org.dspace.app.xmlui.aspect.administrative
Class FlowItemUtils

java.lang.Object
  extended by org.dspace.app.xmlui.aspect.administrative.FlowItemUtils

public class FlowItemUtils
extends Object

Utility methods to processes actions on Groups. These methods are used exclusivly from the administrative flow scripts.

Author:
Jay Paz, Scott Phillips

Constructor Summary
FlowItemUtils()
           
 
Method Summary
static FlowResult processAddBitstream(Context context, int itemID, org.apache.cocoon.environment.Request request)
          Add a new bitstream to the item.
static FlowResult processAddMetadata(Context context, int itemID, org.apache.cocoon.environment.Request request)
          Process the request paramaters to add a new metadata entry for the item.
static FlowResult processCurateItem(Context context, int itemID, org.apache.cocoon.environment.Request request)
          processCurateDSO Utility method to process curation tasks submitted via the DSpace GUI
static FlowResult processDeleteBitstreams(Context context, int itemID, String[] bitstreamIDs)
          Delete the given bitstreams from the bundle and item.
static FlowResult processDeleteItem(Context context, int itemID)
          Permanently delete the specified item, this method assumes that the action has been confirmed.
static FlowResult processEditBitstream(Context context, int itemID, int bitstreamID, String bitstreamName, String primary, String description, int formatID, String userFormat)
          Update a bitstream's metadata.
static FlowResult processEditItem(Context context, int itemID, org.apache.cocoon.environment.Request request)
          Process the request parameters to update the item's metadata and remove any selected bitstreams.
static FlowResult processMoveItem(Context context, int itemID, int collectionID, boolean inherit)
          Move the specified item to another collection.
static FlowResult processQueueItem(Context context, int itemID, org.apache.cocoon.environment.Request request)
          queues curation tasks
static FlowResult processReinstateItem(Context context, int itemID)
          Reinstate the specified item, this method assumes that the action has been confirmed.
static FlowResult processReorderBitstream(Context context, int itemID, org.apache.cocoon.environment.Request request)
           
static FlowResult processWithdrawItem(Context context, int itemID)
          Withdraw the specified item, this method assumes that the action has been confirmed.
static FlowResult resolveItemIdentifier(Context context, String identifier)
          Resolve the given identifier to an item.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlowItemUtils

public FlowItemUtils()
Method Detail

resolveItemIdentifier

public static FlowResult resolveItemIdentifier(Context context,
                                               String identifier)
                                        throws SQLException
Resolve the given identifier to an item. The identifier may be either an internal ID or a handle. If an item is found then the result the internal ID of the item will be placed in the result "itemID" parameter. If the identifier was unable to be resolved to an item then the "identifier" field is placed in error.

Parameters:
context - The current DSpace context.
identifier - An Internal ID or a handle
Returns:
A flow result
Throws:
SQLException

processEditItem

public static FlowResult processEditItem(Context context,
                                         int itemID,
                                         org.apache.cocoon.environment.Request request)
                                  throws SQLException,
                                         AuthorizeException,
                                         UIException,
                                         IOException
Process the request parameters to update the item's metadata and remove any selected bitstreams. Each metadata entry will have three fields "name_X", "value_X", and "language_X" where X is an integer that relates all three of the fields together. The name parameter stores the metadata name that is used by the entry (i.e schema_element_qualifier). The value and language paramaters are user inputed fields. If the optional parameter "remove_X" is given then the metadata value is removed. To support AJAX operations on this page an aditional parameter is considered, the "scope". The scope is the set of metadata entries that are being updated during this request. It the metadata name, schema_element_qualifier, only fields that have this name are considered! If all fields are to be considered then scope should be set to "*". When creating an AJAX query include all the name_X, value_X, language_X, and remove_X for the fields in the set, and then set the scope parameter to be the metadata field.

Parameters:
context - The current DSpace context
itemID - internal item id
request - the Cocoon request
Returns:
A flow result
Throws:
SQLException
AuthorizeException
UIException
IOException

processAddMetadata

public static FlowResult processAddMetadata(Context context,
                                            int itemID,
                                            org.apache.cocoon.environment.Request request)
                                     throws SQLException,
                                            AuthorizeException,
                                            UIException,
                                            IOException
Process the request paramaters to add a new metadata entry for the item.

Parameters:
context - The current DSpace context
itemID - internal item id
request - the Cocoon request
Returns:
A flow result
Throws:
SQLException
AuthorizeException
UIException
IOException

processWithdrawItem

