[daisy] [JIRA] Commented: (DSY-463) A text part with mimetype "text/plain" should accept a part with mime type "text/plain;encoding=UTF8"

Bruno Dumon (JIRA) issues at cocoondev.org
Mon May 7 05:18:20 CDT 2007


    [ http://issues.cocoondev.org//browse/DSY-463?page=comments#action_13160 ] 

Bruno Dumon commented on DSY-463:
---------------------------------

You're quite right there are a couple of issues with the mime type checking, I happened to think about this while reading up about mime types in another context (atom publishing protocol).

Some other issues are:
 * mime type checking should be case insensitive, and the order of the parameters should be of no importance
 * the parsing of the comma-separated list of acceptable mime types should be smarter, since e.g. something/something;someparam="," is a valid mime type

PS: patches welcome.

> A text part with mimetype "text/plain" should accept a part with mime type "text/plain;encoding=UTF8"
> -----------------------------------------------------------------------------------------------------
>
>          Key: DSY-463
>          URL: http://issues.cocoondev.org//browse/DSY-463
>      Project: Daisy
>         Type: Improvement
>   Components: Repository
>     Versions: 2.0.1
>     Reporter: Geoffrey De Smet
>     Priority: Trivial

>
> I have a schema which contains a part like this:
>   <partType name="myTextPart" mimeTypes="text/plain" ...
> When I set a part like this:
>   document.setPart("myTextPart", "text/plain;encoding=UTF-8", myString.getBytes("UTF-8"));
> I get the following exception:
> Caused by: org.outerj.daisy.repository.DocumentTypeInconsistencyException: The mime-type "text/plain;charset=UTF-8" isn't part of the allowed mime types (text/plain) required by the PartType "myTextPart" (ID: 14).
> 	at org.outerj.daisy.repository.commonimpl.DocumentVariantImpl.setPart(DocumentVariantImpl.java:545)
> 	at org.outerj.daisy.repository.commonimpl.DocumentVariantImpl.setPart(DocumentVariantImpl.java:513)
> 	at org.outerj.daisy.repository.commonimpl.DocumentVariantImpl.setPart(DocumentVariantImpl.java:488)
> 	at org.outerj.daisy.repository.commonimpl.DocumentImpl.setPart(DocumentImpl.java:307)
> On the other hand, if I 'd use:
>    <partType name="myTextPart" mimeTypes="text/plain;encoding=UTF-8" ...
> it doesn't get indexed by lucene

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.cocoondev.org//secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira



More information about the daisy mailing list