mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +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:
@@ -212,7 +212,7 @@ public class Bitstream extends DSpaceObject
|
||||
bitstream.setFormat(null);
|
||||
|
||||
context.addEvent(new Event(Event.CREATE, Constants.BITSTREAM,
|
||||
bitstreamID, null, bitstream.lookupIdentifiers(context)));
|
||||
bitstreamID, null, bitstream.getIdentifiers(context)));
|
||||
|
||||
return bitstream;
|
||||
}
|
||||
@@ -248,7 +248,7 @@ public class Bitstream extends DSpaceObject
|
||||
bitstream.setFormat(null);
|
||||
|
||||
context.addEvent(new Event(Event.CREATE, Constants.BITSTREAM,
|
||||
bitstreamID, "REGISTER", bitstream.lookupIdentifiers(context)));
|
||||
bitstreamID, "REGISTER", bitstream.getIdentifiers(context)));
|
||||
|
||||
return bitstream;
|
||||
}
|
||||
@@ -509,14 +509,14 @@ public class Bitstream extends DSpaceObject
|
||||
if (modified)
|
||||
{
|
||||
bContext.addEvent(new Event(Event.MODIFY, Constants.BITSTREAM,
|
||||
getID(), null, lookupIdentifiers(bContext)));
|
||||
getID(), null, getIdentifiers(bContext)));
|
||||
modified = false;
|
||||
}
|
||||
if (modifiedMetadata)
|
||||
{
|
||||
bContext.addEvent(new Event(Event.MODIFY_METADATA,
|
||||
Constants.BITSTREAM, getID(), getDetails(),
|
||||
lookupIdentifiers(bContext)));
|
||||
getIdentifiers(bContext)));
|
||||
modifiedMetadata = false;
|
||||
clearDetails();
|
||||
}
|
||||
@@ -544,7 +544,7 @@ public class Bitstream extends DSpaceObject
|
||||
"bitstream_id=" + getID()));
|
||||
|
||||
bContext.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, getID(),
|
||||
String.valueOf(getSequenceID()), lookupIdentifiers(bContext)));
|
||||
String.valueOf(getSequenceID()), getIdentifiers(bContext)));
|
||||
|
||||
// Remove from cache
|
||||
bContext.removeCached(this, getID());
|
||||
@@ -751,6 +751,6 @@ public class Bitstream extends DSpaceObject
|
||||
{
|
||||
//Also fire a modified event since the bitstream HAS been modified
|
||||
bContext.addEvent(new Event(Event.MODIFY, Constants.BITSTREAM, getID(),
|
||||
null, lookupIdentifiers(bContext)));
|
||||
null, getIdentifiers(bContext)));
|
||||
}
|
||||
}
|
||||
|
@@ -448,7 +448,7 @@ public class Bundle extends DSpaceObject
|
||||
|
||||
ourContext.addEvent(new Event(Event.ADD, Constants.BUNDLE, getID(),
|
||||
Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID()),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
|
||||
// copy authorization policies from bundle to bitstream
|
||||
// FIXME: multiple inclusion is affected by this...
|
||||
@@ -553,7 +553,7 @@ public class Bundle extends DSpaceObject
|
||||
|
||||
ourContext.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, getID(),
|
||||
Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID()),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
|
||||
//Ensure that the last modified from the item is triggered !
|
||||
Item owningItem = (Item) getParentObject();
|
||||
@@ -614,13 +614,13 @@ public class Bundle extends DSpaceObject
|
||||
if (modified)
|
||||
{
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.BUNDLE, getID(),
|
||||
null, lookupIdentifiers(ourContext)));
|
||||
null, getIdentifiers(ourContext)));
|
||||
modified = false;
|
||||
}
|
||||
if (modifiedMetadata)
|
||||
{
|
||||
ourContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.BUNDLE,
|
||||
getID(), null, lookupIdentifiers(ourContext)));
|
||||
getID(), null, getIdentifiers(ourContext)));
|
||||
modifiedMetadata = false;
|
||||
}
|
||||
|
||||
@@ -638,7 +638,7 @@ public class Bundle extends DSpaceObject
|
||||
+ getID()));
|
||||
|
||||
ourContext.addEvent(new Event(Event.DELETE, Constants.BUNDLE, getID(),
|
||||
getName(), lookupIdentifiers(ourContext)));
|
||||
getName(), getIdentifiers(ourContext)));
|
||||
|
||||
// Remove from cache
|
||||
ourContext.removeCached(this, getID());
|
||||
|
@@ -280,7 +280,7 @@ public class Collection extends DSpaceObject
|
||||
myPolicy.update();
|
||||
|
||||
context.addEvent(new Event(Event.CREATE, Constants.COLLECTION,
|
||||
c.getID(), c.handle, c.lookupIdentifiers(context)));
|
||||
c.getID(), c.handle, c.getIdentifiers(context)));
|
||||
|
||||
log.info(LogManager.getHeader(context, "create_collection",
|
||||
"collection_id=" + row.getIntColumn("collection_id"))
|
||||
@@ -971,7 +971,7 @@ public class Collection extends DSpaceObject
|
||||
}
|
||||
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.COLLECTION,
|
||||
getID(), "remove_template_item", lookupIdentifiers(ourContext)));
|
||||
getID(), "remove_template_item", getIdentifiers(ourContext)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1003,7 +1003,7 @@ public class Collection extends DSpaceObject
|
||||
|
||||
ourContext.addEvent(new Event(Event.ADD, Constants.COLLECTION, getID(),
|
||||
Constants.ITEM, item.getID(), item.getHandle(),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1043,7 +1043,7 @@ public class Collection extends DSpaceObject
|
||||
|
||||
ourContext.addEvent(new Event(Event.REMOVE, Constants.COLLECTION,
|
||||
getID(), Constants.ITEM, item.getID(), item.getHandle(),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1067,14 +1067,14 @@ public class Collection extends DSpaceObject
|
||||
if (modified)
|
||||
{
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.COLLECTION,
|
||||
getID(), null, lookupIdentifiers(ourContext)));
|
||||
getID(), null, getIdentifiers(ourContext)));
|
||||
modified = false;
|
||||
}
|
||||
if (modifiedMetadata)
|
||||
{
|
||||
ourContext.addEvent(new Event(Event.MODIFY_METADATA,
|
||||
Constants.COLLECTION, getID(), getDetails(),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
modifiedMetadata = false;
|
||||
clearDetails();
|
||||
}
|
||||
@@ -1141,7 +1141,7 @@ public class Collection extends DSpaceObject
|
||||
"collection_id=" + getID()));
|
||||
|
||||
ourContext.addEvent(new Event(Event.DELETE, Constants.COLLECTION,
|
||||
getID(), getHandle(), lookupIdentifiers(ourContext)));
|
||||
getID(), getHandle(), getIdentifiers(ourContext)));
|
||||
|
||||
// Remove from cache
|
||||
ourContext.removeCached(this, getID());
|
||||
@@ -1577,6 +1577,6 @@ public class Collection extends DSpaceObject
|
||||
{
|
||||
//Also fire a modified event since the collection HAS been modified
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.COLLECTION,
|
||||
getID(), null, lookupIdentifiers(ourContext)));
|
||||
getID(), null, getIdentifiers(ourContext)));
|
||||
}
|
||||
}
|
||||
|
@@ -233,14 +233,14 @@ public class Community extends DSpaceObject
|
||||
myPolicy.update();
|
||||
|
||||
context.addEvent(new Event(Event.CREATE, Constants.COMMUNITY, c.getID(),
|
||||
c.handle, c.lookupIdentifiers(context)));
|
||||
c.handle, c.getIdentifiers(context)));
|
||||
|
||||
// if creating a top-level Community, simulate an ADD event at the Site.
|
||||
if (parent == null)
|
||||
{
|
||||
context.addEvent(new Event(Event.ADD, Constants.SITE, Site.SITE_ID,
|
||||
Constants.COMMUNITY, c.getID(), c.handle,
|
||||
c.lookupIdentifiers(context)));
|
||||
c.getIdentifiers(context)));
|
||||
}
|
||||
|
||||
log.info(LogManager.getHeader(context, "create_community",
|
||||
@@ -531,14 +531,14 @@ public class Community extends DSpaceObject
|
||||
if (modified)
|
||||
{
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.COMMUNITY,
|
||||
getID(), null, lookupIdentifiers(ourContext)));
|
||||
getID(), null, getIdentifiers(ourContext)));
|
||||
modified = false;
|
||||
}
|
||||
if (modifiedMetadata)
|
||||
{
|
||||
ourContext.addEvent(new Event(Event.MODIFY_METADATA,
|
||||
Constants.COMMUNITY, getID(), getDetails(),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
modifiedMetadata = false;
|
||||
clearDetails();
|
||||
}
|
||||
@@ -911,7 +911,7 @@ public class Community extends DSpaceObject
|
||||
|
||||
ourContext.addEvent(new Event(Event.ADD, Constants.COMMUNITY,
|
||||
getID(), Constants.COLLECTION, c.getID(), c.getHandle(),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
|
||||
DatabaseManager.insert(ourContext, mappingRow);
|
||||
}
|
||||
@@ -988,7 +988,7 @@ public class Community extends DSpaceObject
|
||||
|
||||
ourContext.addEvent(new Event(Event.ADD, Constants.COMMUNITY,
|
||||
getID(), Constants.COMMUNITY, c.getID(), c.getHandle(),
|
||||
lookupIdentifiers(ourContext)));
|
||||
getIdentifiers(ourContext)));
|
||||
|
||||
DatabaseManager.insert(ourContext, mappingRow);
|
||||
}
|
||||
@@ -1026,7 +1026,7 @@ public class Community extends DSpaceObject
|
||||
// Capture ID & Handle of Collection we are removing, so we can trigger events later
|
||||
int removedId = c.getID();
|
||||
String removedHandle = c.getHandle();
|
||||
String[] removedIdentifiers = c.lookupIdentifiers(ourContext);
|
||||
String[] removedIdentifiers = c.getIdentifiers(ourContext);
|
||||
|
||||
// How many parent(s) does this collection have?
|
||||
TableRow trow = DatabaseManager.querySingle(ourContext,
|
||||
@@ -1087,7 +1087,7 @@ public class Community extends DSpaceObject
|
||||
// Capture ID & Handle of Community we are removing, so we can trigger events later
|
||||
int removedId = c.getID();
|
||||
String removedHandle = c.getHandle();
|
||||
String[] removedIdentifiers = c.lookupIdentifiers(ourContext);
|
||||
String[] removedIdentifiers = c.getIdentifiers(ourContext);
|
||||
|
||||
// How many parent(s) does this subcommunity have?
|
||||
TableRow trow = DatabaseManager.querySingle(ourContext,
|
||||
@@ -1158,7 +1158,7 @@ public class Community extends DSpaceObject
|
||||
|
||||
// Since this is a top level Community, simulate a REMOVE event at the Site.
|
||||
ourContext.addEvent(new Event(Event.REMOVE, Constants.SITE, Site.SITE_ID,
|
||||
Constants.COMMUNITY, getID(), getHandle(), lookupIdentifiers(ourContext)));
|
||||
Constants.COMMUNITY, getID(), getHandle(), getIdentifiers(ourContext)));
|
||||
} else {
|
||||
// This is a subcommunity, so let the parent remove it
|
||||
// NOTE: this essentially just logs event and calls "rawDelete()"
|
||||
@@ -1182,7 +1182,7 @@ public class Community extends DSpaceObject
|
||||
// Capture ID & Handle of object we are removing, so we can trigger events later
|
||||
int deletedId = getID();
|
||||
String deletedHandle = getHandle();
|
||||
String[] deletedIdentifiers = lookupIdentifiers(ourContext);
|
||||
String[] deletedIdentifiers = getIdentifiers(ourContext);
|
||||
|
||||
// Remove Community object from cache
|
||||
ourContext.removeCached(this, getID());
|
||||
@@ -1401,6 +1401,6 @@ public class Community extends DSpaceObject
|
||||
{
|
||||
//Also fire a modified event since the community HAS been modified
|
||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.COMMUNITY,
|
||||
getID(), null, lookupIdentifiers(ourContext)));
|
||||
getID(), null, getIdentifiers(ourContext)));
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,8 @@ public abstract class DSpaceObject
|
||||
// e.g. to document metadata fields touched, etc.
|
||||
private StringBuffer eventDetails = null;
|
||||
|
||||
private String[] identifiers = null;
|
||||
|
||||
/**
|
||||
* Reset the cache of event details.
|
||||
*/
|
||||
@@ -109,26 +111,52 @@ public abstract class DSpaceObject
|
||||
* Tries to lookup all Identifiers of this DSpaceObject.
|
||||
* @return An array containing all found identifiers or an array with a length of 0.
|
||||
*/
|
||||
public String[] lookupIdentifiers(Context context)
|
||||
public String[] getIdentifiers(Context context)
|
||||
{
|
||||
String[] identifiers = new String[0];
|
||||
if (identifiers == null)
|
||||
{
|
||||
log.debug("This DSO's identifiers cache is empty, looking for identifiers...");
|
||||
identifiers = new String[0];
|
||||
|
||||
IdentifierService identifierService =
|
||||
new DSpace().getSingletonService(IdentifierService.class);
|
||||
|
||||
if (identifierService != null)
|
||||
{
|
||||
return identifierService.lookup(context, this);
|
||||
}
|
||||
|
||||
identifiers = identifierService.lookup(context, this);
|
||||
} else {
|
||||
log.warn("No IdentifierService found, will return an array containing "
|
||||
+ "the Handle only.");
|
||||
|
||||
if (getHandle() != null)
|
||||
{
|
||||
return new String[] { HandleManager.getCanonicalForm(getHandle()) };
|
||||
identifiers = new String[] { HandleManager.getCanonicalForm(getHandle()) };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new String[0];
|
||||
if (log.isDebugEnabled())
|
||||
{
|
||||
StringBuilder dbgMsg = new StringBuilder();
|
||||
for (String id : identifiers)
|
||||
{
|
||||
if (dbgMsg.capacity() == 0)
|
||||
{
|
||||
dbgMsg.append("This DSO's Identifiers are: ");
|
||||
} else {
|
||||
dbgMsg.append(", ");
|
||||
}
|
||||
dbgMsg.append(id);
|
||||
}
|
||||
dbgMsg.append(".");
|
||||
log.debug(dbgMsg.toString());
|
||||
}
|
||||
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
public void resetIdentifiersCache()
|
||||
{
|
||||
identifiers = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -224,7 +224,7 @@ public class InstallItem
|
||||
|
||||
// Notify interested parties of newly archived Item
|
||||
c.addEvent(new Event(Event.INSTALL, Constants.ITEM, item.getID(),
|
||||
item.getHandle(), item.lookupIdentifiers(c)));
|
||||
item.getHandle(), item.getIdentifiers(c)));
|
||||
|
||||
// remove in-progress submission
|
||||
is.deleteWrapper();
|
||||
|
@@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -547,7 +547,7 @@ public class EPerson extends DSpaceObject
|
||||
+ e.getID()));
|
||||
|
||||
context.addEvent(new Event(Event.CREATE, Constants.EPERSON, e.getID(),
|
||||
null, e.lookupIdentifiers(context)));
|
||||
null, e.getIdentifiers(context)));
|
||||
|
||||
return e;
|
||||
}
|
||||
@@ -578,7 +578,7 @@ public class EPerson extends DSpaceObject
|
||||
}
|
||||
|
||||
myContext.addEvent(new Event(Event.DELETE, Constants.EPERSON, getID(),
|
||||
getEmail(), lookupIdentifiers(myContext)));
|
||||
getEmail(), getIdentifiers(myContext)));
|
||||
|
||||
// Remove from cache
|
||||
myContext.removeCached(this, getID());
|
||||
@@ -1008,13 +1008,13 @@ public class EPerson extends DSpaceObject
|
||||
if (modified)
|
||||
{
|
||||
myContext.addEvent(new Event(Event.MODIFY, Constants.EPERSON,
|
||||
getID(), null, lookupIdentifiers(myContext)));
|
||||
getID(), null, getIdentifiers(myContext)));
|
||||
modified = false;
|
||||
}
|
||||
if (modifiedMetadata)
|
||||
{
|
||||
myContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.EPERSON,
|
||||
getID(), getDetails(), lookupIdentifiers(myContext)));
|
||||
getID(), getDetails(), getIdentifiers(myContext)));
|
||||
modifiedMetadata = false;
|
||||
clearDetails();
|
||||
}
|
||||
|
@@ -215,7 +215,7 @@ public class Group extends DSpaceObject
|
||||
+ g.getID()));
|
||||
|
||||
context.addEvent(new Event(Event.CREATE, Constants.GROUP, g.getID(),
|
||||
null, g.lookupIdentifiers(context)));
|
||||
null, g.getIdentifiers(context)));
|
||||
|
||||
return g;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ public class Group extends DSpaceObject
|
||||
|
||||
myContext.addEvent(new Event(Event.ADD, Constants.GROUP, getID(),
|
||||
Constants.EPERSON, e.getID(), e.getEmail(),
|
||||
lookupIdentifiers(myContext)));
|
||||
getIdentifiers(myContext)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -297,7 +297,7 @@ public class Group extends DSpaceObject
|
||||
|
||||
myContext.addEvent(new Event(Event.ADD, Constants.GROUP, getID(),
|
||||
Constants.GROUP, g.getID(), g.getName(),
|
||||
lookupIdentifiers(myContext)));
|
||||
getIdentifiers(myContext)));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -315,7 +315,7 @@ public class Group extends DSpaceObject
|
||||
epeopleChanged = true;
|
||||
myContext.addEvent(new Event(Event.REMOVE, Constants.GROUP, getID(),
|
||||
Constants.EPERSON, e.getID(), e.getEmail(),
|
||||
lookupIdentifiers(myContext)));
|
||||
getIdentifiers(myContext)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +333,7 @@ public class Group extends DSpaceObject
|
||||
groupsChanged = true;
|
||||
myContext.addEvent(new Event(Event.REMOVE, Constants.GROUP, getID(),
|
||||
Constants.GROUP, g.getID(), g.getName(),
|
||||
lookupIdentifiers(myContext)));
|
||||
getIdentifiers(myContext)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1007,7 +1007,7 @@ public class Group extends DSpaceObject
|
||||
// FIXME: authorizations
|
||||
|
||||
myContext.addEvent(new Event(Event.DELETE, Constants.GROUP, getID(),
|
||||
getName(), lookupIdentifiers(myContext)));
|
||||
getName(), getIdentifiers(myContext)));
|
||||
|
||||
// Remove from cache
|
||||
myContext.removeCached(this, getID());
|
||||
@@ -1116,7 +1116,7 @@ public class Group extends DSpaceObject
|
||||
if (modifiedMetadata)
|
||||
{
|
||||
myContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.GROUP,
|
||||
getID(), getDetails(), lookupIdentifiers(myContext)));
|
||||
getID(), getDetails(), getIdentifiers(myContext)));
|
||||
modifiedMetadata = false;
|
||||
clearDetails();
|
||||
}
|
||||
|
@@ -82,6 +82,7 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
{
|
||||
service.register(context, dso);
|
||||
}
|
||||
dso.resetIdentifiersCache();
|
||||
//Update our item
|
||||
dso.update();
|
||||
}
|
||||
@@ -105,6 +106,7 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
throw new IdentifierException("Cannot register identifier: Didn't "
|
||||
+ "find a provider that supports this identifier.");
|
||||
}
|
||||
object.resetIdentifiersCache();
|
||||
//Update our item
|
||||
object.update();
|
||||
}
|
||||
@@ -160,6 +162,13 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
identifiers.add(result);
|
||||
}
|
||||
}
|
||||
catch (IdentifierNotFoundException ex)
|
||||
{
|
||||
log.info(service.getClass().getName() + " doesn't find an "
|
||||
+ "Identifier for " + dso.getTypeText() + ", "
|
||||
+ Integer.toString(dso.getID()) + ".");
|
||||
log.debug(ex.getMessage(), ex);
|
||||
}
|
||||
catch (IdentifierException ex)
|
||||
{
|
||||
log.error(ex.getMessage(), ex);
|
||||
@@ -227,6 +236,7 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
dso.resetIdentifiersCache();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -243,5 +253,6 @@ public class IdentifierServiceImpl implements IdentifierService {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
dso.resetIdentifiersCache();
|
||||
}
|
||||
}
|
||||
|
@@ -57,7 +57,7 @@ public class VersioningConsumer implements Consumer {
|
||||
//and browse index we need to fire a new event
|
||||
ctx.addEvent(new Event(Event.MODIFY,
|
||||
previousItem.getType(), previousItem.getID(),
|
||||
null, previousItem.lookupIdentifiers(ctx)));
|
||||
null, previousItem.getIdentifiers(ctx)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user