fetch:content-type file: customisation

Friday, 9 June 2017 · 11 messages · last reply 12 Jun 2017
AB
Andy Bunce9 Jun 2017 11:49 #
Hi, I notice that fetch:content-type()[1] returns "application/octet-stream" for files with the commonly used XProc file extensions *.xpl and *.xproc. This seems to be driven from the list in src/main/resources/media-types.properties [2] Would it be possible to add these extensions as "application/*xproc*+xml" or add a mechanism to allow extension/customisation? Maybe similar to [3] For static files served from jetty adding mime-mapping elements to web.xml works [4] /Andy [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type [2] https://github.com/BaseXdb/basex/blob/master/basex-core/ src/main/resources/media-types.properties [3] http://docs.oracle.com/javase/7/docs/api/javax/activation/ MimetypesFileTypeMap.html [4] https://stackoverflow.com/questions/33803109/how-can-i-set-mime-mapping-to-a-file-served-as-static-content-by-jetty-runner/33809187#33809187
CG
Christian Grün9 Jun 2017 12:01 #
Hi Andy, Adding the extensions statically is surely the least effort for now. I can add the following two mappings: xpl=application/xml xproc=application/xml Are some more that I should include? Thanks, Christian
Quoted text · Andy Bunce · 21 lines
On Fri, Jun 9, 2017 at 11:49 AM, Andy Bunce <bunce.andy at gmail.com> wrote: > Hi, > > I notice that fetch:content-type()[1] returns "application/octet-stream" for > files with the commonly used XProc file extensions *.xpl and *.xproc. > This seems to be driven from the list in > src/main/resources/media-types.properties [2] > Would it be possible to add these extensions as "application/xproc+xml" or > add a mechanism to allow extension/customisation? Maybe similar to [3] > For static files served from jetty adding mime-mapping elements to web.xml > works [4] > > /Andy > > [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type > [2] > https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/resources/media-types.properties > [3] > http://docs.oracle.com/javase/7/docs/api/javax/activation/MimetypesFileTypeMap.html > [4] > https://stackoverflow.com/questions/33803109/how-can-i-set-mime-mapping-to-a-file-served-as-static-content-by-jetty-runner/33809187#33809187
AB
Andy Bunce9 Jun 2017 12:38 #
Hi Christian, Just these two I am thinking about at the moment. Is there some reason not to go with "application/*xproc*+xml"? [1] Many in the existing list are in this style e.g. atom=application/atom+xml svg=image/svg+xml lostxml=application/lost+xml And it looks like BaseX will treat it as XML [2] /Andy [1] https://www.w3.org/XML/XProc/docs/langspec.html#media-type-registration [2] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/http/MediaType.java#L148
Quoted text · Christian Grün · 46 lines
On 9 June 2017 at 11:01, Christian Grün <christian.gruen at gmail.com> wrote: > Hi Andy, > > Adding the extensions statically is surely the least effort for now. > > I can add the following two mappings: > > xpl=application/xml > xproc=application/xml > > Are some more that I should include? > > Thanks, > Christian > > > > On Fri, Jun 9, 2017 at 11:49 AM, Andy Bunce <bunce.andy at gmail.com> wrote: > > Hi, > > > > I notice that fetch:content-type()[1] returns "application/octet-stream" > for > > files with the commonly used XProc file extensions *.xpl and *.xproc. > > This seems to be driven from the list in > > src/main/resources/media-types.properties [2] > > Would it be possible to add these extensions as "application/xproc+xml" > or > > add a mechanism to allow extension/customisation? Maybe similar to [3] > > For static files served from jetty adding mime-mapping elements to > web.xml > > works [4] > > > > /Andy > > > > [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type > > [2] > > https://github.com/BaseXdb/basex/blob/master/basex-core/ > src/main/resources/media-types.properties > > [3] > > http://docs.oracle.com/javase/7/docs/api/javax/activation/ > MimetypesFileTypeMap.html > > [4] > > https://stackoverflow.com/questions/33803109/how-can-i- > set-mime-mapping-to-a-file-served-as-static-content-by- > jetty-runner/33809187#33809187 >
CG
Christian Grün9 Jun 2017 12:49 #
Quoted text · Andy Bunce · 1 line
> Is there some reason not to go with "application/xproc+xml"? [1]
Should be fine. So I guess "application/xpl+xml" would be the better choice as well?
Quoted text · Andy Bunce · 1 line
> And it looks like BaseX will treat it as XML [2]
Exactly ;)
Quoted text · Andy Bunce · 51 lines
> [1] https://www.w3.org/XML/XProc/docs/langspec.html#media-type-registration > [2] > https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/http/MediaType.java#L148 > > On 9 June 2017 at 11:01, Christian Grün <christian.gruen at gmail.com> wrote: >> >> Hi Andy, >> >> Adding the extensions statically is surely the least effort for now. >> >> I can add the following two mappings: >> >> xpl=application/xml >> xproc=application/xml >> >> Are some more that I should include? >> >> Thanks, >> Christian >> >> >> >> On Fri, Jun 9, 2017 at 11:49 AM, Andy Bunce <bunce.andy at gmail.com> wrote: >> > Hi, >> > >> > I notice that fetch:content-type()[1] returns "application/octet-stream" >> > for >> > files with the commonly used XProc file extensions *.xpl and *.xproc. >> > This seems to be driven from the list in >> > src/main/resources/media-types.properties [2] >> > Would it be possible to add these extensions as "application/xproc+xml" >> > or >> > add a mechanism to allow extension/customisation? Maybe similar to [3] >> > For static files served from jetty adding mime-mapping elements to >> > web.xml >> > works [4] >> > >> > /Andy >> > >> > [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type >> > [2] >> > >> > https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/resources/media-types.properties >> > [3] >> > >> > http://docs.oracle.com/javase/7/docs/api/javax/activation/MimetypesFileTypeMap.html >> > [4] >> > >> > https://stackoverflow.com/questions/33803109/how-can-i-set-mime-mapping-to-a-file-served-as-static-content-by-jetty-runner/33809187#33809187 > >
AB
Andy Bunce9 Jun 2017 12:59 #
Quoted text · Christian Grün · 1 line
>So I guess "application/xpl+xml" would be the better choice as well?
My understanding multiple extensions in use but same mimetype of "xproc+xml". As with xq=application/xquery xqm=application/xquery xquery=application/xquery xqy=application/xquery Although I note the list has: xsl=text/xml xslt=application/xslt+xml
Quoted text · Christian Grün · 14 lines
On 9 June 2017 at 11:49, Christian Grün <christian.gruen at gmail.com> wrote: > > > Is there some reason not to go with "application/xproc+xml"? [1] > > Should be fine. So I guess "application/xpl+xml" would be the better > choice as well? > > > And it looks like BaseX will treat it as XML [2] > > Exactly ;) > > > > > [1]
Quoted text · Christian Grün · 2 lines
> > [2] > >
Quoted text · Christian Grün · 25 lines
> > > > On 9 June 2017 at 11:01, Christian Grün <christian.gruen at gmail.com> wrote: > >> > >> Hi Andy, > >> > >> Adding the extensions statically is surely the least effort for now. > >> > >> I can add the following two mappings: > >> > >> xpl=application/xml > >> xproc=application/xml > >> > >> Are some more that I should include? > >> > >> Thanks, > >> Christian > >> > >> > >> > >> On Fri, Jun 9, 2017 at 11:49 AM, Andy Bunce <bunce.andy at gmail.com> wrote: > >> > Hi, > >> > > >> > I notice that fetch:content-type()[1] returns
"application/octet-stream"
Quoted text · Christian Grün · 5 lines
> >> > for > >> > files with the commonly used XProc file extensions *.xpl and *.xproc. > >> > This seems to be driven from the list in > >> > src/main/resources/media-types.properties [2] > >> > Would it be possible to add these extensions as
"application/xproc+xml"
Quoted text · Christian Grün · 2 lines
> >> > or > >> > add a mechanism to allow extension/customisation? Maybe similar to
[3]
Quoted text · Christian Grün · 10 lines
> >> > For static files served from jetty adding mime-mapping elements to > >> > web.xml > >> > works [4] > >> > > >> > /Andy > >> > > >> > [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type > >> > [2] > >> > > >> >
Quoted text · Christian Grün · 3 lines
> >> > [3] > >> > > >> >
Quoted text · Christian Grün · 3 lines
> >> > [4] > >> > > >> >
Quoted text · Christian Grün · 2 lines
> > > >
CG
Christian Grün9 Jun 2017 13:10 #
Quoted text · Andy Bunce · 2 lines
> My understanding multiple extensions in use but same mimetype of > "xproc+xml".
Sorry, I didn’t get it… Would you recommend the following mappings? xpl=application/xproc+xml xproc=application/xproc+xml
Quoted text · Andy Bunce · 4 lines
> Although I note the list has: > > xsl=text/xml > xslt=application/xslt+xml
I have adopted most of the entries from existing mime type lists, so I assume that various assignments could be updated. XSL seems to be a tricky case [1,2]; I would be happy to change the current assignment if someone reading this believes the current assignments are not the best choices. [1] http://www.dpawson.co.uk/xsl/sect2/mimetypes.html [2] https://stackoverflow.com/questions/6715767/what-content-type-should-be-used-for-xmlxsl-presentation
AB
Andy Bunce9 Jun 2017 13:12 #
Quoted text · Christian Grün · 3 lines
>Would you recommend the following mappings? >xpl=application/xproc+xml >xproc=application/xproc+xml
Yes. /Andy
Quoted text · Christian Grün · 26 lines
On 9 June 2017 at 12:10, Christian Grün <christian.gruen at gmail.com> wrote: > > My understanding multiple extensions in use but same mimetype of > > "xproc+xml". > > Sorry, I didn’t get it… Would you recommend the following mappings? > > xpl=application/xproc+xml > xproc=application/xproc+xml > > > > Although I note the list has: > > > > xsl=text/xml > > xslt=application/xslt+xml > > I have adopted most of the entries from existing mime type lists, so I > assume that various assignments could be updated. XSL seems to be a > tricky case [1,2]; I would be happy to change the current assignment > if someone reading this believes the current assignments are not the > best choices. > > > [1] http://www.dpawson.co.uk/xsl/sect2/mimetypes.html > [2] https://stackoverflow.com/questions/6715767/what- > content-type-should-be-used-for-xmlxsl-presentation >
CG
Christian Grün9 Jun 2017 13:35 #
Perfect. And thanks for your suggestions on how to customize mime types in the future.
Quoted text · Andy Bunce · 37 lines
On Fri, Jun 9, 2017 at 1:12 PM, Andy Bunce <bunce.andy at gmail.com> wrote: >>Would you recommend the following mappings? > >>xpl=application/xproc+xml >>xproc=application/xproc+xml > > Yes. > /Andy > > On 9 June 2017 at 12:10, Christian Grün <christian.gruen at gmail.com> wrote: >> >> > My understanding multiple extensions in use but same mimetype of >> > "xproc+xml". >> >> Sorry, I didn’t get it… Would you recommend the following mappings? >> >> xpl=application/xproc+xml >> xproc=application/xproc+xml >> >> >> > Although I note the list has: >> > >> > xsl=text/xml >> > xslt=application/xslt+xml >> >> I have adopted most of the entries from existing mime type lists, so I >> assume that various assignments could be updated. XSL seems to be a >> tricky case [1,2]; I would be happy to change the current assignment >> if someone reading this believes the current assignments are not the >> best choices. >> >> >> [1] http://www.dpawson.co.uk/xsl/sect2/mimetypes.html >> [2] >> https://stackoverflow.com/questions/6715767/what-content-type-should-be-used-for-xmlxsl-presentation > >
FE
Fabrice ETANCHAUDin reply to Andy Bunce, 9 Jun 2017, 12:389 Jun 2017 15:11 #
Hi all, Dear Christian, I hope you are doing well. On the same subject, would it be possible for the REST interface to handle PUT requests of application/vnd.api+json<http://www.iana.org/assignments/media-types/application/vnd.api+json> resources (http://jsonapi.org/) like JSON ones ? Best regards, Fabrice
Quoted text · Andy Bunce · 46 lines
De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Andy Bunce Envoyé : vendredi 9 juin 2017 12:38 À : Christian Grün Cc : basex-talk at mailman.uni-konstanz.de Objet : Re: [basex-talk] fetch:content-type file: customisation Hi Christian, Just these two I am thinking about at the moment. Is there some reason not to go with "application/xproc+xml"? [1] Many in the existing list are in this style e.g. atom=application/atom+xml svg=image/svg+xml lostxml=application/lost+xml And it looks like BaseX will treat it as XML [2] /Andy [1] https://www.w3.org/XML/XProc/docs/langspec.html#media-type-registration [2] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/http/MediaType.java#L148 On 9 June 2017 at 11:01, Christian Grün <christian.gruen at gmail.com<mailto:christian.gruen at gmail.com>> wrote: Hi Andy, Adding the extensions statically is surely the least effort for now. I can add the following two mappings: xpl=application/xml xproc=application/xml Are some more that I should include? Thanks, Christian On Fri, Jun 9, 2017 at 11:49 AM, Andy Bunce <bunce.andy at gmail.com<mailto:bunce.andy at gmail.com>> wrote: > Hi, > > I notice that fetch:content-type()[1] returns "application/octet-stream" for > files with the commonly used XProc file extensions *.xpl and *.xproc. > This seems to be driven from the list in > src/main/resources/media-types.properties [2] > Would it be possible to add these extensions as "application/xproc+xml" or > add a mechanism to allow extension/customisation? Maybe similar to [3] > For static files served from jetty adding mime-mapping elements to web.xml > works [4] > > /Andy > > [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type > [2] > https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/resources/media-types.properties > [3] > http://docs.oracle.com/javase/7/docs/api/javax/activation/MimetypesFileTypeMap.html > [4] > https://stackoverflow.com/questions/33803109/how-can-i-set-mime-mapping-to-a-file-served-as-static-content-by-jetty-runner/33809187#33809187
CG
Christian Grün11 Jun 2017 21:59 #
Hi Fabrice, I guess it would be better to use RESTXQ for building responses that match the JSON API specification. Did you try that already? Cheers Christian Am 09.06.2017 15:11 schrieb "Fabrice ETANCHAUD" <fetanchaud at pch.cerfrance.fr
Quoted text · Fabrice ETANCHAUD · 1 line
>:
Hi all, Dear Christian, I hope you are doing well. On the same subject, would it be possible for the REST interface to handle PUT requests of application/vnd.api+json <http://www.iana.org/assignments/media-types/application/vnd.api+json> resources (http://jsonapi.org/) like JSON ones ? Best regards, Fabrice
Quoted text · basex-talk-bounces at mailman.uni-konstanz.de · 53 lines
*De :* basex-talk-bounces at mailman.uni-konstanz.de [mailto: basex-talk-bounces at mailman.uni-konstanz.de] *De la part de* Andy Bunce *Envoyé :* vendredi 9 juin 2017 12:38 *À :* Christian Grün *Cc :* basex-talk at mailman.uni-konstanz.de *Objet :* Re: [basex-talk] fetch:content-type file: customisation Hi Christian, Just these two I am thinking about at the moment. Is there some reason not to go with "application/*xproc*+xml"? [1] Many in the existing list are in this style e.g. atom=application/atom+xml svg=image/svg+xml lostxml=application/lost+xml And it looks like BaseX will treat it as XML [2] /Andy [1] https://www.w3.org/XML/XProc/docs/langspec.html#media-type-registration [2] https://github.com/BaseXdb/basex/blob/master/basex-core/ src/main/java/org/basex/util/http/MediaType.java#L148 On 9 June 2017 at 11:01, Christian Grün <christian.gruen at gmail.com> wrote: Hi Andy, Adding the extensions statically is surely the least effort for now. I can add the following two mappings: xpl=application/xml xproc=application/xml Are some more that I should include? Thanks, Christian On Fri, Jun 9, 2017 at 11:49 AM, Andy Bunce <bunce.andy at gmail.com> wrote: > Hi, > > I notice that fetch:content-type()[1] returns "application/octet-stream" for > files with the commonly used XProc file extensions *.xpl and *.xproc. > This seems to be driven from the list in > src/main/resources/media-types.properties [2] > Would it be possible to add these extensions as "application/xproc+xml" or > add a mechanism to allow extension/customisation? Maybe similar to [3] > For static files served from jetty adding mime-mapping elements to web.xml > works [4] > > /Andy > > [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type > [2] > https://github.com/BaseXdb/basex/blob/master/basex-core/ src/main/resources/media-types.properties > [3] > http://docs.oracle.com/javase/7/docs/api/javax/activation/ MimetypesFileTypeMap.html > [4] > https://stackoverflow.com/questions/33803109/how-can-i- set-mime-mapping-to-a-file-served-as-static-content-by- jetty-runner/33809187#33809187
FE
Fabrice ETANCHAUD12 Jun 2017 09:34 #
Hi Christian, Yes I already used RestXQ to implement JSON API partially, you are right, RestXQ is the only way serverside. The need in REST was only for blind storage of redirected json-api responses, that can also be done with RestXQ. Thank you Christian for providing us with such a flexible software ! Best regards, Fabrice
Quoted text · Christian Grün · 63 lines
De : Christian Grün [mailto:christian.gruen at gmail.com] Envoyé : dimanche 11 juin 2017 22:00 À : Fabrice ETANCHAUD Cc : Andy Bunce; BaseX Objet : RE: [basex-talk] fetch:content-type file: customisation Hi Fabrice, I guess it would be better to use RESTXQ for building responses that match the JSON API specification. Did you try that already? Cheers Christian Am 09.06.2017 15:11 schrieb "Fabrice ETANCHAUD" <fetanchaud at pch.cerfrance.fr<mailto:fetanchaud at pch.cerfrance.fr>>: Hi all, Dear Christian, I hope you are doing well. On the same subject, would it be possible for the REST interface to handle PUT requests of application/vnd.api+json<http://www.iana.org/assignments/media-types/application/vnd.api+json> resources (http://jsonapi.org/) like JSON ones ? Best regards, Fabrice De : basex-talk-bounces at mailman.uni-konstanz.de<mailto:basex-talk-bounces at mailman.uni-konstanz.de> [mailto:basex-talk-bounces at mailman.uni-konstanz.de<mailto:basex-talk-bounces at mailman.uni-konstanz.de>] De la part de Andy Bunce Envoyé : vendredi 9 juin 2017 12:38 À : Christian Grün Cc : basex-talk at mailman.uni-konstanz.de<mailto:basex-talk at mailman.uni-konstanz.de> Objet : Re: [basex-talk] fetch:content-type file: customisation Hi Christian, Just these two I am thinking about at the moment. Is there some reason not to go with "application/xproc+xml"? [1] Many in the existing list are in this style e.g. atom=application/atom+xml svg=image/svg+xml lostxml=application/lost+xml And it looks like BaseX will treat it as XML [2] /Andy [1] https://www.w3.org/XML/XProc/docs/langspec.html#media-type-registration [2] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/basex/util/http/MediaType.java#L148 On 9 June 2017 at 11:01, Christian Grün <christian.gruen at gmail.com<mailto:christian.gruen at gmail.com>> wrote: Hi Andy, Adding the extensions statically is surely the least effort for now. I can add the following two mappings: xpl=application/xml xproc=application/xml Are some more that I should include? Thanks, Christian On Fri, Jun 9, 2017 at 11:49 AM, Andy Bunce <bunce.andy at gmail.com<mailto:bunce.andy at gmail.com>> wrote: > Hi, > > I notice that fetch:content-type()[1] returns "application/octet-stream" for > files with the commonly used XProc file extensions *.xpl and *.xproc. > This seems to be driven from the list in > src/main/resources/media-types.properties [2] > Would it be possible to add these extensions as "application/xproc+xml" or > add a mechanism to allow extension/customisation? Maybe similar to [3] > For static files served from jetty adding mime-mapping elements to web.xml > works [4] > > /Andy > > [1] http://docs.basex.org/wiki/Fetch_Module#fetch:content-type > [2] > https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/resources/media-types.properties > [3] > http://docs.oracle.com/javase/7/docs/api/javax/activation/MimetypesFileTypeMap.html > [4] > https://stackoverflow.com/questions/33803109/how-can-i-set-mime-mapping-to-a-file-served-as-static-content-by-jetty-runner/33809187#33809187

⚡Generated with XQuery