public class ImportTagsAction extends AbstractNotifierAction
Modifier and Type | Field and Description |
---|---|
private static String[] |
_ALLOWED_EXTENSIONS |
private int |
_createdTagsCount
The count of new tags
|
private int |
_errorCount
The count of error
|
protected JSONUtils |
_jsonUtils
The JSon Utils Component
|
protected AmetysObjectResolver |
_resolver
The Ametys object resolver
|
protected TagProviderExtensionPoint |
_tagProviderExtPt
The tag provider extension point
|
protected TagTargetTypeExtensionPoint |
_targetTypeEP
Target types
|
private int |
_updatedTagsCount
The count of updated tags
|
_observationManager
manager
EMPTY_MAP
Constructor and Description |
---|
ImportTagsAction() |
Modifier and Type | Method and Description |
---|---|
private String |
_findUniqueName(String originalName,
Map<String,Object> contextualParameters) |
private Set<TagProvider> |
_getTagProviders() |
private boolean |
_hasTag(Set<TagProvider> providers,
String name,
Map<String,Object> contextualParameters) |
Map |
act(Redirector redirector,
SourceResolver resolver,
Map objectModel,
String source,
Parameters parameters) |
protected I18nizableText |
configureDescription(Configuration configuration,
String defaultCatalogue)
Configure description from the passed configuration
|
protected I18nizableText |
configureLabel(Configuration configuration,
String defaultCatalogue)
Configure label from the passed configuration
|
protected Map<String,Tag> |
configureTags(Configuration configuration,
Tag parent,
String defaultCatalogue)
Configure tag from the passed configuration
|
protected void |
createOrUpdateTags(DefaultTraversableAmetysObject<?> parent,
Map<String,Tag> tags,
Map<String,Object> contextualParameters)
Save or update a tag
|
protected Configuration |
initializeTags(String path)
Initialize a configuration tags from the tags file.
|
void |
service(ServiceManager smanager) |
_getCurrentUser
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final String[] _ALLOWED_EXTENSIONS
protected TagProviderExtensionPoint _tagProviderExtPt
protected AmetysObjectResolver _resolver
protected TagTargetTypeExtensionPoint _targetTypeEP
protected JSONUtils _jsonUtils
private int _createdTagsCount
private int _updatedTagsCount
private int _errorCount
public ImportTagsAction()
public void service(ServiceManager smanager) throws ServiceException
service
in interface Serviceable
service
in class AbstractNotifierAction
ServiceException
public Map act(Redirector redirector, SourceResolver resolver, Map objectModel, String source, Parameters parameters) throws Exception
Exception
protected void createOrUpdateTags(DefaultTraversableAmetysObject<?> parent, Map<String,Tag> tags, Map<String,Object> contextualParameters)
parent
- the JCR parent tag or providertags
- the list of tags to add or updatecontextualParameters
- Contextual parameters transmitted by the environment.protected Configuration initializeTags(String path) throws Exception
path
- the path of the file to initialize tags.Exception
- if an error occurs.protected Map<String,Tag> configureTags(Configuration configuration, Tag parent, String defaultCatalogue) throws ConfigurationException
configuration
- The configurationparent
- The parent tag if anydefaultCatalogue
- The default catalogue for i18nTag
ConfigurationException
- If an error occurredprotected I18nizableText configureLabel(Configuration configuration, String defaultCatalogue) throws ConfigurationException
configuration
- The configurationdefaultCatalogue
- The default catalogueConfigurationException
- If an error occurredprotected I18nizableText configureDescription(Configuration configuration, String defaultCatalogue) throws ConfigurationException
configuration
- The configurationdefaultCatalogue
- The default catalogueConfigurationException
- If an error occurredprivate String _findUniqueName(String originalName, Map<String,Object> contextualParameters)
private boolean _hasTag(Set<TagProvider> providers, String name, Map<String,Object> contextualParameters)
private Set<TagProvider> _getTagProviders()