]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-5564: More changes related to name change from 'articles' to 'publicitems'
authorRichard Millet <remillet@berkeley.edu>
Tue, 29 Jan 2013 21:38:37 +0000 (13:38 -0800)
committerRichard Millet <remillet@berkeley.edu>
Tue, 29 Jan 2013 21:38:37 +0000 (13:38 -0800)
39 files changed:
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java
services/JaxRsServiceProvider/src/main/webapp/WEB-INF/applicationContext-security.xml
services/article/jaxb/src/main/java/org/collectionspace/services/PublicitemsCommonJAXBSchema.java [deleted file]
services/blob/service/pom.xml
services/blob/service/src/main/java/org/collectionspace/services/blob/BlobResource.java
services/build.xml
services/common/pom.xml
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
services/common/src/main/java/org/collectionspace/services/common/CollectionSpaceResource.java
services/common/src/main/java/org/collectionspace/services/common/publicitem/PublicItemResource.java [moved from services/common/src/main/java/org/collectionspace/services/common/article/ArticleResource.java with 87% similarity]
services/common/src/main/java/org/collectionspace/services/common/publicitem/PublicItemUtil.java [moved from services/common/src/main/java/org/collectionspace/services/common/article/ArticleUtil.java with 61% similarity]
services/common/src/main/java/org/collectionspace/services/common/workflow/service/nuxeo/WorkflowDocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java
services/pom.xml
services/publicitem/3rdparty/build.xml [moved from services/article/3rdparty/build.xml with 100% similarity]
services/publicitem/3rdparty/nuxeo-platform-cs-publicitem/build.xml [moved from services/article/3rdparty/nuxeo-platform-cs-publicitem/build.xml with 100% similarity]
services/publicitem/3rdparty/nuxeo-platform-cs-publicitem/pom.xml [moved from services/article/3rdparty/nuxeo-platform-cs-publicitem/pom.xml with 100% similarity]
services/publicitem/3rdparty/nuxeo-platform-cs-publicitem/src/main/resources/schemas/publicitems_common.xsd [moved from services/article/3rdparty/nuxeo-platform-cs-publicitem/src/main/resources/schemas/publicitems_common.xsd with 100% similarity]
services/publicitem/3rdparty/pom.xml [moved from services/article/3rdparty/pom.xml with 100% similarity]
services/publicitem/build.xml [moved from services/article/build.xml with 100% similarity]
services/publicitem/client/pom.xml [moved from services/article/client/pom.xml with 100% similarity]
services/publicitem/client/src/main/java/org/collectionspace/services/client/PublicItemClient.java [moved from services/article/client/src/main/java/org/collectionspace/services/client/PublicItemClient.java with 95% similarity]
services/publicitem/client/src/main/java/org/collectionspace/services/client/PublicItemProxy.java [moved from services/article/client/src/main/java/org/collectionspace/services/client/PublicItemProxy.java with 97% similarity]
services/publicitem/client/src/test/java/org/collectionspace/services/client/test/PublicItemServiceTest.java [moved from services/article/client/src/test/java/org/collectionspace/services/client/test/PublicItemServiceTest.java with 100% similarity]
services/publicitem/jaxb/pom.xml [moved from services/article/jaxb/pom.xml with 100% similarity]
services/publicitem/jaxb/src/main/java/org/collectionspace/services/PublicitemsCommonJAXBSchema.java [new file with mode: 0644]
services/publicitem/jaxb/src/main/resources/publicitems-common.xsd [moved from services/article/jaxb/src/main/resources/publicitems-common.xsd with 100% similarity]
services/publicitem/pom.xml [moved from services/article/pom.xml with 100% similarity]
services/publicitem/service/pom.xml [moved from services/article/service/pom.xml with 100% similarity]
services/publicitem/service/profiles.xml [moved from services/article/service/profiles.xml with 100% similarity]
services/publicitem/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemConstants.java [moved from services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemConstants.java with 83% similarity]
services/publicitem/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemDocumentModelHandler.java [moved from services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemDocumentModelHandler.java with 89% similarity]
services/publicitem/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemValidatorHandler.java [moved from services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemValidatorHandler.java with 100% similarity]
services/publicitem/service/src/test/java/org/collectionspace/services/test/PublicItemServiceTest.java [moved from services/article/service/src/test/java/org/collectionspace/services/test/PublicItemServiceTest.java with 65% similarity]
services/publicitem/service/src/test/resources/log4j.xml [moved from services/article/service/src/test/resources/log4j.xml with 100% similarity]
services/report/client/src/test/java/org/collectionspace/services/client/test/ReportServiceTest.java
services/report/service/src/main/java/org/collectionspace/services/report/ReportResource.java

