[Geoserver-users] Creating a plugin in Eclipse

Hi,
I created a plugin for GeoServer a while ago using the basic tutorial in the
documentation. I was wondering how to create a plugin using the GeoServer
source in Eclipse that can just be compiled as needed when I run from
source.
Cheers,
Jon

--
View this message in context: http://www.nabble.com/Creating-a-plugin-in-Eclipse-tp15714663p15714663.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hi Jon,

You have a couple of options.

1) Modify the pom.xml in teh web module and have it depend on your plugin module. Then re-run eclipse:eclipse.

2) In Eclipse, manually alter the build path of the web project and add a dependency on your plugin module. This will get wiped out however the next time you run eclipse:eclipse.

Hope that helps.

-Justin

Jon Britton wrote:

Hi,
I created a plugin for GeoServer a while ago using the basic tutorial in the
documentation. I was wondering how to create a plugin using the GeoServer
source in Eclipse that can just be compiled as needed when I run from
source.
Cheers,
Jon

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Ok, thanks. I think I've sorted it out now.

I do have another problem however. My plugin worked fine before under 1.5.0,
but now GeoServer won't find it when I call it. I made my service contructor
(extending AbstractService) output to the command line and this seems to
work out, but the Dispatcher doesn't find it! I assume this has something to
do with my applicationContext but I can't find what it is.

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd&quot;&gt;

<beans>

  <!-- the cds service. -->
  <bean id="cds"
    class="uk.ac.glam.geoserver.global.CDS">
    <constructor-arg ref="data"/>
  </bean>
      
  <!-- this registers the above beans with the servlet context
   it is around to keep the struts app happy as we move away from
   servlets -->
  <bean id="cdsRegisterar"
    class="org.vfny.geoserver.global.GeoServerServletContextInitializer">
    
    <constructor-arg type="java.lang.String" value="CDS"/>
    <constructor-arg ref="cds"/>
  </bean>
   
  <bean id="cdsAbstractService" abstract="true"
    class="org.vfny.geoserver.servlets.AbstractService">
    <!-- reference to geoserver bean defined in the 'main' context -->
    <property name="geoServer" ref="geoServer"/>
    <property name="catalog" ref="data"/>
  </bean>
    
  <bean id="cdsGetChanges"
    class="uk.ac.glam.geoserver.cds.servlets.Changes"
    parent="cdsAbstractService">
    <constructor-arg ref="cds"/>
  </bean>
  
</beans>

jdeolive-2 wrote:

Hi Jon,

You have a couple of options.

1) Modify the pom.xml in teh web module and have it depend on your
plugin module. Then re-run eclipse:eclipse.

2) In Eclipse, manually alter the build path of the web project and add
a dependency on your plugin module. This will get wiped out however the
next time you run eclipse:eclipse.

Hope that helps.

-Justin

Jon Britton wrote:

Hi,
I created a plugin for GeoServer a while ago using the basic tutorial in
the
documentation. I was wondering how to create a plugin using the GeoServer
source in Eclipse that can just be compiled as needed when I run from
source.
Cheers,
Jon

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Creating-a-plugin-in-Eclipse-tp15714663p15716521.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Hmm.. I was just looking at the code for the WCS class and noticed that it
calls setId("wcs") in it's constructors. Is this something I need to do for
my plugin? I didn't have to before.

Cheers,
Jon

Jon Britton wrote:

Ok, thanks. I think I've sorted it out now.

I do have another problem however. My plugin worked fine before under
1.5.0, but now GeoServer won't find it when I call it. I made my service
constructor (extending AbstractService) output to the command line and
this seems to work out, but the Dispatcher doesn't find it! I assume this
has something to do with my applicationContext but I can't find what it
is.

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd&quot;&gt;

<beans>

  <!-- the cds service. -->
  <bean id="cds"
    class="uk.ac.glam.geoserver.global.CDS">
    <constructor-arg ref="data"/>
  </bean>
      
  <!-- this registers the above beans with the servlet context
   it is around to keep the struts app happy as we move away from
   servlets -->
  <bean id="cdsRegisterar"
    class="org.vfny.geoserver.global.GeoServerServletContextInitializer">
    
    <constructor-arg type="java.lang.String" value="CDS"/>
    <constructor-arg ref="cds"/>
  </bean>
   
  <bean id="cdsAbstractService" abstract="true"
    class="org.vfny.geoserver.servlets.AbstractService">
    <!-- reference to geoserver bean defined in the 'main' context -->
    <property name="geoServer" ref="geoServer"/>
    <property name="catalog" ref="data"/>
  </bean>
    
  <bean id="cdsGetChanges"
    class="uk.ac.glam.geoserver.cds.servlets.Changes"
    parent="cdsAbstractService">
    <constructor-arg ref="cds"/>
  </bean>
  
</beans>

jdeolive-2 wrote:

Hi Jon,

You have a couple of options.

1) Modify the pom.xml in teh web module and have it depend on your
plugin module. Then re-run eclipse:eclipse.

2) In Eclipse, manually alter the build path of the web project and add
a dependency on your plugin module. This will get wiped out however the
next time you run eclipse:eclipse.

Hope that helps.

-Justin

Jon Britton wrote:

Hi,
I created a plugin for GeoServer a while ago using the basic tutorial in
the
documentation. I was wondering how to create a plugin using the
GeoServer
source in Eclipse that can just be compiled as needed when I run from
source.
Cheers,
Jon

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Creating-a-plugin-in-Eclipse-tp15714663p15734921.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I don't believe it is necessary. There is no code that relies on this being set.

It sounds like you are writing a plug-in for a new service? Do tell.

