Package org.ametys.web.repository.page
Class SitemapDAO
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.web.repository.page.SitemapDAO
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
DAO for manipulating pages
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionconvertPathToId
(String siteName, String lang, String path) Get the id of a page from its site name, language and sitemap's pathfilterPagesByRegExp
(String id, String value) Get the path of pages which match filter regexpgetDecorators
(String siteName) Get the sitemap's decoratorsgetPageProperties
(String pageId) Get the properties of a page in order to display it into a sitemap treegetPageProperties
(Page page) Get the properties of a page in order to display it into a sitemap treegetPageProperties
(Page page, List<String> rightsToCheck) Get the properties of a page in order to display it into a sitemap treegetProperties
(String siteName, String lang) Get properties of a site, sitemap or on sites root nodegetSitemap
(String sitemapId) Get sitemap propertiesgetSitemapProperties
(String siteName, String lang, List<String> rights) Get the sitemap properties as JSON objectgetSitemapProperties
(Sitemap sitemap, List<String> rightsToCheck) Get the sitemap properties into a JSON objectgetUserRights
(Sitemap sitemap) Get the user rights on a sitemapboolean
isCurrentUserAllowed
(PagesContainer pageContainer, List<String> rights) Determines if the current user has the requested right on this pages containervoid
service
(ServiceManager smanager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The component's role
-
-
Constructor Details
-
SitemapDAO
public SitemapDAO()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getSitemap
Get sitemap properties- Parameters:
sitemapId
- the sitemap ID- Returns:
- the sitemap's properties or null if not found
-
getProperties
Get properties of a site, sitemap or on sites root node- Parameters:
siteName
- the site name. Set to null to get properties of sites root nodelang
- the sitemap language. Set to null to get properties of site node- Returns:
- the properties
-
getSitemapProperties
Get the sitemap properties as JSON object- Parameters:
siteName
- the site name. Set to null to get properties of sites root nodelang
- the sitemap language. Set to null to get properties of site noderights
- If not null, the sitemap properties will contain a 'isAllowed' property based on user rights. Can be null.- Returns:
- the sitemap properties
-
getSitemapProperties
Get the sitemap properties into a JSON object- Parameters:
sitemap
- The sitemaprightsToCheck
- If not null, the sitemap properties will contain a 'isAllowed' property based on user rights. Can be null.- Returns:
- the sitemap properties
-
getPageProperties
Get the properties of a page in order to display it into a sitemap tree- Parameters:
pageId
- The page's id- Returns:
- The page's properties
-
getPageProperties
Get the properties of a page in order to display it into a sitemap tree- Parameters:
page
- The page- Returns:
- The page's properties
-
getPageProperties
Get the properties of a page in order to display it into a sitemap tree- Parameters:
page
- The pagerightsToCheck
- If not null, the page properties will contain a 'isAllowed' property based on user rights- Returns:
- The page's properties
-
isCurrentUserAllowed
Determines if the current user has the requested right on this pages container- Parameters:
pageContainer
- The pages containerrights
- The rights to check- Returns:
- true if the current user is allowed
-
filterPagesByRegExp
Get the path of pages which match filter regexp- Parameters:
id
- The id of page or sitemap to start searchvalue
- the value to match- Returns:
- the matching paths
-
getDecorators
Get the sitemap's decorators- Parameters:
siteName
- the site name- Returns:
- the list of decorators
-
convertPathToId
Get the id of a page from its site name, language and sitemap's path- Parameters:
siteName
- The site namelang
- The languagepath
- the page's path. Can be null to get sitemap's id- Returns:
- the page id or null if not found
-
getUserRights
Get the user rights on a sitemap- Parameters:
sitemap
- the sitemap- Returns:
- The user's rights
-