mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-11 03:53:07 +00:00
Enhancing the PR for DS-1990.
Adds a cache to the Identifier array in the DSpaceObject class. Renames the method from lookupIdentifiers into getIdentifiers.
This commit is contained in:
@@ -201,7 +201,7 @@ public class Item extends DSpaceObject
|
||||
context.restoreAuthSystemState();
|
||||
|
||||
context.addEvent(new Event(Event.CREATE, Constants.ITEM, i.getID(),
|
||||
null, i.lookupIdentifiers(context)));
|
||||
null, i.getIdentifiers(context)));
|
||||
|
||||
log.info(LogManager.getHeader(context, "create_item", "item_id="
|
||||
+ row.getIntColumn("item_id")));
|
||||
@@ -358,7 +358,7 @@ public class Item extends DSpaceObject
|
||||
itemRow.setColumn("last_modified", lastModified);
|
||||
DatabaseManager.updateQuery(ourContext, "UPDATE item SET last_modified = ? WHERE item_id= ? ", lastModified, getID());
|
||||
//Also fire a modified event since the item HAS been modified
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(), null, lookupIdentifiers(ourContext)));
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(), null, getIdentifiers(ourContext)));
|
||||
} catch (SQLException e) {
|
||||
log.error(LogManager.getHeader(ourContext, "Error while updating last modified timestamp", "Item: " + getID()));
|
||||
}
|
||||
@@ -1307,7 +1307,7 @@ public class Item extends DSpaceObject
|
||||
|
||||
ourContext.addEvent(new Event(Event.ADD, Constants.ITEM, getID(),
|
||||
Constants.BUNDLE, b.getID(), b.getName(),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1349,7 +1349,7 @@ public class Item extends DSpaceObject
|
||||
getID(), b.getID());
|
||||
|
||||
ourContext.addEvent(new Event(Event.REMOVE, Constants.ITEM, getID(),
|
||||
Constants.BUNDLE, b.getID(), b.getName(), lookupIdentifiers(ourContext)));
|
||||
Constants.BUNDLE, b.getID(), b.getName(), getIdentifiers(ourContext)));
|
||||
|
||||
// If the bundle is orphaned, it's removed
|
||||
TableRowIterator tri = DatabaseManager.query(ourContext,
|
||||
@@ -1810,13 +1810,13 @@ public class Item extends DSpaceObject
|
||||
if (dublinCoreChanged)
|
||||
{
|
||||
ourContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.ITEM, getID(),
|
||||
getDetails(), lookupIdentifiers(ourContext)));
|
||||
getDetails(), getIdentifiers(ourContext)));
|
||||
clearDetails();
|
||||
dublinCoreChanged = false;
|
||||
}
|
||||
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(),
|
||||
null, lookupIdentifiers(ourContext)));
|
||||
null, getIdentifiers(ourContext)));
|
||||
modified = false;
|
||||
}
|
||||
}
|
||||
@@ -1909,7 +1909,7 @@ public class Item extends DSpaceObject
|
||||
update();
|
||||
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(),
|
||||
"WITHDRAW", lookupIdentifiers(ourContext)));
|
||||
"WITHDRAW", getIdentifiers(ourContext)));
|
||||
|
||||
// remove all authorization policies, saving the custom ones
|
||||
AuthorizeManager.removeAllPoliciesByDSOAndTypeNotEqualsTo(ourContext, this, ResourcePolicy.TYPE_CUSTOM);
|
||||
@@ -1967,7 +1967,7 @@ public class Item extends DSpaceObject
|
||||
update();
|
||||
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(),
|
||||
"REINSTATE", lookupIdentifiers(ourContext)));
|
||||
"REINSTATE", getIdentifiers(ourContext)));
|
||||
|
||||
// authorization policies
|
||||
if (colls.length > 0)
|
||||
@@ -2001,7 +2001,7 @@ public class Item extends DSpaceObject
|
||||
AuthorizeManager.authorizeAction(ourContext, this, Constants.REMOVE);
|
||||
|
||||
ourContext.addEvent(new Event(Event.DELETE, Constants.ITEM, getID(),
|
||||
getHandle(), lookupIdentifiers(ourContext)));
|
||||
getHandle(), getIdentifiers(ourContext)));
|
||||
|
||||
log.info(LogManager.getHeader(ourContext, "delete_item", "item_id="
|
||||
+ getID()));
|
||||
@@ -2424,7 +2424,7 @@ public class Item extends DSpaceObject
|
||||
// so we only do this here if the owning collection hasn't changed.
|
||||
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(),
|
||||
null, lookupIdentifiers(ourContext)));
|
||||
null, getIdentifiers(ourContext)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user