From 6c999731235df80675a10166237506b45b7137b9 Mon Sep 17 00:00:00 2001 From: remillet Date: Mon, 6 Feb 2017 16:06:09 -0800 Subject: [PATCH] CSPACE-7065: Fixed term display name updates in refojbs after sync. --- .../services/client/AccountClient.java | 1 + services/common/pom.xml | 5 +++++ .../java/RemoteDocumentModelHandlerImpl.java | 20 ++++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/services/account/client/src/main/java/org/collectionspace/services/client/AccountClient.java b/services/account/client/src/main/java/org/collectionspace/services/client/AccountClient.java index 7efb2f600..d97cf2a53 100644 --- a/services/account/client/src/main/java/org/collectionspace/services/client/AccountClient.java +++ b/services/account/client/src/main/java/org/collectionspace/services/client/AccountClient.java @@ -43,6 +43,7 @@ public class AccountClient extends AbstractServiceClientImplorg.collectionspace.services.relation.client ${project.version} + + org.collectionspace.services + org.collectionspace.services.account.client + ${project.version} + org.collectionspace.services org.collectionspace.services.publicitem.client 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 f832cd303..0ef72eafc 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 @@ -40,6 +40,7 @@ import org.collectionspace.authentication.spi.AuthNContext; import org.collectionspace.services.authorization.AccountPermission; import org.collectionspace.services.jaxb.AbstractCommonList; import org.collectionspace.services.lifecycle.TransitionDef; +import org.collectionspace.services.client.AccountClient; import org.collectionspace.services.client.CollectionSpaceClient; import org.collectionspace.services.client.PayloadInputPart; import org.collectionspace.services.client.PayloadOutputPart; @@ -101,6 +102,8 @@ public abstract class RemoteDocumentModelHandlerImpl private final Logger logger = LoggerFactory.getLogger(RemoteDocumentModelHandlerImpl.class); private final static String CR = "\r\n"; private final static String EMPTYSTR = ""; + private static final String COLLECTIONSPACE_CORE_SCHEMA = CollectionSpaceClient.COLLECTIONSPACE_CORE_SCHEMA; + private static final String ACCOUNT_PERMISSION_COMMON_PART_NAME = AccountClient.SERVICE_COMMON_PART_NAME; /* (non-Javadoc) * @see org.collectionspace.services.common.document.AbstractDocumentHandlerImpl#setServiceContext(org.collectionspace.services.common.context.ServiceContext) @@ -408,16 +411,27 @@ public abstract class RemoteDocumentModelHandlerImpl throw new BadRequestException(msg); } - //skip if the part is not in metadata + //skip if the part is not in metadata or if it is a system part ObjectPartType partMeta = partsMetaMap.get(partLabel); - if (partMeta == null) { + if (partMeta == null || isSystemPart(partLabel)) { continue; } fillPart(part, docModel, partMeta, action, ctx); } } - /** + private boolean isSystemPart(String partLabel) { + boolean result = false; + + if (partLabel != null && (partLabel.equalsIgnoreCase(COLLECTIONSPACE_CORE_SCHEMA) || + partLabel.equalsIgnoreCase(ACCOUNT_PERMISSION_COMMON_PART_NAME))) { + result = true; + } + + return result; + } + + /** * fillPart fills an XML part into given document model * @param part to fill * @param docModel for the given object -- 2.47.3