Package org.apache.chemistry.opencmis.commons.data

Examples of org.apache.chemistry.opencmis.commons.data.AllowableActions


        init(model, COLUMN_NAMES, COLUMN_WIDTHS);
    }

    @Override
    public void doubleClickAction(MouseEvent e, int rowIndex) {
        AllowableActions aa = getObject().getAllowableActions();

        if ((aa == null) || (aa.getAllowableActions() == null)
                || aa.getAllowableActions().contains(Action.CAN_UPDATE_PROPERTIES)) {
            new PropertyEditorFrame(getClientModel(), getObject());
        }
    }
View Full Code Here


    public boolean hasAllowableAction(Action action) {
        if (action == null) {
            throw new IllegalArgumentException("Action must be set!");
        }

        AllowableActions currentAllowableActions = getAllowableActions();
        if (currentAllowableActions == null || currentAllowableActions.getAllowableActions() == null) {
            throw new IllegalStateException("Allowable Actions are not available!");
        }

        return currentAllowableActions.getAllowableActions().contains(action);
    }
View Full Code Here

                    f = createResult(FAILURE, "Non-Fileable object has CAN_MOVE_OBJECT allowable action!");
                    addResult(results, assertNotAllowableAction(object, Action.CAN_MOVE_OBJECT, null, f));
                }

                // get allowable actions again
                AllowableActions allowableActions = session.getBinding().getObjectService()
                        .getAllowableActions(session.getRepositoryInfo().getId(), object.getId(), null);

                if (allowableActions.getAllowableActions() == null) {
                    addResult(results,
                            createResult(FAILURE, "getAllowableActions() didn't returned allowable actions!"));
                } else {
                    f = createResult(FAILURE,
                            "Object allowable actions don't match the allowable actions returned by getAllowableActions()!");
                    addResult(
                            results,
                            assertEqualSet(object.getAllowableActions().getAllowableActions(),
                                    allowableActions.getAllowableActions(), null, f));
                }
            }

            // check ACL
            if (object.getAcl() != null && object.getAcl().getAces() != null) {
View Full Code Here

        return (result.getStatus().getLevel() <= OK.getLevel() ? null : result);
    }

    protected CmisTestResult assertAllowableAction(CmisObject object, Action action, CmisTestResult success,
            CmisTestResult failure) {
        AllowableActions allowableActions = object.getAllowableActions();
        if (allowableActions != null && allowableActions.getAllowableActions() != null) {
            if (allowableActions.getAllowableActions().contains(action)) {
                return success;
            }
        }

        return failure;
View Full Code Here

        return failure;
    }

    protected CmisTestResult assertNotAllowableAction(CmisObject object, Action action, CmisTestResult success,
            CmisTestResult failure) {
        AllowableActions allowableActions = object.getAllowableActions();
        if (allowableActions != null && allowableActions.getAllowableActions() != null) {
            if (!allowableActions.getAllowableActions().contains(action)) {
                return success;
            }
        }

        return failure;
View Full Code Here

    public static void getAllowableActions(CallContext context, CmisService service, String repositoryId,
            HttpServletRequest request, HttpServletResponse response) throws Exception {
        // get parameters
        String objectId = (String) context.get(CONTEXT_OBJECT_ID);

        AllowableActions allowableActions = service.getAllowableActions(repositoryId, objectId, null);

        JSONObject jsonAllowableActions = JSONConverter.convert(allowableActions);

        response.setStatus(HttpServletResponse.SC_OK);
        writeJSON(jsonAllowableActions, request, response);
View Full Code Here

            HttpServletRequest request, HttpServletResponse response) throws Exception {
        // get parameters
        String objectId = getStringParameter(request, Constants.PARAM_ID);

        // execute
        AllowableActions allowableActions = service.getAllowableActions(repositoryId, objectId, null);

        if (allowableActions == null) {
            throw new CmisRuntimeException("Allowable Actions is null!");
        }
View Full Code Here

    public boolean hasAllowableAction(Action action) {
        if (action == null) {
            throw new IllegalArgumentException("Action must be set!");
        }

        AllowableActions currentAllowableActions = getAllowableActions();
        if (currentAllowableActions == null || currentAllowableActions.getAllowableActions() == null) {
            throw new IllegalStateException("Allowable Actions are not available!");
        }

        return currentAllowableActions.getAllowableActions().contains(action);
    }
View Full Code Here

            HttpServletRequest request, HttpServletResponse response) throws Exception {
        // get parameters
        String objectId = getStringParameter(request, Constants.PARAM_ID);

        // execute
        AllowableActions allowableActions = service.getAllowableActions(repositoryId, objectId, null);

        if (allowableActions == null) {
            throw new CmisRuntimeException("Allowable Actions is null!");
        }
View Full Code Here

            ObjectInFolderDataImpl oifd = new ObjectInFolderDataImpl();
            ObjectDataImpl objectData = new ObjectDataImpl();
            if (includePathSegments != null && includePathSegments)
                oifd.setPathSegment(spo.getName());
            if (includeAllowableActions != null && includeAllowableActions) {
                AllowableActions allowableActions = DataObjectCreator.fillAllowableActions(spo, user);
                objectData.setAllowableActions(allowableActions);
            }
            if (includeRelationships != null && includeRelationships != IncludeRelationships.NONE) {
                objectData.setRelationships(null /* f.getRelationships() */);
            }
View Full Code Here

TOP

Related Classes of org.apache.chemistry.opencmis.commons.data.AllowableActions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.