Examples of UserRoles


Examples of org.intalio.tempo.workflow.auth.UserRoles

            Document domInput = null;
            if (omInputContainer.getFirstElement() != null) {
                domInput = new TaskUnmarshaller().unmarshalTaskOutput(omInputContainer);
            }
            final String participantToken = requireElementValue(rootQueue, "participantToken");
            final UserRoles ur = _server.getUserRoles(participantToken);
            final String user = ur.getUserID();           
            final String formUrl = expectElementValue(rootQueue, "formUrl");
            Document userProcessResponse = _server.initProcess(dao,taskID, user, formUrl, domInput, participantToken);
            if (userProcessResponse == null)
                throw new RuntimeException("TMP did not return a correct message while calling init");
            OMElement response = new TMSResponseMarshaller(OM_FACTORY) {
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

      try {
        dao=_taskDAOFactory.openConnection();
            OMElementQueue rootQueue = new OMElementQueue(requestElement);
            String taskID = requireElementValue(rootQueue, "pipaurl");
            String participantToken = requireElementValue(rootQueue, "participantToken");
            final UserRoles user = _server.getUserRoles(participantToken);
            Task task = _server.getPipa(dao,taskID, participantToken);
            OMElement response = new TMSResponseMarshaller(OM_FACTORY) {
                public OMElement marshalResponse(Task task) {
                    OMElement response = createElement("getPipaResponse");
                    response.addChild(new TaskMarshaller().marshalFullTask(task, user));
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

            HashMap map = new HashMap();
            map.put(TaskFetcher.FETCH_CLASS_NAME, taskType);
            map.put(TaskFetcher.FETCH_SUB_QUERY, subQuery);
            map.put(TaskFetcher.FETCH_FIRST, first);
            map.put(TaskFetcher.FETCH_MAX, max);
            final UserRoles user = _server.getUserRoles(participantToken);
            Task[] tasks = _server.getAvailableTasks(dao,participantToken, map);
            OMElement result = marshalTasksList(user, tasks, "getAvailableTasksResponse");
            return result;
        } catch (Exception e) {
          throw makeFault(e);
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

            String first = expectElementValue(rootQueue, "first");
            String max = expectElementValue(rootQueue, "max");
            HashMap map = new HashMap();
            map.put(TaskFetcher.FETCH_CLASS_NAME, taskType);
            map.put(TaskFetcher.FETCH_SUB_QUERY, subQuery);
            final UserRoles user = _server.getUserRoles(participantToken);
            final Long taskCount = _server.countAvailableTasks(dao,participantToken, map);
            return new TMSResponseMarshaller(OM_FACTORY) {
                public OMElement createOkResponse() {
                    OMElement response = createElement("countAvailableTasksResponse");
                    response.setText(Long.toString(taskCount));
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles


/*JIRA WF-1466 Changes have been made to get the dao in the method
instead of creating and opening connections in the method itself */
    public Task[] getTaskList(ITaskDAOConnection dao,String participantToken) throws AuthException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task[] result = dao.fetchAllAvailableTasks(credentials);
        return result;
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

        return _authProvider.authenticate(participantToken);
    }

    public Task getTask(ITaskDAOConnection dao,String taskID, String participantToken) throws AuthException, UnavailableTaskException,
            AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        
        Task task = dao.fetchTaskIfExists(taskID);
        if ((task != null)) {
            checkIsAvailable(taskID, task, credentials);
            if (_logger.isDebugEnabled())
                _logger.debug("Workflow Task " + taskID + " for user " + credentials.getUserID());
            return task;
        } else {
            throw new UnavailableTaskException("No task with" + taskID + " has been found");
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

            throw new AccessDeniedException(credentials.getUserID() + " cannot access task:" + taskID);
    }

    public void setOutput(ITaskDAOConnection dao,String taskID, Document output, String participantToken) throws AuthException,
            UnavailableTaskException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithOutput) {
            ITaskWithOutput taskWithOutput = (ITaskWithOutput) task;
            taskWithOutput.setOutput(output);
            dao.updateTask(task);
            dao.commit();
            if (_logger.isDebugEnabled())
                _logger.debug(credentials.getUserID() + " has set output for Workflow Task " + task);
        } else
            throw new UnavailableTaskException(credentials.getUserID() + " cannot set output for Workflow Task " + task);
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

            throw new UnavailableTaskException(credentials.getUserID() + " cannot set output for Workflow Task " + task);
    }

    public void complete(ITaskDAOConnection dao,String taskID, String participantToken) throws AuthException, UnavailableTaskException,
            InvalidTaskStateException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithState) {
            ITaskWithState taskWithState = (ITaskWithState) task;
            taskWithState.setState(TaskState.COMPLETED);
            dao.updateTask(task);
            dao.commit();
            if (_logger.isDebugEnabled())
                _logger.debug(credentials.getUserID() + " has completed the Workflow Task " + task);
        } else {
            throw new UnavailableTaskException(credentials.getUserID() + " cannot complete Workflow Task " + task);
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

        }
    }

    public void setOutputAndComplete(ITaskDAOConnection dao,String taskID, Document output, String participantToken) throws AuthException,
            UnavailableTaskException, InvalidTaskStateException, AccessDeniedException {
        UserRoles credentials = _authProvider.authenticate(participantToken);
        Task task = dao.fetchTaskIfExists(taskID);
        checkIsAvailable(taskID, task, credentials);
        if (task instanceof ITaskWithOutput && task instanceof ITaskWithState) {
            ((ITaskWithOutput) task).setOutput(output);
            ((ITaskWithState) task).setState(TaskState.COMPLETED);
            dao.updateTask(task);
            dao.commit();
            if (_logger.isDebugEnabled())
                _logger.debug(credentials.getUserID() + " has set output and completed Workflow Task " + task);
        } else {
            throw new UnavailableTaskException(credentials.getUserID()
                    + " cannot set output and complete Workflow Task " + task);
        }
    }
View Full Code Here

Examples of org.intalio.tempo.workflow.auth.UserRoles

        }
    }

    public void delete(ITaskDAOConnection dao,String[] taskIDs, String participantToken) throws AuthException, UnavailableTaskException {
        HashMap<String, Exception> problemTasks = new HashMap<String, Exception>();
        UserRoles credentials = _authProvider.authenticate(participantToken);

        String userID = credentials.getUserID();
        for (String taskID : taskIDs) {
            try {
                Task task = dao.fetchTaskIfExists(taskID);
                if (_permissions.isAuthorized(TaskPermissions.ACTION_DELETE, task, credentials)) {
                    dao.deleteTask(task.getInternalId(), taskID);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.