]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-3865: Workaround to return values for four additional fields, other than URI...
authorAron Roberts <aron@socrates.berkeley.edu>
Mon, 16 May 2011 22:59:17 +0000 (22:59 +0000)
committerAron Roberts <aron@socrates.berkeley.edu>
Mon, 16 May 2011 22:59:17 +0000 (22:59 +0000)
services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityConstants.java
services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityDocumentModelHandler.java

index deb3896ee27d649100ec7a6e4330723e5d0d4e85..15f8b9108d404f402ba3390b2542b4d94c450e5a 100644 (file)
@@ -24,8 +24,7 @@
 package org.collectionspace.services.taxonomy.nuxeo;
 
 /**
- * TaxonomyAuthorityConstants processes CollectionObject document
- *
+ * TaxonomyAuthorityConstants
  */
 public class TaxonomyAuthorityConstants {
 
index 482b0251dc247073d89977c09968fc54df2c1968..8bb95b744fbf0d2c9554d7abf13d4c65e9d5d77b 100644 (file)
@@ -60,6 +60,10 @@ public class TaxonomyAuthorityDocumentModelHandler
     public TaxonomyAuthorityDocumentModelHandler() {
        super(COMMON_PART_LABEL);
     }
+    
+    public String getCommonPartLabel() {
+        return COMMON_PART_LABEL;
+    }
        
     @Override
     public TaxonomyauthorityCommonList extractCommonPartList(DocumentWrapper<DocumentModelList> wrapDoc) throws Exception {
@@ -71,7 +75,15 @@ public class TaxonomyAuthorityDocumentModelHandler
         //FIXME: iterating over a long list of documents is not a long term
         //strategy...need to change to more efficient iterating in future
         List<TaxonomyauthorityCommonList.TaxonomyauthorityListItem> list = coList.getTaxonomyauthorityListItem();
-        String label = getServiceContext().getCommonPartLabel();
+        // FIXME: This workaround - for the discrepancy between plural service
+        // name / path ("taxonomyauthorities") and singular common part name
+        // ("taxonomyauthority ... _common") in this service might be handled
+        // in a cleaner way than below.  Absent this workaround, values of fields
+        // (other than URI and CSID) could not be obtained via the document model.
+        // Perhaps this will be moot when we switch to the model of Person, et al.,
+        // where SERVICE_PAYLOAD_NAME can be distinct from SERVICE_NAME.
+        // String label = getServiceContext().getCommonPartLabel();
+        String label = getCommonPartLabel();
         Iterator<DocumentModel> iter = wrapDoc.getWrappedObject().iterator();
         while(iter.hasNext()){
             DocumentModel docModel = iter.next();