Package org.dspace.workflow

Examples of org.dspace.workflow.WorkflowItem


            AuthorizeException
    {
        String buttonPressed = UIUtil.getSubmitButton(request, "submit_cancel");

        // Get workflow item
        WorkflowItem workflowItem;

        try
        {
            int wfID = Integer.parseInt(request.getParameter("workflow_id"));
            workflowItem = WorkflowItem.find(context, wfID);
View Full Code Here


            AuthorizeException
    {
        String buttonPressed = UIUtil.getSubmitButton(request, "submit_cancel");

        // Get workflow item
        WorkflowItem workflowItem;

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

        if (workflowItem == null)
        {
            log.warn(LogManager.getHeader(context, "integrity_error", UIUtil
                    .getRequestLogInfo(request)));
            JSPManager.showIntegrityError(request, response);

            return;
        }

        if (buttonPressed.equals("submit_approve"))
        {
            Item item = workflowItem.getItem();

            // Advance the item along the workflow
            WorkflowManager.advance(context, workflowItem, context
                    .getCurrentUser());

            // FIXME: This should be a return value from advance()
            // See if that gave the item a Handle. If it did,
            // the item made it into the archive, so we
            // should display a suitable page.
            String handle = HandleManager.findHandle(context, item);

            if (handle != null)
            {
                String displayHandle = HandleManager.getCanonicalForm(handle);

                request.setAttribute("handle", displayHandle);
                JSPManager.showJSP(request, response,
                        "/mydspace/in-archive.jsp");
            }
            else
            {
                JSPManager.showJSP(request, response,
                        "/mydspace/task-complete.jsp");
            }

            context.complete();
        }
        else if (buttonPressed.equals("submit_reject"))
        {
            // Submission rejected. Ask the user for a reason
            log.info(LogManager.getHeader(context, "get_reject_reason",
                    "workflow_id=" + workflowItem.getID() + ",item_id="
                            + workflowItem.getItem().getID()));

            request.setAttribute("workflow.item", workflowItem);
            JSPManager
                    .showJSP(request, response, "/mydspace/reject-reason.jsp");
        }
        else if (buttonPressed.equals("submit_edit"))
        {
            // FIXME: Check auth
            log.info(LogManager.getHeader(context, "edit_workflow_item",
                    "workflow_id=" + workflowItem.getID() + ",item_id="
                            + workflowItem.getItem().getID()));

            // Forward control to the submission interface
            // with the relevant item
            response.sendRedirect(response.encodeRedirectURL(request
                    .getContextPath()
                    + "/submit?workflow=" + workflowItem.getID()));
        }
        else if (buttonPressed.equals("submit_pool"))
        {
            // Return task to pool
            WorkflowManager.unclaim(context, workflowItem, context
View Full Code Here

            AuthorizeException
    {
        String buttonPressed = UIUtil.getSubmitButton(request, "submit_cancel");

        // Get workflow item
        WorkflowItem workflowItem;

        try
        {
            int wfID = Integer.parseInt(request.getParameter("workflow_id"));
            workflowItem = WorkflowItem.find(context, wfID);
View Full Code Here

        swordService.message("Failed to ingest the package; throwing exception");
        throw new SWORDErrorException(DSpaceSWORDErrorCodes.UNPACKAGE_FAIL, "METS package ingester failed to unpack package");
      }
     
      // now we can inject the newly constructed item into the workflow
      WorkflowItem wfi = WorkflowManager.startWithoutNotify(context, wsi);
      swordService.message("Workflow process started");
     
      // pull the item out so that we can report on it
      Item installedItem = wfi.getItem();
     
      // update the item metadata to inclue the current time as
      // the updated date
      this.setUpdatedDate(installedItem);
     
View Full Code Here

        String button = UIUtil.getSubmitButton(request, "submit");

        if (button.equals("submit_abort"))
        {
            // bring up the confirm page
            WorkflowItem wi = WorkflowItem.find(c, UIUtil.getIntParameter(
                    request, "workflow_id"));

            request.setAttribute("workflow", wi);
            JSPManager.showJSP(request, response,
                    "/dspace-admin/workflow-abort-confirm.jsp");
        }
        else if (button.equals("submit_abort_confirm"))
        {
            // do the actual abort
            WorkflowItem wi = WorkflowItem.find(c, UIUtil.getIntParameter(
                    request, "workflow_id"));

            WorkflowManager.abort(c, wi, c.getCurrentUser());

            // now show what's left
View Full Code Here

   * @param context The current DSpace content
   * @param id The unique ID of the current workflow
   */
  public static boolean processApproveTask(Context context, String id) throws SQLException, UIException, ServletException, AuthorizeException, IOException
  {
    WorkflowItem workflowItem = findWorkflow(context, id);
    Item item = workflowItem.getItem();
   
    // Advance the item along the workflow
        WorkflowManager.advance(context, workflowItem, context.getCurrentUser());

        // FIXME: This should be a return value from advance()
View Full Code Here

   * @param context The current DSpace content
   * @param id The unique ID of the current workflow
   */
  public static void processUnclaimTask(Context context, String id) throws SQLException, UIException, ServletException, AuthorizeException, IOException
  {
    WorkflowItem workflowItem = findWorkflow(context, id);
   
        // Return task to pool
        WorkflowManager.unclaim(context, workflowItem, context.getCurrentUser());
       
        context.commit();
       
        //Log this unclaim action
        log.info(LogManager.getHeader(context, "unclaim_workflow",
                "workflow_item_id=" + workflowItem.getID() + ",item_id="
                        + workflowItem.getItem().getID() + ",collection_id="
                        + workflowItem.getCollection().getID()
                        + ",new_state=" + workflowItem.getState()));
  }
View Full Code Here

   * @param context The current DSpace content
   * @param id The unique ID of the current workflow
   */
  public static void processClaimTask(Context context, String id) throws SQLException, UIException, ServletException, AuthorizeException, IOException
  {
    WorkflowItem workflowItem = findWorkflow(context, id);
   
       // Claim the task
       WorkflowManager.claim(context, workflowItem, context.getCurrentUser());
      
       context.commit();
      
       //log this claim information
       log.info(LogManager.getHeader(context, "claim_task", "workflow_item_id="
                   + workflowItem.getID() + "item_id=" + workflowItem.getItem().getID()
                   + "collection_id=" + workflowItem.getCollection().getID()
                   + "newowner_id=" + workflowItem.getOwner().getID()
                   + "new_state=" + workflowItem.getState()));
  }
View Full Code Here

   * @param id The unique ID of the current workflow
     * @param request The current request object
   */
  public static String processRejectTask(Context context, String id,Request request) throws SQLException, UIException, ServletException, AuthorizeException, IOException
  {
    WorkflowItem workflowItem = findWorkflow(context, id);
   
    String reason = request.getParameter("reason");

    if (reason != null && reason.length() > 1)
    {
View Full Code Here

        else if (workflowID != null) // if resuming a workflow item
        {
            try
            {
                // load the workflow item
                WorkflowItem wi = WorkflowItem.find(context, Integer
                        .parseInt(workflowID));

                //load submission information
                SubmissionInfo si = SubmissionInfo.load(request, wi);
               
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.