]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-4783 - Applied a partial fix (hack) that will work until we put in a proper...
authorPatrick Schmitz <pschmitz@berkeley.edu>
Mon, 12 Mar 2012 04:51:54 +0000 (21:51 -0700)
committerPatrick Schmitz <pschmitz@berkeley.edu>
Mon, 12 Mar 2012 04:51:54 +0000 (21:51 -0700)
services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml
services/relation/service/src/main/java/org/collectionspace/services/relation/nuxeo/RelationDocumentModelHandler.java

index 43554fedad8293dd4898e52c4f8521674cbd0140..f5760f7c1648f5857635bf41262e8a30a179468c 100644 (file)
       <service:DocHandlerParams xmlns:service="http://collectionspace.org/services/common/service">
         <service:params>
           <service:ListResultsFields>
-                                               <!-- The default fields should probably be omitted here -->
             <service:ListResultField>
               <service:element>displayName</service:element>
               <service:xpath>displayName</service:xpath>
               <service:element>vocabType</service:element>
               <service:xpath>vocabType</service:xpath>
             </service:ListResultField>
-            <service:ListResultField>
-              <service:element>taxonFullName</service:element>
-              <service:xpath>taxonFullName</service:xpath>
-            </service:ListResultField>
           </service:ListResultsFields>
         </service:params>
       </service:DocHandlerParams>
         <service:params>
           <service:ListResultsFields>
                                        <!-- Omit the standard AuthorityItem items (they are handled by the code) -->
+            <service:ListResultField>
+              <service:element>taxonFullName</service:element>
+              <service:xpath>taxonFullName</service:xpath>
+            </service:ListResultField>
           </service:ListResultsFields>
         </service:params>
       </service:DocHandlerParams>
index 4d131ca8e5b7c9365749cbe07d897ee39c44ecdd..2c394b3a325c12c80c90e0461af5f65f317512e6 100644 (file)
@@ -397,15 +397,18 @@ public class RelationDocumentModelHandler
     
     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.
+       if(docType!=null) {
+               // HACK - Use startsWith to allow for extension of schemas.
+               if(docType.startsWith("Person"))
+                       common_schema = PersonAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+               else if(docType.startsWith("Organization"))
+                       common_schema = OrgAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+               else if(docType.startsWith("Locationitem"))
+                       common_schema = LocationAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+               else if(docType.startsWith("Taxon"))
+                       common_schema = TaxonomyAuthorityClient.SERVICE_ITEM_COMMON_PART_NAME;
+               //else leave it null.
+       }
        return common_schema;
     }