]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
NOJIRA: Renaming from Article to PublicItem service.
authorRichard Millet <remillet@berkeley.edu>
Mon, 28 Jan 2013 20:26:28 +0000 (12:26 -0800)
committerRichard Millet <remillet@berkeley.edu>
Mon, 28 Jan 2013 20:26:28 +0000 (12:26 -0800)
27 files changed:
services/article/3rdparty/build.xml
services/article/3rdparty/nuxeo-platform-cs-article/src/main/resources/schemas/articles_common.xsd [deleted file]
services/article/3rdparty/nuxeo-platform-cs-publicitem/build.xml [moved from services/article/3rdparty/nuxeo-platform-cs-article/build.xml with 83% similarity]
services/article/3rdparty/nuxeo-platform-cs-publicitem/pom.xml [moved from services/article/3rdparty/nuxeo-platform-cs-article/pom.xml with 79% similarity]
services/article/3rdparty/nuxeo-platform-cs-publicitem/src/main/resources/schemas/publicitems_common.xsd [new file with mode: 0644]
services/article/3rdparty/pom.xml
services/article/build.xml
services/article/client/pom.xml
services/article/client/src/main/java/org/collectionspace/services/client/PublicItemClient.java [moved from services/article/client/src/main/java/org/collectionspace/services/client/ArticleClient.java with 89% similarity]
services/article/client/src/main/java/org/collectionspace/services/client/PublicItemProxy.java [moved from services/article/client/src/main/java/org/collectionspace/services/client/ArticleProxy.java with 87% similarity]
services/article/client/src/test/java/org/collectionspace/services/client/test/PublicItemServiceTest.java [moved from services/article/client/src/test/java/org/collectionspace/services/client/test/ArticleServiceTest.java with 80% similarity]
services/article/jaxb/pom.xml
services/article/jaxb/src/main/java/org/collectionspace/services/ArticlesCommonJAXBSchema.java [deleted file]
services/article/jaxb/src/main/java/org/collectionspace/services/PublicitemsCommonJAXBSchema.java [new file with mode: 0644]
services/article/jaxb/src/main/resources/articles-common.xsd [deleted file]
services/article/jaxb/src/main/resources/publicitems-common.xsd [new file with mode: 0644]
services/article/pom.xml
services/article/service/pom.xml
services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemConstants.java [moved from services/article/service/src/main/java/org/collectionspace/services/article/nuxeo/ArticleConstants.java with 92% similarity]
services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemDocumentModelHandler.java [moved from services/article/service/src/main/java/org/collectionspace/services/article/nuxeo/ArticleDocumentModelHandler.java with 52% similarity]
services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemValidatorHandler.java [moved from services/article/service/src/main/java/org/collectionspace/services/article/nuxeo/ArticleValidatorHandler.java with 73% similarity]
services/article/service/src/test/java/org/collectionspace/services/test/PublicItemServiceTest.java [moved from services/article/service/src/test/java/org/collectionspace/services/test/ArticleServiceTest.java with 50% similarity]
services/blob/service/src/main/java/org/collectionspace/services/blob/BlobResource.java
services/common/src/main/java/org/collectionspace/services/common/article/ArticleResource.java
services/common/src/main/java/org/collectionspace/services/common/article/ArticleUtil.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/report/service/src/main/java/org/collectionspace/services/report/ReportResource.java

index 0ec33548a3a594c87f99f8ac0f60409c3733dbba..7f3fdf96df0d478c5d2b3fed2662a754949a155f 100644 (file)
@@ -1,7 +1,7 @@
 
-<project name="article.3rdparty" default="package" basedir=".">
+<project name="publicitem.3rdparty" default="package" basedir=".">
     <description>
-        Article service 3rdparty
+        PublicItem service 3rdparty
     </description>
   <!-- set global properties for this build -->
     <property name="services.trunk" value="../../.."/>
     </target>
 
     <target name="deploy" depends="install"
-    description="deploy article in ${jee.server.nuxeo}">
-        <ant antfile="nuxeo-platform-cs-article/build.xml" target="deploy" inheritall="false"/>
+    description="deploy publicitem in ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-publicitem/build.xml" target="deploy" inheritall="false"/>
     </target>
 
     <target name="undeploy"
-    description="undeploy article from ${jee.server.nuxeo}">
-        <ant antfile="nuxeo-platform-cs-article/build.xml" target="undeploy" inheritall="false"/>
+    description="undeploy publicitem from ${jee.server.nuxeo}">
+        <ant antfile="nuxeo-platform-cs-publicitem/build.xml" target="undeploy" inheritall="false"/>
     </target>
 
     <target name="dist"
-    description="generate distribution for article" depends="package">
-        <ant antfile="nuxeo-platform-cs-article/build.xml" target="dist" inheritall="false"/>
+    description="generate distribution for publicitem" depends="package">
+        <ant antfile="nuxeo-platform-cs-publicitem/build.xml" target="dist" inheritall="false"/>
     </target>
 
 
diff --git a/services/article/3rdparty/nuxeo-platform-cs-article/src/main/resources/schemas/articles_common.xsd b/services/article/3rdparty/nuxeo-platform-cs-article/src/main/resources/schemas/articles_common.xsd
deleted file mode 100644 (file)
index 2f288e4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<!--
-    ArticlesCommon XML Schema (XSD) for Nuxeo
-    
-    Entity  : ArticlesCommon
-    Used for: Nuxeo EP core document type
-
-    $LastChangedRevision$
-    $LastChangedDate$
--->
-
-<xs:schema 
-    xmlns:xs="http://www.w3.org/2001/XMLSchema"
-    xmlns:ns="http://collectionspace.org/article/"
-    xmlns="http://collectionspace.org/article/"
-    targetNamespace="http://collectionspace.org/article/"
-    version="0.1">
-    
-       <xs:element name="articleNumber" type="xs:string" />                            <!-- An identifier for the article (different than the CSID) -->
-       <xs:element name="articleContentName" type="xs:string" />                       <!-- A name for the article's content  -->
-       <xs:element name="articleContentRepositoryId" type="xs:string" />       <!-- The backend repository ID of the article's content -->
-       <xs:element name="articleContentUrl" type="xs:string" />                        <!-- The publicly accessible URL of the article's content -->   
-       <xs:element name="articleJobId" type="xs:string" />                                     <!-- The asynch job ID -if any -->
-       <xs:element name="articleSource" type="xs:string" />                            <!-- The name of the service/resource that was used to create the article. -->
-       <xs:element name="accessExpirationDate" type="xs:dateTime" />           <!-- When the article is no longer available for access -->
-       <xs:element name="accessedCount" type="xs:integer" />                           <!-- How many times the article has been accessed. -->
-       <xs:element name="accessedCountLimit" type="xs:integer" />                      <!-- The maximum times the article can be accessed. -->
-</xs:schema>
similarity index 83%
rename from services/article/3rdparty/nuxeo-platform-cs-article/build.xml
rename to services/article/3rdparty/nuxeo-platform-cs-publicitem/build.xml
index e88ea9c343ec2c0586ee9cf8a35456245921f8dc..bac61c91ab0ea692481fe8adc1fe062d1e1f7c4f 100644 (file)
@@ -1,7 +1,7 @@
 
-<project name="nuxeo-platform-cs-article" default="package" basedir=".">
+<project name="nuxeo-platform-cs-publicitem" default="package" basedir=".">
     <description>
-        Article nuxeo document type
+        PublicItem's Nuxeo document type
     </description>
     <!-- set global properties for this build -->
     <property name="services.trunk" value="../../../.."/>
     <property file="${services.trunk}/build.properties" />
     <property name="mvn.opts" value="" />
     <property name="src" location="src"/>
