From: Aron Roberts Date: Mon, 16 May 2011 22:59:17 +0000 (+0000) Subject: CSPACE-3865: Workaround to return values for four additional fields, other than URI... X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=673b7f3194429e19691b1aa09a611977f59d7bc3;p=tmp%2Fjakarta-migration.git CSPACE-3865: Workaround to return values for four additional fields, other than URI and CSID, in summary lists of taxonomy authorities. --- diff --git a/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityConstants.java b/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityConstants.java index deb3896ee..15f8b9108 100644 --- a/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityConstants.java +++ b/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityConstants.java @@ -24,8 +24,7 @@ package org.collectionspace.services.taxonomy.nuxeo; /** - * TaxonomyAuthorityConstants processes CollectionObject document - * + * TaxonomyAuthorityConstants */ public class TaxonomyAuthorityConstants { diff --git a/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityDocumentModelHandler.java b/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityDocumentModelHandler.java index 482b0251d..8bb95b744 100644 --- a/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityDocumentModelHandler.java +++ b/services/taxonomy/service/src/main/java/org/collectionspace/services/taxonomy/nuxeo/TaxonomyAuthorityDocumentModelHandler.java @@ -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 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 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 iter = wrapDoc.getWrappedObject().iterator(); while(iter.hasNext()){ DocumentModel docModel = iter.next();