You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@oodt.apache.org by ma...@apache.org on 2010/07/29 09:27:02 UTC

svn commit: r980344 - in /incubator/oodt/trunk: ./ curator/ curator/src/main/java/org/apache/oodt/cas/curation/service/ curator/src/main/webapp/WEB-INF/

Author: mattmann
Date: Thu Jul 29 07:27:01 2010
New Revision: 980344

URL: http://svn.apache.org/viewvc?rev=980344&view=rev
Log:
- fix for OODT-21 Remove jersey dependency from curator and replace with Apache CXF

Modified:
    incubator/oodt/trunk/CHANGES.txt
    incubator/oodt/trunk/curator/pom.xml
    incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationService.java
    incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java
    incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java
    incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java
    incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
    incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java
    incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/SystemResource.java
    incubator/oodt/trunk/curator/src/main/webapp/WEB-INF/web.xml

Modified: incubator/oodt/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/CHANGES.txt?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/CHANGES.txt (original)
+++ incubator/oodt/trunk/CHANGES.txt Thu Jul 29 07:27:01 2010
@@ -5,6 +5,8 @@ Apache OODT Change Log
 Release 0.1-incubating - Current Development
 --------------------------------------------
 
+* OODT-21 Remove jersey dependency from curator and replace with Apache CXF (mattmann)
+
 * OODT-18 Convert curator to use Apache commons rather than jTidy (mattmann)
 
 * OODT-16 - Remove JPL look+feel and web references, as well as dependency on private JPL M2 

Modified: incubator/oodt/trunk/curator/pom.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/pom.xml?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/pom.xml (original)
+++ incubator/oodt/trunk/curator/pom.xml Thu Jul 29 07:27:01 2010
@@ -109,11 +109,12 @@ the License.
       <version>2.3</version>
       <classifier>jdk15</classifier>
     </dependency>
-    <dependency>
-      <groupId>com.sun.jersey</groupId>
-      <artifactId>jersey-server</artifactId>
-      <version>1.1.2-ea</version>
-    </dependency>
+   <dependency>
+      <groupId>org.apache.cxf</groupId>
+      <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+      <!-- 2.2.x where x in the 0-7 range or 2.3-SNAPSHOT-->
+      <version>2.2.7</version>
+   </dependency>
   </dependencies>
 
 </project>

Modified: incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationService.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationService.java?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationService.java (original)
+++ incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationService.java Thu Jul 29 07:27:01 2010
@@ -21,18 +21,10 @@ package org.apache.oodt.cas.curation.ser
 //OODT imports
 import org.apache.oodt.cas.curation.servlet.CuratorConfMetKeys;
 import org.apache.oodt.cas.curation.util.SSOUtils;
-import org.apache.oodt.cas.filemgr.catalog.Catalog;
-import org.apache.oodt.cas.filemgr.structs.Product;
-import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
-import org.apache.oodt.cas.metadata.Metadata;
-import org.apache.oodt.cas.metadata.SerializableMetadata;
 import org.apache.oodt.security.sso.SingleSignOn;
 
 //JDK imports
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.io.UnsupportedEncodingException;
@@ -41,8 +33,6 @@ import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -54,7 +44,6 @@ import javax.ws.rs.core.UriInfo;
 //JAX-RS imports
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
-import net.sf.json.JSONSerializer;
 
 //APACHE imports
 import org.apache.commons.lang.StringUtils;

Modified: incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java (original)
+++ incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/CurationServiceConfig.java Thu Jul 29 07:27:01 2010
@@ -21,19 +21,16 @@ package org.apache.oodt.cas.curation.ser
 //OODT imports
 import org.apache.oodt.cas.curation.servlet.CuratorConfMetKeys;
 import org.apache.oodt.cas.filemgr.datatransfer.DataTransferFactory;
-import org.apache.oodt.cas.filemgr.structs.exceptions.ConnectionException;
 import org.apache.oodt.cas.filemgr.system.XmlRpcFileManagerClient;
 import org.apache.oodt.cas.metadata.util.PathUtils;
 
 //JDK imports
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 

Modified: incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java (original)
+++ incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/DirectoryResource.java Thu Jul 29 07:27:01 2010
@@ -18,11 +18,12 @@
 
 package org.apache.oodt.cas.curation.service;
 
