Class ContentMetadataExtracter

    • Field Detail

      • stringTaggingSeparators

        protected java.util.List<java.lang.String> stringTaggingSeparators
    • Constructor Detail

      • ContentMetadataExtracter

        public ContentMetadataExtracter()
    • 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.
      • 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 to NodeRefs.

        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 upon
        propertyDef - the PropertyDefinition of the taggable property
        rawValue - the raw value from the metadata extracter
      • splitTag

        protected java.util.List<java.lang.String> splitTag​(java.lang.String str)