Package org.dspace.workflow

Examples of org.dspace.workflow.WorkflowItem


                log.debug("put: Using CountedInputStream, length="
                        + String.valueOf(contentLength));
            }
            WorkspaceItem wi = sip.ingest(this.context, this.collection, pis,
                    PackageParameters.create(this.request), null);
            WorkflowItem wfi = WorkflowManager.startWithoutNotify(this.context, wi);

            // get new item's location: if workflow completed, then look
            // for handle (but be ready for disappointment); otherwise,
            // return the workflow item's resource.
            int state = wfi.getState();
            String location = null;
            if (state == WorkflowManager.WFSTATE_ARCHIVE)
            {
                Item ni = wfi.getItem();
                String handle = HandleManager.findHandle(this.context, ni);
                String end = (handle != null) ? DAVDSpaceObject
                        .getPathElt(handle) : DAVItem.getPathElt(ni);
                DAVItem newItem = new DAVItem(this.context, this.request, this.response,
                        makeChildPath(end), ni);
View Full Code Here


                DAVResource result[] = new DAVResource[wi.size()];
                ListIterator wii = wi.listIterator();
                int i = 0;
                while (wii.hasNext())
                {
                    WorkflowItem wfi = (WorkflowItem) wii.next();
                    result[i++] = new DAVWorkflowItem(this.context, this.request,
                            this.response, makeChildPath(DAVWorkflowItem
                                    .getPathElt(wfi.getID())), wfi);
                }
                return result;
            }
        }
        return new DAVResource[0];
View Full Code Here

                DAVResource result[] = new DAVResource[wi.size()];
                ListIterator wii = wi.listIterator();
                int i = 0;
                while (wii.hasNext())
                {
                    WorkflowItem wfi = (WorkflowItem) wii.next();
                    result[i++] = new DAVWorkflowItem(this.context, this.request,
                            this.response, makeChildPath(DAVWorkflowItem
                                    .getPathElt(wfi.getID())), wfi);
                }
                return result;
            }
        }
        return new DAVResource[0];
View Full Code Here

            //schedule temp file for deletion
            tempFile.deleteOnExit();

            //get the new workflowitem (if it exists)
            WorkflowItem wfi = WorkflowItem.findByItem(context, item);

            //Get status of item
            //  if we found a WorkflowItem, then it is still in-process
            //  if we didn't find one, item is already in archive
            int state;
            if(wfi!=null)
            {
                state = wfi.getState();
            }
            else
            {
                state = WorkflowManager.WFSTATE_ARCHIVE;
            }
View Full Code Here

     * @throws IOException
     * @throws SQLException
     */
    public static boolean curate(Curator curator, Context c, String wfId)
            throws AuthorizeException, IOException, SQLException {
        WorkflowItem wfi = WorkflowItem.find(c, Integer.parseInt(wfId));
        if (wfi != null) {
            if (curate(curator, c, wfi)) {
                WorkflowManager.advance(c, wfi, c.getCurrentUser(), false, true);
                return true;
            }
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

      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 already claimed.
          if ( state == WorkflowManager.WFSTATE_STEP1POOL ||
             state == WorkflowManager.WFSTATE_STEP2POOL ||
             state == WorkflowManager.WFSTATE_STEP3POOL)
          {
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);
        if(workflowItem.getState() != WorkflowManager.WFSTATE_STEP1POOL &&
                workflowItem.getState() != WorkflowManager.WFSTATE_STEP2POOL &&
                workflowItem.getState() != WorkflowManager.WFSTATE_STEP3POOL){
            // Only allow tasks in the pool to be claimed !
            throw new AuthorizeException("Error while claiming task: this task has already been claimed !");
        }

       // 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

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.