Package org.ametys.cms.tag
Class GetCMSTagsAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GetTagsAction
SAX events for tags
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user provider.protected 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected UserIdentity
Provides the current user.Get filtered tagsgetProvidersIds
(boolean onlyCustomTags) Get all providers IDsGet the tag provider extension point roleprotected boolean
isCreationAllowed
(TagProvider<? extends Tag> tagProvider, Tag tag) Determines if the current user can created tagprotected boolean
Determines if a tag is privateprotected boolean
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) tagToJSON
(Tag tag, TagProvider<? extends Tag> tagProvider, List<String> objectTargetIds, Map<String, Object> jsParameters) Get tag's properties to JSON formatMethods 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 Details
-
_rightManager
The rights manager. -
_currentUserProvider
The current user provider.
-
-
Constructor Details
-
GetCMSTagsAction
public GetCMSTagsAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractGetTagsAction
- Throws:
ServiceException
-
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
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
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
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
Determines if a tag is private- Parameters:
tag
- the tag to test- Returns:
- true if a tag is private
-
_getCurrentUser
Provides the current user.- Returns:
- the current user which cannot be
null
.
-