org.dspace.workflow
Class WorkflowItem

java.lang.Object
  extended by org.dspace.workflow.WorkflowItem
All Implemented Interfaces:
InProgressSubmission

public class WorkflowItem
extends Object
implements InProgressSubmission

Class representing an item going through the workflow process in DSpace

Version:
$Revision: 3738 $
Author:
Robert Tansley

Method Summary
 void deleteWrapper()
          delete the WorkflowItem, retaining the Item
static WorkflowItem find(Context context, int id)
          Get a workflow item from the database.
static WorkflowItem[] findAll(Context c)
          return all workflowitems
static WorkflowItem[] findByCollection(Context context, Collection c)
          Get all workflow items for a particular collection.
static WorkflowItem[] findByEPerson(Context context, EPerson ep)
          Get all workflow items that were original submissions by a particular e-person.
 Collection getCollection()
          Get the collection being submitted to
 int getID()
          Get the internal ID of this workflow item
 Item getItem()
          Get the incomplete item object
 EPerson getOwner()
          get owner of WorkflowItem
 int getState()
          Get state of WorkflowItem
 EPerson getSubmitter()
          Get the submitter
 boolean hasMultipleFiles()
          Find out if the submission has (or is intended to have) more than one associated bitstream.
 boolean hasMultipleTitles()
          Find out if the submission has (or is intended to have) more than one title.
 boolean isPublishedBefore()
          Find out if the submission has been published or publicly distributed before
 void setMultipleFiles(boolean b)
          Indicate whether the submission is intended to have more than one file.
 void setMultipleTitles(boolean b)
          Indicate whether the submission is intended to have more than one title.
 void setOwner(EPerson ep)
          set owner of WorkflowItem
 void setPublishedBefore(boolean b)
          Indicate whether the submission has been published or publicly distributed before
 void setState(int newstate)
          Set state of WorkflowItem
 void update()
          Update the workflow item, including the unarchived item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

find

public static WorkflowItem find(Context context,
                                int id)
                         throws SQLException
Get a workflow item from the database. The item, collection and submitter are loaded into memory.

Parameters:
context - DSpace context object
id - ID of the workspace item
Returns:
the workflow item, or null if the ID is invalid.
Throws:
SQLException

findAll

public static WorkflowItem[] findAll(Context c)
                              throws SQLException
return all workflowitems

Parameters:
c - active context
Returns:
WorkflowItem [] of all workflows in system
Throws:
SQLException

findByEPerson

public static WorkflowItem[] findByEPerson(Context context,
                                           EPerson ep)
                                    throws SQLException
Get all workflow items that were original submissions by a particular e-person. These are ordered by workflow ID, since this should likely keep them in the order in which they were created.

Parameters:
context - the context object
ep - the eperson
Returns:
the corresponding workflow items
Throws:
SQLException

findByCollection

public static WorkflowItem[] findByCollection(Context context,
                                              Collection c)
                                       throws SQLException
Get all workflow items for a particular collection.

Parameters:
context - the context object
c - the collection
Returns:
array of the corresponding workflow items
Throws:
SQLException

getID

public int getID()
Get the internal ID of this workflow item

Specified by:
getID in interface InProgressSubmission
Returns:
the internal identifier

getOwner

public EPerson getOwner()
get owner of WorkflowItem

Returns:
EPerson owner

setOwner

public void setOwner(EPerson ep)
set owner of WorkflowItem

Parameters:
ep - owner

getState

public int getState()
Get state of WorkflowItem

Returns:
state

setState

public void setState(int newstate)
Set state of WorkflowItem

Parameters:
newstate - new state (from WorkflowManager)

update

public void update()
            throws SQLException,
                   IOException,
                   AuthorizeException
Update the workflow item, including the unarchived item.

Specified by:
update in interface InProgressSubmission
Throws:
SQLException
IOException
AuthorizeException

deleteWrapper

public void deleteWrapper()
                   throws SQLException,
                          IOException,
                          AuthorizeException
delete the WorkflowItem, retaining the Item

Specified by:
deleteWrapper in interface InProgressSubmission
Throws:
SQLException
IOException
AuthorizeException

getItem

public Item getItem()
Description copied from interface: InProgressSubmission
Get the incomplete item object

Specified by:
getItem in interface InProgressSubmission
Returns:
the item

getCollection

public Collection getCollection()
Description copied from interface: InProgressSubmission
Get the collection being submitted to

Specified by:
getCollection in interface InProgressSubmission
Returns:
the collection

getSubmitter

public EPerson getSubmitter()
                     throws SQLException
Description copied from interface: InProgressSubmission
Get the submitter

Specified by:
getSubmitter in interface InProgressSubmission
Returns:
the submitting e-person
Throws:
SQLException

hasMultipleFiles

public boolean hasMultipleFiles()
Description copied from interface: InProgressSubmission
Find out if the submission has (or is intended to have) more than one associated bitstream.

Specified by:
hasMultipleFiles in interface InProgressSubmission
Returns:
true if there is to be more than one file.

setMultipleFiles

public void setMultipleFiles(boolean b)
Description copied from interface: InProgressSubmission
Indicate whether the submission is intended to have more than one file.

Specified by:
setMultipleFiles in interface InProgressSubmission
Parameters:
b - if true, submission may have more than one file.

hasMultipleTitles

public boolean hasMultipleTitles()
Description copied from interface: InProgressSubmission
Find out if the submission has (or is intended to have) more than one title.

Specified by:
hasMultipleTitles in interface InProgressSubmission
Returns:
true if there is to be more than one file.

setMultipleTitles

public void setMultipleTitles(boolean b)
Description copied from interface: InProgressSubmission
Indicate whether the submission is intended to have more than one title.

Specified by:
setMultipleTitles in interface InProgressSubmission
Parameters:
b - if true, submission may have more than one title.

isPublishedBefore

public boolean isPublishedBefore()
Description copied from interface: InProgressSubmission
Find out if the submission has been published or publicly distributed before

Specified by:
isPublishedBefore in interface InProgressSubmission
Returns:
true if it has been published before

setPublishedBefore

public void setPublishedBefore(boolean b)
Description copied from interface: InProgressSubmission
Indicate whether the submission has been published or publicly distributed before

Specified by:
setPublishedBefore in interface InProgressSubmission
Parameters:
b - true if it has been published before


Copyright © 2010 DuraSpace. All Rights Reserved.