]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3932 (on branch 3899 because of 1.7 code freeze). Made all current AuthorityI...
authorLaramie Crocker <laramie@berkeley.edu>
Thu, 12 May 2011 05:08:26 +0000 (05:08 +0000)
committerLaramie Crocker <laramie@berkeley.edu>
Thu, 12 May 2011 05:08:26 +0000 (05:08 +0000)
services/IntegrationTests/src/test/resources/test-data/xmlreplay/person/person.xml
services/authority/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java
services/location/service/src/main/java/org/collectionspace/services/location/nuxeo/LocationDocumentModelHandler.java
services/organization/service/src/main/java/org/collectionspace/services/organization/OrgAuthorityResource.java
services/organization/service/src/main/java/org/collectionspace/services/organization/nuxeo/OrganizationDocumentModelHandler.java
services/person/service/src/main/java/org/collectionspace/services/person/nuxeo/PersonDocumentModelHandler.java
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java
services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonDocumentModelHandler.java
services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java

index b13b339cddcd29da8a963e8c31b3093e044b4a4e..840bbc84ebf0014c9b0cb4bb84d2047c2c4a151a 100755 (executable)
        \r
        !-- ========================= POST a person ===================================================== -->\r
        \r
-       <testGroup ID="postPerson" autoDeletePOSTS="false">\r
+       <testGroup ID="postPerson" autoDeletePOSTS="true">\r
            <test ID="PersonAuth1" auth="admin@collectionspace.org">\r
             <method>POST</method>\r
             <uri>/cspace-services/personauthorities/</uri>\r
index 8bbfd41cfd8690b335c9e29bf74d96f64b1043fd..1af842ea5b85ab81693c7398cec4872437f63943 100644 (file)
@@ -105,31 +105,18 @@ public abstract class AuthorityItemDocumentModelHandler<AICommon, AICommonList>
                this.inAuthority = inAuthority;
        }
 
