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(UserACL userACL, org.exoplatform.portal.mop.service.LayoutService storage, org.exoplatform.services.organization.OrganizationService orgService, org.exoplatform.portal.mop.service.NavigationService navService, org.exoplatform.portal.mop.storage.DescriptionStorage descriptionService, org.exoplatform.portal.mop.storage.PageStorage pageStorage, org.exoplatform.commons.api.settings.SettingService settingService, org.exoplatform.container.xml.InitParams params) -
Method Summary
Modifier and TypeMethodDescriptioncomputePortalPath(jakarta.servlet.http.HttpServletRequest context) computePortalSitePath(String portalName, jakarta.servlet.http.HttpServletRequest context) voidcreateGroupSite(String groupId) Create a group site for the specified group.org.exoplatform.portal.config.model.PagecreatePageTemplate(String temp, String ownerType, String ownerId) Creates a page from an existing template.voidcreateUserPortalConfig(String siteType, String siteName, String template) This method should create a the portal config, pages and navigation according to the template name.voidcreateUserSite(String userName) Create a user site for the specified user.voiddeleteListenerElements(org.exoplatform.container.component.ComponentPlugin listener) <T> Tbooleanorg.exoplatform.portal.mop.service.LayoutServiceorg.exoplatform.portal.mop.importer.ImportModeDeprecated, for removal: This API element is subject to removal in a future version.notion of 'default' portal doesn't exist anymoreorg.exoplatform.portal.config.model.PortalConfigDeprecated, for removal: This API element is subject to removal in a future version.the default portal has been deprecated in favor of a meta site that aggregate other sites into it and which shares the same Shared Layout and Portal layout with aggregated sites.Deprecated, for removal: This API element is subject to removal in a future version.notion of 'default' portal doesn't exist anymoreReturns the default portal template to be used when creating a siteorg.exoplatform.portal.mop.storage.DescriptionStoragebooleangetFirstAllowedPageNode(String portalName, String portalType, String nodePath, jakarta.servlet.http.HttpServletRequest context) getFirstAllowedPageNode(Collection<UserNode> userNodes) getMakableNavigations(String remoteUser, boolean withSite) Compute and returns the list that the specified user can manage.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.services.organization.OrganizationServiceorg.exoplatform.portal.mop.page.PageContextgetPage(org.exoplatform.portal.mop.page.PageKey pageRef) Load metadata of specify pageorg.exoplatform.portal.mop.storage.PageStorageorg.exoplatform.portal.config.model.PortalConfiggetPortalConfigFromTemplate(String templateName) getPortalSiteNavigations(String siteName, String portalType, jakarta.servlet.http.HttpServletRequest context) getPortalSiteRootNode(String siteName, String siteType, jakarta.servlet.http.HttpServletRequest context) getSiteNames(org.exoplatform.portal.mop.SiteType siteType, int offset, int limit) getUserHomePage(String username) getUserPortalConfig(String portalName, String username) Build and returns an instance ofUserPortalConfig.getUserPortalConfig(String portalName, String accessUser, Locale locale) getUserPortalConfig(String portalName, String accessUser, UserPortalContext userPortalContext) Deprecated, for removal: This API element is subject to removal in a future version.the methodgetUserPortalConfig(String, String, java.util.Locale)orgetUserPortalConfig(String, String)should be used insteadList<org.exoplatform.portal.config.model.PortalConfig> booleanhasMakableNavigations(String remoteUser, boolean withSite) Returns a boolean hasNav according to if the user has at least one makable navigation i.e if he belongs to at least one groupvoidinitListener(org.exoplatform.container.component.ComponentPlugin listener) voidreloadConfig(String ownerType, String predefinedOwner, String location, String importMode, boolean overrideMode) voidremoveUserPortalConfig(String portalName) This method removes the PortalConfig, Page and PageNavigation that belong to the portal in the database.voidremoveUserPortalConfig(String ownerType, String ownerId) This method removes the PortalConfig, Page and PageNavigation that belong to the portal in the database.voidsaveUserHomePage(String username, String uri) Stores user default home pagevoidsetCreateUserPortal(boolean createUserPortal) voidsetDefaultGroupSiteTemplate(String defaultGroupSiteTemplate) voidsetDefaultUserSiteTemplate(String defaultUserSiteTemplate) voidsetDestroyUserPortal(boolean destroyUserPortal) voidsetMetaPortalConfig(org.exoplatform.portal.config.model.PortalConfig metaPortalConfig) Set the PortalConfig object of the default portalvoidstart()voidstop()
-
Field Details
-
DEFAULT_GLOBAL_PORTAL
- See Also:
-
DEFAULT_GROUP_SITE_TEMPLATE
- See Also:
-
DEFAULT_USER_SITE_TEMPLATE
- See Also:
-
siteFilter
protected final org.exoplatform.portal.mop.SiteFilter siteFilter
-
-
Constructor Details
-
Method Details
-
getPageService
public org.exoplatform.portal.mop.storage.PageStorage getPageService() -
getDataStorage
public org.exoplatform.portal.mop.service.LayoutService getDataStorage() -
getDefaultImportMode
public org.exoplatform.portal.mop.importer.ImportMode getDefaultImportMode() -
getCreateUserPortal
public boolean getCreateUserPortal() -
setCreateUserPortal
public void setCreateUserPortal(boolean createUserPortal) -
getDestroyUserPortal
public boolean getDestroyUserPortal() -
setDestroyUserPortal
public void setDestroyUserPortal(boolean destroyUserPortal) -
getDefaultGroupSiteTemplate
-
setDefaultGroupSiteTemplate
-
getDefaultUserSiteTemplate
-
setDefaultUserSiteTemplate
-
getDescriptionService
public org.exoplatform.portal.mop.storage.DescriptionStorage getDescriptionService() -
getUserACL
-
getOrganizationService
public org.exoplatform.services.organization.OrganizationService getOrganizationService() -
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.hasPermission(org.exoplatform.portal.config.model.PortalConfig)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 byUserACL.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
-
getUserPortalConfig
@Deprecated(forRemoval=true, since="7.0") public UserPortalConfig getUserPortalConfig(String portalName, String accessUser, UserPortalContext userPortalContext) Deprecated, for removal: This API element is subject to removal in a future version.the methodgetUserPortalConfig(String, String, java.util.Locale)orgetUserPortalConfig(String, String)should be used instead- Parameters:
portalName- the portal nameaccessUser- the user nameuserPortalContext-- Returns:
- the config
-
createUserSite
Create a user site for the specified user. It will perform the following:- create the user site by calling
createUserPortalConfig(String, String, String)which may create a site or not according to the default configuration - if not site exists then it creates a site then it creates an empty site
- if not navigation exists for the user site then it creates an empty navigation
- Parameters:
userName- the user name- Throws:
Exception- a nasty exception
- create the user site by calling
-
createGroupSite
Create a group site for the specified group. It will perform the following:- create the group site by calling
createUserPortalConfig(String, String, String)which may create a site or not according to the default configuration - if not site exists then it creates a site then it creates an empty site
- Parameters:
groupId- the group id- Throws:
Exception- a nasty exception
- create the group site by calling
-
createUserPortalConfig
public void createUserPortalConfig(String siteType, String siteName, String template) throws Exception 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- Throws:
Exception- any exception
-
removeUserPortalConfig
This method removes the PortalConfig, Page and PageNavigation that belong to the portal in the database.- Parameters:
portalName- the portal name- Throws:
Exception- any exception
-
removeUserPortalConfig
This method removes the PortalConfig, Page and PageNavigation that belong to the portal in the database.- Parameters:
ownerType- the owner typeownerId- the portal name- Throws:
Exception- any exception
-
getPage
public org.exoplatform.portal.mop.page.PageContext getPage(org.exoplatform.portal.mop.page.PageKey pageRef) Load metadata of specify page- Parameters:
pageRef- the PageKey- Returns:
- the PageContext
-
createPageTemplate
public org.exoplatform.portal.config.model.Page createPageTemplate(String temp, String ownerType, String ownerId) throws Exception Creates a page from an existing template.- Parameters:
temp- the template nameownerType- the new owner typeownerId- the new owner id- Returns:
- the page
- Throws:
Exception- any exception
-
getGlobalPortal
-
getSiteNames
-
getUserPortalSites
-
computePortalSitePath
public String computePortalSitePath(String portalName, jakarta.servlet.http.HttpServletRequest context) throws Exception - Throws:
Exception
-
computePortalPath
- Throws:
Exception
-
getPortalSiteRootNode
public UserNode getPortalSiteRootNode(String siteName, String siteType, jakarta.servlet.http.HttpServletRequest context) throws Exception - Throws:
Exception
-
getFirstAllowedPageNode
-
getFirstAllowedPageNode
public String getFirstAllowedPageNode(String portalName, String portalType, String nodePath, jakarta.servlet.http.HttpServletRequest context) throws Exception - Throws:
Exception
-
initListener
public void initListener(org.exoplatform.container.component.ComponentPlugin listener) -
deleteListenerElements
public void deleteListenerElements(org.exoplatform.container.component.ComponentPlugin listener) -
start
public void start()- Specified by:
startin interfaceorg.picocontainer.Startable
-
stop
public void stop()- Specified by:
stopin interfaceorg.picocontainer.Startable
-
getDefaultPortal
Deprecated, for removal: This API element is subject to removal in a future version.notion of 'default' portal doesn't exist anymore- Returns:
- configured default portal
-
getMetaPortal
-
getUserHomePage
- Parameters:
username- user name- Returns:
- User home page uri preference
-
saveUserHomePage
Stores user default home page- Parameters:
username- user nameuri- URI to consider as default page of user
-
getDefaultPortalTemplate
Returns the default portal template to be used when creating a site- Returns:
- the default portal template name
-
getPortalTemplates
-
getPortalConfigFromTemplate
public org.exoplatform.portal.config.model.PortalConfig getPortalConfigFromTemplate(String templateName) -
getConfig
-
getDefaultPortalSkinName
Deprecated, for removal: This API element is subject to removal in a future version.notion of 'default' portal doesn't exist anymoreGet the skin name of the default portal- Returns:
- Skin name of the default portal
-
getMetaPortalSkinName
Get the skin name of the default portal- Returns:
- Skin name of the default portal
-
getDefaultPortalConfig
@Deprecated(forRemoval=true, since="1.5.0") public org.exoplatform.portal.config.model.PortalConfig getDefaultPortalConfig()Deprecated, for removal: This API element is subject to removal in a future version.the default portal has been deprecated in favor of a meta site that aggregate other sites into it and which shares the same Shared Layout and Portal layout with aggregated sites. The notion of default portal doesn't exist anymore, since the default displayed portal/page will be the first portal + navigation determined switch 'display-order' of portal (portal.xml) and 'node' order definition (navigation.xml)Get the PortalConfig object of the default portal- Returns:
- PortalConfig object 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
-