index c5bdd1591518a397a66b4e372232bc33b96d6e01..d3bd9887cbb17a4c3ab79b90c391f77eb124bc70 100644 (file)
         </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.article.service</artifactId>\r
+            <artifactId>org.collectionspace.services.publicitem.service</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
         <dependency>\r
index cfee42fc2474a87af4c500b9d43029d0ebebc747..ccea44fb7fc40dd9e23079b35ce408e278b2feff 100644 (file)
@@ -65,7 +65,7 @@ import org.collectionspace.services.common.ResourceBase;
 import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.ResourceMapHolder;
 import org.collectionspace.services.common.ResourceMapImpl;
-import org.collectionspace.services.common.article.ArticleResource;
+import org.collectionspace.services.common.publicitem.PublicItemResource;
 import org.collectionspace.services.common.relation.RelationResource;
 import org.collectionspace.services.common.security.SecurityInterceptor;
 
@@ -121,7 +121,7 @@ public class CollectionSpaceJaxRsApplication extends Application
         addResourceToMapAndSingletons(new BlobResource());
         addResourceToMapAndSingletons(new MovementResource());
         addResourceToMapAndSingletons(new ReportResource());
-        addResourceToMapAndSingletons(new ArticleResource());
+        addResourceToMapAndSingletons(new PublicItemResource());
 
         singletons.add(new IDResource());
         
index 2e6b6f69a966ffd98bbdc49f15d6e4533bbd2cb6..a6750477b1dd46df05f59651cca776aebaad0efc 100644 (file)
@@ -27,7 +27,7 @@
           class="org.springframework.security.web.FilterChainProxy">
         <sec:filter-chain-map path-type="ant">
                        <!-- Exclude the resource path to public items' content from AuthN and AuthZ.  Let's us publish resources with anonymous access. -->
-                       <sec:filter-chain pattern="/articles/*/*/content"
+                       <sec:filter-chain pattern="/publicitems/*/*/content"
                               filters="none"/>
             <sec:filter-chain pattern="/**"
                               filters="securityContextPersistenceFilter,basicAuthenticationFilter,logoutFilter,exTranslationFilter,filterInvocationInterceptor"/>
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
deleted file mode 100644 (file)
index 70516cb..0000000
+++ /dev/null
@@ -1,34 +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="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
index a660fc6a2f23c834aa4eb9877b08dfb88689d4d9..a1f122f516055b9829270eabf840a18e7bbdb2e1 100644 (file)
@@ -35,7 +35,7 @@
         </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>
         
@@ -93,7 +93,6 @@
         <dependency>
             <groupId>org.nuxeo.ecm.core</groupId>
             <artifactId>nuxeo-core-api</artifactId>
-            <version>${nuxeo.core.version}</version>
             <exclusions>
                 <exclusion>
                     <artifactId>jboss-remoting</artifactId>
index d64214814c3f3d36024d558ebb928068acb63715..407515ca61cd90130f59aab24a3c0e356412ed45 100644 (file)
@@ -23,7 +23,7 @@
  */
 package org.collectionspace.services.blob;
 
-import org.collectionspace.services.article.PublicitemsCommon;
+import org.collectionspace.services.publicitem.PublicitemsCommon;
 import org.collectionspace.services.client.BlobClient;
 import org.collectionspace.services.client.PayloadOutputPart;
 import org.collectionspace.services.client.PayloadPart;
@@ -33,10 +33,10 @@ import org.collectionspace.services.common.FileUtils;
 import org.collectionspace.services.common.ResourceBase;
 import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.ServiceMessages;
-import org.collectionspace.services.common.article.ArticleUtil;
 import org.collectionspace.services.common.blob.BlobInput;
 import org.collectionspace.services.common.blob.BlobUtil;
 import org.collectionspace.services.common.context.ServiceContext;
+import org.collectionspace.services.common.publicitem.PublicItemUtil;
 import org.collectionspace.services.nuxeo.client.java.CommonList;
 import org.jboss.resteasy.plugins.providers.multipart.InputPart;
 import org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput;
