org.dspace.app.bulkedit
Class BulkEditChange

java.lang.Object
  extended by org.dspace.app.bulkedit.BulkEditChange

public class BulkEditChange
extends Object

Utility class to store changes to item that may occur during a batch edit.

Author:
Stuart Lewis

Constructor Summary
BulkEditChange()
          Initalise a change holder for a new item
BulkEditChange(Item i)
          Initalise a new change holder for an existing item
 
Method Summary
 void changeOwningCollection(Collection oldC, Collection newC)
          Register a change to the owning collection
 ArrayList<DCValue> getAdds()
          Get the list of elements and their values that have been added.
 ArrayList<DCValue> getComplete()
          Get the list of all values
 ArrayList<DCValue> getConstant()
          Get the list of unchanged values
 Item getItem()
          Get the DSpace Item that these changes are applicable to.
 ArrayList<Collection> getNewMappedCollections()
          Get the list of new mapped Collections
 Collection getNewOwningCollection()
          Get the new owning collection
 ArrayList<Collection> getOldMappedCollections()
          Get the list of old mapped Collections
 Collection getOldOwningCollection()
          Get the old owning collection
 ArrayList<DCValue> getRemoves()
          Get the list of elements and their values that have been removed.
 boolean hasChanges()
          Have any changes actually been recorded, or is this empty?
 boolean isNewItem()
          Does this change object represent a new item?
 void registerAdd(DCValue dcv)
          Add an added metadata value
 void registerConstant(DCValue dcv)
          Add an unchanged metadata value
 void registerNewMappedCollection(Collection c)
          Add a new mapped Collection
 void registerOldMappedCollection(Collection c)
          Add an old mapped Collection
 void registerRemove(DCValue dcv)
          Add a removed metadata value
 void setItem(Item i)
          Store the item - used when a new item is created
 void setOwningCollection(Collection newC)
          Set the owning collection of an item
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BulkEditChange

public BulkEditChange()
Initalise a change holder for a new item


BulkEditChange

public BulkEditChange(Item i)
Initalise a new change holder for an existing item

Parameters:
i - The Item to store
Method Detail

setItem

public void setItem(Item i)
Store the item - used when a new item is created

Parameters:
i - The item

registerAdd

public void registerAdd(DCValue dcv)
Add an added metadata value

Parameters:
dcv - The value to add

registerRemove

public void registerRemove(DCValue dcv)
Add a removed metadata value

Parameters:
dcv - The value to remove

registerConstant

public void registerConstant(DCValue dcv)
Add an unchanged metadata value

Parameters:
dcv - The value to keep unchanged

registerNewMappedCollection

public void registerNewMappedCollection(Collection c)
Add a new mapped Collection

Parameters:
c - The new mapped Collection

registerOldMappedCollection

public void registerOldMappedCollection(Collection c)
Add an old mapped Collection

Parameters:
c - The old mapped Collection

changeOwningCollection

public void changeOwningCollection(Collection oldC,
                                   Collection newC)
Register a change to the owning collection

Parameters:
oldC - The old owning collection
newC - The new owning collection

setOwningCollection

public void setOwningCollection(Collection newC)
Set the owning collection of an item

Parameters:
newC - The new owning collection

getItem

public Item getItem()
Get the DSpace Item that these changes are applicable to.

Returns:
The item

getAdds

public ArrayList<DCValue> getAdds()
Get the list of elements and their values that have been added.

Returns:
the list of elements and their values that have been added.

getRemoves

public ArrayList<DCValue> getRemoves()
Get the list of elements and their values that have been removed.

Returns:
the list of elements and their values that have been removed.

getConstant

public ArrayList<DCValue> getConstant()
Get the list of unchanged values

Returns:
the list of unchanged values

getComplete

public ArrayList<DCValue> getComplete()
Get the list of all values

Returns:
the list of all values

getNewMappedCollections

public ArrayList<Collection> getNewMappedCollections()
Get the list of new mapped Collections

Returns:
the list of new mapped collections

getOldMappedCollections

public ArrayList<Collection> getOldMappedCollections()
Get the list of old mapped Collections

Returns:
the list of old mapped collections

getOldOwningCollection

public Collection getOldOwningCollection()
Get the old owning collection

Returns:
the old owning collection

getNewOwningCollection

public Collection getNewOwningCollection()
Get the new owning collection

Returns:
the new owning collection

isNewItem

public boolean isNewItem()
Does this change object represent a new item?

Returns:
Whether or not this is for a new item

hasChanges

public boolean hasChanges()
Have any changes actually been recorded, or is this empty?

Returns:
Whether or not changes have been made


Copyright © 2010 DuraSpace. All Rights Reserved.