com.arsdigita.kernel
Class Resource

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.kernel.Resource
Direct Known Subclasses:
Application, Portal, Portlet

public class Resource
extends ACSObject

Author:
Jim Parsons

Field Summary
static String BASE_DATA_OBJECT_TYPE
           
static String CHILD_RESOURCE
           
static String DESCRIPTION
           
static String PARENT_RESOURCE
           
static String RESOURCE_TYPE
           
static String TIMESTAMP
           
static String TITLE
           
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE, versionId
 
Constructor Summary
protected Resource(DataObject dataObject)
           
protected Resource(OID oid)
           
protected Resource(String dataObjectType)
           
 
Method Summary
protected  void afterSave()
           
protected  void beforeSave()
           
static Resource createResource(ResourceType resourceType, String title, Resource parent)
           
static Resource createResource(String resourceObjectType, String title, Resource parent)
           
protected  String getBaseDataObjectType()
          Returns the base data object type for this domain object class.
 ResourceCollection getChildResources()
           
protected  ACSObject getContainer()
          Returns the container for this object, or null if there is no container.
static Resource getContainingResource(ACSObject obj)
           
 String getDescription()
           
 String getDisplayName()
          Returns a display name for this object.
 Resource getParentResource()
           
 ResourceType getResourceType()
           
 Date getTimestamp()
           
 String getTitle()
           
protected  boolean isContainerModified()
          Returns true if this object has been moved to a new container, or null if the container has not changed.
static ResourceCollection retrieveAllResources()
           
static Resource retrieveResource(BigDecimal id)
           
static Resource retrieveResource(DataObject dobj)
           
static Resource retrieveResource(OID oid)
           
 void setDescription(String description)
           
 void setParentResource(Resource resource)
           
protected  void setResourceType(ResourceType resourceType)
           
 void setTitle(String title)
           
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getDefaultDomainClass, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, initialize, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, 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

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
See Also:
Constant Field Values

TITLE

public static final String TITLE
See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
See Also:
Constant Field Values

PARENT_RESOURCE

public static final String PARENT_RESOURCE
See Also:
Constant Field Values

CHILD_RESOURCE

public static final String CHILD_RESOURCE
See Also:
Constant Field Values

RESOURCE_TYPE

public static final String RESOURCE_TYPE
See Also:
Constant Field Values

TIMESTAMP

public static final String TIMESTAMP
See Also:
Constant Field Values
Constructor Detail

Resource

protected Resource(DataObject dataObject)

Resource

protected Resource(String dataObjectType)

Resource

protected Resource(OID oid)
            throws DataObjectNotFoundException
Method Detail

getBaseDataObjectType

protected String getBaseDataObjectType()
Description copied from class: DomainObject
Returns the base data object type for this domain object class. Intended to be overrided by subclasses whenever the subclass will only work if their primary data object is of a certain base type.

Overrides:
getBaseDataObjectType in class ACSObject

createResource

public static Resource createResource(ResourceType resourceType,
                                      String title,
                                      Resource parent)

createResource

public static Resource createResource(String resourceObjectType,
                                      String title,
                                      Resource parent)

beforeSave

protected void beforeSave()
Overrides:
beforeSave in class ACSObject

afterSave

protected void afterSave()
Overrides:
afterSave in class DomainObject

retrieveResource

public static Resource retrieveResource(BigDecimal id)

retrieveResource

public static Resource retrieveResource(OID oid)

retrieveResource

public static Resource retrieveResource(DataObject dobj)

getContainingResource

public static final Resource getContainingResource(ACSObject obj)

getResourceType

public ResourceType getResourceType()

setResourceType

protected void setResourceType(ResourceType resourceType)

getParentResource

public Resource getParentResource()

setParentResource

public void setParentResource(Resource resource)

getChildResources

public ResourceCollection getChildResources()

getTitle

public String getTitle()

setTitle

public void setTitle(String title)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getTimestamp

public Date getTimestamp()

retrieveAllResources

public static ResourceCollection retrieveAllResources()

getDisplayName

public String getDisplayName()
Description copied from class: ACSObject
Returns a display name for this object. The display name is produced by domain-specific logic based on any properties of the domain object. The display name is used internally for efficient access in cursors like ACSObjectCollection. ACSObject.save() takes care of populating the internal data object's displayName property with the result of the getDisplayName method. While this method is not abstract, the default implementation is very useless. All subclasses should provide their own implementations.

Overrides:
getDisplayName in class ACSObject
Returns:
the displayable name for this object.

getContainer

protected ACSObject getContainer()
Description copied from class: ACSObject
Returns the container for this object, or null if there is no container. The container is produced by domain-specific logic based on any properties of the domain object. The resulting container is denormalized internally by ACSObject.save(). The denormalized container hierarchy is currently only used for generically determining what package instance an object belongs to. In the future, other generic services may be introduced that take advantage of the denormalized container hierarchy. While this method is not abstract, the default implementation "guesses" the container based on metadata about the object. If this object's data object type has a composite role property (required, visible property where 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).

Overrides:
getContainer in class ACSObject
Returns:
this object's container.

isContainerModified

protected boolean isContainerModified()
Description copied from class: ACSObject
Returns true if this object has been moved to a new container, or null if the container has not changed. This methods is used by ACSObject.save() to determine when to denormalize the result of getContainer(). While this method is not abstract, the default implementation "guesses" the container based on metadata about the object. If this object's data object type has a composite role property (required, visible property where 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().

Overrides:
isContainerModified in class ACSObject
Returns:
this object's container.
See Also:
ACSObject.getContainer()


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC