org.alfresco.repo.content.metadata
Class HtmlMetadataExtracter

java.lang.Object
  extended by org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter
      extended by org.alfresco.repo.content.metadata.HtmlMetadataExtracter
All Implemented Interfaces:
ContentWorker, MetadataExtracter

public class HtmlMetadataExtracter
extends AbstractMappingMetadataExtracter

Extracts the following values from HTML documents:

   author:                 --      cm:author
   title:                  --      cm:title
   description:            --      cm:description
 
TIKA note - all metadata will be present, but will need to search for the varient names ourselves as tika puts them in as-is.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.content.metadata.MetadataExtracter
MetadataExtracter.OverwritePolicy
 
Field Summary
static java.util.Set MIMETYPES
           
 
Fields inherited from class org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter
logger, NAMESPACE_PROPERTY_PREFIX, supportedDateFormats
 
Constructor Summary
HtmlMetadataExtracter()
           
 
Method Summary
protected  java.util.Map extractRaw(org.alfresco.service.cmr.repository.ContentReader reader)
          Override to provide the raw extracted metadata values.
 
Methods inherited from class org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter
checkIsSupported, extract, extract, extract, filterSystemProperties, getDefaultMapping, getExtractionTime, getMapping, getMimetypeService, getReliability, init, isSupported, makeDate, newRawMap, putRawValue, readMappingProperties, readMappingProperties, register, setDictionaryService, setFailOnTypeConversion, setInheritDefaultMapping, setMapping, setMappingProperties, setMimetypeService, setOverwritePolicy, setOverwritePolicy, setRegistry, setSupportedDateFormats, setSupportedMimetypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIMETYPES

public static final java.util.Set MIMETYPES
Constructor Detail

HtmlMetadataExtracter

public HtmlMetadataExtracter()
Method Detail

extractRaw

protected java.util.Map extractRaw(org.alfresco.service.cmr.repository.ContentReader reader)
                            throws java.lang.Throwable
Description copied from class: AbstractMappingMetadataExtracter
Override to provide the raw extracted metadata values. An extracter should extract as many of the available properties as is realistically possible. Even if the default 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

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:
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
See Also:
AbstractMappingMetadataExtracter.getDefaultMapping()


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.