コード例 #1
0
 /**
  * Filters out selected values supplied in an update request.
  *
  * @param objectProps the properties filtered out from the update payload
  * @param partMeta metadata for the object to fill
  */
 @Override
 public void filterReadOnlyPropertiesForPart(
     Map<String, Object> objectProps, ObjectPartType partMeta) {
   super.filterReadOnlyPropertiesForPart(objectProps, partMeta);
   String commonPartLabel = getServiceContext().getCommonPartLabel();
   if (partMeta.getLabel().equalsIgnoreCase(commonPartLabel)) {
     objectProps.remove(AuthorityJAXBSchema.CSID);
     objectProps.remove(AuthorityJAXBSchema.SHORT_IDENTIFIER);
     objectProps.remove(AuthorityJAXBSchema.REF_NAME);
   }
 }
コード例 #2
0
  /*
   * Non standard injection of CSID into common part, since caller may access through
   * shortId, and not know the CSID.
   * @see org.collectionspace.services.nuxeo.client.java.RemoteDocumentModelHandlerImpl#extractPart(org.nuxeo.ecm.core.api.DocumentModel, java.lang.String, org.collectionspace.services.common.service.ObjectPartType)
   */
  @Override
  protected Map<String, Object> extractPart(
      DocumentModel docModel, String schema, ObjectPartType partMeta) throws Exception {
    Map<String, Object> unQObjectProperties = super.extractPart(docModel, schema, partMeta);

    // Add the CSID to the common part
    if (partMeta.getLabel().equalsIgnoreCase(authorityCommonSchemaName)) {
      String csid = getCsid(docModel); // NuxeoUtils.extractId(docModel.getPathAsString());
      unQObjectProperties.put("csid", csid);
    }

    return unQObjectProperties;
  }