-   // Laramie20110510 CSPACE-3932
-   public static final String HACK_VOCABULARIES = "vocabularies"; //TODO: get rid of these.
-    //public static final String HACK_ORGANIZATIONS = "Organizations"; //TODO: get rid of these.
-    public static final String HACK_ORGAUTHORITIES = "orgauthorities";  //TODO: get rid of these.
-    public static final String HACK_PERSONAUTHORITIES = "personauthorities";  //TODO: get rid of these.
-    public static final String HACK_LOCATIONAUTHORITIES = "locationauthorities";  //TODO: get rid of these.
-    private final static Map<String,String> hackMap = new HashMap<String,String>();
-    static {
-        hackMap.put("persons", HACK_PERSONAUTHORITIES);
-        hackMap.put("organizations", HACK_ORGAUTHORITIES);
-        hackMap.put("vocabularies", HACK_VOCABULARIES);
-        hackMap.put("locations", HACK_LOCATIONAUTHORITIES);
+    /** Subclasses may override this to customize the URI segment. */
+    public String getAuthorityServicePath(){
+        return getServiceContext().getServiceName().toLowerCase();    // Laramie20110510 CSPACE-3932
     }
+
     @Override
     public String getUri(DocumentModel docModel) {
         // Laramie20110510 CSPACE-3932
-        String serviceContextName = getServiceContext().getServiceName().toLowerCase();
-        String displayContextPath = hackMap.get(serviceContextName);
-        if (Tools.isEmpty(displayContextPath)){
-            displayContextPath = serviceContextName;
-        }
-        return "/"+displayContextPath+'/'+inAuthority+'/'+ AuthorityClient.ITEMS+'/'+getCsid(docModel);
+        String authorityServicePath = getAuthorityServicePath();
+        return "/"+authorityServicePath+'/'+inAuthority+'/'+ AuthorityClient.ITEMS+'/'+getCsid(docModel);
     }
 
-
     public String getAuthorityRefNameBase(){
         return this.authorityRefNameBase;
     }
index d8d00d943c2135b96ef70d3dbe9fc54fdb135a4b..93f7634ae15284df6ea328db483e169f215e7b1f 100644 (file)
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.collectionspace.services.LocationJAXBSchema;
+import org.collectionspace.services.client.LocationAuthorityClient;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.service.ObjectPartType;
@@ -69,6 +70,11 @@ public class LocationDocumentModelHandler
     public LocationDocumentModelHandler() {
        super(COMMON_PART_LABEL);
     }
+
+    @Override
+    public String getAuthorityServicePath(){
+        return LocationAuthorityClient.SERVICE_PATH_COMPONENT;    //  CSPACE-3932
+    }
        
     /* (non-Javadoc)
      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
index a417bf36923b017ee188b5c2250b080076dcec06..766a6ae102a55a43bba1225a43eeea78ac9644bf 100644 (file)
@@ -43,7 +43,7 @@ public class OrgAuthorityResource extends
        AuthorityResourceWithContacts<OrgauthoritiesCommon, OrgauthoritiesCommonList, OrganizationsCommon,
        OrganizationDocumentModelHandler> {
 
-    private final static String orgAuthorityServiceName = "orgauthorities";
+    private final static String orgAuthorityServiceName = OrgAuthorityClient.SERVICE_NAME;
        private final static String ORGAUTHORITIES_COMMON = "orgauthorities_common";
     
     private final static String organizationServiceName = "organizations";
index 6ee9045ede082a3a40baeae633f9e5d8c5aeb8d9..fa42403fb28249c9954866a73f5c40715b70a710 100644 (file)
@@ -27,6 +27,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.collectionspace.services.client.OrgAuthorityClient;
 import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
 import org.collectionspace.services.OrganizationJAXBSchema;
 import org.collectionspace.services.common.document.DocumentWrapper;
@@ -60,6 +61,11 @@ public class OrganizationDocumentModelHandler
     public OrganizationDocumentModelHandler() {
        super(COMMON_PART_LABEL);
     }
+
+    @Override
+    public String getAuthorityServicePath(){
+        return OrgAuthorityClient.SERVICE_PATH_COMPONENT;    //  CSPACE-3932
+    }
        
     /* (non-Javadoc)
      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
index d03e5e9c6bb4ff2c03711ae3d09753dcf5f48071..f29ee16180d1807989ad989274abf22ff6f739be 100644 (file)
@@ -28,6 +28,7 @@ import java.util.Arrays;
 import java.util.List;
 import java.util.Map;
 
+import org.collectionspace.services.client.PersonAuthorityClient;
 import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
 import org.collectionspace.services.PersonJAXBSchema;
 import org.collectionspace.services.common.document.DocumentWrapper;
@@ -67,6 +68,11 @@ public class PersonDocumentModelHandler
     public PersonDocumentModelHandler() {
        super(COMMON_PART_LABEL);
     }
+
+    @Override
+    public String getAuthorityServicePath(){
+        return PersonAuthorityClient.SERVICE_PATH_COMPONENT;    // CSPACE-3932
+    }
        
     /* (non-Javadoc)
      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
index 5e48687dd05cd8c6424323e6f2fb6086fb53eb49..92b0737f7906873f28ae21ed7e943a6b26bc1c44 100644 (file)
@@ -196,7 +196,7 @@ public class RelationDocumentModelHandler
             String itemDocType = itemDocModel.getDocumentType().getName();
             item.setDocumentTypeFromModel(itemDocType);           //this one comes from the nuxeo documentType
 
-            System.out.println("\r\n******** AuthorityItemDocumentModelHandlder documentType **************\r\n\tdocModel: "+itemDocType+"\r\n\tpayload: "+documentType);
+            //DEBUG: System.out.println("\r\n******** AuthorityItemDocumentModelHandlder documentType **************\r\n\tdocModel: "+itemDocType+"\r\n\tpayload: "+documentType);
             boolean usedDocumentTypeFromPayload = true;
             if ( ! Tools.isBlank(documentType)){
                 if (documentType.equals(itemDocType)){
index 242a08013e75be52d204465b81f6f7f39dc38d35..99bf3d63068fef65abad154fd635972f9169b263 100644 (file)
@@ -30,6 +30,7 @@ import java.util.List;
 import java.util.Map;
 
 import org.collectionspace.services.TaxonJAXBSchema;
+import org.collectionspace.services.client.TaxonomyAuthorityClient;
 import org.collectionspace.services.common.document.DocumentFilter;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.service.ObjectPartType;
@@ -70,6 +71,11 @@ public class TaxonDocumentModelHandler
         super(COMMON_PART_LABEL);
     }
 
+    @Override
+    public String getAuthorityServicePath(){
+        return TaxonomyAuthorityClient.SERVICE_PATH_COMPONENT;    // CSPACE-3932
+    }
+
     /* (non-Javadoc)
      * @see org.collectionspace.services.nuxeo.client.java.DocumentModelHandler#handleCreate(org.collectionspace.services.common.document.DocumentWrapper)
      */
index eb8828dbe188239b7218b0259ae53067ff98f1ae..0d751ac674569e1f2142e5275a0400ecfe7935d0 100644 (file)
@@ -26,6 +26,7 @@ package org.collectionspace.services.vocabulary.nuxeo;
 import java.util.Iterator;
 import java.util.List;
 
+import org.collectionspace.services.client.VocabularyClient;
 import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema;
 import org.collectionspace.services.common.document.DocumentWrapper;
 import org.collectionspace.services.common.vocabulary.nuxeo.AuthorityItemDocumentModelHandler;
@@ -55,6 +56,11 @@ public class VocabularyItemDocumentModelHandler
     public VocabularyItemDocumentModelHandler() {
        super(COMMON_PART_LABEL);
     }
+
+    @Override
+    public String getAuthorityServicePath(){
+        return VocabularyClient.SERVICE_PATH_COMPONENT;    // CSPACE-3932
+    }
        
     
     @Override