[Zoo-discuss] mimeType output

Fenoy Gerald gerald.fenoy at geolabs.fr
Mon Jan 20 02:52:53 PST 2014


Dear Quang,
sorry for late reply.

In the ZOO-Kernel there is no specific mimeType other than "text/xml" to specify that your result is in XML format. Furthermore, as you can see here [1] there is a specific treatment for  all mimeTypes starting with « application/ » which does not correspond to your requirement. So I think that the first step should be to try using the text/xml mimeType initially, this way you will be sure that ZOO-Kernel will understand well that you want to deal with XML content and you should not face any issue doing this.

Nevertheless, I also think that we may use something similar to what we use for the MapServer support, defining two mimeTypes, one generic mimeType sur as text/xml and the specific one, in your example it should be application/vnd.agard.xml. This way, the ZOO-Kernel will take advantage of the generic mimeType to check if it is a XML content or not and will be able to deal with the relevant mimeType transparently.

If you are interested in getting such enhancement, please let me know I can integrate this quickly I think.

Waiting for your feedbacks.
Best regards,




[1] http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel/service_internal.c#L1638

Le 18 janv. 2014 à 18:23, truongxuan quang <truongxuanquang at yahoo.com> a écrit :

> Dear Gerald
> Sorry for unclear question, I could say yes...I need to do something like that, and I got stuck.
> Bellow is example what I would like to do, they were implemented some WPS in 52North (please see text bellow) 
> Describle process
> localhost:8080/wps/WebProcessingService?Request=DescribeProcess&service=WPS&Version=1.0.0&Language=en&Identifier=server.algorithm.EarthquakeQuery
> for more detail : https://docs.google.com/document/d/1AOfxDuzWyFQiHiOwXpi-Aeq1IPPDBwQTd0spNmdBktQ/edit?usp=sharing
> ............
> <ProcessOutputs>
> <Default>
> <Format>
> <MimeType>application/vnd.agard.xml</MimeType>
> </Format>
> </Default>
> <Supported>
> <Format>
> <MimeType>application/vnd.agard.xml</MimeType>
> </Format>
> </Supported>
> </ComplexOutput>
> </Output>
> </ProcessOutputs>
> </ProcessDescription>
> </ns:ProcessDescriptions>
> ==================     
> Execute Process
> localhost:8080/wps/WebProcessingService?Service=WPS&Version=1.0.0&Request=Execute&Identifier=server.algorithm.EarthquakeQuery&DataInputs=...............
> more detail https://docs.google.com/document/d/1b24T81zpjhZcx-H6xhTFyZjTzx7y8RK2EPkrl-7X5NY/edit?pli=1
> ============= 
> Refer to above DescribeProcess if I try to Execute process I get
> full detail in big file xml of Execute request as  abstract of xml bellow:
> (2) 
> <episode>
> <episode-id>EQ1_1389871457374</episode-id>
> </event-id>
> <datums alias="Input Parameters" id="IP" source="Input Parameters">
> ...
> <datums alias="Alert Parameters" id="AP" source="Alert Parameters">
> ..
> <datums alias="Alert Parameters" id="AP" source="Alert Parameters">
> ...
> <datums alias="CITY" id="w_city" source="Alert Parameters">
> ...
> <datums alias="AIRPORT" id="w_airport" source="Alert Parameters">
> ..
> <datums alias="LOGISTIC" id="w_logistic" source="Alert Parameters">
> ..
> <datums alias="nurclear-cite" id="ras1" source="Alert Parameters">
> ...
> <datums alias="POP INFO" id="ras0" source="Raster Analysis">
> ...
> <datums alias="ELEV INFO" id="ras1" source="Raster Analysis">
> ....
> <datums alias="SLOPE  INFO" id="ras2" source="Raster Analysis">
> ......
> 
> as you can see Execute of Process was transformed to .agard.xml
> FROM Original of WPS standard and Execute result (2) they are totally different.
> My question is there is the way to configure transform xml as above example by automatic way OR I have to write specific code in python (eg: If in case I write ZOO service in python).
> If I understand not wrong, I have to write the code in ZOO-Service.py to transform xml, I would like to make sure that it can fine (no bug or error) if I transform xml using ZOO-Project. Anyway Gerald if you have already some example or ideas please help 
> 
> I hope these example is clear for my question 
> 
> Many thanks
> 
> Quang   
> 
> 
> On Thursday, January 16, 2014 5:22 PM, Fenoy Gerald <gerald.fenoy at geolabs.fr> wrote:
> Dear Quang,
> I’m not sure to understand exactly what you are searching for.
> 
> ZOO-Kernel should be able to handle any kind of mimeType « as-is ». In some cases, for instance when you are asking for the ZOO-Kernel to store your result, the name of the stored file won’t have any relation with the mimeType you specified. You can see here how it works : [1] and how mimeType are used to define extension in the filename stored. 
> To simplify we may add an array or a map in service.h storing couples of (mimeType,extension)  or we may also use extension defined in zcfg file.
> 
> Anyway, first I would like to make I am on the right way for your question about integrating a new mimeType support.
> 
> Best regards,
> 
> 
> [1] http://zoo-project.org/trac/browser/trunk/zoo-project/zoo-kernel/service_internal.c#L1937
> 
> Le 16 janv. 2014 à 11:52, truongxuan quang <truongxuanquang at yahoo.com> a écrit :
> 
> > If I use xsd or xslt in this case it is fine with ZOO-kernel? 
> > 
> > 
> > On Thursday, January 16, 2014 11:48 AM, truongxuan quang <truongxuanquang at yahoo.com> wrote:
> > Dear list
> > 
> > 
> > It is possible if I would like to define my mineType for ComplexOutput in ZOO-Project, If yes how can I config for a new mineType.
> > 
> > Many thanks,
> > 
> > T.Xuan Quang
> 
> > 
> > 
> > _______________________________________________
> > Zoo-discuss mailing list
> > Zoo-discuss at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss
> 
> 
> 
> Gérald Fenoy
> gerald.fenoy at geolabs.fr
> 
> 
> 
> _______________________________________________
> Zoo-discuss mailing list
> Zoo-discuss at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/zoo-discuss



Gérald Fenoy
gerald.fenoy at geolabs.fr

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 204 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osgeo.org/pipermail/zoo-discuss/attachments/20140120/6f92d443/attachment.pgp>


More information about the Zoo-discuss mailing list