[Geoserver-devel] New templating tutorials

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?
In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?
Cheers
Andrea

Andrea Aime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?

Looks great Andrea.

In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?

Not quite sure what you mean.

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,469cb21f286751637810514!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Andrea Aime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?

Looks great Andrea.

In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?

Not quite sure what you mean.

Now feature.typeName is just a string. What about exposing the type
as an attribute, and then use feature.type.name instead?

Cheers
Andrea

Andrea Aime wrote:

Justin Deoliveira ha scritto:

Andrea Aime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?

Looks great Andrea.

In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?

Not quite sure what you mean.

Now feature.typeName is just a string. What about exposing the type
as an attribute, and then use feature.type.name instead?

I see... yeah I could go for that... I would assume that we would also provide attribute type access via feature.type. The only downside I see to this is that the user has two ways to get to an attribute type:

1. feature.attributes
2. feature.type.attributes

Could possibly be confusing.

Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

!DSPAM:4007,469cd864323595219720167!

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Justin Deoliveira ha scritto:

Andrea Aime wrote:

I see... yeah I could go for that... I would assume that we would also provide attribute type access via feature.type. The only downside I see to this is that the user has two ways to get to an attribute type:

Yes, haven't you seen this wiki page?
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

1. feature.attributes
2. feature.type.attributes

Could possibly be confusing.

Yeah, I know, the downside of providing information in just one place
would be that you have to find ways to access the attributes map in
feature with another value got from the data model, that is, something like:

${feature.type.attributes[${attribute.name}].type}

thought I have really no idea of what's the actual freemarker syntax
to do that.
Having those duplicated makes it easier for the user.

Cheers
Andrea

Here are a few minor changes for the tutorial pages.

http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Look into GEOSERVER_DATA_DIR/featureTypes/myfeatureTeype/template.ftl to
see...
    should be
Look into GEOSERVER_DATA_DIR/featureTypes/myfeatureType/template.ftl to
see...

