|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--oracle.portal.provider.v1.FilePersonalizationManager
The FilePersonalizationManager implements a PortletPersonalizationManager
using data objects to persist customized data to/from the filesystem. The
class of the data objects managed by a particular instance of the
FilePersonalizationManager is registered using setDataClass(String). Most commonly this will be specified in the
provider.xml file
(e.g. <dataClass>className</dataClass>). If your
data class implements the PersonalizationObject interface (recommended), it
will be responsible for reading and writing its own content through its
read() and write() methods. Otherwise, it is assumed that the data class
implements the Serializable interface, and can therefore be
saved and restored through Java serialization.
The persisted data is maintained in the filesystem; one data file per user
customization. The root directory for this repository should be registered
using setRootDirectory(String). Again, this will most commonly be
achieved through an entry in the provider.xml file
(e.g. <rootDirectory>path</rootDirectory>). If
this directory is not set explicitly, however, the corresponding servlet's
application root, specified via the "provider_root" initArg, will be
used.
The customization data files for each portlet instance are maintained in subdirectories of this root, with a path of the form "providerId/portletId/portletInstance". Each customization data file has a filename of the form "userName.dat", where userName corresponds to the user for which the customization has been made (or "_default.dat" for the default user).
If the 'path hashing' feature has been activated (i.e. setUseHashing(String) has been called with a "true" value or
<useHashing>true</useHashing> has been specified in
provider.xml), then each customization data file for a particular portlet
instance is stored in a subdirectory of the instance directory determined by
'hashing' the data file name. This can improve filesystem performance by
limiting the number of customization data files stored in a single
directory.
| Constructor Summary | |
FilePersonalizationManager()
Null Constructor |
|
| 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 if a customization exists for this given reference. |
void |
init(Portlet p)
Initializes the repository for this FilePersonalizationManager. |
void |
initInstance(Portlet p)
Initializes a new FilePersonalizationManager instance. |
java.lang.Object |
read(PortletReference ref,
ProviderUser user)
Returns a data 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 |
setRootDirectory(java.lang.String root)
Sets the path to the filesystem directory under which this provider's personalization data will be stored. |
void |
setUseHashing(boolean useHashing)
Activate or deactivate the 'path hashing' feature for this FilePersonalizationManager. |
void |
setUseHashing(java.lang.String useHashing)
Activate or deactivate the 'path hashing' feature for this FilePersonalizationManager. |
void |
write(PortletReference ref,
java.lang.Object o,
ProviderUser user)
Updates this reference's customization using the passed data object. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public FilePersonalizationManager()
| Method Detail |
public void setDataClass(java.lang.String className)
throws PersonalizationException
PersonalizationObject or
Serializable. It is recommended that your data object
subclass NameValuePersonalizationObject.className - the class name for that class that represents the data
to be managed.public void setRootDirectory(java.lang.String root)
path - physical path to serve as the root directory for the
personalization data repository.public void setUseHashing(boolean useHashing)
useHashing - boolean indicating whether the 'path hashing' feature
should be used when determining the filesystem path in which to store a
customization data file for a particular portlet instance. If false,
then all customization data files for a particular portlet instance
will be stored in a single directory corresponding to that portlet
instance. If true, then an extra level of directories below the portlet
instance directory, with names derived by a hash function of the
customization data file name, will be used in order to limit the number
of customization data files stored in a single directory.public void setUseHashing(java.lang.String useHashing)
useHashing - String representation of boolean ("true" or "false")
indicating whether the 'path hashing' feature should be used when
determining the filesystem path in which to store a customization data
file for a particular portlet instance.setUseHashing(boolean)public void initInstance(Portlet p)
init() method). Currently, the method defaults
the root directory for the FilePersonalizationManager's personalization
data to the provider's repository path.p - the portlet this FilePersonalizationManager 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.The FilePersonalizationManager currently does nothing in response to this call.
p - the portlet this FilePersonalizationManager is controlling.
public void destroy(Portlet p)
throws AccessControlException,
java.io.IOException
In response to this call, the FilePersonalizationManager removes all data files from the filesytem that pertain to this Portlet.
p - the portlet this PortletPersonalizationManager is controlling.
public void create(PortletReference ref,
ProviderUser user)
throws java.io.IOException,
PortletAlreadyExistsException,
AccessControlException
In response to this call, the FilePersonalizationManager creates a new
instance of the data object class that is registered to it, and calls
its init() method if the class implements
PersonalizationObject or CustomizationObject. Finally, the new instance
is saved to the filesystem, ensuring the initial data persists.
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
In response to this call, the FilePersonalizationManager saves the passed object to the filesystem, ensuring the initial data persists.
ref - the PortletReference. The details of the PortletReference
determine whether this creates the default, system instance or a specific
user instance.o - the Object representing the initial values for this instance
(should implement PersonalizationObject or Serializable).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 reference 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.setDataClass) containing the customizations particular to
this reference
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 data object containing the new values (should implement
PersonalizationObject or Serializable).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 instance we are copying from.to - reference for the portlet instance 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 | ||||||||