[Geoserver-users] add other ows to gs

Hi:

We have implemented a WPS instance, and now we want to integrate it to gs to replace the wps under the community module of geoserver 2.0.0(for easily written, I call it gs-wps).

The problem is that our wps have a different architecture with the gs-wps. I found the other ows such as wcs wms and wfs all have some common struts: the kvp-parser, response and so on. Also they all communicate with spring. And each operation of a ows will be built as a java object for example the “org.vfny.geoserver.wms.servlets.DescribeLayer” in the wms and so on.

However in our wps there is only a WPSServlet acted as a front controller which receive the httpservletrequest and httpservletResponse as parameters. No matter which kind of request is received (getCapabilities or DescribeProcess) , they are all handled by the front controller

So I do not know how to dispatch the request from the client to the WPSServlet and do some initialization work.

I have seen the gs sources for a long time ,but I have no idea because of my unfamiliar with the spring.

I also referred to the hello plugin at http://geoserver.org/display/GEOSDOC/3+A+Simple+PlugIn

But it seems that it does not work.

I hope someone can give me some further advise.

Sorry to bother you.

I’m sure the fellows working on the WPS module are curious why it didn’t meet your needs. In the long term, a WPS based on the OWS dispatcher system is probably the only implementation that will make it into officially supported status, so you might want to look into helping out with that effort instead of tacking an independent servlet onto GeoServer.

That said, the printing community module does very little aside from wrapping a plain servlet so that it can hook into Spring; you may find it a useful example:
http://svn.codehaus.org/geoserver/trunk/src/community/printing/

There currently needs to be a mapping added to web.xml for such mappings to apply, however.

Hope this helps.

If you could avoid cross posting to both lists that would be appreciated. As this is a development question it is more suited to the geoserver-devel list.

That said, we are happy about the contribution. However have you thought about collaborating with the existing wps effort? David Robison and Andrea have been putting a lot of effort into the existing wps module so it is definitely starting to gain momentum. It is built with teh common ows architecture used by services, and it integrates nicely with the geotools process api.

It would be nice to have some more information about your WPS service. How does it work internally? What is the range of processes that it includes? etc...

That said, the easiest way to wire up your servlet is to add a mapping for it directly in the web.xml file, and it can totally bypass spring all together. This approach has a number of downsides in that you won't be able to access any of the geoserver internals such as the catalog. But it is probably easiest.

-Justin

maven apache wrote:

Hi:

We have implemented a WPS instance, and now we want to integrate it to gs to replace the wps under the community module of geoserver 2.0.0(for easily written, I call it gs-wps).

The problem is that our wps have a different architecture with the gs-wps. I found the other ows such as wcs wms and wfs all have some common struts: the kvp-parser, response and so on. Also they all communicate with spring. And each operation of a ows will be built as a java object for example the “org.vfny.geoserver.wms.servlets.DescribeLayer” in the wms and so on.

However in our wps there is only a WPSServlet acted as a front controller which receive the httpservletrequest and httpservletResponse as parameters. No matter which kind of request is received (getCapabilities or DescribeProcess) , they are all handled by the front controller

So I do not know how to dispatch the request from the client to the WPSServlet and do some initialization work.

I have seen the gs sources for a long time ,but I have no idea because of my unfamiliar with the spring.

I also referred to the hello plugin at http://geoserver.org/display/GEOSDOC/3+A+Simple+PlugIn

But it seems that it does not work.

I hope someone can give me some further advise.

Sorry to bother you.

------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

------------------------------------------------------------------------

_______________________________________________
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.

Thanks for Justin’s reply and sorry for my crossing posting, it won’t happen again. :slight_smile: .

2009/12/22 Justin Deoliveira <jdeolive@anonymised.com>

If you could avoid cross posting to both lists that would be appreciated. As this is a development question it is more suited to the geoserver-devel list.

That said, we are happy about the contribution. However have you thought about collaborating with the existing wps effort? David Robison and Andrea have been putting a lot of effort into the existing wps module so it is definitely starting to gain momentum. It is built with teh common ows architecture used by services, and it integrates nicely with the geotools process api.

Yes, the gs-wps is fine. However we have not only wps but also other swe owses(sps,and sos).

It would be nice to have some more information about your WPS service. How does it work internally? What is the range of processes that it includes? etc…