-Justin

Jon Britton wrote:

Hmm.. I was just looking at the code for the WCS class and noticed that it
calls setId("wcs") in it's constructors. Is this something I need to do for
my plugin? I didn't have to before.

Cheers,
Jon

Jon Britton wrote:

Ok, thanks. I think I've sorted it out now.

I do have another problem however. My plugin worked fine before under
1.5.0, but now GeoServer won't find it when I call it. I made my service
constructor (extending AbstractService) output to the command line and
this seems to work out, but the Dispatcher doesn't find it! I assume this
has something to do with my applicationContext but I can't find what it
is.

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd&quot;&gt;

<beans>

  <!-- the cds service. -->
  <bean id="cds"
    class="uk.ac.glam.geoserver.global.CDS">
    <constructor-arg ref="data"/>
  </bean>
      
  <!-- this registers the above beans with the servlet context
   it is around to keep the struts app happy as we move away from servlets -->
  <bean id="cdsRegisterar"
    class="org.vfny.geoserver.global.GeoServerServletContextInitializer">
    
    <constructor-arg type="java.lang.String" value="CDS"/>
    <constructor-arg ref="cds"/>
  </bean>
     <bean id="cdsAbstractService" abstract="true"
    class="org.vfny.geoserver.servlets.AbstractService">
    <!-- reference to geoserver bean defined in the 'main' context -->
    <property name="geoServer" ref="geoServer"/>
    <property name="catalog" ref="data"/>
  </bean>
    
  <bean id="cdsGetChanges" class="uk.ac.glam.geoserver.cds.servlets.Changes"
    parent="cdsAbstractService">
    <constructor-arg ref="cds"/>
  </bean>
  
</beans>

jdeolive-2 wrote:

Hi Jon,

You have a couple of options.

1) Modify the pom.xml in teh web module and have it depend on your plugin module. Then re-run eclipse:eclipse.

2) In Eclipse, manually alter the build path of the web project and add a dependency on your plugin module. This will get wiped out however the next time you run eclipse:eclipse.

Hope that helps.

-Justin

Jon Britton wrote:

Hi,
I created a plugin for GeoServer a while ago using the basic tutorial in
the
documentation. I was wondering how to create a plugin using the
GeoServer
source in Eclipse that can just be compiled as needed when I run from
source.
Cheers,
Jon

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Yeh, this is something I did during my MSc dissertation but didn't really
manage to get very far. I had a working service that subtracted two images
using a specified spectral band and then used a specified tolerance value to
classify between negative change or no change/positive change. It was to be
used for detecting changes in forestry. It only created a non-georeferenced
image since that's all I could get to work at the time, but the idea was to
vectorise the result into a shapefile or GML or something then send it back.

I can't remember now how to get this working with GeoServer. I seem to
remember that I changed web.xml to make it work but I can't get it working
now. Like I said, the constructors get called when GeoServer loads up but it
doesn't recognise it when I call it!

Cheers,
Jon

jdeolive-2 wrote:

I don't believe it is necessary. There is no code that relies on this
being set.

It sounds like you are writing a plug-in for a new service? Do tell.

-Justin

Jon Britton wrote:

Hmm.. I was just looking at the code for the WCS class and noticed that
it
calls setId("wcs") in it's constructors. Is this something I need to do
for
my plugin? I didn't have to before.

Cheers,
Jon

Jon Britton wrote:

Ok, thanks. I think I've sorted it out now.

I do have another problem however. My plugin worked fine before under
1.5.0, but now GeoServer won't find it when I call it. I made my service
constructor (extending AbstractService) output to the command line and
this seems to work out, but the Dispatcher doesn't find it! I assume
this
has something to do with my applicationContext but I can't find what it
is.

Here it is:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd&quot;&gt;

<beans>

  <!-- the cds service. -->
  <bean id="cds"
    class="uk.ac.glam.geoserver.global.CDS">
    <constructor-arg ref="data"/>
  </bean>
      
  <!-- this registers the above beans with the servlet context
   it is around to keep the struts app happy as we move away from
   servlets -->
  <bean id="cdsRegisterar"
    class="org.vfny.geoserver.global.GeoServerServletContextInitializer">
    
    <constructor-arg type="java.lang.String" value="CDS"/>
    <constructor-arg ref="cds"/>
  </bean>
   
  <bean id="cdsAbstractService" abstract="true"
    class="org.vfny.geoserver.servlets.AbstractService">
    <!-- reference to geoserver bean defined in the 'main' context -->
    <property name="geoServer" ref="geoServer"/>
    <property name="catalog" ref="data"/>
  </bean>
    
  <bean id="cdsGetChanges"
    class="uk.ac.glam.geoserver.cds.servlets.Changes"
    parent="cdsAbstractService">
    <constructor-arg ref="cds"/>
  </bean>
  
</beans>

jdeolive-2 wrote:

Hi Jon,

You have a couple of options.

1) Modify the pom.xml in teh web module and have it depend on your
plugin module. Then re-run eclipse:eclipse.

2) In Eclipse, manually alter the build path of the web project and add
a dependency on your plugin module. This will get wiped out however the
next time you run eclipse:eclipse.

Hope that helps.

-Justin

Jon Britton wrote:

Hi,
I created a plugin for GeoServer a while ago using the basic tutorial
in
the
documentation. I was wondering how to create a plugin using the
GeoServer
source in Eclipse that can just be compiled as needed when I run from
source.
Cheers,
Jon

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/Creating-a-plugin-in-Eclipse-tp15714663p15758288.html
Sent from the GeoServer - User mailing list archive at Nabble.com.