Package org.dspace.content

Examples of org.dspace.content.WorkspaceItem


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

        // Get workspace item, if any
        WorkspaceItem workspaceItem;

        try
        {
            int wsID = Integer.parseInt(request.getParameter("workspace_id"));
            workspaceItem = WorkspaceItem.find(context, wsID);
        }
        catch (NumberFormatException nfe)
        {
            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");
            }
View Full Code Here


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

        // Get workspace item
        WorkspaceItem workspaceItem;

        try
        {
            int wsID = Integer.parseInt(request.getParameter("workspace_id"));
            workspaceItem = WorkspaceItem.find(context, wsID);
        }
        catch (NumberFormatException nfe)
        {
            workspaceItem = null;
        }

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

            return;
        }

        // We have a workspace item
        if (buttonPressed.equals("submit_delete"))
        {
            // User has clicked on "delete"
            log.info(LogManager.getHeader(context, "remove_submission",
                    "workspace_item_id=" + workspaceItem.getID() + ",item_id="
                            + workspaceItem.getItem().getID()));
            workspaceItem.deleteAll();
            showMainPage(context, request, response);
            context.complete();
        }
        else
        {
View Full Code Here

        if (buttonPressed.equals("submit_send"))
        {
            String reason = request.getParameter("reason");

            WorkspaceItem wsi = WorkflowManager.reject(context, workflowItem,
                    context.getCurrentUser(), reason);

            // Load the Submission Process for the collection this WSI is
            // associated with
            Collection c = wsi.getCollection();
            SubmissionConfigReader subConfigReader = new SubmissionConfigReader();
            SubmissionConfig subConfig = subConfigReader.getSubmissionConfig(c
                    .getHandle(), false);

            // Set the "stage_reached" column on the workspace item
            // to the LAST page of the LAST step in the submission process
            // (i.e. the page just before "Complete")
            int lastStep = subConfig.getNumberOfSteps() - 2;
            wsi.setStageReached(lastStep);
            wsi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED);
            wsi.update();

            JSPManager
                    .showJSP(request, response, "/mydspace/task-complete.jsp");
            context.complete();
        }
View Full Code Here

     
      // We don't need to include any parameters
      PackageParameters params = new PackageParameters();
     
      // ingest the item
      WorkspaceItem wsi = pi.ingest(context, collection, is, params, licence);
      if (wsi == null)
      {
        swordService.message("Failed to ingest the package; throwing exception");
        throw new SWORDErrorException(DSpaceSWORDErrorCodes.UNPACKAGE_FAIL, "METS package ingester failed to unpack package");
      }
View Full Code Here

    {
        // get the value from the request
        int wsItemID = UIUtil.getIntParameter(request,"workspace_id");
       
        // get the workspace item, item and collections from the request value
        WorkspaceItem wsItem = WorkspaceItem.find(c, wsItemID);
        Item item = wsItem.getItem();
        //Collection[] collections = item.getCollections();
        Collection[] collections = {wsItem.getCollection()};
       
        // Ensure the user has authorisation
        AuthorizeManager.authorizeAction(c, item, Constants.READ);
       
        log.info(LogManager.getHeader(c,
            "View Workspace Item Metadata",
            "workspace_item_id="+wsItemID));
       
        // Full or simple display?
        boolean displayAll = false;
        String button = UIUtil.getSubmitButton(request, "submit_simple");
        if (button.equalsIgnoreCase("submit_full"))
        {
            displayAll = true;
        }
       
        // FIXME: we need to synchronise with the handle servlet to use the
        // display item JSP for both handled and un-handled items
        // Set attributes and display
        // request.setAttribute("wsItem", wsItem);
        request.setAttribute("display.all", new Boolean(displayAll));
        request.setAttribute("item", item);
        request.setAttribute("collections", collections);
        request.setAttribute("workspace_id", new Integer(wsItem.getID()));
       
        JSPManager.showJSP(request, response, "/display-item.jsp");
    }
View Full Code Here

    {
        InProgressSubmission submission = findSubmission(context, id);
   
    if (submission instanceof WorkspaceItem)
    {
      WorkspaceItem workspaceItem = (WorkspaceItem) submission;
     
      if (step > workspaceItem.getStageReached())
      {
        workspaceItem.setStageReached(step);
        workspaceItem.setPageReached(1)//reset page to first page in new step
        workspaceItem.update();
        context.commit();
      }
      else if ((step == workspaceItem.getStageReached()) &&
           (page > workspaceItem.getPageReached()))
      {
        workspaceItem.setPageReached(page);
        workspaceItem.update();
        context.commit();
      }
    }
    }
View Full Code Here

    {
        InProgressSubmission submission = findSubmission(context, id);

        if (submission instanceof WorkspaceItem)
        {
            WorkspaceItem workspaceItem = (WorkspaceItem) submission;

            workspaceItem.setStageReached(step);
            workspaceItem.setPageReached(page > 0 ? page : 1);
            workspaceItem.update();
            context.commit();
        }
    }
View Full Code Here

   
    InProgressSubmission submission = findSubmission(context, id);
   
    if (submission instanceof WorkspaceItem)
    {
      WorkspaceItem workspaceItem = (WorkspaceItem) submission;
      int stage = workspaceItem.getStageReached();
      if (stage < 0)
        stage = 0;
      return stage;
    }
   
View Full Code Here

   
    InProgressSubmission submission = findSubmission(context, id);
   
    if (submission instanceof WorkspaceItem)
    {
      WorkspaceItem workspaceItem = (WorkspaceItem) submission;
      int page = workspaceItem.getPageReached();
      if (page < 0)
        page = 0;
      return page;
    }
   
View Full Code Here

  public static void processSaveOrRemove(Context context, String id, Request request) throws SQLException, AuthorizeException, IOException
  {
    if (request.getParameter("submit_remove") != null)
    {
      // If they selected to remove the item then delete everything.
      WorkspaceItem workspace = findWorkspace(context,id);
      workspace.deleteAll();
          context.commit();
    }
  }
View Full Code Here

TOP

Related Classes of org.dspace.content.WorkspaceItem

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.