Search in sources :

Example 6 with IncludeRelationships

use of org.apache.chemistry.opencmis.commons.enums.IncludeRelationships 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;
}
Also used : CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) JSONObject(org.apache.chemistry.opencmis.commons.impl.json.JSONObject) IncludeRelationships(org.apache.chemistry.opencmis.commons.enums.IncludeRelationships) BigInteger(java.math.BigInteger) ObjectList(org.apache.chemistry.opencmis.commons.data.ObjectList) DateTimeFormat(org.apache.chemistry.opencmis.commons.enums.DateTimeFormat)

Aggregations

DateTimeFormat (org.apache.chemistry.opencmis.commons.enums.DateTimeFormat)6 IncludeRelationships (org.apache.chemistry.opencmis.commons.enums.IncludeRelationships)6 CmisRuntimeException (org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException)6 BigInteger (java.math.BigInteger)4 JSONArray (org.apache.chemistry.opencmis.commons.impl.json.JSONArray)3 JSONObject (org.apache.chemistry.opencmis.commons.impl.json.JSONObject)3 ObjectInFolderContainer (org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer)2 IBaseObject (com.pogeyan.cmis.api.data.IBaseObject)1 ObjectData (org.apache.chemistry.opencmis.commons.data.ObjectData)1 ObjectInFolderList (org.apache.chemistry.opencmis.commons.data.ObjectInFolderList)1 ObjectList (org.apache.chemistry.opencmis.commons.data.ObjectList)1 ObjectParentData (org.apache.chemistry.opencmis.commons.data.ObjectParentData)1 CmisInvalidArgumentException (org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException)1 ReturnVersion (org.apache.chemistry.opencmis.commons.impl.ReturnVersion)1