public class SitemapDAO extends AbstractLogEnabled implements Serviceable, Component
| Modifier and Type | Field and Description |
|---|---|
private CurrentUserProvider |
_currentUserProvider |
private AmetysObjectResolver |
_resolver |
private RightManager |
_rightManager |
private SiteManager |
_siteManager |
private SitemapDecoratorsHandler |
_sitemapHandler |
static String |
ROLE
The component's role
|
| Constructor and Description |
|---|
SitemapDAO() |
| Modifier and Type | Method and Description |
|---|---|
private void |
_getMatchingPages(Page page,
String value,
List<String> matchingPaths) |
String |
convertPathToId(String siteName,
String lang,
String path)
Get the id of a page from its site name, language and sitemap's path
|
List<String> |
filterPagesByRegExp(String id,
String value)
Get the path of pages which match filter regexp
|
List<Map<String,Object>> |
getDecorators(String siteName)
Get the sitemap's decorators
|
Map<String,Object> |
getPageProperties(Page page)
Get the properties of a page in order to display it into a sitemap tree
|
Map<String,Object> |
getPageProperties(Page page,
List<String> rightsToCheck)
Get the properties of a page in order to display it into a sitemap tree
|
Map<String,Object> |
getPageProperties(String pageId)
Get the properties of a page in order to display it into a sitemap tree
|
Map<String,Object> |
getProperties(String siteName,
String lang)
Get properties of a site, sitemap or on sites root node
|
Map<String,Object> |
getSitemap(String sitemapId)
Get sitemap properties
|
Map<String,Object> |
getSitemapProperties(Sitemap sitemap,
List<String> rightsToCheck)
Get the sitemap properties into a JSON object
|
Map<String,Object> |
getSitemapProperties(String siteName,
String lang,
List<String> rights)
Get the sitemap properties as JSON object
|
protected Set<String> |
getUserRights(Sitemap sitemap)
Get the user rights on a sitemap
|
boolean |
isCurrentUserAllowed(PagesContainer pageContainer,
List<String> rights)
Determines if the current user has the requested right on this pages container
|
void |
service(ServiceManager smanager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLoggerprivate AmetysObjectResolver _resolver
private RightManager _rightManager
private CurrentUserProvider _currentUserProvider
private SiteManager _siteManager
private SitemapDecoratorsHandler _sitemapHandler
public SitemapDAO()
public void service(ServiceManager smanager) throws ServiceException
service in interface ServiceableServiceExceptionpublic Map<String,Object> getSitemap(String sitemapId)
sitemapId - the sitemap IDpublic Map<String,Object> getProperties(String siteName, String lang)
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 nodepublic Map<String,Object> getSitemapProperties(String siteName, String lang, List<String> rights)
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.public Map<String,Object> getSitemapProperties(Sitemap sitemap, List<String> rightsToCheck)
sitemap - The sitemaprightsToCheck - If not null, the sitemap properties will contain a 'isAllowed' property based on user rights. Can be null.public Map<String,Object> getPageProperties(String pageId)
pageId - The page's idpublic Map<String,Object> getPageProperties(Page page)
page - The pagepublic Map<String,Object> getPageProperties(Page page, List<String> rightsToCheck)
page - The pagerightsToCheck - If not null, the page properties will contain a 'isAllowed' property based on user rightspublic boolean isCurrentUserAllowed(PagesContainer pageContainer, List<String> rights)
pageContainer - The pages containerrights - The rights to checkpublic List<String> filterPagesByRegExp(String id, String value)
id - The id of page or sitemap to start searchvalue - the value to matchprivate void _getMatchingPages(Page page, String value, List<String> matchingPaths)
public List<Map<String,Object>> getDecorators(String siteName)
siteName - the site namepublic String convertPathToId(String siteName, String lang, String path)
siteName - The site namelang - The languagepath - the page's path. Can be null to get sitemap's idprotected Set<String> getUserRights(Sitemap sitemap)
sitemap - the sitemap