Package org.dspace.app.bulkedit
Class BulkEditChange
java.lang.Object
org.dspace.app.bulkedit.BulkEditChange
Utility class to store changes to item that may occur during a batch edit.
- Author:
- Stuart Lewis
-
Constructor Summary
ConstructorsConstructorDescriptionInitialise a change holder for a new itemInitialise a new change holder for an existing item -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeOwningCollection(Collection oldC, Collection newC) Register a change to the owning collectiongetAdds()Get the list of elements and their values that have been added.Get the list of all valuesGet the list of unchanged valuesgetItem()Get the DSpace Item that these changes are applicable to.Get the list of new mapped CollectionsGet the new owning collectionGet the list of old mapped CollectionsGet the old owning collectionGet the list of elements and their values that have been removed.booleanHave any changes actually been recorded, or is this empty?booleanDoes this change object represent a deleted item?booleanDoes this change object represent a new item?booleanDoes this change object represent a reinstated item?booleanDoes this change object represent a withdrawn item?voidAdd an added metadata valuevoidAdd an unchanged metadata valuevoidAdd a new mapped CollectionvoidAdd an old mapped CollectionvoidAdd a removed metadata valuevoidSet that this item has been deletedvoidStore the item - used when a new item is createdvoidSet the owning collection of an itemvoidSet that this item has been deletedvoidSet that this item has been withdrawn
-
Constructor Details
-
BulkEditChange
public BulkEditChange()Initialise a change holder for a new item -
BulkEditChange
Initialise a new change holder for an existing item- Parameters:
i- The Item to store
-
-
Method Details
-
setItem
Store the item - used when a new item is created- Parameters:
i- The item
-
registerAdd
Add an added metadata value- Parameters:
dcv- The value to add
-
registerRemove
Add a removed metadata value- Parameters:
dcv- The value to remove
-
registerConstant
Add an unchanged metadata value- Parameters:
dcv- The value to keep unchanged
-
registerNewMappedCollection
Add a new mapped Collection- Parameters:
c- The new mapped Collection
-
registerOldMappedCollection
Add an old mapped Collection- Parameters:
c- The old mapped Collection
-
changeOwningCollection
Register a change to the owning collection- Parameters:
oldC- The old owning collectionnewC- The new owning collection
-
setOwningCollection
Set the owning collection of an item- Parameters:
newC- The new owning collection
-
getItem
Get the DSpace Item that these changes are applicable to.- Returns:
- The item
-
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
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
Get the list of unchanged values- Returns:
- the list of unchanged values
-
getComplete
Get the list of all values- Returns:
- the list of all values
-
getNewMappedCollections
Get the list of new mapped Collections- Returns:
- the list of new mapped collections
-
getOldMappedCollections
Get the list of old mapped Collections- Returns:
- the list of old mapped collections
-
getOldOwningCollection
Get the old owning collection- Returns:
- the old owning 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
-
isDeleted
public boolean isDeleted()Does this change object represent a deleted item?- Returns:
- Whether or not this is for a deleted item
-
setDeleted
public void setDeleted()Set that this item has been deleted -
isWithdrawn
public boolean isWithdrawn()Does this change object represent a withdrawn item?- Returns:
- Whether or not this is for a withdrawn item
-
setWithdrawn
public void setWithdrawn()Set that this item has been withdrawn -
isReinstated
public boolean isReinstated()Does this change object represent a reinstated item?- Returns:
- Whether or not this is for a reinstated item
-
setReinstated
public void setReinstated()Set that this item has been deleted -
hasChanges
public boolean hasChanges()Have any changes actually been recorded, or is this empty?- Returns:
- Whether or not changes have been made
-