-    <property name="nuxeo.article.jar"
-        value="org.collectionspace.services.article.3rdparty.nuxeo-${cspace.release}.jar"/>
-    <property name="nuxeo.article.jars.all"
-        value="org.collectionspace.services.article.3rdparty.nuxeo-*.jar"/>
+    <property name="nuxeo.publicitem.jar"
+        value="org.collectionspace.services.publicitem.3rdparty.nuxeo-${cspace.release}.jar"/>
+    <property name="nuxeo.publicitem.jars.all"
+        value="org.collectionspace.services.publicitem.3rdparty.nuxeo-*.jar"/>
 
     <condition property="osfamily-unix">
         <os family="unix" />
     </target>
 
     <target name="deploy" depends="install"
-        description="deploy article doctype in ${jee.server.nuxeo}">
-        <copy file="${basedir}/target/${nuxeo.article.jar}"
+        description="deploy publicitem doctype in ${jee.server.nuxeo}">
+        <copy file="${basedir}/target/${nuxeo.publicitem.jar}"
         todir="${jee.deploy.nuxeo.plugins}"/>
     </target>
 
     <target name="undeploy"
-        description="undeploy article doctype from ${jee.server.nuxeo}">
+        description="undeploy publicitem doctype from ${jee.server.nuxeo}">
         <delete>
             <fileset dir="${jee.deploy.nuxeo.plugins}">
-                <include name="${nuxeo.article.jars.all}"/>
+                <include name="${nuxeo.publicitem.jars.all}"/>
             </fileset>
         </delete>
     </target>
 
     <target name="dist"
-        description="generate distribution for article doctype" depends="package">
+        description="generate distribution for publicitem doctype" depends="package">
         <copy todir="${services.trunk}/${dist.deploy.nuxeo.plugins}">
-            <fileset file="${basedir}/target/${nuxeo.article.jar}"/>
+            <fileset file="${basedir}/target/${nuxeo.publicitem.jar}"/>
         </copy>
     </target>
 
similarity index 79%
rename from services/article/3rdparty/nuxeo-platform-cs-article/pom.xml
rename to services/article/3rdparty/nuxeo-platform-cs-publicitem/pom.xml
index 65328eab6889fac99175b9668ebc6547fc019648..be1a1be49aa5025af6011ab1fe4f5d5f900b9863 100644 (file)
@@ -5,23 +5,23 @@
 
     <parent>
         <groupId>org.collectionspace.services</groupId>
-        <artifactId>org.collectionspace.services.article.3rdparty</artifactId>
+        <artifactId>org.collectionspace.services.publicitem.3rdparty</artifactId>
         <version>3.2.1-SNAPSHOT</version>
     </parent>
     
     <modelVersion>4.0.0</modelVersion>
     <groupId>org.collectionspace.services</groupId>
-    <artifactId>org.collectionspace.services.article.3rdparty.nuxeo</artifactId>
-    <name>services.article.3rdparty.nuxeo</name>
+    <artifactId>org.collectionspace.services.publicitem.3rdparty.nuxeo</artifactId>
+    <name>services.publicitem.3rdparty.nuxeo</name>
     <packaging>jar</packaging>
     <description>
-        Article Nuxeo Document Type
+        PublicItem Nuxeo Document Type
     </description>
     
     <properties>
-        <ServiceName>article</ServiceName>
-        <NuxeoDocTypeName>Article</NuxeoDocTypeName>
-        <CommonSchemaName>articles_common</CommonSchemaName>
+        <ServiceName>publicitem</ServiceName>
+        <NuxeoDocTypeName>PublicItem</NuxeoDocTypeName>
+        <CommonSchemaName>publicitems_common</CommonSchemaName>
                <Lifecycle>cs_default</Lifecycle>
     </properties>
 
diff --git a/services/article/3rdparty/nuxeo-platform-cs-publicitem/src/main/resources/schemas/publicitems_common.xsd b/services/article/3rdparty/nuxeo-platform-cs-publicitem/src/main/resources/schemas/publicitems_common.xsd
new file mode 100644 (file)
index 0000000..ecbcd30
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+    PublicitemsCommon XML Schema (XSD) for Nuxeo
+    
+    Entity  : PublicitemsCommon
+    Used for: Nuxeo EP core document type
+
+    $LastChangedRevision$
+    $LastChangedDate$
+-->
+
+<xs:schema 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    xmlns:ns="http://collectionspace.org/publicitem/"
+    xmlns="http://collectionspace.org/publicitem/"
+    targetNamespace="http://collectionspace.org/publicitem/"
+    version="0.1">
+    
+       <xs:element name="itemNumber" type="xs:string" />                               <!-- An identifier for the publicitem (different than the CSID) -->
+       <xs:element name="contentName" type="xs:string" />                              <!-- A name for the publicitem's content  -->
+       <xs:element name="contentId" type="xs:string" />                                <!-- The the ID of the content blob in the back-end repository -->
+       <xs:element name="contentUri" type="xs:string" />                               <!-- The publicly accessible URL of the publicitem's content -->        
+       <xs:element name="contentCreationJobId" type="xs:string" />             <!-- The asynch job ID -if any -->
+       <xs:element name="contentSource" type="xs:string" />                    <!-- The name of the service/resource that was used to create the publicitem. -->
+       <xs:element name="contentExpirationDate" type="xs:dateTime" />  <!-- When the publicitem is no longer available for access -->
+       <xs:element name="contentAccessedCount" type="xs:integer" />    <!-- How many times the publicitem has been accessed. -->
+       <xs:element name="contentAccessCountLimit" type="xs:integer" /> <!-- The maximum times the publicitem can be accessed. -->
+</xs:schema>
index e0622fd67424911142711c674f780f24cd46238b..625102d11ed2972b597209bb53c2b1bdee6d4a85 100644 (file)
@@ -3,21 +3,21 @@
   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>
-        <artifactId>org.collectionspace.services.article</artifactId>
+        <artifactId>org.collectionspace.services.publicitem</artifactId>
         <groupId>org.collectionspace.services</groupId>
         <version>3.2.1-SNAPSHOT</version>
     </parent>
     
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.collectionspace.services.article.3rdparty</artifactId>
-    <name>services.article.3rdparty</name>
+    <artifactId>org.collectionspace.services.publicitem.3rdparty</artifactId>
+    <name>services.publicitem.3rdparty</name>
     <packaging>pom</packaging>
     
     <description>
-        3rd party build for article service
+        3rd party build for publicitem service
     </description>
 
     <modules>
-        <module>nuxeo-platform-cs-article</module>
+        <module>nuxeo-platform-cs-publicitem</module>
     </modules>
 </project>
index bc60494e8b65b2e34e52bfe3158f0b3981e82b41..a366a3ef8efbec7db5ced4ec04aac1a19a70d767 100644 (file)
@@ -1,7 +1,7 @@
 
-<project name="article" default="package" basedir=".">
+<project name="publicitem" default="package" basedir=".">
     <description>
-        Article service
+        PublicItem service
     </description>
   <!-- set global properties for this build -->
     <property name="services.trunk" value="../.."/>
     </target>
 
     <target name="deploy" depends="install"
-    description="deploy article service">
+    description="deploy publicitem service">
         <ant antfile="3rdparty/build.xml" target="deploy" inheritall="false"/>
     </target>
 
     <target name="undeploy"
-    description="undeploy article service">
+    description="undeploy publicitem service">
         <ant antfile="3rdparty/build.xml" target="undeploy" inheritall="false"/>
     </target>
 
     <target name="dist" depends="package"
-    description="distribute article service">
+    description="distribute publicitem service">
         <ant antfile="3rdparty/build.xml" target="dist" inheritall="false"/>
     </target>
 
index 53173d3517ec25993b9ed5e8f604e37025f276c1..73c1fc37de9903f34d90d48393072a03ed46d7a1 100644 (file)
@@ -4,13 +4,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
     <parent>
         <groupId>org.collectionspace.services</groupId>
-        <artifactId>org.collectionspace.services.article</artifactId>
+        <artifactId>org.collectionspace.services.publicitem</artifactId>
         <version>3.2.1-SNAPSHOT</version>
     </parent>
 
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.collectionspace.services.article.client</artifactId>
-    <name>services.article.client</name>
+    <artifactId>org.collectionspace.services.publicitem.client</artifactId>
+    <name>services.publicitem.client</name>
     
     <dependencies>
         <!-- keep slf4j dependencies on the top -->