The front controller is to get the request string (for get it maybe “request=wps&version=1.0.0…” and for post it maybe a xml fragment" ) ,then parser the string to identify the request type(getCapabilities or DescirbeProcess),then do the business work, build the response document and return.

That said, the easiest way to wire up your servlet is to add a mapping for it directly in the web.xml file, and it can totally bypass spring all together. This approach has a number of downsides in that you won’t be able to access any of the geoserver internals such as the catalog. But it is probably easiest.

yes, this is a easier way to implement my requirement, and I also want to build some pages to manager the service just like the web pages to config the wcs wms and wcs in the gs.
Actually I prefer I can add my service in a plugin way like the other ows in the gs.
Thanks anyway.

-Justin

maven apache wrote:

Hi:

We have implemented a WPS instance, and now we want to integrate it to gs to replace the wps under the community module of geoserver 2.0.0(for easily written, I call it gs-wps).

The problem is that our wps have a different architecture with the gs-wps. I found the other ows such as wcs wms and wfs all have some common struts: the kvp-parser, response and so on. Also they all communicate with spring. And each operation of a ows will be built as a java object for example the “org.vfny.geoserver.wms.servlets.DescribeLayer” in the wms and so on.

However in our wps there is only a WPSServlet acted as a front controller which receive the httpservletrequest and httpservletResponse as parameters. No matter which kind of request is received (getCapabilities or DescribeProcess) , they are all handled by the front controller

So I do not know how to dispatch the request from the client to the WPSServlet and do some initialization work.

I have seen the gs sources for a long time ,but I have no idea because of my unfamiliar with the spring.

I also referred to the hello plugin at http://geoserver.org/display/GEOSDOC/3+A+Simple+PlugIn

But it seems that it does not work.

I hope someone can give me some further advise.

Sorry to bother you.



This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev



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.

maven apache wrote:

Thanks for Justin's reply and sorry for my crossing posting, it won't happen again. :slight_smile: .

No problem :slight_smile:

2009/12/22 Justin Deoliveira <jdeolive@anonymised.com <mailto:jdeolive@anonymised.com>>

    If you could avoid cross posting to both lists that would be
    appreciated. As this is a development question it is more suited to
    the geoserver-devel list.

    That said, we are happy about the contribution. However have you
    thought about collaborating with the existing wps effort? David
    Robison and Andrea have been putting a lot of effort into the
    existing wps module so it is definitely starting to gain momentum.
    It is built with teh common ows architecture used by services, and
    it integrates nicely with the geotools process api.

Yes, the gs-wps is fine. However we have not only wps but also other swe owses(sps,and sos).

    It would be nice to have some more information about your WPS
    service. How does it work internally? What is the range of processes
    that it includes? etc...

The front controller is to get the request string (for get it maybe "request=wps&version=1.0.0....." and for post it maybe a xml fragment" ) ,then parser the string to identify the request type(getCapabilities or DescirbeProcess),then do the business work, build the response document and return.

Ok, and you don't intend to use the current ows dispatcher?

    That said, the easiest way to wire up your servlet is to add a
    mapping for it directly in the web.xml file, and it can totally
    bypass spring all together. This approach has a number of downsides
    in that you won't be able to access any of the geoserver internals
    such as the catalog. But it is probably easiest.

yes, this is a easier way to implement my requirement, and I also want to build some pages to manager the service just like the web pages to config the wcs wms and wcs in the gs.

Plugging into the wicket UI is generally easy. It is documented in the developer guide:

http://docs.geoserver.org/2.0.x/en/developer/programming-guide/wicket-pages/index.html

Actually I prefer I can add my service in a plugin way like the other ows in the gs.

Ok, so what I would recommend is the following:

1) modify web.xml to create a mapping for your specific servlet, something like:

    <servlet-mapping>
       <servlet-name>dispatcher</servlet-name>
       <url-pattern>/foobar/*</url-pattern>
     </servlet-mapping>

   This will map certain urls (everything under foobar) to the spring dispatcher.

2) In your modules applicationContext.xml file create a spring controller that wraps up your servlet. See the javadoc of org.springframework.web.servlet.mvc.ServletWrappingController for details on how to do this.

3) Creating a second mapping that maps urls of the form foobar/** to the controller created in step (2). Look in the applicationContext.xml for wfs,wms,wcs,etc... for example, but it looks like:

  <bean id="wfsURLMapping"
class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
   <property name="alwaysUseFullPath" value="true"/>
     <property name="mappings">
      <props>
         <prop key="/foobar">servletWrappingBeanFromStep2</prop>
         <prop key="/foobar/*">servletWrappingBeanFromStep2</prop>
      </props>
     </property>
  </bean>

This approach will let you tie into spring and access the internals of geoserver, but will also allow you to avoid using the current ows service framework.

Hope that helps.

-Justin

Thanks anyway.

    -Justin

    maven apache wrote:

        Hi:

        We have implemented a WPS instance, and now we want to integrate
        it to gs to replace the wps under the community module of
        geoserver 2.0.0(for easily written, I call it gs-wps).

        The problem is that our wps have a different architecture with
        the gs-wps. I found the other ows such as wcs wms and wfs all
        have some common struts: the kvp-parser, response and so on.
        Also they all communicate with spring. And each operation of a
        ows will be built as a java object for example the
        “org.vfny.geoserver.wms.servlets.DescribeLayer” in the wms and
        so on.

        However in our wps there is only a WPSServlet acted as a front
        controller which receive the httpservletrequest and
        httpservletResponse as parameters. No matter which kind of
        request is received (getCapabilities or DescribeProcess) , they
        are all handled by the front controller

        So I do not know how to dispatch the request from the client to
        the WPSServlet and do some initialization work.

        I have seen the gs sources for a long time ,but I have no idea
        because of my unfamiliar with the spring.

        I also referred to the hello plugin at
        http://geoserver.org/display/GEOSDOC/3+A+Simple+PlugIn

        But it seems that it does not work.

        I hope someone can give me some further advise.

        Sorry to bother you.

        ------------------------------------------------------------------------

        ------------------------------------------------------------------------------
        This SF.Net email is sponsored by the Verizon Developer Community
        Take advantage of Verizon's best-in-class app development support
        A streamlined, 14 day to market process makes app distribution
        fast and easy
        Join now and get one step closer to millions of Verizon customers
        http://p.sf.net/sfu/verizon-dev2dev

        ------------------------------------------------------------------------

        _______________________________________________
        Geoserver-devel mailing list
        Geoserver-devel@lists.sourceforge.net
        <mailto: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.

------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

------------------------------------------------------------------------

_______________________________________________
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.

2009/12/23 Justin Deoliveira <jdeolive@anonymised.com>

maven apache wrote:

Thanks for Justin’s reply and sorry for my crossing posting, it won’t happen again. :slight_smile: .

No problem :slight_smile:

2009/12/22 Justin Deoliveira <jdeolive@anonymised.com mailto:[jdeolive@anonymised.com](mailto:jdeolive@anonymised.com)>

If you could avoid cross posting to both lists that would be
appreciated. As this is a development question it is more suited to
the geoserver-devel list.

That said, we are happy about the contribution. However have you
thought about collaborating with the existing wps effort? David
Robison and Andrea have been putting a lot of effort into the
existing wps module so it is definitely starting to gain momentum.
It is built with teh common ows architecture used by services, and
it integrates nicely with the geotools process api.

Yes, the gs-wps is fine. However we have not only wps but also other swe owses(sps,and sos).

It would be nice to have some more information about your WPS
service. How does it work internally? What is the range of processes
that it includes? etc…

The front controller is to get the request string (for get it maybe “request=wps&version=1.0.0…” and for post it maybe a xml fragment" ) ,then parser the string to identify the request type(getCapabilities or DescirbeProcess),then do the business work, build the response document and return.

Ok, and you don’t intend to use the current ows dispatcher?

That said, the easiest way to wire up your servlet is to add a
mapping for it directly in the web.xml file, and it can totally
bypass spring all together. This approach has a number of downsides
in that you won’t be able to access any of the geoserver internals
such as the catalog. But it is probably easiest.

yes, this is a easier way to implement my requirement, and I also want to build some pages to manager the service just like the web pages to config the wcs wms and wcs in the gs.

Plugging into the wicket UI is generally easy. It is documented in the developer guide:

http://docs.geoserver.org/2.0.x/en/developer/programming-guide/wicket-pages/index.html

Actually I prefer I can add my service in a plugin way like the other ows in the gs.

Ok, so what I would recommend is the following:

  1. modify web.xml to create a mapping for your specific servlet, something like:
dispatcher /foobar/*

This will map certain urls (everything under foobar) to the spring dispatcher.

  1. In your modules applicationContext.xml file create a spring controller that wraps up your servlet. See the javadoc of org.springframework.web.servlet.mvc.ServletWrappingController for details on how to do this.

  2. Creating a second mapping that maps urls of the form foobar/** to the controller created in step (2). Look in the applicationContext.xml for wfs,wms,wcs,etc… for example, but it looks like:

<bean id=“wfsURLMapping”

class=“org.springframework.web.servlet.handler.SimpleUrlHandlerMapping”>



servletWrappingBeanFromStep2
servletWrappingBeanFromStep2


This approach will let you tie into spring and access the internals of geoserver, but will also allow you to avoid using the current ows service framework.

Hi Justin:

Thinks for your latest suggestion.

I tried to get some further information of spring after I read your post.

I focused on the ServletWrappingController and I did a simple test by the following steps before I add the ows(my ows):

  1. I create a new maven module named “king” under the community module,and under the directory king/src/main/java I only create a simple Servelt named KServelt which just return a string to the client, this is the code:

public class KServlet extends HttpServlet{
protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
resp.getOutputStream().write(“king”.getBytes()); } } }
2) edit the applicationContext.xml under the /king/src/main/java, the contents can be found here http://dpaste.com/137311/

  1. modify the web.xml under the web/app/src/main/webapp/WEB-INFO,add the following "

dispatcher /king/*

Then I start the geoserver by run the org.geoserver.web.Start , then enter
http://localhost:8080/geoserver/king/king.do in the browser but it seems that the mapping does not work,since I got a 404 error.
I change the url to http://localhost:8080/geoserver/king.do,things did not change.

Actually I have do the same test about ServletWrappingController in a common dynamic web project,and it works. But in gs I failed,that is the reason I post it here rather than the springframework maillist.

Looking forward a reply.

:slight_smile:

Hope that helps.

-Justin

Thanks anyway.

-Justin

maven apache wrote:

Hi:

We have implemented a WPS instance, and now we want to integrate
it to gs to replace the wps under the community module of
geoserver 2.0.0(for easily written, I call it gs-wps).

The problem is that our wps have a different architecture with
the gs-wps. I found the other ows such as wcs wms and wfs all
have some common struts: the kvp-parser, response and so on.
Also they all communicate with spring. And each operation of a
ows will be built as a java object for example the
“org.vfny.geoserver.wms.servlets.DescribeLayer” in the wms and
so on.

However in our wps there is only a WPSServlet acted as a front
controller which receive the httpservletrequest and
httpservletResponse as parameters. No matter which kind of
request is received (getCapabilities or DescribeProcess) , they
are all handled by the front controller

So I do not know how to dispatch the request from the client to
the WPSServlet and do some initialization work.

I have seen the gs sources for a long time ,but I have no idea
because of my unfamiliar with the spring.

I also referred to the hello plugin at
http://geoserver.org/display/GEOSDOC/3+A+Simple+PlugIn

But it seems that it does not work.

I hope someone can give me some further advise.

Sorry to bother you.



This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution
fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev



Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net

mailto:[Geoserver-devel@lists.sourceforge.net](mailto:Geoserver-devel@anonymised.comrge.net)

https://lists.sourceforge.net/lists/listinfo/geoserver-devel

– Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.



This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev



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.

maven apache ha scritto:

1) I create a new maven module named "king" under the community module,and under the directory king/src/main/java I only create a simple Servelt named KServelt which just return a string to the client, this is the code:

*public class KServlet extends HttpServlet{*
* **protected void doGet(HttpServletRequest req, HttpServletResponse resp) {*
* **resp.getOutputStream().write("king".getBytes()); }** **} }*
2) edit the applicationContext.xml under the /king/src/main/java, the contents can be found here http://dpaste.com/137311/

3) modify the web.xml under the web/app/src/main/webapp/WEB-INFO,add the following "
-------------------------
    <servlet-mapping>
     <servlet-name>dispatcher</servlet-name>
     <url-pattern>/king/*</url-pattern>
    </servlet-mapping>
-------------------------

Then I start the geoserver by run the org.geoserver.web.Start , then enter http://localhost:8080/geoserver/king/king.do in the browser but it seems that the mapping does not work,since I got a 404 error.
I change the url to http://localhost:8080/geoserver/king.do,things did not change.

Is your servlet in the Start.java classpath when you start it?
Usually putting another module in the web-app classpath involves:
- adding a depedency from web-app to your new module, and adding
   your module to the general maven build (make sure your module
   it built when you do mvn install from the root)
- running mvn eclipse:eclipse again so that the eclipse projects
   are rebuilt
- refresh from eclipse

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

2009/12/24 Andrea Aime <aaime@anonymised.com>

maven apache ha scritto:

  1. I create a new maven module named “king” under the community module,and under the directory king/src/main/java I only create a simple Servelt named KServelt which just return a string to the client, this is the code:

public class KServlet extends HttpServlet{

  • *protected void doGet(HttpServletRequest req, HttpServletResponse resp) {
  • resp.getOutputStream().write(“king”.getBytes()); } *} }
  1. edit the applicationContext.xml under the /king/src/main/java, the contents can be found here http://dpaste.com/137311/

  2. modify the web.xml under the web/app/src/main/webapp/WEB-INFO,add the following "


dispatcher /king/* -------------------------

Then I start the geoserver by run the org.geoserver.web.Start , then enter http://localhost:8080/geoserver/king/king.do in the browser but it seems that the mapping does not work,since I got a 404 error.
I change the url to http://localhost:8080/geoserver/king.do,things did not change.

Is your servlet in the Start.java classpath when you start it?
Usually putting another module in the web-app classpath involves:

  • adding a depedency from web-app to your new module, and adding
    your module to the general maven build (make sure your module
    it built when you do mvn install from the root)
  • running mvn eclipse:eclipse again so that the eclipse projects
    are rebuilt
  • refresh from eclipse

Yes,I forgot mention that:
I have add a profile in the pom fo the webapp module:

addking org.geoserver king 2.0.0

Then I run commond: mvn clean install -Dmaven.test.skip=true -P addking, and I am sure the king.2.0.0.jar is included in the web/app/target/geoserver/webinfo/lib.

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

maven apache ha scritto:

Yes,I forgot mention that:
I have add a profile in the pom fo the webapp module:
----------------------
<profile>
<id>addking</id>
<dependencies>
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>king</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
</profile>
--------------------- Then I run commond: mvn clean install -Dmaven.test.skip=true -P addking, and I am sure the king.2.0.0.jar is included in the web/app/target/geoserver/webinfo/lib.

That does not matter. Is the web-app project referring to the king
project in Eclipse?
Try running:
mvn eclipse:eclipse -o -Paddking

and then refreshing from Eclipse

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

2009/12/24 Andrea Aime <aaime@anonymised.com>

maven apache ha scritto:

Yes,I forgot mention that:
I have add a profile in the pom fo the webapp module:

addking org.geoserver king 2.0.0 --------------------- Then I run commond: mvn clean install -Dmaven.test.skip=true -P addking, and I am sure the king.2.0.0.jar is included in the web/app/target/geoserver/webinfo/lib.

That does not matter. Is the web-app project referring to the king
project in Eclipse?

No,in the buildpath page,the project king do not exist, I wonder if it is caused that" the dependency king is not defined directly ? it is defined by profile manner?

Try running:
mvn eclipse:eclipse -o -Paddking

Ok, just following your suggestion, first I delete the .class and .project file under the web/app module,then run the above commond,then run mvn install -P addking.

But problem also .
The logs can be found here:http://dpaste.com/137319/

and then refreshing from Eclipse

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Hi:
This thread is posted for a long time. Thank Justin and other people, I have made some progress with their help. :).

However I meet another problem, the ows which I try to add to gs contains the following modules ,a web module(ows-web) and a jar module(ows-server), and there is a folder named conf under the ows-web/src/main/webapp/WEB-INF/conf… Under this folder there are many config files which are to be used in the servlet under the ows-server module. And this servelt is just the one I wrapped as a
org.springframework.web.servlet.mvc.ServletWrappingController.

I do not think it’s a good idea to add the config files to the web module of gs directly, because
1 ) I do not want to break the gs architecture.
2 ) the wcs wms also read data from the local disk, how did them configed? Can I use the same way for my ows?

2009/12/24 maven apache <apachemaven0@anonymised.com…>

2009/12/24 Andrea Aime <aaime@anonymised.com>

maven apache ha scritto:

Yes,I forgot mention that:
I have add a profile in the pom fo the webapp module:

addking org.geoserver king 2.0.0 --------------------- Then I run commond: mvn clean install -Dmaven.test.skip=true -P addking, and I am sure the king.2.0.0.jar is included in the web/app/target/geoserver/webinfo/lib.

That does not matter. Is the web-app project referring to the king
project in Eclipse?

No,in the buildpath page,the project king do not exist, I wonder if it is caused that" the dependency king is not defined directly ? it is defined by profile manner?

Try running:
mvn eclipse:eclipse -o -Paddking

Ok, just following your suggestion, first I delete the .class and .project file under the web/app module,then run the above commond,then run mvn install -P addking.

But problem also .
The logs can be found here:http://dpaste.com/137319/

and then refreshing from Eclipse

Cheers
Andrea


Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

Glad to hear you are making progress :).

Basically the rule of thumb is that configuration files are stored in the geoserver data directory. In some cases default configuration are stored in a module directly, but this is only to be used as a default if the file does not exist in the data directory.

That said, what you need to do is use the org.geoserver.config.GeoServerDataDirectory class via spring injection. So just declare another constructor argument in your class:

class YourServlet {

   org.geoserver.config.GeoServerDataDirectory dd;

   public YourServlet(..., org.geoserver.config.GeoServerDataDirectory dd) {
     ...
     this.dd = dd;
   }
}

Then in the applicationContext do this:

<bean id="myServlet" ...>
    ...
    <constructor-arg ref="dataDirectory"/>
</bean>

The "dataDirectory" bean is a singleton bean declared by the main module.

With the GeoServerDataDirectory class you have numerous lookup methods you can use to get at lookup files.

Hope that helps.

-Justin

maven apache wrote:

Hi:
This thread is posted for a long time. Thank Justin and other people, I have made some progress with their help. :).

However I meet another problem, the ows which I try to add to gs contains the following modules ,a web module(ows-web) and a jar module(ows-server), and there is a folder named conf under the ows-web/src/main/webapp/WEB-INF/conf.. Under this folder there are many config files which are to be used in the servlet under the ows-server module. And this servelt is just the one I wrapped as a org.springframework.web.servlet.mvc.ServletWrappingController.

I do not think it's a good idea to add the config files to the web module of gs directly, because 1 ) I do not want to break the gs architecture.
2 ) the wcs wms also read data from the local disk, how did them configed? Can I use the same way for my ows?
2009/12/24 maven apache <apachemaven0@anonymised.com <mailto:apachemaven0@anonymised.com>>

    2009/12/24 Andrea Aime <aaime@anonymised.com <mailto:aaime@anonymised.com>>

        maven apache ha scritto:

            Yes,I forgot mention that:
            I have add a profile in the pom fo the webapp module:
            ----------------------
            <profile>
            <id>addking</id>
            <dependencies>
            <dependency>
            <groupId>org.geoserver</groupId>
            <artifactId>king</artifactId>
            <version>2.0.0</version>
            </dependency>
            </dependencies>
            </profile>
            --------------------- Then I run commond: mvn clean install
            -Dmaven.test.skip=true -P addking, and I am sure the
            king.2.0.0.jar is included in the
            web/app/target/geoserver/webinfo/lib.

        That does not matter. Is the web-app project referring to the king
        project in Eclipse?

    No,in the buildpath page,the project king do not exist, I wonder if
    it is caused that" the dependency king is not defined directly ? it
    is defined by profile manner?

        Try running:
        mvn eclipse:eclipse -o -Paddking

    Ok, just following your suggestion, first I delete the .class and
    .project file under the web/app module,then run the above
    commond,then run mvn install -P addking.

    But problem also .
    The logs can be found here:http://dpaste.com/137319/

        and then refreshing from Eclipse

        Cheers
        Andrea

        -- Andrea Aime
        OpenGeo - http://opengeo.org
        Expert service straight from the developers.

------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

------------------------------------------------------------------------

_______________________________________________
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.

2009/12/27 Justin Deoliveira <jdeolive@anonymised.com>

Glad to hear you are making progress :).

Basically the rule of thumb is that configuration files are stored in the geoserver data directory. In some cases default configuration are stored in a module directly, but this is only to be used as a default if the file does not exist in the data directory.

That said, what you need to do is use the org.geoserver.config.GeoServerDataDirectory class via spring injection. So just declare another constructor argument in your class:

class YourServlet {

org.geoserver.config.GeoServerDataDirectory dd;

public YourServlet(…, org.geoserver.config.GeoServerDataDirectory dd) {

this.dd = dd;
}
}

Then in the applicationContext do this:

<bean id=“myServlet” …>


Thanks, I check the geoserver svn, and I found that in the version of 2.0.0 there is not a dataDirectory defined in the applicaionContext.xml. You can check it here: http://svn.codehaus.org/geoserver/tags/2.0.0/src/main/src/main/java/applicationContext.xml

And in the version of 2.0.x,it exist. So I wonder which is the related class of GeoserverDataDirectory in 2.0.0?
If there is not one ,I think I have to change to version of 2.0,x then.

The “dataDirectory” bean is a singleton bean declared by the main module.

With the GeoServerDataDirectory class you have numerous lookup methods you can use to get at lookup files.

Hope that helps.

-Justin

maven apache wrote:

Hi:
This thread is posted for a long time. Thank Justin and other people, I have made some progress with their help. :).

However I meet another problem, the ows which I try to add to gs contains the following modules ,a web module(ows-web) and a jar module(ows-server), and there is a folder named conf under the ows-web/src/main/webapp/WEB-INF/conf… Under this folder there are many config files which are to be used in the servlet under the ows-server module. And this servelt is just the one I wrapped as a org.springframework.web.servlet.mvc.ServletWrappingController.

I do not think it’s a good idea to add the config files to the web module of gs directly, because 1 ) I do not want to break the gs architecture.
2 ) the wcs wms also read data from the local disk, how did them configed? Can I use the same way for my ows?

2009/12/24 maven apache <apachemaven0@anonymised.com mailto:[apachemaven0@anonymised.com](mailto:apachemaven0@anonymised.com)>

2009/12/24 Andrea Aime <aaime@anonymised.com mailto:[aaime@anonymised.com](mailto:aaime@anonymised.com01...)>

maven apache ha scritto:

Yes,I forgot mention that:
I have add a profile in the pom fo the webapp module:

addking org.geoserver king 2.0.0 --------------------- Then I run commond: mvn clean install -Dmaven.test.skip=true -P addking, and I am sure the king.2.0.0.jar is included in the web/app/target/geoserver/webinfo/lib.

That does not matter. Is the web-app project referring to the king
project in Eclipse?

No,in the buildpath page,the project king do not exist, I wonder if
it is caused that" the dependency king is not defined directly ? it
is defined by profile manner?
Try running:
mvn eclipse:eclipse -o -Paddking

Ok, just following your suggestion, first I delete the .class and
.project file under the web/app module,then run the above
commond,then run mvn install -P addking.

But problem also .
The logs can be found here:http://dpaste.com/137319/
and then refreshing from Eclipse

Cheers
Andrea

– Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.



This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev



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.

<snip>

Thanks, I check the geoserver svn, and I found that in the version of 2.0.0 there is not a dataDirectory defined in the applicaionContext.xml. You can check it here: http://svn.codehaus.org/geoserver/tags/2.0.0/src/main/src/main/java/applicationContext.xml

And in the version of 2.0.x,it exist. So I wonder which is the related class of GeoserverDataDirectory in 2.0.0?
If there is not one ,I think I have to change to version of 2.0,x then.

My apologies, yes this was added after 2.0.0 went out. So you can either (a) move to 2.0.x or (b) do the following:

<bean id="myServlet" ...>
   ...
   <constructor-arg ref="resourceLoader"/>
</bean>

class YourServlet {

  org.geoserver.config.GeoServerDataDirectory dd;

  public YourServlet(..., org.geoserver.platform.GeoServerResourceLoader rl) {
    ...
    this.dd = new org.geoserver.config.GeoServerDataDirectory(rl);
  }

}

    The "dataDirectory" bean is a singleton bean declared by the main
    module.

    With the GeoServerDataDirectory class you have numerous lookup
    methods you can use to get at lookup files.

    Hope that helps.

    -Justin

    maven apache wrote:

        Hi:
        This thread is posted for a long time. Thank Justin and other
        people, I have made some progress with their help. :).

        However I meet another problem, the ows which I try to add to gs
        contains the following modules ,a web module(ows-web) and a jar
        module(ows-server), and there is a folder named conf under the
        ows-web/src/main/webapp/WEB-INF/conf.. Under this folder there
        are many config files which are to be used in the servlet under
        the ows-server module. And this servelt is just the one I
        wrapped as a
        org.springframework.web.servlet.mvc.ServletWrappingController.

        I do not think it's a good idea to add the config files to the
        web module of gs directly, because 1 ) I do not want to break
        the gs architecture.
        2 ) the wcs wms also read data from the local disk, how did them
        configed? Can I use the same way for my ows?
        2009/12/24 maven apache <apachemaven0@anonymised.com
        <mailto:apachemaven0@anonymised.com> <mailto:apachemaven0@anonymised.com
        <mailto:apachemaven0@anonymised.com>>>

           2009/12/24 Andrea Aime <aaime@anonymised.com
        <mailto:aaime@anonymised.com> <mailto:aaime@anonymised.com
        <mailto:aaime@anonymised.com>>>

               maven apache ha scritto:

                   Yes,I forgot mention that:
                   I have add a profile in the pom fo the webapp module:
                   ----------------------
                   <profile>
                   <id>addking</id>
                   <dependencies>
                   <dependency>
                   <groupId>org.geoserver</groupId>
                   <artifactId>king</artifactId>
                   <version>2.0.0</version>
                   </dependency>
                   </dependencies>
                   </profile>
                   --------------------- Then I run commond: mvn clean
        install
                   -Dmaven.test.skip=true -P addking, and I am sure the
                   king.2.0.0.jar is included in the
                   web/app/target/geoserver/webinfo/lib.

               That does not matter. Is the web-app project referring to
        the king
               project in Eclipse?

           No,in the buildpath page,the project king do not exist, I
        wonder if
           it is caused that" the dependency king is not defined
        directly ? it
           is defined by profile manner?
               Try running:
               mvn eclipse:eclipse -o -Paddking

           Ok, just following your suggestion, first I delete the .class and
           .project file under the web/app module,then run the above
           commond,then run mvn install -P addking.

           But problem also .
           The logs can be found here:http://dpaste.com/137319/
               and then refreshing from Eclipse

               Cheers
               Andrea

               -- Andrea Aime
               OpenGeo - http://opengeo.org
               Expert service straight from the developers.

        ------------------------------------------------------------------------

        ------------------------------------------------------------------------------
        This SF.Net email is sponsored by the Verizon Developer Community
        Take advantage of Verizon's best-in-class app development support
        A streamlined, 14 day to market process makes app distribution
        fast and easy
        Join now and get one step closer to millions of Verizon customers
        http://p.sf.net/sfu/verizon-dev2dev

        ------------------------------------------------------------------------

        _______________________________________________
        Geoserver-devel mailing list
        Geoserver-devel@lists.sourceforge.net
        <mailto: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.

------------------------------------------------------------------------

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

------------------------------------------------------------------------

_______________________________________________
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.

2009/12/30 Justin Deoliveira <jdeolive@anonymised.com>

Thanks, I check the geoserver svn, and I found that in the version of 2.0.0 there is not a dataDirectory defined in the applicaionContext.xml. You can check it here: http://svn.codehaus.org/geoserver/tags/2.0.0/src/main/src/main/java/applicationContext.xml
And in the version of 2.0.x,it exist. So I wonder which is the related class of GeoserverDataDirectory in 2.0.0?
If there is not one ,I think I have to change to version of 2.0,x then.

My apologies, yes this was added after 2.0.0 went out. So you can either (a) move to 2.0.x or (b) do the following:

Thanks, I have move to 2.0.x and it works ! :slight_smile:
And now I am trying to add some pages like the web-wcs web-wfs pages for my ows.
I am digging in the architecture of the pages, a little complex :(/

<bean id=“myServlet” …>


class YourServlet {

org.geoserver.config.GeoServerDataDirectory dd;

public YourServlet(…, org.geoserver.platform.GeoServerResourceLoader rl) {

this.dd = new org.geoserver.config.GeoServerDataDirectory(rl);
}

}

The “dataDirectory” bean is a singleton bean declared by the main
module.

With the GeoServerDataDirectory class you have numerous lookup
methods you can use to get at lookup files.

Hope that helps.

-Justin

maven apache wrote:

Hi:
This thread is posted for a long time. Thank Justin and other
people, I have made some progress with their help. :).

However I meet another problem, the ows which I try to add to gs
contains the following modules ,a web module(ows-web) and a jar
module(ows-server), and there is a folder named conf under the
ows-web/src/main/webapp/WEB-INF/conf… Under this folder there
are many config files which are to be used in the servlet under
the ows-server module. And this servelt is just the one I
wrapped as a
org.springframework.web.servlet.mvc.ServletWrappingController.

I do not think it’s a good idea to add the config files to the
web module of gs directly, because 1 ) I do not want to break
the gs architecture.
2 ) the wcs wms also read data from the local disk, how did them
configed? Can I use the same way for my ows?
2009/12/24 maven apache <apachemaven0@anonymised.com

mailto:[apachemaven0@anonymised.com](mailto:apachemaven0@anonymised.com) <mailto:apachemaven0@anonymised.com

mailto:[apachemaven0@anonymised.com](mailto:apachemaven0@anonymised.com)>>

2009/12/24 Andrea Aime <aaime@anonymised.com

mailto:[aaime@anonymised.com](mailto:aaime@anonymised.com) <mailto:aaime@anonymised.com

mailto:[aaime@anonymised.com](mailto:aaime@anonymised.com)>>

maven apache ha scritto:

Yes,I forgot mention that:
I have add a profile in the pom fo the webapp module:

addking org.geoserver king 2.0.0 --------------------- Then I run commond: mvn clean install -Dmaven.test.skip=true -P addking, and I am sure the king.2.0.0.jar is included in the web/app/target/geoserver/webinfo/lib.

That does not matter. Is the web-app project referring to
the king
project in Eclipse?

No,in the buildpath page,the project king do not exist, I
wonder if
it is caused that" the dependency king is not defined
directly ? it
is defined by profile manner?
Try running:
mvn eclipse:eclipse -o -Paddking

Ok, just following your suggestion, first I delete the .class and
.project file under the web/app module,then run the above
commond,then run mvn install -P addking.

But problem also .
The logs can be found here:http://dpaste.com/137319/
and then refreshing from Eclipse

Cheers
Andrea

– Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.



This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution
fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev



Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net

mailto:[Geoserver-devel@lists.sourceforge.net](mailto:Geoserver-devel@anonymised.comrge.net)

https://lists.sourceforge.net/lists/listinfo/geoserver-devel

– Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.



This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon’s best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev



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.

Hi:
I have integrate my sos to the geoserver ,and now I want to add some back pages like the wcs wms, is there anything I should pay attention to?