-//JAX-RS imports
+//JDK imports
 import java.io.File;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+//JAX-RS imports
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
@@ -31,10 +32,9 @@ import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
 
-import com.sun.jersey.spi.resource.Singleton;
+
 
 @Path("directory")
-@Singleton
 /**
  * 
  * A web service endpoint to a service providing views of the staging area, the

Modified: incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java (original)
+++ incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/IngestionResource.java Thu Jul 29 07:27:01 2010
@@ -50,7 +50,6 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
-import com.sun.jersey.spi.resource.Singleton;
 
 //JSON imports
 import net.sf.json.JSONObject;
@@ -65,7 +64,6 @@ import net.sf.json.JSONObject;
  * 
  */
 @Path("ingest")
-@Singleton
 public class IngestionResource extends CurationService {
 
   private static final long serialVersionUID = -7514150767897700936L;

Modified: incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java (original)
+++ incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/MetadataResource.java Thu Jul 29 07:27:01 2010
@@ -19,11 +19,9 @@
 package org.apache.oodt.cas.curation.service;
 
 //OODT imports
-import org.apache.oodt.cas.curation.policymgr.CurationPolicyManager;
 import org.apache.oodt.cas.curation.structs.ExtractorConfig;
 import org.apache.oodt.cas.curation.util.CurationXmlStructFactory;
 import org.apache.oodt.cas.curation.util.ExtractorConfigReader;
-import org.apache.oodt.cas.curation.util.HTMLEncode;
 import org.apache.oodt.cas.filemgr.catalog.Catalog;
 import org.apache.oodt.cas.filemgr.repository.XMLRepositoryManager;
 import org.apache.oodt.cas.filemgr.structs.Product;
@@ -32,14 +30,13 @@ import org.apache.oodt.cas.filemgr.struc
 import org.apache.oodt.cas.filemgr.structs.exceptions.CatalogException;
 import org.apache.oodt.cas.filemgr.structs.exceptions.RepositoryManagerException;
 import org.apache.oodt.cas.filemgr.util.GenericFileManagerObjectFactory;
-import org.apache.oodt.cas.filemgr.util.XmlStructFactory;
 import org.apache.oodt.cas.metadata.MetExtractor;
 import org.apache.oodt.cas.metadata.Metadata;
 import org.apache.oodt.cas.metadata.SerializableMetadata;
 import org.apache.oodt.cas.metadata.exceptions.MetExtractionException;
 import org.apache.oodt.cas.metadata.util.GenericMetadataObjectFactory;
-import org.apache.oodt.cas.metadata.util.PathUtils;
 
+//JDK imports
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -47,19 +44,14 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.util.Arrays;
-import java.util.Enumeration;
 import java.util.List;
-import java.util.Map;
-import java.util.Properties;
 import java.util.Set;
 import java.util.Iterator;
-import java.util.logging.Level;
-
 import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+//JAX-RS imports
 import javax.ws.rs.DefaultValue;
 import javax.ws.rs.FormParam;
 import javax.ws.rs.GET;
@@ -72,6 +64,7 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriInfo;
 import javax.ws.rs.Consumes;
 
+//JSON imports
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
 import net.sf.json.JSONSerializer;

Modified: incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java (original)
+++ incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/PolicyResource.java Thu Jul 29 07:27:01 2010
@@ -19,7 +19,7 @@
 package org.apache.oodt.cas.curation.service;
 
 //OODT imports
-import org.apache.oodt.cas.curation.util.HTMLEncode;
+import org.apache.commons.lang.StringEscapeUtils;
 import org.apache.oodt.cas.filemgr.repository.XMLRepositoryManager;
 import org.apache.oodt.cas.filemgr.structs.Product;
 import org.apache.oodt.cas.filemgr.structs.ProductPage;
@@ -51,13 +51,11 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.QueryParam;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
-import com.sun.jersey.spi.resource.Singleton;
 
 //JSON imports
 import net.sf.json.JSONObject;
 
 @Path("policy")
-@Singleton
 public class PolicyResource extends CurationService {
 
   @Context
@@ -216,9 +214,9 @@ public class PolicyResource extends Cura
     out.append("<ul class=\"fileTree\" >");
     for (String policy : policyDirs) {
       out.append("<li class=\"directory collapsed\"><a href=\"#\" rel=\"/");
-      out.append(HTMLEncode.encode(policy));
+      out.append(StringEscapeUtils.escapeHtml(policy));
       out.append("/\">");
-      out.append(HTMLEncode.encode(policy));
+      out.append(StringEscapeUtils.escapeHtml(policy));
       out.append("</a></li>");
     }
     out.append("</ul>");
@@ -242,11 +240,11 @@ public class PolicyResource extends Cura
     for (String type : typeNames) {
       out
           .append("<li class=\"directory collapsed productType\"><a href=\"#\" rel=\"/");
-      out.append(HTMLEncode.encode(policy));
+      out.append(StringEscapeUtils.escapeHtml(policy));
       out.append("/");
-      out.append(HTMLEncode.encode(type));
+      out.append(StringEscapeUtils.escapeHtml(type));
       out.append("/\">");
-      out.append(HTMLEncode.encode(type));
+      out.append(StringEscapeUtils.escapeHtml(type));
       out.append("</a></li>");
     }
 

Modified: incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/SystemResource.java
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/SystemResource.java?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/SystemResource.java (original)
+++ incubator/oodt/trunk/curator/src/main/java/org/apache/oodt/cas/curation/service/SystemResource.java Thu Jul 29 07:27:01 2010
@@ -25,10 +25,7 @@ import javax.ws.rs.Produces;
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
 
-import com.sun.jersey.spi.resource.Singleton;
-
 @Path("system")
-@Singleton
 public class SystemResource extends CurationService {
 
   @Context

Modified: incubator/oodt/trunk/curator/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/oodt/trunk/curator/src/main/webapp/WEB-INF/web.xml?rev=980344&r1=980343&r2=980344&view=diff
==============================================================================
--- incubator/oodt/trunk/curator/src/main/webapp/WEB-INF/web.xml (original)
+++ incubator/oodt/trunk/curator/src/main/webapp/WEB-INF/web.xml Thu Jul 29 07:27:01 2010
@@ -17,34 +17,35 @@ the License.
 -->
 <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
 	<display-name>curate</display-name>
-	
-	<welcome-file-list>
-		<welcome-file>index.html</welcome-file>
-		<welcome-file>index.htm</welcome-file>
-		<welcome-file>index.jsp</welcome-file>
-		<welcome-file>default.html</welcome-file>
-		<welcome-file>default.htm</welcome-file>
-		<welcome-file>default.jsp</welcome-file>
-	</welcome-file-list>
-	
-   
-    <servlet>
-        <display-name>JAX-RS Rest Servlet</display-name>
-        <servlet-name>JAX-RS Rest Servlet</servlet-name>
-        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-    
+	<servlet>
+	 <servlet-name>CXFServlet</servlet-name>
+	 <servlet-class>
+	   org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet
+	 </servlet-class>
+	 <init-param>
+	  <param-name>jaxrs.serviceClasses</param-name>
+	  <param-value>
+	    org.apache.oodt.cas.curation.service.DirectoryResource
+	    org.apache.oodt.cas.curation.service.IngestionResource
+	    org.apache.oodt.cas.curation.service.MetadataResource
+	    org.apache.oodt.cas.curation.service.PolicyResource
+	    org.apache.oodt.cas.curation.service.SystemResource
+	  </param-value>
+	 </init-param>
+	<load-on-startup>1</load-on-startup>
+	</servlet>
+
    <servlet>
         <display-name>Curation Service</display-name>
         <servlet-name>Curation Service</servlet-name>
         <servlet-class>org.apache.oodt.cas.curation.service.CurationService</servlet-class>
         <load-on-startup>1</load-on-startup>
     </servlet>
-   
-    <servlet-mapping>
-        <servlet-name>JAX-RS Rest Servlet</servlet-name>
-        <url-pattern>/services/*</url-pattern>
-    </servlet-mapping>
+    
+
+	<servlet-mapping>
+		<servlet-name>CXFServlet</servlet-name>
+		<url-pattern>/services/*</url-pattern>
+	</servlet-mapping>
 
 </web-app>