|
|||||||||||
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
An ACSObject is a generic object that can be handled by any of a
number of Core services e.g., versioning, permissions. Subclass
ACSObject if you need any of these services.
ACSObject contains a DataObject
with an
ObjectType
of "ACSObject
" or any subtype
of it. The persistence storage mechanism guarantees that all
DataObject
s that are of type "ACSObject
"
can be uniquely identified from each other by a single
identifier. Thus any instances of this class can be uniquely
identified by a single identifier, which is currently found in this
object's OID
.
Field Summary | |
static String |
BASE_DATA_OBJECT_TYPE
|
protected static String |
CONTAINER
The denormalized container. |
static String |
DEFAULT_DOMAIN_CLASS
The default domain class name. |
static String |
DISPLAY_NAME
The denormalized display name. |
static String |
ID
The BigDecimal ID. |
static String |
OBJECT_TYPE
The object type. |
static String |
versionId
|
Constructor Summary | |
ACSObject()
Default constructor. |
|
ACSObject(DataObject acsObjectData)
|
|
ACSObject(ObjectType type)
Constructor in which the contained DataObject is
initialized with a new DataObject with an
ObjectType specified by type. |
|
ACSObject(OID oid)
Constructor in which the contained DataObject is retrieved
from the persistent storage mechanism using the
specified OID. |
|
ACSObject(String typeName)
Constructor in which the contained DataObject is
initialized with a new DataObject with an
ObjectType specified by the string
typeName. |
Method Summary | |
void |
assertPrivilege(PrivilegeDescriptor priv)
Asserts that the current user has the specified privilege on this object. |
protected void |
beforeSave()
|
boolean |
checkPrivilege(PrivilegeDescriptor priv)
Check that the current user has the specified privilege on this object. |
void |
doCreateCheck()
This method is called by the PermissionsObserver when an object is created. |
void |
doWriteCheck()
|
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. |
String |
getDefaultDomainClass()
Gets the name of the domain class for this object |
String |
getDisplayName()
Returns a display name for this object. |
BigDecimal |
getID()
Gets the value of the ID property. |
String |
getSpecificObjectType()
Gets the value of the "objectType" property, which is the fully qualified name of the data object type that this domain object had when it was first created. |
OID |
getSpecificOID()
Gets the specific OID for this ACSObject, which is the tuple of the 'objectType' & 'id' properties. |
ACSObject |
gimmeContainer()
Deprecated. |
protected void |
initialize()
Called from base class (DomainObject) constructors. |
protected boolean |
isContainerModified()
Returns true if this object has been moved to a new container, or null if the container has not changed. |
BigDecimal |
setID()
Deprecated. No longer has any effect on the id. Will always return getID() |
BigDecimal |
setID(BigDecimal id)
Deprecated. No longer has any effect on the id. Will always return getID() |
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, delete, 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
public static final String ID
public static final String OBJECT_TYPE
public static final String DEFAULT_DOMAIN_CLASS
ACSObjectInstantiator
,
Constant Field Valuespublic static final String DISPLAY_NAME
protected static final String CONTAINER
Constructor Detail |
public ACSObject(DataObject acsObjectData)
public ACSObject()
DataObject
is
initialized with a new DataObject
with an
ObjectType
of "ACSObject".
ObservableDomainObject.ObservableDomainObject(String)
,
ObjectType
public ACSObject(String typeName)
DataObject
is
initialized with a new DataObject
with an
ObjectType
specified by the string
typeName.
typeName
- the name of the ObjectType
of the
contained DataObject
ObservableDomainObject.ObservableDomainObject(String)
,
DataObject
,
ObjectType
public ACSObject(ObjectType type)
DataObject
is
initialized with a new DataObject
with an
ObjectType
specified by type.
type
- the ObjectType
of the contained
DataObject
ObservableDomainObject.ObservableDomainObject(ObjectType)
,
DataObject
,
ObjectType
public ACSObject(OID oid) throws DataObjectNotFoundException
DataObject
is retrieved
from the persistent storage mechanism using the
specified OID.
oid
- the OID for the retrieved
DataObject
ObservableDomainObject.ObservableDomainObject(OID)
,
DataObject
,
OID
Method Detail |
protected String getBaseDataObjectType()
DomainObject
getBaseDataObjectType
in class DomainObject
protected void initialize()
initialize
in class DomainObject
public BigDecimal getID()
public BigDecimal setID(BigDecimal id)
id
- the value to try to set the ID property to
public BigDecimal setID() throws PersistenceException
com.arsdigita.db.Sequences.getNextValue()
only if the ID property is not already set.
Returns the value that the ID is set to after execution.
PersistenceException
- if a unique id could not
be generated.public String getDisplayName()
protected ACSObject getContainer()
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).
protected boolean isContainerModified()
com.arsdigita.persistence.metadata.Property.isComposite()==true
),
then we check whether the composite role property has been modified.
If no composite role is found, then the return value is false.
Subclasses should provide their own implementations if the metadata
driven default implementation is inadequate. See the example
mentioned in getContainer().
getContainer()
public ACSObject gimmeContainer()
getContainer()
.
public String getSpecificObjectType()
public OID getSpecificOID()
public String getDefaultDomainClass()
public final void assertPrivilege(PrivilegeDescriptor priv)
PermissionException
- if the user does not have the privilegepublic final boolean checkPrivilege(PrivilegeDescriptor priv)
public void doCreateCheck()
public void doWriteCheck()
protected void beforeSave()
beforeSave
in class DomainObject
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |