]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3178 Modified authorityItem create and update to accept refNames in place...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Thu, 13 Oct 2011 00:35:15 +0000 (00:35 +0000)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Thu, 13 Oct 2011 00:35:15 +0000 (00:35 +0000)
83 files changed:
services/IntegrationTests/src/test/java/org/collectionspace/services/IntegrationTests/test/RelationIntegrationTest.java
services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/2-item.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/3-locations_w_relations_CSID.xml [moved from services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/3-locations_w_relations.xml with 68% similarity, mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/5-locations_w_relations_RefNames.xml [new file with mode: 0644]
services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/location-hierarchy.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml
services/IntegrationTests/src/test/resources/test-data/xmlreplay/xml-replay-master.xml
services/JaxRsServiceProvider/pom.xml
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CollectionSpaceJaxRsApplication.java
services/acquisition/client/pom.xml
services/authority/jaxb/pom.xml [new file with mode: 0644]
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemJAXBSchema.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemJAXBSchema.java with 100% similarity]
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemListItemJAXBSchema.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityItemListItemJAXBSchema.java with 100% similarity]
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityJAXBSchema.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityJAXBSchema.java with 100% similarity]
services/authority/jaxb/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityListItemJAXBSchema.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityListItemJAXBSchema.java with 100% similarity]
services/authority/pom.xml
services/authority/service/pom.xml [new file with mode: 0644]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java with 96% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/Hierarchy.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/Hierarchy.java with 100% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/IVocabManager.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/IVocabManager.java with 100% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java with 100% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/VocabManager.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/VocabManager.java with 100% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/VocabManagerImpl.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/VocabManagerImpl.java with 100% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityDocumentModelHandler.java with 100% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityIdentifierUtils.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityIdentifierUtils.java with 100% similarity]
services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java [moved from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java with 84% similarity]
services/batch/client/pom.xml
services/batch/service/src/main/java/org/collectionspace/services/batch/nuxeo/CreateAndLinkLoanOutBatchJob.java
services/blob/client/pom.xml
services/blob/service/src/main/java/org/collectionspace/services/blob/BlobResource.java
services/collectionobject/client/pom.xml
services/common/src/main/java/org/collectionspace/services/common/ResourceBase.java
services/common/src/main/java/org/collectionspace/services/common/context/RemoteServiceContextImpl.java
services/common/src/main/java/org/collectionspace/services/common/context/ServiceContext.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocHandlerBase.java
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/DocumentModelHandler.java
services/contact/service/pom.xml
services/group/client/pom.xml
services/intake/client/pom.xml
services/intake/client/src/test/java/org/collectionspace/services/client/test/OrganizationAuthRefDocsTest.java
services/loanin/client/pom.xml
services/loanin/client/src/test/java/org/collectionspace/services/client/test/LoaninAuthRefsTest.java
services/loanin/pom.xml
services/loanout/client/pom.xml
services/location/client/pom.xml
services/location/jaxb/pom.xml
services/location/pom.xml
services/location/service/pom.xml
services/media/client/pom.xml
services/movement/client/pom.xml
services/note/client/pom.xml
services/objectexit/client/pom.xml
services/organization/client/pom.xml
services/organization/client/src/main/java/org/collectionspace/services/client/OrgAuthorityClientUtils.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityAuthRefsTest.java
services/organization/client/src/test/java/org/collectionspace/services/client/test/OrgAuthorityServiceTest.java
services/organization/jaxb/pom.xml
services/organization/pom.xml
services/organization/service/pom.xml
services/person/client/pom.xml
services/person/client/src/main/java/org/collectionspace/services/client/PersonAuthorityClientUtils.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthoritySearchTest.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServicePerfTest.java
services/person/client/src/test/java/org/collectionspace/services/client/test/PersonAuthorityServiceTest.java
services/person/client/src/test/resources/log4j.properties
services/person/jaxb/pom.xml
services/person/pom.xml
services/person/service/pom.xml
services/relation/client/pom.xml
services/relation/client/src/test/java/org/collectionspace/services/client/test/RelationServiceTest.java
services/relation/service/pom.xml
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java
services/report/service/pom.xml
services/taxonomy/client/pom.xml
services/taxonomy/jaxb/pom.xml
services/taxonomy/pom.xml
services/taxonomy/service/pom.xml
services/vocabulary/client/pom.xml
services/vocabulary/client/src/main/java/org/collectionspace/services/client/VocabularyClientUtils.java
services/vocabulary/client/src/test/java/org/collectionspace/services/client/test/VocabularyServiceTest.java
services/vocabulary/pom.xml
services/vocabulary/service/pom.xml
services/workflow/service/src/main/java/org/collectionspace/services/workflow/WorkflowResource.java

index d71772c40d8f5c136f2a73041756fd59289bddfc..c4eb6f3830e2b97eda24bbb96f8fff1954788795 100755 (executable)
@@ -140,10 +140,10 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
            String predicate = RelationshipType.COLLECTIONOBJECT_INTAKE.toString();
            ClientResponse<RelationsCommonList> resultResponse = relationClient.readList(
                        collectionObjectCsid,
-                       CollectionobjectsCommon.class.getSimpleName(),
+                       null, //CollectionobjectsCommon.class.getSimpleName(),
                        predicate,
                        intakeCsid,
-                       IntakesCommon.class.getSimpleName());
+                       null ); //IntakesCommon.class.getSimpleName());
         RelationsCommonList relationList = null;
            try {
                Assert.assertEquals(resultResponse.getStatus(), Response.Status.OK.getStatusCode());
@@ -270,10 +270,10 @@ public class RelationIntegrationTest extends CollectionSpaceIntegrationTest {
            for (String collectionObjectCsid : collectionObjectIDList) {
                    ClientResponse<RelationsCommonList> resultResponse = relationClient.readList(
                                intakeCsid,
-                               IntakesCommon.class.getSimpleName(), //subject
+                               null, //IntakesCommon.class.getSimpleName(), //subject
                                predicate,
                                collectionObjectCsid,
-                               CollectionobjectsCommon.class.getSimpleName()); //object
+                               null); //CollectionobjectsCommon.class.getSimpleName()); //object
 
                    try {
                        Assert.assertEquals(resultResponse.getStatus(), Response.Status.OK.getStatusCode());
index 2432caa2fe3d54af3d6178338281fd7f179e97e8..17a5fc4d6634042293bbb92a16b94f098182f8c6 100644 (file)
@@ -2,7 +2,7 @@
 <document name="locations">
   <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">
     <shortIdentifier>${shortIdentifier}</shortIdentifier>
-    <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})</refName>
+               <!-- <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})</refName> -->
     <termStatus>Approved</termStatus>
     <displayNameComputed>true</displayNameComputed>
     <shortDisplayNameComputed>false</shortDisplayNameComputed>
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <document name="locations">\r
   <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
-    <inAuthority>${inAuthority}</inAuthority>\r
+    <!-- <inAuthority>${inAuthority}</inAuthority>\r
     <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
-    <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})'${name}'</refName>\r
+               <refName>urn:cspace:org.collectionspace.demo:locationauthority:name(${authShortIdentifier}):location:name(${shortIdentifier})'${name}'</refName> -->\r
     <displayName>${name}</displayName>\r
     <displayNameComputed>false</displayNameComputed>\r
     <shortDisplayNameComputed>true</shortDisplayNameComputed>\r
                <predicate>hasBroader</predicate>\r
                <subject>\r
                  <csid>${itemCSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
+                       <!-- <documentType>Locationitem</documentType> -->\r
                </subject>\r
                <object>\r
                  <csid>${parentCSID}</csid>\r
-                 <uri>${parentUri}</uri>\r
-                 <documentType>Locationitem</documentType>\r
+                       <!-- <uri>${parentUri}</uri>\r
+                       <documentType>Locationitem</documentType> -->\r
                </object>\r
        </relation-list-item>\r
        <relation-list-item>\r
                <predicate>hasBroader</predicate>\r
                <subject>\r
                  <csid>${childCSID}</csid>\r
-                 <uri>${childUri}</uri>\r
+                       <!-- <uri>${childUri}</uri>\r
                  <documentType>Locationitem</documentType>\r
                  <name>Child1</name>\r
-                 <number>2200</number>\r
+                       <number>2200</number> -->\r
                </subject>\r
                <object>\r
                  <csid>${itemCSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
+                       <!-- <documentType>Locationitem</documentType>\r
                  <name>Item</name>\r
-                 <number>1111</number>\r
+                       <number>1111</number> -->\r
                </object>\r
        </relation-list-item>\r
        <relation-list-item>\r
                <predicate>hasBroader</predicate>\r
                <subject>\r
-                 <uri>${child2Uri}</uri>\r
                  <csid>${child2CSID}</csid>\r
+                 <!-- <uri>${child2Uri}</uri>\r
                  <documentType>Locationitem</documentType>\r
                  <name>Child2</name>\r
-                 <number>2222</number>\r
+                 <number>2222</number> -->\r
                </subject>\r
                <object>\r
                  <csid>${itemCSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
+                 <!-- <documentType>Locationitem</documentType>\r
                  <name>Item</name>\r
-                 <number>1111</number>\r
+                       <number>1111</number> -->\r
                </object>\r
        </relation-list-item>\r
        <relation-list-item>\r
                <predicate>hasBroader</predicate>\r
                <subject>\r
-                 <uri>${child3Uri}</uri>\r
                  <csid>${child3CSID}</csid>\r
+                 <!-- <uri>${child3Uri}</uri>\r
                  <documentType>Locationitem</documentType>\r
                  <name>Child3</name>\r
-                 <number>3333</number>\r
+                       <number>3333</number> -->\r
                </subject>\r
                <object>\r
                  <csid>${itemCSID}</csid>\r
-                 <documentType>Locationitem</documentType>\r
+                 <!-- <documentType>Locationitem</documentType>\r
                  <name>Item</name>\r
-                 <number>1111</number>\r
+                       <number>1111</number> -->\r
                </object>\r
        </relation-list-item>\r
   </ns3:relations-common-list>\r
diff --git a/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/5-locations_w_relations_RefNames.xml b/services/IntegrationTests/src/test/resources/test-data/xmlreplay/location/hierarchy/5-locations_w_relations_RefNames.xml
new file mode 100644 (file)
index 0000000..f86783b
--- /dev/null
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<document name="locations">\r
+  <ns2:locations_common xmlns:ns2="http://collectionspace.org/services/location" xmlns:ns3="http://collectionspace.org/services/jaxb">\r
+    <shortIdentifier>${shortIdentifier}</shortIdentifier>\r
+    <displayName>${name}</displayName>\r
+    <displayNameComputed>false</displayNameComputed>\r
+  </ns2:locations_common>\r
+  <!-- \r
+       WARNING: ${itemCSID} does NOT get expanded by XmlReplay. \r
+          It passes through and then the service deals with it.\r
+  -->\r
+  <ns3:relations-common-list xmlns:ns3="http://collectionspace.org/services/relation" xmlns:ns2="http://collectionspace.org/services/jaxb">\r
+    <relation-list-item>\r
+               <predicate>hasBroader</predicate>\r
+               <subject>\r
+                 <csid>${itemCSID}</csid>\r
+               </subject>\r
+               <object>\r
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Aisle3)'Aisle 3'</refName>\r
+               </object>\r
+       </relation-list-item>\r
+       <relation-list-item>\r
+               <predicate>hasBroader</predicate>\r
+               <subject>\r
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf1)'Shelf 1'</refName>\r
+               </subject>\r
+               <object>\r
+                 <csid>${itemCSID}</csid>\r
+               </object>\r
+       </relation-list-item>\r
+       <relation-list-item>\r
+               <predicate>hasBroader</predicate>\r
+               <subject>\r
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf2)'Shelf 2'</refName>\r
+               </subject>\r
+               <object>\r
+                 <csid>${itemCSID}</csid>\r
+               </object>\r
+       </relation-list-item>\r
+       <relation-list-item>\r
+               <predicate>hasBroader</predicate>\r
+               <subject>\r
+                       <refName>urn:cspace:core.collectionspace.org:locationauthorities:name(CSPACE3739LocationAuthority):item:name(Shelf3)'Shelf 3'</refName>\r
+               </subject>\r
+               <object>\r
+                 <csid>${itemCSID}</csid>\r
+               </object>\r
+       </relation-list-item>\r
+  </ns3:relations-common-list>\r
+</document>\r
+\r
+\r
+\r
index c09c83336b250587099da4ebd1b1a102c1dbbc2a..fa2bc51ea5602c73ee621a319ba2f2081a59d41d 100644 (file)
                <var ID="name">Aisle 3</var>
             </vars>
         </test>
+
+                               <test ID="Location1_old">
+            <method>POST</method>
+            <uri>/cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
+            <filename>location/hierarchy/3-locations_w_relations_CSID.xml</filename>
+            <vars>
+                                                       <var ID="name">Cabinet 1</var>
+               <var ID="parentCSID">${LocationParent.CSID}</var>
+               <var ID="childCSID">${LocationChild1.CSID}</var>
+               <var ID="child2CSID">${LocationChild2.CSID}</var>
+               <var ID="child3CSID">${LocationChild3.CSID}</var>
+            </vars>
+        </test>
         
         <test ID="Location1">
             <method>POST</method>
             <uri>/cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/</uri>
-            <filename>location/hierarchy/3-locations_w_relations.xml</filename>
+            <filename>location/hierarchy/5-locations_w_relations_RefNames.xml</filename>
             <vars>
-               <var ID="inAuthority">${LocationAuth1.CSID}</var>
-               <var ID="authShortIdentifier">CSPACE3739LocationAuthority</var>
-               <var ID="shortIdentifier">Cabinet1</var>
-               <var ID="name">Cabinet 1</var>
-               <var ID="parentCSID">${LocationParent.CSID}</var>
-               <var ID="parentUri">/cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority-setting-error-parent)/items/${LocationParent.CSID}</var>
+               <var ID="shortIdentifier">Cabinet1a</var>
+                                                       <var ID="name">Cabinet 1a</var>
                <var ID="childCSID">${LocationChild1.CSID}</var>
-               <var ID="childUri">/cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/${LocationChild1.CSID}</var>
                <var ID="child2CSID">${LocationChild2.CSID}</var>
-               <var ID="child2Uri">/cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/${LocationChild2.CSID}</var>
                <var ID="child3CSID">${LocationChild3.CSID}</var>
-               <var ID="child3Uri">/cspace-services/locationauthorities/urn:cspace:name(CSPACE3739LocationAuthority)/items/${LocationChild3.CSID}</var>
             </vars>
         </test>
         
index cec5f002995dcd612131d5f0bf5be320ea8fcced..fd72e30e78425f7ea89710e019d1ebb7164f7622 100755 (executable)
@@ -20,6 +20,7 @@
             <vars>\r
                <var ID="inAuthority">${PersonAuth1.CSID}</var>\r
                <var ID="authShortIdentifier">CSPACE3739PersonAuthority</var>\r
+               <var ID="shortIdentifier">johnWayneActor1</var>\r
             </vars>\r
         </test>\r
         <test ID="Person2">\r
index 65a1660e17f553dda65b4b3240be88db0c66ec29..e78cd5c63bda4f0c68d0a37f1296b6b484af6d5b 100755 (executable)
@@ -42,7 +42,9 @@
     <run controlFile="acquisitions/acquisitions.xml" testGroup="makeone" />\r
     <run controlFile="acquisitions/acquisitions.xml" testGroup="testList" />\r
     <run controlFile="relation/relation.xml" testGroup="makeRelations" />\r
-    <run controlFile="relation/relation.xml" testGroup="r2only" />\r
+               <!-- No - this test is broken\r
+               <run controlFile="relation/relation.xml" testGroup="r2only" />\r
+               -->\r
     <run controlFile="person/person.xml" testGroup="postPerson" />\r
     <run controlFile="person/person.xml" testGroup="updatePerson" />\r
     <run controlFile="person/person.xml" testGroup="PersonAddRelsDeleteRels" />\r
index 56a458613a1597815e1dcd019ecc3ae1b1d05d0e..5ec81e874770044770d2a21ab04dae802b0d8c9e 100644 (file)
@@ -52,7 +52,7 @@
         <!-- CollectionSpace dependencies -->\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
+            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>        \r
         <dependency>\r
index d99eaff77e34236fc125b13d80cf65998f5f375d..60e2933454dda80b1130d5a3e858b946e104ddc4 100644 (file)
@@ -96,14 +96,12 @@ public class CollectionSpaceJaxRsApplication extends Application
         singletons.add(new RoleResource());
         singletons.add(new PermissionResource());
 
-        singletons.add(new VocabularyResource());
-        singletons.add(new PersonAuthorityResource());
-        singletons.add(new OrgAuthorityResource());
-        singletons.add(new LocationAuthorityResource());
-        singletons.add(new TaxonomyAuthorityResource());
-
-        singletons.add(new AcquisitionResource());
-        
+        addResourceToMapAndSingletons(new VocabularyResource());
+        addResourceToMapAndSingletons(new PersonAuthorityResource());
+        addResourceToMapAndSingletons(new OrgAuthorityResource());
+        addResourceToMapAndSingletons(new LocationAuthorityResource());
+        addResourceToMapAndSingletons(new TaxonomyAuthorityResource());
+        addResourceToMapAndSingletons(new AcquisitionResource());
         addResourceToMapAndSingletons(new ContactResource());
         addResourceToMapAndSingletons(new CollectionObjectResource());
         addResourceToMapAndSingletons(new GroupResource());
index c5cfe67d22b1c2e224dc328095bdfc3622cbe476..03532b092d0bca3132c05544a8470d5f93025566 100644 (file)
@@ -29,7 +29,7 @@
         <!-- CollectionSpace Dependencies -->\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>        \r
diff --git a/services/authority/jaxb/pom.xml b/services/authority/jaxb/pom.xml
new file mode 100644 (file)
index 0000000..557655e
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <parent>
+        <artifactId>org.collectionspace.services.authority</artifactId>
+        <groupId>org.collectionspace.services</groupId>
+        <version>1.12-SNAPSHOT</version>
+    </parent>
+    
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.collectionspace.services</groupId>
+    <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+    <name>services.authority.jaxb</name>
+    
+    <dependencies>
+        <dependency>
+            <groupId>com.sun.xml.bind</groupId>
+            <artifactId>jaxb-impl</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.jaxb2-commons</groupId>
+            <artifactId>property-listener-injector</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.jvnet.jaxb2_commons</groupId>
+            <artifactId>runtime</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
+    </dependencies>
+    
+               <!-- until we have schemas to compile, we can omit the plugin
+    <build>
+        <finalName>collectionspace-services-authority-jaxb</finalName>
+        <defaultGoal>install</defaultGoal>
+        <plugins>
+            <plugin>
+                <groupId>org.jvnet.jaxb2.maven2</groupId>
+                <artifactId>maven-jaxb2-plugin</artifactId>
+            </plugin>
+        </plugins>
+               </build>
+               -->
+</project>
+
index 8d4d98cbdcbca9382f89834c5f09cc3317069e33..eb504088bafc37b4d9c0b97c20c05bdfe70a3ce2 100644 (file)
     <groupId>org.collectionspace.services</groupId>\r
     <artifactId>org.collectionspace.services.authority</artifactId>\r
     <name>services.authority</name>\r
-    <packaging>jar</packaging>\r
+    <packaging>pom</packaging>\r
 \r
