[Geoserver-devel] STRUTS package structure - 2 questions

Question #1: Package Structure

I have been trying to figure out a package structure for GeoServer 1.2 and cannot choose between the following:

Option 1

org.vnfy.geoserver.config
- existing package, contents have been removed
org.vnfy.geoserver.config.view
- jsp, servlet tiles based rendering sutff (WMSDescirption.jsp, WMSContents.jsp )
org.vnfy.geoserver.config.form
- contains ActionForms (aka FormBeans) (ie WMSDescriptionForm, WMSContentsForm )
org.vnfy.geoserver.config.action
- contains Struts Action (ie WMSDescriptionAction, WMSContentsAction )
org.vnfy.geoserver.config.model
- contains Beans for current configuration (WMSConfig)
org.vnfy.geoserver.config.model.xml
- model persistence to existing xml config files
org.vnfy.geoserver.global
- global appliaction state (ie WMSState or WMSGlobal or simply WMS )
- this is different from current configuration, may actually contains gt2 DataStores/Catalog etc...

Option 2 - group by sub-component

org.vnfy.geoserver.config.wms
- contains ActionForms (aka FormBeans) (ie WMSDescriptionForm, WMSContentsForm )
- contains WMS ActionForms (aka FormBeans) (ie WMSDescriptionForm, WMSContentsForm)
- contains WMS Actions (ie WMSDescriptionAction, WMSContentsAction )
- contains WMS View implementations (JSP files)
org.vnfy.geoserver.config.wfs
- similar to WMS
org.vnfy.geoserver.config.catalog
- similar to WMS
org.vnfy.geoserver.config.model
- contains Beans for current configuration (WMSConfig,..)
org.vnfy.geoserver.config.model.xml
- model persistence to existing xml config files

org.vnfy.geoserver.global
- global appliaction state (ie WMSState or WMSGlobal or simply WMS )
- this is different from current configuration, may actually contains gt2 DataStores/Catalog etc...

Question #2 - JSP Location/Deployment

I also cannot tell where to locate the source JSP files they could be next to the actions, or the forms or in the top level. There is also conflicting advise on where to store them - either "naked" or in the WEB_INF directory where only STRUTS Actions can redirect to them.

If anyone had any guidence it would be appricated.
Jody Garnett

Okay I am learning - option 1 seems to have it. And it has been recommended (thanks David/Chris) that I follow the existing "module" based example as seen in the request and response packages...

So we are left with a layered approach at the geoserver package level, each layer has a sub package for each module. GeoServer currently consists of three modules: WFS, WMS and Catalog. Each layer occasionally has helper classes such as reader, writers or parsers.

So for the 1.2 branch we will have...

package org.vnfy.geoserver
- seems to be common Exception Handling code + Tomcat

package org.vnfy.geoserver.action
package org.vnfy.geoserver.action.catalog
package org.vnfy.geoserver.action.wfs
package org.vnfy.geoserver.action.wms
- contains Struts Action (ie WMSDescriptionAction, WMSContentsAction )

package org.vnfy.geoserver.config
package org.vnfy.geoserver.config.catalog
package org.vnfy.geoserver.config.wfs
package org.vnfy.geoserver.config.wms
- contains Beans for current configuration (ie WMSConfig)
package org.vnfy.geoserver.config.xml
- processes xml read & write

package org.vnfy.geoserver.form
package org.vnfy.geoserver.form.catalog
package org.vnfy.geoserver.form.wfs
package org.vnfy.geoserver.form.wms
- contains ActionForms (aka FormBeans) (ie WMSDescriptionForm, WMSContentsForm )

package org.vnfy.geoserver.global
package org.vnfy.geoserver.global.catalog
package org.vnfy.geoserver.global.wfs
package org.vnfy.geoserver.global.wms
- contains the actual server state (ie WMSGlobal )
- actual beans probably saved in WebContainer (rather than singletons)
- catalog contains "real" gt2 DataStores with JDBC connections

package org.vnfy.geoserver.requests
package org.vnfy.geoserver.requests.readers
package org.vnfy.geoserver.requests.wfs
package org.vnfy.geoserver.requests.wms
- request parsing, processing

package org.vnfy.geoserver.response
package org.vnfy.geoserver.response.wfs
package org.vnfy.geoserver.response.wms
- manages top-level responses

package org.vnfy.geoserver.view
package org.vnfy.geoserver.view.catalog
package org.vnfy.geoserver.view.wfs
package org.vnfy.geoserver.view.wms
- jsp, servlet tiles based rendering sutff (WMSDescirption.jsp, WMSContents.jsp )

package org.vnfy.geoserver.servlett
- contains all interface servlets, one for each WFS, WMS, GeoServer response
- our ActionForm subclass should go here?

package org.vnfy.geoserver.global.zserver
- not sure what this one does

Jody Garnett wrote:

Back again - just had a short irc/phone call with Chris. Basically we
really wish we had things flipped around like so:
org.vnfy.geoserver.wms
org.vnfy.geoserver.wfs
org.vnfy.geoserver.data

Where wms/wfs/data can do whatever they want (probably need a common
config entry point though)

But we don't have the above, and we don't have time right now to get
there. So we are going to continue with option 3...renaming "catalog" to "data" in case a real OGC catalog server shows up (rather than the existing zserver)

So at the end of the day:

WEB-INF/struts-config.xml
WEB-INF/tiles/
WEB-INF/pages/

package org.vnfy.geoserver
- seems to be common Exception Handling code + Tomcat

package org.vnfy.geoserver.action
package org.vnfy.geoserver.action.data
package org.vnfy.geoserver.action.wfs
package org.vnfy.geoserver.action.wms
- contains Struts Action (ie WMSDescriptionAction, WMSContentsAction )

package org.vnfy.geoserver.config
package org.vnfy.geoserver.config.data
package org.vnfy.geoserver.config.wfs
package org.vnfy.geoserver.config.wms
- contains Beans for current configuration (ie WMSConfig)

package org.vnfy.geoserver.config.xml
- processes xml read & write

package org.vnfy.geoserver.form
package org.vnfy.geoserver.form.data
package org.vnfy.geoserver.form.wfs
package org.vnfy.geoserver.form.wms
- contains ActionForms (aka FormBeans) (ie WMSDescriptionForm, WMSContentsForm )

package org.vnfy.geoserver.global
package org.vnfy.geoserver.global.data
package org.vnfy.geoserver.global.wfs
package org.vnfy.geoserver.global.wms
- contains the actual server state (ie WMSGlobal )
- actual beans probably saved in WebContainer (rather than singletons)
- catalog contains "real" gt2 DataStores with JDBC connections

package org.vnfy.geoserver.requests
package org.vnfy.geoserver.requests.readers
package org.vnfy.geoserver.requests.wfs
package org.vnfy.geoserver.requests.wms
- request parsing, processing

package org.vnfy.geoserver.response
package org.vnfy.geoserver.response.wfs
package org.vnfy.geoserver.response.wms
- manages top-level responses

package org.vnfy.geoserver.servlett
- contains all interface servlets, one for each WFS, WMS, GeoServer response
- our ActionForm subclass should go here?

package org.vnfy.geoserver.global.zserver
- a non j2ee front end