2009/12/23 Justin Deoliveira <[email protected]>
>
>
> maven apache wrote:
>
>> Thanks for Justin's reply and sorry for my crossing posting, it won't
>> happen again. :) .
>>
>> No problem :)
>
> 2009/12/22 Justin Deoliveira <[email protected] <mailto:
>> [email protected]>>
>>
>>
>> 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.
>
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/
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.
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.
:)
>
> 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
>> [email protected]
>> <mailto:[email protected]>
>>
>> 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
>> [email protected]
>> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-devel