Beta 15032021

This commit is contained in:
Dimitris 2021-03-16 07:56:18 +02:00
parent 3b6f93c03f
commit e04f137a4c
10 changed files with 681 additions and 718 deletions

View File

@ -1 +1 @@
java -jar target/usagestats_r5.jar --spring.config.location=file:./usageStatsAPI.properties &
java -jar target/usagestats_r5.jar --spring.config.location=file:./usageStatsAPI.properties

View File

@ -44,6 +44,9 @@ public class WebMvcConfiguration extends WebMvcConfigurerAdapter {
registry.addViewController("/sushilite/IR").setViewName("redirect:/sushilite/IR/");
registry.addViewController("/sushilite/IR/").setViewName("forward:/sushilite/IR/index.html");
registry.addViewController("/sushilite/DSR").setViewName("redirect:/sushilite/DSR/");
registry.addViewController("/sushilite/DSR/").setViewName("forward:/sushilite/DSR/index.html");
super.addViewControllers(registry);
}
}

View File

@ -8,6 +8,13 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.servlet.http.HttpServletResponse;
import org.apache.log4j.Logger;
@ -38,25 +45,6 @@ class SushiLiteController {
this.sushiLiteService = sushiLiteService;
}
// @RequestMapping(value = "/sushilite/r5/GetReport/", method = RequestMethod.GET)
// public String getReport(
// @RequestParam(value = "Report", defaultValue = "") String reportP,
// @RequestParam(value = "Release", defaultValue = "4") String release,
// @RequestParam(value = "RequestorID", defaultValue = "anonymous") String requestorId,
// @RequestParam(value = "BeginDate", defaultValue = "") String beginDate,
// @RequestParam(value = "EndDate", defaultValue = "") String endDate,
// @RequestParam(value = "RepositoryIdentifier", defaultValue = "") String repositoryIdentifier,
// @RequestParam(value = "ItemIdentifier", defaultValue = "") String itemIdentifier,
// @RequestParam(value = "ItemDataType", defaultValue = "") String itemDataType,
// @RequestParam(value = "hasDOI", defaultValue = "") String hasDoi,
// @RequestParam(value = "Granularity", defaultValue = "Monthly") String granularity,
// @RequestParam(value = "Callback", defaultValue = "") String callback,
// @RequestParam(value = "Pretty", defaultValue = "") String pretty) {
// log.info("Sushi Report request: " + reportP + " from " + requestorId);
// log.info("repository identifier: " + repositoryIdentifier + " - item identifier: " + itemIdentifier);
//
// return sushiLiteService.displayReport(reportP, release, requestorId, beginDate, endDate, repositoryIdentifier, itemIdentifier, itemDataType, hasDoi, granularity, callback, pretty);
// }
@RequestMapping(value = "/sushilite/r5/status", method = RequestMethod.GET)
public String getReportStatus() {
log.info("COUNTER Report status request ");
@ -96,8 +84,11 @@ class SushiLiteController {
@RequestParam(value = "DataType", defaultValue = "") String dataType,
@RequestParam(value = "Granularity", defaultValue = "Monthly") String granularity) {
log.info("COUNTER ΙR Report request for repository " + repositoryIdentifier + " and for item " + itemIdentifier);
String report = sushiLiteService.displayReportIR(requestorId, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, dataType, granularity);
class BuildReportWithTimeout implements Callable<ResponseEntity> {
@Override
public ResponseEntity call() throws Exception {
String report = sushiLiteService.displayReportIR(requestorId, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, dataType, granularity);
if (report.indexOf(".zip") < 0) {
return new ResponseEntity<>(report, HttpStatus.OK);
} else {
@ -106,19 +97,91 @@ class SushiLiteController {
return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
}
}
}
final ExecutorService executor = Executors.newSingleThreadExecutor();
final Future<ResponseEntity> future = executor.submit(new BuildReportWithTimeout());
try {
return future.get(2, TimeUnit.MINUTES);
} catch (InterruptedException ie) {
String compressedOutput = "<pre> {\"Report\":\"IR\", \"Description\":\"Large Report Timeout. Please contact usagecounts@openaire.eu for requests" + "\"} </pre>";
return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
} catch (ExecutionException ee) {
/* Handle the error. Or ignore it. */
} catch (TimeoutException te) {
String compressedOutput = "<pre> {\"Report\":\"IR\", \"Description\":\"Large Report Timeout. Please contact usagecounts@openaire.eu for requests" + "\"} </pre>";
return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
}
if (!executor.isTerminated()) {
executor.shutdownNow();
}
return null;
// String report = sushiLiteService.displayReportIR(requestorId, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, dataType, granularity);
//
// if (report.indexOf(".zip") < 0) {
// return new ResponseEntity<>(report, HttpStatus.OK);
// } else {
//
// String compressedOutput = "<pre> {\"Report\":\"IR\", \"Description\":\"Compressed Report Due to large number of records\", \"URL To Download Report from: \":\"" + report + "\"} </pre>";
// return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
// }
}
@RequestMapping(value = "/sushilite/r5/reports/dsr", method = RequestMethod.GET)
public String getReportDSR(
public ResponseEntity getReportDSR(
@RequestParam(value = "RepositoryIdentifier", defaultValue = "") String repositoryIdentifier,
@RequestParam(value = "ItemIdentifier", defaultValue = "") String itemIdentifier,
@RequestParam(value = "DatasetIdentifier", defaultValue = "") String itemIdentifier,
@RequestParam(value = "RequestorID", defaultValue = "anonymous") String requestorId,
@RequestParam(value = "BeginDate", defaultValue = "") String beginDate,
@RequestParam(value = "EndDate", defaultValue = "") String endDate,
@RequestParam(value = "MetricType", defaultValue = "") List<String> metricType,
@RequestParam(value = "DataType", defaultValue = "") String dataType,
@RequestParam(value = "Granularity", defaultValue = "Monthly") String granularity) {
log.info("COUNTER ΙR Report request for repository " + repositoryIdentifier + " and for item " + itemIdentifier);
return sushiLiteService.displayReportDSR(requestorId, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, dataType, granularity);
@RequestParam(value = "Granularity", defaultValue = "Monthly") String granularity) throws Exception {
log.info("COUNTER DSR Report request for repository " + repositoryIdentifier + " and for item " + itemIdentifier);
class BuildReportWithTimeout implements Callable<ResponseEntity> {
@Override
public ResponseEntity call() throws Exception {
String report = sushiLiteService.displayReportDSR(requestorId, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, granularity);
if (report.indexOf(".zip") < 0) {
return new ResponseEntity<>(report, HttpStatus.OK);
} else {
String compressedOutput = "<pre> {\"Report\":\"DSR\", \"Description\":\"Compressed Report Due to large number of records\", \"URL To Download Report from: \":\"" + report + "\"} </pre>";
return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
}
}
}
final ExecutorService executor = Executors.newSingleThreadExecutor();
final Future<ResponseEntity> future = executor.submit(new BuildReportWithTimeout());
try {
return future.get(2, TimeUnit.MINUTES);
} catch (InterruptedException ie) {
String compressedOutput = "<pre> {\"Report\":\"DSR\", \"Description\":\"Large Report Timeout. Please contact usagecounts@openaire.eu for requests" + "\"} </pre>";
return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
} catch (ExecutionException ee) {
/* Handle the error. Or ignore it. */
} catch (TimeoutException te) {
String compressedOutput = "<pre> {\"Report\":\"DSR\", \"Description\":\"Large Report Timeout. Please contact usagecounts@openaire.eu for requests" + "\"} </pre>";
return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
}
if (!executor.isTerminated()) {
executor.shutdownNow();
}
return null;
// String report = sushiLiteService.displayReportDSR(requestorId, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, granularity);
// if (report.indexOf(".zip") < 0) {
// return new ResponseEntity<>(report, HttpStatus.OK);
// } else {
//
// String compressedOutput = "<pre> {\"Report\":\"DSR\", \"Description\":\"Compressed Report Due to large number of records\", \"URL To Download Report from: \":\"" + report + "\"} </pre>";
// return new ResponseEntity<>(compressedOutput, HttpStatus.OK);
// }
}
@RequestMapping(value = "/download/{file_name}", method = RequestMethod.GET)

View File

@ -685,15 +685,15 @@ public class UsageStatsRepository {
}
public void executeItemDSR(List<COUNTER_Dataset_Usage> reportItems, String repositoryIdentifier, String itemIdentifier, Date beginDate,
Date endDate, List<String> metricType, String itemDataType, String granularity) {
Date endDate, List<String> metricType, String granularity) {
String[] split = itemIdentifier.split(":");
switch (split[0].toLowerCase()) {
case "oid":
executeDSROid(reportItems, repositoryIdentifier, itemIdentifier.replaceFirst(split[0] + ":", ""), beginDate, endDate, metricType, itemDataType, granularity);
executeDSROid(reportItems, repositoryIdentifier, itemIdentifier.replaceFirst(split[0] + ":", ""), beginDate, endDate, metricType, granularity);
break;
case "doi":
executeDSRDoi(reportItems, repositoryIdentifier, itemIdentifier.replaceFirst(split[0] + ":", ""), beginDate, endDate, metricType, itemDataType, granularity);
executeDSRDoi(reportItems, repositoryIdentifier, itemIdentifier.replaceFirst(split[0] + ":", ""), beginDate, endDate, metricType, granularity);
break;
// case "openaire":
// executeOpenaire(reportItems, itemIdentifier.replaceFirst(split[0] + ":", ""), repositoryIdentifier, itemDataType, beginDate, endDate, granularity);
@ -765,7 +765,7 @@ public class UsageStatsRepository {
}
private void executeDSROid(List<COUNTER_Dataset_Usage> reportItems, String repositoryIdentifier,
String oid, Date beginDate, Date endDate, List<String> metricType, String itemDataType, String granularity) {
String oid, Date beginDate, Date endDate, List<String> metricType, String granularity) {
Connection connection = null;
PreparedStatement st = null;
ResultSet rs = null;
@ -782,9 +782,9 @@ public class UsageStatsRepository {
while (rs.next()) {
if (repositoryIdentifier != null) {
executeBatchItemsDSR(reportItems, repositoryIdentifier, rs.getString(1), beginDate, endDate, metricType, itemDataType, granularity);
executeBatchItemsDSR(reportItems, repositoryIdentifier, rs.getString(1), beginDate, endDate, metricType, granularity);
} else {
executeItemsAllRepoDSR(reportItems, rs.getString(1), beginDate, endDate, metricType, itemDataType, granularity);
executeItemsAllRepoDSR(reportItems, rs.getString(1), beginDate, endDate, metricType, granularity);
}
}
} catch (Exception e) {
@ -797,7 +797,7 @@ public class UsageStatsRepository {
}
private void executeDSRDoi(List<COUNTER_Dataset_Usage> reportItems, String repositoryIdentifier,
String doi, Date beginDate, Date endDate, List<String> metricType, String itemDataType, String granularity) {
String doi, Date beginDate, Date endDate, List<String> metricType, String granularity) {
Connection connection = null;
PreparedStatement st = null;
ResultSet rs = null;
@ -815,9 +815,9 @@ public class UsageStatsRepository {
while (rs.next()) {
if (repositoryIdentifier != null) {
executeBatchItemsDSR(reportItems, repositoryIdentifier, rs.getString(1), beginDate, endDate, metricType, itemDataType, granularity);
executeBatchItemsDSR(reportItems, repositoryIdentifier, rs.getString(1), beginDate, endDate, metricType,granularity);
} else {
executeItemsAllRepoDSR(reportItems, rs.getString(1), beginDate, endDate, metricType, itemDataType, granularity);
executeItemsAllRepoDSR(reportItems, rs.getString(1), beginDate, endDate, metricType, granularity);
}
}
} catch (Exception e) {
@ -2695,7 +2695,7 @@ public class UsageStatsRepository {
public void executeBatchItemsDSR(List<COUNTER_Dataset_Usage> reportItems,
String repositoryIdentifier, String itemIdentifier, Date beginDate,
Date endDate, List<String> metricType, String dataType, String granularity) throws Exception {
Date endDate, List<String> metricType, String granularity) throws Exception {
SimpleDateFormat report_dateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat postgresFormat = new SimpleDateFormat("yyyy/MM");
String beginDateStr = postgresFormat.format(beginDate);
@ -2711,66 +2711,68 @@ public class UsageStatsRepository {
connection = usageStatsDB.getConnection();
if (granularity.equalsIgnoreCase("totals")) {
if (dataType.equals("")) {
// if (dataType.equals("")) {
// st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
// + "SELECT rc.type, sum(us.downloads) as downloads, sum(us.views) as views, "
// + "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
// + "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews, "
// + "dp.access_method as access_method "
// + "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
// + statsDB + ".result_oids ro, tpd, datasetsusagestats_20210312a.datasetsperformance dp "
// + "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND rc.id=us.result_id AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
// + "AND dp.ds_type=ro.oid "
// + "GROUP BY rc.type, rs.title, us.result_id, rs.title, rs.year, dp.access_method order by rc.type ASC;");
//
// st.setString(1, beginDateStr);
// st.setString(2, endDateStr);
// st.setString(3, repositoryIdentifier);
//
// rs = st.executeQuery();
// COUNTER_Dataset_Usage reportItem = null;
//
// boolean[] metricTypeValue = {false, false, false, false};
// if (metricType.contains("Total_Dataset_Requests")) {
// metricTypeValue[0] = true;
// }
// if (metricType.contains("Total_Dataset_Investigations")) {
// metricTypeValue[1] = true;
// }
// if (metricType.contains("Unique_Dataset_Requests")) {
// metricTypeValue[2] = true;
// }
// if (metricType.contains("Unique_Dataset_Investigations")) {
// metricTypeValue[3] = true;
// }
//
// while (rs.next()) {
// reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(6)), rs.getString(10));
// String[] identifiersAll = rs.getString(7).split("#!#");
// for (int i = 0; i < identifiersAll.length; i++) {
// String[] typeIdentifierArray = identifiersAll[i].split("#-#");
// reportItem.addIdentifier(new COUNTER_Dataset_Identifiers(typeIdentifierArray[0], typeIdentifierArray[1]));
// }
//
// reportItem.addPerformance(new COUNTER_Dataset_Performance(report_dateFormat.format(beginDate), report_dateFormat.format(endDate),
// metricTypeValue[0] == true ? rs.getString(2) : null, metricTypeValue[1] == true ? rs.getString(3) : null, metricTypeValue[2] == true ? rs.getString(8) : null, metricTypeValue[3] == true ? rs.getString(9) : null));
// reportItems.add(reportItem);
// }
//
// } //else {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews, "
+ "dp.access_method as access_method "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND rc.id=us.result_id AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY rc.type, rs.title, us.result_id, rs.title, rs.year order by rc.type ASC;");
+ statsDB + ".result_oids ro, tpd, datasetsusagestats_20210312a.datasetsperformance dp "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id AND rc.type='Dataset' "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, rs.year, dp.access_method ORDER by rc.type ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, repositoryIdentifier);
rs = st.executeQuery();
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
if (metricType.contains("Total_Dataset_Requests")) {
metricTypeValue[0] = true;
}
if (metricType.contains("Total_Dataset_Investigations")) {
metricTypeValue[1] = true;
}
if (metricType.contains("Unique_Dataset_Requests")) {
metricTypeValue[2] = true;
}
if (metricType.contains("Unique_Dataset_Investigations")) {
metricTypeValue[3] = true;
}
while (rs.next()) {
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(6)), "Regular");
String[] identifiersAll = rs.getString(7).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
reportItem.addIdentifier(new COUNTER_Dataset_Identifiers(typeIdentifierArray[0], typeIdentifierArray[1]));
}
reportItem.addPerformance(new COUNTER_Dataset_Performance(report_dateFormat.format(beginDate), report_dateFormat.format(endDate),
metricTypeValue[0] == true ? rs.getString(2) : null, metricTypeValue[1] == true ? rs.getString(3) : null, metricTypeValue[2] == true ? rs.getString(8) : null, metricTypeValue[3] == true ? rs.getString(9) : null));
reportItems.add(reportItem);
}
} else {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND rc.type=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, rs.year order by rc.type ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, repositoryIdentifier);
st.setString(4, dataType);
rs = st.executeQuery();
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
@ -2788,7 +2790,7 @@ public class UsageStatsRepository {
metricTypeValue[3] = true;
}
while (rs.next()) {
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(6)), "Regular");
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(6)), rs.getString(10));
String[] identifiersAll = rs.getString(7).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
@ -2799,91 +2801,21 @@ public class UsageStatsRepository {
metricTypeValue[0] == true ? rs.getString(2) : null, metricTypeValue[1] == true ? rs.getString(3) : null, metricTypeValue[2] == true ? rs.getString(8) : null, metricTypeValue[3] == true ? rs.getString(9) : null));
reportItems.add(reportItem);
}
}
//}
} else if (granularity.equalsIgnoreCase("monthly")) {
if (dataType.equals("")) {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, us.`date`, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews, "
+ "dp.access_method as access_method "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND rc.id=us.result_id AND us.result_id=rs.id AND ro.id=us.result_id "
+ "AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year order by rc.type, us.`date` ASC;");
+ statsDB + ".result_oids ro, tpd, datasetsusagestats_20210312a.datasetsperformance dp "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id AND rc.type='Dataset' "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year, dp.access_method ORDER by rc.type, us.`date` ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, repositoryIdentifier);
rs = st.executeQuery();
String result = "";
String lastDate = "";
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
if (metricType.contains("Total_Dataset_Requests")) {
metricTypeValue[0] = true;
}
if (metricType.contains("Total_Dataset_Investigations")) {
metricTypeValue[1] = true;
}
if (metricType.contains("Unique_Dataset_Requests")) {
metricTypeValue[2] = true;
}
if (metricType.contains("Unique_Dataset_Investigations")) {
metricTypeValue[3] = true;
}
int ft_total = 0;
int abstr = 0;
Calendar endCal = Calendar.getInstance();
endCal.setTime(postgresFormat.parse(endDateStr));
endCal.add(Calendar.MONTH, 1);
Date endDateForZeros = endCal.getTime();
lastDate = beginDateStr;
String datatype = "";
while (rs.next()) {
Calendar endC = Calendar.getInstance();
endC.setTime(postgresFormat.parse(rs.getString(2)));
endC.set(Calendar.DATE, endC.getActualMaximum(Calendar.DATE));
// //iterate on data types
if (!datatype.equals(rs.getString(1))) {
datatype = rs.getString(1);
}
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(7)), "Regular");
String[] identifiersAll = rs.getString(8).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
reportItem.addIdentifier(new COUNTER_Dataset_Identifiers(typeIdentifierArray[0], typeIdentifierArray[1]));
}
reportItem.addPerformance(new COUNTER_Dataset_Performance(report_dateFormat.format(postgresFormat.parse(rs.getString(2))), report_dateFormat.format(endC.getTime()),
metricTypeValue[0] == true ? rs.getString(3) : null, metricTypeValue[1] == true ? rs.getString(4) : null, metricTypeValue[2] == true ? rs.getString(9) : null, metricTypeValue[3] == true ? rs.getString(10) : null));
reportItems.add(reportItem);
endC.setTime(postgresFormat.parse(rs.getString(2)));
endC.add(Calendar.MONTH, 1);
lastDate = postgresFormat.format(endC.getTime());
//if (reportItem != null) {
//fillWithZeros(postgresFormat.parse(lastDate), endDateForZeros, reportItem);
}
} else {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, us.`date`, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND rc.type=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year order by rc.type, us.`date` ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, repositoryIdentifier);
st.setString(4, dataType);
rs = st.executeQuery();
String result = "";
@ -2929,7 +2861,7 @@ public class UsageStatsRepository {
datatype = rs.getString(1);
}
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(7)), "Regular");
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(7)), rs.getString(11));
String[] identifiersAll = rs.getString(8).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
@ -2939,9 +2871,6 @@ public class UsageStatsRepository {
metricTypeValue[0] == true ? rs.getString(3) : null, metricTypeValue[1] == true ? rs.getString(4) : null, metricTypeValue[2] == true ? rs.getString(9) : null, metricTypeValue[3] == true ? rs.getString(10) : null));
reportItems.add(reportItem);
// }
//
// //}
endC.setTime(postgresFormat.parse(rs.getString(2)));
endC.add(Calendar.MONTH, 1);
lastDate = postgresFormat.format(endC.getTime());
@ -2949,7 +2878,6 @@ public class UsageStatsRepository {
//fillWithZeros(postgresFormat.parse(lastDate), endDateForZeros, reportItem);
}
}
}
/*
jedis.put(redis_key, "persistent", "false");
jedis.put(redis_key, "query", st.toString());
@ -2968,15 +2896,16 @@ public class UsageStatsRepository {
connection = usageStatsDB.getConnection();
if (granularity.equalsIgnoreCase("totals")) {
if (dataType.equals("")) {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews,"
+ "dp.access_method as access_method "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND us.result_id=? AND rc.id=us.result_id AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY rc.type, rs.title, us.result_id, rs.title, rs.year order by rc.type ASC;");
+ statsDB + ".result_oids ro, tpd, datasetsusagestats_20210312a.datasetsperformance dp "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND us.result_id=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id AND rc.type='Dataset' "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, rs.year, dp.access_method ORDER by rc.type ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
@ -3000,52 +2929,7 @@ public class UsageStatsRepository {
}
while (rs.next()) {
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(6)), "Regular");
String[] identifiersAll = rs.getString(7).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
reportItem.addIdentifier(new COUNTER_Dataset_Identifiers(typeIdentifierArray[0], typeIdentifierArray[1]));
}
reportItem.addPerformance(new COUNTER_Dataset_Performance(report_dateFormat.format(beginDate), report_dateFormat.format(endDate),
metricTypeValue[0] == true ? rs.getString(2) : null, metricTypeValue[1] == true ? rs.getString(3) : null, metricTypeValue[2] == true ? rs.getString(8) : null, metricTypeValue[3] == true ? rs.getString(9) : null));
reportItems.add(reportItem);
}
} else {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND us.result_id=? AND rc.type=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, rs.year order by rc.type ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, repositoryIdentifier);
st.setString(4, itemIdentifier);
st.setString(5, dataType);
rs = st.executeQuery();
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
if (metricType.contains("Total_Dataset_Requests")) {
metricTypeValue[0] = true;
}
if (metricType.contains("Total_Dataset_Investigations")) {
metricTypeValue[1] = true;
}
if (metricType.contains("Unique_Dataset_Requests")) {
metricTypeValue[2] = true;
}
if (metricType.contains("Unique_Dataset_Investigations")) {
metricTypeValue[3] = true;
}
while (rs.next()) {
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(6)), "Regular");
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(6)), rs.getString(10));
String[] identifiersAll = rs.getString(7).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
@ -3055,94 +2939,23 @@ public class UsageStatsRepository {
metricTypeValue[0] == true ? rs.getString(2) : null, metricTypeValue[1] == true ? rs.getString(3) : null, metricTypeValue[2] == true ? rs.getString(8) : null, metricTypeValue[3] == true ? rs.getString(9) : null));
reportItems.add(reportItem);
}
}
} else if (granularity.equalsIgnoreCase("monthly")) {
if (dataType.equals("")) {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, us.`date`, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews, "
+ "dp.access_method as access_method "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND us.result_id=? AND rc.id=us.result_id AND us.result_id=rs.id AND ro.id=us.result_id "
+ "AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year order by rc.type, us.`date` ASC;");
+ statsDB + ".result_oids ro, tpd, datasetsusagestats_20210312a.datasetsperformance dp "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND us.result_id=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id AND rc.type='Dataset' "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year, dp.access_method ORDER by rc.type, us.`date` ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, repositoryIdentifier);
st.setString(4, itemIdentifier);
rs = st.executeQuery();
String result = "";
String lastDate = "";
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
if (metricType.contains("Total_Dataset_Requests")) {
metricTypeValue[0] = true;
}
if (metricType.contains("Total_Dataset_Investigations")) {
metricTypeValue[1] = true;
}
if (metricType.contains("Unique_Dataset_Requests")) {
metricTypeValue[2] = true;
}
if (metricType.contains("Unique_Dataset_Investigations")) {
metricTypeValue[3] = true;
}
int ft_total = 0;
int abstr = 0;
Calendar endCal = Calendar.getInstance();
endCal.setTime(postgresFormat.parse(endDateStr));
endCal.add(Calendar.MONTH, 1);
Date endDateForZeros = endCal.getTime();
lastDate = beginDateStr;
String datatype = "";
while (rs.next()) {
Calendar endC = Calendar.getInstance();
endC.setTime(postgresFormat.parse(rs.getString(2)));
endC.set(Calendar.DATE, endC.getActualMaximum(Calendar.DATE));
// //iterate on data types
if (!datatype.equals(rs.getString(1))) {
datatype = rs.getString(1);
}
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(7)), "Regular");
String[] identifiersAll = rs.getString(8).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
reportItem.addIdentifier(new COUNTER_Dataset_Identifiers(typeIdentifierArray[0], typeIdentifierArray[1]));
}
reportItem.addPerformance(new COUNTER_Dataset_Performance(report_dateFormat.format(postgresFormat.parse(rs.getString(2))), report_dateFormat.format(endC.getTime()),
metricTypeValue[0] == true ? rs.getString(3) : null, metricTypeValue[1] == true ? rs.getString(4) : null, metricTypeValue[2] == true ? rs.getString(9) : null, metricTypeValue[3] == true ? rs.getString(10) : null));
reportItems.add(reportItem);
endC.setTime(postgresFormat.parse(rs.getString(2)));
endC.add(Calendar.MONTH, 1);
lastDate = postgresFormat.format(endC.getTime());
//if (reportItem != null) {
//fillWithZeros(postgresFormat.parse(lastDate), endDateForZeros, reportItem);
}
} else {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, us.`date`, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=? AND us.result_id=? AND rc.type=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year order by rc.type, us.`date` ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, repositoryIdentifier);
st.setString(4, itemIdentifier);
st.setString(5, dataType);
rs = st.executeQuery();
String result = "";
String lastDate = "";
@ -3183,7 +2996,7 @@ public class UsageStatsRepository {
datatype = rs.getString(1);
}
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(7)), "Regular");
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", platform, rs.getString(1), Integer.toString(rs.getInt(7)), rs.getString(11));
String[] identifiersAll = rs.getString(8).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
@ -3200,7 +3013,6 @@ public class UsageStatsRepository {
//fillWithZeros(postgresFormat.parse(lastDate), endDateForZeros, reportItem);
}
}
}
/*
jedis.put(redis_key, "persistent", "false");
jedis.put(redis_key, "query", st.toString());
@ -3219,7 +3031,7 @@ public class UsageStatsRepository {
public void executeItemsAllRepoDSR(List<COUNTER_Dataset_Usage> reportItems,
String itemIdentifier, Date beginDate,
Date endDate, List<String> metricType, String dataType, String granularity) throws Exception {
Date endDate, List<String> metricType, String granularity) throws Exception {
SimpleDateFormat report_dateFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat postgresFormat = new SimpleDateFormat("yyyy/MM");
String beginDateStr = postgresFormat.format(beginDate);
@ -3233,65 +3045,22 @@ public class UsageStatsRepository {
connection = usageStatsDB.getConnection();
if (granularity.equalsIgnoreCase("totals")) {
if (dataType.equals("")) {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, ds.name, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews, "
+ "dp.access_method "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd, " + statsDB + ".datasource ds "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=ds.id AND us.result_id=? AND rc.id=us.result_id AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY rc.type, rs.title, us.result_id, rs.title, rs.year, ds.name order by rc.type ASC;");
+ statsDB + ".result_oids ro, tpd, " + statsDB + ".datasource ds, datasetsusagestats_20210312a.datasetsperformance dp "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=ds.id AND us.result_id=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id AND rc.type='Dataset' "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, rs.year, ds.name,dp.access_method ORDER by rc.type ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, itemIdentifier);
rs = st.executeQuery();
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
if (metricType.contains("Total_Dataset_Requests")) {
metricTypeValue[0] = true;
}
if (metricType.contains("Total_Dataset_Investigations")) {
metricTypeValue[1] = true;
}
if (metricType.contains("Unique_Dataset_Requests")) {
metricTypeValue[2] = true;
}
if (metricType.contains("Unique_Dataset_Investigations")) {
metricTypeValue[3] = true;
}
while (rs.next()) {
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", rs.getString(8), rs.getString(1), Integer.toString(rs.getInt(6)), "Regular");
String[] identifiersAll = rs.getString(7).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
reportItem.addIdentifier(new COUNTER_Dataset_Identifiers(typeIdentifierArray[0], typeIdentifierArray[1]));
}
reportItem.addPerformance(new COUNTER_Dataset_Performance(report_dateFormat.format(beginDate), report_dateFormat.format(endDate),
metricTypeValue[0] == true ? rs.getString(2) : null, metricTypeValue[1] == true ? rs.getString(3) : null, metricTypeValue[2] == true ? rs.getString(9) : null, metricTypeValue[3] == true ? rs.getString(10) : null));
reportItems.add(reportItem);
}
} else {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, ds.name, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd, " + statsDB + ".datasource ds "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=ds.id AND us.result_id=? AND rc.type=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, rs.year, ds.name order by rc.type ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, itemIdentifier);
st.setString(4, dataType);
rs = st.executeQuery();
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
@ -3311,7 +3080,7 @@ public class UsageStatsRepository {
while (rs.next()) {
String platform = getInstitutionName(rs.getString(8));
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", rs.getString(8), rs.getString(1), Integer.toString(rs.getInt(6)), "Regular");
reportItem = new COUNTER_Dataset_Usage(rs.getString(5), "OpenAIRE", rs.getString(8), rs.getString(1), Integer.toString(rs.getInt(6)), rs.getString(11));
String[] identifiersAll = rs.getString(7).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
@ -3323,20 +3092,19 @@ public class UsageStatsRepository {
reportItems.add(reportItem);
}
}
//}
} else if (granularity.equalsIgnoreCase("monthly")) {
if (dataType.equals("")) {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, us.`date`, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, ds.name, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews, "
+ "dp.access_method "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd, " + statsDB + ".datasource ds "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=ds.id AND us.result_id=? AND rc.id=us.result_id AND us.result_id=rs.id AND ro.id=us.result_id "
+ "AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year, ds.name order by rc.type, us.`date` ASC;");
+ statsDB + ".result_oids ro, tpd, " + statsDB + ".datasource ds, datasetsusagestats_20210312a.datasetsperformance dp "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=ds.id AND us.result_id=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id AND rc.type='Dataset' "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year, ds.name, dp.access_method ORDER by rc.type, us.`date` ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, itemIdentifier);
@ -3368,73 +3136,6 @@ public class UsageStatsRepository {
endCal.add(Calendar.MONTH, 1);
Date endDateForZeros = endCal.getTime();
lastDate = beginDateStr;
String datatype = "";
while (rs.next()) {
Calendar endC = Calendar.getInstance();
endC.setTime(postgresFormat.parse(rs.getString(2)));
endC.set(Calendar.DATE, endC.getActualMaximum(Calendar.DATE));
// //iterate on data types
if (!datatype.equals(rs.getString(1))) {
datatype = rs.getString(1);
}
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", rs.getString(9), rs.getString(1), Integer.toString(rs.getInt(7)), "Regular");
String[] identifiersAll = rs.getString(8).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
reportItem.addIdentifier(new COUNTER_Dataset_Identifiers(typeIdentifierArray[0], typeIdentifierArray[1]));
}
reportItem.addPerformance(new COUNTER_Dataset_Performance(report_dateFormat.format(postgresFormat.parse(rs.getString(2))), report_dateFormat.format(endC.getTime()),
metricTypeValue[0] == true ? rs.getString(3) : null, metricTypeValue[1] == true ? rs.getString(4) : null, metricTypeValue[2] == true ? rs.getString(10) : null, metricTypeValue[3] == true ? rs.getString(11) : null));
reportItems.add(reportItem);
endC.setTime(postgresFormat.parse(rs.getString(2)));
endC.add(Calendar.MONTH, 1);
lastDate = postgresFormat.format(endC.getTime());
//if (reportItem != null) {
//fillWithZeros(postgresFormat.parse(lastDate), endDateForZeros, reportItem);
}
} else {
st = connection.prepareStatement("WITH tpd as (select id, concat(type,'#-#',pid) type_id from " + statsDB + ".result_pids) "
+ "SELECT rc.type, us.`date`, sum(us.downloads) as downloads, sum(us.views) as views, "
+ "us.result_id as resultid, rs.title as item, rs.year as yop, group_concat(distinct tpd.type_id,'#!#') as oid, ds.name, "
+ "count(case when us.downloads >0 then 1 else null end) as uniquedownloads, count(case when us.views >0 then 1 else null end) as uniqueviews "
+ "FROM " + usagestatsImpalaDB + ".usage_stats us, " + statsDB + ".result_classifications rc, " + statsDB + ".result rs, "
+ statsDB + ".result_oids ro, tpd, " + statsDB + ".datasource ds "
+ "WHERE us.`date`>=? AND us.`date`<=? AND us.repository_id=ds.id AND us.result_id=? AND rc.type=? AND rc.id=us.result_id "
+ "AND us.result_id=rs.id AND ro.id=us.result_id AND tpd.id=us.result_id "
+ "GROUP BY ro.id, rc.type, rs.title, us.result_id, us.`date`, rs.year, ds.name order by rc.type, us.`date` ASC;");
st.setString(1, beginDateStr);
st.setString(2, endDateStr);
st.setString(3, itemIdentifier);
st.setString(4, dataType);
rs = st.executeQuery();
String result = "";
String lastDate = "";
COUNTER_Dataset_Usage reportItem = null;
boolean[] metricTypeValue = {false, false, false, false};
if (metricType.contains("Total_Dataset_Requests")) {
metricTypeValue[0] = true;
}
if (metricType.contains("Total_Dataset_Investigations")) {
metricTypeValue[1] = true;
}
if (metricType.contains("Unique_Dataset_Requests")) {
metricTypeValue[2] = true;
}
if (metricType.contains("Unique_Dataset_Investigations")) {
metricTypeValue[3] = true;
}
int ft_total = 0;
int abstr = 0;
Calendar endCal = Calendar.getInstance();
endCal.setTime(postgresFormat.parse(endDateStr));
endCal.add(Calendar.MONTH, 1);
Date endDateForZeros = endCal.getTime();
lastDate = beginDateStr;
String datatype = "";
@ -3450,7 +3151,7 @@ public class UsageStatsRepository {
// reportItem = new COUNTER_Platform_Usage("", "OpenAIRE", rs.getString(1), "Regular", "");
datatype = rs.getString(1);
}
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", rs.getString(9), rs.getString(1), Integer.toString(rs.getInt(7)), "Regular");
reportItem = new COUNTER_Dataset_Usage(rs.getString(6), "OpenAIRE", rs.getString(9), rs.getString(1), Integer.toString(rs.getInt(7)), rs.getString(12));
String[] identifiersAll = rs.getString(8).split("#!#");
for (int i = 0; i < identifiersAll.length; i++) {
String[] typeIdentifierArray = identifiersAll[i].split("#-#");
@ -3468,7 +3169,6 @@ public class UsageStatsRepository {
//fillWithZeros(postgresFormat.parse(lastDate), endDateForZeros, reportItem);
}
}
}
/*
jedis.put(redis_key, "persistent", "false");
jedis.put(redis_key, "query", st.toString());
@ -3567,8 +3267,7 @@ public class UsageStatsRepository {
} catch (Exception e) {
log.error("No member found " + e);
}
finally {
} finally {
DbUtils.closeQuietly(rs);
DbUtils.closeQuietly(st);
DbUtils.closeQuietly(connection);

View File

@ -3,11 +3,7 @@ package eu.dnetlib.usagestats.services;
import eu.dnetlib.usagestats.sushilite.domain.COUNTER_Dataset_Report;
import eu.dnetlib.usagestats.sushilite.domain.COUNTER_Item_Report;
import eu.dnetlib.usagestats.sushilite.domain.COUNTER_Platform_Report;
import eu.dnetlib.usagestats.sushilite.domain.COUNTER_Title_Report;
import eu.dnetlib.usagestats.sushilite.domain.ReportResponseWrapper;
import eu.dnetlib.usagestats.sushilite.domain.SUSHI_Consortium_Member_List;
import eu.dnetlib.usagestats.sushilite.domain.SUSHI_Service_Status;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
@ -39,6 +35,6 @@ public interface SushiLiteService {
COUNTER_Item_Report buildReportIR(String customerID, String repositoryIdentifier, String itemIdentifier, String beginDate,String endDate, List<String> metricType, String dataType,String granularity) throws Exception;
String displayReportIR(String customerID, String repositoryIdentifier, String itemIdentifier, String beginDate,String endDate, List<String> metricType, String dataType,String granularity);
COUNTER_Dataset_Report buildReportDSR(String customerID, String repositoryIdentifier, String itemIdentifier, String beginDate,String endDate, List<String> metricType, String dataType,String granularity) throws Exception;
String displayReportDSR(String customerID, String repositoryIdentifier, String itemIdentifier, String beginDate,String endDate, List<String> metricType, String dataType,String granularity);
COUNTER_Dataset_Report buildReportDSR(String customerID, String repositoryIdentifier, String itemIdentifier, String beginDate,String endDate, List<String> metricType, String granularity) throws Exception;
String displayReportDSR(String customerID, String repositoryIdentifier, String itemIdentifier, String beginDate,String endDate, List<String> metricType, String granularity);
}

View File

@ -310,12 +310,13 @@ public class SushiLiteServiceImpl implements SushiLiteService {
@Override
public ArrayList buildReportSupported() {
ArrayList reportSupportedList = new ArrayList();
SUSHI_Report_List r1 = new SUSHI_Report_List("Status Report", "", "5", "Current status of the reporting service supported by this API", "/status");
SUSHI_Report_List r2 = new SUSHI_Report_List("Members Report", "", "5", "List of UsageCounts members", "/members");
SUSHI_Report_List r1 = new SUSHI_Report_List("Status Report", "Status Report", "5", "Current status of the reporting service supported by this API", "/status");
SUSHI_Report_List r2 = new SUSHI_Report_List("Members Report", "Members Report", "5", "List of UsageCounts members", "/members");
SUSHI_Report_List r3 = new SUSHI_Report_List("List Of Reports Report", "", "5", "List of reports supported by the API", "/reports/");
SUSHI_Report_List r4 = new SUSHI_Report_List("Platform Master Report PR", "PR", "5", "A customizable report summarizing activity across a providers platforms that allows the user to apply filters and select other configuration options for the report. ", "/PR");
SUSHI_Report_List r5 = new SUSHI_Report_List("Platform Usage Report", "PR_P1", "5", "Standard View of the Package Master Report that presents usage for the overall Platform broken down by Metric_Type.", "/PR_1");
SUSHI_Report_List r6 = new SUSHI_Report_List("Platform Item Report", "IR", "5", "COUNTER 'Item Master Report", "/IR");
SUSHI_Report_List r6 = new SUSHI_Report_List("Platform Item Report", "IR", "5", "COUNTER Item Master Report", "/IR");
SUSHI_Report_List r7 = new SUSHI_Report_List("Datasets Report", "IR", "5", "COUNTER Datasets Report", "/DSR");
reportSupportedList.add(r1);
reportSupportedList.add(r2);
@ -323,6 +324,7 @@ public class SushiLiteServiceImpl implements SushiLiteService {
reportSupportedList.add(r4);
reportSupportedList.add(r5);
reportSupportedList.add(r6);
reportSupportedList.add(r7);
return reportSupportedList;
}
@ -693,7 +695,7 @@ public class SushiLiteServiceImpl implements SushiLiteService {
@Override
public COUNTER_Dataset_Report buildReportDSR(String customerID, String repositoryIdentifier, String itemIdentifier, String beginDate,
String endDate, List<String> metricType, String dataType, String granularity) throws Exception {
String endDate, List<String> metricType,String granularity) throws Exception {
ZonedDateTime dateTime = ZonedDateTime.now(); // Gets the current date and time, with your default time-zone
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'");
@ -794,7 +796,7 @@ public class SushiLiteServiceImpl implements SushiLiteService {
if (!itemid.equals("-1") && !repoid.equals("-1") && beginDateParsed != null && endDateParsed != null && beginDateParsed.before(endDateParsed)) {
if (!itemid.equals("") && !repoid.equals("")) {
//if (dataType.equalsIgnoreCase("") || dataType.equalsIgnoreCase("article")) {
usageStatsRepository.executeItemDSR(reportItems, repoid, itemIdentifier, beginDateParsed, endDateParsed, metricType, dataType, granularity);
usageStatsRepository.executeItemDSR(reportItems, repoid, itemIdentifier, beginDateParsed, endDateParsed, metricType, granularity);
if (reportItems.isEmpty()) {
reportExceptions.add(new SUSHI_Error_Model("3030", "Error", "usagecounts.openaire.eu", "No Usage Available for Requested Dates", "Service did not find any data"));
}
@ -802,14 +804,14 @@ public class SushiLiteServiceImpl implements SushiLiteService {
//reportExceptions.add(new SUSHI_Error_Model("3030", "Error", "usagecounts.openaire.eu", "No Usage Available for Requested Dates", "Service did not find any data"));
//}
} else if (!repoid.equals("")) {
usageStatsRepository.executeBatchItemsDSR(reportItems, repoid, itemIdentifier, beginDateParsed, endDateParsed, metricType, dataType, granularity);
usageStatsRepository.executeBatchItemsDSR(reportItems, repoid, itemIdentifier, beginDateParsed, endDateParsed, metricType, granularity);
if (reportItems.isEmpty()) {
reportExceptions.add(new SUSHI_Error_Model("3030", "Error", "usagecounts.openaire.eu", "No Usage Available for Requested Dates", "Service did not find any data"));
}
}
}
if (repoid.equals("")) {
usageStatsRepository.executeItemDSR(reportItems, null, itemIdentifier, beginDateParsed, endDateParsed, metricType, dataType, granularity);
usageStatsRepository.executeItemDSR(reportItems, null, itemIdentifier, beginDateParsed, endDateParsed, metricType, granularity);
if (reportItems.isEmpty()) {
reportExceptions.add(new SUSHI_Error_Model("3030", "Error", "usagecounts.openaire.eu", "No Usage Available for Requested Dates", "Service did not find any data"));
}
@ -1107,13 +1109,11 @@ public class SushiLiteServiceImpl implements SushiLiteService {
@Override
public String displayReportDSR(String customerID, String repositoryIdentifier,
String itemIdentifier, String beginDate,
String endDate, List<String> metricType,
String dataType, String granularity
) {
String endDate, List<String> metricType,String granularity) {
ObjectMapper objectMapper = new ObjectMapper();
try {
COUNTER_Dataset_Report report = buildReportDSR(customerID, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, dataType, granularity);
COUNTER_Dataset_Report report = buildReportDSR(customerID, repositoryIdentifier, itemIdentifier, beginDate, endDate, metricType, granularity);
if (reportForCompression == false) {
return "<pre>" + objectMapper.writerWithDefaultPrettyPrinter().writeValueAsString(report) + "</pre>";
} else {

View File

@ -81,6 +81,7 @@
<li><a href="./sushilite/PR/">COUNTER PR</a></li>
<li><a href="./sushilite/PR_P1/">COUNTER PR_P1</a></li>
<li><a href="./sushilite/IR/">COUNTER IR</a></li>
<li><a href="./sushilite/DSR/">COUNTER Datasets Report</a></li>
</ul>
<br>
</div>

View File

@ -0,0 +1,201 @@
<!DOCTYPE html>
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="OpenAIRE SUSHI Lite Client, open access, research, scientific publication, European Commission,
EC, FP7, ERC, Horizon 2020, H2020, search, projects "/>
<link href="../../assets/favicon.ico" />
<title>OpenAIRE SUSHI Lite Client</title>
<script src="../../assets/jquery.js"></script>
<script src="../../assets/uikit.js"></script>
<script src="../../assets/uikit-icon-max.js"></script>
<link rel="stylesheet" type="text/css" href="../../assets/theme.css">
<link rel="stylesheet" type="text/css" href="../../assets/custom.css">
<link rel="stylesheet" type="text/css" href="../../assets/custom.css.1">
</head>
<body class="" style="">
<div class="uk-offcanvas-content uk-height-viewport">
<!-- MENU STARTS HERE-->
<!-- MAIN MENU STARTS HERE-->
<!--<div class="tm-header-mobile uk-hidden@m">
<div animation="uk-animation-slide-top" class="uk-navbar-container uk-sticky uk-navbar-transparent uk-light" cls-active="uk-active uk-navbar-sticky" cls-inactive="uk-navbar-transparent uk-light" uk-sticky="">
<nav class="uk-navbar-container uk-navbar" uk-navbar="">
<div class="uk-navbar-center">
<a class="uk-logo uk-navbar-item uk-link" href="https://www.openaire.eu">
<img src="../../assets/apple-icon-72x72.png" alt="OpenAIRE" class="uk-responsive-height">
</a>
<a class="uk-navbar-item uk-logo uk-padding-remove-left uk-visible@m" href="../../sushilite/" >
OpenAIRE SUSHI Lite Client</a>
<a class="uk-navbar-item uk-logo uk-padding-remove-left uk-hidden@m" href="../../sushilite/">
SUSHI Lite Client</a>
</div>
</nav>
</div>
</div>
<div class="tm-header uk-visible@m tm-header-transparent" uk-header="">
&lt;!&ndash; top=".tm-header" + [class*=&quot;uk-section&quot;] &ndash;&gt;
<div animation="uk-animation-slide-top" class="uk-navbar-container uk-sticky uk-navbar-transparent uk-light" cls-active="uk-active uk-navbar-sticky" cls-inactive="uk-navbar-transparent uk-light" media="768" uk-sticky="">
<div class="uk-container uk-container-expand">
<nav class="uk-navbar" uk-navbar="{&quot;align&quot;:&quot;left&quot;}" style="background-color:white !important;">
<div class="uk-navbar-center">
<div class="uk-logo uk-navbar-item uk-margin-small-top">
<a class="uk-logo uk-navbar-item uk-link" href="https://www.openaire.eu">
<img alt="OpenAIRE" class="uk-responsive-height" src="../../assets/Logo_Horizontal.png">
</a>
</div>
<div class="uk-logo uk-navbar-item uk-margin-medium-top">
<h3 style="color: #767779 !important;"><a class="uk-navbar-item uk-logo" href="../../sushilite/">
SUSHI Lite Client</a>
</h3>
</div>
</div>
</nav>
</div>
</div>
</div>-->
<!-- MENU ENDS HERE-->
<div class="first_page_section uk-section-default uk-section uk-padding-remove-vertical">
<div class="first_page_banner_headline uk-grid-collapse uk-flex-middle uk-margin-remove-vertical uk-grid" uk-grid="">
</div>
</div>
<div id="tm-main" class=" uk-section tm-middle custom-main-content uk-padding-remove">
<div uk-grid="" class="uk-grid uk-grid-stack">
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first uk-first-column">
<div class="uk-container">
<form action="../../sushilite/r5/reports/dsr/" method="get" class="uk-form uk-width-1-1 uk-container ">
<h3>Report Request</h3>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
Report Name:
</div>
<div class="uk-width-2-3">
<select name='Report'>
<option value='DSR'>DSR</option>
</select>
</div>
</div>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
Release:
</div>
<div class="uk-width-2-3">
<select name='Release'>
<option value="5">5</option>
</select>
</div>
</div>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
Requestor:
</div>
<div class="uk-width-2-3">
<input type="text" name="RequestorID" value="anonymous">
</div>
</div>
<h3>Report Filters</h3>
<h5>Date range</h5>
<p>Valid date formats are yyyy-mm-dd or yyyy-mm. Default range is the last available month.
</p>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
Begin Date:
</div>
<div class="uk-width-2-3">
<input type="text" name="BeginDate" placeholder="2016-03" />
</div>
</div>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
End Date:
</div>
<div class="uk-width-2-3">
<input type="text" name="EndDate" placeholder="2016-06" />
</div>
</div>
<h5>Filters</h5>
<p>Provide either a Repository Identifier or an Item Identifier<br />
Identifier format: <b>namespace:value</b><br />
Valid namespace for Repository Identifier: <b>openaire</b> or <b>opendoar</b>.<br />
Valid namespace for Dataset Identifier: <b>openaire</b>, <b>doi</b> or <b>oid</b>(for OAI-PMH).
</p>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
Repository Identifier:
</div>
<div class="uk-width-2-3">
<input type="text" name="RepositoryIdentifier" placeholder="e.g. openaire:opendoar____::5cbdfd0dfa22a3fca7266376887f549b">
</div>
</div>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
Dataset Identifier:
</div>
<div class="uk-width-2-3">
<input type="text" name="DatasetIdentifier" placeholder="e.g. openaire:od_________7::fb90de6f20d79783d05749d8f60417d5">
</div>
</div>
<p><b>Metric Type<b></p>
<p><input type="checkbox" name="MetricType" value="Total_Dataset_Requests" checked="checked">Total_Dataset_Requests</p>
<p><input type="checkbox" name="MetricType" value="Total_Dataset_Investigations" checked="checked">Total_Dataset_Investigations</p>
<p><input type="checkbox" name="MetricType" value="Unique_Dataset_Requests" checked="checked">Unique_Dataset_Requests</p>
<p><input type="checkbox" name="MetricType" value="Unique_Dataset_Investigations" checked="checked">Unique_Dataset_Investigations</p>
<!--
//<p>You may also limit the results to include or exclude items that have a DOI<br />
//Valid values: Yes or No</p>
//hasDOI:
//<select name='hasDOI'>
//<option value="">Not applicable</option>
//<option value="Yes">Yes</option>
//<option value="No">No</option>
//</select>
-->
<h3>Report Attributes</h3>
<p>Valid Granularity values: Monthly or Totals</p>
<div class="uk-grid">
<div class=" uk-width-1-3 uk-text-right">
Granularity:
</div>
<div class="uk-width-2-3">
<select name='Granularity'>
<option value="Monthly">Monthly</option>
<option value="Totals">Totals</option>
</select>
</div>
</div>
<!--
//<p>The format in which the response is to be returned defaults to JSON unless a callback function name is entered in which case JSONP is returned.</p>
//<input type="text" name="Callback">
-->
<input type="submit" class="uk-button uk-button-primary" value="Get Report"/>
</form>
</div>
</div>
</div>
</div>
<!-- FOOTER STARTS HERE-->
<!--<div class="custom-footer" style="">
<div class="uk-section-primary uk-section uk-section-small">
<div class="uk-container">
<div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid="">
<div class="uk-width-1-1@m uk-first-column">
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-center">
<img alt="OpenAIRE" class="el-image" src="../../assets/Logo_Horizontal_white_small.png">
</div>
<div class="footer-license uk-margin uk-margin-remove-bottom uk-text-center uk-text-lead">
<div><a href="http://creativecommons.org/licenses/by/4.0/" rel="license" target="_blank"><img alt="Creative" src="../../assets/80x15.png" style="height: auto; max-width: 100%; vertical-align: middle;"></a>&nbsp;UNLESS OTHERWISE INDICATED, ALL MATERIALS CREATED BY THE OPENAIRE CONSORTIUM ARE LICENSED UNDER A&nbsp;<a href="http://creativecommons.org/licenses/by/4.0/" rel="license">CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE</a>.</div>
<div>OPENAIRE IS POWERED BY&nbsp;<a href="http://www.d-net.research-infrastructures.eu/" target="_blank">D-NET</a>.</div>
</div>
<div class="uk-margin uk-margin-remove-top uk-margin-remove-bottom uk-text-right">
<a class="uk-totop uk-icon" href="#" uk-scroll="" uk-totop=""></a>
</div>
</div>
</div>
</div>
</div>
</div>-->
</div>
</body>
</html>

View File

@ -81,7 +81,7 @@
<li><a href="./PR/">COUNTER PR</a></li>
<li><a href="./PR_P1/">COUNTER PR_P1</a></li>
<li><a href="./IR/">COUNTER IR</a></li>
<li><a href="./DSR/">COUNTER Datasets Report</a></li>
</ul>
<br>
</div>

View File

@ -5,15 +5,15 @@ spring.datasource.driverClassName=com.cloudera.impala.jdbc41.Driver
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.HSQLDialect
spring.datasource.hikari.max-lifetime=600000
usagestats.url=jdbc:impala://iis-cdh5-test-gw.ocean.icm.edu.pl:21050/;UseNativeQuery=1;AutoReconnect=1
usagestats.redis.hostname=10.19.65.40
usagestats.redis.hostname=localhost
usagestats.redis.port=6379
usagestats.redis_scheme=tcp
spring.jackson.serialization.INDENT_OUTPUT=true
prod.statsdb=openaire_prod_stats
prod.usagestatsImpalaDB=openaire_prod_usage_stats
compression.max_number_of_records=100
download.folder=/home/dimitris.pierrakos/Sushilite_R5/DownloadSushiReports
sushi-lite.server=https://beta.services.openaire.eu/usagestats_r5
download.folder=/Users/dpie/Desktop/DownloadSushiReports
sushi-lite.server=http:://localhost/usagestats_r5
server.servlet.context-path=/usagestats_r5
#server.port=8080
#spring.datasource.testWhileIdle = true