Package org.dspace.content

Examples of org.dspace.content.WorkspaceItem


    private void setReachedStepAndPage(SubmissionInfo subInfo, int step,
            int page) throws SQLException, AuthorizeException, IOException
    {
        if (!subInfo.isInWorkflow() && subInfo.getSubmissionItem() != null)
        {
            WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem();

            wi.setStageReached(step);
            wi.setPageReached(page);
            wi.update();
        }
    }
View Full Code Here


        {
            return -1;
        }
        else
        {
            WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem();
            int i = wi.getStageReached();

            // Uninitialised workspace items give "-1" as the stage reached
            // this is a special value used by the progress bar, so we change
            // it to "FIRST_STEP"
            if (i == -1)
View Full Code Here

    {
        try
    {
      // decide whether we have a new item or an existing one
            Item item = null;
            WorkspaceItem wsi = null;
            if (result != null)
            {
                item = result.getItem();
            }
            else
            {
                result = new DepositResult();
            }
            if (item == null)
            {
                // simple zip ingester uses the item template, since there is no native metadata
                wsi = WorkspaceItem.create(context, collection, true);
                item = wsi.getItem();
            }

            // add the metadata to the item
      this.addMetadataToItem(deposit, item);
View Full Code Here

        for (Record rec : recordSet.getRecords())
        {
            try
            {
                WorkspaceItem wi = WorkspaceItem.create(context, collection,
                        true);
                merge(formName, wi.getItem(), rec);

                witems.add(wi);

            }
            catch (AuthorizeException e)
View Full Code Here

     */
    public StepAndPage getMaxStepAndPageReached() throws SQLException {

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

            int step = workspaceItem.getStageReached();
            if(step<0)
            {
                step = 0;
            }
           
            int page = workspaceItem.getPageReached();
            if (page < 0)
            {
                page = 0;
            }

View Full Code Here

    String reason = request.getParameter("reason");

    if (reason != null && reason.length() > 1)
    {
            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", which is at NumSteps-1)
            int lastStep = subConfig.getNumberOfSteps()-2;
            wsi.setStageReached(lastStep);
            wsi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED);
            wsi.update();

            context.commit();

            // Submission rejected.  Log this information
            log.info(LogManager.getHeader(context, "reject_workflow", "workflow_item_id="
                    + wsi.getID() + "item_id=" + wsi.getItem().getID()
                    + "collection_id=" + wsi.getCollection().getID()
                    + "eperson_id=" + context.getCurrentUser().getID()));

      // Return no errors.
      return null;
    }
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

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.