Hi Miles,
Having struggled with ftl templates this summer myself, I can relate to your
situation. I found that the REST extension
(http://svn.codehaus.org/geoserver/trunk/src/extension/restconfig/src/main/java/org/geoserver/catalog/rest/templates/)
templates were very helpful in determining which fields are accessible and how
to access them.
Anyway, the FeatureTypeInfo.ftl template contains:
<#include "head.ftl">
Feature Type "${properties.name}"
<ul>
<li>Name: ${properties.name}</li>
<li>Description: ${properties.description}</li>
<li>abstract: ${properties.abstract}</li>
<li>Enabled: ${properties.enabled}</li>
<li>SRS: ${properties.sRS}</li>
<li>Bounds: ${properties.boundingBox}></li>
</ul>
<#include "tail.ftl">
Which suggests that the feature type name (possibly what you're referring to as
title?) is accessed through the properties.name field and the abstract through
properties.abstract, respectively. These might require some kind of list
structure around them (i.e. <#list values as ft> or <#list features as
ft>ft.properties.name), but I found that the easiest way to determine if this
is needed was through trial and error.
Hope this helps!
Regards,
Paula
***************************************
Paula Perkola
Trainee Research Scientist
VTT Technical Research Centre of Finland
-----Original Message-----
From: Miles Jordan [mailto:[email protected]]
Sent: 28. heinäkuuta 2010 8:29
To: '[email protected]'
Subject: [Geoserver-users] GetFeatureInfo FTL [Sec=Unclassified]
Hi all,
I'm attempting to use an FTL template to show some basic info about features
(Geoserver 2.0.2 war).
The most basic of templates I'm trying has this in content.ftl, which is
supposed to show the title of the feature type and the abstract:
<#list features as feature>
<h3>${feature.type.title}</h3>
<p>${feature.type.abstract}</p>
</#if>
</#list>
${feature.type.title} shows "Layer: v_real_time_underway". v_real_time_underway
is actually the name of the table in the database. The title of the feature
type in the configuration is "Current Voyage".
${feature.type.abstract} shows "[No Abstract Provided]". There actually is one.
Because this is a custom template for a specific feature type, I could just
hard code the values for type name and abstract in there, but I'd rather have
clean templates that source feature type info from the geoserver configuration.
Thoughts?
Regards,
Miles Jordan
Acting Manager / Systems Analyst
Australian Antarctic Data Centre
Australian Antarctic Division
Dept. of the Environment, Water, Heritage & the Arts
___________________________________________________________________________
Australian Antarctic Division - Commonwealth of Australia
IMPORTANT: This transmission is intended for the addressee only. If you are not
the intended recipient, you are notified that use or dissemination of this
communication is strictly prohibited by Commonwealth law. If you have received
this transmission in error, please notify the sender immediately by e-mail or
by telephoning +61 3 6232 3209 and DELETE the message.
Visit our web site at http://www.antarctica.gov.au/
___________________________________________________________________________
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users