Returning multiple GenericFiles

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Returning multiple GenericFiles

sammeek
Hi Benjamin,

I am trying to create feature level metadata records server side and I want to return them to the client in some way. Is there a way to Zip a these records and then return them in a zipped genericfiledatabinding? I ideally need to do it this way because I need to keep CSW credentials client side.

Thanks for your continued help.

Sam
Reply | Threaded
Open this post in threaded view
|

Re: Returning multiple GenericFiles

BenjaminPross
Hi Sam,

There is no built-in functionality to do this, but you can do it quite
easily on your own.
In your process, use the zip() method of the IOUtils class to zip your
files. The zipped file can then be returned as GenericFileData.
Now you will need to create a mime type for the new zipped file format.
You will need to add this mime type to the GenericFileGenerator in the
wps_config.xml.
You should also use the mime type in your process, when you create the
GenericFileData with the zip file as payload.
Last but not least, you could add the mime type and the file extension
"zip" in the io.properties file located in the directory
/52n-wps-io/src/main/resources/org/n52/wps/io
This should ensure that the zip file will be delivered with the correct
file extension.

Hope this helps.

Cheers,

Benjamin

Am 20.10.2014 16:27, schrieb sammeek:

> Hi Benjamin,
>
> I am trying to create feature level metadata records server side and I want
> to return them to the client in some way. Is there a way to Zip a these
> records and then return them in a zipped genericfiledatabinding? I ideally
> need to do it this way because I need to keep CSW credentials client side.
>
> Thanks for your continued help.
>
> Sam
>
>
>
> --
> View this message in context: http://geoprocessing.forum.52north.org/Returning-multiple-GenericFiles-tp4025843.html
> Sent from the 52° North - Geoprocessing Community Forum mailing list archive at Nabble.com.
> _______________________________________________
> Geoprocessingservices mailing list
> [hidden email]
> http://list.52north.org/mailman/listinfo/geoprocessingservices
> http://geoprocessing.forum.52north.org
> Please respect our mailing list guidelines:
> http://52north.org/resources/mailing-lists-and-forums/guidelines


--
Benjamin Proß
Software Engineer
52°North Geoprocessing Community

52°North Initiative for Geospatial Open Source Software GmbH
Martin-Luther-King-Weg 24
Fon: +49-(0)-251–396371-42
Fax: +49-(0)-251–396371-11
[hidden email]
http://52north.org/

General Managers: Dr. Albert Remke, Dr. Andreas Wytzisk
Local Court Muenster HRB 10849

_______________________________________________
Geoprocessingservices mailing list
[hidden email]
http://list.52north.org/mailman/listinfo/geoprocessingservices
http://geoprocessing.forum.52north.org
Please respect our mailing list guidelines:
http://52north.org/resources/mailing-lists-and-forums/guidelines