public abstract class TikaPoweredMetadataExtracter extends AbstractMappingMetadataExtracter implements MetadataEmbedder
author: -- cm:author title: -- cm:title subject: -- cm:description created: -- cm:created comments:
| Modifier and Type | Class and Description |
|---|---|
protected static class |
TikaPoweredMetadataExtracter.HeadContentHandler
This content handler will capture entries from within
the header of the Tika content XHTML, but ignore the
rest.
|
protected static class |
TikaPoweredMetadataExtracter.MapCaptureContentHandler
This content handler will grab all tags and attributes,
and record the textual content of the last seen one
of them.
|
protected static class |
TikaPoweredMetadataExtracter.NullContentHandler
A content handler that ignores all the content it finds.
|
MetadataExtracter.OverwritePolicy| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
KEY_AUTHOR |
protected static java.lang.String |
KEY_COMMENTS |
protected static java.lang.String |
KEY_CREATED |
protected static java.lang.String |
KEY_DESCRIPTION |
protected static java.lang.String |
KEY_SUBJECT |
protected static java.lang.String |
KEY_TITLE |
protected static org.apache.commons.logging.Log |
logger |
NAMESPACE_PROPERTY_PREFIX, PROPERTY_COMPONENT_EMBED, PROPERTY_COMPONENT_EXTRACT, PROPERTY_PREFIX_METADATA| Constructor and Description |
|---|
TikaPoweredMetadataExtracter(java.util.ArrayList supportedMimeTypes) |
TikaPoweredMetadataExtracter(java.util.ArrayList supportedMimeTypes,
java.util.ArrayList supportedEmbedMimeTypes) |
TikaPoweredMetadataExtracter(java.util.HashSet supportedMimeTypes) |
TikaPoweredMetadataExtracter(java.util.HashSet supportedMimeTypes,
java.util.HashSet supportedEmbedMimeTypes) |
| Modifier and Type | Method and Description |
|---|---|
protected static java.util.ArrayList |
buildSupportedMimetypes(java.lang.String[] explicitTypes,
org.apache.tika.parser.Parser[] tikaParsers)
Builds up a list of supported mime types by merging
an explicit list with any that Tika also claims to support
|
protected void |
embedInternal(java.util.Map properties,
org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer)
Override to embed metadata values.
|
protected java.util.Map |
extractRaw(org.alfresco.service.cmr.repository.ContentReader reader)
Override to provide the raw extracted metadata values.
|
protected java.util.Map |
extractSpecific(org.apache.tika.metadata.Metadata metadata,
java.util.Map properties,
java.util.Map headers)
Allows implementation specific mappings to be done.
|
protected org.apache.tika.embedder.Embedder |
getEmbedder()
Returns the Tika Embedder to modify
the document.
|
protected java.io.InputStream |
getInputStream(org.alfresco.service.cmr.repository.ContentReader reader)
There seems to be some sort of issue with some downstream
3rd party libraries, and input streams that come from
a
ContentReader. |
protected abstract org.apache.tika.parser.Parser |
getParser()
Returns the correct Tika Parser to process the document.
|
protected java.util.Date |
makeDate(java.lang.String dateStr)
Version which also tries the ISO-8601 formats (in order..),
and similar formats, which Tika makes use of
|
protected boolean |
needHeaderContents()
Do we care about the contents of the
extracted header, or nothing at all?
|
checkIsEmbedSupported, checkIsSupported, embed, extract, extract, extract, filterSystemProperties, getBeanName, getDefaultEmbedMapping, getDefaultMapping, getEmbedMapping, getExecutorService, getExtractionTime, getLimits, getMapping, getMimetypeService, getReliability, init, isEmbeddingSupported, isSupported, newRawMap, putRawValue, readEmbedMappingProperties, readEmbedMappingProperties, readGlobalEmbedMappingProperties, readGlobalExtractMappingProperties, readMappingProperties, readMappingProperties, register, setApplicationContext, setBeanName, setDictionaryService, setEmbedMapping, setEmbedMappingProperties, setEnableStringTagging, setExecutorService, setFailOnTypeConversion, setInheritDefaultEmbedMapping, setInheritDefaultMapping, setMapping, setMappingProperties, setMimetypeLimits, setMimetypeService, setOverwritePolicy, setOverwritePolicy, setProperties, setRegistry, setSupportedDateFormats, setSupportedEmbedMimetypes, setSupportedMimetypesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitembed, isEmbeddingSupportedprotected static org.apache.commons.logging.Log logger
protected static final java.lang.String KEY_AUTHOR
protected static final java.lang.String KEY_TITLE
protected static final java.lang.String KEY_SUBJECT
protected static final java.lang.String KEY_CREATED
protected static final java.lang.String KEY_DESCRIPTION
protected static final java.lang.String KEY_COMMENTS
public TikaPoweredMetadataExtracter(java.util.ArrayList supportedMimeTypes)
public TikaPoweredMetadataExtracter(java.util.ArrayList supportedMimeTypes,
java.util.ArrayList supportedEmbedMimeTypes)
public TikaPoweredMetadataExtracter(java.util.HashSet supportedMimeTypes)
public TikaPoweredMetadataExtracter(java.util.HashSet supportedMimeTypes,
java.util.HashSet supportedEmbedMimeTypes)
protected static java.util.ArrayList buildSupportedMimetypes(java.lang.String[] explicitTypes,
org.apache.tika.parser.Parser[] tikaParsers)
protected java.util.Date makeDate(java.lang.String dateStr)
makeDate in class AbstractMappingMetadataExtracterprotected abstract org.apache.tika.parser.Parser getParser()
TikaAutoMetadataExtracter
which makes use of the Tika auto-detection.protected org.apache.tika.embedder.Embedder getEmbedder()
protected boolean needHeaderContents()
protected java.util.Map extractSpecific(org.apache.tika.metadata.Metadata metadata,
java.util.Map properties,
java.util.Map headers)
protected java.io.InputStream getInputStream(org.alfresco.service.cmr.repository.ContentReader reader)
throws java.io.IOException
ContentReader. This happens most often with
JPEG and Tiff files.
For these cases, buffer out to a local file if not
already therejava.io.IOExceptionprotected java.util.Map extractRaw(org.alfresco.service.cmr.repository.ContentReader reader)
throws java.lang.Throwable
AbstractMappingMetadataExtracterdefault mapping doesn't handle all properties, it is
possible for each instance of the extracter to be configured differently and more or
less of the properties may be used in different installations.
Raw values must not be trimmed or removed for any reason. Null values and empty strings are
OverwritePolicyProperties extracted and their meanings and types should be thoroughly described in the class-level javadocs of the extracter implementation, for example:
editor: - the document editor --> cm:author title: - the document title --> cm:title user1: - the document summary user2: - the document description --> cm:description user3: - user4: -
extractRaw in class AbstractMappingMetadataExtracterreader - the document to extract the values from. This stream provided by
the reader must be closed if accessed directly.java.lang.ThrowableAbstractMappingMetadataExtracter.getDefaultMapping()protected void embedInternal(java.util.Map properties,
org.alfresco.service.cmr.repository.ContentReader reader,
org.alfresco.service.cmr.repository.ContentWriter writer)
throws java.lang.Throwable
AbstractMappingMetadataExtracterdefault mapping doesn't handle all properties, it is
possible for each instance of the extracter to be configured differently and more or
less of the properties may be used in different installations.embedInternal in class AbstractMappingMetadataExtracterproperties - the metadata keys and values to embed in the content filereader - the reader for the original document. This stream provided by
the reader must be closed if accessed directly.writer - the writer for the document to embed the values in. This stream provided by
the writer must be closed if accessed directly.java.lang.ThrowableAbstractMappingMetadataExtracter.getDefaultEmbedMapping()Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.