Class UserPortalConfigService

java.lang.Object
org.exoplatform.portal.config.UserPortalConfigService
All Implemented Interfaces:
org.picocontainer.Startable

public class UserPortalConfigService extends Object implements org.picocontainer.Startable
Created by The eXo Platform SAS Apr 19, 2007 This service is used to load the PortalConfig, Page config and Navigation config for a given user.
  • Field Details

  • Constructor Details

    • UserPortalConfigService

      public UserPortalConfigService(org.exoplatform.portal.mop.service.LayoutService layoutService, org.exoplatform.portal.mop.service.NavigationService navigationService, org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.services.listener.ListenerService listenerService, UserACL userAcl, org.exoplatform.container.xml.InitParams params)
  • Method Details

    • getDataStorage

      public org.exoplatform.portal.mop.service.LayoutService getDataStorage()
    • getDefaultImportMode

      public org.exoplatform.portal.mop.importer.ImportMode getDefaultImportMode()
    • getNavigationService

      public org.exoplatform.portal.mop.service.NavigationService getNavigationService()
      Returns the navigation service associated with this service.
      Returns:
      the navigation service;
    • getUserACL

      public UserACL getUserACL()
    • getUserPortalConfig

      public UserPortalConfig getUserPortalConfig(String portalName, String username)

      Build and returns an instance of UserPortalConfig.


      To return a valid config, the current thread must be associated with an identity that will grant him access to the portal as returned by the UserACL.hasAccessPermission(org.exoplatform.portal.config.model.PortalConfig, Identity) method.


      The navigation loaded on the UserPortalConfig object are obtained according to the specified user argument. The portal navigation is always loaded. If the specified user is null then the navigation of the guest group as configured by UserACL#getGuestsGroup is also loaded, otherwise the navigations are loaded according to the following rules:
      • The navigation corresponding to the user is loaded.
      • When the user is root according to the value returned by UserACL#getSuperUser then the navigation of all groups are loaded.
      • When the user is not root, then all its groups are added except the guest group as configued per UserACL#getGuestsGroup.

      All the navigations are sorted using the value returned by PageNavigation.getPriority().
      Parameters:
      portalName - the portal name
      username - the user name
      Returns:
      the config
    • getUserPortalConfig

      public UserPortalConfig getUserPortalConfig(String portalName, String accessUser, Locale locale)
    • createSiteFromTemplate

      public void createSiteFromTemplate(org.exoplatform.portal.mop.SiteKey sourceSiteKey, org.exoplatform.portal.mop.SiteKey targetSiteKey) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • createSiteFromTemplate

      public void createSiteFromTemplate(org.exoplatform.portal.mop.SiteKey sourceSiteKey, org.exoplatform.portal.mop.SiteKey targetSiteKey, String permission) throws org.exoplatform.commons.exception.ObjectNotFoundException
      Throws:
      org.exoplatform.commons.exception.ObjectNotFoundException
    • createUserPortalConfig

      public void createUserPortalConfig(String siteType, String siteName, String template)
      This method should create a the portal config, pages and navigation according to the template name.
      Parameters:
      siteType - the site type
      siteName - the Site name
      template - the template to use
    • createUserPortalConfig

      public void createUserPortalConfig(String siteType, String siteName, String template, String templatePath)
      This method should create a the portal config, pages and navigation according to the template name.
      Parameters:
      siteType - the site type
      siteName - the Site name
      template - the template to use
      templatePath - the template path to use
    • removeUserPortalConfig

      public void removeUserPortalConfig(String portalName)
      This method removes the PortalConfig, Page and PageNavigation that belong to the portal in the database.
      Parameters:
      portalName - the portal name
    • removeUserPortalConfig

      public void removeUserPortalConfig(String ownerType, String ownerId)
      This method removes the PortalConfig, Page and PageNavigation that belong to the portal in the database.
      Parameters:
      ownerType - the owner type
      ownerId - the portal name
    • getPage

      @Deprecated(forRemoval=true, since="7.0") public org.exoplatform.portal.mop.page.PageContext getPage(org.exoplatform.portal.mop.page.PageKey pageRef)
      Deprecated, for removal: This API element is subject to removal in a future version.
      shouldn't use ConversationState.getCurrent implicitely in Service layer, thus use getPage(PageKey, String) instead
      Load metadata of specify page
      Parameters:
      pageRef - the PageKey
      Returns:
      the PageContext
    • getPage

      public org.exoplatform.portal.mop.page.PageContext getPage(org.exoplatform.portal.mop.page.PageKey pageRef, String username)
    • getUserPortalSites

      public List<org.exoplatform.portal.config.model.PortalConfig> getUserPortalSites(String username)
    • computePortalSitePath

      public String computePortalSitePath(String portalName, jakarta.servlet.http.HttpServletRequest context)
    • computePortalPath

      public String computePortalPath(jakarta.servlet.http.HttpServletRequest request)
    • getPortalSiteNavigations

      public Collection<UserNode> getPortalSiteNavigations(String siteName, String portalType, jakarta.servlet.http.HttpServletRequest context)
    • getPortalSiteRootNode

      public UserNode getPortalSiteRootNode(String siteName, String siteType, jakarta.servlet.http.HttpServletRequest request)
    • getFirstAllowedPageNode

      public UserNode getFirstAllowedPageNode(Collection<UserNode> userNodes)
    • getFirstAllowedPageNode

      public String getFirstAllowedPageNode(String portalName, String portalType, String nodePath, jakarta.servlet.http.HttpServletRequest request)
    • initListener

      public void initListener(org.exoplatform.container.component.ComponentPlugin listener)
    • start

      public void start()
      Specified by:
      start in interface org.picocontainer.Startable
    • getMetaPortal

      public String getMetaPortal()
    • getUserHomePage

      public String getUserHomePage(String username)
      Parameters:
      username - user name
      Returns:
      User home page uri preference
    • getDefaultPortalTemplate

      public String getDefaultPortalTemplate()
      Returns the default portal template to be used when creating a site
      Returns:
      the default portal template name
    • getPortalTemplates

      public Set<String> getPortalTemplates()
    • getConfig

      public <T> T getConfig(String portalType, String portalName, Class<T> objectType, String parentLocation)
    • getMetaPortalSkinName

      public String getMetaPortalSkinName()
      Get the skin name of the default portal
      Returns:
      Skin name of the default portal
    • getMetaPortalConfig

      public org.exoplatform.portal.config.model.PortalConfig getMetaPortalConfig()
      Get the PortalConfig object of the default portal
      Returns:
      PortalConfig object of the default portal
    • setMetaPortalConfig

      public void setMetaPortalConfig(org.exoplatform.portal.config.model.PortalConfig metaPortalConfig)
      Set the PortalConfig object of the default portal
      Parameters:
      metaPortalConfig - PortalConfig object of the default portal
    • reloadConfig

      public void reloadConfig(String ownerType, String predefinedOwner, String location, String importMode, boolean overrideMode)