Package org.exoplatform.portal.config
Class UserPortalConfigService
java.lang.Object
org.exoplatform.portal.config.UserPortalConfigService
- All Implemented Interfaces:
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUserPortalConfigService(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 Summary
Modifier and TypeMethodDescriptionbooleancanRestore(String type, String name) voidcreateSiteFromTemplate(org.exoplatform.portal.mop.SiteKey sourceSiteKey, org.exoplatform.portal.mop.SiteKey targetSiteKey) voidcreateSiteFromTemplate(org.exoplatform.portal.mop.SiteKey sourceSiteKey, org.exoplatform.portal.mop.SiteKey targetSiteKey, String permission) org.exoplatform.portal.config.model.PortalConfigcreateUserPortalConfig(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.voidcreateUserPortalConfig(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.<T> Torg.exoplatform.portal.mop.service.LayoutServiceorg.exoplatform.portal.mop.importer.ImportModegetDefaultPath(String username) 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 filesorg.exoplatform.portal.config.model.PortalConfiggetDefaultSite(String username) getDefaultSiteNode(String portalName, String username) getDefaultSiteNode(String portalType, String portalName, String username) getDefaultSitePath(String portalName, String username) org.exoplatform.portal.config.model.PortalConfigGet the PortalConfig object of the default portalGet the skin name of the default portalorg.exoplatform.portal.mop.service.NavigationServiceReturns the navigation service associated with this service.org.exoplatform.portal.mop.page.PageContextgetPage(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 usegetPage(PageKey, String)insteadorg.exoplatform.portal.mop.page.PageContextgetSiteNodeOrGlobalNode(String portalType, String portalName, String nodePath, String username) getSiteRootNode(String siteType, String siteName, String username, boolean withVisibility) getUserHomePage(String username) getUserPortalConfig(String portalName, String username) Build and returns an instance ofUserPortalConfig.getUserPortalConfig(String portalName, String accessUser, Locale locale) voidinitListener(org.exoplatform.container.component.ComponentPlugin listener) booleanrestoreSite(String type, String name, org.exoplatform.portal.mop.importer.ImportMode importMode, boolean restoreSiteLayout, boolean restorePages, boolean restoreNavigationTree) voidsetMetaPortalConfig(org.exoplatform.portal.config.model.PortalConfig metaPortalConfig) Set the PortalConfig object of the default portalvoidsetUserHomePage(String username, String path) Sets the user default Pathvoidstart()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.picocontainer.Startable
stop
-
Field Details
-
SITE_TEMPLATE_INSTANTIATED
- See Also:
-
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
- See Also:
-
DEFAULT_GLOBAL_PORTAL
- See Also:
-
DEFAULT_GROUP_SITE_TEMPLATE
- See Also:
-
DEFAULT_USER_SITE_TEMPLATE
- See Also:
-
portalSiteFilter
protected final org.exoplatform.portal.mop.SiteFilter portalSiteFilter
-
-
Constructor Details
-
Method Details
-
canRestore
-
restoreSite
-
getDataStorage
public org.exoplatform.portal.mop.service.LayoutService getDataStorage() -
getDefaultImportMode
public org.exoplatform.portal.mop.importer.ImportMode getDefaultImportMode() -
getUserACL
-
getUserPortalConfig
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 theUserPortalConfigobject 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 byPageNavigation.getPriority().- Parameters:
portalName- the portal nameusername- the user name- Returns:
- the config
-
getUserPortalConfig
-
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 bycreateSiteFromTemplate(SiteKey, SiteKey)This method should create a the portal config, pages and navigation according to the template name.- Parameters:
siteType- the site typesiteName- the Site nametemplate- 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 bycreateSiteFromTemplate(SiteKey, SiteKey)This method should create a the portal config, pages and navigation according to the template name.- Parameters:
siteType- the site typesiteName- the Site nametemplate- the template to usetemplatePath- 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 usegetPage(PageKey, String)insteadLoad 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
-
getDefaultSitePath
-
getDefaultSiteNode
-
getDefaultSiteNode
-
getSiteRootNode
-
getDefaultSite
-
getSiteNodeOrGlobalNode
-
initListener
public void initListener(org.exoplatform.container.component.ComponentPlugin listener) -
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
getMetaPortal
-
getUserHomePage
- Parameters:
username- user name- Returns:
- User home page uri preference
-
setUserHomePage
Sets the user default Path- Parameters:
username- user namepath- Page path
-
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 filesReturns the default portal template to be used when creating a site- Returns:
- the default portal template name
-
getPortalTemplates
-
getConfig
-
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
-