org.dspace.xmlworkflow.storedcomponents
Class XmlWorkflowItem

java.lang.Object
  extended by org.dspace.xmlworkflow.storedcomponents.XmlWorkflowItem
All Implemented Interfaces:
InProgressSubmission

public class XmlWorkflowItem
extends Object
implements InProgressSubmission

Class representing an item going through the workflow process in DSpace

Author:
Bram De Schouwer (bram.deschouwer at dot com), Kevin Van de Velde (kevin at atmire dot com), Ben Bosman (ben at atmire dot com), Mark Diggory (markd at atmire dot com)

Method Summary
static int countAll(Context c)
          return all workflowitems
static int countAllInCollection(Context c, int collId)
          return all workflowitems
static XmlWorkflowItem create(Context context)
           
 void deleteWrapper()
          delete the WorkflowItem, retaining the Item
static XmlWorkflowItem find(Context context, int id)
          Get a workflow item from the database.
static XmlWorkflowItem[] findAll(Context c)
          return all workflowitems
static XmlWorkflowItem[] findAll(Context c, int page, int pagesize)
          return all workflowitems for a certain page
static XmlWorkflowItem[] findAllInCollection(Context c, int page, int pagesize, int collectionId)
          return all workflowitems for a certain page with a certain collection
static XmlWorkflowItem[] findByCollection(Context context, Collection c)
          Get all workflow items for a particular collection.
static XmlWorkflowItem[] findByEPerson(Context context, EPerson ep)
           
 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 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 setCollection(Collection collection)
           
 void setItem(Item item)
           
 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 setPublishedBefore(boolean b)
          Indicate whether the submission has been published or publicly distributed before
 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

create

public static XmlWorkflowItem create(Context context)
                              throws AuthorizeException,
                                     IOException,
                                     SQLException
Throws:
AuthorizeException
IOException
SQLException

find

public static XmlWorkflowItem find(Context context,
                                   int id)
                            throws SQLException,
                                   AuthorizeException,
                                   IOException
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
AuthorizeException
IOException

findAll

public static XmlWorkflowItem[] findAll(Context c)
                                 throws SQLException,
                                        AuthorizeException,
                                        IOException,
                                        WorkflowConfigurationException
return all workflowitems

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

findAll

public static XmlWorkflowItem[] findAll(Context c,
                                        int page,
                                        int pagesize)
                                 throws SQLException,
                                        AuthorizeException,
                                        IOException,
                                        WorkflowConfigurationException
return all workflowitems for a certain page

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

findAllInCollection

public static XmlWorkflowItem[] findAllInCollection(Context c,
                                                    int page,
                                                    int pagesize,
                                                    int collectionId)
                                             throws SQLException,
                                                    AuthorizeException,
                                                    IOException,
                                                    WorkflowConfigurationException
return all workflowitems for a certain page with a certain collection

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

countAll

public static int countAll(Context c)
                    throws SQLException,
                           AuthorizeException,
                           IOException,
                           WorkflowConfigurationException
return all workflowitems

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

countAllInCollection

public static int countAllInCollection(Context c,
                                       int collId)
                                throws SQLException,
                                       AuthorizeException,
                                       IOException,
                                       WorkflowConfigurationException
return all workflowitems

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

findByEPerson

public static XmlWorkflowItem[] findByEPerson(Context context,
                                              EPerson ep)
                                       throws SQLException,
                                              AuthorizeException,
                                              IOException,
                                              WorkflowConfigurationException
Throws:
SQLException
AuthorizeException
IOException
WorkflowConfigurationException

findByCollection

public static XmlWorkflowItem[] findByCollection(Context context,
                                                 Collection c)
                                          throws SQLException,
                                                 AuthorizeException,
                                                 IOException
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
AuthorizeException
IOException

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

getID

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

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

getCollection

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

Specified by:
getCollection in interface InProgressSubmission
Returns:
the collection

setCollection

public void setCollection(Collection collection)

getItem

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

Specified by:
getItem in interface InProgressSubmission
Returns:
the item

setItem

public void setItem(Item item)

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

deleteWrapper

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

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


Copyright © 2011 DuraSpace. All Rights Reserved.