|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface represents one portlet on a page (-region).
Based on the currently requested page, the portal determines the portlets that need to be rendered. Before calling the portlet container for each of them, the layout strategy has a chance to change some of the behavior. The PortletContext is the way for the portal to communicate the state of an individual portlet to the layout strategy.
LayoutStrategy
,
StrategyContext
Method Summary | |
int |
getOrder()
Get the order of the portlet in its region. |
Mode |
getPortletMode()
Get the current portlet mode of this portlet instance. |
java.lang.String |
getRegionName()
Get name of the page region this portlet is assigned to. |
java.util.Set |
getSupportedPortletModes(MediaType contentType)
Get a set of modes that this portlet supports. |
java.util.Set |
getSupportedWindowStates()
Get the set of window states allowed by this portlet. |
WindowContext |
getWindowContext()
Get the window context of this portlet on the currently requested page. |
java.lang.String |
getWindowID()
Get a handle to the portlet window for this portlet context. |
WindowState |
getWindowState()
Get the current portlet window state of this portlet instance. |
boolean |
isModeSupported(Mode mode,
MediaType mediaType)
Check if the provided mode is valid for the media type (content type) presented. |
boolean |
isSupportedWindowState(WindowState windowState)
Check if the provided WindowState is allowed for this portlet. |
void |
setOrder(int order)
Set the sort order of this portlet in its region. |
void |
setRegionName(java.lang.String regionName)
Assign the portlet to a different region of the page. |
Method Detail |
public java.lang.String getWindowID()
public WindowContext getWindowContext()
The window context is a state holder to get access to the portlet's position on the page.
public WindowState getWindowState() throws ThemeException
ThemeException
- if the current navigational state is unknownWindowState
public java.util.Set getSupportedWindowStates() throws ThemeException
ThemeException
- if the state provider is unknownpublic boolean isSupportedWindowState(WindowState windowState) throws ThemeException
windowState
- the window state to check against the allowed ones
ThemeException
- if the state provider is unknown
java.lang.IllegalArgumentException
- if the window state is nullpublic Mode getPortletMode() throws ThemeException
ThemeException
- if the current navigational state is unknownpublic java.util.Set getSupportedPortletModes(MediaType contentType) throws ThemeException
Portlet modes are defined per content type.
contentType
- the content type for which to look for the supported modes.
ThemeException
- if the mode provider is unknownpublic boolean isModeSupported(Mode mode, MediaType mediaType) throws ThemeException
Note: you can also check if the portal supports this mode via the strategy context
mode
- the mode to checkmediaType
- the content type to check the mode for
ThemeException
- if the mode provider is unknownStrategyContext.isPortalSupportedPortletMode(Mode)
public java.lang.String getRegionName()
public void setRegionName(java.lang.String regionName)
In order to assign this portlet to another region, the region must be one of the available regions of the current page. The change will not be persisted outside the current request.
regionName
- the name of the region to re-assign the portlet toStrategyContext.getRegions()
public int getOrder()
public void setOrder(int order)
Note: this change is only valid for the current request, and will not be persisted
order
- the sort order to assign to this portlet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |