mirror of
https://github.com/ilri/cgspace-java-helpers.git
synced 2024-12-22 21:22: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()) {
|
switch (parent.getType()) {
|
||||||
case Constants.SITE:
|
case Constants.SITE:
|
||||||
process(context, itemService.findAll(context));
|
process(context, itemService.findAll(context));
|
||||||
|
context.commit();
|
||||||
break;
|
break;
|
||||||
case Constants.COMMUNITY:
|
case Constants.COMMUNITY:
|
||||||
List<Collection> collections = ((Community) parent).getCollections();
|
List<Collection> collections = ((Community) parent).getCollections();
|
||||||
@ -69,11 +70,13 @@ public class FixJpgJpgThumbnails {
|
|||||||
context,
|
context,
|
||||||
itemService.findAllByCollection(context, collection));
|
itemService.findAllByCollection(context, collection));
|
||||||
}
|
}
|
||||||
|
context.commit();
|
||||||
break;
|
break;
|
||||||
case Constants.COLLECTION:
|
case Constants.COLLECTION:
|
||||||
process(
|
process(
|
||||||
context,
|
context,
|
||||||
itemService.findByCollection(context, (Collection) parent));
|
itemService.findByCollection(context, (Collection) parent));
|
||||||
|
context.commit();
|
||||||
break;
|
break;
|
||||||
case Constants.ITEM:
|
case Constants.ITEM:
|
||||||
processItem(context, (Item) parent);
|
processItem(context, (Item) parent);
|
||||||
|
@ -78,6 +78,7 @@ public class FixLowQualityThumbnails {
|
|||||||
switch (parent.getType()) {
|
switch (parent.getType()) {
|
||||||
case Constants.SITE:
|
case Constants.SITE:
|
||||||
process(context, itemService.findAll(context));
|
process(context, itemService.findAll(context));
|
||||||
|
context.commit();
|
||||||
break;
|
break;
|
||||||
case Constants.COMMUNITY:
|
case Constants.COMMUNITY:
|
||||||
List<Collection> collections = ((Community) parent).getCollections();
|
List<Collection> collections = ((Community) parent).getCollections();
|
||||||
@ -86,11 +87,13 @@ public class FixLowQualityThumbnails {
|
|||||||
context,
|
context,
|
||||||
itemService.findAllByCollection(context, collection));
|
itemService.findAllByCollection(context, collection));
|
||||||
}
|
}
|
||||||
|
context.commit();
|
||||||
break;
|
break;
|
||||||
case Constants.COLLECTION:
|
case Constants.COLLECTION:
|
||||||
process(
|
process(
|
||||||
context,
|
context,
|
||||||
itemService.findByCollection(context, (Collection) parent));
|
itemService.findByCollection(context, (Collection) parent));
|
||||||
|
context.commit();
|
||||||
break;
|
break;
|
||||||
case Constants.ITEM:
|
case Constants.ITEM:
|
||||||
processItem(context, (Item) parent);
|
processItem(context, (Item) parent);
|
||||||
|
Loading…
Reference in New Issue
Block a user