|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.portal.provider.v2.personalize.PortletPersonalizationManager
public abstract class PortletPersonalizationManager
The PortletPersonalizationManager manages customization data for a portlet.
Each customization must be created before it can be read/written. The
create(PortletReference, ProviderUser)
method establishes a new
entry and populates it with default values. An alternative
create(PortletReference, PersonalizationObject, ProviderUser)
method is defined to allow clients to create a new instance with specific
values.
Once created, customization attributes can be read from the persistent store
using the read(PortletReference, ProviderUser)
method, modified by
updating the attributes of the PersonalizationObject
and saved again
using the write(PortletReference, PersonalizationObject,
ProviderUser)
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. When reading a customization
the read() method should start with the most specific reference specified
by the PortletReference and work back towards the least specific until it
finds a match for the portlet instance.
If a match is not found at all, the Personalization Manager can throw a
PortletNotFoundException or create a default customization using the default
values. Under normal circumstances, a call to read() should always locate at
least the default customization. Failure to do so indicates that data has
been lost or the portlet instance was not registered correctly when it was
added to the page.
Constructor Summary | |
---|---|
PortletPersonalizationManager()
|
Method Summary | |
---|---|
abstract void |
copy(PortletReference from,
PortletReference to,
ProviderUser user)
Copies the instance customizations from one reference to another. |
abstract void |
create(PortletReference ref,
PersonalizationObject o,
ProviderUser user)
Creates the initial personalization reference for this (new) PortletReference. |
abstract void |
create(PortletReference ref,
ProviderUser user)
Creates the initial personalization reference for this (new) PortletReference and establishes its (static) defaults. |
abstract void |
destroy(PortletReference ref,
ProviderUser user)
Destroys a given Portlet instance from the repository by reference. |
abstract void |
destroy(ProviderInstance provider,
PortletDefinition p)
Called to allow the Portlet Personalization manager to destroy its repository. |
abstract boolean |
exists(PortletReference ref,
ProviderUser user)
Returns true is a customization exists for this given reference. |
java.lang.Class |
getDataClass()
Gets the class name of the data objects this instance manages. |
abstract void |
init(PortletDefinition p)
Called to allow this PortletPersonalizationManager to initialize its repository. |
abstract PersonalizationObject |
read(PortletReference ref,
ProviderUser user)
Returns an object containing the customizations particular to this reference. |
void |
setDataClass(java.lang.String className)
Sets the class name of the data objects this instance manages. |
void |
validate(java.lang.String context,
ValidationError errors)
Validates the internal state of this PortletPersonalizationManager instance. |
abstract void |
write(PortletReference ref,
PersonalizationObject o,
ProviderUser user)
Updates this references customizations. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PortletPersonalizationManager()
Method Detail |
---|
public final void setDataClass(java.lang.String className) throws PersonalizationException
PersonalizationObject
interface.
The framework provides an implementation of this interface calle
NameValuePersonalizationObject
.
className
- the class name for that class that represents the data
to be managed.
PersonalizationException
public final java.lang.Class getDataClass()
public abstract void init(PortletDefinition 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 abstract void destroy(ProviderInstance provider, PortletDefinition p) throws AccessControlException, java.io.IOException
provider
- the provider instance that is being deregistered.p
- the portlet this PortletPersonalizationManager is controlling.
From the Portlet you can get the Provider to identify the specific
instance going away.
AccessControlException
java.io.IOException
public abstract 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.
PortletAlreadyExistsException
AccessControlException
java.io.IOException
public abstract void create(PortletReference ref, PersonalizationObject 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.
PortletAlreadyExistsException
AccessControlException
java.io.IOException
public abstract boolean exists(PortletReference ref, ProviderUser user) throws AccessControlException, java.io.IOException
ref
- the portlet instance to checkuser
- the user making this request -- passed to give the manager access
the the session.
AccessControlException
java.io.IOException
public abstract PersonalizationObject 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.
PortletNotFoundException
AccessControlException
java.io.IOException
public abstract void write(PortletReference ref, PersonalizationObject 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.
java.io.IOException
PortletNotFoundException
AccessControlException
public abstract 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.
PortletNotFoundException
AccessControlException
java.io.IOException
public abstract 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.
PortletNotFoundException
AccessControlException
java.io.IOException
public void validate(java.lang.String context, ValidationError errors)
PortletPersonalizationManager
instance. Errors found are
reported using the supplied ValidationError
instance.
validate
in interface Validateable
context
- The context of the calling instance.errors
- The current list of errors.
|
Oracle Fusion Middleware Java API Reference for Oracle PDK Java 11g Release 1 (11.1.1) E10691-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |