/** * Converts bulk update data. */ public static JSONObject convert(BulkUpdateObjectIdAndChangeToken oc) { if (oc == null) { return null; } JSONObject result = new JSONObject(); setIfNotNull(JSON_BULK_UPDATE_ID, oc.getId(), result); setIfNotNull(JSON_BULK_UPDATE_NEW_ID, oc.getNewId(), result); setIfNotNull(JSON_BULK_UPDATE_CHANGE_TOKEN, oc.getChangeToken(), result); convertExtension(oc, result); return result; }
public void addObjectIdsAndChangeTokens(List<BulkUpdateObjectIdAndChangeToken> objectIdsAndChangeTokens) { if (isNullOrEmpty(objectIdsAndChangeTokens)) { return; } int idx = 0; for (BulkUpdateObjectIdAndChangeToken oc : objectIdsAndChangeTokens) { if (oc == null || oc.getId() == null || oc.getId().length() == 0) { continue; } String idxStr = "[" + idx + "]"; addParameter(Constants.CONTROL_OBJECT_ID + idxStr, oc.getId()); addParameter(Constants.CONTROL_CHANGE_TOKEN + idxStr, (oc.getChangeToken() == null ? "" : oc.getChangeToken())); idx++; } }
public String getIdentifier(BulkEntry entry) { return entry.getObjectIdAndChangeToken().getId(); }
public void addObjectIdsAndChangeTokens(List<BulkUpdateObjectIdAndChangeToken> objectIdsAndChangeTokens) { if (isNullOrEmpty(objectIdsAndChangeTokens)) { return; } int idx = 0; for (BulkUpdateObjectIdAndChangeToken oc : objectIdsAndChangeTokens) { if (oc == null || oc.getId() == null || oc.getId().length() == 0) { continue; } String idxStr = "[" + idx + "]"; addParameter(Constants.CONTROL_OBJECT_ID + idxStr, oc.getId()); addParameter(Constants.CONTROL_CHANGE_TOKEN + idxStr, (oc.getChangeToken() == null ? "" : oc.getChangeToken())); idx++; } }
public String getIdentifier(BulkEntry entry) { return entry.getObjectIdAndChangeToken().getId(); }
/** * Converts bulk update data. */ public static JSONObject convert(BulkUpdateObjectIdAndChangeToken oc) { if (oc == null) { return null; } JSONObject result = new JSONObject(); setIfNotNull(JSON_BULK_UPDATE_ID, oc.getId(), result); setIfNotNull(JSON_BULK_UPDATE_NEW_ID, oc.getNewId(), result); setIfNotNull(JSON_BULK_UPDATE_CHANGE_TOKEN, oc.getChangeToken(), result); convertExtension(oc, result); return result; }
XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_IDANDTOKEN_ID, idAndToken.getId()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_IDANDTOKEN_CHANGETOKEN, idAndToken.getChangeToken());
/** * Throws an exception if the given list is {@code null} or empty or * invalid. */ protected void checkBulkUpdateList(List<BulkUpdateObjectIdAndChangeToken> list) { if (list == null) { throw new CmisInvalidArgumentException("Object Id list must be set!"); } if (list.isEmpty()) { throw new CmisInvalidArgumentException("Object Id list must not be empty!"); } for (BulkUpdateObjectIdAndChangeToken entry : list) { if (entry == null) { throw new CmisInvalidArgumentException("Object Id list has gaps!"); } if (entry.getId() == null) { throw new CmisInvalidArgumentException("Object Id list contains an entry without ID!"); } if (entry.getId().length() == 0) { throw new CmisInvalidArgumentException("Object Id list contains an entry with an empty ID!"); } } }
/** * Converts bulk update object id and change token. */ public static CmisObjectIdAndChangeTokenType convert(BulkUpdateObjectIdAndChangeToken objectIdAndChangeToken) { if (objectIdAndChangeToken == null) { return null; } CmisObjectIdAndChangeTokenType result = new CmisObjectIdAndChangeTokenType(); result.setId(objectIdAndChangeToken.getId()); result.setNewId(objectIdAndChangeToken.getNewId()); result.setChangeToken(objectIdAndChangeToken.getChangeToken()); // handle extensions convertExtension(objectIdAndChangeToken, result); return result; }
XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_IDANDTOKEN_ID, idAndToken.getId()); XMLUtils.write(writer, PREFIX_CMIS, NAMESPACE_CMIS, TAG_IDANDTOKEN_CHANGETOKEN, idAndToken.getChangeToken());
public void update() { String objectId = objectIdAndChangeToken.getId(); final CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object"); if (!info.isVariant(CMISObjectVariant.ASSOC) && !info.isVariant(CMISObjectVariant.VERSION)) { final NodeRef nodeRef = info.getNodeRef(); connector.setProperties(nodeRef, info.getType(), properties, new String[0]); if (isObjectInfoRequired) { getObjectInfo(repositoryId, objectId, "*", IncludeRelationships.NONE); } connector.addSecondaryTypes(nodeRef, addSecondaryTypeIds); connector.removeSecondaryTypes(nodeRef, removeSecondaryTypeIds); if (properties.getProperties().size() > 0 || addSecondaryTypeIds.size() > 0 || removeSecondaryTypeIds.size() > 0) { bulkUpdateContext.success(info); } } };
AtomEntry entry = new AtomEntry(feed.getWriter()); for (BulkUpdateObjectIdAndChangeToken idAndToken : result) { if (idAndToken == null || idAndToken.getId() == null) { continue; idAndToken.getNewId() != null ? idAndToken.getNewId() : idAndToken.getId())); if (idAndToken.getChangeToken() != null) { properties.addProperty(new PropertyStringImpl(PropertyIds.CHANGE_TOKEN, idAndToken .getChangeToken()));
public void update() { String objectId = objectIdAndChangeToken.getId(); final CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object"); if (!info.isVariant(CMISObjectVariant.ASSOC) && !info.isVariant(CMISObjectVariant.VERSION)) { final NodeRef nodeRef = info.getNodeRef(); connector.setProperties(nodeRef, info.getType(), properties, new String[0]); if (isObjectInfoRequired) { getObjectInfo(repositoryId, objectId, "*", IncludeRelationships.NONE); } connector.addSecondaryTypes(nodeRef, addSecondaryTypeIds); connector.removeSecondaryTypes(nodeRef, removeSecondaryTypeIds); if (properties.getProperties().size() > 0 || addSecondaryTypeIds.size() > 0 || removeSecondaryTypeIds.size() > 0) { bulkUpdateContext.success(info); } } };