kinisi / geoserver

MIT License
0 stars 0 forks source link

Implement template-based output formatting. #4

Open aohren opened 10 years ago

aohren commented 10 years ago

Allow user-defined output format, based on a template that maps from our canonical format to arbitrarily defined user templates.

trevorcarlson commented 10 years ago

This is a great idea. But what are you thinking exactly, a high-level description language. Maybe a JavaScript per-entry way to describe the data might be helpful:

"print(data1 + ',' + data2)"

On Apr 5, 2014, at 10:57 AM, Adam Ohren notifications@github.com wrote:

Allow user-defined output format, based on a template that maps from our canonical format to arbitrarily defined user templates.

— Reply to this email directly or view it on GitHub.

aohren commented 10 years ago

Open to anything really. I think there's lots of ways. Something like that or like the following that describes $vars on our end and where it would go in your expected format. Or all of the above! :)

MyFormat { xPos: $lat yPos: $long }

aohren commented 10 years ago

I'm going to start by reworking the already hardcoded CSV and KML formats as simple templates and embedding an Apache Velocity engine on the server. This will be an internal implementation detail for now, but will make it much easier to add/update our formats going forward. After that's done we can brainstorm ways of maybe allowing users to submit their own (ie- upload their own template and we'll transform the data and send it back to them).