Skip to main content
Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/SimpleMimeTypeIdentifier"

(Bundle: org.eclipse.eilf.processing.pipelets.mimetype.SimpleMimeTypeIdentifier)
Line 2: Line 2:
  
 
=== Description ===
 
=== Description ===
This ProcessingService is used to identify the mimetype of a document. The service uses the file extension todo the MIME type detection. The identified MimeType is store in an attribute in the record.
+
This ProcessingService is used to identify the mimetype of a document. The service uses the file extension todo the MIME type detection or tries to extract the mimetype from a given attribute containing metadata of the record. The identified MimeType is store in an attribute in the record.
  
 
==== Useful Information ====
 
==== Useful Information ====
Line 13: Line 13:
  
 
{| border = 1
 
{| border = 1
!Property!!Type!!Description
+
!Property!!Type!!Usage!!Description
 
|-
 
|-
|FileExtensionAttribute||String||name of the attribute containing the file extension
+
|FileExtensionAttribute||String||optional||name of the attribute containing the file extension
 
|-
 
|-
|MimeTypeAttribute||String||name of the attribute to store the identified MimeType in
+
|MetaDataAttribute||String||optional||name of the attribute containing metadata information. e.g. a WebCrawler returns a response header containing mime type information
Note that all properties are required and must be provided.
+
|-
 +
|MimeTypeAttribute||String||required||name of the attribute to store the identified MimeType in
 
|}
 
|}
  
Line 31: Line 32:
 
     <Value>FileExtension</Value>
 
     <Value>FileExtension</Value>
 
   </Property>   
 
   </Property>   
 +
  <Property name="MetaDataAttribute">
 +
    <Value>MetaData</Value>
 +
  </Property>
 
   <Property name="MimeTypeAttribute">
 
   <Property name="MimeTypeAttribute">
 
     <Value>MimeType</Value>
 
     <Value>MimeType</Value>

Revision as of 04:55, 23 March 2009

Bundle: org.eclipse.smila.processing.pipelets.mimetype.SimpleMimeTypeIdentifier

Description

This ProcessingService is used to identify the mimetype of a document. The service uses the file extension todo the MIME type detection or tries to extract the mimetype from a given attribute containing metadata of the record. The identified MimeType is store in an attribute in the record.

Useful Information

Note that this ProcessingService also is a DeclarativeService that implements interface org.eclipse.smila.processing.pipelets.mimetype.MimeTypeIdentifier and can be used outside the workflow as well.

Configuration

  • configuration/org.eclipse.smila.processing.pipelets.mimetype/MimeTypeConfig.xml
Property Type Usage Description
FileExtensionAttribute String optional name of the attribute containing the file extension
MetaDataAttribute String optional name of the attribute containing metadata information. e.g. a WebCrawler returns a response header containing mime type information
MimeTypeAttribute String required name of the attribute to store the identified MimeType in

Example

The following example was used in the SMILA example application to identify MimeTypes of documents delivered by Filesystem- and WebCrawler.

MimeTypeConfig.xml

<PipeletConfiguration xmlns="http://www.eclipse.org/smila/processor">
  <Property name="FileExtensionAttribute">
    <Value>FileExtension</Value>
  </Property>  
  <Property name="MetaDataAttribute">
    <Value>MetaData</Value>
  </Property>
  <Property name="MimeTypeAttribute">
    <Value>MimeType</Value>
  </Property>    
</PipeletConfiguration>

Back to the top