Class XmlMetadataExtracter

    • Field Detail

      • SUPPORTED_MIMETYPES

        public static java.lang.String[] SUPPORTED_MIMETYPES
    • Constructor Detail

      • XmlMetadataExtracter

        public XmlMetadataExtracter()
        Default constructor
    • Method Detail

      • setSelectors

        public void setSelectors​(java.util.List<ContentWorkerSelector<MetadataExtracter>> selectors)
        Sets the list of metadata selectors to use to find the extracter to use, given some content. The evaluations are done in the order that they occur in the list.
        Parameters:
        selectors - A list of selectors
      • extract

        public java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> extract​(org.alfresco.service.cmr.repository.ContentReader reader,
                                                                                                      MetadataExtracter.OverwritePolicy overwritePolicy,
                                                                                                      java.util.Map<org.alfresco.service.namespace.QName,​java.io.Serializable> destination,
                                                                                                      java.util.Map<java.lang.String,​java.util.Set<org.alfresco.service.namespace.QName>> mapping)
        Selects and extracter to perform the work and redirects to it.
        Specified by:
        extract in interface MetadataExtracter
        Overrides:
        extract in class AbstractMappingMetadataExtracter
        Parameters:
        reader - the source of the content
        overwritePolicy - the policy stipulating how the system properties must be overwritten if present
        destination - the map of properties to populate (essentially a return value)
        mapping - a mapping of document-specific properties to system properties.
        Returns:
        Returns a map of all properties on the destination map that were added or modified. If the return map is empty, then no properties were modified.
        See Also:
        MetadataExtracter.extract(ContentReader, Map)
      • extractRaw

        protected java.util.Map<java.lang.String,​java.io.Serializable> extractRaw​(org.alfresco.service.cmr.repository.ContentReader reader)
                                                                                 throws java.lang.Throwable
        This is not required as the
        Specified by:
        extractRaw in class AbstractMappingMetadataExtracter
        Parameters:
        reader - the document to extract the values from. This stream provided by the reader must be closed if accessed directly.
        Returns:
        Returns a map of document property values keyed by property name.
        Throws:
        java.lang.Throwable - All exception conditions can be handled.
        See Also:
        AbstractMappingMetadataExtracter.getDefaultMapping()