@@ -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((PublicitemsCommon)null, resourceMap, uriInfo, 
+               result = PublicItemUtil.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((PublicitemsCommon)null, resourceMap, uriInfo, 
+                       result = PublicItemUtil.publishToRepository((PublicitemsCommon)null, resourceMap, uriInfo, 
                                        getRepositoryClient(ctx), ctx, contentStream, blobsCommon.getName());
                } catch (Exception e) {
                        throw bigReThrow(e, ServiceMessages.CREATE_FAILED);
index 12678eadc89e8fd2c0c3ab65838f34b1564246ef..d6a1f0853015caffc557566e326db1d2379b294e 100644 (file)
         <ant antfile="acquisition/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="dimension/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="contact/build.xml" target="deploy" inheritAll="false"/>\r
-        <ant antfile="article/build.xml" target="deploy" inheritAll="false"/>\r
+        <ant antfile="publicitem/build.xml" target="deploy" inheritAll="false"/>\r
         <ant antfile="JaxRsServiceProvider/build.xml" target="deploy" inheritAll="false"/>\r
     </target>\r
 \r
         <ant antfile="vocabulary/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="organization/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="person/build.xml" target="undeploy" inheritAll="false"/>\r
-        <ant antfile="article/build.xml" target="undeploy" inheritAll="false"/>\r
+        <ant antfile="publicitem/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="contact/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="dimension/build.xml" target="undeploy" inheritAll="false"/>\r
         <ant antfile="acquisition/build.xml" target="undeploy" inheritAll="false"/>\r
index 284753867cb724e92343e6464e0466e388582f9b..091a6ad301b34da34bdcdc72545bd2dd344c5cb8 100644 (file)
         </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.article.client</artifactId>\r
+            <artifactId>org.collectionspace.services.publicitem.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.article.jaxb</artifactId>\r
+            <artifactId>org.collectionspace.services.publicitem.jaxb</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
         <!-- \r
index a79b5cc8238976a8c85531afc8d690ad27c5af60..40f58a3dd5ee190d261cd5a0dd5a8a502abc8223 100644 (file)
         </tenant:serviceBindings>
         <!-- end account service meta-data -->
     
-        <!-- begin Article service meta-data -->
-        <tenant:serviceBindings id="Articles" name="Articles" type="procedure" version="0.1">
+        <!-- begin PublicItem service meta-data -->
+        <tenant:serviceBindings id="PublicItems" name="PublicItems" type="procedure" version="0.1">
             <!-- other URI paths through which this service could be accessed -->
             <!--
             <service:uriPath xmlns:service='http://collectionspace.org/services/config/service'>
-                /articles/*/authorityrefs/
+                /publicitems/*/authorityrefs/
             </service:uriPath>
             -->
             <service:repositoryDomain xmlns:service="http://collectionspace.org/services/config/service">default-domain</service:repositoryDomain>
-            <service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.article.nuxeo.ArticleDocumentModelHandler</service:documentHandler>
+            <service:documentHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.publicitem.nuxeo.PublicItemDocumentModelHandler</service:documentHandler>
             <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/config/service">
                 <service:params>
                     <service:ListResultsFields>
                         <service:ListResultField>
-                            <service:element>articleNumber</service:element>
-                            <service:xpath>articleNumber</service:xpath>
+                            <service:element>itemNumber</service:element>
+                            <service:xpath>itemNumber</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:element>articleSource</service:element>
-                            <service:xpath>articleSource</service:xpath>
+                            <service:element>contentSource</service:element>
+                            <service:xpath>contentSource</service:xpath>
                         </service:ListResultField>
                         <service:ListResultField>
-                            <service:element>articleContentUrl</service:element>
-                            <service:xpath>articleContentUrl</service:xpath>
-                        </service:ListResultField>                  
+                            <service:element>contentUri</service:element>
+                            <service:xpath>contentUri</service:xpath>
+                        </service:ListResultField>
                     </service:ListResultsFields>
                 </service:params>
             </service:DocHandlerParams>
-            <service:validatorHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.article.nuxeo.ArticleValidatorHandler</service:validatorHandler>
+            <service:validatorHandler xmlns:service="http://collectionspace.org/services/config/service">org.collectionspace.services.publicitem.nuxeo.PublicItemValidatorHandler</service:validatorHandler>
             <service:properties xmlns:service="http://collectionspace.org/services/config/service">
                 <types:item xmlns:types="http://collectionspace.org/services/config/types">
                     <types:key>objectNameProperty</types:key>
-                    <types:value>articleContentCsid</types:value>
+                    <types:value>contentName</types:value>
                 </types:item>
                 <types:item xmlns:types="http://collectionspace.org/services/config/types">
                     <types:key>objectNumberProperty</types:key>
-                    <types:value>articleNumber</types:value>
+                    <types:value>itemNumber</types:value>
                 </types:item>
             </service:properties>
-            <service:object xmlns:service="http://collectionspace.org/services/config/service" name="Article" version="0.1">
-                <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="articles-system" updated="" order="0">
+            <service:object xmlns:service="http://collectionspace.org/services/config/service" name="PublicItem" version="0.1">
+                <service:part id="0" control_group="Managed" versionable="true" auditable="false" label="publicitems-system" updated="" order="0">
                     <service:content contentType="application/xml">
                         <service:xmlContent namespaceURI="http://collectionspace.org/services/config/system" schemaLocation="http://collectionspace.org/services/config/system http://collectionspace.org/services/config/system/system-response.xsd" />
                     </service:content>
                 </service:part>
-                <service:part id="1" control_group="Managed" versionable="true" auditable="false" label="articles_common" updated="" order="1">
+                <service:part id="1" control_group="Managed" versionable="true" auditable="false" label="publicitems_common" updated="" order="1">
                     <service:properties>
                         <!-- Fields containing authority term references -->
                         <!-- Fields containing term list / controlled vocabulary references -->
                     </service:properties>
                     <service:content contentType="application/xml">
-                        <service:xmlContent namespaceURI="http://collectionspace.org/services/article" schemaLocation="http://collectionspace.org/services/article http://services.collectionspace.org/article/articles_common.xsd" />
+                        <service:xmlContent namespaceURI="http://collectionspace.org/services/publicitem" schemaLocation="http://collectionspace.org/services/publicitem http://services.collectionspace.org/publicitem/publicitems_common.xsd" />
                     </service:content>
                 </service:part>
                 <service:part id="2" control_group="Managed" versionable="true" auditable="false" label="collectionspace_core" updated="" order="2">
                 </service:part>
             </service:object>
         </tenant:serviceBindings>
-        <!-- end Article service meta-data -->    
+        <!-- end PublicItem service meta-data -->    
     
         <!-- begin dimension service meta-data -->
         <tenant:serviceBindings id="Dimensions" name="Dimensions" type="utility" version="0.1">
index 5e34217e1148d238bccd75f1e666e2eaa7ed0fa5..c8bec4b507198e33c2039eea426d695b4ab59d52 100644 (file)
@@ -90,10 +90,10 @@ public interface CollectionSpaceResource<IT, OT> {
      * Returns true if this resource allow anonymous access.  It addition to returning 'true', this
      * resources base URL path needs to be declared in the Spring Security config file's 'springSecurityFilterChain' bean.
      * There needs to be a 'filter-chain' element something like the following:
-                       <sec:filter-chain pattern="/articles/**"
-                              filters="none"/>
      * See the "applicationContext-security.xml" file for details.
      */
+//                     <sec:filter-chain pattern="/publicitems/*/*/content"
+//                              filters="none"/>
        public boolean allowAnonymousAccess(HttpRequest request, ResourceMethod method);
     
 }
similarity index 87%
rename from services/common/src/main/java/org/collectionspace/services/common/article/ArticleResource.java
rename to services/common/src/main/java/org/collectionspace/services/common/publicitem/PublicItemResource.java
index 7f14e40c3519d691852864e3273f02b8a759e547..e0d80e1977f1bb26c17c808eeda023ee0c48c835 100644 (file)
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.collectionspace.services.common.article;
+package org.collectionspace.services.common.publicitem;
 
 import java.io.InputStream;
 
 import org.collectionspace.authentication.spi.AuthNContext;
-import org.collectionspace.services.article.PublicitemsCommon;
+import org.collectionspace.services.publicitem.PublicitemsCommon;
 import org.collectionspace.services.client.PublicItemClient;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -54,9 +54,9 @@ import javax.ws.rs.core.UriInfo;
 @Path(PublicItemClient.SERVICE_PATH)
 @Consumes("application/xml")
 @Produces("application/xml")
-public class ArticleResource extends ResourceBase {
+public class PublicItemResource extends ResourceBase {
 
-    final Logger logger = LoggerFactory.getLogger(ArticleResource.class);
+    final Logger logger = LoggerFactory.getLogger(PublicItemResource.class);
 
     @Override
     protected String getVersionString() {
@@ -91,15 +91,15 @@ public class ArticleResource extends ResourceBase {
 
         try {
                //
-               // First, extract the ArticlesCommon instance.
+               // First, extract the PublicitemsCommon instance.
                //
                        RemoteServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = (RemoteServiceContext<PoxPayloadIn, PoxPayloadOut>) createServiceContext(uriInfo);
                        PoxPayloadOut poxPayloadOut = get(csid, ctx);
-                       PublicitemsCommon articlesCommon = (PublicitemsCommon)poxPayloadOut.getPart(PublicItemClient.SERVICE_COMMON_PART_NAME).getBody();
+                       PublicitemsCommon publicitemsCommon = (PublicitemsCommon)poxPayloadOut.getPart(PublicItemClient.SERVICE_COMMON_PART_NAME).getBody();
                        //
                        // Get the repository blob ID and retrieve the content as a stream
                        //
-                       String blobContentCsid = articlesCommon.getArticleContentRepositoryId();
+                       String blobContentCsid = publicitemsCommon.getContentId();
                        StringBuffer outMimeType = new StringBuffer();
                        BlobOutput blobOutput = NuxeoBlobUtils.getBlobOutput(ctx, getRepositoryClient(ctx), blobContentCsid, outMimeType);
                        InputStream contentStream = blobOutput.getBlobInputStream();
@@ -108,7 +108,7 @@ public class ArticleResource extends ResourceBase {
                        //
                Response.ResponseBuilder responseBuilder = Response.ok(contentStream, outMimeType.toString());
                responseBuilder = responseBuilder.header("Content-Disposition","inline;filename=\""
-                               + articlesCommon.getArticleContentName() +"\"");
+                               + publicitemsCommon.getContentName() +"\"");
                result = responseBuilder.build();
                } catch (Exception e) {
             throw bigReThrow(e, ServiceMessages.READ_FAILED, csid);
similarity index 61%
rename from services/common/src/main/java/org/collectionspace/services/common/article/ArticleUtil.java
rename to services/common/src/main/java/org/collectionspace/services/common/publicitem/PublicItemUtil.java
index 6c63ba1eb0af0617743021f96a01408c05d0907d..0a3fc18d7e9c3dbd5f18a6d0be3217c82283451a 100644 (file)
@@ -1,11 +1,11 @@
-package org.collectionspace.services.common.article;
+package org.collectionspace.services.common.publicitem;
 
 import java.io.InputStream;
 
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.UriInfo;
 
-import org.collectionspace.services.article.PublicitemsCommon;
+import org.collectionspace.services.publicitem.PublicitemsCommon;
 import org.collectionspace.services.blob.BlobsCommon;
 import org.collectionspace.services.client.PublicItemClient;
 import org.collectionspace.services.client.PoxPayloadIn;
@@ -14,36 +14,39 @@ import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.TransactionException;
 import org.collectionspace.services.common.imaging.nuxeo.NuxeoBlobUtils;
+import org.collectionspace.services.common.publicitem.PublicItemResource;
 import org.collectionspace.services.common.repository.RepositoryClient;
 
-public class ArticleUtil {
+public class PublicItemUtil {
        
        /*
-        * Sets common fields for an ArticlesCommon instance
+        * Sets common fields for an PublicitemsCommon instance
         */
-       private static PublicitemsCommon setArticlesCommonMetadata(
-                       PublicitemsCommon articlesCommon,
+       private static PublicitemsCommon setCommonMetadata(
+                       PublicitemsCommon publicitemsCommon,
                        UriInfo uriInfo,
                ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx) {
-               PublicitemsCommon result = articlesCommon;
+               PublicitemsCommon result = publicitemsCommon;
                
                if (result == null) {
                        result = new PublicitemsCommon(); // If they passed in null, we'll create a new instance
                }
                
-               String itemSource = result.getItemSource();
+               String itemSource = result.getContentSource();
                if (itemSource == null || itemSource.trim().isEmpty()) {
                String publishingService = parentCtx.getServiceName(); // Overrides any existing value
-               result.setItemSource(publishingService);
+               result.setContentSource(publishingService);
                }
        
-       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
+               //
+               // Store just a partial URL -just the CollectionSpace specific URI without the base URL.
+               //
+       String publicUri = String.format("%s/%s/%s/%s",                 // e.g., publicitems/{tenant ID}/{csid}/content
+                       PublicItemClient.SERVICE_NAME,                                  // the base service path to the PublicItem service
+                       PublicItemClient.CSID_PATH_PARAM_VAR,                   // the {csid} param part that will be filled in later in PublicItemDocumentModelHandler.fillAllParts() method
                        parentCtx.getTenantId(),                                                // the tenant ID part
                        PublicItemClient.PUBLICITEMS_CONTENT_SUFFIX);   // the final "content" suffix
-       result.setItemContentUri(publicUri);
+       result.setContentUri(publicUri);
        
                return result;
        }
@@ -52,19 +55,19 @@ public class ArticleUtil {
         * Publishes a PoxPayloadOut instance for public access
         */
        public static Response publishToRepository(
-                       PublicitemsCommon articlesCommon,
+                       PublicitemsCommon publicitemsCommon,
                        ResourceMap resourceMap,
                UriInfo uriInfo,
                ServiceContext<PoxPayloadIn, PoxPayloadOut> parentCtx,
                        PoxPayloadOut poxPayloadOut) {
                Response result = null;
                
-       articlesCommon = setArticlesCommonMetadata(articlesCommon, uriInfo, parentCtx);
-       PoxPayloadIn input = new PoxPayloadIn(PublicItemClient.SERVICE_PAYLOAD_NAME, articlesCommon, 
+       publicitemsCommon = setCommonMetadata(publicitemsCommon, uriInfo, parentCtx);
+       PoxPayloadIn input = new PoxPayloadIn(PublicItemClient.SERVICE_PAYLOAD_NAME, publicitemsCommon, 
                        PublicItemClient.SERVICE_COMMON_PART_NAME);
                
-       ArticleResource articleResource = new ArticleResource();
-       result = articleResource.create(parentCtx, resourceMap, uriInfo, input.getXmlPayload());
+       PublicItemResource publicItemResource = new PublicItemResource();
+       result = publicItemResource.create(parentCtx, resourceMap, uriInfo, input.getXmlPayload());
        
                return result;
        }
@@ -73,7 +76,7 @@ public class ArticleUtil {
         * Publishes a a byte stream for public access
         */
        public static Response publishToRepository(
-                       PublicitemsCommon articlesCommon,
+                       PublicitemsCommon publicitemsCommon,
                        ResourceMap resourceMap,
                UriInfo uriInfo,
                RepositoryClient<PoxPayloadIn, PoxPayloadOut> repositoryClient,
@@ -85,15 +88,15 @@ public class ArticleUtil {
        BlobsCommon blobsCommon = NuxeoBlobUtils.createBlobInRepository(parentCtx, repositoryClient,
                        inputStream, streamName, false);
                
-       articlesCommon = setArticlesCommonMetadata(articlesCommon, uriInfo, parentCtx);
-       articlesCommon.setItemContentId(blobsCommon.getRepositoryId());
-       articlesCommon.setItemContentName(streamName);
+       publicitemsCommon = setCommonMetadata(publicitemsCommon, uriInfo, parentCtx);
+       publicitemsCommon.setContentId(blobsCommon.getRepositoryId());
+       publicitemsCommon.setContentName(streamName);
        
        PoxPayloadOut poxPayloadOut = new PoxPayloadOut(PublicItemClient.SERVICE_PAYLOAD_NAME);
-       poxPayloadOut.addPart(PublicItemClient.SERVICE_COMMON_PART_NAME, articlesCommon);
+       poxPayloadOut.addPart(PublicItemClient.SERVICE_COMMON_PART_NAME, publicitemsCommon);
        
-       ArticleResource articleResource = new ArticleResource();
-       result = articleResource.create(parentCtx, resourceMap, uriInfo, poxPayloadOut.toXML());
+       PublicItemResource publicItemResource = new PublicItemResource();
+       result = publicItemResource.create(parentCtx, resourceMap, uriInfo, poxPayloadOut.toXML());
        
                return result;
        }
index 6b1f83a07ee4a27a8c95805fe47e653ac2d44a43..54c9a1f34076fa177e6fbde703d2ea197b29b2b0 100644 (file)
@@ -76,6 +76,13 @@ public class WorkflowDocumentModelHandler
        super.handleUpdate(wrapDoc);
     }
     
+    @Override
+    protected void handleRefNameChanges(ServiceContext ctx, DocumentModel docModel) throws ClientException {
+       //
+       // We are intentionally overriding this method to do nothing since the Workflow resource is a meta-resource without a refname
+       //
+    }    
+    
     /*
      * Handle read (GET)
      */
index 6e7a945dee8c05dfd545b634c571a973516df983..f7a4a4aacaa7a9e644ea8a8829d683cd8a753f57 100644 (file)
@@ -80,8 +80,8 @@ public abstract class DocumentModelHandler<T, TL>
     private final Logger logger = LoggerFactory.getLogger(DocumentModelHandler.class);
     private RepositoryInstance repositorySession;
 
-    protected String oldRefNameOnUpdate = null;
-    protected String newRefNameOnUpdate = null;
+    protected String oldRefNameOnUpdate = null;  // FIXME: REM - We should have setters and getters for these
+    protected String newRefNameOnUpdate = null;  // FIXME: two fields.
     
     /*
      * Map Nuxeo's life cycle object to our JAX-B based life cycle object
@@ -398,7 +398,7 @@ public abstract class DocumentModelHandler<T, TL>
        return result;
     }
     
-    private void handleRefNameChanges(ServiceContext ctx, DocumentModel docModel) throws ClientException {
+    protected void handleRefNameChanges(ServiceContext ctx, DocumentModel docModel) throws ClientException {
        // First get the old refName
        this.oldRefNameOnUpdate = (String)docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA,
                        CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME);
@@ -407,7 +407,7 @@ public abstract class DocumentModelHandler<T, TL>
         if (refName != null) {
                this.newRefNameOnUpdate = refName.toString();
         } else {
-               logger.error(String.format("refName for document is missing.  Document CSID=%s", docModel.getName()));
+               logger.error(String.format("The refName for document is missing.  Document CSID=%s", docModel.getName())); // FIXME: REM - We should probably be throwing an exception here?
         }
         //
         // Set the refName if it is an update or if the old refName was empty or null
index 884b614764b446a3ff9055c045fa6188147b5b1c..0577780311c3fc88cbd396a9f56a3f2d011d7c53 100644 (file)
@@ -197,7 +197,7 @@ public abstract class   RemoteDocumentModelHandlerImpl<T, TL>
        @Override
        public void handleWorkflowTransition(DocumentWrapper<DocumentModel> wrapDoc, TransitionDef transitionDef)
                        throws Exception {
-               // Do nothing by default, but children can override if they want.  The really workflow transition happens in the WorkflowDocumemtModelHandler class
+               // Do nothing by default, but children can override if they want.  The real workflow transition happens in the WorkflowDocumemtModelHandler class
        }
        
     @Override
index 59966d278ee1a203f4b36e25acd30eba515f7f9d..e9c1c405b1d1c382b46fc815467667d0914d2d04 100644 (file)
@@ -71,7 +71,7 @@
         <module>contact</module>
         <module>workflow</module>
         <module>media</module>
-        <module>article</module>        
+        <module>publicitem</module>        
         <!--module>sdk</module-->
         <module>IntegrationTests</module>
         <module>PerformanceTests</module>
similarity index 95%
rename from services/article/client/src/main/java/org/collectionspace/services/client/PublicItemClient.java
rename to services/publicitem/client/src/main/java/org/collectionspace/services/client/PublicItemClient.java
index c77dde6aa705d6042af0ad4b1fcff72b470a19cb..5d96dea6172920091b837b26fb51f2795c5cbfa9 100644 (file)
@@ -17,7 +17,7 @@
 package org.collectionspace.services.client;
 
 /**
- * ArticleClient.java
+ * PublicItemClient.java
  *
  * $LastChangedRevision$
  * $LastChangedDate$
@@ -25,7 +25,7 @@ package org.collectionspace.services.client;
  */
 public class PublicItemClient extends AbstractCommonListPoxServiceClientImpl<PublicItemProxy> {
 
-    public static final String SERVICE_NAME = "articles";
+    public static final String SERVICE_NAME = "publicitems";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
     public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
     public static final String SERVICE_PATH_PROXY = SERVICE_PATH + "/";
diff --git a/services/publicitem/jaxb/src/main/java/org/collectionspace/services/PublicitemsCommonJAXBSchema.java b/services/publicitem/jaxb/src/main/java/org/collectionspace/services/PublicitemsCommonJAXBSchema.java
new file mode 100644 (file)
index 0000000..e07a8f7
--- /dev/null
@@ -0,0 +1,34 @@
+/**
+ * String constants to access XML element names of the PublicitemsCommon class.
+ */
+package org.collectionspace.services;
+
+/*
+       <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>
+ */
+
+public interface PublicitemsCommonJAXBSchema {
+    final static String ITEM_NUMBER = "itemNumber";
+    final static String ITEM_CONTENT_NAME = "contentName";
+    final static String ITEM_CONTENT_REPO_ID = "contentId";
+    final static String ITEM_CONTENT_URI = "contentUri";
+    final static String ITEM_JOB_ID = "contentCreationJobId";
+    final static String ITEM_SOURCE = "contentSource";
+    final static String ITEM_ACCESS_EXPIRATION_DATE = "contentExpirationDate";
+    final static String ITEM_ACCESSED_COUNT = "contentAccessedCount";
+    final static String ITEM_ACCESSED_COUNT_LIMIT = "contentAccessCountLimit";
+}
\ No newline at end of file
similarity index 83%
rename from services/article/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemConstants.java
rename to services/publicitem/service/src/main/java/org/collectionspace/services/publicitem/nuxeo/PublicItemConstants.java
index 0a45c67b9f42f10f1cbb16698025b12f3cd80136..cb7197c1c955bcd779a63d96a0c431069f840a5c 100644 (file)
 package org.collectionspace.services.publicitem.nuxeo;
 
 /**
- * ArticleConstants specifies constants for the Articles In service
+ * PublicItemConstants specifies constants for the PubicItem service
  *
  */
 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";
+    public final static String NUXEO_DOCTYPE = "PublicItem";
+    public final static String NUXEO_SCHEMA_NAME = "publicitem";
+    public final static String NUXEO_DC_TITLE = "CollectionSpace-PublicItem";
 }
@@ -26,13 +26,13 @@ package org.collectionspace.services.publicitem.nuxeo;
 import javax.ws.rs.core.UriInfo;
 
 import org.collectionspace.services.PublicitemsCommonJAXBSchema;
-import org.collectionspace.services.article.PublicitemsCommon;
+import org.collectionspace.services.publicitem.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;
 
-/** ArticleDocumentModelHandler
+/** PublicItemDocumentModelHandler
  *  $LastChangedRevision$
  *  $LastChangedDate$
  */
@@ -62,7 +62,7 @@ public class PublicItemDocumentModelHandler
     public void extractAllParts(DocumentWrapper<DocumentModel> wrapDoc)
             throws Exception {
        //
-       // Replace the URI with a fully qualified URL
+       // Replace the URI in the Nuxeo documentModel with a fully qualified URL
        //
         DocumentModel documentModel = wrapDoc.getWrappedObject();
                String itemContentUri = (String) documentModel.getProperty(PublicItemClient.SERVICE_COMMON_PART_NAME,
@@ -72,6 +72,12 @@ public class PublicItemDocumentModelHandler
         String url = String.format("%s%s", baseUrl, itemContentUri);
                documentModel.setProperty(PublicItemClient.SERVICE_COMMON_PART_NAME,
                                PublicitemsCommonJAXBSchema.ITEM_CONTENT_URI, url);
+               
+               //
+               // Hand control back to the parent to extract the data from the Nuxeo document model
+               // and turn it into an XML response payload.
+               //
+               super.extractAllParts(wrapDoc);
     }  
 }
 
similarity index 65%
rename from services/article/service/src/test/java/org/collectionspace/services/test/PublicItemServiceTest.java
rename to services/publicitem/service/src/test/java/org/collectionspace/services/test/PublicItemServiceTest.java
index b33974f83d9cb4635e0cd97abbb00b2a9bf8e254..1c29058593badea7500d4101236af441cbb89ddc 100644 (file)
@@ -1,7 +1,7 @@
 package org.collectionspace.services.test;
 
 /**
- * Placeholder for server-side testing of Articles service code.
+ * Placeholder for server-side testing of PublicItem service code.
  * 
  * @version $Revision$
  */
index b893e68d476a008fe58187787467c3e88cab1f78..ad6852558179d66780aeceb3a486f9a264beb134 100644 (file)
@@ -141,8 +141,8 @@ public class ReportServiceTest extends AbstractPoxServiceTestImpl<AbstractCommon
                 invalidStatusCodeMessage(testRequestType, statusCode));
         Assert.assertEquals(statusCode, testExpectedStatusCode);
 
-        String articleCsid = extractId(res);
-        Assert.assertNotNull(articleCsid);
+        String publicItemCsid = extractId(res);
+        Assert.assertNotNull(publicItemCsid);
     }
     
     /* (non-Javadoc)
index f6f6c9f3f18dfa3d5612161085aae9a56a60aa33..3eccdc81c5c1a2877a3fa1521e4892b0b1790ae2 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.PublicitemsCommon;
+import org.collectionspace.services.publicitem.PublicitemsCommon;
 import org.collectionspace.services.client.IQueryManager;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
@@ -35,13 +35,14 @@ import org.collectionspace.services.client.ReportClient;
 import org.collectionspace.services.common.ResourceBase;
 import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.ServiceMessages;
-import org.collectionspace.services.common.article.ArticleUtil;
 import org.collectionspace.services.common.context.ServiceContext;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.invocable.Invocable;
 import org.collectionspace.services.common.invocable.InvocationContext;
+import org.collectionspace.services.common.publicitem.PublicItemUtil;
 import org.collectionspace.services.common.query.QueryManager;
+import org.collectionspace.services.common.repository.RepositoryClient;
 import org.collectionspace.services.common.storage.JDBCTools;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -152,10 +153,10 @@ public class ReportResource extends ResourceBase {
     }
     
     /*
-     * Publishes the report to the Articles service.  The response is a URI to the corresponding Article resource instance in
-     * the form of /articles/{csid}.
-     * To access the contents of the report use a form like /articles/{csid}/{tenantId}/content.  For example,
-     * http://localhost:8180/cspace-services/articles/2991da78-6001-4f34-b02/1/content
+     * Publishes the report to the PublicItem service.  The response is a URI to the corresponding PublicItem resource instance in
+     * the form of /publicitems/{csid}.
+     * To access the contents of the report use a form like /publicitems/{tenantId}/{csid}/content.  For example,
+     * http://localhost:8180/cspace-services/publicitems/2991da78-6001-4f34-b02/1/content
      */
     @POST
     @Path("{csid}/publish")
@@ -171,8 +172,14 @@ 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((PublicitemsCommon)null, resourceMap, uriInfo, getRepositoryClient(ctx), ctx, 
-                       reportInputStream, outReportFileName.toString());
+            response = PublicItemUtil.publishToRepository(
+                       (PublicitemsCommon)null, 
+                       resourceMap, 
+                       uriInfo, 
+                       getRepositoryClient(ctx), 
+                       ctx, 
+                       reportInputStream, 
+                       outReportFileName.toString());
         } catch (Exception e) {
             throw bigReThrow(e, ServiceMessages.POST_FAILED);
         }