From 3c2eae78769f62aad401dabc91a014aff4a532f2 Mon Sep 17 00:00:00 2001 From: Richard Millet Date: Tue, 11 Sep 2012 15:52:00 -0700 Subject: [PATCH] CSPACE-5489: Changed list handling code for authority items to no longer supply refname since it is now part of all common list results and handled in the base class. Also removed all refName list result fields from tenant bindings since they are always included for all objects/resources. --- .../schemas/collectionspace_core.xsd | 2 +- .../AuthorityItemDocumentModelHandler.java | 12 -------- .../client/CollectionSpaceClient.java | 2 +- .../tenants/tenant-bindings-proto.xml | 28 ------------------- .../vocabulary/RefNameServiceUtils.java | 2 +- .../java/RemoteDocumentModelHandlerImpl.java | 6 ++-- 6 files changed, 7 insertions(+), 45 deletions(-) diff --git a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd index 7c9389798..1fe265934 100644 --- a/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd +++ b/3rdparty/nuxeo/nuxeo-platform-collectionspace/src/main/resources/schemas/collectionspace_core.xsd @@ -17,7 +17,7 @@ - + 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 788e91b7a..ea5274001 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 @@ -24,12 +24,10 @@ package org.collectionspace.services.common.vocabulary.nuxeo; import org.collectionspace.services.client.AuthorityClient; -import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.IQueryManager; import org.collectionspace.services.client.PoxPayloadIn; import org.collectionspace.services.client.PoxPayloadOut; -import org.collectionspace.services.common.api.CommonAPI; import org.collectionspace.services.common.api.RefName; import org.collectionspace.services.common.api.Tools; import org.collectionspace.services.common.authorityref.AuthorityRefDocList; @@ -38,7 +36,6 @@ import org.collectionspace.services.common.context.ServiceContext; import org.collectionspace.services.common.document.DocumentException; import org.collectionspace.services.common.document.DocumentFilter; import org.collectionspace.services.common.document.DocumentWrapper; -import org.collectionspace.services.common.document.DocumentWrapperImpl; import org.collectionspace.services.common.vocabulary.AuthorityJAXBSchema; import org.collectionspace.services.common.vocabulary.AuthorityItemJAXBSchema; import org.collectionspace.services.common.vocabulary.RefNameServiceUtils; @@ -249,7 +246,6 @@ public abstract class AuthorityItemDocumentModelHandler // for general logic. boolean hasDisplayName = false; boolean hasShortId = false; - boolean hasRefName = false; boolean hasTermStatus = false; for (int i = 0; i < nFields; i++) { ListResultField field = list.get(i); @@ -258,8 +254,6 @@ public abstract class AuthorityItemDocumentModelHandler hasDisplayName = true; } else if (AuthorityItemJAXBSchema.SHORT_IDENTIFIER.equals(elName)) { hasShortId = true; - } else if (AuthorityItemJAXBSchema.REF_NAME.equals(elName)) { - hasRefName = true; } else if (AuthorityItemJAXBSchema.TERM_STATUS.equals(elName)) { hasTermStatus = true; } @@ -276,12 +270,6 @@ public abstract class AuthorityItemDocumentModelHandler field.setXpath(AuthorityItemJAXBSchema.SHORT_IDENTIFIER); list.add(field); } - if (!hasRefName) { - field = new ListResultField(); - field.setElement(AuthorityItemJAXBSchema.REF_NAME); - field.setXpath(AuthorityItemJAXBSchema.REF_NAME); - list.add(field); - } if (!hasTermStatus) { field = getListResultsTermStatusField(); list.add(field); diff --git a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java index 940983708..d5bd51fa7 100644 --- a/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java +++ b/services/client/src/main/java/org/collectionspace/services/client/CollectionSpaceClient.java @@ -39,7 +39,7 @@ public interface CollectionSpaceClientdisplayName displayName - - refName - refName - shortIdentifier shortIdentifier @@ -1618,10 +1614,6 @@ displayName displayName - - refName - refName - shortIdentifier shortIdentifier @@ -1796,10 +1788,6 @@ displayName displayName - - refName - refName - shortIdentifier shortIdentifier @@ -1999,10 +1987,6 @@ displayName displayName - - refName - refName - shortIdentifier shortIdentifier @@ -2145,10 +2129,6 @@ displayName displayName - - refName - refName - shortIdentifier shortIdentifier @@ -2329,10 +2309,6 @@ displayName displayName - - refName - refName - shortIdentifier shortIdentifier @@ -2516,10 +2492,6 @@ displayName displayName - - refName - refName - shortIdentifier shortIdentifier diff --git a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java index 9583ec9dc..3624de8ae 100644 --- a/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java +++ b/services/common/src/main/java/org/collectionspace/services/common/vocabulary/RefNameServiceUtils.java @@ -547,7 +547,7 @@ public class RefNameServiceUtils { DocumentModel docModel = iter.next(); AuthorityRefDocList.AuthorityRefDocItem ilistItem; - String docType = docModel.getDocumentType().getName(); + String docType = docModel.getDocumentType().getName(); // REM - This will be a tentant qualified document type docType = ServiceBindingUtils.getUnqualifiedTenantDocType(docType); ServiceBindingType sb = queriedServiceBindings.get(docType); if (sb == null) { diff --git a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java index 187b11588..f598d597d 100644 --- a/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java +++ b/services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java @@ -164,7 +164,10 @@ public abstract class RemoteDocumentModelHandlerImpl } } catch (DocumentException e) { // TODO Auto-generated catch block - logger.error(String.format("Could not get document handler params for class %s", this.getClass().getName()), e); + String errMsg = String.format("Could not get document handler params from config bindings for class %s", this.getClass().getName()); + if (logger.isWarnEnabled() == true) { + logger.warn(errMsg); + } } return result; @@ -1149,7 +1152,6 @@ public abstract class RemoteDocumentModelHandlerImpl List childList = null; List parentList = null; DocumentModel docModel = wrapDoc.getWrappedObject(); -// String itemRefName = (String) docModel.getPropertyValue(AuthorityItemJAXBSchema.REF_NAME); cow; String itemRefName = (String) docModel.getProperty(CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA, CollectionSpaceClient.COLLECTIONSPACE_CORE_REFNAME); -- 2.47.3