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"

(Example)
(For SMILA 1.0: Simplification pages are obsolete now, redirect to SMILA/Documentation/Bundle_org.eclipse.smila.processing.pipelets)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Bundle: org.eclipse.smila.processing.pipelets.MimeTypeIdentifyPipelet ==
+
#REDIRECT [[SMILA/Documentation/Bundle org.eclipse.smila.processing.pipelets]]
 
+
=== Description ===
+
This pipelet is used to identify the MIME type of a document.
+
It uses an <tt>org.eclipse.smila.processing.pipelets.mimetype.MimeTypeIdentifier</tt> service to perform the actual identification of the MIME type. Depending on the specified properties, the MIME type is detected from the file content, from the file extension, or from both. If the identification does not return a MIME type - and if configured accordingly - the service will search the metadata for this information. The identified MIME type is then stored to an attribute in the record.
+
 
+
 
+
=== Configuration ===
+
 
+
The pipelet is configured using the <tt><PipeletConfiguration></tt> section inside the <tt><invokePipelet></tt> activity of the corresponding BPEL file. It provides the following properties:
+
 
+
{| 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 Web Crawler returns a response header containing applicable MIME type information
+
|-
+
|''MimeTypeAttribute''||String||Required||Name of the attribute to store the identified MIME type to
+
|}
+
Note that at least one of the properties ''FileExtensionAttribute'', ''ContentAttachment'', and ''MetaDataAttribute'' must be specified!
+
 
+
==== Example ====
+
 
+
The following example is used in the SMILA example application to identify the MIME types of documents that are delivered by the File System Crawler or Web Crawler.
+
 
+
'''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:configuration>
+
          <rec:Val key="FileExtensionAttribute">Extension</rec:Val>
+
          <rec:Val key="MetaDataAttribute">MetaData</rec:Val>
+
          <rec:Val key="MimeTypeAttribute">MimeType</rec:Val>
+
        </proc:configuration>
+
    </proc:invokePipelet>
+
</extensionActivity>
+
</source>
+
 
+
[[Category:SMILA]] [[Category:SMILA/Pipelet]]
+

Latest revision as of 06:03, 19 January 2012

Back to the top