Novell exteNd
Director 5.2 API

com.novell.afw.portlet.api
Interface EbiPortletInfoManager


public interface EbiPortletInfoManager

This is the Portlet Information Manager Interface. It provides methods to manage portlet handles and related information. It also provides methods to access/manage preferences at different levels, including registration time preferences, instance preferences, user preferences, and the default preferences defined in the portlet deployment descriptor.

Since:
v5.0
See Also:
EbiPortletPreferenceInfo

Method Summary
 EbiPortletPreferencesDefaultType getDefaultPortletPreferences(String portletHandleOrName)
          Returns the default (read-only) preferences for the portlet definition that the portlet handle is defined by or for the named portlet.
 EbiPortletPreferencesInstanceType getInstancePortletPreferences(EbiContext context, String portletHandle)
          Returns the preferences that are set for a particular instance of a portlet.
 EbiPortletAppModel getPortletAppModel()
          Returns the EbiPortletAppModel, which represents the all the deployment information for the entire portlet application.
 EbiNovellPortletModel getPortletModel(String portletHandleOrName)
          Gets a EbiNovellPortletModel object by a portlet handle or by name.
 Collection getPortletModelList()
          Gets a list of EbiPortletModel objects.
 EbiPortletPreferencesUserType getUserPortletPreferences(EbiContext context, String portletHandle)
          Returns the preference information for the user logged into the context for the portlet identified by the portlet instance handle.
 boolean isValidPortletApp()
          Indicates whether all the application that this manager is running within is a valid portlet application.
 ResourceBundle loadResourceBundle(Locale locale, EbiNovellPortletModel portletModel)
          Attempts to load the bundle for the specified portlet model and locale.
 void storeInstancePortletPreferences(EbiContext context, String portletHandle, EbiPortletPreferencesInstanceType preferences)
          Persists the preferences for a portlet instance.
 void storePortletHandle(EbiContext context, String portletHandle, String portletName, String parentPortletHandle, String consumerID, String preferences)
          Stores information related to a portlet handle in the producer registry.
 void storeUserPortletPreferences(EbiContext context, String portletHandle, EbiPortletPreferencesUserType preferences)
          Persists the preferences for a portlet instance and the current user.
 EbiPortletEntity updatePortletEntity(EbiPortletEntity entity)
          Updates PortletEntity object that is passed in from consumer to fill in portlet name and other related information retrieved from the producer registry.
 

Method Detail

updatePortletEntity

public EbiPortletEntity updatePortletEntity(EbiPortletEntity entity)
                                     throws EboUnrecoverableSystemException
Updates PortletEntity object that is passed in from consumer to fill in portlet name and other related information retrieved from the producer registry. The modified PortletEntity object is then used by the local portlet container for portlet runtime processing.
Parameters:
entity - a PortletEntity object.
Returns:
the modified PortletEntity object.
Since:
v5.0

storePortletHandle

public void storePortletHandle(EbiContext context,
                               String portletHandle,
                               String portletName,
                               String parentPortletHandle,
                               String consumerID,
                               String preferences)
                        throws EboUnrecoverableSystemException
Stores information related to a portlet handle in the producer registry.
Parameters:
context - an EbiContext object.
portletHandle - a portlet handle to be stored.
portletName - a portlet name (defined in the portlet deployment descriptor) that is associated with the portlet handle.
parentPortletHandle - a parent portlet handle that this portlet handle is inherited from.
consumerID - a consumer ID (or WSRP registration handle)
preferences - an XML String for preferences
Since:
v5.0

getPortletModelList

public Collection getPortletModelList()
                               throws EboUnrecoverableSystemException
Gets a list of EbiPortletModel objects.
Returns:
a Collection of EbiPortletModel objects.
Since:
v5.0

getPortletAppModel

public EbiPortletAppModel getPortletAppModel()
                                      throws EboUnrecoverableSystemException
Returns the EbiPortletAppModel, which represents the all the deployment information for the entire portlet application.
Returns:
EbiPortletAppModel object with the current portlet application's model. This will never be null.
Since:
v5.0

getPortletModel

public EbiNovellPortletModel getPortletModel(String portletHandleOrName)
                                      throws EboUnrecoverableSystemException
Gets a EbiNovellPortletModel object by a portlet handle or by name. If a handle is passed in, then it is resolved to the portlet name first, then the model is returned. In the event that the handle/name are invalid null is returned.
Parameters:
portletHandleOrName - a portlet handle or name.
Returns:
a EbiNovellPortletModel object, or null if no valid handle or name specified.
Since:
v5.0

getDefaultPortletPreferences

public EbiPortletPreferencesDefaultType getDefaultPortletPreferences(String portletHandleOrName)
                                                              throws EboUnrecoverableSystemException
Returns the default (read-only) preferences for the portlet definition that the portlet handle is defined by or for the named portlet. These preferences will be the same for all portlet handles that use the same the portlet definition. These are the preferences that have been deployed with the portlet (portlet.xml and optionally novell-portlet.xml), and may be simple standard String preferences as defined by JSR168, or may be more complex preference types based on Novell extensions to the preferences.
Parameters:
portletHandleOrName - The handle to a portlet instance, or the name of a portlet. If the handle is passed in, then it will be resolved to the portlet name first.
Returns:
EbiPortletPreferencesDefaultType populated with the preference objects representing the preferences deployed with the portlet. If the portletHandleOrName is not a valid handle to a portlet instance, or a valid portlet name null will be returned
Throws:
EboUnrecoverableSystemException - thrown if an unrecoverable error occurs. The operation should not be retryed.
Since:
v5.0

