|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PortletModel
This interface provides access to the model for the different levels of portlet configuration. The resulting model is scoped to a particular request and user context and contains only those resources that are visible in that context.
It expresses the linking between the different portlet-related resources; for example, to find the correct portlet entity for a portlet window in the scope of the current request (user), the appropriate portlet model for the current request must be queried.
In the current portal version, all instances of PortletDefinition
,
Portlet
and WebApplication
are global, therefore the objects
of these types that are returned by this model must be instances that are
available through the global AdminPortletModel
.
Only objects returned from this API may be passed as arguments to the methods.
Method Summary | |
---|---|
PortletEntity |
getParentPortletEntity(PortletEntity entity)
Returns the parent portlet entity that provides defaults for preferences. |
Portlet |
getPortlet(PortletDefinition portletDefinition)
Return the portlet that represents the deployed code unit for the given portlet definition. |
PortletDefinition |
getPortletDefinition(PortletEntity entity)
Return the portlet definition that defines administrative settings for the portlet configuration represented by this entity |
PortletDefinition |
getPortletDefinition(PortletWindow window)
Return the portlet definition that defines administrative settings for the portlet shown in the given window. |
PortletEntity |
getPortletEntity(PortletWindow window)
Return a portlet entity that defines preferences for this portlet in the context of the scope of this portlet model. |
PortletWindow |
getPortletWindow(LayoutControl control)
Return the portlet window that is associated with the given layout control. |
PortletPreferences<java.util.Map.Entry<java.lang.String,java.lang.String>> |
getPreferencesHierarchy(PortletDefinition definition)
Return an aggregated view of the preference layers associated with the given portlet definition. |
PortletPreferences<java.util.Map.Entry<java.lang.String,java.lang.String>> |
getPreferencesHierarchy(PortletEntity entity)
Return an aggregated view of the preference layers associated with the given portlet entity. |
WebApplication |
getWebApplication(Portlet portlet)
Returns the web application that represents the deployment unit for the given portlet |
Method Detail |
---|
PortletWindow getPortletWindow(LayoutControl control) throws ModelException
control
- the layout control that defines the spot in the portal page where
the requested portlet window is displayed.
PortletWindow
or null
.
ModelException
- in case the portlet window cannot be obtainedPortletModelProvider.getPortletModel(com.ibm.portal.content.ContentPage, javax.servlet.ServletRequest, javax.servlet.ServletResponse)
PortletEntity getPortletEntity(PortletWindow window) throws ModelException
PortletEntity
; never returns null
.
ModelException
- in case the portlet entity cannot be obtainedPortletEntity getParentPortletEntity(PortletEntity entity) throws ModelException
null
, if no parent portlet entity exists.
Portlet entities can form a hierarchy where a parent portlet entity provides default values for those preferences that are not explicitly set or overridden on a child portlet entity. In the current portal version, the hierarchy of portlet entities can be at most two levels deep: a portlet entity either has no parent or it is a personalized portlet entity for a particular user and its parent is a shared portlet entity that itself has no parent.
For JSR portlets that do not operate in a special compatibility mode, preferences that are set in EDIT or VIEW mode are stored in a personalized portlet entity, while preferences that are set in EDIT_DEFAULTS mode are stored in a shared portlet entity.
entity
- entity for which the parent is requested
PortletEntity
or null
.
ModelException
- in case the portlet entity exists but cannot be obtainedPortletDefinition getPortletDefinition(PortletWindow window) throws ModelException
This method is more efficient but returns the same portlet definition as
getPorletDefinition(getPortletEntity(window))
PortletDefinition
; never returns null
ModelException
- in case the portlet definition cannot be obtainedPortletDefinition getPortletDefinition(PortletEntity entity) throws ModelException
PortletDefinition
; never returns null
ModelException
- in case the portlet definition cannot be obtainedPortlet getPortlet(PortletDefinition portletDefinition) throws ModelException
Portlet
; never returns null
.
ModelException
- in case the portlet cannot be obtainedWebApplication getWebApplication(Portlet portlet) throws ModelException
ModelException
- in case the web application cannot be obtainedPortletPreferences<java.util.Map.Entry<java.lang.String,java.lang.String>> getPreferencesHierarchy(PortletEntity entity) throws ModelException
PortletPreferences
ModelException
- in case the hierarchy cannot be obtainedPortletPreferences<java.util.Map.Entry<java.lang.String,java.lang.String>> getPreferencesHierarchy(PortletDefinition definition) throws ModelException
PortletPreferences
ModelException
- in case the hierarhy cannot be obtained
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |