Hi Justin,
Thanks for your reply. It seems really close to possible, just two thing
in the way, 1. The messages (which could be fixed by adding a new
attribute to the .mainLayout tiles definition for the bundle name), 2.
Loading the JSP from a JAR, I can't convince
ServletRequest.getRequestDispatcher(string).include(req, resp) to work
for a JSP in the classpath. (Not 100% on how to fix that one...)
Anyway, my aim is to draft FeatureTypes for each table in a
PostgreSQL/PostGIS data store. We are uploading a lot of data into a
database and it would be easier for the GIS people if they could just
generate all the FeatureTypes rather than doing it manually. My
extension was just going to grab the list of available types from the
DataStore and create FeatureTypes applying the generated bounding box
and a default style depending on whether the geometry is point, line,
polgon etc.
Is there something already out there that might do this?
Thanks,
Tim
-----Original Message-----
From: Justin Deoliveira [mailto:jdeolive@anonymised.com]
Sent: Friday, 30 January 2009 12:16 AM
To: Tim Carpenter
Cc: geoserver-devel@lists.sourceforge.net
Subject: Re: [Geoserver-devel] Message bundles for GeoServer extension
Hi Tim,
Unfortunately none of the developers have ever managed to achieve the
goal of distributing UI pages and components as extensions. I am not
sure its possible with the current struts based user interface.
However, for geoserver 2.0 we are adopting a new user interface, and
this is one of the primary things we are looking for. And is one of the
reasons we went with wicket as a framework. It currently lives in a
community module on geoserver trunk.
How exactly are you trying to extend the user interface? Perhaps there
might be another option.
Tim Carpenter wrote:
Hi,
I am trying a simple extension of GeoServer to add a new page to the
config section of the UI. I am having trouble using the .mainLayout
tile
to render the screen as it tries to find messages that are defined in
my
own JAR.
I have created a JAR containing:
WEB-INF/struts-config.xml
WEB-INF/tiles-defs.xml
WEB-INF/pages/data/featureTypes/Draft.jsp
my/package/MyAction.class
my/package/MyActionForm.class
MyApplicationResources.properties
In my struts-config.xml I have (along with my regular struts config
stuff):
<message-resources key="tim-test" parameter="MyApplicationResources"/>
In my tiles-defs.xml I have:
<tiles-definitions>
<definition name="config.data.type.draft" extends=".mainLayout">
<put name="key" value="config.data.type.draft"/>
<put name="body"
value="/WEB-INF/pages/data/featureTypes/Draft.jsp"/>
<put name="status" value="/WEB-INF/pages/data/status.jsp"/>
<put name="layer" value="data"/>
<put name="locationForwards"
value="welcome:config:config.data:config.data.type"/>
<put name="configActions"
value="/WEB-INF/pages/configActions.jsp"/>
</definition>
</tiles-definitions>
At the start of the .mainLayout tile it tries to resolve the
config.data.type.draft.title property which is defined in my message
bundle not in the default one. So it fails:
javax.servlet.ServletException: javax.servlet.jsp.JspException:
Missing
message for key "config.data.type.draft.title"
at
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageCont
extImpl.java:858)
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImpl.java:791)
at
org.apache.jsp.WEB_002dINF.pages.layouts.mainLayout_jsp._jspService(org.
apache.jsp.WEB_002dINF.pages.layouts.mainLayout_jsp:649)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
va:332)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2
16)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
Caused by: javax.servlet.jsp.JspException: Missing message for key
"config.data.type.draft.title"
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
at
org.apache.jsp.WEB_002dINF.pages.layouts.mainLayout_jsp._jspService(org.
apache.jsp.WEB_002dINF.pages.layouts.mainLayout_jsp:313)
... 69 more
There is no option on the .mainLayout tile definition for the message
bundle to point it at my bundle. I don't want to have to change and
thereafter maintain my own version of the main GeoServer packages.
Is there a way to merge my messages into the default message bundle so
my messages can be found?
Thanks,
Tim
------------------------------------------------------------------------
------------------------------------------------------------------------
------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
------------------------------------------------------------------------
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.