getInstancePortletPreferences

public EbiPortletPreferencesInstanceType getInstancePortletPreferences(EbiContext context,
                                                                       String portletHandle)
                                                                throws EboSecurityException,
                                                                       EboUnrecoverableSystemException
Returns the preferences that are set for a particular instance of a portlet. The instance of the portlet is identified by its portletHandle. These preferences returned are allowed to be modified and changes will persist for the instance whoose handle is passed in.
It should be noted that any changes will be stored at the instance level only, and that any values set will override (if allowed) the values set in lower level preference settings.
All users are allowed to read these preference objects.

CAUTIONThis method uses a recursive algorithm to generate composite preferences. If the a portlet instance creates a circular reference with it's parent instance, this method could cause a stack overflow or low memory condition.

Parameters:
context - EbiContext object with user logged into it.
portletHandle - The handle to the instance of a portlet.
Returns:
EbiPortletPreferencesInstanceType populated with the instance level preferences, null if the handle was invalid.
Throws:
EboSecurityException - thrown if the user does not have sufficient privledge to read the instance preferences.
EboUnrecoverableSystemException - thrown if an unrecoverable error occurs. The operation should not be retryed.
Since:
v5.0

storeInstancePortletPreferences

public void storeInstancePortletPreferences(EbiContext context,
                                            String portletHandle,
                                            EbiPortletPreferencesInstanceType preferences)
                                     throws com.novell.afw.portlet.exception.EboPortletPreferenceValidationException,
                                            EboSecurityException,
                                            EboUnrecoverableSystemException,
                                            EboItemExistenceException
Persists the preferences for a portlet instance.
The user must have PROTECT permission to the PortalAdmin element for this operation to succeed or be the owener of the page that the instance of the portlet is on.
Parameters:
context - EbiContext object with user logged into it.
portletHandle - The handle to the instance of a portlet.
preferences - EbiPortletPreferencesInstanceType populated with the instance level preferences.
Throws:
EboPortletPreferenceValidationException - thrown if the values set for one of the preferences is invalid.
EboSecurityException - thrown if the user does not have sufficient privledge (write permission to PortalAdmin element) to update the instance preferences.
EboUnrecoverableSystemException - thrown if an unrecoverable error occurs. The operation should not be retryed.
Since:
v5.0

getUserPortletPreferences

public EbiPortletPreferencesUserType getUserPortletPreferences(EbiContext context,
                                                               String portletHandle)
                                                        throws EboUnrecoverableSystemException,
                                                               EboSecurityException,
                                                               EboItemExistenceException
Returns the preference information for the user logged into the context for the portlet identified by the portlet instance handle.
It should be noted that any changes will be stored at the user level only, and that any values set will override (if allowed) the values set in higher level preference settings.
Parameters:
context - EbiContext with a user logged in.
portletHandle - The handle to a portlet instance.
Returns:
EbiPortletPreferencesInstanceType populated with the user level preferences.
Throws:
EboUnrecoverableSystemException - thrown if an unrecoverable error occurs. The operation should not be retryed.
Since:
v5.0

storeUserPortletPreferences

public void storeUserPortletPreferences(EbiContext context,
                                        String portletHandle,
                                        EbiPortletPreferencesUserType preferences)
                                 throws com.novell.afw.portlet.exception.EboPortletPreferenceValidationException,
                                        EboUnrecoverableSystemException,
                                        EboSecurityException
Persists the preferences for a portlet instance and the current user.
Parameters:
context - EbiContext object with user logged into it.
portletHandle - The handle to the instance of a portlet.
preferences - EbiPortletPreferencesUserType populated with the user level preferences.
Throws:
EboPortletPreferenceValidationException - thrown if the values set for one of the preferences is invalid.
EboUnrecoverableSystemException - thrown if an unrecoverable error occurs. The operation should not be retryed.
Since:
v5.0

isValidPortletApp

public boolean isValidPortletApp()
Indicates whether all the application that this manager is running within is a valid portlet application. If this method returns false, then none of the methods should be called, since they would cause errors or return unreliable results.
Returns:
boolean true if the portlet application is valid (no errors occured during descriptor processing).
Since:
v5.0

loadResourceBundle

public ResourceBundle loadResourceBundle(Locale locale,
                                         EbiNovellPortletModel portletModel)
Attempts to load the bundle for the specified portlet model and locale. If the portletModel's getResourceBundleName() returns null (that is none was defined in the descriptor) then this method will return null.
Parameters:
locale - The locale for which the bundle should be returned
portletModel - the portlet for which to load the bundle.
Returns:
The localized bundle requested, or null if the portlet did not specify a bundle.
Throws:
MissingResourceException - thrown if the reosource bundle specified by the portlet could be found.

Novell exteNd
Director 5.2 API