Package org.dspace.workflow

Examples of org.dspace.workflow.WorkflowItem


      String[] workflowIDs = request.getParameterValues("workflowID");
      if (workflowIDs != null)
      {
        for (String workflowID : workflowIDs)
        {
          WorkflowItem workflowItem = WorkflowItem.find(context, Integer.valueOf(workflowID));
         
          int state = workflowItem.getState();
          // Only unclaim tasks that are allready claimed.
          if ( state == WorkflowManager.WFSTATE_STEP1POOL ||
             state == WorkflowManager.WFSTATE_STEP2POOL ||
             state == WorkflowManager.WFSTATE_STEP3POOL)
          {
View Full Code Here


      String[] workflowIDs = request.getParameterValues("workflowID");
      if (workflowIDs != null)
      {
        for (String workflowID : workflowIDs)
        {
          WorkflowItem workflowItem = WorkflowItem.find(context, Integer.valueOf(workflowID));
          //workflowItem.get
         
          int state = workflowItem.getState();
          // only claim tasks that are in the pool.
          if ( state == WorkflowManager.WFSTATE_STEP1 ||
             state == WorkflowManager.WFSTATE_STEP2 ||
             state == WorkflowManager.WFSTATE_STEP3 )
          {
                    log.info(LogManager.getHeader(context, "unclaim_workflow", "workflow_id=" + workflowItem.getID()));
            WorkflowManager.unclaim(context, workflowItem, context.getCurrentUser());
          }
        }
        context.commit();
      }
View Full Code Here

                {
                    String handle = null;

                    // Check if workflow completes immediately, and
                    // return Handle if so.
                    WorkflowItem wfi = WorkflowManager.startWithoutNotify(context, wi);

                    if (wfi.getState() == WorkflowManager.WFSTATE_ARCHIVE)
                    {
                        Item ni = wfi.getItem();
                        handle = HandleManager.findHandle(context, ni);
                    }
                    if (handle == null)
                    System.out.println("Created Workflow item, ID="
                                + String.valueOf(wfi.getID()));
                    else
                        System.out.println("Created and installed item, handle="+handle);
                }
                else
                {
View Full Code Here

    }

    public void accept(EntityReference ref, Map<String, Object> inputVar, Context context) {
        try {
            Integer id = Integer.parseInt(ref.getId());
            WorkflowItem workflowItem = WorkflowItem.find(context, id);
            WorkflowManager.claim(context, workflowItem, context.getCurrentUser());
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
        } catch (AuthorizeException ae) {
            throw new EntityException("Forbidden", "Forbidden", 403);
View Full Code Here

    }

    public void returnToPool(EntityReference ref, Map<String, Object> inputVar, Context context) {
        try {
            Integer id = Integer.parseInt(ref.getId());
            WorkflowItem workflowItem = WorkflowItem.find(context, id);
            WorkflowManager.unclaim(context, workflowItem, context.getCurrentUser());
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
        } catch (AuthorizeException ae) {
            throw new EntityException("Forbidden", "Forbidden", 403);
View Full Code Here

    }

    public void approve(EntityReference ref, Map<String, Object> inputVar, Context context) {
        try {
            Integer id = Integer.parseInt(ref.getId());
            WorkflowItem workflowItem = WorkflowItem.find(context, id);
            WorkflowManager.advance(context, workflowItem, context.getCurrentUser());
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
        } catch (AuthorizeException ae) {
            throw new EntityException("Forbidden", "Forbidden", 403);
View Full Code Here

    public void reject(EntityReference ref, Map<String, Object> inputVar, Context context) {
        try {
            Integer id = Integer.parseInt(ref.getId());
            String reason = (String) inputVar.get("reason");
            WorkflowItem workflowItem = WorkflowItem.find(context, id);
            WorkflowManager.reject(context, workflowItem, context.getCurrentUser(), reason);
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
        } catch (AuthorizeException ae) {
            throw new EntityException("Forbidden", "Forbidden", 403);
View Full Code Here

        try {
            // make a list of workflow items
            while (tri.hasNext()) {
                TableRow row = tri.next();
                WorkflowItem wi = WorkflowItem.find(c, row.getIntColumn("workflow_id"));
                wfItems.add(wi);
            }
        } finally {
            if (tri != null) {
                tri.close();
View Full Code Here

        Context context = null;
        try {
            context = new Context();
            refreshParams(context);

            WorkflowItem comm = WorkflowItem.find(context, Integer.parseInt(id));
            return comm != null ? true : false;
        } catch (SQLException ex) {
            throw new EntityException("Internal server error", "SQL error", 500);
        } finally {
            removeConn(context);
View Full Code Here

        {
            workspaceItem = null;
        }

        // Get workflow item specified, if any
        WorkflowItem workflowItem;

        try
        {
            int wfID = Integer.parseInt(request.getParameter("workflow_id"));
            workflowItem = WorkflowItem.find(context, wfID);
        }
        catch (NumberFormatException nfe)
        {
            workflowItem = null;
        }

        // Respond to button press
        boolean ok = false;

        if (buttonPressed.equals("submit_new"))
        {
            // New submission: Redirect to submit
            response.sendRedirect(response.encodeRedirectURL(request
                    .getContextPath()
                    + "/submit"));
            ok = true;
        }
        else if (buttonPressed.equals("submit_own"))
        {
            // Review own submissions
            showPreviousSubmissions(context, request, response);
            ok = true;
        }
        else if (buttonPressed.equals("submit_resume"))
        {
            // User clicked on a "Resume" button for a workspace item.
            String wsID = request.getParameter("workspace_id");
            response.sendRedirect(response.encodeRedirectURL(request
                    .getContextPath()
                    + "/submit?resume=" + wsID));
            ok = true;
        }
        else if (buttonPressed.equals("submit_delete"))
        {
            // User clicked on a "Remove" button for a workspace item
            if (workspaceItem != null)
            {
                log.info(LogManager.getHeader(context, "confirm_removal",
                        "workspace_item_id=" + workspaceItem.getID()));

                request.setAttribute("workspace.item", workspaceItem);
                JSPManager.showJSP(request, response,
                        "/mydspace/remove-item.jsp");
            }
            else
            {
                log.warn(LogManager.getHeader(context, "integrity_error",
                        UIUtil.getRequestLogInfo(request)));
                JSPManager.showIntegrityError(request, response);
            }

            ok = true;
        }
        else if (buttonPressed.equals("submit_claim"))
        {
            // User clicked "take task" button on workflow task
            if (workflowItem != null)
            {
                log.info(LogManager.getHeader(context, "view_workflow",
                        "workflow_id=" + workflowItem.getID()));

                request.setAttribute("workflow.item", workflowItem);
                JSPManager.showJSP(request, response,
                        "/mydspace/preview-task.jsp");
                ok = true;
            }
        }
        else if (buttonPressed.equals("submit_perform"))
        {
            // User clicked "Do This Task" button on workflow task
            if (workflowItem != null)
            {
                log.info(LogManager.getHeader(context, "view_workflow",
                        "workflow_id=" + workflowItem.getID()));

                request.setAttribute("workflow.item", workflowItem);
                JSPManager.showJSP(request, response,
                        "/mydspace/perform-task.jsp");
                ok = true;
            }
        }
        else if (buttonPressed.equals("submit_return"))
        {
            // User clicked "Return to pool" button on workflow task
            if (workflowItem != null)
            {
                log.info(LogManager.getHeader(context, "unclaim_workflow",
                        "workflow_id=" + workflowItem.getID()));

                WorkflowManager.unclaim(context, workflowItem, context
                        .getCurrentUser());

                showMainPage(context, request, response);
View Full Code Here

TOP

Related Classes of org.dspace.workflow.WorkflowItem

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.