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 {
<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>
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;
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)
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