Class UIPortalApplication

All Implemented Interfaces:
Serializable

public class UIPortalApplication extends UIApplication
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:
  • Field Details

  • Constructor Details

    • UIPortalApplication

      public UIPortalApplication() throws Exception
      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

      public static UIPortalApplication.EditMode getDefaultEditMode()
      Returns a locally cached value of "gatein.portal.pageEditor.defaultEditMode" property from configuration.properties.
      Returns:
    • setCurrentSite

      public void setCurrentSite(UIPortal uiPortal)
      Sets the specified portal to be showed in the normal mode currently
      Parameters:
      uiPortal -
    • getCurrentSite

      public UIPortal getCurrentSite()
      Returns current UIPortal which being showed in normal mode
      Returns:
    • getCachedUIPortal

      public UIPortal getCachedUIPortal(String ownerType, String ownerId)
      Returns a cached UIPortal matching to OwnerType and OwnerId if any
      Parameters:
      ownerType -
      ownerId -
      Returns:
    • getCachedUIPortal

      public UIPortal getCachedUIPortal(org.exoplatform.portal.mop.SiteKey key)
    • putCachedUIPortal

      public void putCachedUIPortal(UIPortal uiPortal)
      Associates the specified UIPortal to a cache map with specified key which bases on OwnerType and OwnerId
      Parameters:
      uiPortal -
    • removeCachedUIPortal

      public void removeCachedUIPortal(String ownerType, String ownerId)
      Remove the UIPortal from the cache map
      Parameters:
      ownerType -
      ownerId -
    • invalidateUIPage

      public void invalidateUIPage(String pageRef)
      Invalidate any UIPage cache object associated to UIPortal objects
      Parameters:
      pageRef -
    • refreshCachedUI

      public void refreshCachedUI() throws Exception
      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

      public Locale getLocale()
    • setModeState

      public void setModeState(int mode)
    • setDefaultEditMode

      public void setDefaultEditMode(UIPortalApplication.ComponentTab componentTab, UIPortalApplication.EditLevel editLevel)
    • getModeState

      public int getModeState()
    • setLastRequestNavData

      public void setLastRequestNavData(RequestNavigationData navData)
    • isEditing

      public boolean isEditing()
      Deprecated.
      use the Mode State instead
      Returns:
      True if the Portal is not in the normal mode
    • getScripts

      public Map<String,Boolean> 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

      public Collection<org.exoplatform.portal.resource.SkinConfig> 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

      public Collection<org.exoplatform.portal.resource.SkinConfig> getCustomSkins()
    • getBrandingUrl

      public String getBrandingUrl()
    • getSkin

      public String getSkin()
    • getPortletSkins

      public Set<org.exoplatform.portal.resource.Skin> 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

      public Set<String> getPortletNames()
      Returns:
      a set of current page portlet names
    • getPortletBundles

      public Set<String> getPortletBundles()
      Returns:
      a set of current page portlet resource bundle names to preload
    • getPortletStylesheets

      public Set<String> getPortletStylesheets()
      Returns:
      a set of current page portlet additonal stylesheet files to preload
    • getInitParamsOfPagePortlets

      public Set<String> getInitParamsOfPagePortlets(String paramName)
    • getPagePortletInfos

      public List<org.gatein.pc.portlet.impl.info.ContainerPortletInfo> getPagePortletInfos()
      Find portlets visible on the page
      Returns:
      List of ContainerPortletInfo corresponding to portlet info on the page
    • processDecode

      public void processDecode(WebuiRequestContext context) throws Exception
      Check current portal name, if it's changing, reload portal properties (for now, skin setting)
      Overrides:
      processDecode in class UIComponent
      Throws:
      Exception
    • processAction

      public void processAction(WebuiRequestContext context) throws Exception
      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:
      processAction in class UIApplication
      Throws:
      Exception
    • processRender

      public void processRender(WebuiRequestContext context) throws Exception
      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:
      processRender in class UIComponent
      Throws:
      Exception
    • getUserPortalConfig

      @Deprecated public org.exoplatform.portal.config.UserPortalConfig getUserPortalConfig()
      Deprecated.
      Returns:
    • reloadPortalProperties

      public void reloadPortalProperties() throws Exception
      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

      public String getUserHomePage()
      Returns:
      User Home page preference
    • isMenuSticky

      public boolean isMenuSticky()
      Returns:
      true if user prefers sticky menu, else false
    • getPortalURLTemplate

      public String getPortalURLTemplate() throws UnsupportedEncodingException
      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

      public String getBaseURL() throws UnsupportedEncodingException
      Throws:
      UnsupportedEncodingException
    • getEditLevel

      public UIPortalApplication.EditLevel getEditLevel()
      Returns:
      the editLevel
    • setEditLevel

      public void setEditLevel(UIPortalApplication.EditLevel editLevel)
      Parameters:
      editLevel - the editLevel to set
    • getEditMode

      public UIPortalApplication.EditMode getEditMode()
    • getComponentTab

      public UIPortalApplication.ComponentTab getComponentTab()
    • includePortletScripts

      public void includePortletScripts()
    • getLastPortal

      public String getLastPortal()
    • getCurrentPage

      public UIPage getCurrentPage()
    • setCurrentPage

      public void setCurrentPage(UIPage currentPage)
    • isMaximizePortlet

      public boolean isMaximizePortlet()
    • getMaximizedPortletId

      public String getMaximizedPortletId()