org.dspace.content
Class WorkspaceItem

java.lang.Object
  extended by org.dspace.content.WorkspaceItem
All Implemented Interfaces:
InProgressSubmission
Direct Known Subclasses:
SupervisedItem

public class WorkspaceItem
extends Object
implements InProgressSubmission

Class representing an item in the process of being submitted by a user

Version:
$Revision: 3761 $
Author:
Robert Tansley

Method Summary
static WorkspaceItem create(Context c, Collection coll, boolean template)
          Create a new workspace item, with a new ID.
 void deleteAll()
          Delete the workspace item.
 void deleteWrapper()
          Deletes submission wrapper, doesn't delete item contents
static WorkspaceItem find(Context context, int id)
          Get a workspace item from the database.
static WorkspaceItem[] findAll(Context context)
          Get all workspace items in the whole system
static WorkspaceItem[] findByCollection(Context context, Collection c)
          Get all workspace items for a particular collection.
static WorkspaceItem[] findByEPerson(Context context, EPerson ep)
          Get all workspace items for a particular e-person.
 Collection getCollection()
          Get the collection being submitted to
 int getID()
          Get the internal ID of this workspace item
 Item getItem()
          Get the incomplete item object
 int getPageReached()
          Get the value of the page reached column (which represents the page reached within a stage/step)
 int getStageReached()
          Get the value of the stage reached column
 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 setPageReached(int v)
          Set the value of the page reached column (which represents the page reached within a stage/step)
 void setPublishedBefore(boolean b)
          Indicate whether the submission has been published or publicly distributed before
 void setStageReached(int v)
          Set the value of the stage reached column
 void update()
          Update the workspace 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 WorkspaceItem find(Context context,
                                 int id)
                          throws SQLException
Get a workspace 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 workspace item, or null if the ID is invalid.
Throws:
SQLException

create

public static WorkspaceItem create(Context c,
                                   Collection coll,
                                   boolean template)
                            throws AuthorizeException,
                                   SQLException,
                                   IOException
Create a new workspace item, with a new ID. An Item is also created. The submitter is the current user in the context.

Parameters:
c - DSpace context object
coll - Collection being submitted to
template - if true, the workspace item starts as a copy of the collection's template item
Returns:
the newly created workspace item
Throws:
AuthorizeException
SQLException
IOException

findByEPerson

public static WorkspaceItem[] findByEPerson(Context context,
                                            EPerson ep)
                                     throws SQLException
Get all workspace items for a particular e-person. These are ordered by workspace item 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 workspace items
Throws:
SQLException

findByCollection

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

Parameters:
context - the context object
c - the collection
Returns:
the corresponding workspace items
Throws:
SQLException

findAll

public static WorkspaceItem[] findAll(Context context)
                               throws SQLException
Get all workspace items in the whole system

Parameters:
context - the context object
Returns:
all workspace items
Throws:
SQLException

getID

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

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

getStageReached

public int getStageReached()
Get the value of the stage reached column

Returns:
the value of the stage reached column

setStageReached

public void setStageReached(int v)
Set the value of the stage reached column

Parameters:
v - the value of the stage reached column

getPageReached

public int getPageReached()
Get the value of the page reached column (which represents the page reached within a stage/step)

Returns:
the value of the page reached column

setPageReached

public void setPageReached(int v)
Set the value of the page reached column (which represents the page reached within a stage/step)

Parameters:
v - the value of the page reached column

update

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

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

deleteAll

public void deleteAll()
               throws SQLException,
                      AuthorizeException,
                      IOException
Delete the workspace item. The entry in workspaceitem, the unarchived item and its contents are all removed (multiple inclusion notwithstanding.)

Throws:
SQLException
AuthorizeException
IOException

deleteWrapper

public void deleteWrapper()
                   throws SQLException,
                          AuthorizeException,
                          IOException
Description copied from interface: InProgressSubmission
Deletes submission wrapper, doesn't delete item contents

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

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.