added event that allow to update solr document of collection and community

This commit is contained in:
Mykhaylo
2021-09-02 09:55:28 +02:00
parent 16d8e3372b
commit 981e224fea
2 changed files with 12 additions and 1 deletions

View File

@@ -524,6 +524,8 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
// register this as the admin group // register this as the admin group
collection.setAdmins(admins); collection.setAdmins(admins);
context.addEvent(new Event(Event.MODIFY, Constants.COLLECTION, collection.getID(),
null, getIdentifiers(context, collection)));
return admins; return admins;
} }
@@ -540,6 +542,8 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
// Remove the link to the collection table. // Remove the link to the collection table.
collection.setAdmins(null); collection.setAdmins(null);
context.addEvent(new Event(Event.MODIFY, Constants.COLLECTION, collection.getID(),
null, getIdentifiers(context, collection)));
} }
@Override @Override
@@ -657,8 +661,11 @@ public class CollectionServiceImpl extends DSpaceObjectServiceImpl<Collection> i
collection.clearModified(); collection.clearModified();
} }
if (collection.isMetadataModified()) { if (collection.isMetadataModified()) {
collection.clearDetails(); context.addEvent(new Event(Event.MODIFY_METADATA, Constants.COLLECTION, collection.getID(),
collection.getDetails(),getIdentifiers(context, collection)));
collection.clearModified();
} }
collection.clearDetails();
} }
@Override @Override

View File

@@ -287,6 +287,8 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
// register this as the admin group // register this as the admin group
community.setAdmins(admins); community.setAdmins(admins);
context.addEvent(new Event(Event.MODIFY, Constants.COMMUNITY, community.getID(),
null, getIdentifiers(context, community)));
return admins; return admins;
} }
@@ -302,6 +304,8 @@ public class CommunityServiceImpl extends DSpaceObjectServiceImpl<Community> imp
// Remove the link to the community table. // Remove the link to the community table.
community.setAdmins(null); community.setAdmins(null);
context.addEvent(new Event(Event.MODIFY, Constants.COMMUNITY, community.getID(),
null, getIdentifiers(context, community)));
} }
@Override @Override