mirror of
https://github.com/ilri/cgspace-java-helpers.git
synced 2024-11-27 00:58:19 +01:00
src: re-organize switch statements in scripts
It makes more sense to me to start from the top level of the hier- archy.
This commit is contained in:
parent
8e01595cc1
commit
5ebf4930cf
@ -59,10 +59,8 @@ public class FixJpgJpgThumbnails {
|
||||
DSpaceObject parent = handleService.resolveToObject(context, parentHandle);
|
||||
if (parent != null) {
|
||||
switch (parent.getType()) {
|
||||
case Constants.COLLECTION:
|
||||
process(
|
||||
context,
|
||||
itemService.findByCollection(context, (Collection) parent));
|
||||
case Constants.SITE:
|
||||
process(context, itemService.findAll(context));
|
||||
break;
|
||||
case Constants.COMMUNITY:
|
||||
List<Collection> collections = ((Community) parent).getCollections();
|
||||
@ -72,8 +70,10 @@ public class FixJpgJpgThumbnails {
|
||||
itemService.findAllByCollection(context, collection));
|
||||
}
|
||||
break;
|
||||
case Constants.SITE:
|
||||
process(context, itemService.findAll(context));
|
||||
case Constants.COLLECTION:
|
||||
process(
|
||||
context,
|
||||
itemService.findByCollection(context, (Collection) parent));
|
||||
break;
|
||||
case Constants.ITEM:
|
||||
processItem(context, (Item) parent);
|
||||
|
@ -76,10 +76,8 @@ public class FixLowQualityThumbnails {
|
||||
DSpaceObject parent = handleService.resolveToObject(context, parentHandle);
|
||||
if (parent != null) {
|
||||
switch (parent.getType()) {
|
||||
case Constants.COLLECTION:
|
||||
process(
|
||||
context,
|
||||
itemService.findByCollection(context, (Collection) parent));
|
||||
case Constants.SITE:
|
||||
process(context, itemService.findAll(context));
|
||||
break;
|
||||
case Constants.COMMUNITY:
|
||||
List<Collection> collections = ((Community) parent).getCollections();
|
||||
@ -89,8 +87,10 @@ public class FixLowQualityThumbnails {
|
||||
itemService.findAllByCollection(context, collection));
|
||||
}
|
||||
break;
|
||||
case Constants.SITE:
|
||||
process(context, itemService.findAll(context));
|
||||
case Constants.COLLECTION:
|
||||
process(
|
||||
context,
|
||||
itemService.findByCollection(context, (Collection) parent));
|
||||
break;
|
||||
case Constants.ITEM:
|
||||
processItem(context, (Item) parent);
|
||||
|
Loading…
Reference in New Issue
Block a user