-    <dependencies>\r
-        <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common-api</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.common</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
-            <version>${project.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.service</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>\r
-\r
-\r
-        <!-- Utilities -->\r
-\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-api</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.slf4j</groupId>\r
-            <artifactId>slf4j-log4j12</artifactId>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>log4j</groupId>\r
-            <artifactId>log4j</artifactId>\r
-            <version>1.2.14</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.apache.commons</groupId>\r
-            <artifactId>commons-jexl</artifactId>\r
-            <version>2.0.1</version>\r
-        </dependency>\r
-        <dependency>\r
-                       <groupId>commons-codec</groupId>\r
-                       <artifactId>commons-codec</artifactId>\r
-                       <version>1.4</version>\r
-        </dependency>\r
-\r
-        <!-- javax -->\r
-        <dependency>\r
-            <groupId>javax.servlet</groupId>\r
-            <artifactId>servlet-api</artifactId>\r
-            <version>2.5</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jaas</artifactId>\r
-            <version>1.0.01</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>javax.security</groupId>\r
-            <artifactId>jacc</artifactId>\r
-            <version>1.0</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!--\r
-            <dependency>\r
-            <groupId>dom4j</groupId>\r
-            <artifactId>dom4j</artifactId>\r
-            <version>1.6.1</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        -->\r
-        <dependency>\r
-            <groupId>mysql</groupId>\r
-            <artifactId>mysql-connector-java</artifactId>\r
-        </dependency>\r
-                               <dependency>\r
-                                               <groupId>postgresql</groupId>\r
-                                               <artifactId>postgresql</artifactId>\r
-                               </dependency>\r
-         <dependency>\r
-            <groupId>javax.persistence</groupId>\r
-            <artifactId>persistence-api</artifactId>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>com.sun.xml.bind</groupId>\r
-            <artifactId>jaxb-impl</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jvnet.jaxb2-commons</groupId>\r
-            <artifactId>property-listener-injector</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jvnet.jaxb2_commons</groupId>\r
-            <artifactId>runtime</artifactId>\r
-        </dependency>\r
-\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>jaxrs-api</artifactId>\r
-        </dependency>        \r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxrs</artifactId>\r
-            <exclusions>\r
-                <exclusion>\r
-                    <groupId>tjws</groupId>\r
-                    <artifactId>webserver</artifactId>\r
-                </exclusion>\r
-            </exclusions>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-jaxb-provider</artifactId>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.jboss.resteasy</groupId>\r
-            <artifactId>resteasy-multipart-provider</artifactId>\r
-        </dependency>\r
-\r
-        <dependency>\r
-            <groupId>org.hibernate</groupId>\r
-            <artifactId>hibernate-entitymanager</artifactId>\r
-        </dependency>\r
-        <!-- jboss -->\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jbosssx</artifactId>\r
-            <version>4.2.3.GA</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>jboss</groupId>\r
-            <artifactId>jboss-remoting</artifactId>\r
-            <version>2.2.2.SP8</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <!-- nuxeo -->\r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-mimetype-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-imaging-core</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>        \r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-imaging-api</artifactId>\r
-             <version>${nuxeo.platform.version}</version>\r
-           </dependency>\r
-           <dependency>\r
-             <groupId>org.nuxeo.ecm.platform</groupId>\r
-             <artifactId>nuxeo-platform-filemanager-api</artifactId>\r
-                 <version>${nuxeo.platform.version}</version>        \r
-           </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.common</groupId>\r
-            <artifactId>nuxeo-common</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-            <scope>provided</scope>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-api</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-client</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-query</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-schema</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-storage-sql</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-facade</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.ecm.core</groupId>\r
-            <artifactId>nuxeo-core-io</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.nuxeo.runtime</groupId>\r
-            <artifactId>nuxeo-runtime-osgi</artifactId>\r
-            <version>${nuxeo.core.version}</version>\r
-        </dependency>\r
-        <dependency>\r
-            <groupId>org.osgi</groupId>\r
-            <artifactId>org.osgi.core</artifactId>\r
-            <version>4.1.0</version>\r
-        </dependency>\r
-    </dependencies>\r
+    <modules>\r
+        <module>jaxb</module>\r
+        <module>service</module>\r
+    </modules>\r
 </project>\r
 \r
diff --git a/services/authority/service/pom.xml b/services/authority/service/pom.xml
new file mode 100644 (file)
index 0000000..481e369
--- /dev/null
@@ -0,0 +1,288 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" \r
+                       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \r
+                       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">\r
+    <parent>\r
+        <groupId>org.collectionspace.services</groupId>\r
+        <artifactId>org.collectionspace.services.main</artifactId>\r
+        <version>1.12-SNAPSHOT</version>\r
+    </parent>\r
+\r
+    <modelVersion>4.0.0</modelVersion>\r
+    <groupId>org.collectionspace.services</groupId>\r
+    <artifactId>org.collectionspace.services.authority.service</artifactId>\r
+    <name>services.authority</name>\r
+    <packaging>jar</packaging>\r
+\r
+    <dependencies>\r
+        <!-- CollectionSpace dependencies -->\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.common-api</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.common</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authentication.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authentication.service</artifactId>\r
+            <version>${project.version}</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authorization.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authorization.service</artifactId>\r
+            <version>${project.version}</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.relation.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.relation.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+\r
+\r
+        <!-- Utilities -->\r
+\r
+        <dependency>\r
+            <groupId>org.slf4j</groupId>\r
+            <artifactId>slf4j-api</artifactId>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.slf4j</groupId>\r
+            <artifactId>slf4j-log4j12</artifactId>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>log4j</groupId>\r
+            <artifactId>log4j</artifactId>\r
+            <version>1.2.14</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.apache.commons</groupId>\r
+            <artifactId>commons-jexl</artifactId>\r
+            <version>2.0.1</version>\r
+        </dependency>\r
+        <dependency>\r
+                       <groupId>commons-codec</groupId>\r
+                       <artifactId>commons-codec</artifactId>\r
+                       <version>1.4</version>\r
+        </dependency>\r
+\r
+        <!-- javax -->\r
+        <dependency>\r
+            <groupId>javax.servlet</groupId>\r
+            <artifactId>servlet-api</artifactId>\r
+            <version>2.5</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+\r
+        <dependency>\r
+            <groupId>javax.security</groupId>\r
+            <artifactId>jaas</artifactId>\r
+            <version>1.0.01</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>javax.security</groupId>\r
+            <artifactId>jacc</artifactId>\r
+            <version>1.0</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <!--\r
+            <dependency>\r
+            <groupId>dom4j</groupId>\r
+            <artifactId>dom4j</artifactId>\r
+            <version>1.6.1</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        -->\r
+        <dependency>\r
+            <groupId>mysql</groupId>\r
+            <artifactId>mysql-connector-java</artifactId>\r
+        </dependency>\r
+                               <dependency>\r
+                                               <groupId>postgresql</groupId>\r
+                                               <artifactId>postgresql</artifactId>\r
+                               </dependency>\r
+         <dependency>\r
+            <groupId>javax.persistence</groupId>\r
+            <artifactId>persistence-api</artifactId>\r
+        </dependency>\r
+\r
+        <dependency>\r
+            <groupId>com.sun.xml.bind</groupId>\r
+            <artifactId>jaxb-impl</artifactId>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.jvnet.jaxb2-commons</groupId>\r
+            <artifactId>property-listener-injector</artifactId>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.jvnet.jaxb2_commons</groupId>\r
+            <artifactId>runtime</artifactId>\r
+        </dependency>\r
+\r
+        <!-- jboss -->\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>jaxrs-api</artifactId>\r
+        </dependency>        \r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>resteasy-jaxrs</artifactId>\r
+            <exclusions>\r
+                <exclusion>\r
+                    <groupId>tjws</groupId>\r
+                    <artifactId>webserver</artifactId>\r
+                </exclusion>\r
+            </exclusions>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>resteasy-jaxb-provider</artifactId>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.jboss.resteasy</groupId>\r
+            <artifactId>resteasy-multipart-provider</artifactId>\r
+        </dependency>\r
+\r
+        <dependency>\r
+            <groupId>org.hibernate</groupId>\r
+            <artifactId>hibernate-entitymanager</artifactId>\r
+        </dependency>\r
+        <!-- jboss -->\r
+        <dependency>\r
+            <groupId>jboss</groupId>\r
+            <artifactId>jbosssx</artifactId>\r
+            <version>4.2.3.GA</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>jboss</groupId>\r
+            <artifactId>jboss-remoting</artifactId>\r
+            <version>2.2.2.SP8</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <!-- nuxeo -->\r
+           <dependency>\r
+             <groupId>org.nuxeo.ecm.platform</groupId>\r
+             <artifactId>nuxeo-platform-mimetype-api</artifactId>\r
+             <version>${nuxeo.platform.version}</version>\r
+           </dependency>        \r
+           <dependency>\r
+             <groupId>org.nuxeo.ecm.platform</groupId>\r
+             <artifactId>nuxeo-platform-imaging-core</artifactId>\r
+             <version>${nuxeo.platform.version}</version>\r
+           </dependency>        \r
+           <dependency>\r
+             <groupId>org.nuxeo.ecm.platform</groupId>\r
+             <artifactId>nuxeo-platform-imaging-api</artifactId>\r
+             <version>${nuxeo.platform.version}</version>\r
+           </dependency>\r
+           <dependency>\r
+             <groupId>org.nuxeo.ecm.platform</groupId>\r
+             <artifactId>nuxeo-platform-filemanager-api</artifactId>\r
+                 <version>${nuxeo.platform.version}</version>        \r
+           </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.common</groupId>\r
+            <artifactId>nuxeo-common</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+            <scope>provided</scope>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.runtime</groupId>\r
+            <artifactId>nuxeo-runtime</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-api</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-client</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-query</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-schema</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-storage-sql</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-io</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-facade</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.ecm.core</groupId>\r
+            <artifactId>nuxeo-core-io</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.nuxeo.runtime</groupId>\r
+            <artifactId>nuxeo-runtime-osgi</artifactId>\r
+            <version>${nuxeo.core.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.osgi</groupId>\r
+            <artifactId>org.osgi.core</artifactId>\r
+            <version>4.1.0</version>\r
+        </dependency>\r
+    </dependencies>\r
+</project>\r
+\r
similarity index 96%
rename from services/authority/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
rename to services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/AuthorityResource.java
index 0b3c219e072e031523e27085574dcabb9eadb493..96d887e650ab977f44cfe0a8612b01a688aa64c8 100644 (file)
@@ -30,6 +30,7 @@ import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.workflow.WorkflowClient;
 import org.collectionspace.services.common.ClientType;
 import org.collectionspace.services.common.ResourceBase;
+import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.ServiceMain;
 import org.collectionspace.services.common.ServiceMessages;
 import org.collectionspace.services.common.XmlTools;
@@ -287,6 +288,31 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
         return itemcsid;
     }
 
+    /*
+     * Generally, callers will first call RefName.AuthorityItem.parse with a refName, and then 
+     * use the returned item.inAuthority.resource and a resourceMap to get a service-specific
+     * Resource. They then call this method on that resource.
+     */
+    @Override
+       public DocumentModel getDocModelForAuthorityItem(RefName.AuthorityItem item) 
+                       throws Exception, DocumentNotFoundException {
+       if(item == null) {
+               return null;
+       }
+        String whereClause = buildWhereForAuthByName(item.getParentShortIdentifier());
+        // Ensure we have the right context.
+        ServiceContext ctx = createServiceContext(item.inAuthority.resource);
+        
+        String parentcsid = getRepositoryClient(ctx).findDocCSID(ctx, whereClause);
+
+        String itemWhereClause = buildWhereForAuthItemByName(item.getShortIdentifier(), parentcsid);
+        ctx = createServiceContext(getItemServiceName());
+        DocumentWrapper<DocumentModel> docWrapper = getRepositoryClient(ctx).findDoc(ctx, itemWhereClause);
+        DocumentModel docModel = docWrapper.getWrappedObject();
+        return docModel;
+    }
+
+
     @POST
     public Response createAuthority(String xmlPayload) {
         try {
@@ -461,10 +487,12 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
      *************************************************************************/
     @POST
     @Path("{csid}/items")
-    public Response createAuthorityItem(@Context UriInfo ui, @PathParam("csid") String specifier, String xmlPayload) {
+    public Response createAuthorityItem(@Context ResourceMap resourceMap, @Context UriInfo ui, 
+               @PathParam("csid") String specifier, String xmlPayload) {
         try {
             PoxPayloadIn input = new PoxPayloadIn(xmlPayload);
             ServiceContext ctx = createServiceContext(getItemServiceName(), input);
+            ctx.setResourceMap(resourceMap);
             ctx.setUriInfo(ui);    //Laramie
 
             // Note: must have the parentShortId, to do the create.
@@ -761,6 +789,7 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
     @PUT
     @Path("{csid}/items/{itemcsid}")
     public byte[] updateAuthorityItem(
+               @Context ResourceMap resourceMap, 
             @Context UriInfo ui,
             @PathParam("csid") String parentspecifier,
             @PathParam("itemcsid") String itemspecifier,
@@ -773,6 +802,7 @@ public abstract class AuthorityResource<AuthCommon, AuthItemHandler>
             String parentcsid = lookupParentCSID(parentspecifier, "updateAuthorityItem(parent)", "UPDATE_ITEM", null);
 
             ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(getItemServiceName(), theUpdate);
+            ctx.setResourceMap(resourceMap);
             String itemcsid = lookupItemCSID(itemspecifier, parentcsid, "updateAuthorityItem(item)", "UPDATE_ITEM", ctx);
 
             // We omit the parentShortId, only needed when doing a create...
@@ -125,7 +125,9 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
     public void handleCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
         // first fill all the parts of the document
         super.handleCreate(wrapDoc);
+        // Ensure we have required fields set properly
         handleInAuthority(wrapDoc.getWrappedObject());
+        
        handleComputedDisplayNames(wrapDoc.getWrappedObject());
        String displayName = (String) wrapDoc.getWrappedObject().getProperty(authorityItemCommonSchemaName, 
                                AuthorityItemJAXBSchema.DISPLAY_NAME);
@@ -133,9 +135,8 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
                logger.warn("Creating Authority Item with no displayName!");
        }
         // CSPACE-3178:
-        // Uncomment once debugged and App layer is read to integrate
-        // Experimenting with these uncommented now ...
         handleDisplayNameAsShortIdentifier(wrapDoc.getWrappedObject(), authorityItemCommonSchemaName);
+        // refName includes displayName, so we force a correct value here.
         updateRefnameForAuthorityItem(wrapDoc, authorityItemCommonSchemaName, getAuthorityRefNameBase());
     }
     
@@ -441,6 +442,7 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
 
     public void fillAllParts(DocumentWrapper<DocumentModel> wrapDoc, Action action) throws Exception {
         super.fillAllParts(wrapDoc, action);
+        /*
         ServiceContext ctx = getServiceContext();
         PoxPayloadIn input = (PoxPayloadIn) ctx.getInput();
         DocumentModel documentModel = (wrapDoc.getWrappedObject());
@@ -451,16 +453,43 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
 
         PayloadOutputPart payloadOutputPart = new PayloadOutputPart(RelationClient.SERVICE_COMMON_LIST_NAME, relationsCommonList);
         ctx.setProperty(RelationClient.SERVICE_COMMON_LIST_NAME, payloadOutputPart);
+        */
+    }
+
+    public void completeCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+        super.completeCreate(wrapDoc);
+        handleRelationsPayload(wrapDoc, false);
     }
 
     public void completeUpdate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
         super.completeUpdate(wrapDoc);
-        //now we add part for relations list
-        ServiceContext ctx = getServiceContext();
-        PayloadOutputPart foo = (PayloadOutputPart) ctx.getProperty(RelationClient.SERVICE_COMMON_LIST_NAME);
-        ((PoxPayloadOut) ctx.getOutput()).addPart(foo);
+        handleRelationsPayload(wrapDoc, true);
         handleItemRefNameReferenceUpdate();
     }
+    
+    // Note that we must do this after we have completed the Update, so that the repository has the
+    // info for the item itself. The relations code must call into the repo to get info for each end.
+    // This could be optimized to pass in the parent docModel, since it will often be one end.
+    // Nevertheless, we should complete the item save before we do work on the relations, especially
+    // since a save on Create might fail, and we would not want to create relations for something
+    // that may not be created...
+    private void handleRelationsPayload(DocumentWrapper<DocumentModel> wrapDoc, boolean fUpdate) throws Exception {
+        ServiceContext ctx = getServiceContext();
+        PoxPayloadIn input = (PoxPayloadIn) ctx.getInput();
+        DocumentModel documentModel = (wrapDoc.getWrappedObject());
+        String itemCsid = documentModel.getName();
+
+        //Updates relations part
+        RelationsCommonList relationsCommonList = updateRelations(itemCsid, input, wrapDoc, fUpdate);
+
+        PayloadOutputPart payloadOutputPart = new PayloadOutputPart(RelationClient.SERVICE_COMMON_LIST_NAME, relationsCommonList);
+        ctx.setProperty(RelationClient.SERVICE_COMMON_LIST_NAME, payloadOutputPart);
+
+        //now we add part for relations list
+        //ServiceContext ctx = getServiceContext();
+        //PayloadOutputPart foo = (PayloadOutputPart) ctx.getProperty(RelationClient.SERVICE_COMMON_LIST_NAME);
+        ((PoxPayloadOut) ctx.getOutput()).addPart(payloadOutputPart);
+    }
 
     /**  updateRelations strategy:
     
@@ -478,53 +507,69 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
     child-b                                   parent-d                        child-c
     parent-a
      */
-    public RelationsCommonList updateRelations(String itemCSID, PoxPayloadIn input, DocumentWrapper<DocumentModel> wrapDoc)
+    private RelationsCommonList updateRelations(
+               String itemCSID, PoxPayloadIn input, DocumentWrapper<DocumentModel> wrapDoc, boolean fUpdate)
             throws Exception {
+        if(logger.isTraceEnabled()) {
+               logger.trace("AuthItemDocHndler.updateRelations for: "+itemCSID);
+        }
         PayloadInputPart part = input.getPart(RelationClient.SERVICE_COMMON_LIST_NAME);        //input.getPart("relations_common");
         if (part == null) {
             return null;  //nothing to do--they didn't send a list of relations.
         }
         RelationsCommonList relationsCommonListBody = (RelationsCommonList) part.getBody();
+        List<RelationsCommonList.RelationListItem> inboundList = relationsCommonListBody.getRelationListItem();
+        List<RelationsCommonList.RelationListItem> actionList = newList();
+        List<RelationsCommonList.RelationListItem> childList = null;
+        List<RelationsCommonList.RelationListItem> parentList = null;
+        DocumentModel docModel = wrapDoc.getWrappedObject();
 
         ServiceContext ctx = getServiceContext();
-        UriInfo uriInfo = ctx.getUriInfo();
-        MultivaluedMap queryParams = uriInfo.getQueryParameters();
-
-        //Run getList() once as sent to get childListOuter:
-        String predicate = RelationshipType.HAS_BROADER.value();
-        queryParams.putSingle(IRelationsManager.PREDICATE_QP, predicate);
-        queryParams.putSingle(IRelationsManager.SUBJECT_QP, null);
-        queryParams.putSingle(IRelationsManager.SUBJECT_TYPE_QP, null);
-        queryParams.putSingle(IRelationsManager.OBJECT_QP, itemCSID);
-        queryParams.putSingle(IRelationsManager.OBJECT_TYPE_QP, null);
-        RelationsCommonList childListOuter = (new RelationResource()).getList(ctx.getUriInfo());    //magically knows all query params because they are in the context.
-
-        //Now run getList() again, leaving predicate, swapping subject and object, to get parentListOuter.
-        queryParams.putSingle(IRelationsManager.PREDICATE_QP, predicate);
-        queryParams.putSingle(IRelationsManager.SUBJECT_QP, itemCSID);
-        queryParams.putSingle(IRelationsManager.OBJECT_QP, null);
-        RelationsCommonList parentListOuter = (new RelationResource()).getList(ctx.getUriInfo());
+        //Do magic replacement of ${itemCSID} and fix URI's.
+        fixupInboundListItems(ctx, inboundList, docModel, itemCSID);
 
         String HAS_BROADER = RelationshipType.HAS_BROADER.value();
+        UriInfo uriInfo = ctx.getUriInfo();
+        MultivaluedMap queryParams = uriInfo.getQueryParameters();
 
-        List<RelationsCommonList.RelationListItem> inboundList = relationsCommonListBody.getRelationListItem();
-        List<RelationsCommonList.RelationListItem> actionList = newList();
-        List<RelationsCommonList.RelationListItem> childList = childListOuter.getRelationListItem();
-        List<RelationsCommonList.RelationListItem> parentList = parentListOuter.getRelationListItem();
-
-        if (parentList.size() > 1) {
-            throw new Exception("Too many parents for object: " + itemCSID + " list: " + dumpList(parentList, "parentList"));
+        if(fUpdate) {
+               //Run getList() once as sent to get childListOuter:
+               String predicate = RelationshipType.HAS_BROADER.value();
+               queryParams.putSingle(IRelationsManager.PREDICATE_QP, predicate);
+               queryParams.putSingle(IRelationsManager.SUBJECT_QP, null);
+               queryParams.putSingle(IRelationsManager.SUBJECT_TYPE_QP, null);
+               queryParams.putSingle(IRelationsManager.OBJECT_QP, itemCSID);
+               queryParams.putSingle(IRelationsManager.OBJECT_TYPE_QP, null);
+               RelationsCommonList childListOuter = (new RelationResource()).getList(ctx.getUriInfo());    //magically knows all query params because they are in the context.
+       
+               //Now run getList() again, leaving predicate, swapping subject and object, to get parentListOuter.
+               queryParams.putSingle(IRelationsManager.PREDICATE_QP, predicate);
+               queryParams.putSingle(IRelationsManager.SUBJECT_QP, itemCSID);
+               queryParams.putSingle(IRelationsManager.OBJECT_QP, null);
+               RelationsCommonList parentListOuter = (new RelationResource()).getList(ctx.getUriInfo());
+       
+
+               childList = childListOuter.getRelationListItem();
+               parentList = parentListOuter.getRelationListItem();
+
+               if (parentList.size() > 1) {
+                   throw new Exception("Too many parents for object: " + itemCSID + " list: " + dumpList(parentList, "parentList"));
+               }
+        
+               if(logger.isTraceEnabled()) {
+                       logger.trace("AuthItemDocHndler.updateRelations for: "+itemCSID+" got existing relations.");
+               }
         }
 
-        DocumentModel docModel = wrapDoc.getWrappedObject();
-
-        //Do magic replacement of ${itemCSID} and fix URI's.
-        fixupInboundListItems(ctx, inboundList, docModel, itemCSID);
 
         for (RelationsCommonList.RelationListItem inboundItem : inboundList) {
-            if (inboundItem.getObject().getCsid().equals(itemCSID) && inboundItem.getPredicate().equals(HAS_BROADER)) {
+               // Note that the relations may specify the other (non-item) bit with a refName, not a CSID,
+               // and so the CSID for those may be null
+            if (itemCSID.equals(inboundItem.getObject().getCsid()) 
+                       && inboundItem.getPredicate().equals(HAS_BROADER)) {
                 //then this is an item that says we have a child.  That child is inboundItem
-                RelationsCommonList.RelationListItem childItem = findInList(childList, inboundItem);
+                RelationsCommonList.RelationListItem childItem = 
+                               (childList==null)?null:findInList(childList, inboundItem);
                 if (childItem != null) {
                     removeFromList(childList, childItem);    //exists, just take it off delete list
                 } else {
@@ -532,9 +577,11 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
                 }
                 ensureChildHasNoOtherParents(ctx, queryParams, inboundItem.getSubject().getCsid());
 
-            } else if (inboundItem.getSubject().getCsid().equals(itemCSID) && inboundItem.getPredicate().equals(HAS_BROADER)) {
+            } else if (itemCSID.equals(inboundItem.getSubject().getCsid())
+                       && inboundItem.getPredicate().equals(HAS_BROADER)) {
                 //then this is an item that says we have a parent.  inboundItem is that parent.
-                RelationsCommonList.RelationListItem parentItem = findInList(parentList, inboundItem);
+                RelationsCommonList.RelationListItem parentItem = 
+                               (parentList==null)?null:findInList(parentList, inboundItem);
                 if (parentItem != null) {
                     removeFromList(parentList, parentItem);    //exists, just take it off delete list
                 } else {
@@ -545,12 +592,27 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
                 //not dealing with: hasNarrower or any other predicate.
             }
         }
-        String dump = dumpLists(itemCSID, parentList, childList, actionList);
-        //System.out.println("====dump====="+CR+dump);
-        logger.info("~~~~~~~~~~~~~~~~~~~~~~dump~~~~~~~~~~~~~~~~~~~~~~~~" + CR + dump);
-        deleteRelations(parentList, ctx, "parentList");               //todo: there are items appearing on both lists....april 20.
-        deleteRelations(childList, ctx, "childList");
+        if(logger.isTraceEnabled()) {
+               String dump = dumpLists(itemCSID, parentList, childList, actionList);
+               //System.out.println("====dump====="+CR+dump);
+               logger.trace("~~~~~~~~~~~~~~~~~~~~~~dump~~~~~~~~~~~~~~~~~~~~~~~~" + CR + dump);
+        }
+        if(fUpdate) {
+            if(logger.isTraceEnabled()) {
+               logger.trace("AuthItemDocHndler.updateRelations for: "+itemCSID+" deleting "
+                                       +parentList.size()+" existing parents and "+childList.size()+" existing children.");
+            }
+               deleteRelations(parentList, ctx, "parentList");               //todo: there are items appearing on both lists....april 20.
+               deleteRelations(childList, ctx, "childList");
+        }
+        if(logger.isTraceEnabled()) {
+               logger.trace("AuthItemDocHndler.updateRelations for: "+itemCSID+" adding "
+                               +actionList.size()+" new parents and children.");
+        }
         createRelations(actionList, ctx);
+        if(logger.isTraceEnabled()) {
+               logger.trace("AuthItemDocHndler.updateRelations for: "+itemCSID+" done.");
+        }
         //We return all elements on the inbound list, since we have just worked to make them exist in the system
         // and be non-redundant, etc.  That list came from relationsCommonListBody, so it is still attached to it, just pass that back.
         return relationsCommonListBody;
@@ -615,42 +677,41 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             RelationsDocListItem inboundItemObject = inboundItem.getObject();
             RelationsDocListItem inboundItemSubject = inboundItem.getSubject();
 
-            if (inboundItemObject.getCsid().equalsIgnoreCase(CommonAPI.AuthorityItemCSID_REPLACE)) {
+            if (CommonAPI.AuthorityItemCSID_REPLACE.equalsIgnoreCase(inboundItemObject.getCsid())) {
                 inboundItem.setObjectCsid(itemCSID);
                 inboundItemObject.setCsid(itemCSID);
-                inboundItemObject.setUri(getUri(docModel));
+                //inboundItemObject.setUri(getUri(docModel));
             } else {
+               /*
                 String objectCsid = inboundItemObject.getCsid();
                 DocumentModel itemDocModel = NuxeoUtils.getDocFromCsid(getRepositorySession(), ctx, objectCsid);    //null if not found.
                 DocumentWrapper wrapper = new DocumentWrapperImpl(itemDocModel);
                 String uri = this.getRepositoryClient(ctx).getDocURI(wrapper);
                 inboundItemObject.setUri(uri);    //CSPACE-4037
+                */
             }
-            uriPointsToSameAuthority(thisURI, inboundItemObject.getUri());    //CSPACE-4042
+            //uriPointsToSameAuthority(thisURI, inboundItemObject.getUri());    //CSPACE-4042
 
-            if (inboundItemSubject.getCsid().equalsIgnoreCase(CommonAPI.AuthorityItemCSID_REPLACE)) {
+            if (CommonAPI.AuthorityItemCSID_REPLACE.equalsIgnoreCase(inboundItemSubject.getCsid())) {
                 inboundItem.setSubjectCsid(itemCSID);
                 inboundItemSubject.setCsid(itemCSID);
-                inboundItemSubject.setUri(getUri(docModel));
+                //inboundItemSubject.setUri(getUri(docModel));
             } else {
+               /*
                 String subjectCsid = inboundItemSubject.getCsid();
                 DocumentModel itemDocModel = NuxeoUtils.getDocFromCsid(getRepositorySession(), ctx, subjectCsid);    //null if not found.
                 DocumentWrapper wrapper = new DocumentWrapperImpl(itemDocModel);
                 String uri = this.getRepositoryClient(ctx).getDocURI(wrapper);
                 inboundItemSubject.setUri(uri);    //CSPACE-4037
+                */
             }
-            uriPointsToSameAuthority(thisURI, inboundItemSubject.getUri());  //CSPACE-4042
+            //uriPointsToSameAuthority(thisURI, inboundItemSubject.getUri());  //CSPACE-4042
 
         }
     }
 
-    public RepositoryClient getRepositoryClient(ServiceContext ctx) {
-        RepositoryClient repositoryClient = RepositoryClientFactory.getInstance().getClient(ctx.getRepositoryClientName());
-        return repositoryClient;
-    }
-
     // this method calls the RelationResource to have it create the relations and persist them.
-    private void createRelations(List<RelationsCommonList.RelationListItem> inboundList, ServiceContext ctx) {
+    private void createRelations(List<RelationsCommonList.RelationListItem> inboundList, ServiceContext ctx) throws Exception {
         for (RelationsCommonList.RelationListItem item : inboundList) {
             RelationsCommon rc = new RelationsCommon();
             //rc.setCsid(item.getCsid());
@@ -658,6 +719,8 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             RelationsDocListItem itemSubject = item.getSubject();
             RelationsDocListItem itemObject = item.getObject();
 
+            // Set at least one of CSID and refName for Subject and Object
+            // Either value might be null for for each of Subject and Object 
             String subjectCsid = itemSubject.getCsid();
             rc.setSubjectCsid(subjectCsid);
             rc.setDocumentId1(subjectCsid); // populate legacy field for backward compatibility
@@ -673,21 +736,27 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon>
             //RelationshipType  foo = (RelationshipType.valueOf(item.getPredicate())) ;
             //rc.setPredicate(foo);     //this must be one of the type found in the enum in  services/jaxb/src/main/resources/relations_common.xsd
 
+            // This is superfluous, since it will be fetched by the Relations Create logic.
             rc.setSubjectDocumentType(itemSubject.getDocumentType());
             rc.setObjectDocumentType(itemObject.getDocumentType());
             // populate legacy fields for backward compatibility
             rc.setDocumentType1(itemSubject.getDocumentType());
             rc.setDocumentType2(itemObject.getDocumentType());
 
+            // This is superfluous, since it will be fetched by the Relations Create logic.
             rc.setSubjectUri(itemSubject.getUri());
             rc.setObjectUri(itemObject.getUri());
+            // May not have the info here. Only really require CSID or refName. 
+            // Rest is handled in the Relation create mechanism
+            //uriPointsToSameAuthority(itemSubject.getUri(), itemObject.getUri());
 
             PoxPayloadOut payloadOut = new PoxPayloadOut(RelationClient.SERVICE_PAYLOAD_NAME);
             PayloadOutputPart outputPart = new PayloadOutputPart(RelationClient.SERVICE_COMMONPART_NAME, rc);
             payloadOut.addPart(outputPart);
             //System.out.println("\r\n==== TO CREATE: "+rc.getDocumentId1()+"==>"+rc.getPredicate()+"==>"+rc.getDocumentId2());
             RelationResource relationResource = new RelationResource();
-            Object res = relationResource.create(ctx.getUriInfo(), payloadOut.toXML());    //NOTE ui recycled from above to pass in unknown query params.
+            Object res = relationResource.create(ctx.getResourceMap(), 
+                       ctx.getUriInfo(), payloadOut.toXML());    //NOTE ui recycled from above to pass in unknown query params.
         }
     }
 
index 633a706f63cbfe40789887270fab35d5e3ec943b..a751d5397dbfacb48cbfce46b4c11b2d8b9107c9 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
index 8df63cddb10dc45e647d990b9a0197e6c7b5a0c1..fcaa5e616cf2a5dbda96b92eeb61847333ee0764 100644 (file)
@@ -135,7 +135,7 @@ public class CreateAndLinkLoanOutBatchJob implements BatchInvocable {
                // First, create the Loanout
                // We fetch the resource class by service name
                ResourceBase resource = resourceMap.get( LoanoutClient.SERVICE_NAME); 
-               Response response = resource.create(null, loanoutPayload);
+               Response response = resource.create(resourceMap, null, loanoutPayload);
                if(response.getStatus() != CREATED_STATUS) {
                        completionStatus = STATUS_ERROR;
                        errorInfo = new InvocationError(INT_ERROR_STATUS,
@@ -161,7 +161,7 @@ public class CreateAndLinkLoanOutBatchJob implements BatchInvocable {
                        +   "<predicateDisplayName>"+RELATION_PREDICATE_DISP+"</predicateDisplayName>"
                        + "</ns2:relations_common></document>";
                ResourceBase resource = resourceMap.get(RelationClient.SERVICE_NAME);
-               Response response = resource.create(null, relationPayload);
+               Response response = resource.create(resourceMap, null, relationPayload);
                if(response.getStatus() != CREATED_STATUS) {
                        completionStatus = STATUS_ERROR;
                        errorInfo = new InvocationError(INT_ERROR_STATUS,
index 7d78e24a394c726046733b2724762bf356bc747b..1459035aaf2aa2996dcc5e2621f111cf1a4f3a07 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>
index 9126c7835ade57a8c9f9e6b42beba5632e747bed..645c5976f8e651124a00231a1e0c8775c10849fa 100644 (file)
@@ -28,6 +28,7 @@ import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 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.blob.BlobInput;
 import org.collectionspace.services.common.blob.BlobUtil;
@@ -207,7 +208,9 @@ public class BlobResource extends ResourceBase {
     
     @POST
     @Override
-    public Response create(@Context UriInfo ui,
+    public Response create(
+               @Context ResourceMap resourceMap, 
+               @Context UriInfo ui,
                String xmlPayload) {
        Response response = null;
        MultivaluedMap<String, String> queryParams = ui.getQueryParameters();
@@ -220,7 +223,7 @@ public class BlobResource extends ResourceBase {
                        blobInput.createBlobFile(blobUri);
                        response = this.create(null, ctx);
                } else {
-                       response = super.create(ui, xmlPayload);
+                       response = super.create(resourceMap, ui, xmlPayload);
                }
        } catch (Exception e) {
                throw bigReThrow(e, ServiceMessages.CREATE_FAILED);
index 0b035126377bab369a2f2f12f7e9d2ddf0c00b93..7249f02bdce0f6aeeb7a8b526a413fb12660d432 100644 (file)
@@ -37,7 +37,7 @@
         </dependency>        \r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>        \r
index 4dc221e383e6f9f5ab6d584b791ae0bce377f8e5..3d348503ac9979b06e82232d1e84c760d8d14ac0 100644 (file)
@@ -26,6 +26,7 @@ package org.collectionspace.services.common;
 import org.collectionspace.services.client.IQueryManager;\r
 import org.collectionspace.services.client.PoxPayloadIn;\r
 import org.collectionspace.services.client.PoxPayloadOut;\r
+import org.collectionspace.services.common.api.RefName;\r
 import org.collectionspace.services.common.authorityref.AuthorityRefList;\r
 import org.collectionspace.services.common.context.MultipartServiceContextImpl;\r
 import org.collectionspace.services.common.context.ServiceBindingUtils;\r
@@ -78,13 +79,15 @@ public abstract class ResourceBase
 \r
 \r
     //======================= CREATE ====================================================\r
+    \r
     @POST\r
-    public Response create(@Context UriInfo ui,\r
+    public Response create(@Context ResourceMap resourceMap, @Context UriInfo ui,\r
             String xmlPayload) {\r
         try {\r
             PoxPayloadIn input = new PoxPayloadIn(xmlPayload);\r
             //System.out.println("\r\n\r\n==============================\r\nxmlPayload:\r\n"+xmlPayload);\r
             ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(input);\r
+            ctx.setResourceMap(resourceMap);\r
             return create(input, ctx);\r
         } catch (Exception e) {\r
             throw bigReThrow(e, ServiceMessages.CREATE_FAILED);\r
@@ -116,12 +119,13 @@ public abstract class ResourceBase
     //======================= UPDATE ====================================================\r
     @PUT\r
     @Path("{csid}")\r
-    public byte[] update(@PathParam("csid") String csid, String xmlPayload) {\r
+    public byte[] update(@Context ResourceMap resourceMap, @PathParam("csid") String csid, String xmlPayload) {\r
         PoxPayloadOut result = null;\r
         ensureCSID(csid, UPDATE);\r
         try {\r
             PoxPayloadIn theUpdate = new PoxPayloadIn(xmlPayload);\r
             ServiceContext<PoxPayloadIn, PoxPayloadOut> ctx = createServiceContext(theUpdate);\r
+            ctx.setResourceMap(resourceMap);\r
             result = update(csid, theUpdate, ctx); //==> CALL implementation method, which subclasses may override.\r
         } catch (Exception e) {\r
             throw bigReThrow(e, ServiceMessages.UPDATE_FAILED, csid);\r
@@ -336,4 +340,35 @@ public abstract class ResourceBase
         }\r
         return authRefList;\r
     }\r
+    \r
+    //======================== UTILITY : getDocModelForRefName ========================================\r
+    /*\r
+     * ResourceBase create and update calls will set the resourceMap into the service context\r
+     * for all inheriting resource classes. Just use ServiceContext.getResourceMap() to get\r
+     * the map, and pass it in.\r
+     */\r
+    public static DocumentModel getDocModelForRefName(String refName, ResourceMap resourceMap) \r
+                       throws Exception, DocumentNotFoundException {\r
+       // TODO - we need to generalize the idea of a refName to more than Authorities and Items. \r
+       RefName.AuthorityItem item = RefName.AuthorityItem.parse(refName);\r
+       if(item == null) {\r
+               return null;\r
+       }\r
+       ResourceBase resource = resourceMap.get(item.inAuthority.resource);\r
+       return resource.getDocModelForAuthorityItem(item);\r
+    }\r
+\r
+    // THis is ugly, but prevents us parsing the refName twice. Once we make refName a little more\r
+    // general, and less Authority(Item) specific, this will look better.\r
+       public DocumentModel getDocModelForAuthorityItem(RefName.AuthorityItem item) \r
+                       throws Exception, DocumentNotFoundException {\r
+               logger.warn("Default (ResourceBase) getDocModelForAuthorityItem called - should not happen!");\r
+               return null;\r
+       }\r
+\r
+    public DocumentModel getDocModelForRefName(String refName) \r
+                       throws Exception, DocumentNotFoundException {\r
+       return getDocModelForAuthorityItem(RefName.AuthorityItem.parse(refName));\r
+    }\r
+\r
 }\r
index be3df4641ded54e25d5afbdc0b40bda9ae3ce4f1..1c5f5c422087c65c52e38451b3298ce9f22ec183 100644 (file)
@@ -27,6 +27,7 @@ import java.lang.reflect.Constructor;
 
 import javax.ws.rs.core.MultivaluedMap;
 
+import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.security.UnauthorizedException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -51,6 +52,8 @@ public class RemoteServiceContextImpl<IT, OT>
     /** The target of the HTTP request **/
     JaxRsContext jaxRsContext;
     
+    ResourceMap resourceMap = null;
+    
     @Override
     public void setJaxRsContext(JaxRsContext theJaxRsContext) {
        this.jaxRsContext = theJaxRsContext;
@@ -138,6 +141,22 @@ public class RemoteServiceContextImpl<IT, OT>
         this.output = output;
     }
 
+    /**
+     * @return the map of service names to resource classes.
+     */
+    public ResourceMap getResourceMap() {
+       return resourceMap;
+    }
+
+    /**
+     * @param map the map of service names to resource instances.
+     */
+    public void setResourceMap(ResourceMap map) {
+       this.resourceMap = map;
+    }
+
+    
     /* (non-Javadoc)
      * @see org.collectionspace.services.common.context.RemoteServiceContext#getLocalContext(java.lang.String)
      */
index ccfdb588c464c4ae7415a49e4ee3ab10487215cb..193167e1ce55be91453147c45dd88858aea8abf2 100644 (file)
@@ -30,6 +30,7 @@ import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.UriInfo;
 
 import org.collectionspace.services.common.ClientType;
+import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.document.DocumentHandler;
 import org.collectionspace.services.common.document.ValidatorHandler;
 import org.collectionspace.services.common.query.QueryContext;
@@ -44,6 +45,12 @@ import org.collectionspace.services.common.service.ServiceBindingType;
  * between various components of the service framework while processing
  * a service request.
  */
+/**
+ * @author pschmitz
+ *
+ * @param <IT>
+ * @param <OT>
+ */
 public interface ServiceContext<IT, OT> {
 
     /**
@@ -169,7 +176,7 @@ public interface ServiceContext<IT, OT> {
      * @return the input
      */
     public IT getInput();
-
+    
     /**
      * setInput is used to set request input before starting to
      * process input data
@@ -189,6 +196,16 @@ public interface ServiceContext<IT, OT> {
      */
     public void setOutput(OT output);
 
+    /**
+     * @return the map of service names to resource classes.
+     */
+    public ResourceMap getResourceMap();
+
+    /**
+     * @param map the map of service names to resource instances.
+     */
+    public void setResourceMap(ResourceMap map);
+
     /**
      * getPartsMetadata returns metadata for object parts used by the service
      * @return
index e8d9366f9f480bce6fbb7108342f1c2c48cabf16..2ce34ae91170b67f3d0ce1ccdc9452f83e868d15 100755 (executable)
@@ -32,10 +32,13 @@ import java.util.List;
 \r
 import org.collectionspace.services.common.ReflectionMapper;\r
 import org.collectionspace.services.common.api.Tools;\r
+import org.collectionspace.services.common.repository.RepositoryClient;\r
+import org.collectionspace.services.common.repository.RepositoryClientFactory;\r
 import org.collectionspace.services.common.service.ListResultField;\r
 import org.collectionspace.services.common.service.DocHandlerParams;\r
 import org.collectionspace.services.common.service.ServiceBindingType;\r
 import org.collectionspace.services.common.context.MultipartServiceContext;\r
+import org.collectionspace.services.common.context.ServiceContext;\r
 import org.collectionspace.services.common.datetime.DateTimeFormatUtils;\r
 import org.collectionspace.services.common.document.DocumentException;\r
 import org.collectionspace.services.common.document.DocumentWrapper;\r
@@ -89,6 +92,7 @@ public abstract class DocHandlerBase<T> extends RemoteDocumentModelHandlerImpl<T
         this.commonPart = commonPart;\r
     }\r
 \r
+\r
     /** Subclass DocHandlers may override this method to control exact creation of the common list.\r
      *  This class instantiates an AbstractCommonList from the classname returned by getDocHandlerParams().AbstractCommonListClassname.\r
      * @return\r
index 54e9db8f7419e793ea33b8f3d37f9a83aac784ac..91c7a2f0c290a42f1211630b79e460c34ae30d42 100644 (file)
@@ -37,6 +37,8 @@ import org.collectionspace.services.common.document.DocumentHandler.Action;
 import org.collectionspace.services.nuxeo.client.*;
 import org.collectionspace.services.nuxeo.util.NuxeoUtils;
 import org.collectionspace.services.common.profile.Profiler;
+import org.collectionspace.services.common.repository.RepositoryClient;
+import org.collectionspace.services.common.repository.RepositoryClientFactory;
 
 import org.nuxeo.ecm.core.api.ClientException;
 import org.nuxeo.ecm.core.api.DocumentModel;
@@ -81,6 +83,11 @@ public abstract class DocumentModelHandler<T, TL>
     }
     
     
+    public RepositoryClient getRepositoryClient(ServiceContext ctx) {
+        RepositoryClient repositoryClient = RepositoryClientFactory.getInstance().getClient(ctx.getRepositoryClientName());
+        return repositoryClient;
+    }
+
     /**
      * getRepositorySession returns Nuxeo Repository Session
      * @return
index 74c236d2c0295c4e8166cf9a5b753e273d41edb6..49a787eff5583ad07cefd21e892c88eb1344c92a 100644 (file)
@@ -15,7 +15,7 @@
     <dependencies>
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
index 20904c25df162f657bb2584c895ff05d372b9d3f..6d0fa2bbcdfd898620579742b50db73c5ebff601 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
index 9ccff566155b19d154904f1508cd390bb24cb56d..55e9c2b6052683a19fead203d00de09207580d10 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>        \r
index dfc3ca4f3c3c63e6823a5450f2ff76dd06ed010c..51b062e451f14e3682eadbce30b0349c692dd1e4 100644 (file)
@@ -74,7 +74,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
     private List<String> intakeIdsCreated = new ArrayList<String>();\r
     private List<String> orgIdsCreated = new ArrayList<String>();\r
     private String orgAuthCSID = null; \r
-    private String orgAuthRefName = null; \r
+    //private String orgAuthRefName = null; \r
     private String currentOwnerOrgCSID = null; \r
     private String currentOwnerRefName = null;\r
     private String depositorRefName = null;\r
@@ -173,8 +173,8 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
      */\r
     protected void createOrgRefs(){\r
         OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();\r
-        orgAuthRefName = \r
-               OrgAuthorityClientUtils.createOrgAuthRefName(ORGANIZATION_AUTHORITY_NAME, null);\r
+        //orgAuthRefName = \r
+       //      OrgAuthorityClientUtils.createOrgAuthRefName(ORGANIZATION_AUTHORITY_NAME, null);\r
         PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(\r
                        ORGANIZATION_AUTHORITY_NAME, ORGANIZATION_AUTHORITY_NAME, orgAuthClient.getCommonPartName());\r
         ClientResponse<Response> res = orgAuthClient.create(multipart);\r
@@ -218,7 +218,7 @@ public class OrganizationAuthRefDocsTest extends BaseServiceTest {
         orgInfo.put(OrganizationJAXBSchema.SHORT_NAME, shortName);\r
         orgInfo.put(OrganizationJAXBSchema.LONG_NAME, longName);\r
         PoxPayloadOut multipart = \r
-               OrgAuthorityClientUtils.createOrganizationInstance(orgAuthRefName,\r
+               OrgAuthorityClientUtils.createOrganizationInstance(null, //orgAuthRefName,\r
                                orgInfo, orgAuthClient.getItemCommonPartName());\r
         ClientResponse<Response> res = orgAuthClient.createItem(orgAuthCSID, multipart);\r
         int statusCode = res.getStatus();\r
index 5aea39c89f08eccbf2bfebda5e72759570d139a6..503295fa7552cca1447891eb3a7ae3f114a620cf 100644 (file)
             <artifactId>org.collectionspace.services.person.client</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>    
 <!-- External dependencies -->        
         <dependency>
             <groupId>org.testng</groupId>
index cd761fc1bb23089f2647300707e8fd03e6d520ce..f6e2dcf3cffadd8773da45be6b7c8b4983a5713e 100644 (file)
@@ -31,6 +31,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
 import org.collectionspace.services.PersonJAXBSchema;
+import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.LoaninClient;
 import org.collectionspace.services.client.PersonAuthorityClient;
index 6da96f378c3fe46abf42712c9c8e631fcd1da122..467a27507348539b37bede8cdc4a562eabc887bc 100644 (file)
     <packaging>pom</packaging>
 
     <dependencies>
-        <dependency>
-            <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
-            <optional>true</optional>
-            <version>${project.version}</version>
-        </dependency>    
     </dependencies>
 
     <modules>
index e482002e2efccca68c26e35478c4390d4f1e66d2..5e27b9008891f6bb2030d6ec1c74f703fceb4bcf 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
index 0c140143ac7d6ca5502a6f4b9e159bdd6772c0bf..627b746fd41b90cfe1b57f9deca8f5653a84152f 100644 (file)
             <artifactId>org.collectionspace.services.location.jaxb</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.client</artifactId>\r
index 80341e13b2bcae304de1ecec076c32a717eb2c61..639cc224b39e531e8aa58e181aaff49f0bf1e8f3 100644 (file)
             <artifactId>org.collectionspace.services.jaxb</artifactId>
             <version>${project.version}</version>
         </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>        
     </dependencies>
 
     <build>
index c9a34a6e4df01cbd94a653cde6950eb37eca397c..32b502480faa3565b39a2e1567fcf5f7b0580be8 100644 (file)
     <packaging>pom</packaging>\r
 \r
     <dependencies>\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>    \r
     </dependencies>\r
 \r
     <modules>\r
index 50f662244a39b8b54c1ad35da82d8663e07362f7..19deb675a8b462bac64359dd3f8cc84ec3f46aee 100644 (file)
             <artifactId>org.collectionspace.services.location.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.contact.service</artifactId>\r
index 66e64af21af07a5057ced7e32695355c4d09e056..bc2a854c1737f994de241792da4262c2e9e4138b 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
index 1cf2a5c279fb463e0859ad738932db152c14b9e8..0d39ad2b8ebabd8d38f31a1a85df0246b88400cf 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
index 4ffd7ca00ed5f0ffe23fbe6d5b4ef8f2d1d696c9..67ef18d8387977316e3e6dd404465a8a7d7ee61a 100644 (file)
             <artifactId>slf4j-log4j12</artifactId>\r
         </dependency>\r
         <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
-            <optional>true</optional>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.note.jaxb</artifactId>\r
index ad0dca9cc3dbf6fdd083fb9ca1267173a34c553e..9df823f6ba22673e0e8f34e5ce0b4c7ad6ff8161 100644 (file)
@@ -28,7 +28,7 @@
 <!-- CollectionSpace dependencies -->
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>        
index 369fad5f5724462003da93ab96a0e5f8b6f3a234..7d1b314c6fc63a84a6815ea1d395377bdac3bcf3 100644 (file)
             <scope>provided</scope>\r
         </dependency>\r
         <!-- CollectionSpace dependencies -->\r
-        <dependency>\r
-            <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
-            <version>${project.version}</version>\r
-        </dependency>        \r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.organization.jaxb</artifactId>\r
index 80b5c988641b31b063f0ae996add4e1aa2ce6c82..e8f8f3587dea3bcf614451cc4bcc3d7678407b0f 100644 (file)
@@ -143,8 +143,8 @@ public class OrgAuthorityClientUtils {
         OrgauthoritiesCommon orgAuthority = new OrgauthoritiesCommon();\r
         orgAuthority.setDisplayName(displayName);\r
         orgAuthority.setShortIdentifier(shortIdentifier);\r
-        String refName = createOrgAuthRefName(shortIdentifier, displayName);\r
-        orgAuthority.setRefName(refName);\r
+        //String refName = createOrgAuthRefName(shortIdentifier, displayName);\r
+        //orgAuthority.setRefName(refName);\r
         orgAuthority.setVocabType("OrgAuthority");\r
         PoxPayloadOut multipart = new PoxPayloadOut(OrgAuthorityClient.SERVICE_PAYLOAD_NAME);\r
         PayloadOutputPart commonPart = multipart.addPart(orgAuthority, MediaType.APPLICATION_XML_TYPE);\r
@@ -258,8 +258,8 @@ public class OrgAuthorityClientUtils {
                if((value = (String)orgInfo.get(OrganizationJAXBSchema.SHORT_DISPLAY_NAME))!=null)\r
                organization.setShortDisplayName(value);\r
                \r
-       String refName = createOrganizationRefName(orgAuthRefName, shortId, value);\r
-       organization.setRefName(refName);\r
+       //String refName = createOrganizationRefName(orgAuthRefName, shortId, value);\r
+       //organization.setRefName(refName);\r
 \r
         if (mainBodyList != null) {\r
             organization.setMainBodyGroupList(mainBodyList);\r
@@ -359,6 +359,7 @@ public class OrgAuthorityClientUtils {
      * @param displaySuffix displayName to be appended, if non-null\r
      * @return the string\r
      */\r
+    /*\r
     public static String createOrgAuthRefName(String shortId, String displaySuffix) {\r
        String refName = "urn:cspace:org.collectionspace.demo:orgauthority:name("\r
                        +shortId+")";\r
@@ -366,6 +367,7 @@ public class OrgAuthorityClientUtils {
                refName += "'"+displaySuffix+"'";\r
        return refName;\r
     }\r
+    */\r
 \r
     /**\r
      * Creates the organization ref name.\r
@@ -375,6 +377,7 @@ public class OrgAuthorityClientUtils {
      * @param displaySuffix displayName to be appended, if non-null\r
      * @return the string\r
      */\r
+    /*\r
     public static String createOrganizationRefName(\r
                        String orgAuthRefName, String shortId, String displaySuffix) {\r
        String refName = orgAuthRefName+":organization:name("+shortId+")";\r
@@ -382,6 +385,7 @@ public class OrgAuthorityClientUtils {
                refName += "'"+displaySuffix+"'";\r
        return refName;\r
     }\r
+    */\r
 \r
     /**\r
      * Produces a default displayName from the basic name and foundingPlace fields.\r
index 4e2f722c4c8a0f755c912c662134ff4045091d3b..ef155886bbe84abbfcf0ddd5944e7d6a25a27c2a 100644 (file)
@@ -155,7 +155,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
         OrgAuthorityClient orgAuthClient = new OrgAuthorityClient();
         String shortId = createIdentifier();
         String displayName = "TestOrgAuth-" + shortId;
-       String baseRefName = OrgAuthorityClientUtils.createOrgAuthRefName(shortId, null);
+       //String baseRefName = OrgAuthorityClientUtils.createOrgAuthRefName(shortId, null);
         PoxPayloadOut multipart =
             OrgAuthorityClientUtils.createOrgAuthorityInstance(
                                displayName, shortId, orgAuthClient.getCommonPartName());
@@ -181,7 +181,7 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
                // so they can be deleted after tests have been run.
                String newId = extractId(res);
                if (knownResourceId == null){
-                       setKnownResource( newId, baseRefName );
+                       setKnownResource( newId, null ); //baseRefName );
                }
                allResourceIdsCreated.add(newId);
         } finally {
@@ -252,17 +252,17 @@ public class OrgAuthorityAuthRefsTest extends BaseServiceTest {
             res.releaseConnection();
         }
 
-        String authRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
+        //String authRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
         
         // Create temporary Person resources, and their corresponding refNames
         // by which they can be identified.
-               String csid = createPerson("Charlie", "Orgcontact", "charlieOrgcontact", authRefName);
+               String csid = createPerson("Charlie", "Orgcontact", "charlieOrgcontact", null ); // authRefName);
         personIdsCreated.add(csid);
         organizationContactPersonRefName1 = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
 
         // Create temporary Person resources, and their corresponding refNames
         // by which they can be identified.
-               csid = createPerson("Chelsie", "Contact", "chelsieContact", authRefName);
+               csid = createPerson("Chelsie", "Contact", "chelsieContact", null ); // authRefName);
         personIdsCreated.add(csid);
         organizationContactPersonRefName2 = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
     }
index 8529b975f55fb4916889c9402d43d4283b71d36b..160e08da161947a186e6a160ab6ac7f58bb13b45 100644 (file)
@@ -146,7 +146,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl { //FIXME:
         OrgAuthorityClient client = new OrgAuthorityClient();
         String shortId = createIdentifier();
         String displayName = "displayName-" + shortId;
-        String baseRefName = OrgAuthorityClientUtils.createOrgAuthRefName(shortId, null);
+        //String baseRefName = OrgAuthorityClientUtils.createOrgAuthRefName(shortId, null);
         PoxPayloadOut multipart = OrgAuthorityClientUtils.createOrgAuthorityInstance(
                 displayName, shortId, client.getCommonPartName());
 
@@ -176,7 +176,7 @@ public class OrgAuthorityServiceTest extends AbstractServiceTestImpl { //FIXME:
         // Store the ID returned from the first resource created
         // for additional tests below.
         if (knownResourceId == null) {
-            setKnownResource(newID, shortId, baseRefName);
+            setKnownResource(newID, shortId, null ); //baseRefName);
             if (logger.isDebugEnabled()) {
                 logger.debug(testName + ": knownResourceId=" + knownResourceId);
             }
index 4f3a920449f982871ed0897d43a794a2a3eb6086..4da8fc09c282cd3c84c5f9c659c2113e7fc84778 100644 (file)
     <name>services.organization.jaxb</name>
     
     <dependencies>
-        <dependency>
-            <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.authority</artifactId>
-            <optional>true</optional>
-            <version>${project.version}</version>
-        </dependency>        
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.common</artifactId>
             <artifactId>org.collectionspace.services.jaxb</artifactId>
             <version>${project.version}</version>
         </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
     </dependencies>
     
     <build>
index 4506840ca9675315bd49f492f7a1950ea3a39efe..5acef8dc3e67a4e5a273a31c21b4c65ba9a57b7c 100644 (file)
     <packaging>pom</packaging>\r
     \r
     <dependencies>\r
+                       <!--\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.authority</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>    \r
+                               -->\r
     </dependencies>\r
 \r
     <modules>\r
index 46d9ab20a9294886399f1ada4711877a39f06fef..55924d0e9f990fca2b4874db9cb2b32caea45d0f 100644 (file)
@@ -24,7 +24,7 @@
         <!-- CollectionSpace dependencies -->\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
+            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>        \r
index f3247e59b3bcda091198b0778e1530ab465db5b0..8942b0473b050c082dd39548437dbf4b0dee38cf 100644 (file)
             <artifactId>org.collectionspace.services.jaxb</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>        \r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>        \r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.common</artifactId>\r
index b7613f67326aae6592c6677eee4ded02f3a49bb0..267c8ac99b3c13063b677b551ee93e79a6c6a1f8 100644 (file)
@@ -140,8 +140,8 @@ public class PersonAuthorityClientUtils {
         PersonauthoritiesCommon personAuthority = new PersonauthoritiesCommon();\r
         personAuthority.setDisplayName(displayName);\r
         personAuthority.setShortIdentifier(shortIdentifier);\r
-        String refName = createPersonAuthRefName(shortIdentifier, displayName);\r
-        personAuthority.setRefName(refName);\r
+        //String refName = createPersonAuthRefName(shortIdentifier, displayName);\r
+        //personAuthority.setRefName(refName);\r
         personAuthority.setVocabType("PersonAuthority");\r
         PoxPayloadOut multipart = new PoxPayloadOut(PersonAuthorityClient.SERVICE_PAYLOAD_NAME);\r
         PayloadOutputPart commonPart = multipart.addPart(personAuthority, MediaType.APPLICATION_XML_TYPE);\r
@@ -170,7 +170,7 @@ public class PersonAuthorityClientUtils {
                String headerLabel){\r
         final Map<String, List<String>> EMPTY_PERSON_REPEATABLES_INFO =\r
                 new HashMap<String, List<String>>();\r
-        return createPersonInstance(inAuthority, personAuthRefName, personInfo,\r
+        return createPersonInstance(inAuthority, null /*personAuthRefName*/, personInfo,\r
                 EMPTY_PERSON_REPEATABLES_INFO, headerLabel);\r
     }\r
 \r
@@ -226,8 +226,8 @@ public class PersonAuthorityClientUtils {
                throw new IllegalArgumentException("shortDisplayName cannot be null when shortDisplayComputed is 'false'");\r
        }       \r
 \r
-       String refName = createPersonRefName(personAuthRefName, shortId, displayName);\r
-               person.setRefName(refName);\r
+       //String refName = createPersonRefName(personAuthRefName, shortId, displayName);\r
+               //person.setRefName(refName);\r
        \r
        String value;\r
         List<String> values = null;\r
@@ -352,10 +352,10 @@ public class PersonAuthorityClientUtils {
        \r
        if(logger.isDebugEnabled()){\r
                logger.debug("Import: Create Item: \"" + displayName\r
-                               +"\" in personAuthorityulary: \"" + personAuthorityRefName +"\"");\r
+                               +"\" in personAuthorityulary: \"" + vcsid +"\"");\r
        }\r
        PoxPayloadOut multipart = \r
-               createPersonInstance(vcsid, personAuthorityRefName,\r
+               createPersonInstance(vcsid, null /*personAuthorityRefName*/,\r
                        personMap, personRepeatablesMap, client.getItemCommonPartName());\r
        \r
        String result = null;\r
@@ -365,12 +365,12 @@ public class PersonAuthorityClientUtils {
        \r
                if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
                        throw new RuntimeException("Could not create Item: \""+personMap.get(PersonJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in personAuthority: \"" + personAuthorityRefName\r
+                                       +"\" in personAuthority: \"" + vcsid //personAuthorityRefName\r
                                        +"\" "+ invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
                }\r
                if(statusCode != EXPECTED_STATUS_CODE) {\r
                        throw new RuntimeException("Unexpected Status when creating Item: \""+personMap.get(PersonJAXBSchema.SHORT_IDENTIFIER)\r
-                                       +"\" in personAuthority: \"" + personAuthorityRefName +"\", Status:"+ statusCode);\r
+                                       +"\" in personAuthority: \"" + vcsid /*personAuthorityRefName*/ +"\", Status:"+ statusCode);\r
                }\r
        \r
                result = extractId(res);\r
@@ -388,6 +388,7 @@ public class PersonAuthorityClientUtils {
      * @param displaySuffix displayName to be appended, if non-null\r
      * @return the string\r
      */\r
+    /*\r
     public static String createPersonAuthRefName(String shortId, String displaySuffix) {\r
        String refName = "urn:cspace:org.collectionspace.demo:personauthority:name("\r
                        +shortId+")";\r
@@ -395,6 +396,7 @@ public class PersonAuthorityClientUtils {
                refName += "'"+displaySuffix+"'";\r
        return refName;\r
     }\r
+    */\r
 \r
     /**\r
      * Creates the person ref name.\r
@@ -404,6 +406,7 @@ public class PersonAuthorityClientUtils {
      * @param displaySuffix displayName to be appended, if non-null\r
      * @return the string\r
      */\r
+    /*\r
     public static String createPersonRefName(\r
                                                String personAuthRefName, String shortId, String displaySuffix) {\r
        String refName = personAuthRefName+":person:name("+shortId+")";\r
@@ -411,6 +414,7 @@ public class PersonAuthorityClientUtils {
                refName += "'"+displaySuffix+"'";\r
        return refName;\r
     }\r
+    */\r
 \r
     /**\r
      * Extract id.\r
index c6f38395f3ea8ca66c08413ee83f467f86e78e44..662e3018c348572d5533087146a61af65b27fb91 100644 (file)
@@ -123,7 +123,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
     private String knownResourceId = null;
     
     /** The known resource ref name. */
-    private String knownResourceRefName = null;
+    //private String knownResourceRefName = null;
     
     /** The known item resource id. */
     private String knownItemResourceId = null;
@@ -210,7 +210,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
             Assert.fail("Could not create new Authority for search tests.", e);
         }
         try {
-            createItemsInAuthorityForPartialTermMatch(knownResourceId, knownResourceRefName);
+            createItemsInAuthorityForPartialTermMatch(knownResourceId, null ); //knownResourceRefName);
         } catch (Exception e) {
             Assert.fail("Could not create new item in Authority for search tests.", e);
         }
@@ -594,7 +594,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         PersonAuthorityClient client = new PersonAuthorityClient();
         String shortId = createIdentifier();
        String displayName = "displayName-" + shortId;
-       String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
+       //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
        PoxPayloadOut multipart =
             PersonAuthorityClientUtils.createPersonAuthorityInstance(
            displayName, shortId, client.getCommonPartName());
@@ -617,12 +617,12 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
        }
         // Store the refname from the first resource created
         // for additional tests below.
-        knownResourceRefName = baseRefName;
+        //knownResourceRefName = baseRefName;
         // Store the ID returned from the first resource created
         // for additional tests below.
         if (knownResourceId == null){
             knownResourceId = newID;
-            knownResourceRefName = baseRefName;
+            //knownResourceRefName = baseRefName;
         }
 
         // Store the IDs from every resource created by tests,
@@ -666,7 +666,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         styles.add(TEST_KWD_UTF8_STYLE);
         partialTermRepeatablesMap.put(PersonJAXBSchema.SCHOOLS_OR_STYLES, styles);
 
-        createItem(testName, authorityCsid, authRefName, client, 
+        createItem(testName, authorityCsid, null /*authRefName*/, client, 
                 partialTermPersonMap, partialTermRepeatablesMap);
         //
         // Adjust the property map for the QUOTE item
@@ -676,7 +676,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
         partialTermPersonMap.put(PersonJAXBSchema.SUR_NAME, TEST_PARTIAL_TERM_SUR_NAME_QUOTE);
         partialTermPersonMap.put(PersonJAXBSchema.BIO_NOTE, TEST_KWD_BIO_NOTE_DBL_QUOTES);
 
-        createItem(testName, authorityCsid, authRefName, client, 
+        createItem(testName, authorityCsid, null /*authRefName*/, client, 
                 partialTermPersonMap, partialTermRepeatablesMap);
     }
     
@@ -688,7 +688,7 @@ public class PersonAuthoritySearchTest extends BaseServiceTest {
                Map<String, String> partialTermPersonMap,
                Map<String, List<String>> partialTermRepeatablesMap) throws Exception {
         PoxPayloadOut multipart =
-            PersonAuthorityClientUtils.createPersonInstance(authorityCsid, authRefName, 
+            PersonAuthorityClientUtils.createPersonInstance(authorityCsid, null, //authRefName, 
                 partialTermPersonMap, partialTermRepeatablesMap, client.getItemCommonPartName() );
 
         String newID = null;
index e960c858166c4d9a3502ca53ef4d9fc52fc875bd..1ef98d1210428efdc8527b8c06e2105fe8021619 100644 (file)
@@ -59,7 +59,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest {
 //    final String SERVICE_PATH_COMPONENT = "personauthorities";
 //    final String ITEM_SERVICE_PATH_COMPONENT = "items";
     private String authId = null;
-    private String authRefName = null;
+    //private String authRefName = null;
     private List<String> allItemIdsCreated = new ArrayList<String>();
     private String[] firstNames = { 
                "Ann","Anne","Anno",
@@ -155,7 +155,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest {
         PersonAuthorityClient client = new PersonAuthorityClient();
         String shortId = "perfTestPersons";
        String displayName = "Perf Test Person Auth";
-       String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
+       //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
        PoxPayloadOut multipart =
             PersonAuthorityClientUtils.createPersonAuthorityInstance(
            displayName, shortId, client.getCommonPartName());
@@ -176,7 +176,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest {
        }
         // Store the refname from the first resource created
         // for additional tests below.
-       authRefName = baseRefName;
+       //authRefName = baseRefName;
         // Store the ID returned from the first resource created
         // for additional tests below.
        authId = newID;
@@ -211,7 +211,7 @@ public class PersonAuthorityServicePerfTest extends BaseServiceTest {
         personMap.put(PersonJAXBSchema.SUR_NAME, lastName);
         Map<String, List<String>> personRepeatablesMap = new HashMap<String, List<String>>();
         PoxPayloadOut multipart =
-            PersonAuthorityClientUtils.createPersonInstance(authId, authRefName, 
+            PersonAuthorityClientUtils.createPersonInstance(authId, null, //authRefName, 
                        personMap, personRepeatablesMap, client.getItemCommonPartName() );
 
         String newID = null;
index a3ea09e7190a0b69a3bcb5d8fb12b6df13b2c9d3..3802681c07d38a221c5d503cfe0104e8182c47a4 100644 (file)
@@ -98,7 +98,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
     // Hold some values for a recently created item to verify upon read.
     private String knownResourceId = null;
     private String knownResourceShortIdentifer = null;
-    private String knownResourceRefName = null;
+    //private String knownResourceRefName = null;
     private String knownItemResourceId = null;
     private String knownItemResourceShortIdentifer = null;
     // The resource ID of an item resource used for partial term matching tests.
@@ -118,7 +118,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
             String refName) {
         knownResourceId = id;
         knownResourceShortIdentifer = shortIdentifer;
-        knownResourceRefName = refName;
+        //knownResourceRefName = refName;
     }
 
     protected void setKnownItemResource(String id, String shortIdentifer) {
@@ -158,7 +158,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
         PersonAuthorityClient client = new PersonAuthorityClient();
         String shortId = createIdentifier();
         String displayName = "displayName-" + shortId;
-        String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
+        //String baseRefName = PersonAuthorityClientUtils.createPersonAuthRefName(shortId, null);
         PoxPayloadOut multipart =
                 PersonAuthorityClientUtils.createPersonAuthorityInstance(
                 displayName, shortId, client.getCommonPartName());
@@ -187,7 +187,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
         }
         // Save values for additional tests
         if (knownResourceId == null) {
-            setKnownResource(newID, shortId, baseRefName);
+            setKnownResource(newID, shortId, null ); //baseRefName);
             if (logger.isDebugEnabled()) {
                 logger.debug(testName + ": knownResourceId=" + knownResourceId);
             }
@@ -232,7 +232,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
             logger.debug(testBanner(testName, CLASS_NAME));
         }
         setupCreate();
-        String newID = createItemInAuthority(knownResourceId, knownResourceRefName);
+        String newID = createItemInAuthority(knownResourceId, null ); //knownResourceRefName);
     }
 
     /**
@@ -307,7 +307,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
         johnWayneGroups.add("Scottish");
         johnWayneRepeatablesMap.put(PersonJAXBSchema.GROUPS, johnWayneGroups);
 
-        return createItemInAuthority(vcsid, authRefName, shortId, johnWayneMap, johnWayneRepeatablesMap);
+        return createItemInAuthority(vcsid, null /*authRefName*/, shortId, johnWayneMap, johnWayneRepeatablesMap);
 
     }
 
@@ -332,7 +332,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
         PersonAuthorityClient client = new PersonAuthorityClient();
 
         PoxPayloadOut multipart =
-                PersonAuthorityClientUtils.createPersonInstance(vcsid, authRefName, itemFieldProperties,
+                PersonAuthorityClientUtils.createPersonInstance(vcsid, null /*authRefName*/, itemFieldProperties,
                 itemRepeatableFieldProperties, client.getItemCommonPartName());
 
         String newID = null;
@@ -633,7 +633,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
         final Map NULL_REPEATABLE_FIELD_PROPERTIES = null;
         PoxPayloadOut multipart =
                 PersonAuthorityClientUtils.createPersonInstance(knownResourceId,
-                knownResourceRefName, fieldProperties,
+                null /*knownResourceRefName*/, fieldProperties,
                 NULL_REPEATABLE_FIELD_PROPERTIES, client.getItemCommonPartName());
 
         // Send the request and receive a response
@@ -1921,7 +1921,7 @@ public class PersonAuthorityServiceTest extends AbstractServiceTestImpl { //FIXM
         Map<String, List<String>> nonexRepeatablesMap = new HashMap<String, List<String>>();
         PoxPayloadOut multipart =
                 PersonAuthorityClientUtils.createPersonInstance(NON_EXISTENT_ID,
-                PersonAuthorityClientUtils.createPersonAuthRefName(NON_EXISTENT_ID, null),
+                null, //PersonAuthorityClientUtils.createPersonAuthRefName(NON_EXISTENT_ID, null),
                 nonexMap, nonexRepeatablesMap, client.getItemCommonPartName());
         ClientResponse<String> res =
                 client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
index 1a5d8cfb5655ec026bcfd2e34b98ba1ac0eba9c4..4519e9992b28124010fe35f85726d26c49650b99 100644 (file)
@@ -19,7 +19,7 @@ log4j.appender.R.layout=org.apache.log4j.PatternLayout
 log4j.appender.R.layout.ConversionPattern=%d %-5p [%t] [%c:%L] %m%n\r
 \r
 #packages\r
-log4j.logger.org.collectionspace=INFO\r
+log4j.logger.org.collectionspace=DEBUG\r
 log4j.logger.org.apache=INFO\r
 log4j.logger.httpclient=INFO\r
 log4j.logger.org.jboss.resteasy=INFO\r
index 7c3a70686ce5a27ef5046a6463f7eb0f218ff4cb..ecae7445809f41420858b27976fbb3228e83f6a4 100644 (file)
             <artifactId>org.collectionspace.services.jaxb</artifactId>
             <version>${project.version}</version>
         </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <optional>true</optional>
+            <version>${project.version}</version>
+        </dependency>    
     </dependencies>
 
     <build>
index 00ddab8b9dd7d0e9dd5c2ba1d8c459271d77dc70..ee3dee3899b1f15a395e2ea2aecf7219efe05fa8 100644 (file)
     <packaging>pom</packaging>\r
 \r
     <dependencies>\r
+                       <!--\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.authority</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>    \r
+                               -->\r
     </dependencies>\r
 \r
     <modules>\r
index 76e3233dbfbbefd73bc16bf3be1193f7a646ebd0..d2c37e1f11430dde66caf75a7c4e6c30c5da7961 100644 (file)
             <artifactId>org.collectionspace.services.common</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.person.jaxb</artifactId>\r
index e5ceb19bc39afd4d52898374d95eb4caf0716171..65c6744f63d124c268c32821b0a2513c17b3f556 100644 (file)
             <artifactId>org.collectionspace.services.client</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.person.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
+            <optional>true</optional>\r
+            <version>${project.version}</version>\r
+        </dependency>        \r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.common</artifactId>\r
index 26ecb6bf0f8e6fa2183d9392edd24c3e4b418767..8b220a87467801fe33829d7aa99e751f48f96252 100644 (file)
  */
 package org.collectionspace.services.client.test;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 
+import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.client.CollectionSpaceClient;
 import org.collectionspace.services.client.PayloadInputPart;
 import org.collectionspace.services.client.PayloadOutputPart;
+import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.PersonAuthorityClientUtils;
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
 import org.collectionspace.services.client.RelationClient;
@@ -56,7 +63,16 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
 
    /** The logger. */
     private final String CLASS_NAME = RelationServiceTest.class.getName();
+    private final String PERSON_AUTHORITY_NAME = "TestPersonAuth";
     private final Logger logger = LoggerFactory.getLogger(CLASS_NAME);
+    private List<String> personIdsCreated = new ArrayList<String>();
+    private String samSubjectPersonCSID = null;
+    private String oliveObjectPersonCSID = null;
+    private String samSubjectRefName = null;
+    private String oliveObjectRefName = null;
+    private String personAuthCSID = null;
+    private String personShortId = PERSON_AUTHORITY_NAME;
+    
 
     /** The SERVICE path component. */
     final String SERVICE_PATH_COMPONENT = "relations";
@@ -99,6 +115,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         // (e.g. CREATE, DELETE), its valid and expected status codes, and
         // its associated HTTP method name (e.g. POST, DELETE).
         setupCreate();
+        createPersonRefs();
 
         // Submit the request to the service and store the response.
         RelationClient client = new RelationClient();
@@ -132,6 +149,58 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
         // so they can be deleted after tests have been run.
         allResourceIdsCreated.add(extractId(res));
     }
+    
+    /**
+     * Creates the person refs.
+     */
+    protected void createPersonRefs() {
+        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        PoxPayloadOut multipart = PersonAuthorityClientUtils.createPersonAuthorityInstance(
+                PERSON_AUTHORITY_NAME, PERSON_AUTHORITY_NAME, personAuthClient.getCommonPartName());
+        ClientResponse<Response> res = personAuthClient.create(multipart);
+        int statusCode = res.getStatus();
+
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, STATUS_CREATED);
+        personAuthCSID = extractId(res);
+
+        String authRefName = PersonAuthorityClientUtils.getAuthorityRefName(personAuthCSID, null);
+
+        String csid = createPerson("Sam", "Subject", "samSubject", authRefName);
+        Assert.assertNotNull(csid);
+        samSubjectPersonCSID = csid;
+        samSubjectRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
+        Assert.assertNotNull(samSubjectRefName);
+        personIdsCreated.add(csid);
+
+        csid = createPerson("Olive", "Object", "oliveObject", authRefName);
+        Assert.assertNotNull(csid);
+        oliveObjectRefName = PersonAuthorityClientUtils.getPersonRefName(personAuthCSID, csid, null);
+        oliveObjectPersonCSID = csid;
+        Assert.assertNotNull(oliveObjectRefName);
+        personIdsCreated.add(csid);
+    }
+
+    protected String createPerson(String firstName, String surName, String shortId, String authRefName) {
+        PersonAuthorityClient personAuthClient = new PersonAuthorityClient();
+        Map<String, String> personInfo = new HashMap<String, String>();
+        personInfo.put(PersonJAXBSchema.FORE_NAME, firstName);
+        personInfo.put(PersonJAXBSchema.SUR_NAME, surName);
+        personInfo.put(PersonJAXBSchema.SHORT_IDENTIFIER, shortId);
+        PoxPayloadOut multipart =
+                PersonAuthorityClientUtils.createPersonInstance(personAuthCSID,
+                authRefName, personInfo, personAuthClient.getItemCommonPartName());
+        ClientResponse<Response> res = personAuthClient.createItem(personAuthCSID, multipart);
+        int statusCode = res.getStatus();
+
+        Assert.assertTrue(REQUEST_TYPE.isValidStatusCode(statusCode),
+                invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
+        Assert.assertEquals(statusCode, STATUS_CREATED);
+        return extractId(res);
+    }
+
+    
 
     /* (non-Javadoc)
      * @see org.collectionspace.services.client.test.AbstractServiceTestImpl#createList(java.lang.String)
@@ -857,10 +926,7 @@ public class RelationServiceTest extends AbstractServiceTestImpl {
      * @param identifier the identifier
      */
     private void fillRelation(RelationsCommon relationCommon, String identifier) {
-        fillRelation(relationCommon, "Subject-" + identifier,
-                "SubjectType-" + identifier + "-type",
-                "Object-" + identifier,
-                "ObjectType-" + identifier + "-type",
+        fillRelation(relationCommon, samSubjectPersonCSID, null, oliveObjectPersonCSID, null,
                 RelationshipType.COLLECTIONOBJECT_INTAKE.toString(),
                 RelationshipType.COLLECTIONOBJECT_INTAKE + ".displayName");
     }
index e271c8040ac426732d49dcf897f1085aa763dc4f..651c4395231aaf00810d8ffbffbc0b49532d904b 100644 (file)
             <version>5.6</version>\r
         </dependency>\r
         \r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.person.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.organization.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.location.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.taxonomy.client</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
 \r
       <!-- javax -->\r
 \r
index 0e988e172b4e82083125dcd6a47b713f915c1167..5aceb9a87a82ec9f3022dd5cd7ada0b19cfb16a2 100644 (file)
  */
 package org.collectionspace.services.relation.nuxeo;
 
+import java.util.HashMap;
 import java.util.Iterator;
 
 import org.collectionspace.services.client.PoxPayloadIn;
 import org.collectionspace.services.client.PoxPayloadOut;
+import org.collectionspace.services.common.ResourceBase;
+import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.ServiceMain;
+import org.collectionspace.services.common.api.RefName;
 import org.collectionspace.services.common.api.Tools;
 import org.collectionspace.services.common.config.TenantBindingConfigReaderImpl;
 import org.collectionspace.services.common.context.ServiceBindingUtils;
+import org.collectionspace.services.common.document.DocumentNotFoundException;
 import org.collectionspace.services.common.document.InvalidDocumentException;
 import org.collectionspace.services.common.relation.RelationJAXBSchema;
 import org.collectionspace.services.common.relation.nuxeo.RelationConstants;
@@ -43,10 +48,17 @@ import org.collectionspace.services.relation.RelationsCommon;
 import org.collectionspace.services.relation.RelationsCommonList;
 import org.collectionspace.services.relation.RelationsCommonList.RelationListItem;
 
+// HACK HACK HACK
+import org.collectionspace.services.client.PersonAuthorityClient;
+import org.collectionspace.services.client.OrgAuthorityClient;
+import org.collectionspace.services.client.LocationAuthorityClient;
+import org.collectionspace.services.client.TaxonomyAuthorityClient;
+
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 import org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl;
 import org.collectionspace.services.relation.RelationsDocListItem;
+import org.nuxeo.ecm.core.api.ClientException;
 import org.nuxeo.ecm.core.api.DocumentModel;
 import org.nuxeo.ecm.core.api.DocumentModelList;
 import org.nuxeo.ecm.core.api.model.PropertyException;
@@ -77,28 +89,26 @@ public class RelationDocumentModelHandler
 
     @Override
     public void handleCreate(DocumentWrapper<DocumentModel> wrapDoc) throws Exception {
+       // Merge in the data from the payload
+        super.handleCreate(wrapDoc);
 
-        // Obtain document models for the subject and object of the relation.
+        // Obtain document models for the subject and object of the relation, so that
+        // we ensure we have value docType, URI info. If the docModels support refNames, 
+        // we will also set those.
+        // Note that this introduces another caching problem... 
         DocumentModel relationDocModel = wrapDoc.getWrappedObject();
         ServiceContext ctx = getServiceContext();
-        DocumentModel subjectDocModel = getSubjectDocModel(relationDocModel, ctx);
-        DocumentModel objectDocModel = getObjectDocModel(relationDocModel, ctx);
+        DocumentModel subjectDocModel = getSubjectOrObjectDocModel(relationDocModel, ctx, SUBJ_DOC_MODEL);
+        DocumentModel objectDocModel = getSubjectOrObjectDocModel(relationDocModel, ctx, OBJ_DOC_MODEL);
 
         // Use values from the subject and object document models to populate the
         // relevant fields of the relation's own document model.
         if (subjectDocModel != null) {
-            relationDocModel = populateSubjectValues(relationDocModel, subjectDocModel);
+            populateSubjectOrObjectValues(relationDocModel, subjectDocModel, ctx, SUBJ_DOC_MODEL);
         }
         if (objectDocModel != null) {
-            relationDocModel = populateObjectValues(relationDocModel, objectDocModel);
+            populateSubjectOrObjectValues(relationDocModel, objectDocModel, ctx, OBJ_DOC_MODEL);
         }
-
-        // FIXME: Verify the following:
-        // Do we call this method here, only after we've updated the relationDocModel?
-        // Has the wrapDoc instance itself been updated, in the process of updating the relationDocModel,
-        // or do we need to pass the updated relationDocModel back into that instance?
-        super.handleCreate(wrapDoc);
-
     }
 
     @Override
@@ -199,6 +209,8 @@ public class RelationDocumentModelHandler
 
         String subjectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.SUBJECT_URI);
         subject.setUri(subjectUri);
+        String subjectRefName = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.SUBJECT_REFNAME);
+        subject.setRefName(subjectRefName);
         relationListItem.setSubject(subject);
 
         String objectCsid = relationListItem.getObjectCsid();
@@ -207,6 +219,8 @@ public class RelationDocumentModelHandler
 
         String objectUri = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.OBJECT_URI);
         object.setUri(objectUri);
+        String objectRefName = (String) docModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.OBJECT_REFNAME);
+        object.setRefName(objectRefName);
         relationListItem.setObject(object);
 
         return relationListItem;
@@ -293,62 +307,25 @@ public class RelationDocumentModelHandler
         return "/" + RelationConstants.NUXEO_SCHEMA_ROOT_ELEMENT + "/" + prop;
     }
 
-    /**
-     * Obtains the subject resource and uses its values to populate
-     * subject-related fields in the relation resource.
-     */
-    private DocumentModel getSubjectDocModel(DocumentModel relationDocModel, ServiceContext ctx) throws Exception {
-        // Get the document model for the subject of the relation.
-        DocumentModel subjectDocModel = null;
-        String subjectCsid = "";
-        String subjectRefName = "";
-        // FIXME: Currently assumes that the object CSID is valid if present
-        // in the incoming payload.
-        try {
-            subjectCsid = (String) relationDocModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.SUBJECT_CSID);
-            // FIXME: Remove this entire 'if' statement when legacy fields are removed from the Relation record:
-            if (Tools.isBlank(subjectCsid)) {
-                subjectCsid = (String) relationDocModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_ID_1);
-            }
-        } catch (PropertyException pe) {
-            // Per CSPACE-4468, ignore any property exception here.
-            // (See parallel comment below in getObjectDocModel.)
-        }
-        if (Tools.notBlank(subjectCsid)) {
-            // FIXME: Call a utility routine here that uses the CSID to retrieve the subject record's docModel.
-            // The following is a placeholder:
-            subjectDocModel = getDocModelFromCsid(subjectCsid);
-        }
-        if (Tools.isBlank(subjectCsid)) {
-            try {
-                subjectRefName = (String) relationDocModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.SUBJECT_REFNAME);
-                // FIXME: Call a utility routine here - for which the method below is currently a
-                // placeholder - that uses the refName to retrieve the subject record's docModel.
-                subjectDocModel = getDocModelFromRefname(subjectRefName);
-            } catch (Exception e) {
-                throw new InvalidDocumentException(
-                        "Relation record must contain a CSID or refName to identify the subject of the relation.", e);
-            }
-        }
-        return subjectDocModel;
-    }
-
-    /**
-     * Obtains the object resource and uses its values to populate
-     * object-related fields in the relation resource.
-     */
-    private DocumentModel getObjectDocModel(DocumentModel relationDocModel, ServiceContext ctx) throws Exception {
+    private final boolean SUBJ_DOC_MODEL = true;
+    private final boolean OBJ_DOC_MODEL = false;
+    
+    private DocumentModel getSubjectOrObjectDocModel(
+               DocumentModel relationDocModel, ServiceContext ctx, boolean fSubject) throws Exception {
         // Get the document model for the object of the relation.
-        String objectCsid = "";
-        String objectRefName = "";
-        DocumentModel objectDocModel = null;
+       String commonPartLabel = ctx.getCommonPartLabel();
+        String csid = "";
+        String refName = "";
+        DocumentModel docModel = null;
         // FIXME: Currently assumes that the object CSID is valid if present
         // in the incoming payload.
         try {
-            objectCsid = (String) relationDocModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.OBJECT_CSID);
+            csid = (String) relationDocModel.getProperty(commonPartLabel, 
+                       (fSubject?RelationJAXBSchema.SUBJECT_CSID:RelationJAXBSchema.OBJECT_CSID));
             // FIXME: Remove this entire 'if' statement when legacy fields are removed from the Relation record:
-            if (Tools.isBlank(objectCsid)) {
-                objectCsid = (String) relationDocModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.DOCUMENT_ID_2);
+            if (Tools.isBlank(csid)) {
+                csid = (String) relationDocModel.getProperty(commonPartLabel, 
+                                       (fSubject?RelationJAXBSchema.DOCUMENT_ID_1:RelationJAXBSchema.DOCUMENT_ID_2));
             }
         } catch (PropertyException pe) {
             // Per CSPACE-4468, ignore any property exception here.
@@ -356,40 +333,88 @@ public class RelationDocumentModelHandler
             // can now be null (missing), because a refName value can be
             // provided as an alternate identifier.
         }
-        if (Tools.isBlank(objectCsid)) {
+        if (Tools.notBlank(csid)) {
+            DocumentWrapper<DocumentModel> docWrapper = getRepositoryClient(ctx).getDocFromCsid(ctx, csid);
+            docModel = docWrapper.getWrappedObject();
+        } else { //  if (Tools.isBlank(objectCsid)) {
             try {
-                objectRefName = (String) relationDocModel.getProperty(ctx.getCommonPartLabel(), RelationJAXBSchema.OBJECT_REFNAME);
-                // FIXME: Call a utility routine here - for which the method below is currently a
-                // placeholder - that uses the refName to retrieve the object record's docModel.
-                objectDocModel = getDocModelFromRefname(objectRefName);
+               refName = (String) relationDocModel.getProperty(commonPartLabel, 
+                               (fSubject?RelationJAXBSchema.SUBJECT_REFNAME:RelationJAXBSchema.OBJECT_REFNAME));
+               docModel = ResourceBase.getDocModelForRefName(refName, ctx.getResourceMap());
             } catch (Exception e) {
                 throw new InvalidDocumentException(
                         "Relation record must have a CSID or refName to identify the object of the relation.", e);
             }
         }
-        return objectDocModel;
+        if(docModel==null) {
+               throw new DocumentNotFoundException("Relation.getSubjectOrObjectDocModel could not find doc with CSID: "
+                                       +csid+" and/or refName: "+refName );
+        }
+        return docModel;
     }
-
-    // CSPACE-4468 placeholder methods:
     
-    // FIXME: Placeholder method.
-    private DocumentModel getDocModelFromCsid(String csid) {
-        return null;
-    }
+    private void populateSubjectOrObjectValues(
+               DocumentModel relationDocModel, 
+               DocumentModel subjectOrObjectDocModel,
+               ServiceContext ctx,
+               boolean fSubject ) {
+        HashMap<String,Object> properties = new HashMap<String,Object>();
 
-    // FIXME: Placeholder method.
-    // Patrick is providing a working replacement for this method, in a framework class.
-    private DocumentModel getDocModelFromRefname(String csid) {
-        return null;
-    }
+        try {
+               String doctype = (String) subjectOrObjectDocModel.getType();
+               properties.put((fSubject?RelationJAXBSchema.SUBJECT_DOCTYPE:RelationJAXBSchema.OBJECT_DOCTYPE),
+                                                       doctype);
+               // FIXME: Remove the line below when legacy fields are removed from the Relation record:
+               properties.put((fSubject?RelationJAXBSchema.DOCUMENT_TYPE_1:RelationJAXBSchema.DOCUMENT_TYPE_2), 
+                                                       doctype);
+       
+               String csid = (String) subjectOrObjectDocModel.getName();
+               properties.put((fSubject?RelationJAXBSchema.SUBJECT_CSID:RelationJAXBSchema.OBJECT_CSID),
+                                                       csid);
+               // FIXME: Remove the two lines immediately below when legacy fields are removed from the Relation record:
+               properties.put((fSubject?RelationJAXBSchema.DOCUMENT_ID_1:RelationJAXBSchema.DOCUMENT_ID_2),
+                                                       csid);
+       
+               String uri = (String) subjectOrObjectDocModel.getProperty(COLLECTIONSPACE_CORE_SCHEMA,
+                                                                                                                                       COLLECTIONSPACE_CORE_URI);
+               properties.put((fSubject?RelationJAXBSchema.SUBJECT_URI:RelationJAXBSchema.OBJECT_URI),
+                                                       uri);
+               
+               String common_schema = getCommonSchemaNameForDocType(doctype);
+               
+               if(common_schema!=null) {
+                       String refname = (String)subjectOrObjectDocModel.getProperty(common_schema, 
+                                                                                                                       RefName.REFNAME );
+                   properties.put((fSubject?RelationJAXBSchema.SUBJECT_REFNAME:RelationJAXBSchema.OBJECT_REFNAME),
+                               refname);
+               }
+        } catch (ClientException ce) {
+            throw new RuntimeException(
+                    "populateSubjectOrObjectValues: Problem fetching field " + ce.getLocalizedMessage());
+        }
 
-    // FIXME: Placeholder method.
-    private DocumentModel populateSubjectValues(DocumentModel relationDocModel, DocumentModel objectDocModel) {
-        throw new UnsupportedOperationException("Not yet implemented");
+        // FIXME: Call below is based solely on Nuxeo API docs; have not yet verified that it correctly updates existing
+        // property values in the target document model.
+        try {
+               relationDocModel.setProperties(ctx.getCommonPartLabel(), properties);
+        } catch (ClientException ce) {
+            throw new RuntimeException(
+                    "populateSubjectValues: Problem setting fields " + ce.getLocalizedMessage());
+        }
     }
-
-    // FIXME: Placeholder method.
-    private DocumentModel populateObjectValues(DocumentModel relationDocModel, DocumentModel objectDocModel) {
-        throw new UnsupportedOperationException("Not yet implemented");
+    
+    private String getCommonSchemaNameForDocType(String docType) {
+       String common_schema = null;
+       if("Person".equals(docType))
+               common_schema = PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+       else if("Organization".equals(docType))
+               common_schema = OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+       else if("Locationitem".equals(docType))
+               common_schema = LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+       else if("Taxon".equals(docType))
+               common_schema = TaxonomyAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+       //else leave it null.
+       return common_schema;
     }
+
 }
index f41265c6b3ac3e926ab8fed1f35415dd2923407b..ab8702d248e4b82ebc83dacb1e8dd5ce0e9abda4 100644 (file)
@@ -16,7 +16,7 @@
     <dependencies>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
-            <artifactId>org.collectionspace.services.authority</artifactId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>        \r
index cc9601b5a715aad34986697d0464f05062027596..771993f9c2fff7d78f64fdb465b1b552f679c5bb 100644 (file)
             <artifactId>org.collectionspace.services.taxonomy.jaxb</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.client</artifactId>
index adaa1a42c25f852df1eb0a896fd0845a3fe183a8..9072d075107377310d7faa1f04b372296acf450e 100644 (file)
             <artifactId>org.collectionspace.services.jaxb</artifactId>
             <version>${project.version}</version>
         </dependency>        
+        <dependency>
+            <groupId>org.collectionspace.services</groupId>
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>
+            <version>${project.version}</version>
+        </dependency>        
     </dependencies>
 
     <build>
index 0b692e58c365d8a9621f7558e473bff2ce465f5a..2885bccc5d74781f8039817fb930fadb184f1f75 100644 (file)
     <packaging>pom</packaging>
 
     <dependencies>
+                       <!--
         <dependency>
             <groupId>org.collectionspace.services</groupId>
             <artifactId>org.collectionspace.services.authority</artifactId>
             <optional>true</optional>
             <version>${project.version}</version>
         </dependency>    
+                               -->
     </dependencies>
 
     <modules>
index b9f5727da159407f56775335c39a05e5297b4a7f..cd7cfd6f0272642271d906c331fad0b6a8a8181d 100644 (file)
@@ -39,7 +39,7 @@
         </dependency>
         <dependency>
             <groupId>org.collectionspace.services</groupId>
-            <artifactId>org.collectionspace.services.contact.service</artifactId>
+            <artifactId>org.collectionspace.services.authority.service</artifactId>
             <version>${project.version}</version>
         </dependency>
         <!-- External dependencies -->        
index f1e46c184b1530d328f54cc86c33ad63ebfe819b..cc5dca721ce5534d1eebfe4fd93c190073dbbc1c 100644 (file)
             <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.jaxb</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.client</artifactId>\r
index 38b8efe1dab37ab5f296cf8b3afa33a57b8e357e..5e62c178cd94d5e9277d2da3bc315b3c8269e35e 100644 (file)
@@ -26,8 +26,8 @@ public class VocabularyClientUtils {
         VocabulariesCommon vocabulary = new VocabulariesCommon();\r
         vocabulary.setDisplayName(displayName);\r
         vocabulary.setShortIdentifier(shortIdentifier);\r
-        String refName = createVocabularyRefName(shortIdentifier, displayName);\r
-        vocabulary.setRefName(refName);\r
+        //String refName = createVocabularyRefName(shortIdentifier, displayName);\r
+        //vocabulary.setRefName(refName);\r
         vocabulary.setVocabType("enum");\r
         PoxPayloadOut multipart = new PoxPayloadOut(VocabularyClient.SERVICE_PAYLOAD_NAME);\r
         PayloadOutputPart commonPart = multipart.addPart(vocabulary, MediaType.APPLICATION_XML_TYPE);\r
@@ -50,8 +50,8 @@ public class VocabularyClientUtils {
        String displayName = vocabItemInfo.get(AuthorityItemJAXBSchema.DISPLAY_NAME);\r
                vocabularyItem.setShortIdentifier(shortId);\r
                vocabularyItem.setDisplayName(displayName);\r
-       String refName = createVocabularyItemRefName(vocabularyRefName, shortId, displayName);\r
-               vocabularyItem.setRefName(refName);\r
+       //String refName = createVocabularyItemRefName(vocabularyRefName, shortId, displayName);\r
+               //vocabularyItem.setRefName(refName);\r
                PoxPayloadOut multipart = new PoxPayloadOut(VocabularyClient.SERVICE_ITEM_PAYLOAD_NAME);\r
         PayloadOutputPart commonPart = multipart.addPart(vocabularyItem,\r
             MediaType.APPLICATION_XML_TYPE);\r
@@ -76,7 +76,7 @@ public class VocabularyClientUtils {
                logger.debug("Import: Create Item: \""+itemMap.get(AuthorityItemJAXBSchema.SHORT_IDENTIFIER)\r
                                +"\" in personAuthority: \"" + vcsid +"\"");\r
        }\r
-       PoxPayloadOut multipart = createVocabularyItemInstance(vocabularyRefName,\r
+       PoxPayloadOut multipart = createVocabularyItemInstance(null, //vocabularyRefName,\r
                                itemMap, client.getCommonPartItemName());\r
        ClientResponse<Response> res = client.createItem(vcsid, multipart);\r
 \r
@@ -84,12 +84,12 @@ public class VocabularyClientUtils {
 \r
        if(!REQUEST_TYPE.isValidStatusCode(statusCode)) {\r
                throw new RuntimeException("Could not create Item: \"" + itemMap.get(AuthorityItemJAXBSchema.DISPLAY_NAME)\r
-                               + "\" in personAuthority: \"" + vocabularyRefName\r
+                               + "\" in personAuthority: \"" + vcsid //vocabularyRefName\r
                                + "\" " + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));\r
        }\r
        if(statusCode != EXPECTED_STATUS_CODE) {\r
                throw new RuntimeException("Unexpected Status when creating Item: \""+itemMap.get(AuthorityItemJAXBSchema.DISPLAY_NAME)\r
-                               + "\" in personAuthority: \"" + vocabularyRefName + "\", Status:" + statusCode);\r
+                               + "\" in personAuthority: \"" + vcsid /*vocabularyRefName*/ + "\", Status:" + statusCode);\r
        }\r
 \r
        return extractId(res);\r
@@ -126,6 +126,7 @@ public class VocabularyClientUtils {
         return id;\r
     }\r
     \r
+    /*\r
     public static String createVocabularyRefName(String shortIdentifier, String displaySuffix) {\r
        String refName = "urn:cspace:org.collectionspace.demo:vocabulary:name("\r
                        + shortIdentifier + ")";\r
@@ -141,5 +142,6 @@ public class VocabularyClientUtils {
                refName += "'" + displaySuffix + "'";\r
        return refName;\r
     }\r
+    */\r
 \r
 }\r
index fb103e585acedabd9468fd0c8231a1c560ac3ca4..79819f5be1860bf986c8f6f731da14c89ed8f8de 100644 (file)
@@ -66,8 +66,8 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
     final String SERVICE_ITEM_PAYLOAD_NAME = VocabularyClient.SERVICE_ITEM_PAYLOAD_NAME;
     private String knownResourceId = null;
     private String knownResourceShortIdentifer = null;
-    private String knownResourceRefName = null;
-    private String knownResourceFullRefName = null;
+    //private String knownResourceRefName = null;
+    //private String knownResourceFullRefName = null;
     private String knownItemResourceId = null;
     private int nItemsToCreateInList = 5;
 //    private List<String> allResourceIdsCreated = new ArrayList<String>();
@@ -78,8 +78,8 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
             String refName, String fullRefName) {
         knownResourceId = id;
         knownResourceShortIdentifer = shortIdentifer;
-        knownResourceRefName = refName;
-        knownResourceFullRefName = fullRefName;
+        //knownResourceRefName = refName;
+        //knownResourceFullRefName = fullRefName;
     }
 
     /* (non-Javadoc)
@@ -140,9 +140,9 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         // Store the ID returned from the first resource created
         // for additional tests below.
         if (knownResourceId == null) {
-            setKnownResource(extractId(res), identifier,
-                    VocabularyClientUtils.createVocabularyRefName(identifier, null),
-                    VocabularyClientUtils.createVocabularyRefName(identifier, displayName));
+            setKnownResource(extractId(res), identifier, null, null );
+                    //VocabularyClientUtils.createVocabularyRefName(identifier, null),
+                    //VocabularyClientUtils.createVocabularyRefName(identifier, displayName));
             if (logger.isDebugEnabled()) {
                 logger.debug(testName + ": knownResourceId=" + knownResourceId);
             }
@@ -180,7 +180,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         itemInfo.put(AuthorityItemJAXBSchema.SHORT_IDENTIFIER, shortId);
         itemInfo.put(AuthorityItemJAXBSchema.DISPLAY_NAME, "display-" + shortId);
         String newID = VocabularyClientUtils.createItemInVocabulary(knownResourceId,
-                knownResourceRefName, itemInfo, client);
+                null /*knownResourceRefName*/, itemInfo, client);
 
         // Store the ID returned from the first item resource created
         // for additional tests below.
@@ -272,7 +272,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         itemInfo.put(AuthorityItemJAXBSchema.SHORT_IDENTIFIER, "Bad Item Short Id!");
         itemInfo.put(AuthorityItemJAXBSchema.DISPLAY_NAME, "Bad Item!");
         PoxPayloadOut multipart =
-                VocabularyClientUtils.createVocabularyItemInstance(knownResourceRefName,
+                VocabularyClientUtils.createVocabularyItemInstance(null, //knownResourceRefName,
                 itemInfo, client.getCommonPartItemName());
         ClientResponse<Response> res = client.createItem(knownResourceId, multipart);
 
@@ -280,12 +280,12 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
 
         if (!REQUEST_TYPE.isValidStatusCode(statusCode)) {
             throw new RuntimeException("Could not create Item: \"" + itemInfo.get(AuthorityItemJAXBSchema.DISPLAY_NAME)
-                    + "\" in personAuthority: \"" + knownResourceRefName
+                    + "\" in personAuthority: \"" + knownResourceId //knownResourceRefName
                     + "\" " + invalidStatusCodeMessage(REQUEST_TYPE, statusCode));
         }
         if (statusCode != EXPECTED_STATUS_CODE) {
             throw new RuntimeException("Unexpected Status when creating Item: \"" + itemInfo.get(AuthorityItemJAXBSchema.DISPLAY_NAME)
-                    + "\" in personAuthority: \"" + knownResourceRefName + "\", Status:" + statusCode);
+                    + "\" in personAuthority: \"" + knownResourceId /*knownResourceRefName*/ + "\", Status:" + statusCode);
         }
     }
 
@@ -410,7 +410,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
                 client.getCommonPartName(), VocabulariesCommon.class);
 
         Assert.assertNotNull(vocabulary);
-        Assert.assertEquals(vocabulary.getRefName(), knownResourceFullRefName);
+        //Assert.assertEquals(vocabulary.getRefName(), knownResourceFullRefName);
     }
 
     /**
@@ -1079,7 +1079,7 @@ public class VocabularyServiceTest extends AbstractServiceTestImpl {
         itemInfo.put(AuthorityItemJAXBSchema.DISPLAY_NAME, "display-nonex");
         PoxPayloadOut multipart =
                 VocabularyClientUtils.createVocabularyItemInstance(
-                VocabularyClientUtils.createVocabularyRefName(NON_EXISTENT_ID, null),
+                null, //VocabularyClientUtils.createVocabularyRefName(NON_EXISTENT_ID, null),
                 itemInfo, client.getCommonPartItemName());
         ClientResponse<String> res =
                 client.updateItem(knownResourceId, NON_EXISTENT_ID, multipart);
index 3b79d7d625d3c6b86e9766a7f6cf988ded2feac0..642852793bdf2304a8fd5c82d6ae247ef651745a 100644 (file)
     <packaging>pom</packaging>\r
 \r
     <dependencies>\r
+                       <!--\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.authority</artifactId>\r
             <optional>true</optional>\r
             <version>${project.version}</version>\r
         </dependency>    \r
+                               -->\r
     </dependencies>\r
 \r
     <modules>\r
index 745f6c3bf2477e77a527c66e7ea6efca876754d4..9940c99b700c4c54da86f825f292b23c274d69e2 100644 (file)
             <artifactId>org.collectionspace.services.common</artifactId>\r
             <version>${project.version}</version>\r
         </dependency>\r
+        <dependency>\r
+            <groupId>org.collectionspace.services</groupId>\r
+            <artifactId>org.collectionspace.services.authority.service</artifactId>\r
+            <version>${project.version}</version>\r
+        </dependency>\r
         <dependency>\r
             <groupId>org.collectionspace.services</groupId>\r
             <artifactId>org.collectionspace.services.vocabulary.jaxb</artifactId>\r
index ea93390e663a92fb98b604eaaa48df226b449fc0..b0ec10880e9250db30adff9140727868020b27ca 100644 (file)
@@ -25,6 +25,7 @@ package org.collectionspace.services.workflow;
 
 import org.collectionspace.services.client.workflow.WorkflowClient;
 import org.collectionspace.services.common.ResourceBase;
+import org.collectionspace.services.common.ResourceMap;
 import org.collectionspace.services.common.ServiceMessages;
 import org.collectionspace.services.jaxb.AbstractCommonList;
 
@@ -72,7 +73,7 @@ public class WorkflowResource extends ResourceBase {
     
        @Override
        @POST
-       public Response create(@Context UriInfo ui, String xmlPayload) {
+       public Response create(@Context ResourceMap resourceMap, @Context UriInfo ui, String xmlPayload) {
                Response response = Response.status(Response.Status.BAD_REQUEST)
                                .entity(ServiceMessages.POST_UNSUPPORTED).type("text/plain").build();
                return response;