public static FlowResult processWithdrawItem(Context context,
                                             int itemID)
                                      throws SQLException,
                                             AuthorizeException,
                                             IOException
Withdraw the specified item, this method assumes that the action has been confirmed.

Parameters:
context - The DSpace context
itemID - The id of the to-be-withdrawn item.
Returns:
A result object
Throws:
SQLException
AuthorizeException
IOException

processReinstateItem

public static FlowResult processReinstateItem(Context context,
                                              int itemID)
                                       throws SQLException,
                                              AuthorizeException,
                                              IOException
Reinstate the specified item, this method assumes that the action has been confirmed.

Parameters:
context - The DSpace context
itemID - The id of the to-be-reinstated item.
Returns:
A result object
Throws:
SQLException
AuthorizeException
IOException

processMoveItem

public static FlowResult processMoveItem(Context context,
                                         int itemID,
                                         int collectionID,
                                         boolean inherit)
                                  throws SQLException,
                                         AuthorizeException,
                                         IOException
Move the specified item to another collection.

Parameters:
context - The DSpace context
itemID - The id of the to-be-moved item.
collectionID - The id of the destination collection.
inherit - Whether to inherit the policies of the destination collection
Returns:
A result object
Throws:
SQLException
AuthorizeException
IOException

processDeleteItem

public static FlowResult processDeleteItem(Context context,
                                           int itemID)
                                    throws SQLException,
                                           AuthorizeException,
                                           IOException
Permanently delete the specified item, this method assumes that the action has been confirmed.

Parameters:
context - The DSpace context
itemID - The id of the to-be-deleted item.
Returns:
A result object
Throws:
SQLException
AuthorizeException
IOException

processAddBitstream

public static FlowResult processAddBitstream(Context context,
                                             int itemID,
                                             org.apache.cocoon.environment.Request request)
                                      throws SQLException,
                                             AuthorizeException,
                                             IOException
Add a new bitstream to the item. The bundle, bitstream (aka file), and description will be used to create a new bitstream. If the format needs to be adjusted then they will need to access the edit bitstream form after it has been uploaded.

Parameters:
context - The DSpace content
itemID - The item to add a new bitstream too
request - The request.
Returns:
A flow result
Throws:
SQLException
AuthorizeException
IOException

processEditBitstream

public static FlowResult processEditBitstream(Context context,
                                              int itemID,
                                              int bitstreamID,
                                              String bitstreamName,
                                              String primary,
                                              String description,
                                              int formatID,
                                              String userFormat)
                                       throws SQLException,
                                              AuthorizeException
Update a bitstream's metadata.

Parameters:
context - The DSpace content
itemID - The item to which the bitstream belongs
bitstreamID - The bitstream being updated.
description - The new description of the bitstream
formatID - The new format ID of the bitstream
userFormat - Any user supplied formats.
Returns:
A flow result object.
Throws:
SQLException
AuthorizeException

processDeleteBitstreams

public static FlowResult processDeleteBitstreams(Context context,
                                                 int itemID,
                                                 String[] bitstreamIDs)
                                          throws SQLException,
                                                 AuthorizeException,
                                                 IOException,
                                                 UIException
Delete the given bitstreams from the bundle and item. If there are no more bitstreams left in a bundle then also remove it.

Parameters:
context - Current dspace content
itemID - The item id from which to remove bitstreams
bitstreamIDs - A bundleID slash bitstreamID pair of bitstreams to be removed.
Returns:
A flow result
Throws:
SQLException
AuthorizeException
IOException
UIException

processReorderBitstream

public static FlowResult processReorderBitstream(Context context,
                                                 int itemID,
                                                 org.apache.cocoon.environment.Request request)
                                          throws SQLException,
                                                 AuthorizeException
Throws:
SQLException
AuthorizeException

processCurateItem

public static FlowResult processCurateItem(Context context,
                                           int itemID,
                                           org.apache.cocoon.environment.Request request)
                                    throws AuthorizeException,
                                           IOException,
                                           SQLException,
                                           Exception
processCurateDSO Utility method to process curation tasks submitted via the DSpace GUI

Parameters:
context -
itemID -
request -
Throws:
AuthorizeException
IOException
SQLException
Exception

processQueueItem

public static FlowResult processQueueItem(Context context,
                                          int itemID,
                                          org.apache.cocoon.environment.Request request)
                                   throws AuthorizeException,
                                          IOException,
                                          SQLException,
                                          Exception
queues curation tasks

Throws:
AuthorizeException
IOException
SQLException
Exception


Copyright © 2012 DuraSpace. All Rights Reserved.