exo-jcr SVN: r277 - in ws/branches/2.2.x/rest/core/src: main/java/org/exoplatform/services/rest/impl and 2 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-13 23:44:20 -0400 (Tue, 13 Oct 2009)
New Revision: 277
Modified:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
Log:
EXOJCR-185 :
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java 2009-10-13 18:38:38 UTC (rev 276)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java 2009-10-14 03:44:20 UTC (rev 277)
@@ -22,6 +22,8 @@
import java.util.List;
+import javax.ws.rs.core.Application;
+
/**
* Manages root resources.
*
@@ -31,6 +33,12 @@
public interface ResourceBinder
{
/**
+ * @param application Application
+ * @see Application
+ */
+ void addApplication(Application application);
+
+ /**
* @param resourceClass class of candidate to be root resource
* @return true if resource was bound and false if resource was not bound
* cause it is not root resource
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java 2009-10-13 18:38:38 UTC (rev 276)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java 2009-10-14 03:44:20 UTC (rev 277)
@@ -156,7 +156,6 @@
* @see Application
*/
@SuppressWarnings("unchecked")
- @Deprecated
public void addApplication(Application application)
{
ProviderBinder providers = ProviderBinder.getInstance();
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-13 18:38:38 UTC (rev 276)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ConstructorDescriptorImpl.java 2009-10-14 03:44:20 UTC (rev 277)
@@ -18,8 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.ApplicationContext;
@@ -218,7 +216,6 @@
*/
public Object createInstance(ApplicationContext context)
{
- ExoContainer container = ExoContainerContext.getCurrentContainer();
Object[] p = new Object[parameters.size()];
int i = 0;
for (ConstructorParameter cp : parameters)
@@ -243,9 +240,19 @@
else
{
// If parameter not has not annotation then get constructor parameter
- // from container, this is out of scope JAX-RS specification.
- Object tmp = container.getComponentInstanceOfType(cp.getParameterClass());
+ // from DependencyInjector, this is out of scope JAX-RS specification.
+
+ if (context.getDependencyInjector() == null)
+ {
+ String msg =
+ "Can't instantiate resource " + resourceClass
+ + ". DependencyInjector not found, not able get required parameter " + cp;
+ LOG.error(msg);
+ throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg)
+ .type(MediaType.TEXT_PLAIN).build());
+ }
+ Object tmp = context.getDependencyInjector().getInjectableParameter(cp.getParameterClass(), null);
if (tmp == null)
{
String msg =
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-13 18:38:38 UTC (rev 276)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-14 03:44:20 UTC (rev 277)
@@ -116,12 +116,12 @@
private final DependencyInjector depInjector;
- public RequestHandlerImpl(DependencyInjector depInjector)
- {
- this.binder = new BaseResourceBinder();
- this.dispatcher = new RequestDispatcher(binder);
- this.depInjector = depInjector;
- }
+// public RequestHandlerImpl(DependencyInjector depInjector)
+// {
+// this.binder = new BaseResourceBinder();
+// this.dispatcher = new RequestDispatcher(binder);
+// this.depInjector = depInjector;
+// }
public RequestHandlerImpl(ResourceBinder binder, DependencyInjector depInjector)
{
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java 2009-10-13 18:38:38 UTC (rev 276)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java 2009-10-14 03:44:20 UTC (rev 277)
@@ -142,7 +142,7 @@
EnvironmentContext.setCurrent(env);
ServletContainerRequest request = new ServletContainerRequest(httpRequest);
ContainerResponse response = new ContainerResponse(new ServletContainerResponseWriter(httpResponse));
- requestHandler.handleRequest(request, response);
+ getRequestHandler().handleRequest(request, response);
}
catch (Exception e)
{
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-13 18:38:38 UTC (rev 276)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-14 03:44:20 UTC (rev 277)
@@ -20,10 +20,13 @@
import org.exoplatform.services.rest.DependencyInjector;
import org.exoplatform.services.rest.RequestHandler;
+import org.exoplatform.services.rest.ResourceBinder;
+import org.exoplatform.services.rest.impl.BaseResourceBinder;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
+import javax.ws.rs.core.Application;
/**
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
@@ -61,9 +64,32 @@
}
}
- RequestHandler handler = new RequestHandlerImpl(dependencyInjector);
+ ResourceBinder binder = new BaseResourceBinder();
+ String applicationFQN = event.getServletContext().getInitParameter("javax.ws.rs.Application");
+ if (applicationFQN != null)
+ {
+ try
+ {
+ Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(applicationFQN.trim());
+ Application application = (Application)cl.newInstance();
+ binder.addApplication(application);
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new RuntimeException(cnfe);
+ }
+ catch (InstantiationException ie)
+ {
+ throw new RuntimeException(ie);
+ }
+ catch (IllegalAccessException iae)
+ {
+ throw new RuntimeException(iae);
+ }
+ }
+
+ RequestHandler handler = new RequestHandlerImpl(binder, dependencyInjector);
event.getServletContext().setAttribute(RequestHandler.class.getName(), handler);
- // TODO process for javax.ws.rs.Application
}
}
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-13 18:38:38 UTC (rev 276)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-14 03:44:20 UTC (rev 277)
@@ -45,14 +45,14 @@
{
// StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
// container = StandaloneContainer.getInstance();
-
- requestHandler = new RequestHandlerImpl(new SimpleDependencyInjector());
+ binder = new BaseResourceBinder();
+ requestHandler = new RequestHandlerImpl(binder, null/*new SimpleDependencyInjector()*/);
requestHandler.init();
- binder = (BaseResourceBinder)requestHandler.getBinder();
// reset providers to be sure it is clean
ProviderBinder.setInstance(new ProviderBinder());
providers = ProviderBinder.getInstance();
+
// Set-up context for tests that are not used full request cycle.
// Usually context is set-up in RequestHandler
ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
14 years, 8 months
exo-jcr SVN: r276 - ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-13 14:38:38 -0400 (Tue, 13 Oct 2009)
New Revision: 276
Added:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java
Log:
EXOJCR-185 : simple implementation of DependencyInjector
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/SimpleDependencyInjector.java 2009-10-13 18:38:38 UTC (rev 276)
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest.impl;
+
+import org.exoplatform.services.rest.DependencyInjector;
+
+import java.lang.reflect.Type;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id: SimpleDependencyInjector.java 275 2009-10-13 16:17:02Z aparfonov $
+ */
+public class SimpleDependencyInjector extends HashMap<Class<?>, Object> implements DependencyInjector
+{
+
+ private static final long serialVersionUID = 8212609178539168377L;
+
+ public Object getInjectableParameter(Class<?> type, Type genericType)
+ {
+ return get(type);
+ }
+
+}
14 years, 8 months
exo-jcr SVN: r275 - in ws/branches/2.2.x/rest/core/src: main/java/org/exoplatform/services/rest/impl and 10 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-13 12:17:02 -0400 (Tue, 13 Oct 2009)
New Revision: 275
Added:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/AbstractResourceTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java
Removed:
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java
Modified:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseImplTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/VariantsHandlerTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptLanguageTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptMediaTypeTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptTokenTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/CookieTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/EntityTagTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/HeaderParameterParserTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/LanguageTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/MediaTypeTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/HeadMethodTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MediaTypeTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodExceptionTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodReturnTypeTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/OptionsMethodTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/ParametersInjectionTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ByteEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ContextResolverTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ExceptionMapperTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FileEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FormEntityTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/InputStreamEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/OtherEntityTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ProviderContextParameterInjectionTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ReaderEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/SourceEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/StringEntityProviderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AcceptResourceTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ContextParametersInjectionTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/MatchedURIsAndResourcesTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriBuilderTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriComponentTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/util/MediaTypeMapTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java
Log:
EXOJCR-185 :
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ApplicationContext.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -41,23 +41,6 @@
{
/**
- * Should be used to pass template values in context by using returned list in
- * matching to @see
- * {@link org.exoplatform.services.rest.uri.UriPattern#match(String, List)}
- * . List will be cleared during matching.
- *
- * @return the list for template values
- */
- List<String> getParameterValues();
-
- /**
- * Pass in context list of path template parameters @see {@link UriPattern}.
- *
- * @param parameterNames list of templates parameters
- */
- void setParameterNames(List<String> parameterNames);
-
- /**
* Add ancestor resource, according to JSR-311:
* <p>
* Entries are ordered according in reverse request URI matching order, with
@@ -89,45 +72,67 @@
Map<String, Object> getAttributes();
/**
- * @return See {@link Request}
+ * @return See {@link GenericContainerRequest}
*/
- Request getRequest();
+ GenericContainerRequest getContainerRequest();
/**
+ * @return See {@link GenericContainerResponse}
+ */
+ GenericContainerResponse getContainerResponse();
+
+
+ DependencyInjector getDependencyInjector();
+
+ /**
* @return See {@link HttpHeaders}
*/
HttpHeaders getHttpHeaders();
+
+ /**
+ * @return {@link InitialProperties}
+ */
+ InitialProperties getInitialProperties();
/**
- * @return {@link InitialProperties}
+ * Should be used to pass template values in context by using returned list in
+ * matching to @see
+ * {@link org.exoplatform.services.rest.uri.UriPattern#match(String, List)}
+ * . List will be cleared during matching.
+ *
+ * @return the list for template values
*/
- InitialProperties getInitialProperties();
+ List<String> getParameterValues();
/**
- * @return See {@link SecurityContext}
+ * @return {@link ProviderBinder}
+ * @see Providers
*/
- SecurityContext getSecurityContext();
+ ProviderBinder getProviders();
/**
- * @return See {@link GenericContainerRequest}
+ * @return See {@link Request}
*/
- GenericContainerRequest getContainerRequest();
+ Request getRequest();
/**
- * @return See {@link UriInfo}
+ * @return See {@link SecurityContext}
*/
- UriInfo getUriInfo();
+ SecurityContext getSecurityContext();
/**
- * @return See {@link GenericContainerResponse}
+ * @return See {@link UriInfo}
*/
- GenericContainerResponse getContainerResponse();
+ UriInfo getUriInfo();
+ void setDependencyInjector(DependencyInjector depInjector);
+
/**
- * @return {@link ProviderBinder}
- * @see Providers
+ * Pass in context list of path template parameters @see {@link UriPattern}.
+ *
+ * @param parameterNames list of templates parameters
*/
- ProviderBinder getProviders();
+ void setParameterNames(List<String> parameterNames);
}
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest;
+
+import java.lang.reflect.Type;
+
+/**
+ * Implementation of DependencyInjector should be able to provide
+ * objects that required for constructors or fields of Resource or Provider.
+ *
+ * @author <a href="mailto:andrey.parfonov@exoplatform.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public interface DependencyInjector
+{
+
+ /**
+ * Get single parameter of type <code>type</code>.
+ *
+ * @param type class of required parameter
+ * @param the type of object to be produced
+ * @return object of required type or null if instance of <code>type</code>
+ * may not be produced
+ */
+ Object getInjectableParameter(Class<?> type, Type genericType);
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/DependencyInjector.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -23,6 +23,8 @@
import java.util.List;
/**
+ * Manages root resources.
+ *
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id$
*/
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ApplicationContextImpl.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -19,6 +19,7 @@
package org.exoplatform.services.rest.impl;
import org.exoplatform.services.rest.ApplicationContext;
+import org.exoplatform.services.rest.DependencyInjector;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.GenericContainerResponse;
import org.exoplatform.services.rest.InitialProperties;
@@ -51,6 +52,14 @@
private static ThreadLocal<ApplicationContext> current = new ThreadLocal<ApplicationContext>();
/**
+ * @return current ApplicationContext.
+ */
+ public static ApplicationContext getCurrent()
+ {
+ return current.get();
+ }
+
+ /**
* Set ApplicationContext for current thread.
*
* @param context the ApplicationContext.
@@ -61,14 +70,6 @@
}
/**
- * @return current ApplicationContext.
- */
- public static ApplicationContext getCurrent()
- {
- return current.get();
- }
-
- /**
* Values of template parameters.
*/
private List<String> parameterValues = new ArrayList<String>();
@@ -114,13 +115,58 @@
protected ProviderBinder providers;
/**
+ * Absolute path, full requested URI without query string and fragment.
+ */
+ private URI absolutePath;
+
+ /**
+ * Decoded relative path.
+ */
+ private String path;
+
+ /**
+ * Not decoded relative path.
+ */
+ private String encodedPath;
+
+ /**
+ * Not decoded path template parameters.
+ */
+ private MultivaluedMap<String, String> encodedPathParameters;
+
+ /**
+ * Decoded path template parameters.
+ */
+ private MultivaluedMap<String, String> pathParameters;
+
+ /**
+ * List of not decoded path segments.
+ */
+ private List<PathSegment> encodedPathSegments;
+
+ /**
+ * Decoded path segments.
+ */
+ private List<PathSegment> pathSegments;
+
+ /**
+ * Not decoded query parameters.
+ */
+ private MultivaluedMap<String, String> encodedQueryParameters;
+
+ /**
+ * Decoded query parameters.
+ */
+ private MultivaluedMap<String, String> queryParameters;
+
+ /**
* Constructs new instance of ApplicationContext.
*
* @param request See {@link GenricContainerRequest}
* @param response See {@link GenericContainerResponse}
* @param providers See {@link ProviderBinder}
*/
- public ApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response,
+ /*public */ApplicationContextImpl(GenericContainerRequest request, GenericContainerResponse response,
ProviderBinder providers)
{
this.request = request;
@@ -131,27 +177,6 @@
/**
* {@inheritDoc}
*/
- public List<String> getParameterValues()
- {
- return parameterValues;
- }
-
- /**
- * {@inheritDoc}
- */
- public void setParameterNames(List<String> parameterNames)
- {
- if (encodedPathParameters == null)
- encodedPathParameters = new MultivaluedMapImpl();
-
- for (int i = 0; i < parameterNames.size(); i++)
- encodedPathParameters.add(parameterNames.get(i), parameterValues.get(i));
-
- }
-
- /**
- * {@inheritDoc}
- */
public void addMatchedResource(Object resource)
{
matchedResources.add(0, resource);
@@ -169,41 +194,44 @@
/**
* {@inheritDoc}
*/
- public Map<String, Object> getAttributes()
+ public URI getAbsolutePath()
{
- return attributes == null ? attributes = new HashMap<String, Object>() : attributes;
+ if (absolutePath != null)
+ return absolutePath;
+
+ return absolutePath = getRequestUriBuilder().replaceQuery(null).fragment(null).build();
}
-
+
/**
* {@inheritDoc}
*/
- public Request getRequest()
+ public UriBuilder getAbsolutePathBuilder()
{
- return request;
+ return UriBuilder.fromUri(getAbsolutePath());
}
/**
* {@inheritDoc}
*/
- public HttpHeaders getHttpHeaders()
+ public Map<String, Object> getAttributes()
{
- return request;
+ return attributes == null ? attributes = new HashMap<String, Object>() : attributes;
}
-
+
/**
* {@inheritDoc}
*/
- public InitialProperties getInitialProperties()
+ public URI getBaseUri()
{
- return this;
+ return request.getBaseUri();
}
/**
* {@inheritDoc}
*/
- public SecurityContext getSecurityContext()
+ public UriBuilder getBaseUriBuilder()
{
- return request;
+ return UriBuilder.fromUri(getBaseUri());
}
/**
@@ -217,114 +245,36 @@
/**
* {@inheritDoc}
*/
- public UriInfo getUriInfo()
- {
- return this;
- }
-
- /**
- * {@inheritDoc}
- */
public GenericContainerResponse getContainerResponse()
{
return response;
}
-
- // InitialProperties
- /**
- * {@inheritDoc}
- */
- public Map<String, String> getProperties()
+ public DependencyInjector getDependencyInjector()
{
- return properties == null ? properties = new HashMap<String, String>() : properties;
+ // TODO Auto-generated method stub
+ return null;
}
/**
* {@inheritDoc}
*/
- public String getProperty(String name)
+ public HttpHeaders getHttpHeaders()
{
- return getProperties().get(name);
+ return request;
}
/**
* {@inheritDoc}
*/
- public void setProperty(String name, String value)
+ public InitialProperties getInitialProperties()
{
- getProperties().put(name, value);
+ return this;
}
- // UriInfo
-
/**
- * Absolute path, full requested URI without query string and fragment.
- */
- private URI absolutePath;
-
- /**
- * Decoded relative path.
- */
- private String path;
-
- /**
- * Not decoded relative path.
- */
- private String encodedPath;
-
- /**
- * Not decoded path template parameters.
- */
- private MultivaluedMap<String, String> encodedPathParameters;
-
- /**
- * Decoded path template parameters.
- */
- private MultivaluedMap<String, String> pathParameters;
-
- /**
- * List of not decoded path segments.
- */
- private List<PathSegment> encodedPathSegments;
-
- /**
- * Decoded path segments.
- */
- private List<PathSegment> pathSegments;
-
- /**
- * Not decoded query parameters.
- */
- private MultivaluedMap<String, String> encodedQueryParameters;
-
- /**
- * Decoded query parameters.
- */
- private MultivaluedMap<String, String> queryParameters;
-
- /**
* {@inheritDoc}
*/
- public URI getAbsolutePath()
- {
- if (absolutePath != null)
- return absolutePath;
-
- return absolutePath = getRequestUriBuilder().replaceQuery(null).fragment(null).build();
- }
-
- /**
- * {@inheritDoc}
- */
- public UriBuilder getAbsolutePathBuilder()
- {
- return UriBuilder.fromUri(getAbsolutePath());
- }
-
- /**
- * {@inheritDoc}
- */
public List<Object> getMatchedResources()
{
return matchedResources;
@@ -349,22 +299,14 @@
/**
* {@inheritDoc}
*/
- public URI getBaseUri()
+ public List<String> getParameterValues()
{
- return request.getBaseUri();
+ return parameterValues;
}
/**
* {@inheritDoc}
*/
- public UriBuilder getBaseUriBuilder()
- {
- return UriBuilder.fromUri(getBaseUri());
- }
-
- /**
- * {@inheritDoc}
- */
public String getPath()
{
return getPath(true);
@@ -454,6 +396,30 @@
/**
* {@inheritDoc}
*/
+ public Map<String, String> getProperties()
+ {
+ return properties == null ? properties = new HashMap<String, String>() : properties;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getProperty(String name)
+ {
+ return getProperties().get(name);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public ProviderBinder getProviders()
+ {
+ return providers;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public MultivaluedMap<String, String> getQueryParameters()
{
return getQueryParameters(true);
@@ -474,6 +440,14 @@
/**
* {@inheritDoc}
*/
+ public Request getRequest()
+ {
+ return request;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public URI getRequestUri()
{
return request.getRequestUri();
@@ -490,9 +464,44 @@
/**
* {@inheritDoc}
*/
- public ProviderBinder getProviders()
+ public SecurityContext getSecurityContext()
{
- return providers;
+ return request;
}
+ /**
+ * {@inheritDoc}
+ */
+ public UriInfo getUriInfo()
+ {
+ return this;
+ }
+
+ public void setDependencyInjector(DependencyInjector depInjector)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setParameterNames(List<String> parameterNames)
+ {
+ if (encodedPathParameters == null)
+ encodedPathParameters = new MultivaluedMapImpl();
+
+ for (int i = 0; i < parameterNames.size(); i++)
+ encodedPathParameters.add(parameterNames.get(i), parameterValues.get(i));
+
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setProperty(String name, String value)
+ {
+ getProperties().put(name, value);
+ }
+
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -50,9 +50,6 @@
import javax.ws.rs.ext.RuntimeDelegate;
/**
- * Lookup for root resource eXo container components at startup and
- * register/unregister resources via specified methods.
- *
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id$
*/
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,9 +18,22 @@
*/
package org.exoplatform.services.rest.impl;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import javax.ws.rs.ext.ExceptionMapper;
+
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.ApplicationContext;
+import org.exoplatform.services.rest.DependencyInjector;
import org.exoplatform.services.rest.FilterDescriptor;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.GenericContainerResponse;
@@ -29,20 +42,7 @@
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.ResponseFilter;
-import org.picocontainer.Startable;
-import java.io.File;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.StreamingOutput;
-import javax.ws.rs.ext.ExceptionMapper;
-
/**
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id: $
@@ -51,6 +51,37 @@
{
/**
+ * For writing error message.
+ */
+ static class ErrorStreaming implements StreamingOutput
+ {
+
+ /**
+ * Exception which should send to client.
+ */
+ private final Exception e;
+
+ /**
+ * @param e Exception for serialization
+ */
+ ErrorStreaming(Exception e)
+ {
+ this.e = e;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void write(OutputStream output)
+ {
+ PrintWriter pw = new PrintWriter(output);
+ e.printStackTrace(pw);
+ pw.flush();
+ }
+
+ }
+
+ /**
* Logger.
*/
private static final Log LOG = ExoLogger.getLogger(RequestHandlerImpl.class.getName());
@@ -60,11 +91,6 @@
* and may be accessible via method {@link ApplicationContextImpl#getProperties()}.
*/
private static final Map<String, String> properties = new HashMap<String, String>();
-
- /**
- * See {@link RequestDispatcher}.
- */
- private final RequestDispatcher dispatcher;
public static final String getProperty(String name)
{
@@ -78,23 +104,36 @@
properties.put(name, value);
}
- private final ResourceBinder binder;
+ /**
+ * See {@link RequestDispatcher}.
+ */
+ private final RequestDispatcher dispatcher;
/**
- * Constructs new instance of {@link RequestHandler}.
+ * ResourceBinder.
*/
- public RequestHandlerImpl()
+ private final ResourceBinder binder;
+
+ private final DependencyInjector depInjector;
+
+ public RequestHandlerImpl(DependencyInjector depInjector)
{
this.binder = new BaseResourceBinder();
this.dispatcher = new RequestDispatcher(binder);
+ this.depInjector = depInjector;
}
+ public RequestHandlerImpl(ResourceBinder binder, DependencyInjector depInjector)
+ {
+ this.binder = binder;
+ this.dispatcher = new RequestDispatcher(binder);
+ this.depInjector = depInjector;
+ }
+
public ResourceBinder getBinder()
{
return binder;
}
-
- // RequestHandler
/**
* {@inheritDoc}
@@ -106,6 +145,7 @@
{
ApplicationContext context = new ApplicationContextImpl(request, response, ProviderBinder.getInstance());
context.getProperties().putAll(properties);
+ context.setDependencyInjector(depInjector);
ApplicationContextImpl.setCurrent(context);
for (ObjectFactory<FilterDescriptor> factory : ProviderBinder.getInstance().getRequestFilters(
@@ -225,40 +265,7 @@
}
}
- //
-
/**
- * For writing error message.
- */
- static class ErrorStreaming implements StreamingOutput
- {
-
- /**
- * Exception which should send to client.
- */
- private final Exception e;
-
- /**
- * @param e Exception for serialization
- */
- ErrorStreaming(Exception e)
- {
- this.e = e;
- }
-
- /**
- * {@inheritDoc}
- */
- public void write(OutputStream output)
- {
- PrintWriter pw = new PrintWriter(output);
- e.printStackTrace(pw);
- pw.flush();
- }
-
- }
-
- /**
* Startup initialization.
*/
public void init()
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -46,6 +46,8 @@
public class BaseRestServlet extends HttpServlet
{
+ private static final long serialVersionUID = -8234561611241680339L;
+
/**
* See {@link ContainerResponseWriter}.
*/
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,6 +18,7 @@
*/
package org.exoplatform.services.rest.servlet;
+import org.exoplatform.services.rest.DependencyInjector;
import org.exoplatform.services.rest.RequestHandler;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
@@ -37,8 +38,32 @@
public void contextInitialized(ServletContextEvent event)
{
- RequestHandler handler = new RequestHandlerImpl();
+ String dependencyInjectorFQN = event.getServletContext().getInitParameter(DependencyInjector.class.getName());
+ DependencyInjector dependencyInjector = null;
+ if (dependencyInjectorFQN != null)
+ {
+ try
+ {
+ Class<?> cl = Thread.currentThread().getContextClassLoader().loadClass(dependencyInjectorFQN.trim());
+ dependencyInjector = (DependencyInjector)cl.newInstance();
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ throw new RuntimeException(cnfe);
+ }
+ catch (InstantiationException ie)
+ {
+ throw new RuntimeException(ie);
+ }
+ catch (IllegalAccessException iae)
+ {
+ throw new RuntimeException(iae);
+ }
+ }
+
+ RequestHandler handler = new RequestHandlerImpl(dependencyInjector);
event.getServletContext().setAttribute(RequestHandler.class.getName(), handler);
+ // TODO process for javax.ws.rs.Application
}
}
Deleted: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -1,78 +0,0 @@
-/*
- * 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.
- */
-package org.exoplatform.services.rest;
-
-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.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 AbstractResourceTest extends BaseTest
-{
-
- // public void setUp() throws Exception {
- // super.setUp();
- // }
-
- 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("", 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());
-
- }
-
-}
Deleted: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -1,91 +0,0 @@
-/*
- * 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.
- */
-package org.exoplatform.services.rest;
-
-import junit.framework.TestCase;
-
-import org.exoplatform.container.StandaloneContainer;
-import org.exoplatform.services.rest.impl.ApplicationContextImpl;
-import org.exoplatform.services.rest.impl.BaseResourceBinder;
-import org.exoplatform.services.rest.impl.ProviderBinder;
-import org.exoplatform.services.rest.impl.RequestHandlerImpl;
-
-/**
- * @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 BaseResourceBinder binder;
-
- protected RequestHandlerImpl requestHandler;
-
- public void setUp() throws Exception
- {
- StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
-// container = StandaloneContainer.getInstance();
-
- requestHandler = new RequestHandlerImpl();
- requestHandler.init();
- binder = (BaseResourceBinder)requestHandler.getBinder();
-
-// 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();
- // System.out.println("##########################"+providers);
- ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
-// binder.clear();
- }
-
- public void tearDown() throws Exception
- {
- }
-
- public boolean registry(Object resource) throws Exception
- {
- // container.registerComponentInstance(resource);
- return binder.bind(resource);
- }
-
- public boolean registry(Class<?> resourceClass) throws Exception
- {
- // container.registerComponentImplementation(resourceClass.getName(), resourceClass);
- return binder.bind(resourceClass);
- }
-
- public boolean unregistry(Object resource)
- {
- // container.unregisterComponentByInstance(resource);
- return binder.unbind(resource.getClass());
- }
-
- public boolean unregistry(Class<?> resourceClass)
- {
- // container.unregisterComponent(resourceClass.getName());
- return binder.unbind(resourceClass);
- }
-
-}
Copied: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/AbstractResourceTest.java (from rev 270, ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/AbstractResourceTest.java)
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/AbstractResourceTest.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/AbstractResourceTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -0,0 +1,79 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest.impl;
+
+import org.exoplatform.services.rest.ContainerResponseWriter;
+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.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 AbstractResourceTest extends BaseTest
+{
+
+ // public void setUp() throws Exception {
+ // super.setUp();
+ // }
+
+ 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("", 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());
+
+ }
+
+}
Copied: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java (from rev 274, ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java)
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/BaseTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -0,0 +1,89 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest.impl;
+
+import junit.framework.TestCase;
+
+import org.exoplatform.container.StandaloneContainer;
+import org.exoplatform.services.rest.impl.ApplicationContextImpl;
+import org.exoplatform.services.rest.impl.BaseResourceBinder;
+import org.exoplatform.services.rest.impl.ProviderBinder;
+import org.exoplatform.services.rest.impl.RequestHandlerImpl;
+
+/**
+ * @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 BaseResourceBinder binder;
+
+ protected RequestHandlerImpl requestHandler;
+
+ public void setUp() throws Exception
+ {
+// StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
+// container = StandaloneContainer.getInstance();
+
+ requestHandler = new RequestHandlerImpl(new SimpleDependencyInjector());
+ requestHandler.init();
+ binder = (BaseResourceBinder)requestHandler.getBinder();
+
+ // reset providers to be sure it is clean
+ ProviderBinder.setInstance(new ProviderBinder());
+ providers = ProviderBinder.getInstance();
+ // Set-up context for tests that are not used full request cycle.
+ // Usually context is set-up in RequestHandler
+ ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
+ }
+
+ public void tearDown() throws Exception
+ {
+ }
+
+ public boolean registry(Object resource) throws Exception
+ {
+ // container.registerComponentInstance(resource);
+ return binder.bind(resource);
+ }
+
+ public boolean registry(Class<?> resourceClass) throws Exception
+ {
+ // container.registerComponentImplementation(resourceClass.getName(), resourceClass);
+ return binder.bind(resourceClass);
+ }
+
+ public boolean unregistry(Object resource)
+ {
+ // container.unregisterComponentByInstance(resource);
+ return binder.unbind(resource.getClass());
+ }
+
+ public boolean unregistry(Class<?> resourceClass)
+ {
+ // container.unregisterComponent(resourceClass.getName());
+ return binder.unbind(resourceClass);
+ }
+
+}
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.GenericContainerResponse;
import org.exoplatform.services.rest.Property;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.RequestFilter;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResourceBinderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import org.exoplatform.services.rest.BaseTest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.GenericContainerResponse;
import org.exoplatform.services.rest.ResponseFilter;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseImplTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseImplTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseImplTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import org.exoplatform.services.rest.BaseTest;
import org.exoplatform.services.rest.impl.header.HeaderHelper;
import java.net.URI;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/VariantsHandlerTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/VariantsHandlerTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/VariantsHandlerTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import org.exoplatform.services.rest.BaseTest;
import java.util.List;
import java.util.Locale;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptLanguageTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptLanguageTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptLanguageTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.List;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptMediaTypeTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptMediaTypeTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptMediaTypeTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.List;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptTokenTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptTokenTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/AcceptTokenTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.List;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/CookieTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/CookieTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/CookieTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.List;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/EntityTagTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/EntityTagTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/EntityTagTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import javax.ws.rs.core.EntityTag;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/HeaderParameterParserTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/HeaderParameterParserTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/HeaderParameterParserTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.text.ParseException;
import java.util.Map;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/LanguageTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/LanguageTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/LanguageTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.Locale;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/MediaTypeTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/MediaTypeTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/header/MediaTypeTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.header;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.HashMap;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/HeadMethodTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/HeadMethodTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/HeadMethodTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MediaTypeTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MediaTypeTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MediaTypeTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import javax.ws.rs.Consumes;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodExceptionTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodExceptionTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodExceptionTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.UnhandledException;
import javax.ws.rs.GET;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,8 +18,8 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.Filter;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.method.MethodInvokerFilter;
import org.exoplatform.services.rest.resource.GenericMethodResource;
import org.exoplatform.services.rest.resource.ResourceMethodDescriptor;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodReturnTypeTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodReturnTypeTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodReturnTypeTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import java.util.List;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/OptionsMethodTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/OptionsMethodTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/OptionsMethodTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/ParametersInjectionTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/ParametersInjectionTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/ParametersInjectionTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,8 +18,8 @@
*/
package org.exoplatform.services.rest.impl.method;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.Property;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ByteEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ByteEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ByteEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.header.MediaTypeHelper;
import java.io.ByteArrayInputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ContextResolverTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ContextResolverTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ContextResolverTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -26,7 +26,7 @@
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id: $
*/
-public class ContextResolverTest extends org.exoplatform.services.rest.AbstractResourceTest
+public class ContextResolverTest extends org.exoplatform.services.rest.impl.AbstractResourceTest
{
@Provider
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ExceptionMapperTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ExceptionMapperTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ExceptionMapperTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.ContainerResponse;
import javax.ws.rs.GET;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FileEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FileEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FileEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.header.MediaTypeHelper;
import java.io.ByteArrayInputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FormEntityTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FormEntityTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/FormEntityTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -19,7 +19,7 @@
package org.exoplatform.services.rest.impl.provider;
import org.apache.commons.fileupload.FileItem;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import java.io.ByteArrayOutputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/InputStreamEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/InputStreamEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/InputStreamEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,10 +18,10 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
import org.exoplatform.services.rest.generated.Book;
import org.exoplatform.services.rest.generated.MemberPrice;
import org.exoplatform.services.rest.generated.Price;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import java.io.ByteArrayInputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JAXBEntityTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,8 +18,8 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.generated.Book;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.ContainerResponse;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,8 +18,8 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
import org.exoplatform.services.rest.RequestHandler;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import java.io.ByteArrayInputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,8 +18,8 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.generated.Book;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.ContainerResponse;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/OtherEntityTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/OtherEntityTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/OtherEntityTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.ContainerResponse;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import org.exoplatform.services.rest.tools.ByteArrayContainerResponseWriter;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ProviderContextParameterInjectionTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ProviderContextParameterInjectionTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ProviderContextParameterInjectionTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.ContainerResponse;
import org.exoplatform.services.rest.provider.EntityProvider;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ReaderEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ReaderEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/ReaderEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.header.MediaTypeHelper;
import java.io.ByteArrayInputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/SourceEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/SourceEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/SourceEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/StringEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/StringEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/StringEntityProviderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.provider;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AcceptResourceTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AcceptResourceTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AcceptResourceTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.resource;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import javax.ws.rs.Consumes;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/AnnotationInheritanceTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.resource;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ApplicationTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,12 +18,12 @@
*/
package org.exoplatform.services.rest.impl.resource;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.Filter;
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.GenericContainerResponse;
import org.exoplatform.services.rest.RequestFilter;
import org.exoplatform.services.rest.ResponseFilter;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.ContainerResponse;
import org.exoplatform.services.rest.method.MethodInvokerFilter;
import org.exoplatform.services.rest.resource.GenericMethodResource;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ContextParametersInjectionTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ContextParametersInjectionTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ContextParametersInjectionTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,8 +18,8 @@
*/
package org.exoplatform.services.rest.impl.resource;
-import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.InitialProperties;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.MultivaluedMapImpl;
import org.exoplatform.services.rest.impl.header.HeaderHelper;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/MatchedURIsAndResourcesTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/MatchedURIsAndResourcesTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/MatchedURIsAndResourcesTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.resource;
-import org.exoplatform.services.rest.AbstractResourceTest;
+import org.exoplatform.services.rest.impl.AbstractResourceTest;
import org.exoplatform.services.rest.impl.header.HeaderHelper;
import java.util.ArrayList;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,9 +18,9 @@
*/
package org.exoplatform.services.rest.impl.resource;
-import org.exoplatform.services.rest.BaseTest;
import org.exoplatform.services.rest.ConstructorDescriptor;
import org.exoplatform.services.rest.FieldInjector;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.header.MediaTypeHelper;
import org.exoplatform.services.rest.method.MethodParameter;
import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/resource/ResourceDescriptorValidatorTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.resource;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
import org.exoplatform.services.rest.resource.ResourceMethodDescriptor;
import org.exoplatform.services.rest.resource.ResourceMethodMap;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriBuilderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriBuilderTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriBuilderTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.uri;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.net.URI;
import java.util.HashMap;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriComponentTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriComponentTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/uri/UriComponentTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.impl.uri;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.List;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/util/MediaTypeMapTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/util/MediaTypeMapTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/util/MediaTypeMapTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.util;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import java.util.Iterator;
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java 2009-10-13 13:50:24 UTC (rev 274)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/wadl/WadlProcessorTest.java 2009-10-13 16:17:02 UTC (rev 275)
@@ -18,7 +18,7 @@
*/
package org.exoplatform.services.rest.wadl;
-import org.exoplatform.services.rest.BaseTest;
+import org.exoplatform.services.rest.impl.BaseTest;
import org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl;
import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
import org.exoplatform.services.rest.wadl.research.Application;
14 years, 8 months
exo-jcr SVN: r274 - in ws/branches/2.2.x/rest/core/src: main/java/org/exoplatform/services/rest/impl and 7 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-13 09:50:24 -0400 (Tue, 13 Oct 2009)
New Revision: 274
Added:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
Removed:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java
Modified:
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java
ws/branches/2.2.x/rest/core/src/test/java/conf/standalone/test-configuration.xml
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java
ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java
Log:
EXOJCR-185 : do not use container for internal interaction between RequestHandler, RequestDispatcher and ResourceBinder. Simplify the ProviderBinder
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ComponentLifecycleScope.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -21,6 +21,7 @@
/**
* Object scope identifier.
*/
+@Deprecated
public enum ComponentLifecycleScope {
/**
* New instance of object created foe each request.
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ContainerObjectFactory.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -28,7 +28,7 @@
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id: $
*/
-
+@Deprecated
public class ContainerObjectFactory<T extends ObjectModel> implements ObjectFactory<T>
{
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest;
+
+import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public interface ResourceBinder
+{
+ /**
+ * @param resourceClass class of candidate to be root resource
+ * @return true if resource was bound and false if resource was not bound
+ * cause it is not root resource
+ */
+ boolean bind(Class<?> resourceClass);
+
+ /**
+ * Register supplied Object as root resource if it has valid JAX-RS
+ * annotations and no one resource with the same UriPattern already
+ * registered.
+ *
+ * @param resource candidate to be root resource
+ * @return true if resource was bound and false if resource was not bound
+ * cause it is not root resource
+ */
+ boolean bind(Object resource);
+
+ /**
+ * @return all registered root resources
+ */
+ List<ObjectFactory<AbstractResourceDescriptor>> getResources();
+
+ /**
+ * @return number of bound resources
+ */
+ int getSize();
+
+ /**
+ * Remove root resource of supplied class from root resource collection.
+ *
+ * @param clazz root resource class
+ * @return true if resource was unbound false otherwise
+ */
+ boolean unbind(Class<?> clazz);
+
+ boolean unbind(String uriTemplate);
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/ResourceBinder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -0,0 +1,481 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest.impl;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.rest.Filter;
+import org.exoplatform.services.rest.ObjectFactory;
+import org.exoplatform.services.rest.PerRequestObjectFactory;
+import org.exoplatform.services.rest.RequestFilter;
+import org.exoplatform.services.rest.ResourceBinder;
+import org.exoplatform.services.rest.ResponseFilter;
+import org.exoplatform.services.rest.SingletonObjectFactory;
+import org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl;
+import org.exoplatform.services.rest.impl.resource.ResourceDescriptorValidator;
+import org.exoplatform.services.rest.method.MethodInvokerFilter;
+import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
+import org.exoplatform.services.rest.resource.ResourceDescriptorVisitor;
+import org.exoplatform.services.rest.uri.UriPattern;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.ws.rs.Path;
+import javax.ws.rs.core.Application;
+import javax.ws.rs.ext.ContextResolver;
+import javax.ws.rs.ext.ExceptionMapper;
+import javax.ws.rs.ext.MessageBodyReader;
+import javax.ws.rs.ext.MessageBodyWriter;
+import javax.ws.rs.ext.Provider;
+import javax.ws.rs.ext.RuntimeDelegate;
+
+/**
+ * Lookup for root resource eXo container components at startup and
+ * register/unregister resources via specified methods.
+ *
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class BaseResourceBinder implements ResourceBinder
+{
+
+ /**
+ * Logger.
+ */
+ private static final Log LOG = ExoLogger.getLogger("ws.rest.core.ResourceBinder");
+
+ private static final Comparator<ObjectFactory<AbstractResourceDescriptor>> RESOURCE_COMPARATOR =
+ new ResourceComparator();
+
+ /**
+ * Compare two {@link SingletonResourceFactory}.
+ */
+ private static final class ResourceComparator implements Comparator<ObjectFactory<AbstractResourceDescriptor>>
+ {
+ /**
+ * Compare two ResourceClass for order.
+ *
+ * @param o1 first ResourceClass to be compared
+ * @param o2 second ResourceClass to be compared
+ * @return positive , zero or negative dependent of {@link UriPattern}
+ * comparison
+ * @see Comparator#compare(Object, Object)
+ * @see UriPattern
+ * @see UriPattern#URIPATTERN_COMPARATOR
+ */
+ public int compare(ObjectFactory<AbstractResourceDescriptor> o1, ObjectFactory<AbstractResourceDescriptor> o2)
+ {
+ return UriPattern.URIPATTERN_COMPARATOR.compare(o1.getObjectModel().getUriPattern(), o2.getObjectModel()
+ .getUriPattern());
+ }
+ };
+
+ /**
+ * Root resource descriptors.
+ */
+ private final List<ObjectFactory<AbstractResourceDescriptor>> rootResources =
+ new ArrayList<ObjectFactory<AbstractResourceDescriptor>>();
+
+ /**
+ * Validator.
+ */
+ private final ResourceDescriptorVisitor rdv = ResourceDescriptorValidator.getInstance();
+
+ private int size = 0;
+
+ /**
+ * @see RuntimeDelegate
+ */
+ private final RuntimeDelegate rd;
+
+ public BaseResourceBinder()
+ {
+ rd = new RuntimeDelegateImpl();
+ RuntimeDelegate.setInstance(rd);
+ }
+
+ /**
+ * @param containerContext eXo container context
+ * @throws Exception if can't set instance of {@link RuntimeDelegate}
+ */
+ /*
+ @SuppressWarnings("unchecked")
+ public ResourceBinder(ExoContainerContext containerContext) throws Exception
+ {
+ // Initialize RuntimeDelegate instance
+ // This is first component in life cycle what needs.
+ // TODO better solution to initialize RuntimeDelegate
+ rd = new RuntimeDelegateImpl();
+ RuntimeDelegate.setInstance(rd);
+
+ ExoContainer container = containerContext.getContainer();
+
+ // Lookup Applications
+ List<Application> al = container.getComponentInstancesOfType(Application.class);
+ for (Application a : al)
+ {
+ try
+ {
+ addApplication(a);
+ }
+ catch (Exception e)
+ {
+ LOG.error("Failed add JAX-RS application " + a.getClass().getName(), e);
+ }
+ }
+
+ // Lookup all object which implements ResourceContainer interface and
+ // process them to be add as root resources.
+ for (Object resource : container.getComponentInstancesOfType(ResourceContainer.class))
+ {
+ bind(resource);
+ }
+
+ }
+ */
+
+ /**
+ * @param application Application
+ * @see Application
+ */
+ @SuppressWarnings("unchecked")
+ @Deprecated
+ public void addApplication(Application application)
+ {
+ ProviderBinder providers = ProviderBinder.getInstance();
+ for (Object obj : application.getSingletons())
+ {
+ if (obj.getClass().getAnnotation(Provider.class) != null)
+ {
+ // singleton provider
+ if (obj instanceof ContextResolver)
+ {
+ providers.addContextResolver((ContextResolver)obj);
+ }
+ if (obj instanceof ExceptionMapper)
+ {
+ providers.addExceptionMapper((ExceptionMapper)obj);
+ }
+ if (obj instanceof MessageBodyReader)
+ {
+ providers.addMessageBodyReader((MessageBodyReader)obj);
+ }
+ if (obj instanceof MessageBodyWriter)
+ {
+ providers.addMessageBodyWriter((MessageBodyWriter)obj);
+ }
+ }
+ else if (obj.getClass().getAnnotation(Filter.class) != null)
+ {
+ // singleton filter
+ if (obj instanceof MethodInvokerFilter)
+ {
+ providers.addMethodInvokerFilter((MethodInvokerFilter)obj);
+ }
+ if (obj instanceof RequestFilter)
+ {
+ providers.addRequestFilter((RequestFilter)obj);
+ }
+ if (obj instanceof ResponseFilter)
+ {
+ providers.addResponseFilter((ResponseFilter)obj);
+ }
+ }
+ else
+ {
+ bind(obj); // singleton resource
+ }
+ }
+ for (Class clazz : application.getClasses())
+ {
+ if (clazz.getAnnotation(Provider.class) != null)
+ {
+ // per-request provider
+ if (ContextResolver.class.isAssignableFrom(clazz))
+ {
+ providers.addContextResolver(clazz);
+ }
+ if (ExceptionMapper.class.isAssignableFrom(clazz))
+ {
+ providers.addExceptionMapper(clazz);
+ }
+ if (MessageBodyReader.class.isAssignableFrom(clazz))
+ {
+ providers.addMessageBodyReader(clazz);
+ }
+ if (MessageBodyWriter.class.isAssignableFrom(clazz))
+ {
+ providers.addMessageBodyWriter(clazz);
+ }
+ }
+ else if (clazz.getAnnotation(Filter.class) != null)
+ {
+ // per-request filter
+ if (MethodInvokerFilter.class.isAssignableFrom(clazz))
+ {
+ providers.addMethodInvokerFilter(clazz);
+ }
+ if (RequestFilter.class.isAssignableFrom(clazz))
+ {
+ providers.addRequestFilter(clazz);
+ }
+ if (ResponseFilter.class.isAssignableFrom(clazz))
+ {
+ providers.addResponseFilter(clazz);
+ }
+ }
+ else
+ {
+ bind(clazz); // per-request resource
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean bind(final Object resource)
+ {
+ final Path path = resource.getClass().getAnnotation(Path.class);
+
+ AbstractResourceDescriptor descriptor = null;
+ if (path != null)
+ {
+ try
+ {
+ descriptor = new AbstractResourceDescriptorImpl(resource);
+ }
+ catch (Exception e)
+ {
+ String msg = "Unexpected error occurs when process resource class " + resource.getClass().getName();
+ LOG.error(msg, e);
+ return false;
+ }
+ }
+ else
+ {
+ String msg =
+ "Resource class " + resource.getClass().getName() + " it is not root resource. "
+ + "Path annotation javax.ws.rs.Path is not specified for this class.";
+ LOG.warn(msg);
+ return false;
+ }
+
+ // validate AbstractResourceDescriptor
+ try
+ {
+ descriptor.accept(rdv);
+ }
+ catch (Exception e)
+ {
+ LOG.error("Validation of root resource failed. ", e);
+ return false;
+ }
+
+ synchronized (rootResources)
+ {
+ // check does exist other resource with the same URI pattern
+ for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
+ {
+ if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
+ {
+ String msg =
+ "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
+ + exist.getClass().getName() + " with the same pattern "
+ + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
+ LOG.warn(msg);
+ return false;
+ }
+ }
+
+ // Singleton resource
+ ObjectFactory<AbstractResourceDescriptor> res =
+ new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource);
+ rootResources.add(res);
+ Collections.sort(rootResources, RESOURCE_COMPARATOR);
+ LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getTemplate() + " : "
+ + descriptor.getObjectClass());
+ }
+ size++;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean bind(final Class<?> resourceClass)
+ {
+ final Path path = resourceClass.getAnnotation(Path.class);
+
+ AbstractResourceDescriptor descriptor = null;
+ if (path != null)
+ {
+ try
+ {
+ descriptor = new AbstractResourceDescriptorImpl(resourceClass);
+ }
+ catch (Exception e)
+ {
+ String msg = "Unexpected error occurs when process resource class " + resourceClass.getName();
+ LOG.error(msg, e);
+ return false;
+ }
+ }
+ else
+ {
+ String msg =
+ "Resource class " + resourceClass.getName() + " it is not root resource. "
+ + "Path annotation javax.ws.rs.Path is not specified for this class.";
+ LOG.warn(msg);
+ return false;
+ }
+
+ // validate AbstractResourceDescriptor
+ try
+ {
+ descriptor.accept(rdv);
+ }
+ catch (Exception e)
+ {
+ LOG.error("Validation of root resource failed. ", e);
+ return false;
+ }
+
+ synchronized (rootResources)
+ {
+ // check does exist other resource with the same URI pattern
+ for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
+ {
+ AbstractResourceDescriptor existDescriptor = exist.getObjectModel();
+ if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
+ {
+
+ String msg =
+ "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
+ + existDescriptor.getObjectClass().getName() + " with the same pattern "
+ + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
+ LOG.warn(msg);
+ return false;
+ }
+ }
+ // per-request resource
+ ObjectFactory<AbstractResourceDescriptor> res =
+ new PerRequestObjectFactory<AbstractResourceDescriptor>(descriptor);
+ rootResources.add(res);
+ Collections.sort(rootResources, RESOURCE_COMPARATOR);
+ LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getRegex() + " : " + resourceClass);
+ }
+ size++;
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public boolean unbind(Class clazz)
+ {
+ synchronized (rootResources)
+ {
+ Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
+ while (i.hasNext())
+ {
+ ObjectFactory<AbstractResourceDescriptor> res = i.next();
+ Class c = res.getObjectModel().getObjectClass();
+ if (clazz.equals(c))
+ {
+ i.remove();
+ LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate() + " : " + c);
+ size--;
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean unbind(String uriTemplate)
+ {
+ synchronized (rootResources)
+ {
+ Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
+ while (i.hasNext())
+ {
+ ObjectFactory<AbstractResourceDescriptor> res = i.next();
+ String t = res.getObjectModel().getUriPattern().getTemplate();
+ if (t.equals(uriTemplate))
+ {
+ i.remove();
+ LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate());
+ size--;
+ return true;
+ }
+ }
+ return false;
+ }
+ }
+
+ /**
+ * Clear the list of ResourceContainer description.
+ */
+ public void clear()
+ {
+ rootResources.clear();
+ size = 0;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public List<ObjectFactory<AbstractResourceDescriptor>> getResources()
+ {
+ return rootResources;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getSize()
+ {
+ return size;
+ }
+
+ /**
+ * @return all registered root resources
+ */
+ @Deprecated
+ public List<AbstractResourceDescriptor> getRootResources()
+ {
+ List<AbstractResourceDescriptor> l = new ArrayList<AbstractResourceDescriptor>(rootResources.size());
+ synchronized (rootResources)
+ {
+ for (ObjectFactory<AbstractResourceDescriptor> f : rootResources)
+ l.add(f.getObjectModel());
+ }
+ return l;
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/BaseResourceBinder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ProviderBinder.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -20,8 +20,6 @@
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.ComponentLifecycleScope;
-import org.exoplatform.services.rest.ContainerObjectFactory;
import org.exoplatform.services.rest.FilterDescriptor;
import org.exoplatform.services.rest.ObjectFactory;
import org.exoplatform.services.rest.PerRequestObjectFactory;
@@ -120,7 +118,7 @@
*/
void init()
{
- // TODO remove this hard code
+ // Add known Providers, Filters, etc with predefined life cycle.
ByteEntityProvider baep = new ByteEntityProvider();
addMessageBodyReader(baep);
addMessageBodyWriter(baep);
@@ -180,7 +178,7 @@
addMessageBodyReader(MultipartFormDataEntityProvider.class);
// JAXB context
- addContextResolver(JAXBContextResolver.class, null, ComponentLifecycleScope.CONTAINER);
+ addContextResolver(JAXBContextResolver.class);
}
@@ -243,7 +241,10 @@
{
try
{
- addContextResolver(clazz, null, ComponentLifecycleScope.PER_REQUEST);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addContextResolver(new PerRequestObjectFactory<ProviderDescriptor>(descriptor));
}
catch (Exception e)
{
@@ -262,7 +263,10 @@
Class<? extends ContextResolver> clazz = instance.getClass();
try
{
- addContextResolver(clazz, instance, ComponentLifecycleScope.SINGLETON);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addContextResolver(new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance));
}
catch (Exception e)
{
@@ -270,6 +274,47 @@
}
}
+ protected void addContextResolver(ObjectFactory<ProviderDescriptor> contextResolverFactory)
+ {
+ for (Type type : contextResolverFactory.getObjectModel().getObjectClass().getGenericInterfaces())
+ {
+ if (type instanceof ParameterizedType)
+ {
+ ParameterizedType pt = (ParameterizedType)type;
+ if (ContextResolver.class == pt.getRawType())
+ {
+ Type[] atypes = pt.getActualTypeArguments();
+ if (atypes.length > 1)
+ throw new RuntimeException("Unable strong determine actual type argument, more then one type found.");
+
+ Class<?> aclazz = (Class<?>)atypes[0];
+
+ MediaTypeMap<ObjectFactory<ProviderDescriptor>> pm = contextResolvers.get(aclazz);
+
+ if (pm == null)
+ {
+ pm = new MediaTypeMap<ObjectFactory<ProviderDescriptor>>();
+ contextResolvers.put(aclazz, pm);
+ }
+
+ for (MediaType mime : contextResolverFactory.getObjectModel().produces())
+ {
+ if (pm.get(mime) != null)
+ {
+ String msg =
+ "ContextResolver for " + aclazz.getName() + " and media type " + mime + " already registered.";
+ throw new RuntimeException(msg);
+ }
+ else
+ {
+ pm.put(mime, contextResolverFactory);
+ }
+ }
+ }
+ }
+ }
+ }
+
/**
* Add per-request ExceptionMapper.
*
@@ -280,7 +325,7 @@
{
try
{
- addExceptionMapper(clazz, null, ComponentLifecycleScope.PER_REQUEST);
+ addExceptionMapper(new PerRequestObjectFactory(new ProviderDescriptorImpl(clazz)));
}
catch (Exception e)
{
@@ -299,7 +344,7 @@
Class<? extends ExceptionMapper> clazz = instance.getClass();
try
{
- addExceptionMapper(clazz, instance, ComponentLifecycleScope.SINGLETON);
+ addExceptionMapper(new SingletonObjectFactory(new ProviderDescriptorImpl(clazz), instance));
}
catch (Exception e)
{
@@ -307,6 +352,33 @@
}
}
+ @SuppressWarnings("unchecked")
+ protected void addExceptionMapper(ObjectFactory<ProviderDescriptor> exceptionMapperFactory)
+ {
+ for (Type type : exceptionMapperFactory.getObjectModel().getObjectClass().getGenericInterfaces())
+ {
+ if (type instanceof ParameterizedType)
+ {
+ ParameterizedType pt = (ParameterizedType)type;
+ if (ExceptionMapper.class == pt.getRawType())
+ {
+ Type[] atypes = pt.getActualTypeArguments();
+ if (atypes.length > 1)
+ throw new RuntimeException("Unable strong determine actual type argument, more then one type found.");
+ Class<? extends Throwable> exc = (Class<? extends Throwable>)atypes[0];
+
+ if (exceptionMappers.get(exc) != null)
+ {
+ String msg = "ExceptionMapper for exception " + exc + " already registered.";
+ throw new RuntimeException(msg);
+ }
+
+ exceptionMappers.put(exc, exceptionMapperFactory);
+ }
+ }
+ }
+ }
+
/**
* Add per-request MessageBodyReader.
*
@@ -317,7 +389,10 @@
{
try
{
- addMessageBodyReader(clazz, null, ComponentLifecycleScope.PER_REQUEST);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addMessageBodyReader(new PerRequestObjectFactory<ProviderDescriptor>(descriptor));
}
catch (Exception e)
{
@@ -336,7 +411,10 @@
Class<? extends MessageBodyReader> clazz = instance.getClass();
try
{
- addMessageBodyReader(clazz, instance, ComponentLifecycleScope.SINGLETON);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addMessageBodyReader(new SingletonObjectFactory(descriptor, instance));
}
catch (Exception e)
{
@@ -344,6 +422,16 @@
}
}
+ protected void addMessageBodyReader(ObjectFactory<ProviderDescriptor> readerFactory)
+ {
+ // MessageBodyReader is smart component and can determine which type it
+ // supports, see method MessageBodyReader.isReadable. So here does not
+ // check is reader for the same Java and media type already exists.
+ // Let it be under developer's control.
+ for (MediaType mime : readerFactory.getObjectModel().consumes())
+ readProviders.getList(mime).add(readerFactory);
+ }
+
/**
* Add per-request MessageBodyWriter.
*
@@ -354,7 +442,10 @@
{
try
{
- addMessageBodyWriter(clazz, null, ComponentLifecycleScope.PER_REQUEST);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addMessageBodyWriter(new PerRequestObjectFactory<ProviderDescriptor>(descriptor));
}
catch (Exception e)
{
@@ -373,7 +464,10 @@
Class<? extends MessageBodyWriter> clazz = instance.getClass();
try
{
- addMessageBodyWriter(clazz, instance, ComponentLifecycleScope.SINGLETON);
+ ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addMessageBodyWriter(new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance));
}
catch (Exception e)
{
@@ -381,6 +475,17 @@
}
}
+ protected void addMessageBodyWriter(ObjectFactory<ProviderDescriptor> writerFactory)
+ {
+ // MessageBodyWriter is smart component and can determine which type it
+ // supports, see method MessageBodyWriter.isWriteable. So here does not
+ // check is writer for the same Java and media type already exists.
+ // Let it be under developer's control.
+ for (MediaType mime : writerFactory.getObjectModel().produces())
+ writeProviders.getList(mime).add(writerFactory);
+ }
+
+
/**
* Get list of most acceptable writer's media type for specified type.
*
@@ -491,7 +596,10 @@
{
try
{
- addMethodInvokerFilter(clazz, null, ComponentLifecycleScope.PER_REQUEST);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addMethodInvokerFilter(new PerRequestObjectFactory<FilterDescriptor>(descriptor));
}
catch (Exception e)
{
@@ -509,13 +617,21 @@
Class<? extends MethodInvokerFilter> clazz = instance.getClass();
try
{
- addMethodInvokerFilter(clazz, instance, ComponentLifecycleScope.SINGLETON);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addMethodInvokerFilter(new SingletonObjectFactory<FilterDescriptor>(descriptor, instance));
}
catch (Exception e)
{
LOG.error("Failed add RequestFilter " + clazz.getName(), e);
}
}
+
+ protected void addMethodInvokerFilter(ObjectFactory<FilterDescriptor> filterFactory)
+ {
+ invokerFilters.getList(filterFactory.getObjectModel().getUriPattern()).add(filterFactory);
+ }
/**
* Add per-request RequestFilter.
@@ -526,7 +642,10 @@
{
try
{
- addRequestFilter(clazz, null, ComponentLifecycleScope.PER_REQUEST);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addRequestFilter(new PerRequestObjectFactory<FilterDescriptor>(descriptor));
}
catch (Exception e)
{
@@ -544,13 +663,21 @@
Class<? extends RequestFilter> clazz = instance.getClass();
try
{
- addRequestFilter(clazz, instance, ComponentLifecycleScope.SINGLETON);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addRequestFilter(new SingletonObjectFactory<FilterDescriptor>(descriptor, instance));
}
catch (Exception e)
{
LOG.error("Failed add RequestFilter " + clazz.getName(), e);
}
}
+
+ protected void addRequestFilter(ObjectFactory<FilterDescriptor> filterFactory)
+ {
+ requestFilters.getList(filterFactory.getObjectModel().getUriPattern()).add(filterFactory);
+ }
/**
* Add per-request ResponseFilter.
@@ -561,7 +688,10 @@
{
try
{
- addResponseFilter(clazz, null, ComponentLifecycleScope.PER_REQUEST);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addResponseFilter(new PerRequestObjectFactory<FilterDescriptor>(descriptor));
}
catch (Exception e)
{
@@ -579,13 +709,21 @@
Class<? extends ResponseFilter> clazz = instance.getClass();
try
{
- addResponseFilter(clazz, instance, ComponentLifecycleScope.SINGLETON);
+ FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
+ descriptor.accept(rdv);
+
+ addResponseFilter(new SingletonObjectFactory<FilterDescriptor>(descriptor, instance));
}
catch (Exception e)
{
LOG.error("Failed add ResponseFilter " + clazz.getName(), e);
}
}
+
+ protected void addResponseFilter(ObjectFactory<FilterDescriptor> filterFactory)
+ {
+ responseFilters.getList(filterFactory.getObjectModel().getUriPattern()).add(filterFactory);
+ }
/**
* @param path request path
@@ -726,293 +864,4 @@
return null;
}
- /**
- * @param clazz ContextResolver class
- * @param instance ContextResolver instance, may be null if not singleton
- * instance
- * @param scope ComponentLifecycleScope
- */
- @SuppressWarnings("unchecked")
- public void addContextResolver(Class<? extends ContextResolver> clazz, ContextResolver instance,
- ComponentLifecycleScope scope)
- {
- for (Type type : clazz.getGenericInterfaces())
- {
- if (type instanceof ParameterizedType)
- {
- ParameterizedType pt = (ParameterizedType)type;
- if (ContextResolver.class == pt.getRawType())
- {
- Type[] atypes = pt.getActualTypeArguments();
- if (atypes.length > 1)
- throw new RuntimeException("Unable strong determine actual type argument, more then one type found.");
-
- Class<?> aclazz = (Class<?>)atypes[0];
-
- MediaTypeMap<ObjectFactory<ProviderDescriptor>> pm = contextResolvers.get(aclazz);
-
- if (pm == null)
- {
- pm = new MediaTypeMap<ObjectFactory<ProviderDescriptor>>();
- contextResolvers.put(aclazz, pm);
- }
-
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
- descriptor.accept(rdv);
-
- ObjectFactory<ProviderDescriptor> factory = null;
- switch (scope)
- {
- case PER_REQUEST :
- factory = new PerRequestObjectFactory<ProviderDescriptor>(descriptor);
- break;
- case SINGLETON :
- if (instance == null)
- throw new NullPointerException("ContextResolver instance is null.");
- factory = new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance);
- break;
- case CONTAINER :
- factory = new ContainerObjectFactory<ProviderDescriptor>(descriptor);
- break;
- }
-
- for (MediaType mime : factory.getObjectModel().produces())
- {
- if (pm.get(mime) != null)
- {
- String msg =
- "ContextResolver for " + aclazz.getName() + " and media type " + mime + " already registered.";
- throw new RuntimeException(msg);
- }
- else
- {
- pm.put(mime, factory);
- }
- }
- }
- }
- }
- }
-
- /**
- * @param clazz MessageBodyreader class
- * @param instance MessageBodyReader, may be null if not singleton instance
- * @param scope ComponentLifecycleScope
- */
- @SuppressWarnings("unchecked")
- public void addMessageBodyReader(Class<? extends MessageBodyReader> clazz, MessageBodyReader instance,
- ComponentLifecycleScope scope)
- {
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
- descriptor.accept(rdv);
-
- ObjectFactory<ProviderDescriptor> factory = null;
- switch (scope)
- {
- case PER_REQUEST :
- factory = new PerRequestObjectFactory<ProviderDescriptor>(descriptor);
- break;
- case SINGLETON :
- if (instance == null)
- throw new NullPointerException("MessageBodyReader instance is null.");
- factory = new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance);
- break;
- case CONTAINER :
- factory = new ContainerObjectFactory<ProviderDescriptor>(descriptor);
- break;
- }
-
- // MessageBodyReader is smart component and can determine which type it
- // supports, see method MessageBodyReader.isReadable. So here does not
- // check is reader for the same Java and media type already exists.
- // Let it be under developer's control.
- for (MediaType mime : factory.getObjectModel().consumes())
- readProviders.getList(mime).add(factory);
- }
-
- /**
- * @param clazz MessageBodyWriter class
- * @param instance MessageBodyWriter, may be null if not singleton instance
- * @param scope ComponentLifecycleScope
- */
- @SuppressWarnings("unchecked")
- public void addMessageBodyWriter(Class<? extends MessageBodyWriter> clazz, MessageBodyWriter instance,
- ComponentLifecycleScope scope)
- {
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
- descriptor.accept(rdv);
-
- ObjectFactory<ProviderDescriptor> factory = null;
- switch (scope)
- {
- case PER_REQUEST :
- factory = new PerRequestObjectFactory<ProviderDescriptor>(descriptor);
- break;
- case SINGLETON :
- if (instance == null)
- throw new NullPointerException("MessageBodyWriter instance is null.");
- factory = new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance);
- break;
- case CONTAINER :
- factory = new ContainerObjectFactory<ProviderDescriptor>(descriptor);
- break;
- }
-
- // MessageBodyWriter is smart component and can determine which type it
- // supports, see method MessageBodyWriter.isWriteable. So here does not
- // check is writer for the same Java and media type already exists.
- // Let it be under developer's control.
- for (MediaType mime : factory.getObjectModel().produces())
- writeProviders.getList(mime).add(factory);
- }
-
- /**
- * @param clazz ExceptionMapper class
- * @param instance ExceptionMapper instance, may be null if not singleton
- * instance
- * @param scope ComponentLifecycleScope
- */
- @SuppressWarnings("unchecked")
- public void addExceptionMapper(Class<? extends ExceptionMapper> clazz, ExceptionMapper instance,
- ComponentLifecycleScope scope)
- {
- for (Type type : clazz.getGenericInterfaces())
- {
- if (type instanceof ParameterizedType)
- {
- ParameterizedType pt = (ParameterizedType)type;
- if (ExceptionMapper.class == pt.getRawType())
- {
- Type[] atypes = pt.getActualTypeArguments();
- if (atypes.length > 1)
- throw new RuntimeException("Unable strong determine actual type argument, more then one type found.");
- Class<? extends Throwable> exc = (Class<? extends Throwable>)atypes[0];
-
- if (exceptionMappers.get(exc) != null)
- {
- String msg = "ExceptionMapper for exception " + exc + " already registered.";
- throw new RuntimeException(msg);
- }
-
- ProviderDescriptor descriptor = new ProviderDescriptorImpl(clazz);
- descriptor.accept(rdv);
- ObjectFactory<ProviderDescriptor> factory = null;
-
- switch (scope)
- {
- case PER_REQUEST :
- factory = new PerRequestObjectFactory<ProviderDescriptor>(descriptor);
- break;
- case SINGLETON :
- if (instance == null)
- throw new NullPointerException("ExceptionMapper instance is null.");
- factory = new SingletonObjectFactory<ProviderDescriptor>(descriptor, instance);
- break;
- case CONTAINER :
- factory = new ContainerObjectFactory<ProviderDescriptor>(descriptor);
- break;
- }
-
- exceptionMappers.put(exc, factory);
- }
- }
- }
- }
-
- /**
- * @param clazz RequestFilter class
- * @param instance RequestFilter instance, may be null if not singleton
- * instance
- * @param scope ComponentLifecycleScope
- */
- public void addRequestFilter(Class<? extends RequestFilter> clazz, RequestFilter instance,
- ComponentLifecycleScope scope)
- {
-
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
- descriptor.accept(rdv);
-
- ObjectFactory<FilterDescriptor> factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
- switch (scope)
- {
- case PER_REQUEST :
- factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
- break;
- case SINGLETON :
- if (instance == null)
- throw new NullPointerException("RequestFilter instance is null.");
- factory = new SingletonObjectFactory<FilterDescriptor>(descriptor, instance);
- break;
- case CONTAINER :
- factory = new ContainerObjectFactory<FilterDescriptor>(descriptor);
- break;
- }
-
- requestFilters.getList(descriptor.getUriPattern()).add(factory);
- }
-
- /**
- * @param clazz ResponseFilter class
- * @param instance ResponseFilter instance, may be null if not singleton
- * instance
- * @param scope ComponentLifecycleScope
- */
- public void addResponseFilter(Class<? extends ResponseFilter> clazz, ResponseFilter instance,
- ComponentLifecycleScope scope)
- {
-
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
- descriptor.accept(rdv);
-
- ObjectFactory<FilterDescriptor> factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
- switch (scope)
- {
- case PER_REQUEST :
- factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
- break;
- case SINGLETON :
- if (instance == null)
- throw new NullPointerException("ResponseFilter instance is null.");
- factory = new SingletonObjectFactory<FilterDescriptor>(descriptor, instance);
- break;
- case CONTAINER :
- factory = new ContainerObjectFactory<FilterDescriptor>(descriptor);
- break;
- }
-
- responseFilters.getList(descriptor.getUriPattern()).add(factory);
- }
-
- /**
- * @param clazz MethodInvokerFilter class
- * @param instance MethodInvokerFilter instance, may be null if not singleton
- * instance
- * @param scope ComponentLifecycleScope
- */
- public void addMethodInvokerFilter(Class<? extends MethodInvokerFilter> clazz, MethodInvokerFilter instance,
- ComponentLifecycleScope scope)
- {
-
- FilterDescriptor descriptor = new FilterDescriptorImpl(clazz);
- descriptor.accept(rdv);
-
- ObjectFactory<FilterDescriptor> factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
- switch (scope)
- {
- case PER_REQUEST :
- factory = new PerRequestObjectFactory<FilterDescriptor>(descriptor);
- break;
- case SINGLETON :
- if (instance == null)
- throw new NullPointerException("MethodInvokerFilter instance is null.");
- factory = new SingletonObjectFactory<FilterDescriptor>(descriptor, instance);
- break;
- case CONTAINER :
- factory = new ContainerObjectFactory<FilterDescriptor>(descriptor);
- break;
- }
-
- invokerFilters.getList(descriptor.getUriPattern()).add(factory);
- }
-
}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestDispatcher.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -24,6 +24,7 @@
import org.exoplatform.services.rest.GenericContainerRequest;
import org.exoplatform.services.rest.GenericContainerResponse;
import org.exoplatform.services.rest.ObjectFactory;
+import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.SingletonObjectFactory;
import org.exoplatform.services.rest.impl.header.HeaderHelper;
import org.exoplatform.services.rest.impl.header.MediaTypeHelper;
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/RequestHandlerImpl.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -18,23 +18,6 @@
*/
package org.exoplatform.services.rest.impl;
-import java.io.File;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.StreamingOutput;
-import javax.ws.rs.ext.ExceptionMapper;
-
-import org.exoplatform.container.component.ComponentPlugin;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.services.log.ExoLogger;
import org.exoplatform.services.log.Log;
import org.exoplatform.services.rest.ApplicationContext;
@@ -44,18 +27,27 @@
import org.exoplatform.services.rest.ObjectFactory;
import org.exoplatform.services.rest.RequestFilter;
import org.exoplatform.services.rest.RequestHandler;
+import org.exoplatform.services.rest.ResourceBinder;
import org.exoplatform.services.rest.ResponseFilter;
-import org.exoplatform.services.rest.impl.method.MethodInvokerFilterComponentPlugin;
-import org.exoplatform.services.rest.impl.provider.EntityProviderComponentPlugin;
-import org.exoplatform.services.rest.method.MethodInvokerFilter;
-import org.exoplatform.services.rest.provider.EntityProvider;
import org.picocontainer.Startable;
+import java.io.File;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.StreamingOutput;
+import javax.ws.rs.ext.ExceptionMapper;
+
/**
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
* @version $Id: $
*/
-public final class RequestHandlerImpl implements RequestHandler, Startable
+public final class RequestHandlerImpl implements RequestHandler
{
/**
@@ -86,27 +78,22 @@
properties.put(name, value);
}
+ private final ResourceBinder binder;
+
/**
* Constructs new instance of {@link RequestHandler}.
- *
- * @param dispatcher See {@link RequestDispatcher}
- * @param params init parameters
*/
- public RequestHandlerImpl(RequestDispatcher dispatcher, InitParams params)
+ public RequestHandlerImpl()
{
- if (params != null)
- {
- for (Iterator<ValueParam> i = params.getValueParamIterator(); i.hasNext();)
- {
- ValueParam vp = i.next();
- properties.put(vp.getName(), vp.getValue());
- }
- }
-
- this.dispatcher = dispatcher;
-
+ this.binder = new BaseResourceBinder();
+ this.dispatcher = new RequestDispatcher(binder);
}
-
+
+ public ResourceBinder getBinder()
+ {
+ return binder;
+ }
+
// RequestHandler
/**
@@ -271,26 +258,7 @@
}
- // Startable
-
/**
- * {@inheritDoc}
- */
- public void start()
- {
- init();
- }
-
- /**
- * {@inheritDoc}
- */
- public void stop()
- {
- }
-
- //
-
- /**
* Startup initialization.
*/
public void init()
@@ -327,44 +295,4 @@
}
- /**
- * Processing {@link ComponentPlugin} for injection external components.
- *
- * @param plugin See {@link ComponentPlugin}
- */
- @SuppressWarnings("unchecked")
- public void addPlugin(ComponentPlugin plugin)
- {
- // NOTE!!! ProviderBinder should be already initialized by ResourceBinder
- ProviderBinder providers = ProviderBinder.getInstance();
- if (MethodInvokerFilterComponentPlugin.class.isAssignableFrom(plugin.getClass()))
- {
- // add method invoker filter
- for (Class<? extends MethodInvokerFilter> filter : ((MethodInvokerFilterComponentPlugin)plugin).getFilters())
- providers.addMethodInvokerFilter(filter);
- }
- else if (EntityProviderComponentPlugin.class.isAssignableFrom(plugin.getClass()))
- {
- // add external entity providers
- Set<Class<? extends EntityProvider>> eps = ((EntityProviderComponentPlugin)plugin).getEntityProviders();
- for (Class<? extends EntityProvider> ep : eps)
- {
- providers.addMessageBodyReader(ep);
- providers.addMessageBodyWriter(ep);
- }
- }
- else if (RequestFilterComponentPlugin.class.isAssignableFrom(plugin.getClass()))
- {
- Set<Class<? extends RequestFilter>> filters = ((RequestFilterComponentPlugin)plugin).getFilters();
- for (Class<? extends RequestFilter> filter : filters)
- providers.addRequestFilter(filter);
- }
- else if (ResponseFilterComponentPlugin.class.isAssignableFrom(plugin.getClass()))
- {
- Set<Class<? extends ResponseFilter>> filters = ((ResponseFilterComponentPlugin)plugin).getFilters();
- for (Class<? extends ResponseFilter> filter : filters)
- providers.addResponseFilter(filter);
- }
- }
-
}
Deleted: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/ResourceBinder.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -1,484 +0,0 @@
-/*
- * 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.
- */
-package org.exoplatform.services.rest.impl;
-
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
-import org.exoplatform.services.rest.Filter;
-import org.exoplatform.services.rest.ObjectFactory;
-import org.exoplatform.services.rest.PerRequestObjectFactory;
-import org.exoplatform.services.rest.RequestFilter;
-import org.exoplatform.services.rest.ResponseFilter;
-import org.exoplatform.services.rest.SingletonObjectFactory;
-import org.exoplatform.services.rest.impl.resource.AbstractResourceDescriptorImpl;
-import org.exoplatform.services.rest.impl.resource.ResourceDescriptorValidator;
-import org.exoplatform.services.rest.method.MethodInvokerFilter;
-import org.exoplatform.services.rest.resource.AbstractResourceDescriptor;
-import org.exoplatform.services.rest.resource.ResourceContainer;
-import org.exoplatform.services.rest.resource.ResourceDescriptorVisitor;
-import org.exoplatform.services.rest.uri.UriPattern;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.ws.rs.Path;
-import javax.ws.rs.core.Application;
-import javax.ws.rs.ext.ContextResolver;
-import javax.ws.rs.ext.ExceptionMapper;
-import javax.ws.rs.ext.MessageBodyReader;
-import javax.ws.rs.ext.MessageBodyWriter;
-import javax.ws.rs.ext.Provider;
-import javax.ws.rs.ext.RuntimeDelegate;
-
-/**
- * Lookup for root resource eXo container components at startup and
- * register/unregister resources via specified methods.
- *
- * @see AbstractResourceDescriptor
- * @see SingletonResourceFactory
- * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
- * @version $Id: $
- */
-public final class ResourceBinder
-{
-
- /**
- * Logger.
- */
- private static final Log LOG = ExoLogger.getLogger("ws.rest.core.ResourceBinder");
-
- private static final Comparator<ObjectFactory<AbstractResourceDescriptor>> RESOURCE_COMPARATOR =
- new ResourceComparator();
-
- /**
- * Compare two {@link SingletonResourceFactory}.
- */
- private static final class ResourceComparator implements Comparator<ObjectFactory<AbstractResourceDescriptor>>
- {
- /**
- * Compare two ResourceClass for order.
- *
- * @param o1 first ResourceClass to be compared
- * @param o2 second ResourceClass to be compared
- * @return positive , zero or negative dependent of {@link UriPattern}
- * comparison
- * @see Comparator#compare(Object, Object)
- * @see UriPattern
- * @see UriPattern#URIPATTERN_COMPARATOR
- */
- public int compare(ObjectFactory<AbstractResourceDescriptor> o1, ObjectFactory<AbstractResourceDescriptor> o2)
- {
- return UriPattern.URIPATTERN_COMPARATOR.compare(o1.getObjectModel().getUriPattern(), o2.getObjectModel()
- .getUriPattern());
- }
- };
-
- /**
- * Root resource descriptors.
- */
- private final List<ObjectFactory<AbstractResourceDescriptor>> rootResources =
- new ArrayList<ObjectFactory<AbstractResourceDescriptor>>();
-
- /**
- * Validator.
- */
- private final ResourceDescriptorVisitor rdv = ResourceDescriptorValidator.getInstance();
-
- private int size = 0;
-
- /**
- * @see RuntimeDelegate
- */
- private final RuntimeDelegate rd;
-
- /**
- * @param containerContext eXo container context
- * @throws Exception if can't set instance of {@link RuntimeDelegate}
- */
- @SuppressWarnings("unchecked")
- public ResourceBinder(ExoContainerContext containerContext) throws Exception
- {
- // Initialize RuntimeDelegate instance
- // This is first component in life cycle what needs.
- // TODO better solution to initialize RuntimeDelegate
- rd = new RuntimeDelegateImpl();
- RuntimeDelegate.setInstance(rd);
-
- ExoContainer container = containerContext.getContainer();
-
- // Lookup Applications
- List<Application> al = container.getComponentInstancesOfType(Application.class);
- for (Application a : al)
- {
- try
- {
- addApplication(a);
- }
- catch (Exception e)
- {
- LOG.error("Failed add JAX-RS application " + a.getClass().getName(), e);
- }
- }
-
- // Lookup all object which implements ResourceContainer interface and
- // process them to be add as root resources.
- for (Object resource : container.getComponentInstancesOfType(ResourceContainer.class))
- {
- bind(resource);
- }
-
- }
-
- /**
- * @param application Application
- * @see Application
- */
- @SuppressWarnings("unchecked")
- public void addApplication(Application application)
- {
- ProviderBinder providers = ProviderBinder.getInstance();
- for (Object obj : application.getSingletons())
- {
- if (obj.getClass().getAnnotation(Provider.class) != null)
- {
- // singleton provider
- if (obj instanceof ContextResolver)
- {
- providers.addContextResolver((ContextResolver)obj);
- }
- if (obj instanceof ExceptionMapper)
- {
- providers.addExceptionMapper((ExceptionMapper)obj);
- }
- if (obj instanceof MessageBodyReader)
- {
- providers.addMessageBodyReader((MessageBodyReader)obj);
- }
- if (obj instanceof MessageBodyWriter)
- {
- providers.addMessageBodyWriter((MessageBodyWriter)obj);
- }
- }
- else if (obj.getClass().getAnnotation(Filter.class) != null)
- {
- // singleton filter
- if (obj instanceof MethodInvokerFilter)
- {
- providers.addMethodInvokerFilter((MethodInvokerFilter)obj);
- }
- if (obj instanceof RequestFilter)
- {
- providers.addRequestFilter((RequestFilter)obj);
- }
- if (obj instanceof ResponseFilter)
- {
- providers.addResponseFilter((ResponseFilter)obj);
- }
- }
- else
- {
- bind(obj); // singleton resource
- }
- }
- for (Class clazz : application.getClasses())
- {
- if (clazz.getAnnotation(Provider.class) != null)
- {
- // per-request provider
- if (ContextResolver.class.isAssignableFrom(clazz))
- {
- providers.addContextResolver(clazz);
- }
- if (ExceptionMapper.class.isAssignableFrom(clazz))
- {
- providers.addExceptionMapper(clazz);
- }
- if (MessageBodyReader.class.isAssignableFrom(clazz))
- {
- providers.addMessageBodyReader(clazz);
- }
- if (MessageBodyWriter.class.isAssignableFrom(clazz))
- {
- providers.addMessageBodyWriter(clazz);
- }
- }
- else if (clazz.getAnnotation(Filter.class) != null)
- {
- // per-request filter
- if (MethodInvokerFilter.class.isAssignableFrom(clazz))
- {
- providers.addMethodInvokerFilter(clazz);
- }
- if (RequestFilter.class.isAssignableFrom(clazz))
- {
- providers.addRequestFilter(clazz);
- }
- if (ResponseFilter.class.isAssignableFrom(clazz))
- {
- providers.addResponseFilter(clazz);
- }
- }
- else
- {
- bind(clazz); // per-request resource
- }
- }
- }
-
- /**
- * Register supplied Object as root resource if it has valid JAX-RS
- * annotations and no one resource with the same UriPattern already
- * registered.
- *
- * @param resource candidate to be root resource
- * @return true if resource was bound and false if resource was not bound
- * cause it is not root resource
- */
- public boolean bind(final Object resource)
- {
- final Path path = resource.getClass().getAnnotation(Path.class);
-
- AbstractResourceDescriptor descriptor = null;
- if (path != null)
- {
- try
- {
- descriptor = new AbstractResourceDescriptorImpl(resource);
- }
- catch (Exception e)
- {
- String msg = "Unexpected error occurs when process resource class " + resource.getClass().getName();
- LOG.error(msg, e);
- return false;
- }
- }
- else
- {
- String msg =
- "Resource class " + resource.getClass().getName() + " it is not root resource. "
- + "Path annotation javax.ws.rs.Path is not specified for this class.";
- LOG.warn(msg);
- return false;
- }
-
- // validate AbstractResourceDescriptor
- try
- {
- descriptor.accept(rdv);
- }
- catch (Exception e)
- {
- LOG.error("Validation of root resource failed. ", e);
- return false;
- }
-
- synchronized (rootResources)
- {
- // check does exist other resource with the same URI pattern
- for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
- {
- if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
- {
- String msg =
- "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
- + exist.getClass().getName() + " with the same pattern "
- + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
- LOG.warn(msg);
- return false;
- }
- }
-
- // Singleton resource
- ObjectFactory<AbstractResourceDescriptor> res =
- new SingletonObjectFactory<AbstractResourceDescriptor>(descriptor, resource);
- rootResources.add(res);
- Collections.sort(rootResources, RESOURCE_COMPARATOR);
- LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getTemplate() + " : "
- + descriptor.getObjectClass());
- }
- size++;
- return true;
- }
-
- /**
- * @param resourceClass class of candidate to be root resource
- * @return true if resource was bound and false if resource was not bound
- * cause it is not root resource
- */
- public boolean bind(final Class<?> resourceClass)
- {
- final Path path = resourceClass.getAnnotation(Path.class);
-
- AbstractResourceDescriptor descriptor = null;
- if (path != null)
- {
- try
- {
- descriptor = new AbstractResourceDescriptorImpl(resourceClass);
- }
- catch (Exception e)
- {
- String msg = "Unexpected error occurs when process resource class " + resourceClass.getName();
- LOG.error(msg, e);
- return false;
- }
- }
- else
- {
- String msg =
- "Resource class " + resourceClass.getName() + " it is not root resource. "
- + "Path annotation javax.ws.rs.Path is not specified for this class.";
- LOG.warn(msg);
- return false;
- }
-
- // validate AbstractResourceDescriptor
- try
- {
- descriptor.accept(rdv);
- }
- catch (Exception e)
- {
- LOG.error("Validation of root resource failed. ", e);
- return false;
- }
-
- synchronized (rootResources)
- {
- // check does exist other resource with the same URI pattern
- for (ObjectFactory<AbstractResourceDescriptor> exist : rootResources)
- {
- AbstractResourceDescriptor existDescriptor = exist.getObjectModel();
- if (exist.getObjectModel().getUriPattern().equals(descriptor.getUriPattern()))
- {
-
- String msg =
- "Resource class " + descriptor.getObjectClass().getName() + " can't be registered. Resource class "
- + existDescriptor.getObjectClass().getName() + " with the same pattern "
- + exist.getObjectModel().getUriPattern().getTemplate() + " already registered.";
- LOG.warn(msg);
- return false;
- }
- }
- // per-request resource
- ObjectFactory<AbstractResourceDescriptor> res =
- new PerRequestObjectFactory<AbstractResourceDescriptor>(descriptor);
- rootResources.add(res);
- Collections.sort(rootResources, RESOURCE_COMPARATOR);
- LOG.info("Bind new resource " + res.getObjectModel().getUriPattern().getRegex() + " : " + resourceClass);
- }
- size++;
- return true;
- }
-
- /**
- * Remove root resource of supplied class from root resource collection.
- *
- * @param clazz root resource class
- * @return true if resource was unbound false otherwise
- */
- @SuppressWarnings("unchecked")
- public boolean unbind(Class clazz)
- {
- synchronized (rootResources)
- {
- Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
- while (i.hasNext())
- {
- ObjectFactory<AbstractResourceDescriptor> res = i.next();
- Class c = res.getObjectModel().getObjectClass();
- if (clazz.equals(c))
- {
- i.remove();
- LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate() + " : " + c);
- size--;
- return true;
- }
- }
- return false;
- }
- }
-
- public boolean unbind(String uriTemplate)
- {
- synchronized (rootResources)
- {
- Iterator<ObjectFactory<AbstractResourceDescriptor>> i = rootResources.iterator();
- while (i.hasNext())
- {
- ObjectFactory<AbstractResourceDescriptor> res = i.next();
- String t = res.getObjectModel().getUriPattern().getTemplate();
- if (t.equals(uriTemplate))
- {
- i.remove();
- LOG.info("Remove ResourceContainer " + res.getObjectModel().getUriPattern().getTemplate());
- size--;
- return true;
- }
- }
- return false;
- }
- }
-
- /**
- * Clear the list of ResourceContainer description.
- */
- public void clear()
- {
- rootResources.clear();
- size = 0;
- }
-
- /**
- * @return all registered root resources
- */
- public List<ObjectFactory<AbstractResourceDescriptor>> getResources()
- {
- return rootResources;
- }
-
- /**
- * @return number of bound resources
- */
- public int getSize()
- {
- return size;
- }
-
- /**
- * @return all registered root resources
- */
- @Deprecated
- public List<AbstractResourceDescriptor> getRootResources()
- {
- List<AbstractResourceDescriptor> l = new ArrayList<AbstractResourceDescriptor>(rootResources.size());
- synchronized (rootResources)
- {
- for (ObjectFactory<AbstractResourceDescriptor> f : rootResources)
- l.add(f.getObjectModel());
- }
- return l;
- }
-
-}
Modified: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/impl/provider/ProviderDescriptorImpl.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -83,6 +83,7 @@
/**
* @param provider provider instance
*/
+ @Deprecated
public ProviderDescriptorImpl(Object provider)
{
this(provider.getClass(), ComponentLifecycleScope.SINGLETON);
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -0,0 +1,156 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest.servlet;
+
+import org.exoplatform.services.log.ExoLogger;
+import org.exoplatform.services.log.Log;
+import org.exoplatform.services.rest.ContainerResponseWriter;
+import org.exoplatform.services.rest.GenericContainerResponse;
+import org.exoplatform.services.rest.RequestHandler;
+import org.exoplatform.services.rest.impl.ContainerResponse;
+import org.exoplatform.services.rest.impl.EnvironmentContext;
+import org.exoplatform.services.rest.impl.header.HeaderHelper;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.ws.rs.ext.MessageBodyWriter;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class BaseRestServlet extends HttpServlet
+{
+
+ /**
+ * See {@link ContainerResponseWriter}.
+ */
+ class ServletContainerResponseWriter implements ContainerResponseWriter
+ {
+
+ /**
+ * See {@link HttpServletResponse}.
+ */
+ private HttpServletResponse servletResponse;
+
+ /**
+ * @param response HttpServletResponse
+ */
+ ServletContainerResponseWriter(HttpServletResponse response)
+ {
+ this.servletResponse = response;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @SuppressWarnings("unchecked")
+ public void writeBody(GenericContainerResponse response, MessageBodyWriter entityWriter) throws IOException
+ {
+ Object entity = response.getEntity();
+ if (entity != null)
+ {
+ OutputStream out = servletResponse.getOutputStream();
+ entityWriter.writeTo(entity, entity.getClass(), response.getEntityType(), null, response.getContentType(),
+ response.getHttpHeaders(), out);
+ out.flush();
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void writeHeaders(GenericContainerResponse response) throws IOException
+ {
+ if (servletResponse.isCommitted())
+ return;
+
+ servletResponse.setStatus(response.getStatus());
+
+ if (response.getHttpHeaders() != null)
+ {
+ // content-type and content-length should be preset in headers
+ for (Map.Entry<String, List<Object>> e : response.getHttpHeaders().entrySet())
+ {
+ String name = e.getKey();
+ for (Object o : e.getValue())
+ {
+ String value = null;
+ if (o != null && (value = HeaderHelper.getHeaderAsString(o)) != null)
+ servletResponse.addHeader(name, value);
+ }
+ }
+ }
+ }
+ }
+
+ private static final Log LOG = ExoLogger.getLogger(RestServlet.class.getName());
+
+ private RequestHandler requestHandler;
+
+ private ServletConfig servletConfig;
+
+ protected RequestHandler getRequestHandler()
+ {
+ return requestHandler;
+ }
+
+ public void init(ServletConfig servletConfig)
+ {
+ this.servletConfig = servletConfig;
+ requestHandler = (RequestHandler)servletConfig.getServletContext().getAttribute(RequestHandler.class.getName());
+ }
+
+ public void service(HttpServletRequest httpRequest, HttpServletResponse httpResponse) throws IOException,
+ ServletException
+ {
+
+ EnvironmentContext env = new EnvironmentContext();
+ env.put(HttpServletRequest.class, httpRequest);
+ env.put(HttpServletResponse.class, httpResponse);
+ env.put(ServletConfig.class, servletConfig);
+ env.put(ServletContext.class, getServletContext());
+
+ try
+ {
+ EnvironmentContext.setCurrent(env);
+ ServletContainerRequest request = new ServletContainerRequest(httpRequest);
+ ContainerResponse response = new ContainerResponse(new ServletContainerResponseWriter(httpResponse));
+ requestHandler.handleRequest(request, response);
+ }
+ catch (Exception e)
+ {
+ LOG.error(e);
+ throw new ServletException(e);
+ }
+ finally
+ {
+ EnvironmentContext.setCurrent(null);
+ }
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/BaseRestServlet.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java (rev 0)
+++ ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+package org.exoplatform.services.rest.servlet;
+
+import org.exoplatform.services.rest.RequestHandler;
+import org.exoplatform.services.rest.impl.RequestHandlerImpl;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+/**
+ * @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
+ * @version $Id$
+ */
+public class RestInitializedListener implements ServletContextListener
+{
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ }
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ RequestHandler handler = new RequestHandlerImpl();
+ event.getServletContext().setAttribute(RequestHandler.class.getName(), handler);
+ }
+
+}
Property changes on: ws/branches/2.2.x/rest/core/src/main/java/org/exoplatform/services/rest/servlet/RestInitializedListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: ws/branches/2.2.x/rest/core/src/test/java/conf/standalone/test-configuration.xml
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/conf/standalone/test-configuration.xml 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/test/java/conf/standalone/test-configuration.xml 2009-10-13 13:50:24 UTC (rev 274)
@@ -51,7 +51,7 @@
</init-params>
</component>
- <component>
+ <!-- component>
<type>org.exoplatform.services.rest.impl.RequestHandlerImpl</type>
</component>
<component>
@@ -59,7 +59,7 @@
</component>
<component>
<type>org.exoplatform.services.rest.impl.ResourceBinder</type>
- </component>
+ </component -->
<component>
<type>org.exoplatform.services.rest.impl.provider.JAXBContextResolver</type>
</component>
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/BaseTest.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -22,9 +22,9 @@
import org.exoplatform.container.StandaloneContainer;
import org.exoplatform.services.rest.impl.ApplicationContextImpl;
+import org.exoplatform.services.rest.impl.BaseResourceBinder;
import org.exoplatform.services.rest.impl.ProviderBinder;
import org.exoplatform.services.rest.impl.RequestHandlerImpl;
-import org.exoplatform.services.rest.impl.ResourceBinder;
/**
* @author <a href="mailto:andrew00x@gmail.com">Andrey Parfonov</a>
@@ -33,26 +33,31 @@
public abstract class BaseTest extends TestCase
{
- protected StandaloneContainer container;
+// protected StandaloneContainer container;
protected ProviderBinder providers;
- protected ResourceBinder binder;
+ protected BaseResourceBinder binder;
protected RequestHandlerImpl requestHandler;
public void setUp() throws Exception
{
StandaloneContainer.setConfigurationPath("src/test/java/conf/standalone/test-configuration.xml");
- container = StandaloneContainer.getInstance();
- binder = (ResourceBinder)container.getComponentInstanceOfType(ResourceBinder.class);
- requestHandler = (RequestHandlerImpl)container.getComponentInstanceOfType(RequestHandlerImpl.class);
+// container = StandaloneContainer.getInstance();
+
+ requestHandler = new RequestHandlerImpl();
+ requestHandler.init();
+ binder = (BaseResourceBinder)requestHandler.getBinder();
+
+// 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();
// System.out.println("##########################"+providers);
ApplicationContextImpl.setCurrent(new ApplicationContextImpl(null, null, providers));
- binder.clear();
+// binder.clear();
}
public void tearDown() throws Exception
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestDispatcherTest.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -256,7 +256,7 @@
public void testResourceConstructorsContainer() throws Exception
{
- container.registerComponentInstance(TestContainerComponent.class.getName(), new TestContainerComponent());
+// container.registerComponentInstance(TestContainerComponent.class.getName(), new TestContainerComponent());
registry(Resource4.class);
service("GET", "/aaa/bbb", "", null, null);
unregistry(Resource4.class);
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/RequestFilterTest.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -54,18 +54,18 @@
private HttpServletRequest httpRequest;
- private ResourceBinder binder; // exo container component
+// private ResourceBinder binder; // exo container component
- public RequestFilter1(@Context Providers providers, @Context HttpServletRequest httpRequest, ResourceBinder binder)
+ public RequestFilter1(@Context Providers providers, @Context HttpServletRequest httpRequest/*, ResourceBinder binder*/)
{
this.providers = providers;
this.httpRequest = httpRequest;
- this.binder = binder;
+// this.binder = binder;
}
public void doFilter(GenericContainerRequest request)
{
- if (uriInfo != null && httpHeaders != null && providers != null && httpRequest != null && binder != null)
+ if (uriInfo != null && httpHeaders != null && providers != null && httpRequest != null/* && binder != null*/)
request.setMethod("POST");
}
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/ResponseFilterTest.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -54,19 +54,19 @@
private HttpServletRequest httpRequest;
- private ResourceBinder binder; // exo container component
+// private ResourceBinder binder; // exo container component
- public ResponseFilter1(@Context Providers providers, @Context HttpServletRequest httpRequest,
- ResourceBinder binder)
+ public ResponseFilter1(@Context Providers providers, @Context HttpServletRequest httpRequest/*,
+ ResourceBinder binder*/)
{
this.providers = providers;
this.httpRequest = httpRequest;
- this.binder = binder;
+// this.binder = binder;
}
public void doFilter(GenericContainerResponse response)
{
- if (uriInfo != null && httpHeaders != null && providers != null && httpRequest != null && binder != null)
+ if (uriInfo != null && httpHeaders != null && providers != null && httpRequest != null /*&& binder != null*/)
response.setResponse(Response.status(200).entity("to be or not to be").type("text/plain").build());
}
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/method/MethodInvokerFilterTest.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -20,7 +20,6 @@
import org.exoplatform.services.rest.AbstractResourceTest;
import org.exoplatform.services.rest.Filter;
-import org.exoplatform.services.rest.impl.ResourceBinder;
import org.exoplatform.services.rest.method.MethodInvokerFilter;
import org.exoplatform.services.rest.resource.GenericMethodResource;
import org.exoplatform.services.rest.resource.ResourceMethodDescriptor;
@@ -57,18 +56,18 @@
@Context
private HttpServletRequest httpRequest;
- private ResourceBinder binder; // exo container component
+// private ResourceBinder binder; // exo container component
- public MethodInvokerFilter1(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders, ResourceBinder binder)
+ public MethodInvokerFilter1(@Context UriInfo uriInfo, @Context HttpHeaders httpHeaders/*, ResourceBinder binder*/)
{
this.uriInfo = uriInfo;
this.httpHeaders = httpHeaders;
- this.binder = binder;
+// this.binder = binder;
}
public void accept(GenericMethodResource genericMethodResource)
{
- if (uriInfo != null && httpHeaders != null && providers != null && httpRequest != null && binder != null)
+ if (uriInfo != null && httpHeaders != null && providers != null && httpRequest != null/* && binder != null*/)
{
if (genericMethodResource instanceof SubResourceMethodDescriptor)
// not invoke sub-resource method
Modified: ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java
===================================================================
--- ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java 2009-10-13 09:58:47 UTC (rev 273)
+++ ws/branches/2.2.x/rest/core/src/test/java/org/exoplatform/services/rest/impl/provider/JsonEntityProviderTest.java 2009-10-13 13:50:24 UTC (rev 274)
@@ -40,15 +40,15 @@
private static final String DATA = "{\"name\":\"andrew\", \"password\":\"hello\"}";
- private RequestHandler requestHandler;
+// private RequestHandler requestHandler;
private MediaType mediaType;
public void setUp() throws Exception
{
super.setUp();
- requestHandler = (RequestHandler)container.getComponentInstanceOfType(RequestHandler.class);
- assertNotNull(requestHandler);
+// requestHandler = (RequestHandler)container.getComponentInstanceOfType(RequestHandler.class);
+// assertNotNull(requestHandler);
mediaType = new MediaType("application", "json");
}
14 years, 8 months
exo-jcr SVN: r273 - jcr/trunk/component/webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-13 05:58:47 -0400 (Tue, 13 Oct 2009)
New Revision: 273
Modified:
jcr/trunk/component/webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestEncoding.java
Log:
EXOJCR-183 TestEncoding updated to support splitted Encoding header,
Modified: jcr/trunk/component/webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestEncoding.java
===================================================================
--- jcr/trunk/component/webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestEncoding.java 2009-10-13 09:43:21 UTC (rev 272)
+++ jcr/trunk/component/webdav/src/test/java/org/exoplatform/services/jcr/webdav/ext/TestEncoding.java 2009-10-13 09:58:47 UTC (rev 273)
@@ -45,7 +45,7 @@
// UTF-8 content
public static final String UTF_FILE = "/utfFile.txt";
- public static final String UTF_CONTENT_TYPE = "text/plain;charset=UTF-8";
+ public static final String UTF_CONTENT_TYPE = "text/plain";
public static final String UTF_CHARSET = "UTF8";
@@ -54,7 +54,7 @@
// windows-1251 content
public static final String WIN_FILE = "/winFile.txt";
- public static final String WIN_CONTENT_TYPE = "text/plain;charset=windows-1251";
+ public static final String WIN_CONTENT_TYPE = "text/plain";
public static final String WIN_CHARSET = "Cp1251";
@@ -63,7 +63,7 @@
// ISO 8859-5 content
public static final String ISO_FILE = "/isoFile.txt";
- public static final String ISO_CONTENT_TYPE = "text/plain;charset=iso-8859-5";
+ public static final String ISO_CONTENT_TYPE = "text/plain";
public static final String ISO_CHARSET = "ISO-8859-5";
14 years, 8 months
exo-jcr SVN: r272 - in jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav: command and 1 other directory.
by do-not-reply@jboss.org
Author: dkatayev
Date: 2009-10-13 05:43:21 -0400 (Tue, 13 Oct 2009)
New Revision: 272
Modified:
jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java
Log:
EXOJCR-28 auto-version parameter support added.
Modified: jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java
===================================================================
--- jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2009-10-13 07:27:19 UTC (rev 271)
+++ jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/WebDavServiceImpl.java 2009-10-13 09:43:21 UTC (rev 272)
@@ -125,6 +125,11 @@
* Initialization initialization "update-policy"-parameter value.
*/
public static final String INIT_PARAM_UPDATE_POLICY = "update-policy";
+
+ /**
+ * Initialization "auto-version"-parameter value.
+ */
+ public static final String INIT_PARAM_AUTO_VERSION = "auto-version";
/**
* Logger.
@@ -165,6 +170,11 @@
* Update policy.
*/
private String updatePolicyType = "create-version";
+
+ /**
+ * Auto-version default value.
+ */
+ private String autoVersionType = "checkout-checkin";
/**
* The list of allowed methods.
@@ -234,6 +244,13 @@
updatePolicyType = pUpdatePolicy.getValue();
log.info(INIT_PARAM_UPDATE_POLICY + " = " + updatePolicyType);
}
+
+ ValueParam pAutoVersion = params.getValueParam(INIT_PARAM_AUTO_VERSION);
+ if (pAutoVersion != null)
+ {
+ autoVersionType = pAutoVersion.getValue();
+ log.info(INIT_PARAM_AUTO_VERSION + " = " + autoVersionType);
+ }
}
@@ -938,7 +955,7 @@
NodeTypeUtil.checkContentResourceType(nodeType);
return new PutCommand(nullResourceLocks).put(session, path(repoPath), inputStream, fileNodeType,
- contentNodeType, NodeTypeUtil.getMixinTypes(mixinTypes), mimeType, encoding, updatePolicyType, tokens);
+ contentNodeType, NodeTypeUtil.getMixinTypes(mixinTypes), mimeType, encoding, updatePolicyType, autoVersionType, tokens);
}
catch (NoSuchWorkspaceException exc)
Modified: jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java
===================================================================
--- jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java 2009-10-13 07:27:19 UTC (rev 271)
+++ jcr/trunk/component/webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java 2009-10-13 09:43:21 UTC (rev 272)
@@ -74,7 +74,8 @@
* @return the instance of javax.ws.rs.core.Response
*/
public Response put(Session session, String path, InputStream inputStream, String fileNodeType,
- String contentNodeType, List<String> mixins, String mimeType, String encoding, String updatePolicyType, List<String> tokens)
+ String contentNodeType, List<String> mixins, String mimeType, String encoding, String updatePolicyType,
+ String autoVersion, List<String> tokens)
{
try
@@ -103,8 +104,16 @@
if ("add".equals(updatePolicyType))
{
node = session.getRootNode().addNode(TextUtil.relativizePath(path), fileNodeType);
- node.addNode("jcr:content", contentNodeType);
- updateContent(node, inputStream, mimeType, encoding, mixins);
+ if (!node.isNodeType("mix:versionable"))
+ {
+ node.addNode("jcr:content", contentNodeType);
+ updateContent(node, inputStream, mimeType, encoding, mixins);
+ }
+ else
+ {
+ updateVersion(node, inputStream, mimeType, autoVersion, encoding, mixins);
+ }
+
}
else if ("create-version".equals(updatePolicyType))
{
@@ -112,7 +121,14 @@
}
else
{
- updateContent(node, inputStream, mimeType, encoding, mixins);
+ if (!node.isNodeType("mix:versionable"))
+ {
+ updateContent(node, inputStream, mimeType, encoding, mixins);
+ }
+ else
+ {
+ updateVersion(node, inputStream, mimeType, autoVersion, encoding, mixins);
+ }
}
}
@@ -146,8 +162,8 @@
* @param mixins list of mixins
* @throws RepositoryException {@link RepositoryException}
*/
- private void createVersion(Node fileNode, InputStream inputStream, String mimeType, String encoding, List<String> mixins)
- throws RepositoryException
+ private void createVersion(Node fileNode, InputStream inputStream, String mimeType, String encoding,
+ List<String> mixins) throws RepositoryException
{
if (!fileNode.isNodeType("mix:versionable"))
{
@@ -188,7 +204,8 @@
Node content = node.getNode("jcr:content");
content.setProperty("jcr:mimeType", mimeType);
- if (encoding != null) {
+ if (encoding != null)
+ {
content.setProperty("jcr:encoding", encoding);
}
content.setProperty("jcr:lastModified", Calendar.getInstance());
@@ -205,4 +222,36 @@
}
+ /**
+ * Updates the content of the versionable file according to auto-version value.
+ *
+ * @param fileNode Node to update
+ * @param inputStream input stream that contains the content of
+ * file
+ * @param mimeType content type
+ * @param autoVersion auto-version value
+ * @param mixins list of mixins
+ * @throws RepositoryException {@link RepositoryException}
+ */
+ private void updateVersion(Node fileNode, InputStream inputStream, String mimeType, String encoding,
+ String autoVersion, List<String> mixins) throws RepositoryException
+ {
+ if (!fileNode.isCheckedOut())
+ {
+ fileNode.checkout();
+ fileNode.getSession().save();
+ }
+ if ("checkout".equals(autoVersion))
+ {
+ updateContent(fileNode, inputStream, mimeType, encoding, mixins);
+ }
+ else if ("checkout-checkin".equals(autoVersion))
+ {
+ updateContent(fileNode, inputStream, mimeType, encoding, mixins);
+ fileNode.getSession().save();
+ fileNode.checkin();
+ }
+ fileNode.getSession().save();
+ }
+
}
14 years, 8 months
exo-jcr SVN: r271 - jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene.
by do-not-reply@jboss.org
Author: skabashnyuk
Date: 2009-10-13 03:27:19 -0400 (Tue, 13 Oct 2009)
New Revision: 271
Modified:
jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
Log:
EXOJCR-181 : Binary properties could be indexed differently in some cases. Fixed
Modified: jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java
===================================================================
--- jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2009-10-12 20:33:46 UTC (rev 270)
+++ jcr/trunk/component/core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java 2009-10-13 07:27:19 UTC (rev 271)
@@ -205,14 +205,7 @@
else
{
addParentChildRelation(doc, node.getParentIdentifier());
- // } else {
- // shareable node
- // for (Iterator it = node.getSharedSet().iterator(); it.hasNext(); ) {
- // addParentChildRelation(doc, (NodeId) it.next());
- // }
- // mark shareable nodes
- // doc.add(new Field(FieldNames.SHAREABLE_NODE, "",
- // Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
+
}
}
catch (NamespaceException e)
@@ -356,7 +349,9 @@
InputStream is = null;
try
{
- doc.add(createFulltextField(dreader.getContentAsText(is = pvd.getAsStream())));
+ is = pvd.getAsStream();
+ Reader reader = new StringReader(dreader.getContentAsText(is));
+ doc.add(createFulltextField(reader));
}
finally
{
14 years, 8 months
exo-jcr SVN: r270 - in ws/branches: 2.2.x and 7 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-12 16:33:46 -0400 (Mon, 12 Oct 2009)
New Revision: 270
Added:
ws/branches/2.2.x/
Modified:
ws/branches/2.2.x/commons/pom.xml
ws/branches/2.2.x/frameworks/json/pom.xml
ws/branches/2.2.x/frameworks/servlet/pom.xml
ws/branches/2.2.x/packaging/module/pom.xml
ws/branches/2.2.x/pom.xml
ws/branches/2.2.x/rest/core/pom.xml
ws/branches/2.2.x/rest/ext/pom.xml
ws/branches/2.2.x/testframework/pom.xml
Log:
Added new branch
Copied: ws/branches/2.2.x (from rev 269, ws/trunk)
Modified: ws/branches/2.2.x/commons/pom.xml
===================================================================
--- ws/trunk/commons/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/commons/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.commons</artifactId>
Modified: ws/branches/2.2.x/frameworks/json/pom.xml
===================================================================
--- ws/trunk/frameworks/json/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/frameworks/json/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.frameworks.json</artifactId>
Modified: ws/branches/2.2.x/frameworks/servlet/pom.xml
===================================================================
--- ws/trunk/frameworks/servlet/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/frameworks/servlet/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.frameworks.servlet</artifactId>
Modified: ws/branches/2.2.x/packaging/module/pom.xml
===================================================================
--- ws/trunk/packaging/module/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/packaging/module/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: ws/branches/2.2.x/pom.xml
===================================================================
--- ws/trunk/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -30,7 +30,7 @@
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>eXo WS</name>
Modified: ws/branches/2.2.x/rest/core/pom.xml
===================================================================
--- ws/trunk/rest/core/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/rest/core/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.rest.core</artifactId>
Modified: ws/branches/2.2.x/rest/ext/pom.xml
===================================================================
--- ws/trunk/rest/ext/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/rest/ext/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.rest.ext</artifactId>
Modified: ws/branches/2.2.x/testframework/pom.xml
===================================================================
--- ws/trunk/testframework/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
+++ ws/branches/2.2.x/testframework/pom.xml 2009-10-12 20:33:46 UTC (rev 270)
@@ -25,7 +25,7 @@
<parent>
<groupId>org.exoplatform.ws</groupId>
<artifactId>ws-parent</artifactId>
- <version>2.1.0-Beta03-SNAPSHOT</version>
+ <version>2.2.0-SNAPSHOT</version>
</parent>
<artifactId>exo.ws.testframework</artifactId>
14 years, 8 months
exo-jcr SVN: r269 - in ws/trunk: commons and 6 other directories.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-12 12:06:15 -0400 (Mon, 12 Oct 2009)
New Revision: 269
Modified:
ws/trunk/commons/pom.xml
ws/trunk/frameworks/json/pom.xml
ws/trunk/frameworks/servlet/pom.xml
ws/trunk/packaging/module/pom.xml
ws/trunk/pom.xml
ws/trunk/rest/core/pom.xml
ws/trunk/rest/ext/pom.xml
ws/trunk/testframework/pom.xml
Log:
resore poms after using maven release plugin
Modified: ws/trunk/commons/pom.xml
===================================================================
--- ws/trunk/commons/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/commons/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,49 +1,49 @@
-<!--
-
- 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>
-
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- </parent>
-
- <artifactId>exo.ws.commons</artifactId>
-
- <name>eXo WS :: Commons Utils</name>
-
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.stream</groupId>
- <artifactId>sjsxp</artifactId>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- </dependency>
- </dependencies>
-</project>
+<!--
+
+ 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>
+
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>exo.ws.commons</artifactId>
+
+ <name>eXo WS :: Commons Utils</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.stream</groupId>
+ <artifactId>sjsxp</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Modified: ws/trunk/frameworks/json/pom.xml
===================================================================
--- ws/trunk/frameworks/json/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/frameworks/json/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,54 +1,54 @@
-<!--
-
- 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>
-
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- </parent>
-
- <artifactId>exo.ws.frameworks.json</artifactId>
-
- <name>eXo WS :: Framework :: JSON</name>
- <description>eXo Java Bean to JSON Transformation</description>
-
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <testResources>
- <testResource>
- <directory>src/test/resources</directory>
- <includes>
- <include>**/*.json</include>
- <include>**/*.txt</include>
- </includes>
- </testResource>
- </testResources>
- </build>
-</project>
+<!--
+
+ 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>
+
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>exo.ws.frameworks.json</artifactId>
+
+ <name>eXo WS :: Framework :: JSON</name>
+ <description>eXo Java Bean to JSON Transformation</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.json</include>
+ <include>**/*.txt</include>
+ </includes>
+ </testResource>
+ </testResources>
+ </build>
+</project>
Modified: ws/trunk/frameworks/servlet/pom.xml
===================================================================
--- ws/trunk/frameworks/servlet/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/frameworks/servlet/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,41 +1,41 @@
-<!--
-
- 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>
-
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- </parent>
-
- <artifactId>exo.ws.frameworks.servlet</artifactId>
-
- <name>eXo WS :: Framework :: Servlet</name>
-
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- </dependency>
- </dependencies>
-</project>
+<!--
+
+ 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>
+
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>exo.ws.frameworks.servlet</artifactId>
+
+ <name>eXo WS :: Framework :: Servlet</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Modified: ws/trunk/packaging/module/pom.xml
===================================================================
--- ws/trunk/packaging/module/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/packaging/module/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,66 +1,66 @@
- <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">
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- </parent>
-
- <modelVersion>4.0.0</modelVersion>
- <artifactId>ws.packaging.module</artifactId>
- <packaging>pom</packaging>
- <name>eXo WS Build module</name>
-
- <properties>
- <exobuild.name>ws</exobuild.name>
- <exobuild.type>module</exobuild.type>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare</id>
- <phase>package</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
- <outputDirectory>target</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/javascript</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>1.3</version>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>target/${exobuild.name}.packaging.${exobuild.type}.js</file>
- <type>js</type>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+ <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">
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>ws.packaging.module</artifactId>
+ <packaging>pom</packaging>
+ <name>eXo WS Build module</name>
+
+ <properties>
+ <exobuild.name>ws</exobuild.name>
+ <exobuild.type>module</exobuild.type>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>prepare</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-resources</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>target</outputDirectory>
+ <resources>
+ <resource>
+ <directory>src/main/javascript</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/${exobuild.name}.packaging.${exobuild.type}.js</file>
+ <type>js</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Modified: ws/trunk/pom.xml
===================================================================
--- ws/trunk/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,205 +1,205 @@
-<!--
-
- 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>
-
- <parent>
- <groupId>org.exoplatform</groupId>
- <artifactId>foundation-parent</artifactId>
- <version>2</version>
- </parent>
-
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- <packaging>pom</packaging>
-
- <name>eXo WS</name>
-
- <scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/branches/2.2.x</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/branches/2.2.x</developerConnection>
- <url>http://fisheye.jboss.org/browse/exo-jcr/ws/branches/2.2.x</url>
- </scm>
-
- <properties>
- <exo.product.name>exo-ws</exo.product.name>
- <exo.product.specification>2.1</exo.product.specification>
-
- <org.exoplatform.kernel.version>2.2.0-Beta02</org.exoplatform.kernel.version>
- <org.exoplatform.core.version>2.3.0-Beta02</org.exoplatform.core.version>
-
- <exo.test.includes>*Test*</exo.test.includes>
- </properties>
-
- <modules>
- <module>commons</module>
- <module>frameworks/json</module>
- <module>frameworks/servlet</module>
- <module>testframework</module>
- <module>rest/core</module>
- <module>rest/ext</module>
- <module>packaging/module</module>
- </modules>
-
- <dependencyManagement>
- <dependencies>
- <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.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>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.testframework</artifactId>
- <version>${project.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>com.sun.xml.stream</groupId>
- <artifactId>sjsxp</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- <version>2.1.7</version>
- </dependency>
- <dependency>
- <groupId>stax</groupId>
- <artifactId>stax-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <version>0.4</version>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <!-- <version>1.2.1</version>-->
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3.2</version>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- <version>1.0</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.xsl</include>
- <include>**/*.xsd</include>
- <include>**/*.properties</include>
- <include>**/*.ion</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- <include>**/*.groovy</include>
- </includes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- <includes>
- <include>**/*.xml</include>
- <include>**/*.xsl</include>
- <include>**/*.xsd</include>
- <include>**/*.properties</include>
- <include>**/login.conf</include>
- <include>**/*.ion</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- <include>**/*.groovy</include>
- </includes>
- </resource>
- </resources>
- <testResources>
- <testResource>
- <directory>src/test/java</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.xsl</include>
- <include>**/*.xsd</include>
- <include>**/*.txt</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- <include>**/*.groovy</include>
- </includes>
- </testResource>
- <testResource>
- <directory>src/test/resources</directory>
- <includes>
- <include>**/*.properties</include>
- <include>**/*.xml</include>
- <include>**/*.xsl</include>
- <include>**/*.xsd</include>
- <include>**/*.txt</include>
- <include>**/*.conf</include>
- <include>**/*.config</include>
- <include>**/*.groovy</include>
- </includes>
- </testResource>
- </testResources>
- </build>
-</project>
+<!--
+
+ 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>
+
+ <parent>
+ <groupId>org.exoplatform</groupId>
+ <artifactId>foundation-parent</artifactId>
+ <version>2</version>
+ </parent>
+
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>eXo WS</name>
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/exo-jcr/ws/trunk</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/exo-jcr/ws/trunk</developerConnection>
+ <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.2.0-Beta02</org.exoplatform.kernel.version>
+ <org.exoplatform.core.version>2.3.0-Beta02</org.exoplatform.core.version>
+
+ <exo.test.includes>*Test*</exo.test.includes>
+ </properties>
+
+ <modules>
+ <module>commons</module>
+ <module>frameworks/json</module>
+ <module>frameworks/servlet</module>
+ <module>testframework</module>
+ <module>rest/core</module>
+ <module>rest/ext</module>
+ <module>packaging/module</module>
+ </modules>
+
+ <dependencyManagement>
+ <dependencies>
+ <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.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>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.testframework</artifactId>
+ <version>${project.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>com.sun.xml.stream</groupId>
+ <artifactId>sjsxp</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ <version>2.1.7</version>
+ </dependency>
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ <version>2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <version>0.4</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <!-- <version>1.2.1</version>-->
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3.2</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.xsl</include>
+ <include>**/*.xsd</include>
+ <include>**/*.properties</include>
+ <include>**/*.ion</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ <include>**/*.groovy</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ <include>**/*.xsl</include>
+ <include>**/*.xsd</include>
+ <include>**/*.properties</include>
+ <include>**/login.conf</include>
+ <include>**/*.ion</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ <include>**/*.groovy</include>
+ </includes>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>src/test/java</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ <include>**/*.xsl</include>
+ <include>**/*.xsd</include>
+ <include>**/*.txt</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ <include>**/*.groovy</include>
+ </includes>
+ </testResource>
+ <testResource>
+ <directory>src/test/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ <include>**/*.xsl</include>
+ <include>**/*.xsd</include>
+ <include>**/*.txt</include>
+ <include>**/*.conf</include>
+ <include>**/*.config</include>
+ <include>**/*.groovy</include>
+ </includes>
+ </testResource>
+ </testResources>
+ </build>
+</project>
Modified: ws/trunk/rest/core/pom.xml
===================================================================
--- ws/trunk/rest/core/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/rest/core/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,151 +1,151 @@
-<!--
-
- 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>
-
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- </parent>
-
- <artifactId>exo.ws.rest.core</artifactId>
-
- <name>eXo WS :: REST :: Core</name>
-
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.kernel</groupId>
- <artifactId>exo.kernel.component.common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.core</groupId>
- <artifactId>exo.core.component.xml-processing</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.frameworks.json</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.testframework</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.xml.bind</groupId>
- <artifactId>jaxb-api</artifactId>
- </dependency>
- <dependency>
- <groupId>com.sun.xml.bind</groupId>
- <artifactId>jaxb-impl</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>javax.ws.rs</groupId>
- <artifactId>jsr311-api</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.jvnet.jaxb2.maven2</groupId>
- <artifactId>maven-jaxb2-plugin</artifactId>
- <executions>
- <execution>
- <id>generate wadl classes</id>
- <goals>
- <goal>generate</goal>
- </goals>
- <phase>generate-sources</phase>
- <configuration>
- <schemaDirectory>src/main/resources</schemaDirectory>
- <catalog>src/main/resources/catalog.xml</catalog>
- <generateDirectory>target/generated-sources</generateDirectory>
- <generatePackage>org.exoplatform.services.rest.wadl.research</generatePackage>
- <args>
- <arg>-extension</arg>
- </args>
- <schemaIncludes>
- <include>wadl.xsd</include>
- </schemaIncludes>
- </configuration>
- </execution>
- <execution>
- <id>generate classes for test</id>
- <goals>
- <goal>generate</goal>
- </goals>
- <phase>generate-test-sources</phase>
- <configuration>
- <schemaDirectory>src/test/resources</schemaDirectory>
- <catalog>src/main/resources/catalog.xml</catalog>
- <generateDirectory>target/generated-test-sources</generateDirectory>
- <generatePackage>org.exoplatform.services.rest.generated</generatePackage>
- <args>
- <arg>-extension</arg>
- </args>
- <schemaIncludes>
- <include>book.xsd</include>
- </schemaIncludes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>0</id>
- <goals>
- <goal>run</goal>
- </goals>
- <phase>generate-test-sources</phase>
- <configuration>
- <tasks>
- <echo>copy files gnerated by JAXB to test source directory</echo>
- <copy todir="src/test/java">
- <fileset dir="target/generated-test-sources">
- <include name="org/**" />
- </fileset>
- </copy>
- </tasks>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
+<!--
+
+ 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>
+
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>exo.ws.rest.core</artifactId>
+
+ <name>eXo WS :: REST :: Core</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.kernel</groupId>
+ <artifactId>exo.kernel.component.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.core</groupId>
+ <artifactId>exo.core.component.xml-processing</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.frameworks.json</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.testframework</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>jsr311-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.jaxb2.maven2</groupId>
+ <artifactId>maven-jaxb2-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate wadl classes</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <phase>generate-sources</phase>
+ <configuration>
+ <schemaDirectory>src/main/resources</schemaDirectory>
+ <catalog>src/main/resources/catalog.xml</catalog>
+ <generateDirectory>target/generated-sources</generateDirectory>
+ <generatePackage>org.exoplatform.services.rest.wadl.research</generatePackage>
+ <args>
+ <arg>-extension</arg>
+ </args>
+ <schemaIncludes>
+ <include>wadl.xsd</include>
+ </schemaIncludes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>generate classes for test</id>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ <phase>generate-test-sources</phase>
+ <configuration>
+ <schemaDirectory>src/test/resources</schemaDirectory>
+ <catalog>src/main/resources/catalog.xml</catalog>
+ <generateDirectory>target/generated-test-sources</generateDirectory>
+ <generatePackage>org.exoplatform.services.rest.generated</generatePackage>
+ <args>
+ <arg>-extension</arg>
+ </args>
+ <schemaIncludes>
+ <include>book.xsd</include>
+ </schemaIncludes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>0</id>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <phase>generate-test-sources</phase>
+ <configuration>
+ <tasks>
+ <echo>copy files gnerated by JAXB to test source directory</echo>
+ <copy todir="src/test/java">
+ <fileset dir="target/generated-test-sources">
+ <include name="org/**" />
+ </fileset>
+ </copy>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Modified: ws/trunk/rest/ext/pom.xml
===================================================================
--- ws/trunk/rest/ext/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/rest/ext/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,49 +1,49 @@
-<!--
-
- 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>
-
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- </parent>
-
- <artifactId>exo.ws.rest.ext</artifactId>
-
- <name>eXo WS :: REST :: Extentions</name>
-
- <dependencies>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.commons</artifactId>
- </dependency>
- <dependency>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>exo.ws.rest.core</artifactId>
- </dependency>
- <dependency>
- <groupId>javax.annotation</groupId>
- <artifactId>jsr250-api</artifactId>
- </dependency>
- </dependencies>
-</project>
+<!--
+
+ 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>
+
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>exo.ws.rest.ext</artifactId>
+
+ <name>eXo WS :: REST :: Extentions</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.commons</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>exo.ws.rest.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Modified: ws/trunk/testframework/pom.xml
===================================================================
--- ws/trunk/testframework/pom.xml 2009-10-12 15:50:57 UTC (rev 268)
+++ ws/trunk/testframework/pom.xml 2009-10-12 16:06:15 UTC (rev 269)
@@ -1,43 +1,43 @@
-<!--
-
- 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>
-
- <parent>
- <groupId>org.exoplatform.ws</groupId>
- <artifactId>ws-parent</artifactId>
- <version>2.2.x-SNAPSHOT</version>
- </parent>
-
- <artifactId>exo.ws.testframework</artifactId>
-
- <name>eXo WS :: HTTP :: testframework</name>
-
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.3</version>
- <scope>compile</scope>
- </dependency>
- </dependencies>
+<!--
+
+ 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>
+
+ <parent>
+ <groupId>org.exoplatform.ws</groupId>
+ <artifactId>ws-parent</artifactId>
+ <version>2.1.0-Beta03-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>exo.ws.testframework</artifactId>
+
+ <name>eXo WS :: HTTP :: testframework</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
</project>
\ No newline at end of file
14 years, 8 months
exo-jcr SVN: r268 - ws.
by do-not-reply@jboss.org
Author: aparfonov
Date: 2009-10-12 11:50:57 -0400 (Mon, 12 Oct 2009)
New Revision: 268
Added:
ws/branches/
Log:
create folder for branches
14 years, 8 months