Class UIPortalApplication
java.lang.Object
org.exoplatform.webui.core.UIComponent
org.exoplatform.webui.core.UIContainer
org.exoplatform.webui.core.UIApplication
org.exoplatform.portal.webui.workspace.UIPortalApplication
- All Implemented Interfaces:
Serializable
This extends the UIApplication and hence is a sibling of UIPortletApplication (used by any eXo Portlets as the Parent class
to build the portlet component tree). The UIPortalApplication is responsible to build its subtree according to some
configuration parameters. If all components are displayed it is composed of 2 UI components: -UIWorkingWorkSpace: the right
part that can display the normal or webos portal layouts - UIPopupWindow: a popup window that display or not
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumNested classes/interfaces inherited from class org.exoplatform.webui.core.UIContainer
UIContainer.SelectTabActionListener -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe combination ofUIPortalApplication.EditMode.BLOCKandUIPortalApplication.ComponentTab.APPLICATIONS.static final intThe combination ofUIPortalApplication.EditMode.PREVIEWandUIPortalApplication.ComponentTab.APPLICATIONS.static final intThe combination ofUIPortalApplication.EditMode.BLOCKandUIPortalApplication.ComponentTab.CONTAINERS.static final intThe combination ofUIPortalApplication.EditMode.PREVIEWandUIPortalApplication.ComponentTab.CONTAINERS.static final StringProperty settable in the portal'S configuration.properties file.static final UIComponentstatic final intThe normal, non-edit mode.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprotected UIWorkingWorkspaceFields inherited from class org.exoplatform.webui.core.UIApplication
logFields inherited from class org.exoplatform.webui.core.UIComponent
AJAX_ASYNC, config, OBJECTID, UICOMPONENT, uiparent, USE_WEBUI_RESOURCES -
Constructor Summary
ConstructorsConstructorDescriptionThe constructor of this class is used to build the tree of UI components that will be aggregated in the portal page.
1) The component is stored in the current PortalRequestContext ThreadLocal
2) The configuration for the portal associated with the current user request is extracted from the PortalRequestContext
3) Then according to the context path, either a public or private portal is initiated. -
Method Summary
Modifier and TypeMethodDescriptiongetCachedUIPortal(String ownerType, String ownerId) Returns a cached UIPortal matching to OwnerType and OwnerId if anygetCachedUIPortal(org.exoplatform.portal.mop.SiteKey key) Returns current UIPortal which being showed in normal modestatic UIPortalApplication.EditModeReturns a locally cached value of "gatein.portal.pageEditor.defaultEditMode" property from configuration.properties.getInitParamsOfPagePortlets(String paramName) org.json.JSONObjectReturn a map of GMD resource ids and their URLs that point to ResourceRequestHandler.intorg.exoplatform.services.resources.OrientationList<org.gatein.pc.portlet.impl.info.ContainerPortletInfo> Find portlets visible on the pageCollection<org.exoplatform.portal.resource.SkinConfig> Return corresponding collection of Skin objects depends on current skin name, this object help to build URL that point to SkinResourceRequestHandler.Collection<org.exoplatform.portal.resource.SkinConfig> getPortalSkins(org.exoplatform.portal.resource.SkinVisitor visitor) Return the portal url template which will be sent to client ( browser ) and used for JS based portal url generation.Set<org.exoplatform.portal.resource.Skin> Returns a set of portlets skin that have to be added in the HTML head tag.Return a map of JS resource ids (required to be load for current page) and boolean: true if that script should be push on the header before html.getSkin()org.exoplatform.portal.config.UserPortalConfigDeprecated.voidvoidinvalidateUIPage(String pageRef) Invalidate any UIPage cache object associated to UIPortal objectsbooleanDeprecated.use the Mode State insteadbooleanbooleanbooleanvoidprocessAction(WebuiRequestContext context) The processAction() method is doing 3 actions:
1) if this is a non ajax request and the last is an ajax one, then we check if the requested nodePath is equal to last non ajax nodePath and is not equal to the last nodePath, the server performs a 302 redirect on the last nodePath.
2) if the nodePath exist but is equals to the current one then we also call super and stops here.
3) if the requested nodePath is not equals to the current one or current page no longer exists, then an event of type PageNodeEvent.CHANGE_NODE is sent to the associated EventListener; a call to super is then done.voidprocessDecode(WebuiRequestContext context) Check current portal name, if it's changing, reload portal properties (for now, skin setting)voidprocessRender(WebuiRequestContext context) The processrender() method handles the creation of the returned HTML either for a full page render or in the case of an AJAX call The first request, Ajax is not enabled (means no ajaxRequest parameter in the request) and hence the super.processRender() method is called.voidputCachedUIPortal(UIPortal uiPortal) Associates the specified UIPortal to a cache map with specified key which bases on OwnerType and OwnerIdvoidvoidReload portal properties.voidremoveCachedUIPortal(String ownerType, String ownerId) Remove the UIPortal from the cache mapvoidsetCurrentPage(UIPage currentPage) voidsetCurrentSite(UIPortal uiPortal) Sets the specified portal to be showed in the normal mode currentlyvoidsetDefaultEditMode(UIPortalApplication.ComponentTab componentTab, UIPortalApplication.EditLevel editLevel) voidsetEditLevel(UIPortalApplication.EditLevel editLevel) voidvoidsetModeState(int mode) voidsetOrientation(org.exoplatform.services.resources.Orientation orientation) voidsetSessionOpen(boolean isSessionOpen) voidMethods inherited from class org.exoplatform.webui.core.UIApplication
addMessage, addMessage, clearMessages, findComponentById, getLastAccessApplication, getUIComponentName, getUIPopupMessages, renderBlockToUpdate, renderChildren, setLastAccessApplicationMethods inherited from class org.exoplatform.webui.core.UIContainer
addChild, addChild, findComponentOfType, findFirstComponentOfType, getChild, getChild, getChildById, getChildren, hasChildren, removeChild, removeChildById, renderChild, renderChild, renderChild, renderChild, 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, getId, getName, getParent, getTemplate, getTemplateResourceResolver, isRendered, loadConfirmMesssage, renderEventURL, setComponentConfig, setComponentConfig, setId, setParent, setRendered, setRenderSibling, url, url, url
-
Field Details
-
DEFAULT_MODE_PROPERTY
Property settable in the portal'S configuration.properties file. SeeUIPortalApplication.EditModefor possible values. See alsogetDefaultEditMode().- See Also:
-
PORTAL_PORTLETS_SKIN_ID
- See Also:
-
NORMAL_MODE
public static final int NORMAL_MODEThe normal, non-edit mode.- See Also:
-
APP_BLOCK_EDIT_MODE
public static final int APP_BLOCK_EDIT_MODEThe combination ofUIPortalApplication.EditMode.BLOCKandUIPortalApplication.ComponentTab.APPLICATIONS.- See Also:
-
APP_VIEW_EDIT_MODE
public static final int APP_VIEW_EDIT_MODEThe combination ofUIPortalApplication.EditMode.PREVIEWandUIPortalApplication.ComponentTab.APPLICATIONS.- See Also:
-
CONTAINER_BLOCK_EDIT_MODE
public static final int CONTAINER_BLOCK_EDIT_MODEThe combination ofUIPortalApplication.EditMode.BLOCKandUIPortalApplication.ComponentTab.CONTAINERS.- See Also:
-
CONTAINER_VIEW_EDIT_MODE
public static final int CONTAINER_VIEW_EDIT_MODEThe combination ofUIPortalApplication.EditMode.PREVIEWandUIPortalApplication.ComponentTab.CONTAINERS.- See Also:
-
EMPTY_COMPONENT
-
UI_WORKING_WS_ID
- See Also:
-
UI_VIEWING_WS_ID
- See Also:
-
UI_EDITTING_WS_ID
- See Also:
-
UI_MASK_WS_ID
- See Also:
-
uiWorkingWorkspace
-
-
Constructor Details
-
UIPortalApplication
The constructor of this class is used to build the tree of UI components that will be aggregated in the portal page.
1) The component is stored in the current PortalRequestContext ThreadLocal
2) The configuration for the portal associated with the current user request is extracted from the PortalRequestContext
3) Then according to the context path, either a public or private portal is initiated. Usually a public portal does not contain the left column and only the private one has it.
4) The skin to use is setup
5) Finally, the current component is associated with the current portal owner- Throws:
Exception
-
-
Method Details
-
getDefaultEditMode
Returns a locally cached value of "gatein.portal.pageEditor.defaultEditMode" property from configuration.properties.- Returns:
-
setCurrentSite
Sets the specified portal to be showed in the normal mode currently- Parameters:
uiPortal-
-
getCurrentSite
Returns current UIPortal which being showed in normal mode- Returns:
-
getCachedUIPortal
Returns a cached UIPortal matching to OwnerType and OwnerId if any- Parameters:
ownerType-ownerId-- Returns:
-
getCachedUIPortal
-
putCachedUIPortal
Associates the specified UIPortal to a cache map with specified key which bases on OwnerType and OwnerId- Parameters:
uiPortal-
-
removeCachedUIPortal
Remove the UIPortal from the cache map- Parameters:
ownerType-ownerId-
-
invalidateUIPage
Invalidate any UIPage cache object associated to UIPortal objects- Parameters:
pageRef-
-
refreshCachedUI
- Throws:
Exception
-
isSessionOpen
public boolean isSessionOpen() -
setSessionOpen
public void setSessionOpen(boolean isSessionOpen) -
getOrientation
public org.exoplatform.services.resources.Orientation getOrientation() -
setOrientation
public void setOrientation(org.exoplatform.services.resources.Orientation orientation) -
getLocale
-
setModeState
public void setModeState(int mode) -
setDefaultEditMode
public void setDefaultEditMode(UIPortalApplication.ComponentTab componentTab, UIPortalApplication.EditLevel editLevel) -
getModeState
public int getModeState() -
isEditing
public boolean isEditing()Deprecated.use the Mode State instead- Returns:
- True if the Portal is not in the normal mode
-
getScripts
Return a map of JS resource ids (required to be load for current page) and boolean: true if that script should be push on the header before html. false if that script should be load lazily after html has been loaded
JS resources always contains SHARED/bootstrap required to be loaded eagerly and optionally (by configuration) contains: portal js, portlet js, and resouces registered to be load through JavascriptManager- Returns:
-
getJSConfig
Return a map of GMD resource ids and their URLs that point to ResourceRequestHandler. this map will be used by GateIn JS module loader (currently, it is requirejs)- Throws:
Exception
-
getPortalSkins
public Collection<org.exoplatform.portal.resource.SkinConfig> getPortalSkins(org.exoplatform.portal.resource.SkinVisitor visitor) -
getPortalSkins
Return corresponding collection of Skin objects depends on current skin name, this object help to build URL that point to SkinResourceRequestHandler. this handler is responsible to serves for css files
The collection contains: - portal skin modules
- skin for specific site -
getBrandingUrl
-
getSkin
-
setSkin
-
getPortletSkins
Returns a set of portlets skin that have to be added in the HTML head tag. Those portlets doesn't belongs to portal- Returns:
- the portlet skins
-
getPortletNames
- Returns:
- a set of current page portlet names
-
getPortletBundles
- Returns:
- a set of current page portlet resource bundle names to preload
-
getPortletStylesheets
- Returns:
- a set of current page portlet additonal stylesheet files to preload
-
getInitParamsOfPagePortlets
-
getPagePortletInfos
Find portlets visible on the page- Returns:
ListofContainerPortletInfocorresponding to portlet info on the page
-
processDecode
Check current portal name, if it's changing, reload portal properties (for now, skin setting)- Overrides:
processDecodein classUIComponent- Throws:
Exception
-
processAction
The processAction() method is doing 3 actions:
1) if this is a non ajax request and the last is an ajax one, then we check if the requested nodePath is equal to last non ajax nodePath and is not equal to the last nodePath, the server performs a 302 redirect on the last nodePath.
2) if the nodePath exist but is equals to the current one then we also call super and stops here.
3) if the requested nodePath is not equals to the current one or current page no longer exists, then an event of type PageNodeEvent.CHANGE_NODE is sent to the associated EventListener; a call to super is then done.- Overrides:
processActionin classUIApplication- Throws:
Exception
-
processRender
The processrender() method handles the creation of the returned HTML either for a full page render or in the case of an AJAX call The first request, Ajax is not enabled (means no ajaxRequest parameter in the request) and hence the super.processRender() method is called. This will hence call the processrender() of the Lifecycle object as this method is not overidden in UIPortalApplicationLifecycle. There we simply render the bounded template (groovy usually). Note that bounded template are also defined in component annotations, so for the current class it is UIPortalApplication.gtmpl On second calls, request have the "ajaxRequest" parameter set to true in the URL. In that case the algorithm is a bit more complex: a) The list of components that should be updated is extracted using the context.getUIComponentToUpdateByAjax() method. That list was setup during the process action phase b) Portlets and other UI components to update are split in 2 different lists c) Portlets full content are returned and set with the tag<div class="PortalResponse">d) Block to updates (which are UI components) are set within the<div class="PortalResponseData">tag e) Extra markup headers are in the<div class="MarkupHeadElements">tag f) additional scripts are in<div class="ImmediateScripts">, JS GMD modules will be loaded by generated JS command on AMD js loader, and is put into PortalResponseScript block g) Then the scripts and the skins to reload are set in the<div class="PortalResponseScript">- Overrides:
processRenderin classUIComponent- Throws:
Exception
-
getUserPortalConfig
Deprecated.UsePortalRequestContext.getUserPortalConfig()instead- Returns:
-
reloadPortalProperties
Reload portal properties. This is needed to be called when it is changing Portal site
If user has been authenticated, get the skin name setting from user profile.
anonymous user or no skin setting in user profile, use the skin setting in portal config- Throws:
Exception
-
getUserHomePage
- Returns:
- User Home page preference
-
isMenuSticky
public boolean isMenuSticky()- Returns:
- true if user prefers sticky menu, else false
-
getPortalURLTemplate
Return the portal url template which will be sent to client ( browser ) and used for JS based portal url generation.The portal url template are calculated base on the current request and site state. Something like :
"/portal/g/:platform:administrators/administration/registry?portal:componentId={portal:uicomponentId}&portal:action={portal:action}" ;- Returns:
- return portal url template
- Throws:
UnsupportedEncodingException
-
getBaseURL
- Throws:
UnsupportedEncodingException
-
getEditLevel
- Returns:
- the editLevel
-
setEditLevel
- Parameters:
editLevel- the editLevel to set
-
getEditMode
-
getComponentTab
-
includePortletScripts
public void includePortletScripts() -
getLastPortal
-
getCurrentPage
-
setCurrentPage
-
isMaximizePortlet
public boolean isMaximizePortlet() -
getMaximizedPortletId
-