Package org.dspace.content

Examples of org.dspace.content.WorkspaceItem


                return dso;

            case Constants.ITEM:
                //Initialize a WorkspaceItem
                //(Note: Handle is not set until item is finished)
                WorkspaceItem wsi = WorkspaceItem.create(context, (Collection)parent, params.useCollectionTemplate());

                // Please note that we are returning an Item which is *NOT* yet in the Archive,
                // and doesn't yet have a handle assigned.
                // This Item will remain "incomplete" until 'PackageUtils.finishCreateItem()' is called
                return wsi.getItem();
               
            case Constants.SITE:
                return Site.find(context, Site.SITE_ID);
        }

View Full Code Here


        {
            Item item = (Item) dso;

            //Check if this item is still in a user's workspace.
            //It should be, as we haven't completed its install yet.
            WorkspaceItem wsi = WorkspaceItem.findByItem(context, item);

            // Get collection this item is being submitted to
            Collection collection = item.getOwningCollection();
            if (collection == null)
            {
                // Get the collection this workspace item belongs to
                if (wsi != null)
                {
                    collection = wsi.getCollection();
                }
            }

            // save manifest as a bitstream in Item if desired
            if (preserveManifest())
View Full Code Here

            {
                VersioningService versioningService = new DSpace()
                        .getSingletonService(VersioningService.class);
                Version version = versioningService.createNewVersion(context,
                        itemID, summary);
                WorkspaceItem wsi = WorkspaceItem.findByItem(context,
                        version.getItem());

                context.commit();

                return wsi.getID();

            }
        }
        catch (Exception ex)
        {
View Full Code Here

     * @throws SQLException
     */
    public static boolean isItemInSubmission(Context context, Item item)
            throws SQLException
    {
        WorkspaceItem workspaceItem = WorkspaceItem.findByItem(context, item);
        InProgressSubmission workflowItem = WorkflowItem.findByItem(context,
                item);

        return workspaceItem != null || workflowItem != null;
    }
View Full Code Here

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

            return i;
        }
    }
View Full Code Here

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

            if (page > wi.getPageReached())
            {
                wi.setPageReached(page);
                wi.update();
            }
        }
    }
View Full Code Here

      // first figure out if there's anything we need to do about the workflow/workspace state
      WorkflowTools wft = new WorkflowTools();
      if (wft.isItemInWorkspace(swordContext.getContext(), item))
      {
        WorkspaceItem wsi = wft.getWorkspaceItem(context, item);
        wsi.deleteAll();
      }
      else if (wft.isItemInWorkflow(context, item))
      {
        InProgressSubmission wfi = wft.getWorkflowItem(context, item);
        wfi.deleteWrapper();
View Full Code Here

        if (workspaceID != null)
        {
            try
            {
                // load the workspace item
                WorkspaceItem wi = WorkspaceItem.find(context, Integer
                        .parseInt(workspaceID));

                //load submission information
                SubmissionInfo si = SubmissionInfo.load(request, wi);
               
                //TD: Special case - If a user is resuming a submission
                //where the submission process now has less steps, then
                //we will need to reset the stepReached in the database
                //(Hopefully this will never happen, but just in case!)
                if(getStepReached(si) >= si.getSubmissionConfig().getNumberOfSteps())
                {
                    //update Stage Reached to the last step in the Process
                    int lastStep = si.getSubmissionConfig().getNumberOfSteps()-1;
                    wi.setStageReached(lastStep);
                   
                    //flag that user is on last page of last step
                    wi.setPageReached(AbstractProcessingStep.LAST_PAGE_REACHED);
                   
                    //commit all changes to database immediately
                    wi.update();
                    context.commit();
                   
                    //update submission info
                    si.setSubmissionItem(wi);
                }
View Full Code Here

        }
        else if (buttonPressed.equals("submit_remove"))
        {
            // User wants to cancel and remove
            // Cancellation page only applies to workspace items
            WorkspaceItem wi = (WorkspaceItem) subInfo.getSubmissionItem();

            wi.deleteAll();

            JSPManager.showJSP(request, response,
                    "/submit/cancelled-removed.jsp");

            context.complete();
View Full Code Here

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

            if (step > wi.getStageReached())
            {
                wi.setStageReached(step);
                wi.setPageReached(1); // reset page reached back to 1 (since
                                        // it's page 1 of the new step)
                wi.update();
            }
        }
    }
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.