use of org.apache.chemistry.opencmis.commons.data.ObjectList in project copper-cms by PogeyanOSS.
the class DiscoveryActor method getContentChanges.
private JSONObject getContentChanges(QueryGetRequest request) throws CmisRuntimeException {
String permission = request.getUserObject().getPermission();
if (!Helpers.checkingUserPremission(permission, "get")) {
throw new CmisRuntimeException(request.getUserName() + " is not authorized to applyAcl.");
}
String changeLogToken = request.getParameter(QueryGetRequest.PARAM_CHANGE_LOG_TOKEN);
Boolean includeProperties = request.getBooleanParameter(QueryGetRequest.PARAM_PROPERTIES);
String filter = request.getParameter(QueryGetRequest.PARAM_FILTER);
Boolean includePolicyIds = request.getBooleanParameter(QueryGetRequest.PARAM_POLICY_IDS);
Boolean includeAcl = request.getBooleanParameter(QueryGetRequest.PARAM_ACL);
BigInteger maxItems = request.getBigIntegerParameter(QueryGetRequest.PARAM_MAX_ITEMS);
boolean succinct = request.getBooleanParameter(QueryGetRequest.PARAM_SUCCINCT, false);
DateTimeFormat dateTimeFormat = request.getDateTimeFormatParameter();
Holder<String> changeLogTokenHolder = new Holder<String>(changeLogToken);
ObjectList changes = CmisDiscoveryService.Impl.getContentChanges(request.getRepositoryId(), changeLogTokenHolder, includeProperties, filter, includePolicyIds, includeAcl, maxItems, null, request.getUserObject());
JSONObject jsonChanges = JSONConverter.convert(changes, CmisTypeCacheService.get(request.getRepositoryId()), JSONConverter.PropertyMode.CHANGE, succinct, dateTimeFormat);
jsonChanges.put(JSONConstants.JSON_OBJECTLIST_CHANGE_LOG_TOKEN, changeLogTokenHolder.getValue());
return jsonChanges;
}
use of org.apache.chemistry.opencmis.commons.data.ObjectList in project copper-cms by PogeyanOSS.
the class RelationshipActor method getRelationships.
private JSONObject getRelationships(QueryGetRequest request) throws CmisObjectNotFoundException, MongoException, CmisRuntimeException {
String permission = request.getUserObject().getPermission();
if (!Helpers.checkingUserPremission(permission, "get")) {
throw new CmisRuntimeException(request.getUserName() + " is not authorized to applyAcl.");
}
String objectId = request.getObjectId();
Boolean includeSubRelationshipTypes = request.getBooleanParameter(QueryGetRequest.PARAM_SUB_RELATIONSHIP_TYPES);
RelationshipDirection relationshipDirection = request.getEnumParameter(QueryGetRequest.PARAM_RELATIONSHIP_DIRECTION, RelationshipDirection.class);
String renditionFilter = request.getParameter(QueryGetRequest.PARAM_RENDITION_FILTER);
Boolean includeAllowableActions = request.getBooleanParameter(QueryGetRequest.PARAM_ALLOWABLE_ACTIONS);
BigInteger maxItems = request.getBigIntegerParameter(QueryGetRequest.PARAM_MAX_ITEMS);
BigInteger skipCount = request.getBigIntegerParameter(QueryGetRequest.PARAM_SKIP_COUNT);
boolean succinct = request.getBooleanParameter(QueryGetRequest.PARAM_SUCCINCT, false);
String typeId = request.getParameter(QueryGetRequest.PARAM_TYPE_ID);
DateTimeFormat dateTimeFormat = request.getDateTimeFormatParameter();
ObjectList relationships = CmisRelationshipService.Impl.getObjectRelationships(request.getRepositoryId(), objectId, includeSubRelationshipTypes, relationshipDirection, typeId, renditionFilter, includeAllowableActions, maxItems, skipCount, null, request.getUserName());
if (relationships == null) {
throw new CmisRuntimeException("Relationships are null!");
}
JSONObject jsonChildren = JSONConverter.convert(relationships, null, JSONConverter.PropertyMode.OBJECT, succinct, dateTimeFormat);
return jsonChildren;
}
use of org.apache.chemistry.opencmis.commons.data.ObjectList in project copper-cms by PogeyanOSS.
the class NavigationActor method getCheckedOutDocs.
private JSONObject getCheckedOutDocs(QueryGetRequest request) throws CmisObjectNotFoundException, CmisRuntimeException {
String permission = request.getUserObject().getPermission();
if (!Helpers.checkingUserPremission(permission, "get")) {
throw new CmisRuntimeException(request.getUserName() + " is not authorized to applyAcl.");
}
String folderId = request.getObjectId();
String filter = request.getParameter(QueryGetRequest.PARAM_FILTER);
String orderBy = request.getParameter(QueryGetRequest.PARAM_ORDER_BY);
Boolean includeAllowableActions = request.getBooleanParameter(QueryGetRequest.PARAM_ALLOWABLE_ACTIONS);
includeAllowableActions = includeAllowableActions == null ? false : includeAllowableActions;
IncludeRelationships includeRelationships = request.getEnumParameter(QueryGetRequest.PARAM_RELATIONSHIPS, IncludeRelationships.class);
String renditionFilter = request.getParameter(QueryGetRequest.PARAM_RENDITION_FILTER);
BigInteger maxItems = request.getBigIntegerParameter(QueryGetRequest.PARAM_MAX_ITEMS);
BigInteger skipCount = request.getBigIntegerParameter(QueryGetRequest.PARAM_SKIP_COUNT);
boolean succinct = request.getBooleanParameter(QueryGetRequest.PARAM_SUCCINCT, false);
DateTimeFormat dateTimeFormat = request.getDateTimeFormatParameter();
ObjectList docs = CmisNavigationService.Impl.getCheckedOutDocs(request.getRepositoryId(), folderId, filter, orderBy, includeAllowableActions, includeRelationships, renditionFilter, maxItems, skipCount, null, null, request.getUserObject());
if (docs == null) {
throw new CmisRuntimeException("Children are null!");
}
JSONObject jsonDocs = JSONConverter.convert(docs, CmisTypeCacheService.get(request.getRepositoryId()), JSONConverter.PropertyMode.OBJECT, succinct, dateTimeFormat);
return jsonDocs;
}
Aggregations