public class XmlMetadataExtracter extends AbstractMappingMetadataExtracter
The selectors are used to find an extracter
most appropriate of a given XML document. The chosen extracter is then asked
to extract the values, passing through the
MetadataExtracter.OverwritePolicy
as
AbstractMappingMetadataExtracter.setOverwritePolicy(org.alfresco.repo.content.metadata.MetadataExtracter.OverwritePolicy) on this instance. The overwrite
policy of the embedded extracters is not relevant unless they are used
separately in another context.
ContentWorkerSelector
,
MetadataExtracter
MetadataExtracter.OverwritePolicy
Modifier and Type | Field and Description |
---|---|
static String[] |
SUPPORTED_MIMETYPES |
MEGABYTE_SIZE, metadataExtracterConfig, NAMESPACE_PROPERTY_PREFIX, PROPERTY_COMPONENT_EMBED, PROPERTY_COMPONENT_EXTRACT, PROPERTY_PREFIX_METADATA
Constructor and Description |
---|
XmlMetadataExtracter()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
Map<org.alfresco.service.namespace.QName,Serializable> |
extract(org.alfresco.service.cmr.repository.ContentReader reader,
MetadataExtracter.OverwritePolicy overwritePolicy,
Map<org.alfresco.service.namespace.QName,Serializable> destination,
Map<String,Set<org.alfresco.service.namespace.QName>> mapping)
Selects and extracter to perform the work and redirects to it.
|
protected Map<String,Serializable> |
extractRaw(org.alfresco.service.cmr.repository.ContentReader reader)
This is not required as the
|
protected Map<String,Set<org.alfresco.service.namespace.QName>> |
getDefaultMapping()
It is not possible to have any default mappings, but something has to be
returned.
|
protected void |
init()
Provides a hook point for implementations to perform initialization.
|
void |
setSelectors(List<ContentWorkerSelector<MetadataExtracter>> selectors)
Sets the list of metadata selectors to use to find the extracter to use,
given some content.
|
checkIsEmbedSupported, checkIsSupported, embed, embedInternal, extract, extract, filterSystemProperties, getBeanName, getDefaultEmbedMapping, getEmbedMapping, getExecutorService, getLimits, getMapping, getMimetypeService, isEmbeddingSupported, isSupported, makeDate, newRawMap, putRawValue, readEmbedMappingProperties, readEmbedMappingProperties, readGlobalEmbedMappingProperties, readGlobalExtractMappingProperties, readMappingProperties, readMappingProperties, register, setApplicationContext, setBeanName, setDictionaryService, setEmbedMapping, setEmbedMappingProperties, setEnableStringTagging, setExecutorService, setFailOnTypeConversion, setInheritDefaultEmbedMapping, setInheritDefaultMapping, setMapping, setMappingProperties, setMetadataExtracterConfig, setMimetypeLimits, setMimetypeService, setOverwritePolicy, setProperties, setRegistry, setSupportedDateFormats, setSupportedEmbedMimetypes, setSupportedMimetypes
public static String[] SUPPORTED_MIMETYPES
public void setSelectors(List<ContentWorkerSelector<MetadataExtracter>> selectors)
selectors
- A list of selectorsprotected void init()
AbstractMappingMetadataExtracter
default mappings
will be requested during
initialization.init
in class AbstractMappingMetadataExtracter
protected Map<String,Set<org.alfresco.service.namespace.QName>> getDefaultMapping()
getDefaultMapping
in class AbstractMappingMetadataExtracter
AbstractMappingMetadataExtracter.setInheritDefaultMapping(boolean inherit)
public Map<org.alfresco.service.namespace.QName,Serializable> extract(org.alfresco.service.cmr.repository.ContentReader reader, MetadataExtracter.OverwritePolicy overwritePolicy, Map<org.alfresco.service.namespace.QName,Serializable> destination, Map<String,Set<org.alfresco.service.namespace.QName>> mapping)
extract
in interface MetadataExtracter
extract
in class AbstractMappingMetadataExtracter
reader
- the source of the contentoverwritePolicy
- the policy stipulating how the system properties must be
overwritten if presentdestination
- the map of properties to populate (essentially a return value)mapping
- a mapping of document-specific properties to system properties.MetadataExtracter.extract(ContentReader, Map)
protected Map<String,Serializable> extractRaw(org.alfresco.service.cmr.repository.ContentReader reader) throws Throwable
extractRaw
in class AbstractMappingMetadataExtracter
reader
- the document to extract the values from. This stream provided by
the reader must be closed if accessed directly.Throwable
- All exception conditions can be handled.AbstractMappingMetadataExtracter.getDefaultMapping()
Copyright © 2005–2017 Alfresco Software. All rights reserved.