mirror of
https://github.com/ilri/cgspace-java-helpers.git
synced 2024-12-22 13:12:22 +01:00
src: fix context commit in scripts
I was wondering why the same bitstreams appeared to be getting de- leted on every single run. It turns out that the only mode we were committing the context in was in single item mode. If the argument was a site, community, or collection we were updating the item but not actually committing the changes!
This commit is contained in:
parent
5ebf4930cf
commit
80a336f94d
@ -61,6 +61,7 @@ public class FixJpgJpgThumbnails {
|
||||
switch (parent.getType()) {
|
||||
case Constants.SITE:
|
||||
process(context, itemService.findAll(context));
|
||||
context.commit();
|
||||
break;
|
||||
case Constants.COMMUNITY:
|
||||
List<Collection> collections = ((Community) parent).getCollections();
|
||||
@ -69,11 +70,13 @@ public class FixJpgJpgThumbnails {
|
||||
context,
|
||||
itemService.findAllByCollection(context, collection));
|
||||
}
|
||||
context.commit();
|
||||
break;
|
||||
case Constants.COLLECTION:
|
||||
process(
|
||||
context,
|
||||
itemService.findByCollection(context, (Collection) parent));
|
||||
context.commit();
|
||||
break;
|
||||
case Constants.ITEM:
|
||||
processItem(context, (Item) parent);
|
||||
|
@ -78,6 +78,7 @@ public class FixLowQualityThumbnails {
|
||||
switch (parent.getType()) {
|
||||
case Constants.SITE:
|
||||
process(context, itemService.findAll(context));
|
||||
context.commit();
|
||||
break;
|
||||
case Constants.COMMUNITY:
|
||||
List<Collection> collections = ((Community) parent).getCollections();
|
||||
@ -86,11 +87,13 @@ public class FixLowQualityThumbnails {
|
||||
context,
|
||||
itemService.findAllByCollection(context, collection));
|
||||
}
|
||||
context.commit();
|
||||
break;
|
||||
case Constants.COLLECTION:
|
||||
process(
|
||||
context,
|
||||
itemService.findByCollection(context, (Collection) parent));
|
||||
context.commit();
|
||||
break;
|
||||
case Constants.ITEM:
|
||||
processItem(context, (Item) parent);
|
||||
|
Loading…
Reference in New Issue
Block a user