use of com.pogeyan.cmis.data.mongo.MDocumentObject in project copper-cms by PogeyanOSS.
the class MDocumentObjectDAOImpl method update.
@Override
public void update(String objectId, Map<String, Object> updateProps) {
UpdateOperations<MDocumentObject> update = createUpdateOperations();
Query<MDocumentObject> query = createQuery().disableValidation().field("id").equal(objectId).field("token.changeType").notEqual(TokenChangeType.DELETED.value());
if (updateProps.get("acl") != null) {
MongoAclImpl mAcl = MBaseObject.convertMongoAcl((AccessControlListImplExt) updateProps.get("acl"));
updateProps.remove("acl");
updateProps.put("acl", mAcl);
}
if (updateProps.get("token") != null) {
MongoToken mToken = MBaseObject.convertMongoToken((TokenImpl) updateProps.get("token"));
updateProps.remove("token");
updateProps.put("token", mToken);
}
for (Map.Entry<String, Object> entry : updateProps.entrySet()) {
update = update.set(entry.getKey(), entry.getValue());
}
update(query, update);
}
Aggregations