Search in sources :

Example 1 with FailedToDeleteData

use of org.apache.chemistry.opencmis.commons.data.FailedToDeleteData in project copper-cms by PogeyanOSS.

the class ObjectActor method deleteTree.

private static JSONObject deleteTree(PostRequest request) throws CmisObjectNotFoundException, CmisInvalidArgumentException, CmisNotSupportedException, CmisStorageException, CmisRuntimeException {
    String permission = request.getUserObject().getPermission();
    if (!Helpers.checkingUserPremission(permission, "post")) {
        throw new CmisRuntimeException(request.getUserName() + " is not authorized to applyAcl.");
    }
    String objectId = request.getObjectId();
    Boolean allVersions = request.getBooleanParameter(QueryGetRequest.PARAM_ALL_VERSIONS);
    UnfileObject unfileObjects = request.getEnumParameter(QueryGetRequest.PARAM_UNFILE_OBJECTS, UnfileObject.class);
    Boolean continueOnFailure = request.getBooleanParameter(QueryGetRequest.PARAM_CONTINUE_ON_FAILURE);
    FailedToDeleteData ftd = CmisObjectService.Impl.deleteTree(request.getRepositoryId(), objectId, allVersions, unfileObjects, continueOnFailure, request.getUserObject());
    if (ftd != null && CmisPropertyConverter.Impl.isNotEmpty(ftd.getIds())) {
        JSONObject JSONObject = JSONConverter.convert(ftd);
        return JSONObject;
    }
    return null;
}
Also used : CmisRuntimeException(org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException) JSONObject(org.apache.chemistry.opencmis.commons.impl.json.JSONObject) UnfileObject(org.apache.chemistry.opencmis.commons.enums.UnfileObject) FailedToDeleteData(org.apache.chemistry.opencmis.commons.data.FailedToDeleteData)

Aggregations

FailedToDeleteData (org.apache.chemistry.opencmis.commons.data.FailedToDeleteData)1 UnfileObject (org.apache.chemistry.opencmis.commons.enums.UnfileObject)1 CmisRuntimeException (org.apache.chemistry.opencmis.commons.exceptions.CmisRuntimeException)1 JSONObject (org.apache.chemistry.opencmis.commons.impl.json.JSONObject)1