Package org.ametys.cms.tag
Class AbstractGetTagsAction
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.acting.AbstractAction
org.apache.cocoon.acting.ServiceableAction
org.ametys.cms.tag.AbstractGetTagsAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,Action
- Direct Known Subclasses:
GetCategoriesAction
,GetCMSTagsAction
,GetKeywordsAction
,GetProjectTagsAction
,GetThemesTagAction
SAX events for tags
-
Field Summary
Modifier and TypeFieldDescriptionprotected AmetysObjectResolver
The Ametys object resolverprotected AbstractTagProviderExtensionPoint<? extends Tag>
The tag provider extension pointFields 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 TypeMethodDescriptionGet filtered tagsact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) Returns the tag providers' idgetProvidersIds
(boolean onlyCustomTags) Get all providers IDsabstract String
Get the tag provider extension point roleprotected boolean
isCreationAllowed
(TagProvider<? extends Tag> tagProvider, Tag tag) Determines if the current user can created tagprotected boolean
Test if a tag is visible to the current user.providerToJSON
(TagProvider<? extends Tag> tagProvider, Map<String, Object> contextualParameters, Map<String, Object> jsParameters) Get tag provider's properties to JSON formatvoid
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.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_tagProviderExtPt
The tag provider extension point -
_resolver
The Ametys object resolver
-
-
Constructor Details
-
AbstractGetTagsAction
public AbstractGetTagsAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classServiceableAction
- Throws:
ServiceException
-
getTagProviderEPRole
Get the tag provider extension point role- Returns:
- the tag provider extension point role
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws IOException, SAXException, ProcessingException -
_getFilteredTags
protected Map<String,? extends Tag> _getFilteredTags(Map<String, ? extends Tag> tags, Map<String, Object> jsParameters) Get filtered tags- Parameters:
tags
- the tags to filterjsParameters
- the js parameters- Returns:
- the map of tags
-
getProvidersIds
Get all providers IDs- Parameters:
onlyCustomTags
- If true, return only JCR providers IDs.- Returns:
- a set of providers IDs
-
getProvidersId
Returns the tag providers' id- Returns:
- The id of tag providers
-
tagToJSON
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- Parameters:
tag
- The tagtagProvider
- the tag providerobjectTargetIds
- the list of Ametys object ids. Can be emptyjsParameters
- the js parameters- Returns:
- The tag properties
-
providerToJSON
protected Map<String,Object> providerToJSON(TagProvider<? extends Tag> tagProvider, Map<String, Object> contextualParameters, Map<String, Object> jsParameters) Get tag provider's properties to JSON format- Parameters:
tagProvider
- the tag providercontextualParameters
- The contextual parametersjsParameters
- The js parameters- Returns:
- The tag providers properties
- Throws:
AmetysRepositoryException
- If an error occurred
-
isUserAuthorized
protected boolean isUserAuthorized(Tag tag, List<String> objectTargetIds, Map<String, Object> jsParameters) Test if a tag is visible to the current user.- 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
Determines if the current user can created tag- Parameters:
tagProvider
- The tag providertag
- The tag. Can be null.- Returns:
- true if creation is allowed
-