|
|||||||||||
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.Resource
com.arsdigita.portal.Portlet
A Portlet is a domain class that provides a window or channel into
a content source
( such as a web application, content item, remote content site). The
portlet is added, usually along with other portlets, to a Portal
which provides a way for multiple sources of content to be agregated
on one web page view.
The database object which backs a Portlet contains a sortkey and a cell
number which are used by the containing Portal
to determine
where on the Portal page the Portlet should appear. The Portlet's
database object also includes a 'Profile' field. This field may be used
by implementors to set a value for a recommended width for a particular
portlet.
The contents of a Portlet are rendered via a PortletRenderer
.
The Portlet class was designed to be extended for custom implementations.
Field Summary | |
static String |
BASE_DATA_OBJECT_TYPE
|
static String |
versionId
|
Fields inherited from class com.arsdigita.kernel.Resource |
CHILD_RESOURCE, DESCRIPTION, PARENT_RESOURCE, RESOURCE_TYPE, TIMESTAMP, TITLE |
Fields inherited from class com.arsdigita.kernel.ACSObject |
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE |
Constructor Summary | |
protected |
Portlet(DataObject dataObject)
|
|
Portlet(OID oid)
|
Method Summary | |
void |
afterSave()
|
void |
beforeSave()
|
static Portlet |
createPortlet(PortletType portletType,
Resource parent)
|
static Portlet |
createPortlet(String portletObjectType,
Resource parent)
|
protected AbstractPortletRenderer |
doGetPortletRenderer()
Get the portlet renderer for this portlet. |
protected String |
getBaseDataObjectType()
Returns the base data object type for this domain object class. |
int |
getCellNumber()
|
protected ACSObject |
getContainer()
Returns the container for this object, or null if there is no container. |
Portal |
getPortal()
|
PortletRenderer |
getPortletRenderer()
|
PortletType |
getPortletType()
|
String |
getProfile()
|
int |
getSortKey()
|
protected boolean |
isContainerModified()
Returns true if this object has been moved to a new container, or null if the container has not changed. |
protected long |
newExpirationDate()
Deprecated. |
static Portlet |
retrievePortlet(BigDecimal id)
Retrieve a portlet given its portlet ID. |
static Portlet |
retrievePortlet(DataObject dataObject)
Retrieve a portlet given its data object. |
static Portlet |
retrievePortlet(OID oid)
Retrieve a portlet given its OID. |
void |
setCellNumber(int cellNumber)
|
void |
setPortal(Portal portal)
|
void |
setPortletType(PortletType portletType)
|
void |
setSortKey(int sortKey)
|
Methods inherited from class com.arsdigita.kernel.Resource |
createResource, createResource, getChildResources, getContainingResource, getDescription, getDisplayName, getParentResource, getResourceType, getTimestamp, getTitle, retrieveAllResources, retrieveResource, retrieveResource, retrieveResource, setDescription, setParentResource, setResourceType, setTitle |
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 |
public static final String versionId
public static final String BASE_DATA_OBJECT_TYPE
Constructor Detail |
protected Portlet(DataObject dataObject)
public Portlet(OID oid) throws DataObjectNotFoundException
Method Detail |
protected String getBaseDataObjectType()
DomainObject
getBaseDataObjectType
in class Resource
public static Portlet createPortlet(PortletType portletType, Resource parent)
public static Portlet createPortlet(String portletObjectType, Resource parent)
public void beforeSave()
beforeSave
in class Resource
public void afterSave()
afterSave
in class Resource
public static Portlet retrievePortlet(BigDecimal id)
public static Portlet retrievePortlet(OID oid)
public static Portlet retrievePortlet(DataObject dataObject)
public String getProfile()
public void setPortal(Portal portal)
public Portal getPortal()
public void setPortletType(PortletType portletType)
public PortletType getPortletType()
public PortletRenderer getPortletRenderer()
protected AbstractPortletRenderer doGetPortletRenderer()
getPortletRenderer()
uses this method to return a renderer to
DefaultPortalModel
. Subclasses of Portlet must override
this method and must not call super()
. The base
implementation simply throws an IllegalArgumentException.
getPortletRenderer()
protected long newExpirationDate()
DefaultPortalModel
uses this method to implement TTL-based
cacheing of portlet domain object data. The implementation
provided here is the current time plus five minutes.
protected 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 Resource
protected boolean isContainerModified()
ACSObject
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().
isContainerModified
in class Resource
public void setCellNumber(int cellNumber)
public int getCellNumber()
public void setSortKey(int sortKey)
public int getSortKey()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |