Package org.ametys.cms.tag
Class GetCMSTagsAction
-
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GetTagsAction
public class GetCMSTagsAction extends AbstractGetTagsAction
SAX events for tags
-
-
Field Summary
Fields Modifier and Type Field Description protected CurrentUserProvider
_currentUserProvider
The current user provider.protected RightManager
_rightManager
The rights manager.-
Fields inherited from class org.ametys.cms.tag.AbstractGetTagsAction
_resolver, _tagProviderExtPt
-
Fields inherited from class org.apache.cocoon.acting.ServiceableAction
manager
-
Fields inherited from class org.apache.cocoon.acting.AbstractAction
EMPTY_MAP
-
-
Constructor Summary
Constructors Constructor Description GetCMSTagsAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected UserIdentity
_getCurrentUser()
Provides the current user.protected Map<String,? extends Tag>
_getFilteredTags(Map<String,? extends Tag> tags, Map<String,Object> jsParameters)
Get filtered tagsprotected Set<String>
getProvidersIds(boolean onlyCustomTags)
Get all providers IDsString
getTagProviderEPRole()
Get the tag provider extension point roleprotected boolean
isCreationAllowed(TagProvider<? extends Tag> tagProvider, Tag tag)
Determines if the current user can created tagprotected boolean
isPrivate(Tag tag)
Determines if a tag is privateprotected boolean
isUserAuthorized(Tag tag, List<String> objectTargetIds, Map<String,Object> jsParameters)
Test if a tag is visible to the current user.protected boolean
isUserAuthorized(Tag tag, Content content)
Test if a tag is visible to the current user.void
service(ServiceManager serviceManager)
protected Map<String,Object>
tagToJSON(Tag tag, TagProvider<? extends Tag> tagProvider, List<String> objectTargetIds, Map<String,Object> jsParameters)
Get tag's properties to JSON format-
Methods inherited from class org.ametys.cms.tag.AbstractGetTagsAction
act, getProvidersId, providerToJSON
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_rightManager
protected RightManager _rightManager
The rights manager.
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider.
-
-
Constructor Detail
-
GetCMSTagsAction
public GetCMSTagsAction()
-
-
Method Detail
-
service
public void service(ServiceManager serviceManager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractGetTagsAction
- Throws:
ServiceException
-
getTagProviderEPRole
public String getTagProviderEPRole()
Description copied from class:AbstractGetTagsAction
Get the tag provider extension point role- Specified by:
getTagProviderEPRole
in classAbstractGetTagsAction
- Returns:
- the tag provider extension point role
-
_getFilteredTags
protected Map<String,? extends Tag> _getFilteredTags(Map<String,? extends Tag> tags, Map<String,Object> jsParameters)
Description copied from class:AbstractGetTagsAction
Get filtered tags- Overrides:
_getFilteredTags
in classAbstractGetTagsAction
- Parameters:
tags
- the tags to filterjsParameters
- the js parameters- Returns:
- the map of tags
-
getProvidersIds
protected Set<String> getProvidersIds(boolean onlyCustomTags)
Description copied from class:AbstractGetTagsAction
Get all providers IDs- Overrides:
getProvidersIds
in classAbstractGetTagsAction
- Parameters:
onlyCustomTags
- If true, return only JCR providers IDs.- Returns:
- a set of providers IDs
-
tagToJSON
protected Map<String,Object> tagToJSON(Tag tag, TagProvider<? extends Tag> tagProvider, List<String> objectTargetIds, Map<String,Object> jsParameters)
Description copied from class:AbstractGetTagsAction
Get tag's properties to JSON format- Overrides:
tagToJSON
in classAbstractGetTagsAction
- Parameters:
tag
- The tagtagProvider
- the tag providerobjectTargetIds
- the list of Ametys object ids. Can be emptyjsParameters
- the js parameters- Returns:
- The tag properties
-
isUserAuthorized
protected boolean isUserAuthorized(Tag tag, Content content)
Test if a tag is visible to the current user.- Parameters:
tag
- the Tag object.content
- the current content (can be null).- Returns:
- true if the user has access to the tag, false otherwise.
-
isUserAuthorized
protected boolean isUserAuthorized(Tag tag, List<String> objectTargetIds, Map<String,Object> jsParameters)
Description copied from class:AbstractGetTagsAction
Test if a tag is visible to the current user.- Overrides:
isUserAuthorized
in classAbstractGetTagsAction
- Parameters:
tag
- the Tag object.objectTargetIds
- the ids of current Ametys objectsjsParameters
- The js parameters- Returns:
- true if the user has access to the tag, false otherwise.
-
isCreationAllowed
protected boolean isCreationAllowed(TagProvider<? extends Tag> tagProvider, Tag tag)
Description copied from class:AbstractGetTagsAction
Determines if the current user can created tag- Overrides:
isCreationAllowed
in classAbstractGetTagsAction
- Parameters:
tagProvider
- The tag providertag
- The tag. Can be null.- Returns:
- true if creation is allowed
-
isPrivate
protected boolean isPrivate(Tag tag)
Determines if a tag is private- Parameters:
tag
- the tag to test- Returns:
- true if a tag is private
-
_getCurrentUser
protected UserIdentity _getCurrentUser()
Provides the current user.- Returns:
- the current user which cannot be
null
.
-
-