Class UIPortlet
java.lang.Object
org.exoplatform.webui.core.UIComponent
org.exoplatform.webui.core.UIContainer
org.exoplatform.portal.webui.portal.UIPortalComponent
org.exoplatform.portal.webui.application.UIApplication
org.exoplatform.portal.webui.application.UIPortlet
This UI component represent a portlet window on a page.
Each user request to a portlet will be passed through this class then delegate call to the portlet container
UIPortletLifecycle do the main request router: delegate the job to portlet action listeners according to the url parameters
ProcessAction, ServeResource, Render action listeners will receive event if request url contain parameter point to them, those event will delegate call to portlet container to call JSR 286 portlet lifecycle method
ProcessEvents, ChangePortletMode, ChangeWindowState listener will receive event after the portlet action invocation response. (dispatched during the process of ProcessActionListener)
DeleteComponent, EditPortlet action listener is portal specific listener, come from the UI of portal
Each user request to a portlet will be passed through this class then delegate call to the portlet container
UIPortletLifecycle do the main request router: delegate the job to portlet action listeners according to the url parameters
ProcessAction, ServeResource, Render action listeners will receive event if request url contain parameter point to them, those event will delegate call to portlet container to call JSR 286 portlet lifecycle method
ProcessEvents, ChangePortletMode, ChangeWindowState listener will receive event after the portlet action invocation response. (dispatched during the process of ProcessActionListener)
DeleteComponent, EditPortlet action listener is portal specific listener, come from the UI of portal
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.exoplatform.webui.core.UIContainer
UIContainer.SelectTabActionListener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected static final org.exoplatform.services.log.LogFields inherited from class org.exoplatform.portal.webui.application.UIApplication
appHeight, appStatus, appWidth, locationX, locationY, zIndexFields inherited from class org.exoplatform.portal.webui.portal.UIPortalComponent
factoryId, height, name, template, widthFields inherited from class org.exoplatform.webui.core.UIComponent
AJAX_ASYNC, config, OBJECTID, UICOMPONENT, uiparent, USE_WEBUI_RESOURCES -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<I extends org.gatein.pc.api.invocation.PortletInvocation>
Icreate(Class<I> type, PortalRequestContext prc) Create the correct portlet invocation that will target the portlet represented by this UI component.org.exoplatform.commons.utils.TextgenerateRenderMarkup(org.gatein.pc.api.invocation.response.PortletInvocationResponse pir, WebuiRequestContext context) Parsing response from portlet container.org.exoplatform.portal.pc.ExoPortletStategetClonedState(org.gatein.pc.api.PortletContext clonedContext) Return cloned portlet state (updated after portlet action invocation).javax.portlet.PortletModestatic UIPortletjavax.portlet.WindowStateGet localized displayName metadata configured in portlet.xml.
If can't find localized displayName, return portlet name.
If portlet doesn't exists anymore, return empty string.
This value is cached in session, that means it only query to portlet container one timeReturns the title showed on the InfoBar.getId()org.exoplatform.portal.pc.ExoPortletStategetModifiedState(org.gatein.pc.api.PortletContext modifiedContext) Return modifed portlet stated (after portlet action invovation)org.gatein.pc.api.StatefulPortletContext<org.exoplatform.portal.pc.ExoPortletState> Returns the portlet context of the portlet.portletStyle is 'Window' when it's in WebOS project - an GateIn extension, portletStyle is null if is not in WebOSorg.exoplatform.portal.pom.spi.portlet.PortletReturns the state of the portlet as a set of preferences.org.gatein.pc.api.PortletgetPublicParameters(Map<String, String[]> portletParameters) This methods return the public render parameters names supported by the targeted portlet; in other words, it sorts the full public render params list and only return the ones that the current portlet can handlebooleanRetrieves the skin identifier associated with this portlet ornullif there isn't one (for example, it doesn't make any sense in the WSRP scenario).getState()getSuitedTheme(String skin) Get theme name according to portal skin.getTheme()Theme is composed of map between theme name and skin name.org.gatein.pc.api.invocation.response.PortletInvocationResponseinvoke(org.gatein.pc.api.invocation.PortletInvocation invocation) Performs an invocation on this portlet.booleanvoidputSuitedTheme(String skin, String theme) Add map between portlet theme and portal skinprotected voidsetConfiguredTitle(String _configuredTitle) configuredTitle - the localized title configured in portlet.xml.voidsetCurrentPortletMode(javax.portlet.PortletMode mode) voidsetCurrentWindowState(javax.portlet.WindowState state) voidvoidUsed by portal to show the icon that allow to change portlet modevoidsetState(PortletState state) voidsetStorageId(String storageId) voidsetStorageName(String storageName) voidsetSupportedProcessingEvents(List<QName> supportedProcessingEvents) voidsetSupportedPublicRenderParameters(Map<QName, String> supportedPublicRenderParameters) voidsetSupportModes(List<String> supportModes) voidUsed internally by Portal to change current portlet theme.booleansupportsProcessingEvent(QName name) Tells, according to the info located in portlet.xml, wether this portlet can handle a portlet event with the QName given as the method argumentbooleansupportsPublicParam(String supportedPublicParam) Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter given as a method argumentsupportsPublicParam(QName supportedPublicParam) Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter qname given as method argument.booleansupportsPublishingEvent(QName name) voidupdate(org.exoplatform.portal.pc.ExoPortletState updateState) Update the state of the portlet.voidupdate(org.gatein.pc.api.state.PropertyChange... changes) Methods inherited from class org.exoplatform.portal.webui.application.UIApplication
getDescription, getIcon, getProperties, getShowInfoBar, getShowWindowState, setDescription, setIcon, setProperties, setShowInfoBar, setShowWindowStateMethods inherited from class org.exoplatform.portal.webui.portal.UIPortalComponent
getTemplate, hasAccessPermission, hasPermission, processAction, processDecode, processRenderMethods inherited from class org.exoplatform.webui.core.UIContainer
addChild, addChild, findComponentById, findComponentOfType, findFirstComponentOfType, getChild, getChild, getChildById, getChildren, hasChildren, removeChild, removeChildById, renderChild, renderChild, renderChild, renderChild, renderChildren, renderChildren, renderUIComponent, replaceChild, replaceChild, setChildren, setRenderedChild, setRenderedChild, setRenderedChildrenOfTypesMethods inherited from class org.exoplatform.webui.core.UIComponent
broadcast, buildModelObject, createEvent, createUIComponent, createUIComponent, createUIComponent, doAsync, event, event, event, getAncestorOfType, getApplicationComponent, getComponentConfig, getName, getParent, getTemplateResourceResolver, getUIComponentName, isRendered, loadConfirmMesssage, renderEventURL, setComponentConfig, setComponentConfig, setId, setParent, setRendered, setRenderSibling, url, url, url
-
Field Details
-
LOG
protected static final org.exoplatform.services.log.Log LOG -
DEFAULT_THEME
- See Also:
-
JAVASCRIPT_DEPENDENCY
- See Also:
-
-
Constructor Details
-
UIPortlet
public UIPortlet()
-
-
Method Details
-
getStorageId
-
setStorageId
-
getStorageName
-
setStorageName
-
getWindowId
-
getSkinId
Retrieves the skin identifier associated with this portlet ornullif there isn't one (for example, it doesn't make any sense in the WSRP scenario).- Returns:
- the skin identifier associated with this portlet or
nullif there isn't one
-
getId
- Overrides:
getIdin classUIComponent
-
getApplicationId
-
getPortletStyle
portletStyle is 'Window' when it's in WebOS project - an GateIn extension, portletStyle is null if is not in WebOS- Returns:
- a string represent current portlet style
-
setPortletStyle
-
getShowPortletMode
public boolean getShowPortletMode()- Returns:
- true if portlet is configured to show control icon that allow to change portlet mode
-
setShowPortletMode
Used by portal to show the icon that allow to change portlet mode- Parameters:
b- if show icon
-
getTheme
Theme is composed of map between theme name and skin name. Theme format: {skinName}:{themeName}::{anotherSkin}:{anotherTheme}. For example: the default them is 'Default:DefaultTheme::Vista:VistaTheme::Mac:MacTheme'. Default theme means if portal skin is 'Default', this portlet's theme is 'DefaultTheme. If portal change skin to 'Vista', portlet theme will be change to 'VistaTheme'.- Returns:
- current theme setting
-
setTheme
Used internally by Portal to change current portlet theme. Theme format: {skinName}:{themeName}::{anotherSkin}:{anotherTheme}. For example: 'Default:DefaultTheme::Vista:VistaTheme::Mac:MacTheme' -
getSuitedTheme
Get theme name according to portal skin. If there is no coressponding theme. return 'DefaultTheme'- Parameters:
skin- - portal skin- Returns:
- theme name
-
putSuitedTheme
Add map between portlet theme and portal skin- Parameters:
skin- - portal skin nametheme- - portlet theme name
-
getCurrentPortletMode
public javax.portlet.PortletMode getCurrentPortletMode() -
setCurrentPortletMode
public void setCurrentPortletMode(javax.portlet.PortletMode mode) -
getCurrentWindowState
public javax.portlet.WindowState getCurrentWindowState() -
setCurrentWindowState
public void setCurrentWindowState(javax.portlet.WindowState state) -
getSupportedProcessingEvents
-
setSupportedProcessingEvents
-
getSupportedPublicRenderParameters
-
setSupportedPublicRenderParameters
-
getDisplayName
Get localized displayName metadata configured in portlet.xml.
If can't find localized displayName, return portlet name.
If portlet doesn't exists anymore, return empty string.
This value is cached in session, that means it only query to portlet container one time- Returns:
- display name
-
getProducedOfferedPortlet
public org.gatein.pc.api.Portlet getProducedOfferedPortlet() -
getSupportModes
-
setSupportModes
-
supportsProcessingEvent
Tells, according to the info located in portlet.xml, wether this portlet can handle a portlet event with the QName given as the method argument -
supportsPublishingEvent
-
supportsPublicParam
Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter qname given as method argument. If the qname is supported, the public render parameter id is returned otherwise false is returned.- Parameters:
supportedPublicParam- the supported public parameter qname- Returns:
- the supported public parameter id
-
supportsPublicParam
Tells, according to the info located in portlet.xml, wether this portlet supports the public render parameter given as a method argument -
getPublicRenderParamNames
This methods return the public render parameters names supported by the targeted portlet; in other words, it sorts the full public render params list and only return the ones that the current portlet can handle -
getPublicParameters
-
getPublicParameters
-
create
public <I extends org.gatein.pc.api.invocation.PortletInvocation> I create(Class<I> type, PortalRequestContext prc) throws Exception Create the correct portlet invocation that will target the portlet represented by this UI component.- Type Parameters:
I- the invocation type- Parameters:
type- the invocation typeprc- the portal request context- Returns:
- the portlet invocation
- Throws:
Exception- any exception
-
update
- Throws:
Exception
-
getState
-
setState
-
getPreferences
Returns the state of the portlet as a set of preferences.- Returns:
- the preferences of the portlet
- Throws:
Exception- any exception
-
getPortletContext
public org.gatein.pc.api.StatefulPortletContext<org.exoplatform.portal.pc.ExoPortletState> getPortletContext() throws ExceptionReturns the portlet context of the portlet.- Returns:
- the portlet context
- Throws:
Exception- any exception
-
update
Update the state of the portlet.- Parameters:
updateState- the state update- Throws:
Exception- any exception
-
getModifiedState
public org.exoplatform.portal.pc.ExoPortletState getModifiedState(org.gatein.pc.api.PortletContext modifiedContext) throws Exception Return modifed portlet stated (after portlet action invovation)- Parameters:
modifiedContext-- Throws:
Exception
-
getClonedState
public org.exoplatform.portal.pc.ExoPortletState getClonedState(org.gatein.pc.api.PortletContext clonedContext) throws Exception Return cloned portlet state (updated after portlet action invocation). This method is used in case WSRP- Parameters:
clonedContext-- Throws:
Exception
-
getCurrentUIPortlet
-
invoke
public org.gatein.pc.api.invocation.response.PortletInvocationResponse invoke(org.gatein.pc.api.invocation.PortletInvocation invocation) throws org.gatein.pc.api.PortletInvokerException Performs an invocation on this portlet.- Parameters:
invocation- the portlet invocation- Returns:
- the portlet invocation response
- Throws:
org.gatein.pc.api.PortletInvokerException- any invoker exception
-
setConfiguredTitle
configuredTitle - the localized title configured in portlet.xml. This value returned ans set after portlet container invocation.- Parameters:
_configuredTitle- - portlet title responsed from portlet container
-
getDisplayTitle
Returns the title showed on the InfoBar. The title is computed in following manner.
1. First, the method getTitle(), inherited from UIPortalComponent is called. The getTitle() returns what users set in the PortletSetting tab, the current method returns call result if it is not null.
2. configuredTitle, which is the localized value of javax.portlet.title is returned if it is not null.
3. If the method does not terminate at neither (1) nor (2), the configured display name is returned.- Returns:
-
generateRenderMarkup
public org.exoplatform.commons.utils.Text generateRenderMarkup(org.gatein.pc.api.invocation.response.PortletInvocationResponse pir, WebuiRequestContext context) Parsing response from portlet container. The response contains:
html markup, portlet title, response properties:
- JS resource dependency (defined in gatein-resources.xml)
- html header
- cookie
- extra markup header
If errors occur during portlet lifecycle processing. PortletExceptionHandleService is called. Add plugins to this service to customize portlet error handler- Parameters:
pir- - response object from portlet containercontext- - request context- Returns:
- markup to render on browser
- See Also:
-
isLazyResourcesLoading
public boolean isLazyResourcesLoading()
-