Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "SMILA/Documentation/2011.Simplification/org.eclipse.smila.processing.pipelets"

(New page: == org.eclipse.smila.processing.pipelets.MimeTypeIdentifyPipelet == === Description === This pipelet is used to identify the mimetype of a document. It uses a <tt>org.eclipse.smila.proce...)
 
(For SMILA 1.0: Simplification pages are obsolete now, redirect to SMILA/Documentation/Bundle_org.eclipse.smila.processing.pipelets)
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== org.eclipse.smila.processing.pipelets.MimeTypeIdentifyPipelet ==
+
#REDIRECT [[SMILA/Documentation/Bundle org.eclipse.smila.processing.pipelets]]
 
+
=== Description ===
+
This pipelet is used to identify the mimetype of a document.
+
It uses a <tt>org.eclipse.smila.processing.pipelets.mimetype.MimeTypeIdentifier</tt> service to perform the actual identification of the mimetype. Depending on what properties are specified the mime type is detected from the content or the file extension or both. If the identification does not return a mime type then, if configured, the service searches the metadata for a mimetype. The identified MimeType is store in an attribute in the record.
+
 
+
 
+
=== Configuration ===
+
 
+
The pipelet is configured using the PipeletConfiguration section inside the invokePipelet activity in the BPEL file:
+
 
+
{| border = 1
+
!Property!!Type!!Usage!!Description
+
|-
+
|FileExtensionAttribute||String||optional||name of the attribute containing the file extension
+
|-
+
|ContentAttachment||String||optional||name of the attachment containing the file content
+
|-
+
|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
+
|}
+
Note that at least one of the properties FileExtensionAttribute, ContentAttachment and MetaDataAttribute needs to be specified!
+
 
+
==== Example ====
+
 
+
The following example is used in the SMILA example application to identify MimeTypes of documents delivered by Filesystem- and WebCrawler.
+
 
+
'''addpipeline.bpel'''
+
<source lang="xml">
+
<extensionActivity>
+
    <proc:invokePipelet name="detect MimeType">
+
        <proc:pipelet class="org.eclipse.smila.processing.pipelets.MimeTypeIdentifyPipelet" />
+
        <proc:variables input="request" output="request" />
+
        <proc:PipeletConfiguration>
+
          <proc:Property name="FileExtensionAttribute">
+
            <proc:Value>Extension</proc:Value>
+
          </proc:Property> 
+
          <proc:Property name="MetaDataAttribute">
+
            <proc:Value>MetaData</proc:Value>
+
          </proc:Property>
+
          <proc:Property name="MimeTypeAttribute">
+
            <proc:Value>MimeType</proc:Value>
+
          </proc:Property>   
+
        </proc:PipeletConfiguration>
+
    </proc:invokePipelet>
+
</extensionActivity>
+
</source>
+
 
+
[[Category:SMILA]] [[Category:SMILA/Pipelet]]
+

Latest revision as of 06:03, 19 January 2012

Back to the top