From: Richard Millet Date: Fri, 4 May 2012 20:31:31 +0000 (-0700) Subject: CSPACE-5130: More fixes for special handling of VocabularyItemDocumentModelHandler X-Git-Url: https://git.aero2k.de/?a=commitdiff_plain;h=2867bb8389a1e08524dafc45a6b961831f46aae6;p=tmp%2Fjakarta-migration.git CSPACE-5130: More fixes for special handling of VocabularyItemDocumentModelHandler --- diff --git a/services/authority/service/pom.xml b/services/authority/service/pom.xml index 83a83342b..dc218ccdf 100644 --- a/services/authority/service/pom.xml +++ b/services/authority/service/pom.xml @@ -45,6 +45,11 @@ org.collectionspace.services.authority.jaxb ${project.version} + + org.collectionspace.services + org.collectionspace.services.vocabulary.jaxb + ${project.version} + org.collectionspace.services org.collectionspace.services.authentication.jaxb diff --git a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java index 8ba40877c..c480dd53b 100644 --- a/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java +++ b/services/authority/service/src/main/java/org/collectionspace/services/common/vocabulary/nuxeo/AuthorityItemDocumentModelHandler.java @@ -59,6 +59,7 @@ import org.collectionspace.services.relation.RelationsCommon; import org.collectionspace.services.relation.RelationsCommonList; import org.collectionspace.services.relation.RelationsDocListItem; import org.collectionspace.services.relation.RelationshipType; +import org.collectionspace.services.vocabulary.VocabularyItemJAXBSchema; import org.nuxeo.ecm.core.api.ClientException; import org.nuxeo.ecm.core.api.DocumentModel; import org.nuxeo.ecm.core.api.model.PropertyException; @@ -186,7 +187,7 @@ public abstract class AuthorityItemDocumentModelHandler for (int i = 0; i < nFields; i++) { ListResultField field = list.get(i); String elName = field.getElement(); - if (AuthorityItemJAXBSchema.TERM_DISPLAY_NAME.equals(elName) || AuthorityItemJAXBSchema.DISPLAY_NAME.equals(elName)) { + if (AuthorityItemJAXBSchema.TERM_DISPLAY_NAME.equals(elName) || VocabularyItemJAXBSchema.DISPLAY_NAME.equals(elName)) { hasDisplayName = true; } else if (AuthorityItemJAXBSchema.SHORT_IDENTIFIER.equals(elName)) { hasShortId = true; @@ -199,7 +200,7 @@ public abstract class AuthorityItemDocumentModelHandler ListResultField field; if (!hasDisplayName) { field = getListResultsDisplayNameField(); - list.add(field); + list.add(field); //Note: We're updating the "global" service and tenant bindings instance here -the list instance here is a reference to the tenant bindings instance in the singleton ServiceMain. } if (!hasShortId) { field = new ListResultField(); @@ -310,6 +311,9 @@ public abstract class AuthorityItemDocumentModelHandler return updatedRefName; } + /* + * Note: The Vocabulary document handler overrides this method. + */ protected String getRefPropName() { return ServiceBindingUtils.AUTH_REF_PROP; } diff --git a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml index 7abf3e7ff..1dbca7276 100644 --- a/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml +++ b/services/common/src/main/cspace/config/services/tenants/tenant-bindings-proto.xml @@ -2042,22 +2042,22 @@ --> - - termRef - salutation - - - termRef - title - - - termRef - gender - - - termRef - termStatus - + + termRef + personTermGroupList/[0]/salutation + + + termRef + personTermGroupList/[0]/title + + + termRef + gender + + + termRef + personTermGroupList/[0]/termStatus + diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java index 2b2e8f100..e13c0f33d 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/CommonList.java @@ -107,20 +107,20 @@ public class CommonList extends AbstractCommonList { */ public void setFieldsReturned(String[] fieldKeys) { this.fieldKeys = fieldKeys; - String fieldsImploded = implode(fieldKeys, "|"); + String fieldsImploded = implode(fieldKeys, "|"); setFieldsReturned(fieldsImploded); } // TODO This should be in common, but then we have mutual dependencies. Sigh. private String implode(String strings[], String sep) { String implodedString; - if (strings.length==0) { + if (strings.length == 0) { implodedString = ""; } else { StringBuffer sb = new StringBuffer(); sb.append(strings[0]); - for (int i=1;i extends RemoteDocumentModelHandlerImpl resultsFields = getListItemsArray(); - int nFields = resultsFields.size()+NUM_STANDARD_LIST_RESULT_FIELDS; + int nFields = resultsFields.size() + NUM_STANDARD_LIST_RESULT_FIELDS; String fields[] = new String[nFields]; fields[0] = STANDARD_LIST_CSID_FIELD; fields[1] = STANDARD_LIST_URI_FIELD; fields[2] = STANDARD_LIST_UPDATED_AT_FIELD; fields[3] = STANDARD_LIST_WORKFLOW_FIELD; - for(int i=NUM_STANDARD_LIST_RESULT_FIELDS;i iter = wrapDoc.getWrappedObject().iterator(); diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java index f471deff3..0837b9c7c 100644 --- a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java +++ b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/VocabularyResource.java @@ -25,9 +25,9 @@ package org.collectionspace.services.vocabulary; import org.collectionspace.services.client.VocabularyClient; import org.collectionspace.services.common.context.ServiceBindingUtils; -import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema; +//import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema; import org.collectionspace.services.common.vocabulary.AuthorityResource; -import org.collectionspace.services.nuxeo.util.NuxeoUtils; +//import org.collectionspace.services.nuxeo.util.NuxeoUtils; import org.collectionspace.services.vocabulary.nuxeo.VocabularyItemDocumentModelHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java index 13605c9b1..369015619 100644 --- a/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java +++ b/services/vocabulary/service/src/main/java/org/collectionspace/services/vocabulary/nuxeo/VocabularyItemDocumentModelHandler.java @@ -94,8 +94,8 @@ public class VocabularyItemDocumentModelHandler protected ListResultField getListResultsDisplayNameField() { ListResultField result = new ListResultField(); - result.setElement(AuthorityItemJAXBSchema.DISPLAY_NAME); - result.setXpath(AuthorityItemJAXBSchema.DISPLAY_NAME); + result.setElement(VocabularyItemJAXBSchema.DISPLAY_NAME); + result.setXpath(VocabularyItemJAXBSchema.DISPLAY_NAME); return result; } @@ -103,8 +103,8 @@ public class VocabularyItemDocumentModelHandler protected ListResultField getListResultsTermStatusField() { ListResultField result = new ListResultField(); - result.setElement(VocabularyItemJAXBSchema.DISPLAY_NAME); - result.setXpath(VocabularyItemJAXBSchema.TERM_STATUS); + result.setElement(AuthorityItemJAXBSchema.TERM_STATUS); + result.setXpath(AuthorityItemJAXBSchema.TERM_STATUS); return result; }