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 enumclassNested 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 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.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(org.exoplatform.portal.mop.SiteKey key) Returns current UIPortal which being showed in normal modeCollection<org.exoplatform.portal.resource.SkinConfig> static UIPortalApplication.EditModeDeprecated, for removal: This API element is subject to removal in a future version.no more WebUI based layout management, thus uselessgetInitParamsOfPagePortlets(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()getUiPortal(org.exoplatform.portal.mop.SiteKey siteKey) voidvoidinvalidateUIPage(String pageRef) Invalidate any UIPage cache object associated to UIPortal objectsbooleanDeprecated, for removal: This API element is subject to removal in a future version.no more WebUI based layout management, thus uselessbooleanbooleanvoidprocessAction(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.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 OwnerIdvoidvoidremoveCachedUIPortal(String ownerType, String ownerId) Remove the UIPortal from the cache mapMethods 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, 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, processDecode, renderEventURL, setComponentConfig, setComponentConfig, setId, setParent, setRendered, setRenderSibling, url, url, url
-
Field Details
-
PORTAL_BODY_END_CONTAINER
- 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_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
-
getCurrentSite
Returns current UIPortal which being showed in normal mode- Returns:
-
getUiPortal
-
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
public void refreshCachedUI() -
getOrientation
public org.exoplatform.services.resources.Orientation getOrientation() -
getLocale
-
getModeState
public int getModeState() -
isEditing
Deprecated, for removal: This API element is subject to removal in a future version.no more WebUI based layout management, thus useless- Returns:
- false all time
-
getDefaultEditMode
@Deprecated(forRemoval=true, since="7.0") public static UIPortalApplication.EditMode getDefaultEditMode()Deprecated, for removal: This API element is subject to removal in a future version.no more WebUI based layout management, thus useless- Returns:
- EditMode.NO_EDIT all time
-
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
public org.json.JSONObject 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) -
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 -
getCustomSkins
-
getBrandingUrl
-
getSkin
-
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
-
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
-
getUserHomePage
- Returns:
- User Home page preference
-
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
-
getBaseURL
-
includePortletScripts
public void includePortletScripts() -
getCurrentPage
-
isNoCache
public boolean isNoCache() -
isMaximizePortlet
public boolean isMaximizePortlet() -
getMaximizedPortletId
-