as in ${myMap.myKey, and can be nested
    should be
as in ${myMap.myKey}, and can be nested

I would have made them myself, but my login doesn't seem to have page edit
permissions...

Cheers,
Tyler

aaime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?
In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
View this message in context: http://www.nabble.com/New-templating-tutorials-tf4096488.html#a11694740
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

It seems that the Freemarker templates provide a staightforward way of
customizing the GeoServer output. In addition to the templates listed in
the tutorial, it seems that many other useful templates that could be
developed that would likely have very similar implementations to the
templates that have already been implemented.

For example, following the KML template tutorial, the description.ftl
template allows you to set the description element of the placemark.

   description.ftl
          ''This is ${STATE_NAME.value} state which has a population of
${PERSONS.value}."

yields KML like...

     <Placemark>
          <description>This is Michigan state which has a population of
9,295,297.</description>
          ...
     </Placemark>

It seems that a similar pattern could be used to add temporal information to
a KML placemark
for example (KML timestamp information):

     kml_timestamp.ftl
           "${ADMIS_DATE.value}"

could add a timestamp element to the KML...

     <Placemark>
          ...
          <TimeStamp><when>2001-04-17</when></TimeStamp>
          ...
     </Placemark>

another example (KML timespan information)...

     kml_timespan.ftl
          
"<begin>${ADMIS_DATE.value}</begin><end>${FUTURE_DATE.value}</end>"

could add a timestamp element to the KML...

     <Placemark>
          ...
         
<TimeSpan><begin>2001-04-17</begin><end>2050-01-12</end></TimeSpan>
          ...
     </Placemark>

Granted, I'm not a java developer and I have no idea what coding needs to go
on behind the scenes, but the templates seem to follow a very similar to
what has already been implemented...

Cheers,
Tyler

aaime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?
In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
View this message in context: http://www.nabble.com/New-templating-tutorials-tf4096488.html#a11695342
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

Thanks Tyler,

Made the corrections. We had to restrict access to our wiki due to spam... if you are interested in helping us qa or write docs let me know and i can set you up with access.

Tyler Erickson wrote:

Here are a few minor changes for the tutorial pages.

http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Look into GEOSERVER_DATA_DIR/featureTypes/myfeatureTeype/template.ftl to
see...
    should be Look into GEOSERVER_DATA_DIR/featureTypes/myfeatureType/template.ftl to
see...

as in ${myMap.myKey, and can be nested
    should be
as in ${myMap.myKey}, and can be nested

I would have made them myself, but my login doesn't seem to have page edit
permissions...

Cheers,
Tyler

aaime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?
In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

Hi Tyler,

Thats an interesting idea... i like the idea of using a template to achieve this... i wonder if this could somehow apply to georss as well... as both kml and georss use the same templates.

What do others think?

Tyler Erickson wrote:

It seems that the Freemarker templates provide a staightforward way of
customizing the GeoServer output. In addition to the templates listed in
the tutorial, it seems that many other useful templates that could be
developed that would likely have very similar implementations to the
templates that have already been implemented.

For example, following the KML template tutorial, the description.ftl
template allows you to set the description element of the placemark.

   description.ftl
          ''This is ${STATE_NAME.value} state which has a population of
${PERSONS.value}."

yields KML like...

     <Placemark>
          <description>This is Michigan state which has a population of
9,295,297.</description>
          ...
     </Placemark>

It seems that a similar pattern could be used to add temporal information to
a KML placemark
for example (KML timestamp information):

     kml_timestamp.ftl
           "${ADMIS_DATE.value}"

could add a timestamp element to the KML...

     <Placemark>
          ...
          <TimeStamp><when>2001-04-17</when></TimeStamp>
          ...
     </Placemark>

another example (KML timespan information)...

     kml_timespan.ftl
          "<begin>${ADMIS_DATE.value}</begin><end>${FUTURE_DATE.value}</end>"

could add a timestamp element to the KML...

     <Placemark>
          ...
         <TimeSpan><begin>2001-04-17</begin><end>2050-01-12</end></TimeSpan>
          ...
     </Placemark>

Granted, I'm not a java developer and I have no idea what coding needs to go
on behind the scenes, but the templates seem to follow a very similar to
what has already been implemented...

Cheers,
Tyler

aaime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?
In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

I like this a _lot_ actually. I know you mentioned in before Tyler, but my brain went in to over complex mode and I didn't see that you could just add another template to the mix. It's a nice way to solve pretty low hanging fruit that's a nice win and shouldn't be too tough to implement.

Chris

Justin Deoliveira wrote:

Hi Tyler,

Thats an interesting idea... i like the idea of using a template to achieve this... i wonder if this could somehow apply to georss as well... as both kml and georss use the same templates.

What do others think?

Tyler Erickson wrote:

It seems that the Freemarker templates provide a staightforward way of
customizing the GeoServer output. In addition to the templates listed in
the tutorial, it seems that many other useful templates that could be
developed that would likely have very similar implementations to the
templates that have already been implemented.

For example, following the KML template tutorial, the description.ftl
template allows you to set the description element of the placemark.

   description.ftl
          ''This is ${STATE_NAME.value} state which has a population of
${PERSONS.value}."

yields KML like...

     <Placemark>
          <description>This is Michigan state which has a population of
9,295,297.</description>
          ...
     </Placemark>

It seems that a similar pattern could be used to add temporal information to
a KML placemark
for example (KML timestamp information):

     kml_timestamp.ftl
           "${ADMIS_DATE.value}"

could add a timestamp element to the KML...

     <Placemark>
          ...
          <TimeStamp><when>2001-04-17</when></TimeStamp>
          ...
     </Placemark>

another example (KML timespan information)...

     kml_timespan.ftl
          "<begin>${ADMIS_DATE.value}</begin><end>${FUTURE_DATE.value}</end>"

could add a timestamp element to the KML...

     <Placemark>
          ...
         <TimeSpan><begin>2001-04-17</begin><end>2050-01-12</end></TimeSpan>
          ...
     </Placemark>

Granted, I'm not a java developer and I have no idea what coding needs to go
on behind the scenes, but the templates seem to follow a very similar to
what has already been implemented...

Cheers,
Tyler

aaime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?
In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel

I'd be interested in contributing to the docs.
My confluence username is: tylere

Justin Deoliveira-4 wrote:

Thanks Tyler,

Made the corrections. We had to restrict access to our wiki due to
spam... if you are interested in helping us qa or write docs let me know
and i can set you up with access.

--
View this message in context: http://www.nabble.com/New-templating-tutorials-tf4096488.html#a11696516
Sent from the GeoServer - Dev mailing list archive at Nabble.com.

You should be good to go now.

Tyler Erickson wrote:

I'd be interested in contributing to the docs.
My confluence username is: tylere

Justin Deoliveira-4 wrote:

Thanks Tyler,

Made the corrections. We had to restrict access to our wiki due to spam... if you are interested in helping us qa or write docs let me know and i can set you up with access.

--
Justin Deoliveira
The Open Planning Project
http://topp.openplans.org

This also might be a relatively easy way of doing extrudes as well. We'd have to set a few other params to get the extrudes to work, but we could set them if an extrude template is there.

Extrudes and Time are the two big features that I want next, and was assuming that we'd need some serious time to put in to each. But it sounds like we may be able to squeeze them in without a ton of work if we go this route... Though I do slightly fear the number of templates getting out of control.

Chris

Justin Deoliveira wrote:

Hi Tyler,

Thats an interesting idea... i like the idea of using a template to achieve this... i wonder if this could somehow apply to georss as well... as both kml and georss use the same templates.

What do others think?

Tyler Erickson wrote:

It seems that the Freemarker templates provide a staightforward way of
customizing the GeoServer output. In addition to the templates listed in
the tutorial, it seems that many other useful templates that could be
developed that would likely have very similar implementations to the
templates that have already been implemented.

For example, following the KML template tutorial, the description.ftl
template allows you to set the description element of the placemark.

   description.ftl
          ''This is ${STATE_NAME.value} state which has a population of
${PERSONS.value}."

yields KML like...

     <Placemark>
          <description>This is Michigan state which has a population of
9,295,297.</description>
          ...
     </Placemark>

It seems that a similar pattern could be used to add temporal information to
a KML placemark
for example (KML timestamp information):

     kml_timestamp.ftl
           "${ADMIS_DATE.value}"

could add a timestamp element to the KML...

     <Placemark>
          ...
          <TimeStamp><when>2001-04-17</when></TimeStamp>
          ...
     </Placemark>

another example (KML timespan information)...

     kml_timespan.ftl
          "<begin>${ADMIS_DATE.value}</begin><end>${FUTURE_DATE.value}</end>"

could add a timestamp element to the KML...

     <Placemark>
          ...
         <TimeSpan><begin>2001-04-17</begin><end>2050-01-12</end></TimeSpan>
          ...
     </Placemark>

Granted, I'm not a java developer and I have no idea what coding needs to go
on behind the scenes, but the templates seem to follow a very similar to
what has already been implemented...

Cheers,
Tyler

aaime wrote:

Hi,
I've just added a couple of new template tutorials:
http://docs.codehaus.org/display/GEOSDOC/GetFeatureInfo+templates
http://docs.codehaus.org/display/GEOSDOC/Freemarker+templates

Anyone willing to have a look and comment?
In not particularly satisfied by the data model we are providing
for feature, maybe we should refer the feture type model from
it instead of just the name?
Cheers
Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel