Class JodConverterMetadataExtracter
- java.lang.Object
-
- org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter
-
- org.alfresco.repo.content.metadata.JodConverterMetadataExtracter
-
- All Implemented Interfaces:
ContentWorker,MetadataEmbedder,MetadataExtracter,OpenOfficeMetadataWorker,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware
public class JodConverterMetadataExtracter extends AbstractMappingMetadataExtracter implements OpenOfficeMetadataWorker
Extracts values from Open Office documents into the following:author: -- cm:author title: -- cm:title description: -- cm:description
- Author:
- Neil McErlean
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.alfresco.repo.content.metadata.MetadataExtracter
MetadataExtracter.OverwritePolicy
-
-
Field Summary
-
Fields inherited from class org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter
logger, MEGABYTE_SIZE, NAMESPACE_PROPERTY_PREFIX, PROPERTY_COMPONENT_EMBED, PROPERTY_COMPONENT_EXTRACT, PROPERTY_PREFIX_METADATA
-
-
Constructor Summary
Constructors Constructor Description JodConverterMetadataExtracter()JodConverterMetadataExtracter(java.util.Set<java.lang.String> supportedMimetypes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.io.Serializable>extractRaw(org.alfresco.service.cmr.repository.ContentReader reader)Override to provide the raw extracted metadata values.voidinit()Provides a hook point for implementations to perform initialization.booleanisConnected()booleanisSupported(java.lang.String sourceMimetype)Perform the default check, but also check if the OpenOffice connection is good.voidsetWorker(OpenOfficeMetadataWorker worker)-
Methods inherited from class org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter
checkIsEmbedSupported, checkIsSupported, embed, embedInternal, extract, extract, extract, filterSystemProperties, getBeanName, getDefaultEmbedMapping, getDefaultMapping, getEmbedMapping, getExecutorService, getLimits, getMapping, getMimetypeService, isEmbeddingSupported, makeDate, newRawMap, putRawValue, readEmbedMappingProperties, readEmbedMappingProperties, readGlobalEmbedMappingProperties, readGlobalExtractMappingProperties, readMappingProperties, readMappingProperties, register, setApplicationContext, setBeanName, setDictionaryService, setEmbedMapping, setEmbedMappingProperties, setEnableStringTagging, setExecutorService, setFailOnTypeConversion, setInheritDefaultEmbedMapping, setInheritDefaultMapping, setMapping, setMappingProperties, setMimetypeLimits, setMimetypeService, setOverwritePolicy, setProperties, setRegistry, setSupportedDateFormats, setSupportedEmbedMimetypes, setSupportedMimetypes
-
-
-
-
Method Detail
-
setWorker
public void setWorker(OpenOfficeMetadataWorker worker)
-
init
public void init()
Description copied from class:AbstractMappingMetadataExtracterProvides a hook point for implementations to perform initialization. The base implementation must be invoked or the extracter will fail during extraction. Thedefault mappingswill be requested during initialization.- Overrides:
initin classAbstractMappingMetadataExtracter
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceOpenOfficeMetadataWorker- Returns:
- Returns true if a connection to the Uno server could be established
-
isSupported
public boolean isSupported(java.lang.String sourceMimetype)
Perform the default check, but also check if the OpenOffice connection is good.- Specified by:
isSupportedin interfaceMetadataExtracter- Overrides:
isSupportedin classAbstractMappingMetadataExtracter- Parameters:
sourceMimetype- the document mimetype- Returns:
- Returns true if the mimetype is supported, otherwise false.
- See Also:
AbstractMappingMetadataExtracter.setSupportedMimetypes(Collection)
-
extractRaw
public java.util.Map<java.lang.String,java.io.Serializable> extractRaw(org.alfresco.service.cmr.repository.ContentReader reader) throws java.lang.ThrowableOverride to provide the raw extracted metadata values. An extracter should extract as many of the available properties as is realistically possible. Even if thedefault mappingdoesn'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
- Null: Removed
- Empty String: Passed to the OverwritePolicy
- Non Serializable: Converted to String or fails if that is not possible
Properties 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: -
- Specified by:
extractRawin interfaceOpenOfficeMetadataWorker- Specified by:
extractRawin classAbstractMappingMetadataExtracter- 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()
-
-