Page History
Configuration
Element | Type | Default | Description |
---|---|---|---|
branches | parent tag | None | The configuration of the pipeline to publish to. See below. |
waitForJob | boolean | true | Indicates to the component whether or not wait for the job to complete . |
servletName | String | httpFeeder | Name of the servlet that will feed the files. For example, if servletName is "submitFiles", then you would send files to the httpFeeder using the "http://localhost:50505/submitFiles?params..." URL. |
feederLabel | String | HttpFeeder | The <feederLabel> value to be included with the document as it is sent to the pipeline. For example, HttpFeeder. |
XMLContent | boolean | true | Set this parameter to true if you will be POST-ing XML data to the HTTP Feeder. This XML data will be set as an input stream attached to the job published by the feeder. Subsequent stages can access the data using the Standards.Basic.getContentStream(Job j) method in the package com.searchtechnologies.aspire.framework. |
xmlRootName | String | doc | The name of the root element, for example <root>. This will be the root element of the AspireDocument object which is passed down the pipeline. |
xsltFileName | String | null | The path of the XSL transform file to be used to format the output xml. Path names will be relative to Aspire Home. |
outputMime | String | text/xml | Specifies the mime type which the HTTP feeder will report back to the HTTP client. Change this to "text/html" if your transform creates HTML which should be shown by a browser. |
resultMimeTypeField | String |
Set the mime type using the value found in the field specified. The field must exist as a child of the root (ie a parameter value of mimeType looks for value in the /doc/mimeType field in the default AspireObject) . If the field does not exist or is empty, then the mimeType reverts back to the value from the parameter <outputMime> NOTE: The value is extracted before the transformation (if any) is applied. | |
multipartForm | parent tag |
Enable multi-part form submission, which allows for uploading files to the HTTP server through HTML forms, as well as other input elements. | |||
multipartForm/fileHandler | String | stream | Specify the type of file handler to use for posted files. The stream (default) handler will attach an InputStream to the file stream to the job and subsequent stages can access the data using the Standards.Basic.getContentStream(Job j) method in the package com.searchtechnologies.aspire.framework. The file handler will upload the file to the specified directory (see below). No input stream is attached to the job for the file handler. See above for more details and restrictions. |
multipartForm/uploadDir | String |
Specify the location where files from multi-part forms will be uploaded when using the file handler. See above for more details. | |||
saxonProcessor | boolean | false | Set on true if you want to use SAXON Processors to transform using XSLT 2.0 files. |
debugOutFile | String |
Specify the location where the XSLT processed output will be written to. This is used for debugging the transforms. | |||
headers (2.1 Release) | parent tag | None | The configuration of the http headers. See below. |
Configuration
Element | Type | Default | Description |
---|---|---|---|
branches | parent tag | None | The configuration of the pipeline to publish to. See below. |
waitForJob | boolean | true | Indicates to the component whether or not wait for the job to complete . |
servletName | String | httpFeeder | Name of the servlet that will feed the files. For example, if servletName is "submitFiles", then you would send files to the httpFeeder using the "http://localhost:50505/submitFiles?params..." URL. |
feederLabel | String | HttpFeeder | The <feederLabel> value to be included with the document as it is sent to the pipeline. For example, HttpFeeder. |
XMLContent | boolean | true | Set this parameter to true if you will be POST-ing XML data to the HTTP Feeder. This XML data will be set as an input stream attached to the job published by the feeder. Subsequent stages can access the data using the Standards.Basic.getContentStream(Job j) method in the package com.searchtechnologies.aspire.framework. |
xmlRootName | String | doc | The name of the root element, for example <root>. This will be the root element of the AspireDocument object which is passed down the pipeline. |
xsltFileName | String | null | The path of the XSL transform file to be used to format the output xml. Path names will be relative to Aspire Home. |
outputMime | String | text/xml | Specifies the mime type which the HTTP feeder will report back to the HTTP client. Change this to "text/html" if your transform creates HTML which should be shown by a browser. |
resultMimeTypeField | String |
Set the mime type using the value found in the field specified. The field must exist as a child of the root (ie a parameter value of mimeType looks for value in the /doc/mimeType field in the default AspireObject) . If the field does not exist or is empty, then the mimeType reverts back to the value from the parameter <outputMime> NOTE: The value is extracted before the transformation (if any) is applied. | ||
multipartForm | parent tag |
Enable multi-part form submission, which allows for uploading files to the HTTP server through HTML forms, as well as other input elements. | |||
multipartForm/fileHandler | String | stream | Specify the type of file handler to use for posted files. The stream (default) handler will attach an InputStream to the file stream to the job and subsequent stages can access the data using the Standards.Basic.getContentStream(Job j) method in the package com.searchtechnologies.aspire.framework. The file handler will upload the file to the specified directory (see below). No input stream is attached to the job for the file handler. See above for more details and restrictions. |
multipartForm/uploadDir | String |
Specify the location where files from multi-part forms will be uploaded when using the file handler. See above for more details. | |||
saxonProcessor | boolean | false | Set on true if you want to use SAXON Processors to transform using XSLT 2.0 files. |
debugOutFile | String |
Specify the location where the XSLT processed output will be written to. This is used for debugging the transforms. | |||
headers (2.1 Release) | parent tag | None | The configuration of the http headers. See below. |
Example Configurations for HTML Form-Style Parameters
This will handle either parameters specified on the URL with HTTP GET, or parameters POST'ed from an HTML <form>.
<component name="MyHTTPFeeder" factoryName="aspire-http-feeder" subType="default"> <servletName>submitFiles</servletName> <feederLabel>HttpFeeder</feederLabel> <xsltFileName>config/categorizeOutput.xsl</xsltFileName> <branches> <branch event="onPublish" pipelineManager="CategorizeFolderOrFile" /> </branches> </component>
Example configuration for posting XML to Aspire
<component name="MyHTTPFeeder" factoryName="aspire-http-feeder" subType="default"> <servletName>submitFiles</servletName> <feederLabel>HttpFeeder</feederLabel> <XMLContent>true</XMLContent> <xsltFileName>config/extractor.xsl</xsltFileName> <branches> <branch event="onPublish" pipelineManager="CategorizeFolderOrFile" /> </branches> </component>
Example configuration for configuring HTTP headers
You can specify required HTTP headers in the configuration as following. Then feeder will add those header information to the response.
<component name="MyHTTPFeeder" factoryName="aspire-http-feeder" subType="default"> . . . <headers> <header name="Authorisation">simple</header> <header name="Accept">text/plain</header> </headers> </component>
Serving Files
The HTTPFeeder can also serve up ordinary HTML files so it can be used as a more complete, end-to-end user interface for simple user interfaces.
Files are stored inside the Aspire Home directory, in the "web/httpfeeder/<servlet-name>" directory.
For example, a request for:
Will access the file from:
- $ASPIRE_HOME/web/httpfeeder/submitFiles/test.html
Note that “index.html” is also supported. So, a request for:
Will return:
- $ASPIRE_HOME/web/httpfeeder/submitFiles/index.html
If it exists.
NOTE: if porting from version 0.4, note that the position of the required directory on disk has changed from web/<servlet-name> to web/httpfeeder/<servlet-name>.
Returning Binary Data
Raw binary data can be returned from the HTTPFeeder. This will happen automatically if the following conditions are met:
- The output mime type is "application/octet-stream"
- This can be set with either the <outputMime> or <resultMimeTypeField> configuration parameters.
- There is a job variable called "byteDataResults"
Note that the job variable must (currently) hold data of type ByteArrayOutputStream.
If the above situation occurs, the HTTPFeeder will do the following:
- Fetch the array of bytes from the ByteArrayOutputStream
- Set the returned content-length to the length of the array of bytes
- Writes the byte data back to the client