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
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:
-
Field Summary
FieldsFields inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase
actionAccessRestrictions, actionDefinition, applicableTypes, publicActionFields inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase
adhocPropertiesAllowed, DISPLAY_LABEL, runtimeActionServiceFields inherited from class org.alfresco.repo.action.CommonResourceAbstractBase
nameFields inherited from interface org.alfresco.repo.action.executer.ActionExecuter
PARAM_RESULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddExtractedMetadataToNode(NodeRef actionedUponNodeRef, Map<QName, Serializable> nodeProperties, Map<QName, Serializable> modifiedProperties, NodeService nodeService, DictionaryService dictionaryService, TaggingService taggingService, boolean enableStringTagging, boolean carryAspectProperties, List<String> stringTaggingSeparators) protected voidAdds the parameter definitions to the listprotected voidaddTags(NodeRef actionedUponNodeRef, PropertyDefinition propertyDef, Serializable rawValue) Iterates the values of the taggable property which the metadata extractor should have already attempted to convert values toNodeRefs.voidexecuteImpl(Action ruleAction, NodeRef actionedUponNodeRef) Execute the action implementationbooleanisExecuteAsynchronously(NodeRef actionedUponNodeRef) Used by the action service to work out if it should override the executeAsychronously value when it is know the extract will take place asynchronously anyway.voidsetCarryAspectProperties(boolean carryAspectProperties) Whether or not aspect-related properties must be carried to the new version of the nodevoidsetContentService(ContentService contentService) voidsetDictionaryService(DictionaryService dictService) Set the dictionary servicevoidsetEnableStringTagging(boolean enableStringTagging) Whether or not to enable mapping of simple strings to cm:taggable tagsvoidsetMetadataExtracterRegistry(MetadataExtracterRegistry metadataExtracterRegistry) voidsetNodeService(NodeService nodeService) voidsetStringTaggingSeparators(List<String> stringTaggingSeparators) List of string separators - note: all will be applied to a given stringvoidsetTaggingService(TaggingService taggingService) Methods inherited from class org.alfresco.repo.action.executer.ActionExecuterAbstractBase
createActionDefinition, execute, getActionAccessRestrictions, getActionDefinition, getIgnoreLock, getQueueName, getTrackStatus, init, isApplicableType, onLogException, setActionAccessRestrictions, setApplicableTypes, setBaseNodeService, setIgnoreLock, setLockService, setMlAwareNodeService, setPublicAction, setQueueName, setTrackStatus, verifyActionAccessRestrictionsMethods inherited from class org.alfresco.repo.action.ParameterizedItemAbstractBase
checkMandatoryProperties, getAdhocPropertiesAllowed, getDescriptionKey, getLocalizedParameterDefinitions, getParamDisplayLabel, getParamDisplayLabel, getParameterDefintions, getTitleKey, setAdhocPropertiesAllowed, setLocales, setRuntimeActionService, toStringMethods inherited from class org.alfresco.repo.action.CommonResourceAbstractBase
setBeanName
-
Field Details
-
EXECUTOR_NAME
- See Also:
-
DEFAULT_STRING_TAGGING_SEPARATORS
-
stringTaggingSeparators
-
-
Constructor Details
-
ContentMetadataExtracter
public ContentMetadataExtracter()
-
-
Method Details
-
setNodeService
- Parameters:
nodeService- the node service
-
setContentService
- Parameters:
contentService- The contentService to set.
-
setDictionaryService
Description copied from class:ActionExecuterAbstractBaseSet the dictionary service- Overrides:
setDictionaryServicein classActionExecuterAbstractBase- Parameters:
dictService- The DictionaryService to set.
-
setTaggingService
- Parameters:
taggingService- The TaggingService to set.
-
setMetadataExtracterRegistry
- 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
List of string separators - note: all will be applied to a given string- Parameters:
stringTaggingSeparators-
-
addTags
protected void addTags(NodeRef actionedUponNodeRef, PropertyDefinition propertyDef, 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
-
isExecuteAsynchronously
Used by the action service to work out if it should override the executeAsychronously value when it is know the extract will take place asynchronously anyway. Results in the action being processed post commit, which allows it to see node changes.- Parameters:
actionedUponNodeRef- the node to be processed.- Returns:
- true if the AsynchronousExtractor will be used. false otherwise.
-
executeImpl
Description copied from class:ActionExecuterAbstractBaseExecute the action implementation- Specified by:
executeImplin classActionExecuterAbstractBase- Parameters:
ruleAction- the actionactionedUponNodeRef- the actioned upon node- See Also:
-
addExtractedMetadataToNode
public static void addExtractedMetadataToNode(NodeRef actionedUponNodeRef, Map<QName, Serializable> nodeProperties, Map<QName, Serializable> modifiedProperties, NodeService nodeService, DictionaryService dictionaryService, TaggingService taggingService, boolean enableStringTagging, boolean carryAspectProperties, List<String> stringTaggingSeparators) -
addParameterDefinitions
Description copied from class:ParameterizedItemAbstractBaseAdds the parameter definitions to the list- Specified by:
addParameterDefinitionsin classParameterizedItemAbstractBase- Parameters:
arg0- the parameter definitions list
-