]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
CSPACE-7065: Fixed term display name updates in refojbs after sync.
authorremillet <remillet@yahoo.com>
Tue, 7 Feb 2017 00:06:09 +0000 (16:06 -0800)
committerremillet <remillet@yahoo.com>
Tue, 7 Feb 2017 00:06:09 +0000 (16:06 -0800)
services/account/client/src/main/java/org/collectionspace/services/client/AccountClient.java
services/common/pom.xml
services/common/src/main/java/org/collectionspace/services/nuxeo/client/java/RemoteDocumentModelHandlerImpl.java

index 7efb2f6005a4aee9bd635929dd6563923bfa46ea..d97cf2a53d39ff3077863e9185e703e45b6899c1 100644 (file)
@@ -43,6 +43,7 @@ public class AccountClient extends AbstractServiceClientImpl<AccountsCommonList,
     public static final String SERVICE_NAME = "accounts";
     public static final String SERVICE_PATH_COMPONENT = SERVICE_NAME;
     public static final String SERVICE_PATH = "/" + SERVICE_PATH_COMPONENT;
+    public static final String SERVICE_COMMON_PART_NAME = SERVICE_NAME + PART_LABEL_SEPARATOR + PART_COMMON_LABEL;
     public final static String IMMUTABLE = "immutable";
 
        public AccountClient() throws Exception {
index 48645b4aca8cabb232c0211e74c8fa1d8da97bc4..5e32af0646e783732c58ca11b3d5d77d64e9f595 100644 (file)
                        <artifactId>org.collectionspace.services.relation.client</artifactId>
                        <version>${project.version}</version>
                </dependency>
+               <dependency>
+                       <groupId>org.collectionspace.services</groupId>
+                       <artifactId>org.collectionspace.services.account.client</artifactId>
+                       <version>${project.version}</version>
+               </dependency>
                <dependency>
                        <groupId>org.collectionspace.services</groupId>
                        <artifactId>org.collectionspace.services.publicitem.client</artifactId>
index f832cd303e895c17063b8d750d1b0b9bdb7bf965..0ef72eafc733a27946b419d20cccd68416e29929 100644 (file)
@@ -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<T, TL>
     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<T, TL>
                 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