|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.domain.DomainObject
com.arsdigita.domain.ObservableDomainObject
com.arsdigita.kernel.ACSObject
com.arsdigita.kernel.PackageInstance
Represents an object that corresponds to a package type. A package instance can have its own content, presentation, and parameters associated with it.
PackageType
Field Summary | |
static String |
BASE_DATA_OBJECT_TYPE
|
static String |
versionId
|
Fields inherited from class com.arsdigita.kernel.ACSObject |
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE |
Constructor Summary | |
protected |
PackageInstance()
Constructs a new PackageInstance with no values set. |
|
PackageInstance(BigDecimal id)
Retrieves the PackageInstance domain object with the specified ID. |
|
PackageInstance(DataObject dataObject)
Constructs a PackageInstance domain object from a package instance data object. |
|
PackageInstance(OID oid)
Retrieves the PackageInstance domain object with the specified OID. |
protected |
PackageInstance(String objectType)
Constructs a new PackageInstance with no values set. |
Method Summary | |
void |
delete()
Deletes this object. |
protected String |
getBaseDataObjectType()
Returns the base data object type for this domain object class. |
protected ACSObject |
getContainer()
Returns the container for this object, or null if there is no container. |
SiteNode |
getDefaultMountPoint()
Returns the first site node on which this package instance is mounted. |
String |
getDisplayName()
Returns a display name for this package instance. |
String |
getKey()
Gets the name of this package. |
Locale |
getLocale()
Returns the locale that is associated with this PackageInstance. |
SiteNodeCollection |
getMountPoints()
Gets all the site nodes where this instance is mounted. |
String |
getName()
Gets the package name. |
String |
getPackageKey()
Deprecated. |
PackageType |
getPackageType()
Deprecated. use getType() instead |
String |
getParameter(String v)
|
int |
getParameter(String v,
int x)
|
String |
getParameter(String v,
String y)
|
String |
getTargetBundle()
The name of a resource bundle, suitable for passing as the first parameter to ResourceBundle.getBundle(String, Locale). |
PackageType |
getType()
|
void |
setKey(String key)
Sets the package key. |
void |
setLocale(Locale locale)
Sets the locale to be associated with this PackageInstance. |
void |
setName(String prettyName)
|
protected void |
setType(PackageType type)
|
Methods inherited from class com.arsdigita.kernel.ACSObject |
assertPrivilege, beforeSave, checkPrivilege, doCreateCheck, doWriteCheck, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, isContainerModified, setID, setID |
Methods inherited from class com.arsdigita.domain.ObservableDomainObject |
addObserver, getObservers |
Methods inherited from class com.arsdigita.domain.DomainObject |
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String versionId
public static final String BASE_DATA_OBJECT_TYPE
Constructor Detail |
protected PackageInstance(String objectType)
PackageType.createInstance
to create
a new instance, or PackageInstance(OID oid)
to retrieve an existing one.This is for use only by subclasses of PackageInstance.
objectType
- The object type which the instance will be created
as.DomainObject.DomainObject(String)
,
PackageType.createInstance(java.lang.String)
,
PackageInstance(OID)
protected PackageInstance()
PackageType.createInstance
to create
a new instance, or PackageInstance(OID oid)
to retrieve an existing one.
DomainObject.DomainObject(String)
,
PackageType.createInstance(java.lang.String)
,
PackageInstance(OID)
public PackageInstance(DataObject dataObject)
dataObject
- a PackageInstance data objectpublic PackageInstance(BigDecimal id) throws DataObjectNotFoundException
id
- the primary key of the package instance
DataObjectNotFoundException
- if the id does not
correspond to an existing package instance.public PackageInstance(OID oid) throws DataObjectNotFoundException
oid
- the objectID of the package instance
DataObjectNotFoundException
- If the OID does not
correspond to an existing package instance.Method Detail |
protected String getBaseDataObjectType()
DomainObject
getBaseDataObjectType
in class ACSObject
public PackageType getType()
protected void setType(PackageType type)
public SiteNode getDefaultMountPoint()
public PackageType getPackageType()
getType()
public String getPackageKey()
public String getKey()
public void setKey(String key)
key
- the key for this packagepublic String getName()
public String getDisplayName()
getDisplayName
in class ACSObject
ACSObject.getDisplayName()
public void setName(String prettyName)
public String getParameter(String v)
public String getParameter(String v, String y)
public int getParameter(String v, int x)
public String getTargetBundle()
The name of a resource bundle, suitable for passing as the first parameter to ResourceBundle.getBundle(String, Locale). Should be a fully qualified Java resource name.
TODO: For now we calculate the name based on the name of the Dispatcher for this package, using a hardcoded algorithm. Specifically, we replace "Dispatcher" with "Resources" (the corresponding bundle name for "MyDispatcher" would be "MyResources"). Eventually, we will do away with this algorithm and replace it with another attribute of a Package.
public SiteNodeCollection getMountPoints()
public Locale getLocale()
Returns the locale that is associated with this PackageInstance.
public void setLocale(Locale locale)
Sets the locale to be associated with this PackageInstance.
locale
- java.util.Localeprotected ACSObject getContainer()
ACSObject
com.arsdigita.persistence.metadata.Property.isComposite()==true
),
then we fetch the value of the composite role property, pass it to the
DomainObjectFactory, and return the resulting domain object. If
no composite role property is found, then the return value is null.
Subclasses should provide their own implementations if the metadata
driven default implementation is inadequate. For example, in a
File Storage application, a "Folder" domain class could provide an
implementationof getContainer() that returns the parent folder (if
it exists) OR the package instance (if the folder is the root folder
of one File Storage application instance).
getContainer
in class ACSObject
public void delete()
DomainObject
delete
in class DomainObject
DataObject.delete()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |