Class ContentMetadataExtracter
- java.lang.Object
-
- org.alfresco.repo.action.CommonResourceAbstractBase
-
- org.alfresco.repo.action.ParameterizedItemAbstractBase
-
- org.alfresco.repo.action.executer.ActionExecuterAbstractBase
-
- org.alfresco.repo.action.executer.ContentMetadataExtracter
-
- All Implemented Interfaces:
ActionExecuter,LoggingAwareExecuter,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
public class ContentMetadataExtracter extends ActionExecuterAbstractBase
Extract metadata from any added content.Currently, the default overwrite policy for each extracter is used. (TODO: Add overwrite policy as a parameter.)
- Author:
- Jesper Steen Møller
- See Also:
MetadataExtracter.OverwritePolicy
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringEXECUTOR_NAMEprotected java.util.List<java.lang.String>stringTaggingSeparators-
Fields inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase
actionDefinition, applicableTypes, publicAction
-
Fields inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase
adhocPropertiesAllowed, DISPLAY_LABEL, runtimeActionService
-
Fields inherited from class org.alfresco.repo.action.CommonResourceAbstractBase
name
-
Fields inherited from interface org.alfresco.repo.action.executer.ActionExecuter
PARAM_RESULT
-
-
Constructor Summary
Constructors Constructor Description ContentMetadataExtracter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddParameterDefinitions(java.util.List<ParameterDefinition> arg0)Adds the parameter definitions to the listprotected voidaddTags(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, java.io.Serializable rawValue)Iterates the values of the taggable property which the metadata extractor should have already attempted to convert values toNodeRefs.voidexecuteImpl(Action ruleAction, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)Execute the action implementationvoidsetCarryAspectProperties(boolean carryAspectProperties)Whether or not aspect-related properties must be carried to the new version of the nodevoidsetContentService(ContentService contentService)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictService)Set the dictionary servicevoidsetEnableStringTagging(boolean enableStringTagging)Whether or not to enable mapping of simple strings to cm:taggable tagsvoidsetMetadataExtracterRegistry(MetadataExtracterRegistry metadataExtracterRegistry)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetStringTaggingSeparators(java.util.List<java.lang.String> stringTaggingSeparators)List of string separators - note: all will be applied to a given stringvoidsetTaggingService(TaggingService taggingService)protected java.util.List<java.lang.String>splitTag(java.lang.String str)-
Methods inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase
createActionDefinition, execute, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, init, isApplicableType, onLogException, setApplicableTypes, setBaseNodeService, setIgnoreLock, setLockService, setMlAwareNodeService, setPublicAction, setQueueName, setTrackStatus
-
Methods inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase
checkMandatoryProperties, getAdhocPropertiesAllowed, getDescriptionKey, getLocalizedParameterDefinitions, getParamDisplayLabel, getParamDisplayLabel, getParameterDefintions, getTitleKey, setAdhocPropertiesAllowed, setLocales, setRuntimeActionService, toString
-
Methods inherited from class org.alfresco.repo.action.CommonResourceAbstractBase
setBeanName
-
-
-
-
Field Detail
-
EXECUTOR_NAME
public static final java.lang.String EXECUTOR_NAME
- See Also:
- Constant Field Values
-
stringTaggingSeparators
protected java.util.List<java.lang.String> stringTaggingSeparators
-
-
Method Detail
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
- Parameters:
nodeService- the node service
-
setContentService
public void setContentService(ContentService contentService)
- Parameters:
contentService- The contentService to set.
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictService)
Description copied from class:ActionExecuterAbstractBaseSet the dictionary service- Overrides:
setDictionaryServicein classActionExecuterAbstractBase- Parameters:
dictService- The DictionaryService to set.
-
setTaggingService
public void setTaggingService(TaggingService taggingService)
- Parameters:
taggingService- The TaggingService to set.
-
setMetadataExtracterRegistry
public void setMetadataExtracterRegistry(MetadataExtracterRegistry metadataExtracterRegistry)
- Parameters:
metadataExtracterRegistry- The metadataExtracterRegistry to set.
-
setCarryAspectProperties
public void setCarryAspectProperties(boolean carryAspectProperties)
Whether or not aspect-related properties must be carried to the new version of the node- Parameters:
carryAspectProperties- true (default) to carry all aspect-linked properties forward. false will clean the aspect of any unextracted values.
-
setEnableStringTagging
public void setEnableStringTagging(boolean enableStringTagging)
Whether or not to enable mapping of simple strings to cm:taggable tags- Parameters:
enableStringTagging- true find or create tags for each string mapped to cm:taggable. false (default) ignore mapping strings to tags.
-
setStringTaggingSeparators
public void setStringTaggingSeparators(java.util.List<java.lang.String> stringTaggingSeparators)
List of string separators - note: all will be applied to a given string- Parameters:
stringTaggingSeparators-
-
addTags
protected void addTags(org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, java.io.Serializable rawValue)Iterates the values of the taggable property which the metadata extractor should have already attempted to convert values toNodeRefs.If conversion by the metadata extracter failed due to a MalformedNodeRefException the taggable property should still contain raw string values.
Mixing of NodeRefs and string values is permitted so each raw value is checked for a valid NodeRef representation and if so, converts to a NodeRef, if not, adds as a tag via the
TaggingService.- Parameters:
actionedUponNodeRef- The NodeRef being actioned uponpropertyDef- the PropertyDefinition of the taggable propertyrawValue- the raw value from the metadata extracter
-
splitTag
protected java.util.List<java.lang.String> splitTag(java.lang.String str)
-
executeImpl
public void executeImpl(Action ruleAction, org.alfresco.service.cmr.repository.NodeRef actionedUponNodeRef)
Description copied from class:ActionExecuterAbstractBaseExecute the action implementation- Specified by:
executeImplin classActionExecuterAbstractBase- Parameters:
ruleAction- the actionactionedUponNodeRef- the actioned upon node- See Also:
ActionExecuter.execute(Action, NodeRef)
-
addParameterDefinitions
protected void addParameterDefinitions(java.util.List<ParameterDefinition> arg0)
Description copied from class:ParameterizedItemAbstractBaseAdds the parameter definitions to the list- Specified by:
addParameterDefinitionsin classParameterizedItemAbstractBase- Parameters:
arg0- the parameter definitions list
-
-