@@ -37,7 +37,7 @@
         </dependency>
          <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.article.jaxb</artifactId>
+            <artifactId>org.collectionspace.services.publicitem.jaxb</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
@@ -81,6 +81,6 @@
     </dependencies>
     
     <build>
-        <finalName>collectionspace-services-article-client</finalName>
+        <finalName>collectionspace-services-publicitem-client</finalName>
     </build>
 </project>
similarity index 89%
rename from services/article/client/src/main/java/org/collectionspace/services/client/ArticleClient.java
rename to services/article/client/src/main/java/org/collectionspace/services/client/PublicItemClient.java
index fff3669cbff9b477c71fbaf59a341f25639f5795..c77dde6aa705d6042af0ad4b1fcff72b470a19cb 100644 (file)
@@ -23,7 +23,7 @@ package org.collectionspace.services.client;
  * $LastChangedDate$
  *
  */
-public class ArticleClient extends AbstractCommonListPoxServiceClientImpl<ArticleProxy> {
+public class PublicItemClient extends AbstractCommonListPoxServiceClientImpl<PublicItemProxy> {
 
     public static final String SERVICE_NAME = "articles";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
@@ -48,8 +48,8 @@ public class ArticleClient extends AbstractCommonListPoxServiceClientImpl<Articl
     }
 
     @Override
-    public Class<ArticleProxy> getProxyClass() {
-        return ArticleProxy.class;
+    public Class<PublicItemProxy> getProxyClass() {
+        return PublicItemProxy.class;
     }
 
 }
similarity index 87%
rename from services/article/client/src/main/java/org/collectionspace/services/client/ArticleProxy.java
rename to services/article/client/src/main/java/org/collectionspace/services/client/PublicItemProxy.java
index d5f8dea801e82942718e408d71f8cc726585bb18..c51fff4e01f8a78af2f1f11b71355673085822c6 100644 (file)
@@ -27,8 +27,8 @@ import javax.ws.rs.Produces;
  * $LastChangedDate$
  *
  */
-@Path(ArticleClient.SERVICE_PATH_PROXY)
+@Path(PublicItemClient.SERVICE_PATH_PROXY)
 @Produces({"application/xml"})
 @Consumes({"application/xml"})
-public interface ArticleProxy extends CollectionSpaceCommonListPoxProxy {
+public interface PublicItemProxy extends CollectionSpaceCommonListPoxProxy {
 }
similarity index 80%
rename from services/article/client/src/test/java/org/collectionspace/services/client/test/ArticleServiceTest.java
rename to services/article/client/src/test/java/org/collectionspace/services/client/test/PublicItemServiceTest.java
index 6bdbfb363daa4d8f1084ad52bbe185f372937595..2cab8f920b80c07f265d516d3c81166ad52767ca 100644 (file)
@@ -24,7 +24,6 @@ package org.collectionspace.services.client.test;
 
 //import java.util.ArrayList;
 import java.math.BigInteger;
-import java.util.Date;
 
 import javax.ws.rs.core.Response;
 import javax.xml.datatype.DatatypeConfigurationException;
@@ -32,15 +31,13 @@ import javax.xml.datatype.DatatypeFactory;
 import javax.xml.datatype.XMLGregorianCalendar;
 
 import org.collectionspace.services.client.AbstractCommonListUtils;
-import org.collectionspace.services.client.CollectionSpaceClient;
-import org.collectionspace.services.client.ArticleClient;
+import org.collectionspace.services.client.PublicItemClient;
 import org.collectionspace.services.client.PayloadInputPart;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
-import org.collectionspace.services.common.api.GregorianCalendarDateTimeUtils;
 import org.collectionspace.services.jaxb.AbstractCommonList;
-import org.collectionspace.services.article.ArticlesCommon;
+import org.collectionspace.services.publicitem.PublicitemsCommon;
 
 import org.jboss.resteasy.client.ClientResponse;
 import org.testng.Assert;
@@ -49,21 +46,21 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * ArticleServiceTest, carries out tests against a deployed and running Articles
+ * PublicItemServiceTest, carries out tests against a deployed and running PublicItem
  * Service.
  * 
  * $LastChangedRevision$ $LastChangedDate$
  */
-public class ArticleServiceTest extends
-               AbstractPoxServiceTestImpl<AbstractCommonList, ArticlesCommon> {
+public class PublicItemServiceTest extends
+               AbstractPoxServiceTestImpl<AbstractCommonList, PublicitemsCommon> {
 
        /** The logger. */
-       private final String CLASS_NAME = ArticleServiceTest.class.getName();
+       private final String CLASS_NAME = PublicItemServiceTest.class.getName();
        private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
        // Instance variables specific to this test.
        /** The service path component. */
-       final String SERVICE_NAME = "articles";
-       final String SERVICE_PATH_COMPONENT = "articles";
+       final String SERVICE_NAME = PublicItemClient.SERVICE_NAME;
+       final String SERVICE_PATH_COMPONENT = PublicItemClient.SERVICE_PATH_COMPONENT;
 
        /*
         * (non-Javadoc)
@@ -73,8 +70,8 @@ public class ArticleServiceTest extends
         * ()
         */
        @Override
-       protected ArticleClient getClientInstance() {
-               return new ArticleClient();
+       protected PublicItemClient getClientInstance() {
+               return new PublicItemClient();
        }
 
        /*
@@ -112,9 +109,9 @@ public class ArticleServiceTest extends
                setupCreate();
 
                // Submit the request to the service and store the response.
-               ArticleClient client = new ArticleClient();
+               PublicItemClient client = new PublicItemClient();
                String identifier = createIdentifier();
-               PoxPayloadOut multipart = createArticleInstance(identifier);
+               PoxPayloadOut multipart = createPublicItemInstance(identifier);
                String newID = null;
                ClientResponse<Response> res = client.create(multipart);
                try {
@@ -191,7 +188,7 @@ public class ArticleServiceTest extends
                setupRead();
 
                // Submit the request to the service and store the response.
-               ArticleClient client = new ArticleClient();
+               PublicItemClient client = new PublicItemClient();
                ClientResponse<String> res = client.read(knownResourceId);
                PoxPayloadIn input = null;
                try {
@@ -206,11 +203,11 @@ public class ArticleServiceTest extends
                // Get the common part of the response and verify that it is not null.
                PayloadInputPart payloadInputPart = input.getPart(client
                                .getCommonPartName());
-               ArticlesCommon articlesCommon = null;
+               PublicitemsCommon publicItemsCommon = null;
                if (payloadInputPart != null) {
-                       articlesCommon = (ArticlesCommon) payloadInputPart.getBody();
+                       publicItemsCommon = (PublicitemsCommon) payloadInputPart.getBody();
                }
-               Assert.assertNotNull(articlesCommon);
+               Assert.assertNotNull(publicItemsCommon);
 
        }
 
@@ -231,7 +228,7 @@ public class ArticleServiceTest extends
                setupReadNonExistent();
 
                // Submit the request to the service and store the response.
-               ArticleClient client = new ArticleClient();
+               PublicItemClient client = new PublicItemClient();
                ClientResponse<String> res = client.read(NON_EXISTENT_ID);
                try {
                        int statusCode = res.getStatus();
@@ -274,7 +271,7 @@ public class ArticleServiceTest extends
 
                // Submit the request to the service and store the response.
                AbstractCommonList list = null;
-               ArticleClient client = new ArticleClient();
+               PublicItemClient client = new PublicItemClient();
                ClientResponse<AbstractCommonList> res = client.readList();
                assertStatusCode(res, testName);
                try {
@@ -330,7 +327,7 @@ public class ArticleServiceTest extends
                setupRead();
 
                // Retrieve the contents of a resource to update.
-               ArticleClient client = new ArticleClient();
+               PublicItemClient client = new PublicItemClient();
                ClientResponse<String> res = client.read(knownResourceId);
                PoxPayloadIn input = null;
                try {
@@ -348,19 +345,19 @@ public class ArticleServiceTest extends
                // Extract the common part from the response.
                PayloadInputPart payloadInputPart = input.getPart(client
                                .getCommonPartName());
-               ArticlesCommon articlesCommon = null;
+               PublicitemsCommon publicItemsCommon = null;
                if (payloadInputPart != null) {
-                       articlesCommon = (ArticlesCommon) payloadInputPart.getBody();
+                       publicItemsCommon = (PublicitemsCommon) payloadInputPart.getBody();
                }
-               Assert.assertNotNull(articlesCommon);
+               Assert.assertNotNull(publicItemsCommon);
 
                // Update the content of this resource.
-               articlesCommon.setArticleNumber("updated-"
-                               + articlesCommon.getArticleNumber());
-               articlesCommon.setArticleJobId("updated-" + articlesCommon.getArticleJobId());
+               publicItemsCommon.setItemNumber("updated-"
+                               + publicItemsCommon.getItemNumber());
+               publicItemsCommon.setContentCreationJobId("updated-" + publicItemsCommon.getContentCreationJobId());
                if (logger.isDebugEnabled()) {
                        logger.debug("to be updated object");
-                       logger.debug(objectAsXmlString(articlesCommon, ArticlesCommon.class));
+                       logger.debug(objectAsXmlString(publicItemsCommon, PublicitemsCommon.class));
                }
 
                setupUpdate();
@@ -369,7 +366,7 @@ public class ArticleServiceTest extends
                // and store the response.
                PoxPayloadOut output = new PoxPayloadOut(this.getServicePathComponent());
                PayloadOutputPart commonPart = output.addPart(
-                               client.getCommonPartName(), articlesCommon);
+                               client.getCommonPartName(), publicItemsCommon);
                res = client.update(knownResourceId, output);
                try {
                        assertStatusCode(res, testName);
@@ -391,29 +388,29 @@ public class ArticleServiceTest extends
 
                // Extract the updated common part from the response.
                payloadInputPart = input.getPart(client.getCommonPartName());
-               ArticlesCommon updatedArticleCommon = null;
+               PublicitemsCommon updatedPublicitemsCommon = null;
                if (payloadInputPart != null) {
-                       updatedArticleCommon = (ArticlesCommon) payloadInputPart.getBody();
+                       updatedPublicitemsCommon = (PublicitemsCommon) payloadInputPart.getBody();
                }
-               Assert.assertNotNull(updatedArticleCommon);
+               Assert.assertNotNull(updatedPublicitemsCommon);
 
                // Check selected fields in the updated common part.
-               Assert.assertEquals(updatedArticleCommon.getArticleNumber(),
-                               articlesCommon.getArticleNumber(),
+               Assert.assertEquals(updatedPublicitemsCommon.getItemNumber(),
+                               publicItemsCommon.getItemNumber(),
                                "Data in updated object did not match submitted data.");
 
                if (logger.isDebugEnabled()) {
-                       logger.debug("UTF-8 data sent=" + articlesCommon.getArticleJobId()
+                       logger.debug("UTF-8 data sent=" + publicItemsCommon.getContentCreationJobId()
                                        + "\n" + "UTF-8 data received="
-                                       + updatedArticleCommon.getArticleJobId());
+                                       + updatedPublicitemsCommon.getContentCreationJobId());
                }
-               Assert.assertTrue(updatedArticleCommon.getArticleSource().contains(
+               Assert.assertTrue(updatedPublicitemsCommon.getContentSource().contains(
                                                getUTF8DataFragment()), "UTF-8 data retrieved '"
-                                               + updatedArticleCommon.getArticleSource()
+                                               + updatedPublicitemsCommon.getContentSource()
                                                + "' does not contain expected data '"
                                                + getUTF8DataFragment());
-               Assert.assertEquals(updatedArticleCommon.getArticleJobId(),
-                               articlesCommon.getArticleJobId(),
+               Assert.assertEquals(updatedPublicitemsCommon.getContentCreationJobId(),
+                               publicItemsCommon.getContentCreationJobId(),
                                "Data in updated object did not match submitted data.");
        }
 
@@ -428,8 +425,8 @@ public class ArticleServiceTest extends
                // Submit the request to the service and store the response.
                // Note: The ID used in this 'create' call may be arbitrary.
                // The only relevant ID may be the one used in update(), below.
-               ArticleClient client = new ArticleClient();
-               PoxPayloadOut multipart = createArticleInstance(NON_EXISTENT_ID);
+               PublicItemClient client = new PublicItemClient();
+               PoxPayloadOut multipart = createPublicItemInstance(NON_EXISTENT_ID);
                ClientResponse<String> res = client.update(NON_EXISTENT_ID, multipart);
                try {
                        int statusCode = res.getStatus();
@@ -471,7 +468,7 @@ public class ArticleServiceTest extends
                setupDelete();
 
                // Submit the request to the service and store the response.
-               ArticleClient client = new ArticleClient();
+               PublicItemClient client = new PublicItemClient();
                ClientResponse<Response> res = client.delete(knownResourceId);
                try {
                        int statusCode = res.getStatus();
@@ -508,7 +505,7 @@ public class ArticleServiceTest extends
                setupDeleteNonExistent();
 
                // Submit the request to the service and store the response.
-               ArticleClient client = new ArticleClient();
+               PublicItemClient client = new PublicItemClient();
                ClientResponse<Response> res = client.delete(NON_EXISTENT_ID);
                try {
                        int statusCode = res.getStatus();
@@ -579,59 +576,59 @@ public class ArticleServiceTest extends
 
        @Override
        protected PoxPayloadOut createInstance(String identifier) {
-               return createArticleInstance(identifier);
+               return createPublicItemInstance(identifier);
        }
 
        /**
-        * Creates the article instance.
+        * Creates the publicitem instance.
         * 
         * @param identifier
         *            the identifier
         * @return the multipart output
         */
-       private PoxPayloadOut createArticleInstance(String identifier) {
-               return createArticleInstance("articleNumber-" + identifier,
-                               "articleJobId-" + identifier);
+       private PoxPayloadOut createPublicItemInstance(String identifier) {
+               return createPublicItemInstance("itemNumber-" + identifier,
+                               "contentCreationJobId-" + identifier);
        }
 
        /**
-        * Creates the Article instance.
+        * Creates the PublicItem instance.
         * 
-        * @param articleNumber
-        *            the article number
-        * @param articleJobId
-        *            the article asynch job ID
+        * @param itemNumber
+        *            the publicitem number
+        * @param contentCreationJobId
+        *            the publicitem asynch job ID
         * @return the multipart output
         */
-       private PoxPayloadOut createArticleInstance(String articleNumber,
-                       String articleJobId) {
-
-               ArticlesCommon articlesCommon = new ArticlesCommon();
-               articlesCommon.setArticleNumber(articleNumber);
-               articlesCommon.setArticleContentName("contentname-" + articleNumber);
-               articlesCommon.setArticleContentRepositoryId("42640780-82eb-4650-8a70");
-               articlesCommon.setArticleContentUrl("https://github.com/collectionspace/services/blob/CSPACE-5564-REM-A/services/article/jaxb/src/main/resources/articles-common.xsd");
-               articlesCommon.setArticleJobId(articleJobId);
-               articlesCommon.setArticleSource(getUTF8DataFragment());
+       private PoxPayloadOut createPublicItemInstance(String itemNumber,
+                       String itemJobId) {
+
+               PublicitemsCommon publicItemsCommon = new PublicitemsCommon();
+               publicItemsCommon.setItemNumber(itemNumber);
+               publicItemsCommon.setContentName("Inventory report-" + itemNumber);
+               publicItemsCommon.setContentId("42640780-82eb-4650-8a70");
+               publicItemsCommon.setContentUri("publicitems/1/7eaf0780-9eeb-af50-9d76/content");
+               publicItemsCommon.setContentCreationJobId(itemJobId);
+               publicItemsCommon.setContentSource(getUTF8DataFragment());
                try {
                        XMLGregorianCalendar expirationDate = 
                                        DatatypeFactory.newInstance().newXMLGregorianCalendarDate(2013, 12, 31, 0);
-                       articlesCommon.setAccessExpirationDate(expirationDate);
+                       publicItemsCommon.setContentExpirationDate(expirationDate);
                } catch (DatatypeConfigurationException e) {
                        // TODO Auto-generated catch block
                        e.printStackTrace();
                }
-               articlesCommon.setAccessedCount(new BigInteger("3"));
-               articlesCommon.setAccessedCountLimit(new BigInteger("5"));
+               publicItemsCommon.setContentAccessedCount(new BigInteger("3"));
+               publicItemsCommon.setContentAccessCountLimit(new BigInteger("5"));
 
                PoxPayloadOut multipart = new PoxPayloadOut(
                                this.getServicePathComponent());
                PayloadOutputPart commonPart = multipart.addPart(
-                               new ArticleClient().getCommonPartName(), articlesCommon);
+                               new PublicItemClient().getCommonPartName(), publicItemsCommon);
 
                if (logger.isDebugEnabled()) {
-                       logger.debug("To be created, article common:");
-                       logger.debug(objectAsXmlString(articlesCommon, ArticlesCommon.class));
+                       logger.debug("To be created, publicitem common:");
+                       logger.debug(objectAsXmlString(publicItemsCommon, PublicitemsCommon.class));
                }
 
                return multipart;
@@ -646,19 +643,19 @@ public class ArticleServiceTest extends
        @Override
        protected PoxPayloadOut createInstance(String commonPartName,
                        String identifier) {
-               PoxPayloadOut result = createArticleInstance(identifier);
+               PoxPayloadOut result = createPublicItemInstance(identifier);
                return result;
        }
 
        @Override
-       protected ArticlesCommon updateInstance(ArticlesCommon commonPartObject) {
+       protected PublicitemsCommon updateInstance(PublicitemsCommon commonPartObject) {
                // TODO Auto-generated method stub
                return null;
        }
 
        @Override
-       protected void compareUpdatedInstances(ArticlesCommon original,
-                       ArticlesCommon updated) throws Exception {
+       protected void compareUpdatedInstances(PublicitemsCommon original,
+                       PublicitemsCommon updated) throws Exception {
                // TODO Auto-generated method stub
 
        }
index 7532bd4ac05321a7eeb23d64594ab6c96df001ee..84f749f7604fe69c446b971508608e0977ecba2c 100644 (file)
@@ -3,14 +3,14 @@
     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>
-        <artifactId>org.collectionspace.services.article</artifactId>
+        <artifactId>org.collectionspace.services.publicitem</artifactId>
         <groupId>org.collectionspace.services</groupId>
         <version>3.2.1-SNAPSHOT</version>
     </parent>
     
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.collectionspace.services.article.jaxb</artifactId>
-    <name>services.article.jaxb</name>
+    <artifactId>org.collectionspace.services.publicitem.jaxb</artifactId>
+    <name>services.publicitem.jaxb</name>
     
     <dependencies>
         <dependency>
@@ -21,7 +21,7 @@
     </dependencies>
     
     <build>
-        <finalName>collectionspace-services-article-jaxb</finalName>
+        <finalName>collectionspace-services-publicitem-jaxb</finalName>
         <defaultGoal>install</defaultGoal>
         <plugins>
             <plugin>
diff --git a/services/article/jaxb/src/main/java/org/collectionspace/services/ArticlesCommonJAXBSchema.java b/services/article/jaxb/src/main/java/org/collectionspace/services/ArticlesCommonJAXBSchema.java
deleted file mode 100644 (file)
index c5c3e38..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * String constants to access XML element names of the ArticlesCommon class.
- */
-package org.collectionspace.services;
-
-/*
-       <xs:element name="articles_common">
-               <xs:complexType>
-                       <xs:sequence>
-                               <xs:element name="articleNumber" type="xs:string" />                    <!-- An ID for the article (different than the CSID) -->
-                               <xs:element name="articleContentCsid" type="xs:string" />               <!-- The URL of the article's content -->
-                               <xs:element name="articleJobId" type="xs:string" />                             <!-- The asynch job ID -if any -->
-                               <xs:element name="articleSource" type="xs:string" />                    <!-- The name of the service/resource that was used to create the article. -->
-                               <xs:element name="articlePublisher" type="xs:string" />                 <!-- The user who published the article -->
-                               <xs:element name="accessExpirationDate" type="xs:dateTime" />   <!-- When the article is no longer available for access -->
-                               <xs:element name="accessedCount" type="xs:integer" />                   <!-- How many times the article has been accessed. -->
-                               <xs:element name="accessCountLimit" type="xs:integer" />                <!-- The maximum times the article can be accessed. -->
-                       </xs:sequence>
-               </xs:complexType>
-       </xs:element>
- */
-
-public interface ArticlesCommonJAXBSchema {
-    final static String ARTICLE_NUMBER = "articleNumber";
-    final static String ARTICLE_CONTENT_NAME = "articleContentName";
-    final static String ARTICLE_CONTENT_REPO_ID = "articleContentRepositoryId";
-    final static String ARTICLE_CONTENT_URL = "articleContentUrl";
-    final static String ARTICLE_JOB_ID = "articleJobId";
-    final static String ARTICLE_SOURCE = "articleSource";
-    final static String ARTICLE_ACCESS_EXPIRATION_DATE = "accessExpirationDate";
-    final static String ARTICLE_ACCESSED_COUNT = "accessedCount";
-    final static String ARTICLE_ACCESSED_COUNT_LIMIT = "accesseedCountLimit";
-}
\ No newline at end of file
diff --git a/services/article/jaxb/src/main/java/org/collectionspace/services/PublicitemsCommonJAXBSchema.java b/services/article/jaxb/src/main/java/org/collectionspace/services/PublicitemsCommonJAXBSchema.java
new file mode 100644 (file)
index 0000000..70516cb
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * String constants to access XML element names of the ArticlesCommon class.
+ */
+package org.collectionspace.services;
+
+/*
+       <xs:element name="articles_common">
+               <xs:complexType>
+                       <xs:sequence>
+                               <xs:element name="itemNumber" type="xs:string" />                               <!-- An identifier for the article (different than the CSID) -->
+                               <xs:element name="itemContentName" type="xs:string" />                  <!-- A name for the article's content  -->
+                               <xs:element name="itemContentId" type="xs:string" />                    <!-- The backend repository ID of the article's content -->
+                               <xs:element name="itemContentUri" type="xs:string" />                   <!-- The publicly accessible URL of the article's content -->   
+                               <xs:element name="itemJobId" type="xs:string" />                                <!-- The asynch job ID -if any -->
+                               <xs:element name="itemSource" type="xs:string" />                               <!-- The name of the service/resource that was used to create the article. -->
+                               <xs:element name="itemExpirationDate" type="xs:dateTime" />             <!-- When the article is no longer available for access -->
+                               <xs:element name="itemCount" type="xs:integer" />                               <!-- How many times the article has been accessed. -->
+                               <xs:element name="itemCountLimit" type="xs:integer" />                  <!-- The maximum times the article can be accessed. -->
+                       </xs:sequence>
+               </xs:complexType>
+       </xs:element>
+ */
+
+public interface PublicitemsCommonJAXBSchema {
+    final static String ITEM_NUMBER = "itemNumber";
+    final static String ITEM_CONTENT_NAME = "itemContentName";
+    final static String ITEM_CONTENT_REPO_ID = "itemContentId";
+    final static String ITEM_CONTENT_URI = "itemContentUri";
+    final static String ITEM_JOB_ID = "itemJobId";
+    final static String ITEM_SOURCE = "itemSource";
+    final static String ITEM_ACCESS_EXPIRATION_DATE = "itemExpirationDate";
+    final static String ITEM_ACCESSED_COUNT = "itemCount";
+    final static String ITEM_ACCESSED_COUNT_LIMIT = "itemCountLimit";
+}
\ No newline at end of file
diff --git a/services/article/jaxb/src/main/resources/articles-common.xsd b/services/article/jaxb/src/main/resources/articles-common.xsd
deleted file mode 100644 (file)
index d1ad137..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-
-<!-- ArticlesCommon XML Schema (XSD) Entity : ArticlesCommon Used for: JAXB 
-       binding between XML and Java objects $LastChangedRevision$ $LastChangedDate$ -->
-
-<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
-       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="1.0"
-       elementFormDefault="unqualified" xmlns:ns="http://collectionspace.org/services/article"
-       xmlns="http://collectionspace.org/services/article" targetNamespace="http://collectionspace.org/services/article"
-       version="0.1">
-
-       <!-- Avoid XmlRootElement nightmare: See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html -->
-       <xs:element name="articles_common">
-               <xs:complexType>
-                       <xs:sequence>
-                               <xs:element name="articleNumber" type="xs:string" />                            <!-- An identifier for the article (different than the CSID) -->
-                               <xs:element name="articleContentName" type="xs:string" />                       <!-- A name for the article's content  -->
-                               <xs:element name="articleContentRepositoryId" type="xs:string" />       <!-- The backend repository ID of the article's content -->
-                               <xs:element name="articleContentUrl" type="xs:string" />                        <!-- The publicly accessible URL of the article's content -->   
-                               <xs:element name="articleJobId" type="xs:string" />                                     <!-- The asynch job ID -if any -->
-                               <xs:element name="articleSource" type="xs:string" />                            <!-- The name of the service/resource that was used to create the article. -->
-                               <xs:element name="accessExpirationDate" type="xs:dateTime" />           <!-- When the article is no longer available for access -->
-                               <xs:element name="accessedCount" type="xs:integer" />                           <!-- How many times the article has been accessed. -->
-                               <xs:element name="accessedCountLimit" type="xs:integer" />                      <!-- The maximum times the article can be accessed. -->
-                       </xs:sequence>
-               </xs:complexType>
-       </xs:element>
-
-</xs:schema>
\ No newline at end of file
diff --git a/services/article/jaxb/src/main/resources/publicitems-common.xsd b/services/article/jaxb/src/main/resources/publicitems-common.xsd
new file mode 100644 (file)
index 0000000..c6d874b
--- /dev/null
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<!-- PublicitemsCommon XML Schema (XSD) Entity : PublicitemsCommon Used for: JAXB 
+       binding between XML and Java objects $LastChangedRevision$ $LastChangedDate$ -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="1.0"
+       elementFormDefault="unqualified" xmlns:ns="http://collectionspace.org/services/publicitem"
+       xmlns="http://collectionspace.org/services/publicitem" targetNamespace="http://collectionspace.org/services/publicitem"
+       version="0.1">
+
+       <!-- Avoid XmlRootElement nightmare: See http://weblogs.java.net/blog/kohsuke/archive/2006/03/why_does_jaxb_p.html -->
+       <xs:element name="publicitems_common">
+               <xs:complexType>
+                       <xs:sequence>
+                               <xs:element name="itemNumber" type="xs:string" />                               <!-- An identifier for the publicitem (different than the CSID) -->
+                               <xs:element name="contentName" type="xs:string" />                              <!-- A name for the publicitem's content  -->
+                               <xs:element name="contentId" type="xs:string" />                                <!-- The the ID of the content blob in the back-end repository -->
+                               <xs:element name="contentUri" type="xs:string" />                               <!-- The publicly accessible URL of the publicitem's content -->        
+                               <xs:element name="contentCreationJobId" type="xs:string" />             <!-- The asynch job ID -if any -->
+                               <xs:element name="contentSource" type="xs:string" />                    <!-- The name of the service/resource that was used to create the publicitem. -->
+                               <xs:element name="contentExpirationDate" type="xs:dateTime" />  <!-- When the publicitem is no longer available for access -->
+                               <xs:element name="contentAccessedCount" type="xs:integer" />    <!-- How many times the publicitem has been accessed. -->
+                               <xs:element name="contentAccessCountLimit" type="xs:integer" /> <!-- The maximum times the publicitem can be accessed. -->
+                       </xs:sequence>
+               </xs:complexType>
+       </xs:element>
+
+</xs:schema>
\ No newline at end of file
index 9efdae2d0fbce71d8485b72f3130a69dc7abe1a9..6bbb441ffae653ef51fb64d043b201802095d6da 100644 (file)
@@ -8,8 +8,8 @@
     </parent>
     
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.collectionspace.services.article</artifactId>
-    <name>services.article</name>
+    <artifactId>org.collectionspace.services.publicitem</artifactId>
+    <name>services.publicitem</name>
     <packaging>pom</packaging>
 
     <dependencies>
index 696554f01b1d9ad1c2aad2160be6cb275a924794..e9d7dd1d18c6976924155e53e952f7d351a5d3d0 100644 (file)
@@ -3,13 +3,13 @@
 
     <parent>
         <groupId>org.collectionspace.services</groupId>
-        <artifactId>org.collectionspace.services.article</artifactId>        
+        <artifactId>org.collectionspace.services.publicitem</artifactId>        
         <version>3.2.1-SNAPSHOT</version>
     </parent>
     
     <modelVersion>4.0.0</modelVersion>
-    <artifactId>org.collectionspace.services.article.service</artifactId>
-    <name>services.article.service</name>
+    <artifactId>org.collectionspace.services.publicitem.service</artifactId>
+    <name>services.publicitem.service</name>
     <packaging>jar</packaging>       
 
     <dependencies>
         </dependency>
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.article.jaxb</artifactId>
+            <artifactId>org.collectionspace.services.publicitem.jaxb</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.article.client</artifactId>
+            <artifactId>org.collectionspace.services.publicitem.client</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
@@ -98,7 +98,7 @@
     </dependencies>
     
     <build>
-        <finalName>collectionspace-services-article</finalName>
+        <finalName>collectionspace-services-publicitem</finalName>
     </build>
 </project>
 
similarity index 92%
rename from services/article/service/src/main/java/org/collectionspace/services/article/nuxeo/ArticleConstants.java
rename to services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemConstants.java
index a645ea40fe113403d1994f5e6e857ff045660cf1..0a45c67b9f42f10f1cbb16698025b12f3cd80136 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.collectionspace.services.article.nuxeo;
+package org.collectionspace.services.publicitem.nuxeo;
 
 /**
  * ArticleConstants specifies constants for the Articles In service
  *
  */
-public class ArticleConstants {
+public class PublicItemConstants {
     public final static String NUXEO_DOCTYPE = "Article";
     public final static String NUXEO_SCHEMA_NAME = "article";
     public final static String NUXEO_DC_TITLE = "CollectionSpace-Article";
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.collectionspace.services.article.nuxeo;
+package org.collectionspace.services.publicitem.nuxeo;
 
-import org.collectionspace.services.ArticlesCommonJAXBSchema;
-import org.collectionspace.services.article.ArticlesCommon;
-import org.collectionspace.services.client.ArticleClient;
+import javax.ws.rs.core.UriInfo;
+
+import org.collectionspace.services.PublicitemsCommonJAXBSchema;
+import org.collectionspace.services.article.PublicitemsCommon;
+import org.collectionspace.services.client.PublicItemClient;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.nuxeo.client.java.DocHandlerBase;
 import org.nuxeo.ecm.core.api.DocumentModel;
@@ -34,8 +36,8 @@ import org.nuxeo.ecm.core.api.DocumentModel;
  *  $LastChangedRevision$
  *  $LastChangedDate$
  */
-public class ArticleDocumentModelHandler
-        extends DocHandlerBase<ArticlesCommon> {
+public class PublicItemDocumentModelHandler
+        extends DocHandlerBase<PublicitemsCommon> {
        
        @Override
        public void fillAllParts(DocumentWrapper<DocumentModel> wrapDoc, Action action) throws Exception {
@@ -49,11 +51,27 @@ public class ArticleDocumentModelHandler
                // add it now.
                //
                DocumentModel documentModel = wrapDoc.getWrappedObject();
-               String url = (String) documentModel.getProperty(ArticleClient.SERVICE_COMMON_PART_NAME,
-                               ArticlesCommonJAXBSchema.ARTICLE_CONTENT_URL);
-               url = url.replace(ArticleClient.CSID_PATH_PARAM_VAR, documentModel.getName());
-               documentModel.setProperty(ArticleClient.SERVICE_COMMON_PART_NAME,
-                               ArticlesCommonJAXBSchema.ARTICLE_CONTENT_URL, url);
+               String url = (String) documentModel.getProperty(PublicItemClient.SERVICE_COMMON_PART_NAME,
+                               PublicitemsCommonJAXBSchema.ITEM_CONTENT_URI);
+               url = url.replace(PublicItemClient.CSID_PATH_PARAM_VAR, documentModel.getName());
+               documentModel.setProperty(PublicItemClient.SERVICE_COMMON_PART_NAME,
+                               PublicitemsCommonJAXBSchema.ITEM_CONTENT_URI, url);
        }
+       
+    @Override
+    public void extractAllParts(DocumentWrapper<DocumentModel> wrapDoc)
+            throws Exception {
+       //
+       // Replace the URI with a fully qualified URL
+       //
+        DocumentModel documentModel = wrapDoc.getWrappedObject();
+               String itemContentUri = (String) documentModel.getProperty(PublicItemClient.SERVICE_COMMON_PART_NAME,
+                               PublicitemsCommonJAXBSchema.ITEM_CONTENT_URI);        
+        UriInfo uriInfo = this.getServiceContext().getUriInfo();
+        String baseUrl = uriInfo.getBaseUri().toString();
+        String url = String.format("%s%s", baseUrl, itemContentUri);
+               documentModel.setProperty(PublicItemClient.SERVICE_COMMON_PART_NAME,
+                               PublicitemsCommonJAXBSchema.ITEM_CONTENT_URI, url);
+    }  
 }
 
@@ -1,4 +1,4 @@
-package org.collectionspace.services.article.nuxeo;
+package org.collectionspace.services.publicitem.nuxeo;
 
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.InvalidDocumentException;
@@ -7,13 +7,13 @@ import org.collectionspace.services.common.document.DocumentHandler.Action;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 
-public class ArticleValidatorHandler implements ValidatorHandler<PoxPayloadIn, PoxPayloadOut> {
+public class PublicItemValidatorHandler implements ValidatorHandler<PoxPayloadIn, PoxPayloadOut> {
 
        @Override
        public void validate(Action action, ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx)
                        throws InvalidDocumentException {
                // TODO Auto-generated method stub
-               System.out.println("ArticleValidatorHandler executed.");
+               System.out.println("PublicItemValidatorHandler executed.");
 
        }
 
similarity index 50%
rename from services/article/service/src/test/java/org/collectionspace/services/test/ArticleServiceTest.java
rename to services/article/service/src/test/java/org/collectionspace/services/test/PublicItemServiceTest.java
index 56fb8901fae5d12cb139382e9dc19c732e6f48f9..b33974f83d9cb4635e0cd97abbb00b2a9bf8e254 100644 (file)
@@ -1,13 +1,10 @@
 package org.collectionspace.services.test;
 
-//import org.collectionspace.services.article.Article;
-//import org.collectionspace.services.article.ArticleList;
-
 /**
  * Placeholder for server-side testing of Articles service code.
  * 
  * @version $Revision$
  */
-public class ArticleServiceTest {
+public class PublicItemServiceTest {
        //empty
 }
index edd22d65c4e4807ac8f3f0a4d99b180a7d763b8a..d64214814c3f3d36024d558ebb928068acb63715 100644 (file)
@@ -23,7 +23,7 @@
  */
 package org.collectionspace.services.blob;
 
-import org.collectionspace.services.article.ArticlesCommon;
+import org.collectionspace.services.article.PublicitemsCommon;
 import org.collectionspace.services.client.BlobClient;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PayloadPart;
@@ -294,7 +294,7 @@ public class BlobResource extends ResourceBase {
                        BlobsCommon blobsCommon = getBlobsCommon(csid);
                StringBuffer mimeType = new StringBuffer();
                InputStream contentStream = getBlobContent(ctx, csid, null /*derivative term*/, mimeType /*will get set*/);             
-               result = ArticleUtil.publishToRepository((ArticlesCommon)null, resourceMap, uriInfo, 
+               result = ArticleUtil.publishToRepository((PublicitemsCommon)null, resourceMap, uriInfo, 
                                getRepositoryClient(ctx), ctx, contentStream, blobsCommon.getName());
        } catch (Exception e) {
                throw bigReThrow(e, ServiceMessages.PUT_FAILED);
@@ -318,7 +318,7 @@ public class BlobResource extends ResourceBase {
                                BlobsCommon blobsCommon = getBlobsCommon(csid);
                        StringBuffer mimeType = new StringBuffer();
                        InputStream contentStream = getBlobContent(ctx, csid, derivativeTerm, mimeType);
-                       result = ArticleUtil.publishToRepository((ArticlesCommon)null, resourceMap, uriInfo, 
+                       result = ArticleUtil.publishToRepository((PublicitemsCommon)null, resourceMap, uriInfo, 
                                        getRepositoryClient(ctx), ctx, contentStream, blobsCommon.getName());
                } catch (Exception e) {
                        throw bigReThrow(e, ServiceMessages.CREATE_FAILED);
index ae25c8e1098a0b2c71610476290d49bf28630bcb..7f14e40c3519d691852864e3273f02b8a759e547 100644 (file)
@@ -26,8 +26,8 @@ package org.collectionspace.services.common.article;
 import java.io.InputStream;
 
 import org.collectionspace.authentication.spi.AuthNContext;
-import org.collectionspace.services.article.ArticlesCommon;
-import org.collectionspace.services.client.ArticleClient;
+import org.collectionspace.services.article.PublicitemsCommon;
+import org.collectionspace.services.client.PublicItemClient;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.ResourceBase;
@@ -51,7 +51,7 @@ import javax.ws.rs.core.Request;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
-@Path(ArticleClient.SERVICE_PATH)
+@Path(PublicItemClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
 public class ArticleResource extends ResourceBase {
@@ -66,12 +66,12 @@ public class ArticleResource extends ResourceBase {
     
     @Override
     public String getServiceName() {
-        return ArticleClient.SERVICE_NAME;
+        return PublicItemClient.SERVICE_NAME;
     }
 
     @Override
-    public Class<ArticlesCommon> getCommonPartClass() {
-       return ArticlesCommon.class;
+    public Class<PublicitemsCommon> getCommonPartClass() {
+       return PublicitemsCommon.class;
     }
 
        @Override
@@ -81,7 +81,7 @@ public class ArticleResource extends ResourceBase {
        }
        
     @GET
-    @Path("/{csid}/{tenantId}/" + ArticleClient.PUBLICITEMS_CONTENT_SUFFIX) // "content"
+    @Path("/{csid}/{tenantId}/" + PublicItemClient.PUBLICITEMS_CONTENT_SUFFIX) // "content"
     public Response getPublishedResource(
             @Context Request request,
             @Context UriInfo uriInfo,
@@ -95,7 +95,7 @@ public class ArticleResource extends ResourceBase {
                //
                        RemoteServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = (RemoteServiceContext<PoxPayloadIn, PoxPayloadOut>) createServiceContext(uriInfo);
                        PoxPayloadOut poxPayloadOut = get(csid, ctx);
-                       ArticlesCommon articlesCommon = (ArticlesCommon)poxPayloadOut.getPart(ArticleClient.SERVICE_COMMON_PART_NAME).getBody();
+                       PublicitemsCommon articlesCommon = (PublicitemsCommon)poxPayloadOut.getPart(PublicItemClient.SERVICE_COMMON_PART_NAME).getBody();
                        //
                        // Get the repository blob ID and retrieve the content as a stream
                        //
index b03c5a6f214bf11f3ae01666913373a17c6a9b39..6c63ba1eb0af0617743021f96a01408c05d0907d 100644 (file)
@@ -5,9 +5,9 @@ import java.io.InputStream;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
-import org.collectionspace.services.article.ArticlesCommon;
+import org.collectionspace.services.article.PublicitemsCommon;
 import org.collectionspace.services.blob.BlobsCommon;
-import org.collectionspace.services.client.ArticleClient;
+import org.collectionspace.services.client.PublicItemClient;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.common.ResourceMap;
@@ -21,29 +21,29 @@ public class ArticleUtil {
        /*
         * Sets common fields for an ArticlesCommon instance
         */
-       private static ArticlesCommon setArticlesCommonMetadata(
-                       ArticlesCommon articlesCommon,
+       private static PublicitemsCommon setArticlesCommonMetadata(
+                       PublicitemsCommon articlesCommon,
                        UriInfo uriInfo,
                ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx) {
-               ArticlesCommon result = articlesCommon;
+               PublicitemsCommon result = articlesCommon;
                
                if (result == null) {
-                       result = new ArticlesCommon(); // If they passed in null, we'll create a new instance
+                       result = new PublicitemsCommon(); // If they passed in null, we'll create a new instance
                }
                
-               String articleSource = result.getArticleSource();
-               if (articleSource == null || articleSource.trim().isEmpty()) {
+               String itemSource = result.getItemSource();
+               if (itemSource == null || itemSource.trim().isEmpty()) {
                String publishingService = parentCtx.getServiceName(); // Overrides any existing value
-               result.setArticleSource(publishingService);
+               result.setItemSource(publishingService);
                }
        
-       String publicUrl = String.format("%s%s/%s/%s/%s",       // e.g., http://{base url}/articles/{csid}/{tenant ID}/content
-                       uriInfo.getBaseUri().toString(),                        // the base part of the URL
-                       ArticleClient.SERVICE_NAME,                                     // the base service path to the Article service
-                       ArticleClient.CSID_PATH_PARAM_VAR,                      // the {csid} param part that will be filled in later in ArticleDocumentModelHandler.fillAllParts() method
-                       parentCtx.getTenantId(),                                        // the tenant ID part
-                       ArticleClient.PUBLICITEMS_CONTENT_SUFFIX);      // the final "content" suffix
-       result.setArticleContentUrl(publicUrl);
+       String publicUri = String.format("%s/%s/%s/%s",                 // e.g., publicitems/{csid}/{tenant ID}/content
+//                     uriInfo.getBaseUri().toString(),                                // the base part of the URL
+                       PublicItemClient.SERVICE_NAME,                                  // the base service path to the Article service
+                       PublicItemClient.CSID_PATH_PARAM_VAR,                   // the {csid} param part that will be filled in later in ArticleDocumentModelHandler.fillAllParts() method
+                       parentCtx.getTenantId(),                                                // the tenant ID part
+                       PublicItemClient.PUBLICITEMS_CONTENT_SUFFIX);   // the final "content" suffix
+       result.setItemContentUri(publicUri);
        
                return result;
        }
@@ -52,7 +52,7 @@ public class ArticleUtil {
         * Publishes a PoxPayloadOut instance for public access
         */
        public static Response publishToRepository(
-                       ArticlesCommon articlesCommon,
+                       PublicitemsCommon articlesCommon,
                        ResourceMap resourceMap,
                UriInfo uriInfo,
                ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx,
@@ -60,8 +60,8 @@ public class ArticleUtil {
                Response result = null;
                
        articlesCommon = setArticlesCommonMetadata(articlesCommon, uriInfo, parentCtx);
-       PoxPayloadIn input = new PoxPayloadIn(ArticleClient.SERVICE_PAYLOAD_NAME, articlesCommon, 
-                       ArticleClient.SERVICE_COMMON_PART_NAME);
+       PoxPayloadIn input = new PoxPayloadIn(PublicItemClient.SERVICE_PAYLOAD_NAME, articlesCommon, 
+                       PublicItemClient.SERVICE_COMMON_PART_NAME);
                
        ArticleResource articleResource = new ArticleResource();
        result = articleResource.create(parentCtx, resourceMap, uriInfo, input.getXmlPayload());
@@ -73,7 +73,7 @@ public class ArticleUtil {
         * Publishes a a byte stream for public access
         */
        public static Response publishToRepository(
-                       ArticlesCommon articlesCommon,
+                       PublicitemsCommon articlesCommon,
                        ResourceMap resourceMap,
                UriInfo uriInfo,
                RepositoryClient<PoxPayloadIn, PoxPayloadOut> repositoryClient,
@@ -86,11 +86,11 @@ public class ArticleUtil {
                        inputStream, streamName, false);
                
        articlesCommon = setArticlesCommonMetadata(articlesCommon, uriInfo, parentCtx);
-       articlesCommon.setArticleContentRepositoryId(blobsCommon.getRepositoryId());
-       articlesCommon.setArticleContentName(streamName);
+       articlesCommon.setItemContentId(blobsCommon.getRepositoryId());
+       articlesCommon.setItemContentName(streamName);
        
-       PoxPayloadOut poxPayloadOut = new PoxPayloadOut(ArticleClient.SERVICE_PAYLOAD_NAME);
-       poxPayloadOut.addPart(ArticleClient.SERVICE_COMMON_PART_NAME, articlesCommon);
+       PoxPayloadOut poxPayloadOut = new PoxPayloadOut(PublicItemClient.SERVICE_PAYLOAD_NAME);
+       poxPayloadOut.addPart(PublicItemClient.SERVICE_COMMON_PART_NAME, articlesCommon);
        
        ArticleResource articleResource = new ArticleResource();
        result = articleResource.create(parentCtx, resourceMap, uriInfo, poxPayloadOut.toXML());
index 16b50717253bb8d857a9bdc830eb931369c3d8ad..884b614764b446a3ff9055c045fa6188147b5b1c 100644 (file)
@@ -69,13 +69,11 @@ import org.collectionspace.services.common.storage.jpa.JpaStorageUtils;
 import org.collectionspace.services.common.api.CommonAPI;
 import org.collectionspace.services.common.api.RefNameUtils;
 import org.collectionspace.services.common.api.Tools;
-import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils;
 import org.collectionspace.services.common.vocabulary.RefNameServiceUtils.AuthRefConfigInfo;
 import org.collectionspace.services.config.service.DocHandlerParams;
 import org.collectionspace.services.config.service.ListResultField;
 import org.collectionspace.services.config.service.ObjectPartType;
-import org.collectionspace.services.config.service.ServiceBindingType;
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
 import org.collectionspace.services.relation.RelationsCommon;
 import org.collectionspace.services.relation.RelationsCommonList;
index 3657d6c750dec3f788c29b3aeebcf3b9a5f849b5..f6f6c9f3f18dfa3d5612161085aae9a56a60aa33 100644 (file)
@@ -27,7 +27,7 @@ import java.io.InputStream;
 
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.report.nuxeo.ReportDocumentModelHandler;
-import org.collectionspace.services.article.ArticlesCommon;
+import org.collectionspace.services.article.PublicitemsCommon;
 import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -171,7 +171,7 @@ public class ReportResource extends ResourceBase {
             StringBuffer outReportFileName = new StringBuffer();
             ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext();
             InputStream reportInputStream = invokeReport(ctx, csid, invContext, outMimeType, outReportFileName);            
-            response = ArticleUtil.publishToRepository((ArticlesCommon)null, resourceMap, uriInfo, getRepositoryClient(ctx), ctx, 
+            response = ArticleUtil.publishToRepository((PublicitemsCommon)null, resourceMap, uriInfo, getRepositoryClient(ctx), ctx, 
                        reportInputStream, outReportFileName.toString());
         } catch (Exception e) {
             throw bigReThrow(e, ServiceMessages.POST_FAILED);