Skip to content

Commit

Permalink
Updating Script REST API from Restlet to Spring MVC enabling this mod…
Browse files Browse the repository at this point in the history
…ule to work with GeoServer's REST API.
  • Loading branch information
vickdw committed Oct 19, 2017
1 parent acef75b commit bd70e28
Show file tree
Hide file tree
Showing 50 changed files with 1,369 additions and 1,325 deletions.
2 changes: 1 addition & 1 deletion src/community/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
<module>spatialite</module> <module>spatialite</module>
<module>jdbcconfig</module> <module>jdbcconfig</module>
<module>feature-aggregate</module> <module>feature-aggregate</module>
<!-- <module>script</module> --> <module>script</module>
<module>wms-eo</module> <module>wms-eo</module>
<module>colormap</module> <module>colormap</module>
<module>mbtiles</module> <module>mbtiles</module>
Expand Down
4 changes: 2 additions & 2 deletions src/community/release/pom.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<artifactId>gs-wps-download</artifactId> <artifactId>gs-wps-download</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> </dependency>
<!-- <dependency> <dependency>
<groupId>org.geoserver.script</groupId> <groupId>org.geoserver.script</groupId>
<artifactId>gs-script-py</artifactId> <artifactId>gs-script-py</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
Expand All @@ -47,7 +47,7 @@
<groupId>org.geoserver.script</groupId> <groupId>org.geoserver.script</groupId>
<artifactId>gs-script-groovy</artifactId> <artifactId>gs-script-groovy</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
</dependency> --> </dependency>
<dependency> <dependency>
<groupId>org.geoserver.community</groupId> <groupId>org.geoserver.community</groupId>
<artifactId>gs-jdbcconfig</artifactId> <artifactId>gs-jdbcconfig</artifactId>
Expand Down
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,6 @@
import org.restlet.data.*; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
run(request,response) { run(request,response) {
response.setEntity("Hello World!", MediaType.TEXT_PLAIN); response.setContentType("text/plain");
response.getWriter().write("Hello World!");
} }
109 changes: 0 additions & 109 deletions src/community/script/core/src/main/java/applicationContext.xml

This file was deleted.

Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@


import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheBuilder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/** /**
* Facade for the scripting subsystem, providing methods for obtaining script context and managing * Facade for the scripting subsystem, providing methods for obtaining script context and managing
Expand All @@ -44,6 +46,7 @@
* @author Justin Deoliveira, OpenGeo * @author Justin Deoliveira, OpenGeo
* *
*/ */
@Component
public class ScriptManager implements InitializingBean { public class ScriptManager implements InitializingBean {


static Logger LOGGER = Logging.getLogger(ScriptManager.class); static Logger LOGGER = Logging.getLogger(ScriptManager.class);
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*/ */
package org.geoserver.script; package org.geoserver.script;


import java.io.Serializable;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;

import org.geoserver.script.app.AppHook; import org.geoserver.script.app.AppHook;
import org.geoserver.script.function.FunctionHook; import org.geoserver.script.function.FunctionHook;
import org.geoserver.script.wfs.WfsTxHook; import org.geoserver.script.wfs.WfsTxHook;
import org.geoserver.script.wps.WpsHook; import org.geoserver.script.wps.WpsHook;
import org.springframework.stereotype.Component;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineFactory;
import java.io.Serializable;


/** /**
* Base class for script plugins. * Base class for script plugins.
Expand All @@ -23,6 +23,7 @@
* @author Justin Deoliveira, OpenGeo * @author Justin Deoliveira, OpenGeo
* *
*/ */
@Component
public abstract class ScriptPlugin implements Serializable { public abstract class ScriptPlugin implements Serializable {


String extension; String extension;
Expand Down

This file was deleted.

Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,16 +5,14 @@
*/ */
package org.geoserver.script.app; package org.geoserver.script.app;


import java.io.IOException; import org.geoserver.script.ScriptHook;
import org.geoserver.script.ScriptPlugin;


import javax.script.Invocable;
import javax.script.ScriptEngine; import javax.script.ScriptEngine;
import javax.script.ScriptException; import javax.script.ScriptException;

import javax.servlet.http.HttpServletRequest;
import org.geoserver.script.ScriptHook; import javax.servlet.http.HttpServletResponse;
import org.geoserver.script.ScriptPlugin; import java.io.IOException;
import org.restlet.data.Request;
import org.restlet.data.Response;


/** /**
* Hook for "app" requests. * Hook for "app" requests.
Expand Down Expand Up @@ -42,7 +40,7 @@ public AppHook(ScriptPlugin plugin) {
* @param engine The script engine of the appropriate type. * @param engine The script engine of the appropriate type.
* *
*/ */
public void run(Request request, Response response, ScriptEngine engine) public void run(HttpServletRequest request, HttpServletResponse response, ScriptEngine engine)
throws ScriptException, IOException { throws ScriptException, IOException {
invoke(engine, "run", request, response); invoke(engine, "run", request, response);
} }
Expand Down

This file was deleted.

0 comments on commit bd70e28

Please sign in to comment.