Package org.ametys.cms.tag.jcr
Class ImportTagsAction
- All Implemented Interfaces:
Component
,LogEnabled
,Serviceable
,ThreadSafe
,Action
Import subscribers from a CSV or text file.
-
Field Summary
Modifier and TypeFieldDescriptionprotected JSONUtils
The JSon Utils Componentprotected AmetysObjectResolver
The Ametys object resolverprotected TagProviderExtensionPoint
The tag provider extension pointprotected TagTargetTypeExtensionPoint
Target typesFields inherited from class org.ametys.core.observation.AbstractNotifierAction
_observationManager
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 TypeMethodDescriptionact
(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) protected I18nizableText
configureDescription
(Configuration configuration, String defaultCatalogue) Configure description from the passed configurationprotected I18nizableText
configureLabel
(Configuration configuration, String defaultCatalogue) Configure label from the passed configurationconfigureTags
(Configuration configuration, CMSTag parent, String defaultCatalogue) Configure tag from the passed configurationprotected void
createOrUpdateTags
(DefaultTraversableAmetysObject<?> parent, Map<String, CMSTag> tags, Map<String, Object> contextualParameters) Save or update a tagprotected Configuration
initializeTags
(String path) Initialize a configuration tags from the tags file.void
service
(ServiceManager smanager) Methods inherited from class org.ametys.core.util.cocoon.AbstractCurrentUserProviderServiceableAction
_getCurrentUser
Methods 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 -
_targetTypeEP
Target types -
_jsonUtils
The JSon Utils Component
-
-
Constructor Details
-
ImportTagsAction
public ImportTagsAction()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractNotifierAction
- Throws:
ServiceException
-
act
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception - Throws:
Exception
-
createOrUpdateTags
protected void createOrUpdateTags(DefaultTraversableAmetysObject<?> parent, Map<String, CMSTag> tags, Map<String, Object> contextualParameters) Save or update a tag- Parameters:
parent
- the JCR parent tag or providertags
- the list of tags to add or updatecontextualParameters
- Contextual parameters transmitted by the environment.
-
initializeTags
Initialize a configuration tags from the tags file.- Parameters:
path
- the path of the file to initialize tags.- Returns:
- The configuration
- Throws:
Exception
- if an error occurs.
-
configureTags
protected Map<String,CMSTag> configureTags(Configuration configuration, CMSTag parent, String defaultCatalogue) throws ConfigurationException Configure tag from the passed configuration- Parameters:
configuration
- The configurationparent
- The parent tag if anydefaultCatalogue
- The default catalogue for i18n- Returns:
- a Set of
CMSTag
- Throws:
ConfigurationException
- If an error occurred
-
configureLabel
protected I18nizableText configureLabel(Configuration configuration, String defaultCatalogue) throws ConfigurationException Configure label from the passed configuration- Parameters:
configuration
- The configurationdefaultCatalogue
- The default catalogue- Returns:
- The label
- Throws:
ConfigurationException
- If an error occurred
-
configureDescription
protected I18nizableText configureDescription(Configuration configuration, String defaultCatalogue) throws ConfigurationException Configure description from the passed configuration- Parameters:
configuration
- The configurationdefaultCatalogue
- The default catalogue- Returns:
- The description
- Throws:
ConfigurationException
- If an error occurred
-