|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
The PortletPersonalizationManager manages a portlets customizations. Each customization must be created before it can be read/written. create() establishes a new entry and fills it with default values. An alternative create() method is defined to allow clients to create a new instance with specific values.
Once created, customization attributes are controlled by reading them using
the read() method, updating the attributes on customization object,
and then writing them back using the write() method.
A customization is identified by its PortletReference. This reference may refer to a specific user instance or the default instance (see PortletReference for details). Unfortunately, the portal doesn't have knowledge of a specific user instance. It merely understands that a (single) portlet instance exists on a given page. The portal therefore leaves this determination up to the provider. Except when the operation is explicitly constrained to the default portlet instance, the JPDK always generates the deepest PortletReference. I.e. a reference to the per user customization. This interface dictates it throws a PortletNotFoundException in the case where this per user customization doesn't exist. Clients must be prepared to check for this situation and implement their own recovery rules. This includes retying the operation using a self-generated PortletReference to the default portlet.
| Method Summary | |
void |
copy(PortletReference from,
PortletReference to,
ProviderUser user)
Copies the instance customizations from one reference to another. |
void |
create(PortletReference ref,
java.lang.Object o,
ProviderUser user)
Creates the initial personalization reference for this (new) PortletReference. |
void |
create(PortletReference ref,
ProviderUser user)
Creates the initial personalization reference for this (new) PortletReference and establishes its (static) defaults. |
void |
destroy(Portlet p)
Called to allow the Portlet Personalization manager to destroy its repository. |
void |
destroy(PortletReference ref,
ProviderUser user)
Destroys a given Portlet instance from the repository by reference. |
boolean |
exists(PortletReference ref,
ProviderUser user)
Returns true is a customization exists for this given reference. |
void |
init(Portlet p)
Called to allow this PortletPersonalizationManager to initialize its repository. |
void |
initInstance(Portlet p)
Initializes a new PortletPersonalizationManager instance. |
java.lang.Object |
read(PortletReference ref,
ProviderUser user)
Returns an object containing the customizations particular to this reference. |
void |
write(PortletReference ref,
java.lang.Object o,
ProviderUser user)
Updates this references customizations. |
| Method Detail |
public void initInstance(Portlet p)
init() method).p - the portlet this PortletPersonalizationManager is controlling.public void init(Portlet p)
register() method is
called). This gives the personalization manager an opportunity to
initialize the repository for the corresponding Portlet.p - the portlet this PortletPersonalizationManager is controlling.
From the Portlet you can get the Provider to identify the specific instance
being created.
public void destroy(Portlet p)
throws AccessControlException,
java.io.IOException
p - the portlet this PortletPersonalizationManager is controlling.
From the Portlet you can get the Provider to identify the specific instance
going away.
public void create(PortletReference ref,
ProviderUser user)
throws PortletAlreadyExistsException,
AccessControlException,
java.io.IOException
ref - the PortletReference. The details of the PortletReference
determine whether this creates the default, system instance or a specific
user instance.user - the user attempting this operation. The manager is expected
to authorize the user before completing this operation.
public void create(PortletReference ref,
java.lang.Object o,
ProviderUser user)
throws PortletAlreadyExistsException,
AccessControlException,
java.io.IOException
ref - the PortletReference. The details of the PortletReference
determine whether this creates the default, system instance or a specific
user instance.o - object containing the customizations. It is expected that the
manager know how to access/control this object to maintain a persistent
store.user - the user attempting this operation. The manager is expected
to authorize the user before completing this operation.
public boolean exists(PortletReference ref,
ProviderUser user)
throws AccessControlException
ref - the portlet instance to check
public java.lang.Object read(PortletReference ref,
ProviderUser user)
throws PortletNotFoundException,
AccessControlException,
java.io.IOException
ref - the portlet referecne that identifies the instance whose
customizations are being requested.user - the user attempting this operation. The manager is expected
to authorize the user before completing this operation.
public void write(PortletReference ref,
java.lang.Object o,
ProviderUser user)
throws java.io.IOException,
PortletNotFoundException,
AccessControlException
ref - the portlet reference that identifies the instance whose
customizations are being updated.o - the object containing the new values.user - the user attempting this operation. The manager is expected
to authorize the user before completing this operation.
public void destroy(PortletReference ref,
ProviderUser user)
throws PortletNotFoundException,
AccessControlException,
java.io.IOException
ref - the portlet reference that identifies the instance whose
customizations are being deleted.user - the user attempting this operation. The manager is expected
to authorize the user before completing this operation.
public void copy(PortletReference from,
PortletReference to,
ProviderUser user)
throws PortletNotFoundException,
AccessControlException,
java.io.IOException
from - reference for the portlet isntance we are copying from.to - reference for the portlet isntance we are copying to.user - the user attempting this operation. The manager is expected
to authorize the user before completing this operation.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||