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

    • SITE_TEMPLATE_INSTANTIATED

      public static final String SITE_TEMPLATE_INSTANTIATED
      See Also:
    • PUBLIC_SITE_NAME

      public static final String PUBLIC_SITE_NAME
      See Also:
    • HOME_PAGE_URI_PREFERENCE_SCOPE

      public static final org.exoplatform.commons.api.settings.data.Scope HOME_PAGE_URI_PREFERENCE_SCOPE
    • HOME_PAGE_URI_PREFERENCE_KEY

      public static final String HOME_PAGE_URI_PREFERENCE_KEY
      See Also:
    • DEFAULT_GLOBAL_PORTAL

      public static final String DEFAULT_GLOBAL_PORTAL
      See Also:
    • DEFAULT_GROUP_SITE_TEMPLATE

      public static final String DEFAULT_GROUP_SITE_TEMPLATE
      See Also:
    • DEFAULT_USER_SITE_TEMPLATE

      public static final String DEFAULT_USER_SITE_TEMPLATE
      See Also:
    • SITE_NAME_PROP_NAME

      public static final String SITE_NAME_PROP_NAME
      See Also:
    • SITE_TYPE_PROP_NAME

      public static final String SITE_TYPE_PROP_NAME
      See Also:
    • portalSiteFilter

      protected final org.exoplatform.portal.mop.SiteFilter portalSiteFilter
  • 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

    • canRestore

      public boolean canRestore(String type, String name)
    • restoreSite

      public boolean restoreSite(String type, String name, org.exoplatform.portal.mop.importer.ImportMode importMode, boolean restoreSiteLayout, boolean restorePages, boolean restoreNavigationTree)
    • 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

      @Deprecated(forRemoval=true, since="7.0") public org.exoplatform.portal.config.model.PortalConfig createUserPortalConfig(String siteType, String siteName, String template)
      Deprecated, for removal: This API element is subject to removal in a future version.
      the Site creation process has changed to use Site Template Definition as deifned in layout addon instead of creating a site from a static template from sources. You may replace the usage of this method by createSiteFromTemplate(SiteKey, SiteKey)
      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
      Returns:
      created PortalConfig
    • createUserPortalConfig

      @Deprecated(forRemoval=true, since="7.0") public void createUserPortalConfig(String siteType, String siteName, String template, String templatePath)
      Deprecated, for removal: This API element is subject to removal in a future version.
      the Site creation process has changed to use Site Template Definition as deifned in layout addon instead of creating a site from a static template from sources. You may replace the usage of this method by createSiteFromTemplate(SiteKey, SiteKey)
      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
    • 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)
    • getDefaultPath

      public String getDefaultPath(String username)
    • getDefaultPath

      public String getDefaultPath(String username, boolean useUserHome)
    • getDefaultSitePath

      public String getDefaultSitePath(String portalName, String username)
    • getDefaultSiteNode

      public UserNode getDefaultSiteNode(String portalName, String username)
    • getDefaultSiteNode

      public UserNode getDefaultSiteNode(String portalType, String portalName, String username)
    • getSiteRootNode

      public UserNode getSiteRootNode(String siteType, String siteName, String username, boolean withVisibility)
    • getDefaultSite

      public org.exoplatform.portal.config.model.PortalConfig getDefaultSite(String username)
    • getSiteNodeOrGlobalNode

      public UserNode getSiteNodeOrGlobalNode(String portalType, String portalName, String nodePath, String username)
    • 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
    • setUserHomePage

      public void setUserHomePage(String username, String path)
      Sets the user default Path
      Parameters:
      username - user name
      path - Page path
    • getDefaultPortalTemplate

      @Deprecated(forRemoval=true, since="7.0") public String getDefaultPortalTemplate()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Site Templates has been changed to be stored in database to make it dynamically managed by UI rather than statis pages and navigation from source files
      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