reportExceptions.add(newSUSHI_Error_Model("3021","Warning","Unspecified Date Arguments","usagecounts.openaire.eu","Begin Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)));
reportExceptions.add(newSUSHI_Error_Model("3021","Warning","Unspecified Date Arguments","usagecounts.openaire.eu","End Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)));
reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","Begin Date: "+beginDate+" is not a valid date"));
}
if(endDateParsed==null){
reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","End Date: "+endDate+" is not a valid date"));
reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","BeginDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)+"\' is greater than EndDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)+"\'"));
reportExceptions.add(newSUSHI_Error_Model("3060","Error","Invalid Filter Value","usagecounts.openaire.eu","RepositoryIdentifier: "+repositoryIdentifier+" is not valid"));
}
}
Stringitemid="";
if(!itemIdentifier.equals("")){
String[]split=itemIdentifier.split(":");
switch(split[0].toLowerCase()){
case"oid":
itemid=itemIdentifier;
break;
case"doi":
itemid=itemIdentifier;
break;
case"openaire":
itemid=itemIdentifier;
break;
default:
reportExceptions.add(newSUSHI_Error_Model("3060","Error","Invalid Filter Value","usagecounts.openaire.eu","ItemIdentifier: "+itemIdentifier+" is not valid"));
reportExceptions.add(newSUSHI_Error_Model("3070","Error","Required Filter Missing","usagecounts.openaire.eu","ItemIdentifier or RepositoryIdentifier must be supplied"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
}
}else{
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
}
}else{
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
if(itemDataType.equalsIgnoreCase("")||itemDataType.equalsIgnoreCase("part of book or chapter of book")){
usageStatsRepository.executeItem(reportItems,itemIdentifier,repoid,"Part of book or chapter of book",beginDateParsed,endDateParsed,granularity);
if(reportItems.isEmpty()){
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
}
}else{
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
}
}elseif(!repoid.equals("")){
usageStatsRepository.executeBatchItems(reportItems,repoid,"Part of book or chapter of book",beginDateParsed,endDateParsed,granularity);
if(reportItems.isEmpty()){
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
}
}elseif(reportName.equals("")){
reportExceptions.add(newSUSHI_Error_Model("3050","Error","usagecounts.openaire.eu","Report argument is missing","You must supply a Report argument"));
}else{
reportExceptions.add(newSUSHI_Error_Model("3000","Error","usagecounts.openaire.eu","Report "+reportName+" not supported","Supported reports: AR1, IR1, RR1, BR1, BR2"));
//reportExceptions.add(newSUSHI_Error_Model("3021","Warning","Unspecified Date Arguments","usagecounts.openaire.eu","Begin Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)));
//reportExceptions.add(newSUSHI_Error_Model("3021","Warning","Unspecified Date Arguments","usagecounts.openaire.eu","End Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)));
//reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","Begin Date: "+beginDate+" is not a valid date"));
//}
//if(endDateParsed==null){
//reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","End Date: "+endDate+" is not a valid date"));
//reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","BeginDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)+"\' is greater than EndDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)+"\'"));
//reportExceptions.add(newSUSHI_Error_Model("3060","Error","Invalid Filter Value","usagecounts.openaire.eu","RepositoryIdentifier: "+repositoryIdentifier+" is not valid"));
//}
//}
//Stringitemid="";
//if(!itemIdentifier.equals("")){
//String[]split=itemIdentifier.split(":");
//switch(split[0].toLowerCase()){
//case"oid":
//itemid=itemIdentifier;
//break;
//case"doi":
//itemid=itemIdentifier;
//break;
//case"openaire":
//itemid=itemIdentifier;
//break;
//default:
//reportExceptions.add(newSUSHI_Error_Model("3060","Error","Invalid Filter Value","usagecounts.openaire.eu","ItemIdentifier: "+itemIdentifier+" is not valid"));
//reportExceptions.add(newSUSHI_Error_Model("3070","Error","Required Filter Missing","usagecounts.openaire.eu","ItemIdentifier or RepositoryIdentifier must be supplied"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//if(itemDataType.equalsIgnoreCase("")||itemDataType.equalsIgnoreCase("part of book or chapter of book")){
//usageStatsRepository.executeItem(reportItems,itemIdentifier,repoid,"Part of book or chapter of book",beginDateParsed,endDateParsed,granularity);
//if(reportItems.isEmpty()){
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}elseif(!repoid.equals("")){
//usageStatsRepository.executeBatchItems(reportItems,repoid,"Part of book or chapter of book",beginDateParsed,endDateParsed,granularity);
//if(reportItems.isEmpty()){
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}elseif(reportName.equals("")){
//reportExceptions.add(newSUSHI_Error_Model("3050","Error","usagecounts.openaire.eu","Report argument is missing","You must supply a Report argument"));
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3000","Error","usagecounts.openaire.eu","Report "+reportName+" not supported","Supported reports: AR1, IR1, RR1, BR1, BR2"));
@ -450,23 +451,37 @@ public class SushiLiteServiceImpl implements SushiLiteService {
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3021","Warning","usagecounts.openaire.eu","Unspecified Date Arguments","Begin Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)));
reportExceptions.add(newSUSHI_Error_Model("3021","Warning","Unspecified Date Arguments","usagecounts.openaire.eu","Begin Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)));
}
DateendDateParsed;
@ -499,49 +514,230 @@ public class SushiLiteServiceImpl implements SushiLiteService {
reportExceptions.add(newSUSHI_Error_Model("3021","Warning","usagecounts.openaire.eu","Unspecified Date Arguments","End Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)));
reportExceptions.add(newSUSHI_Error_Model("3021","Warning","Unspecified Date Arguments","usagecounts.openaire.eu","End Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)));
reportExceptions.add(newSUSHI_Error_Model("3020","Error","usagecounts.openaire.eu","Invalid Date Arguments","Begin Date: "+beginDate+" is not a valid date"));
reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","Begin Date: "+beginDate+" is not a valid date"));
}
if(endDateParsed==null){
reportExceptions.add(newSUSHI_Error_Model("3020","Error","usagecounts.openaire.eu","Invalid Date Arguments","End Date: "+endDate+" is not a valid date"));
reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","End Date: "+endDate+" is not a valid date"));
reportExceptions.add(newSUSHI_Error_Model("3020","Error","usagecounts.openaire.eu","Invalid Date Arguments","BeginDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)+"\' is greater than EndDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)+"\'"));
reportExceptions.add(newSUSHI_Error_Model("3020","Error","Invalid Date Arguments","usagecounts.openaire.eu","BeginDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)+"\' is greater than EndDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)+"\'"));
reportExceptions.add(newSUSHI_Error_Model("3060","Error","Invalid Filter Value","usagecounts.openaire.eu","RepositoryIdentifier: "+repositoryIdentifier+" is not valid"));
}
//}
Stringitemid="";
if(!itemIdentifier.equals("")){
String[]split=itemIdentifier.split(":");
switch(split[0].toLowerCase()){
case"oid":
itemid=itemIdentifier;
break;
case"doi":
itemid=itemIdentifier;
break;
//case"openaire":
//itemid=itemIdentifier;
//break;
default:
reportExceptions.add(newSUSHI_Error_Model("3060","Error","Invalid Filter Value","usagecounts.openaire.eu","ItemIdentifier: "+itemIdentifier+" is not valid"));
itemid="-1";
}
}
if(itemid.equals("")&&repoid.equals("")){
reportExceptions.add(newSUSHI_Error_Model("3070","Error","Required Filter Missing","usagecounts.openaire.eu","ItemIdentifier or RepositoryIdentifier must be supplied"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//if(dataType.equalsIgnoreCase("")||dataType.equalsIgnoreCase("part of book or chapter of book")){
//usageStatsRepository.executeItem(reportItems,itemIdentifier,repoid,"Part of book or chapter of book",beginDateParsed,endDateParsed,granularity);
//if(reportItems.isEmpty()){
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//}
//}elseif(!repoid.equals("")){
//usageStatsRepository.executeBatchItems(reportItems,repoid,"Part of book or chapter of book",beginDateParsed,endDateParsed,granularity);
//if(reportItems.isEmpty()){
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));
}
//}elseif(reportName.equals("")){
//reportExceptions.add(newSUSHI_Error_Model("3050","Error","usagecounts.openaire.eu","Report argument is missing","You must supply a Report argument"));
//}else{
//reportExceptions.add(newSUSHI_Error_Model("3000","Error","usagecounts.openaire.eu","Report "+reportName+" not supported","Supported reports: AR1, IR1, RR1, BR1, BR2"));
//reportExceptions.add(newSUSHI_Error_Model("3021","Warning","usagecounts.openaire.eu","Unspecified Date Arguments","Begin Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)));
//reportExceptions.add(newSUSHI_Error_Model("3021","Warning","usagecounts.openaire.eu","Unspecified Date Arguments","End Date set to default: "+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)));
//reportExceptions.add(newSUSHI_Error_Model("3020","Error","usagecounts.openaire.eu","Invalid Date Arguments","Begin Date: "+beginDate+" is not a valid date"));
//}
//if(endDateParsed==null){
//reportExceptions.add(newSUSHI_Error_Model("3020","Error","usagecounts.openaire.eu","Invalid Date Arguments","End Date: "+endDate+" is not a valid date"));
//reportExceptions.add(newSUSHI_Error_Model("3020","Error","usagecounts.openaire.eu","Invalid Date Arguments","BeginDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(beginDateParsed)+"\' is greater than EndDate \'"+newSimpleDateFormat("yyyy-MM-dd").format(endDateParsed)+"\'"));
//reportExceptions.add(newSUSHI_Error_Model("3030","Error","usagecounts.openaire.eu","No Usage Available for Requested Dates","Service did not find any data"));