Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
0.3, 0.4
-
None
Description
Currently, all product handlers specified under [1], or user-defined product handlers, return content in one of two MIME type formats: the MIME type of a given product on disk (usually "application/octet-stream") and "text/xml". The former strategy is the default for all "GET" type handlers, and the latter is the default for all "LIST" handlers. A developer currently cannot specify the desired MIME type for either type of handler. This feature is needed if a transformation of a product occurs, such that the RAW product is not actually returned, but information about or based upon the product is returned. For example, the MD5 handler [2] is such a use-case, and would be more usable by end-users in a browser setting if it returned content in the form of the MIME type "text/plain". There are many other example use-cases of this.
I propose to allow a developer to configure the MIME type of generated content for all "GET" handlers, using the following methodology:
1. Allow the developer to optionally specify a MIME type of a given handler in the OFSN XML configuration file's handler configuration block [3]
2. If the user specifies a MIME type, this MIME type will be fed into the MIME type specification in [4], and set as the HTTP server's returned content-type
3. If the user specifies a MIME type, but it is invalid, then the default MIME type of "application/octet-stream" will be used
4. If the user does NOT specify a MIME type for a handler, then the default behavior of using the MIME type of a given product on disk will be enacted (ie. the default behavior of all "GET" handlers right now)
–
[1] http://svn.apache.org/repos/asf/oodt/tags/0.3/product/src/main/java/org/apache/oodt/product/handlers/ofsn/
[2] http://svn.apache.org/repos/asf/oodt/tags/0.3/product/src/main/java/org/apache/oodt/product/handlers/ofsn/MD5GetHandler.java
[3] http://svn.apache.org/repos/asf/oodt/tags/0.3/product/src/main/conf/ofsn-ps.xml
[4] http://svn.apache.org/repos/asf/oodt/tags/0.3/product/src/main/java/org/apache/oodt/product/handlers/ofsn/OFSNFileHandler.java