Package org.ametys.web.site
Class AddPageWizardHelper
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.web.site.AddPageWizardHelper
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
public class AddPageWizardHelper extends AbstractLogEnabled implements Serviceable, Component
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
Current User Providerprotected I18nUtils
_i18nUtils
The I18n utilsprotected AmetysObjectResolver
_resolver
Ametys Object Resolverprotected RightManager
_rightManager
Right Managerprotected TagsDAO
_tagsDAO
Tags DAOstatic String
ROLE
Avalon Role
-
Constructor Summary
Constructors Constructor Description AddPageWizardHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Map<String,Object>
getPageDetails(AmetysObject page, UserIdentity user, int depth, String separator)
get the id, rights and formatted title of a pageMap<String,Object>
getPageInfos(String pageId, int depth, String separator)
Get the page's propertiesList<Map<String,Object>>
getPagesInfos(List<String> pageIds, int depth, String separator)
Get the page's propertiesprivate List<Map<String,Object>>
getSubTags(Tag tag, Tag rootTag, List<String> filters, String targetType, boolean showCategories, String separator)
Iterate over all sub-tags for a tag and list them with their full nameprotected String
getTagFullName(Tag tag, Tag rootTag, String separator)
Get the formatted tag name for a tag, with it's parents namesList<Map<String,Object>>
getTags(List<String> tagNames, List<String> filters, String targetType, boolean showCategories, String separator, Map<String,Object> contextualParameters)
Get the list of sub-tags for a list of input tagsprotected boolean
isTagAvailable(Tag tag, List<String> filters, String targetType)
Check if we can use this tagprivate Map<String,Object>
parseTag(Tag tag, Tag rootTag, String separator)
void
service(ServiceManager manager)
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_resolver
protected AmetysObjectResolver _resolver
Ametys Object Resolver
-
_rightManager
protected RightManager _rightManager
Right Manager
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
Current User Provider
-
_i18nUtils
protected I18nUtils _i18nUtils
The I18n utils
-
-
Constructor Detail
-
AddPageWizardHelper
public AddPageWizardHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getPageInfos
public Map<String,Object> getPageInfos(String pageId, int depth, String separator)
Get the page's properties- Parameters:
pageId
- the page IDdepth
- number of parents to fetch to generate the title (0 to display only the page name)separator
- separator between the parents (e.g. " > " to have "grandParent > parent > page")- Returns:
- the properties
-
getPagesInfos
public List<Map<String,Object>> getPagesInfos(List<String> pageIds, int depth, String separator)
Get the page's properties- Parameters:
pageIds
- the page IDsdepth
- number of parents to fetch to generate the title (0 to display only the page name)separator
- separator between the parents (e.g. " > " to have "grandParent > parent > page")- Returns:
- the properties
-
getPageDetails
protected Map<String,Object> getPageDetails(AmetysObject page, UserIdentity user, int depth, String separator)
get the id, rights and formatted title of a page- Parameters:
page
- page/sitemap to work onuser
- user to check rightsdepth
- number of parents to fetch to generate the title (0 to display only the page name)separator
- separator between the parents (e.g. " > " to have "grandParent > parent > page")- Returns:
- a map with id (String), rights (Set<String>) and title (String)
-
getTags
public List<Map<String,Object>> getTags(List<String> tagNames, List<String> filters, String targetType, boolean showCategories, String separator, Map<String,Object> contextualParameters)
Get the list of sub-tags for a list of input tags- Parameters:
tagNames
- name of input tags where we want to get the list of contained tagsfilters
- list of filters to disable, can contain PAGE_PRIVATE, CONTENT_PRIVATE, PAGE, CONTENTtargetType
- tag target typeshowCategories
- true to display tags containing other tags. If false, only the non-parents tags will be listedseparator
- separator between the parents (e.g. " > " to have "grandParent > parent > page")contextualParameters
- the contextual parameters- Returns:
- a list with one item per requested tagName, each one containing name (String), title (String) and tags (List of Map<String, String>, each map containing a name and title)
-
isTagAvailable
protected boolean isTagAvailable(Tag tag, List<String> filters, String targetType)
Check if we can use this tag- Parameters:
tag
- tag to checkfilters
- list of filters to disable, can contain PAGE_PRIVATE, CONTENT_PRIVATE, PAGE, CONTENTtargetType
- tag target type- Returns:
- true if this tag is not impacted by the input filters
-
getSubTags
private List<Map<String,Object>> getSubTags(Tag tag, Tag rootTag, List<String> filters, String targetType, boolean showCategories, String separator)
Iterate over all sub-tags for a tag and list them with their full name- Parameters:
tag
- tag to iterate overrootTag
- needed to display the hierarchy in the full namefilters
- list of filters to disable, can contain PAGE_PRIVATE, CONTENT_PRIVATE, PAGE, CONTENTtargetType
- tag target typeshowCategories
- true to display tags containing other tags. If false, only the non-parents tags will be listedseparator
- separator between the parents (e.g. " > " to have "grandParent > parent > page")- Returns:
- a list with one item per requested tagName, each one containing name (String), title (String) and tags (List of Map<String, String>, each map containing a name and title)
-
getTagFullName
protected String getTagFullName(Tag tag, Tag rootTag, String separator)
Get the formatted tag name for a tag, with it's parents names- Parameters:
tag
- tag to find the namerootTag
- root tag to display full name until this tagseparator
- separator between the parents (e.g. " > " to have "grandParent > parent > child")- Returns:
- a formatted name
-
-