Author: aparfonov
Date: 2010-06-17 04:39:29 -0400 (Thu, 17 Jun 2010)
New Revision: 2647
Added:
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/BaseTest.java
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyContextParamTest.java
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyExoComponentTest.java
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovySimpleTest.java
ws/trunk/exo.ws.rest.ext/src/test/resources/conf/
ws/trunk/exo.ws.rest.ext/src/test/resources/conf/standalone/
ws/trunk/exo.ws.rest.ext/src/test/resources/groovy1.groovy
ws/trunk/exo.ws.rest.ext/src/test/resources/groovy2.groovy
Removed:
ws/trunk/exo.ws.rest.ext/src/test/resources/standalone/
Modified:
ws/trunk/exo.ws.rest.ext/pom.xml
ws/trunk/exo.ws.rest.ext/src/test/resources/conf/standalone/test-configuration.xml
ws/trunk/pom.xml
Log:
EXOJCR-793 : support for groovy based services
Modified: ws/trunk/exo.ws.rest.ext/pom.xml
===================================================================
--- ws/trunk/exo.ws.rest.ext/pom.xml 2010-06-17 08:34:18 UTC (rev 2646)
+++ ws/trunk/exo.ws.rest.ext/pom.xml 2010-06-17 08:39:29 UTC (rev 2647)
@@ -46,6 +46,10 @@
<artifactId>exo.core.component.xml-processing</artifactId>
</dependency>
<dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.script.groovy</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.ws</groupId>
<artifactId>exo.ws.commons</artifactId>
</dependency>
@@ -54,6 +58,11 @@
<artifactId>exo.ws.rest.core</artifactId>
</dependency>
<dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.testframework</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
</dependency>
@@ -81,6 +90,10 @@
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
</dependency>
</dependencies>
</project>
Added:
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
===================================================================
---
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
(rev 0)
+++
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java 2010-06-17
08:39:29 UTC (rev 2647)
@@ -0,0 +1,217 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.rest.ext.groovy;
+
+import groovy.lang.GroovyClassLoader;
+import groovy.lang.GroovyCodeSource;
+
+import org.exoplatform.services.rest.PerRequestObjectFactory;
+import org.exoplatform.services.rest.impl.ResourceBinder;
+import org.exoplatform.services.script.groovy.GroovyScriptInstantiator;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.nio.charset.Charset;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
+ * @version $Id$
+ */
+public class GroovyJaxrsPublisher
+{
+
+ /** Default character set name. */
+ static final String DEFAULT_CHARSET_NAME = "UTF-8";
+
+ /** Default character set. */
+ static final Charset DEFAULT_CHARSET = Charset.forName(DEFAULT_CHARSET_NAME);
+
+ protected final ResourceBinder binder;
+
+ protected final GroovyScriptInstantiator instantiator;
+
+ protected GroovyClassLoader gcl;
+
+ /**
+ * Create GroovyJaxrsPublisher which is able publish per-request and
+ * singleton resources. Any required dependencies for per-request resource
+ * injected by {@link PerRequestObjectFactory}, instance of singleton
+ * resources will be created by {@link GroovyScriptInstantiator}.
+ *
+ * @param binder resource binder
+ * @param instantiator instantiate java object from given groovy source
+ */
+ public GroovyJaxrsPublisher(ResourceBinder binder, GroovyScriptInstantiator
instantiator)
+ {
+ this.binder = binder;
+ this.instantiator = instantiator;
+ ClassLoader cl = getClass().getClassLoader();
+ this.gcl = new GroovyClassLoader(cl);
+ }
+
+ /**
+ * Create GroovyJaxrsPublisher which is able public per-request resources
+ * only. This is default behavior for RESTful services. Any required
+ * dependencies for resource injected by {@link PerRequestObjectFactory} in
+ * runtime.
+ *
+ * @param binder resource binder
+ */
+ public GroovyJaxrsPublisher(ResourceBinder binder)
+ {
+ ClassLoader cl = getClass().getClassLoader();
+ this.gcl = new GroovyClassLoader(cl);
+ this.binder = binder;
+ this.instantiator = null;
+ }
+
+ /**
+ * Parse given stream and publish result as per-request RESTful service.
+ *
+ * @param in stream which contains groovy source code of RESTful service
+ * @param name name of resource
+ * @return <code>true</code> if resource was published and
<code>false</code>
+ * otherwise
+ */
+ public boolean publishPerRequest(InputStream in, String name)
+ {
+ return publishPerRequest(createCodeSource(in, name));
+ }
+
+ /**
+ * Parse given <code>source</code> and publish result as per-request
RESTful
+ * service.
+ *
+ * @param source groovy source code of RESTful service
+ * @param name name of resource
+ * @return <code>true</code> if resource was published and
<code>false</code>
+ * otherwise
+ */
+ public boolean publishPerRequest(String source, String name)
+ {
+ byte[] bytes = source.getBytes(DEFAULT_CHARSET);
+ return publishPerRequest(new ByteArrayInputStream(bytes), name);
+ }
+
+ /**
+ * Parse given {@link GroovyCodeSource} and publish result as per-request
+ * RESTful service.
+ *
+ * @param gcs groovy code source which contains source code of RESTful
+ * service
+ * @return <code>true</code> if resource was published and
<code>false</code>
+ * otherwise
+ */
+ public boolean publishPerRequest(GroovyCodeSource gcs)
+ {
+ Class<?> rc = gcl.parseClass(gcs);
+ return binder.bind(rc);
+ }
+
+ /**
+ * Parse given stream and publish result as singleton RESTful service.
+ *
+ * @param in stream which contains groovy source code of RESTful service
+ * @param name name of resource
+ * @return <code>true</code> if resource was published and
<code>false</code>
+ * otherwise
+ * @throws UnsupportedOperationException if publisher was created without
+ * support of singleton resource, see
+ * {@link #GroovyJaxrsPublisher(ResourceBinder)}
+ */
+ public boolean publishSingleton(InputStream in, String name)
+ {
+ if (instantiator == null)
+ throw new UnsupportedOperationException(
+ "Can't instantiate groovy script. GroovyScriptInstantiator is not
set.");
+ return publishSingleton(createCodeSource(in, name));
+ }
+
+ /**
+ * Parse given <code>source</code> and publish result as singleton
RESTful
+ * service.
+ *
+ * @param source groovy source code of RESTful service
+ * @param name name of resource
+ * @return <code>true</code> if resource was published and
<code>false</code>
+ * otherwise
+ * @throws UnsupportedOperationException if publisher was created without
+ * support of singleton resource, see
+ * {@link #GroovyJaxrsPublisher(ResourceBinder)}
+ */
+ public boolean publishSingleton(String source, String name)
+ {
+ if (instantiator == null)
+ throw new UnsupportedOperationException(
+ "Can't instantiate groovy script. GroovyScriptInstantiator is not
set.");
+ byte[] bytes = source.getBytes(DEFAULT_CHARSET);
+ return publishSingleton(new ByteArrayInputStream(bytes), name);
+ }
+
+ /**
+ * Parse given {@link GroovyCodeSource} and publish result as singleton
+ * RESTful service.
+ *
+ * @param gcs groovy code source which contains source code of RESTful
+ * service
+ * @return <code>true</code> if resource was published and
<code>false</code>
+ * otherwise
+ * @throws UnsupportedOperationException if publisher was created without
+ * support of singleton resource, see
+ * {@link #GroovyJaxrsPublisher(ResourceBinder)}
+ */
+ public boolean publishSingleton(GroovyCodeSource gcs)
+ {
+ if (instantiator == null)
+ throw new UnsupportedOperationException(
+ "Can't instantiate groovy script. GroovyScriptInstantiator is not
set.");
+ Object r = instantiator.instantiateScript(gcs, gcl);
+ return binder.bind(r);
+ }
+
+ /**
+ * Set groovy class loader.
+ *
+ * @param gcl groovy class loader
+ * @throws NullPointerException if <code>gcl == null</code>
+ */
+ public void setGroovyClassLoader(GroovyClassLoader gcl)
+ {
+ if (gcl == null)
+ throw new NullPointerException("GroovyClassLoader may not be null.");
+ this.gcl = gcl;
+ }
+
+ /**
+ * Create {@link GroovyCodeSource} from given stream and name. Code base
+ * 'file:/groovy/script/jaxrs' will be used.
+ *
+ * @param in groovy source code stream
+ * @param name code source name
+ * @return GroovyCodeSource
+ */
+ protected GroovyCodeSource createCodeSource(InputStream in, String name)
+ {
+ GroovyCodeSource gcs =
+ new GroovyCodeSource(in, name == null ? gcl.generateScriptName() : name,
"/groovy/script/jaxrs");
+ gcs.setCachable(false);
+ return gcs;
+ }
+}
Property changes on:
ws/trunk/exo.ws.rest.ext/src/main/java/org/exoplatform/services/rest/ext/groovy/GroovyJaxrsPublisher.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/BaseTest.java
===================================================================
---
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/BaseTest.java
(rev 0)
+++
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/BaseTest.java 2010-06-17
08:39:29 UTC (rev 2647)
@@ -0,0 +1,111 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.rest.ext;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.rest.ContainerResponseWriter;
+import org.exoplatform.services.rest.ext.groovy.GroovyJaxrsPublisher;
+import org.exoplatform.services.rest.impl.ApplicationContextImpl;
+import org.exoplatform.services.rest.impl.ContainerRequest;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.impl.EnvironmentContext;
+import org.exoplatform.services.rest.impl.InputHeadersMap;
+import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
+import org.exoplatform.services.rest.impl.ProviderBinder;
+import org.exoplatform.services.rest.impl.RequestHandlerImpl;
+import org.exoplatform.services.rest.impl.ResourceBinder;
+import org.exoplatform.services.rest.tools.DummyContainerResponseWriter;
+import org.exoplatform.services.test.mock.MockHttpServletRequest;
+
+import java.io.ByteArrayInputStream;
+import java.net.URI;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.core.MultivaluedMap;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
+ * @version $Id$
+ */
+public abstract class BaseTest extends TestCase
+{
+ protected StandaloneContainer container;
+
+ protected ProviderBinder providers;
+
+ protected ResourceBinder binder;
+
+ protected RequestHandlerImpl requestHandler;
+
+ protected GroovyJaxrsPublisher groovyPublisher;
+
+ public void setUp() throws Exception
+ {
+
StandaloneContainer.setConfigurationPath("src/test/resources/conf/standalone/test-configuration.xml");
+ container = StandaloneContainer.getInstance();
+ binder =
(ResourceBinder)container.getComponentInstanceOfType(ResourceBinder.class);
+ requestHandler =
(RequestHandlerImpl)container.getComponentInstanceOfType(RequestHandlerImpl.class);
+ // reset providers to be sure it is clean
+ ProviderBinder.setInstance(new ProviderBinder());
+ providers = ProviderBinder.getInstance();
+ ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null,
providers));
+ binder.clear();
+ groovyPublisher =
(GroovyJaxrsPublisher)container.getComponentInstanceOfType(GroovyJaxrsPublisher.class);
+ }
+
+ public void tearDown() throws Exception
+ {
+ }
+
+ public ContainerResponse service(String method, String requestURI, String baseURI,
+ Map<String, List<String>> headers, byte[] data, ContainerResponseWriter
writer) throws Exception
+ {
+
+ if (headers == null)
+ headers = new MultivaluedMapImpl();
+
+ ByteArrayInputStream in = null;
+ if (data != null)
+ in = new ByteArrayInputStream(data);
+
+ EnvironmentContext envctx = new EnvironmentContext();
+ HttpServletRequest httpRequest =
+ new MockHttpServletRequest(requestURI, in, in != null ? in.available() : 0,
method, headers);
+ envctx.put(HttpServletRequest.class, httpRequest);
+ EnvironmentContext.setCurrent(envctx);
+ ContainerRequest request =
+ new ContainerRequest(method, new URI(requestURI), new URI(baseURI), in, new
InputHeadersMap(headers));
+ ContainerResponse response = new ContainerResponse(writer);
+ requestHandler.handleRequest(request, response);
+ return response;
+ }
+
+ public ContainerResponse service(String method, String requestURI, String baseURI,
+ MultivaluedMap<String, String> headers, byte[] data) throws Exception
+ {
+ return service(method, requestURI, baseURI, headers, data, new
DummyContainerResponseWriter());
+
+ }
+
+}
Property changes on:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/BaseTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyContextParamTest.java
===================================================================
---
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyContextParamTest.java
(rev 0)
+++
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyContextParamTest.java 2010-06-17
08:39:29 UTC (rev 2647)
@@ -0,0 +1,56 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.rest.ext.groovy;
+
+import org.exoplatform.services.rest.ext.BaseTest;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
+ * @version $Id$
+ */
+public class GroovyContextParamTest extends BaseTest
+{
+
+ private InputStream script;
+
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ script =
Thread.currentThread().getContextClassLoader().getResourceAsStream("groovy1.groovy");
+ assertNotNull(script);
+ }
+
+ public void testPerRequest() throws Exception
+ {
+ assertEquals(0, binder.getSize());
+ groovyPublisher.publishPerRequest(script, "g1");
+ assertEquals(1, binder.getSize());
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse resp =
+ service("GET", "http://localhost:8080/context/a/b",
"http://localhost:8080/context", null, null, writer);
+ assertEquals(200, resp.getStatus());
+ assertEquals("GET\n/context/a/b", new String(writer.getBody()));
+ }
+
+}
Property changes on:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyContextParamTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyExoComponentTest.java
===================================================================
---
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyExoComponentTest.java
(rev 0)
+++
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyExoComponentTest.java 2010-06-17
08:39:29 UTC (rev 2647)
@@ -0,0 +1,85 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.rest.ext.groovy;
+
+import org.exoplatform.services.rest.ext.BaseTest;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+import java.io.InputStream;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
+ * @version $Id$
+ */
+public class GroovyExoComponentTest extends BaseTest
+{
+
+ private InputStream script;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ super.setUp();
+ container.registerComponentInstance(Component1.class.getName(), new Component1());
+ script =
Thread.currentThread().getContextClassLoader().getResourceAsStream("groovy2.groovy");
+ assertNotNull(script);
+ }
+
+ @Override
+ public void tearDown() throws Exception
+ {
+ container.unregisterComponent(Component1.class.getName());
+ super.tearDown();
+ }
+
+ public void testExoComponentPerRequest() throws Exception
+ {
+ containerComponentTest(false, "g1");
+ }
+
+ public void testExoComponentSingleton() throws Exception
+ {
+ containerComponentTest(true, "g1");
+ }
+
+ private void containerComponentTest(boolean singleton, String name) throws Exception
+ {
+ assertEquals(0, binder.getSize());
+ if (singleton)
+ groovyPublisher.publishSingleton(script, name);
+ else
+ groovyPublisher.publishPerRequest(script, name);
+ assertEquals(1, binder.getSize());
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse resp = service("GET", "/a/b", "",
null, null, writer);
+ assertEquals(200, resp.getStatus());
+ assertEquals("exo container's component", new
String(writer.getBody()));
+ }
+
+ public static class Component1
+ {
+ public String getName()
+ {
+ return "exo container's component";
+ }
+ }
+
+}
Property changes on:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovyExoComponentTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovySimpleTest.java
===================================================================
---
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovySimpleTest.java
(rev 0)
+++
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovySimpleTest.java 2010-06-17
08:39:29 UTC (rev 2647)
@@ -0,0 +1,74 @@
+/**
+ * Copyright (C) 2010 eXo Platform SAS.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.exoplatform.services.rest.ext.groovy;
+
+import org.exoplatform.services.rest.ext.BaseTest;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
+
+import java.io.ByteArrayInputStream;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey
Parfonov</a>
+ * @version $Id$
+ */
+public class GroovySimpleTest extends BaseTest
+{
+
+ public void testPerRequest() throws Exception
+ {
+ publicationTest(false, "g1");
+ }
+
+ public void testSingleton() throws Exception
+ {
+ publicationTest(true, "g2");
+ }
+
+ private void publicationTest(boolean singleton, String name) throws Exception
+ {
+ String script = //
+ "(a)javax.ws.rs.Path(\"a\")" //
+ + "class GroovyResource {" //
+ + "(a)javax.ws.rs.GET @javax.ws.rs.Path(\"{who}\")" //
+ + "def m0((a)javax.ws.rs.PathParam(\"who\") String who) { return
(\"hello \" + who)}" //
+ + "}";
+
+ assertEquals(0, binder.getSize());
+
+ if (singleton)
+ groovyPublisher.publishSingleton(new ByteArrayInputStream(script.getBytes()),
name);
+ else
+ groovyPublisher.publishPerRequest(new ByteArrayInputStream(script.getBytes()),
name);
+
+ assertEquals(1, binder.getSize());
+
+ String cs =
+
binder.getResources().get(0).getObjectModel().getObjectClass().getProtectionDomain().getCodeSource()
+ .getLocation().toString();
+ assertEquals("file:/groovy/script/jaxrs", cs);
+
+ ByteArrayContainerResponseWriter writer = new ByteArrayContainerResponseWriter();
+ ContainerResponse resp = service("GET", "/a/groovy",
"", null, null, writer);
+ assertEquals(200, resp.getStatus());
+ assertEquals("hello groovy", new String(writer.getBody()));
+ }
+
+}
Property changes on:
ws/trunk/exo.ws.rest.ext/src/test/java/org/exoplatform/services/rest/ext/groovy/GroovySimpleTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Copied: ws/trunk/exo.ws.rest.ext/src/test/resources/conf/standalone (from rev 2528,
ws/trunk/exo.ws.rest.ext/src/test/resources/standalone)
Modified:
ws/trunk/exo.ws.rest.ext/src/test/resources/conf/standalone/test-configuration.xml
===================================================================
---
ws/trunk/exo.ws.rest.ext/src/test/resources/standalone/test-configuration.xml 2010-06-09
14:10:00 UTC (rev 2528)
+++
ws/trunk/exo.ws.rest.ext/src/test/resources/conf/standalone/test-configuration.xml 2010-06-17
08:39:29 UTC (rev 2647)
@@ -1,111 +1,103 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
+ <!--
- Copyright (C) 2009 eXo Platform SAS.
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it
and/or modify it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version. This software is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU Lesser General
Public License along with this software; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ site:
http://www.fsf.org.
+ -->
+<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
+ <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
+ <init-params>
+ <value-param>
+ <name>logger</name>
+ <value>org.slf4j.Logger</value>
+ </value-param>
+ <value-param>
+ <name>configurator</name>
+ <value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
+ </value-param>
+ <properties-param>
+ <name>properties</name>
+ <description>Log4J properties</description>
+ <property name="log4j.rootLogger" value="INFO, stdout" />
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
+ <property name="log4j.appender.stdout"
value="org.apache.log4j.ConsoleAppender" />
+ <property name="log4j.appender.stdout.threshold" value="DEBUG"
/>
+ <property name="log4j.appender.stdout.layout"
value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.stdout.layout.ConversionPattern"
value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
+ <property name="log4j.appender.file"
value="org.apache.log4j.FileAppender" />
+ <property name="log4j.appender.file.File"
value="target/container.log" />
+ <property name="log4j.appender.file.layout"
value="org.apache.log4j.PatternLayout" />
+ <property name="log4j.appender.file.layout.ConversionPattern"
value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ </properties-param>
+ </init-params>
+ </component>
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ <component>
+ <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.RequestDispatcher</type>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.ResourceBinder</type>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</type>
+ </component>
+ <component>
+ <type>org.exoplatform.services.rest.ext.groovy.GroovyJaxrsPublisher</type>
+ </component>
+ <component>
+ <type>org.exoplatform.services.script.groovy.GroovyScriptInstantiator</type>
+ </component>
--->
-<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.services.log.LogConfigurationInitializer</key>
- <type>org.exoplatform.services.log.LogConfigurationInitializer</type>
- <init-params>
- <value-param>
- <name>logger</name>
- <value>org.slf4j.Logger</value>
- </value-param>
- <value-param>
- <name>configurator</name>
-
<value>org.exoplatform.services.log.impl.Log4JConfigurator</value>
- </value-param>
- <properties-param>
- <name>properties</name>
- <description>Log4J properties</description>
- <property name="log4j.rootLogger" value="INFO, stdout"
/>
-
- <property name="log4j.appender.stdout"
value="org.apache.log4j.ConsoleAppender" />
- <property name="log4j.appender.stdout.threshold"
value="DEBUG" />
- <property name="log4j.appender.stdout.layout"
value="org.apache.log4j.PatternLayout" />
- <property name="log4j.appender.stdout.layout.ConversionPattern"
value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
- <property name="log4j.appender.file"
value="org.apache.log4j.FileAppender" />
- <property name="log4j.appender.file.File"
value="target/container.log" />
- <property name="log4j.appender.file.layout"
value="org.apache.log4j.PatternLayout" />
- <property name="log4j.appender.file.layout.ConversionPattern"
value="%d{dd.MM.yyyy HH:mm:ss} *%-5p* [%t] %c{1}: %m (%F, line %L) %n" />
-
- </properties-param>
- </init-params>
- </component>
-
- <component>
- <type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.RequestDispatcher</type>
- </component>
- <component>
- <type>org.exoplatform.services.rest.impl.ResourceBinder</type>
- </component>
- <component>
-
<type>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</type>
- </component>
-
- <external-component-plugins>
-
<target-component>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</target-component>
- <component-plugin>
- <name>ws.rs.jaxb.context</name>
- <set-method>addPlugin</set-method>
-
<type>org.exoplatform.services.rest.impl.provider.JAXBContextComponentPlugin</type>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</target-component>
+ <component-plugin>
+ <name>ws.rs.jaxb.context</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.rest.impl.provider.JAXBContextComponentPlugin</type>
+ <init-params>
+ <!-- ======== example ======= -->
+ <value-param>
+ <name>book</name>
+ <value>org.exoplatform.services.rest.generated.Book</value>
+ </value-param>
+ <!-- ======================== -->
+ <value-param>
+ <name>wadl.application</name>
+ <value>org.exoplatform.services.rest.wadl.research.Application</value>
+ </value-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ <external-component-plugins>
+ <target-component>org.exoplatform.services.rest.impl.RequestHandlerImpl</target-component>
+ <component-plugin>
+ <name>ws.rs.entity.provider</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.rest.impl.provider.EntityProviderComponentPlugin</type>
+ <!-- NOTE it is just example of configuration. -->
+ <!-- StringEntityProvider is part of REST framework, not needs to add it from
configuration -->
+ <!--
<init-params>
- <!-- ======== example ======= -->
<value-param>
- <name>book</name>
- <value>org.exoplatform.services.rest.generated.Book</value>
- </value-param>
- <!-- ======================== -->
- <value-param>
- <name>wadl.application</name>
-
<value>org.exoplatform.services.rest.wadl.research.Application</value>
- </value-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
- <external-component-plugins>
-
<target-component>org.exoplatform.services.rest.impl.RequestHandlerImpl</target-component>
- <component-plugin>
- <name>ws.rs.entity.provider</name>
- <set-method>addPlugin</set-method>
-
<type>org.exoplatform.services.rest.impl.provider.EntityProviderComponentPlugin</type>
- <!-- NOTE it is just example of configuration. -->
- <!-- StringEntityProvider is part of REST framework, not needs to add it from
configuration -->
- <!--
- <init-params>
- <value-param>
<name>strings</name>
<value>org.exoplatform.services.rest.impl.provider.StringEntityProvider</value>
</value-param>
</init-params>
-->
- </component-plugin>
- <component-plugin>
- <name>ws.rs.method.filter</name>
- <set-method>addPlugin</set-method>
-
<type>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</type>
- <!--
+ </component-plugin>
+ <component-plugin>
+ <name>ws.rs.method.filter</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin</type>
+ <!--
<init-params>
<value-param>
<name>name</name>
@@ -113,12 +105,12 @@
</value-param>
</init-params>
-->
- </component-plugin>
- <component-plugin>
- <name>ws.rs.request.filter</name>
- <set-method>addPlugin</set-method>
-
<type>org.exoplatform.services.rest.impl.RequestFilterComponentPlugin</type>
- <!--
+ </component-plugin>
+ <component-plugin>
+ <name>ws.rs.request.filter</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.rest.impl.RequestFilterComponentPlugin</type>
+ <!--
<init-params>
<value-param>
<name>name</name>
@@ -126,12 +118,12 @@
</value-param>
</init-params>
-->
- </component-plugin>
- <component-plugin>
- <name>ws.rs.response.filter</name>
- <set-method>addPlugin</set-method>
-
<type>org.exoplatform.services.rest.impl.ResponseFilterComponentPlugin</type>
- <!--
+ </component-plugin>
+ <component-plugin>
+ <name>ws.rs.response.filter</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.rest.impl.ResponseFilterComponentPlugin</type>
+ <!--
<init-params>
<value-param>
<name>name</name>
@@ -139,6 +131,6 @@
</value-param>
</init-params>
-->
- </component-plugin>
- </external-component-plugins>
+ </component-plugin>
+ </external-component-plugins>
</configuration>
Added: ws/trunk/exo.ws.rest.ext/src/test/resources/groovy1.groovy
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/test/resources/groovy1.groovy
(rev 0)
+++ ws/trunk/exo.ws.rest.ext/src/test/resources/groovy1.groovy 2010-06-17 08:39:29 UTC
(rev 2647)
@@ -0,0 +1,27 @@
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Context;
+
+@Path("a")
+class CroovyResource1
+{
+
+ CroovyResource1(@Context HttpServletRequest req1)
+ {
+ this.req1 = req1;
+ }
+
+ @Context
+ private HttpServletRequest req
+
+ private HttpServletRequest req1
+
+ @GET
+ @Path("b")
+ def m0()
+ {
+ return req.getMethod() + "\n" +req.getRequestURI().toString()
+ }
+
+}
\ No newline at end of file
Added: ws/trunk/exo.ws.rest.ext/src/test/resources/groovy2.groovy
===================================================================
--- ws/trunk/exo.ws.rest.ext/src/test/resources/groovy2.groovy
(rev 0)
+++ ws/trunk/exo.ws.rest.ext/src/test/resources/groovy2.groovy 2010-06-17 08:39:29 UTC
(rev 2647)
@@ -0,0 +1,24 @@
+import org.exoplatform.services.rest.ext.groovy.GroovyExoComponentTest.Component1;
+
+import javax.ws.rs.GET;
+import javax.ws.rs.Path;
+
+@Path("a")
+class CroovyResource2
+{
+ private Component1 component
+
+ CroovyResource2(Component1 component)
+ {
+ this.component = component
+ }
+
+ @GET
+ @Path("b")
+ def m0()
+ {
+ return component.getName()
+ }
+
+
+}
\ No newline at end of file
Modified: ws/trunk/pom.xml
===================================================================
--- ws/trunk/pom.xml 2010-06-17 08:34:18 UTC (rev 2646)
+++ ws/trunk/pom.xml 2010-06-17 08:39:29 UTC (rev 2647)
@@ -1,179 +1,177 @@
-<!--
- Copyright (C) 2009 eXo Platform SAS.
+ <!--
- This is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as
- published by the Free Software Foundation; either version 2.1 of
- the License, or (at your option) any later version.
-
- This software is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this software; if not, write to the Free
- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-
--->
+ Copyright (C) 2009 eXo Platform SAS. This is free software; you can redistribute it
and/or modify it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or (at
+ your option) any later version. This software is distributed in the hope that it will
be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+ License for more details. You should have received a copy of the GNU Lesser General
Public License along with this software; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ site:
http://www.fsf.org.
+ -->
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.exoplatform</groupId>
- <artifactId>foundation-parent</artifactId>
- <version>7</version>
- </parent>
+ <parent>
+ <groupId>org.exoplatform</groupId>
+ <artifactId>foundation-parent</artifactId>
+ <version>7</version>
+ </parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.0-Beta01-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>eXo WS</name>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.2.0-Beta01-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>eXo WS</name>
- <scm>
-
<
connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<...
-
<
developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/tru...
- <
url>http://fisheye.jboss.org/browse/exo-jcr/ws/trunk</url>
- </scm>
+ <scm>
+ <
connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk<...
+ <
developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/tru...
+ <
url>http://fisheye.jboss.org/browse/exo-jcr/ws/trunk</url>
+ </scm>
- <properties>
- <exo.product.name>exo-ws</exo.product.name>
- <exo.product.specification>2.1</exo.product.specification>
-
-
<org.exoplatform.kernel.version>2.3.0-Beta01-SNAPSHOT</org.exoplatform.kernel.version>
-
<org.exoplatform.core.version>2.4.0-Beta01-SNAPSHOT</org.exoplatform.core.version>
- </properties>
+ <properties>
+ <exo.product.name>exo-ws</exo.product.name>
+ <exo.product.specification>2.1</exo.product.specification>
- <modules>
- <module>exo.ws.commons</module>
- <module>exo.ws.frameworks.json</module>
- <module>exo.ws.frameworks.servlet</module>
- <module>exo.ws.testframework</module>
- <module>exo.ws.rest.core</module>
- <module>exo.ws.rest.ext</module>
- <module>packaging/module</module>
- </modules>
+ <org.exoplatform.kernel.version>2.3.0-Beta01-SNAPSHOT</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.4.0-Beta01-SNAPSHOT</org.exoplatform.core.version>
+ </properties>
- <dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.commons</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.container</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- <version>${org.exoplatform.kernel.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.xml-processing</artifactId>
- <version>${org.exoplatform.core.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.frameworks.json</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.testframework</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.commons</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.rest.core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.stream</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.4</version>
- </dependency>
- <dependency>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- <version>1.4</version>
- </dependency>
- <dependency>
- <groupId>javax.activation</groupId>
- <artifactId>activation</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>picocontainer</groupId>
- <artifactId>picocontainer</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>jtidy</groupId>
- <artifactId>jtidy</artifactId>
- <version>4aug2000r7-dev</version>
- </dependency>
- <dependency>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <version>0.4</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <!-- <version>1.2.1</version>-->
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>xpp3</groupId>
- <artifactId>xpp3</artifactId>
- <version>1.1.3.4.O</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.5.8</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
- <dependencies>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <modules>
+ <module>exo.ws.commons</module>
+ <module>exo.ws.frameworks.json</module>
+ <module>exo.ws.frameworks.servlet</module>
+ <module>exo.ws.testframework</module>
+ <module>exo.ws.rest.core</module>
+ <module>exo.ws.rest.ext</module>
+ <module>packaging/module</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.commons</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.container</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ <version>${org.exoplatform.kernel.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.xml-processing</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.script.groovy</artifactId>
+ <version>${org.exoplatform.core.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.frameworks.json</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.testframework</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.commons</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.stream</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>activation</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>picocontainer</groupId>
+ <artifactId>picocontainer</artifactId>
+ <version>1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>jtidy</groupId>
+ <artifactId>jtidy</artifactId>
+ <version>4aug2000r7-dev</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <version>0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <!-- <version>1.2.1</version>-->
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>xpp3</groupId>
+ <artifactId>xpp3</artifactId>
+ <version>1.1.3.4.O</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.8</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.groovy</groupId>
+ <artifactId>groovy-all</artifactId>
+ <version>1.6.5</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
</project>