Commit 05122021

This commit is contained in:
dimitrispie 2021-01-05 14:22:04 +02:00
parent 49a56a1e25
commit 5b95e6e3c6
9 changed files with 467 additions and 38 deletions

View File

@ -0,0 +1,31 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by dpie on 28/10/2019.
*/
public class Alert {
private String dateTime;
private String alert;
public Alert() {
}
public Alert(String dateTime, String alert) {
this.dateTime = dateTime;
this.alert = alert;
}
@JsonProperty("Date_Time")
public String getDateTime() {
return dateTime;
}
@JsonProperty("Alert")
public String getAlert() {
return alert;
}
}

View File

@ -0,0 +1,31 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by dpie on 04/01/2020.
*/
public class InstitutionID {
private String type;
private String value;
public InstitutionID() {
}
public InstitutionID(String type, String value) {
this.type = type;
this.value = value;
}
@JsonProperty("Type")
public String getType() {
return type;
}
@JsonProperty("Value")
public String getValue() {
return value;
}
}

View File

@ -17,8 +17,8 @@ public class ItemPerformance {
public ItemPerformance(String start, String end, String ft_count, String abstr) { public ItemPerformance(String start, String end, String ft_count, String abstr) {
period = new Period(start, end); period = new Period(start, end);
instances.add(new Instance("ft_total", ft_count)); instances.add(new Instance("Total_Items_Requests", ft_count));
instances.add(new Instance("abstract", abstr)); instances.add(new Instance("Total_Items_Investigations", abstr));
} }
@JsonProperty("Period") @JsonProperty("Period")
@ -26,10 +26,10 @@ public class ItemPerformance {
return period; return period;
} }
@JsonProperty("Category") // @JsonProperty("Category")
public String getCategory() { // public String getCategory() {
return "Requests"; // return "Requests";
} // }
@JsonProperty("Instance") @JsonProperty("Instance")
public List<Instance> getInstance() { public List<Instance> getInstance() {

View File

@ -0,0 +1,39 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by dpie on 04/01/2021.
*/
public class ReportAttribute {
private String name;
private String value;
public ReportAttribute() {
}
public ReportAttribute(String name, String value) {
this.name = name;
this.value = value;
}
@JsonProperty("Name")
public String getName() {
return name;
}
@JsonProperty("Value")
public String getValue() {
return value;
}
public void setName(String name) {
this.name = name;
}
public void setValue(String value) {
this.value = value;
}
}

View File

@ -0,0 +1,135 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Created by dpie on 25/10/2019.
*/
@JsonPropertyOrder({"Created", "Created_By", "Customer_ID", "Report_ID", "Release", "Report_Name", "Institution_Name", "Institution_ID", "Report_Filters", "Report_Attributes","Exceptions"})
public class ReportHeaderPR {
private String created;
private String createdBy;
private String customerID;
private String reportID;
private String release;
private String reportName;
private String institutionName;
private List<Filter> reportFiters = new ArrayList();
private List<ReportAttribute> reportAttributes = new ArrayList();
private List<ReportException> exceptions = new ArrayList();
private List<InstitutionID> institutionID = new ArrayList();
public ReportHeaderPR() {
}
public ReportHeaderPR(String createdBy, String customerID, String reportID, String release, String reportName, String institutionName, List<InstitutionID> institutionID) {
//this.created = created;
this.createdBy = createdBy;
this.customerID = customerID;
this.reportID = reportID;
this.release = release;
this.reportName = reportName;
this.institutionName = institutionName;
this.institutionID = institutionID;
}
@JsonProperty("Created")
public String getCreated() {
return created;
}
@JsonProperty("Created_By")
public String getCreatedBy() {
return createdBy;
}
@JsonProperty("Customer_ID")
public String getCustomerID() {
return customerID;
}
@JsonProperty("Report_ID")
public String getReportID() {
return reportID;
}
@JsonProperty("Report_Name")
public String getReportName() {
return reportName;
}
@JsonProperty("Institution_Name")
public String getInstitutionName() {
return institutionName;
}
@JsonProperty("Institution_ID")
public List<InstitutionID> getInstitutionID() {
return institutionID;
}
@JsonProperty("Report_Filters")
public List<Filter> getReportFilters() {
return reportFiters;
}
@JsonProperty("Report_Attributes")
public List<ReportAttribute> getReportAttributes() {
return reportAttributes;
}
@JsonProperty("Exceptions")
public List<ReportException> getExceptions() {
return exceptions;
}
public void setReportName(String reportName) {
this.reportName = reportName;
}
public void setCreated(String created) {
this.created = created;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public void setReportFiters(List<Filter> reportFiters) {
this.reportFiters = reportFiters;
}
// @JsonIgnore
// public Date getBeginDate() {
// return beginDate;
// }
//
// @JsonIgnore
// public Date getEndDate() {
// return endDate;
// }
//
// public void setReportAttributes(List<Attribute> reportAttributes) {
// this.reportAttributes = reportAttributes;
// }
public void setReportAttributes(List<ReportAttribute> reportAttributes) {
this.reportAttributes = reportAttributes;
}
public void setExceptions(List<ReportException> exceptions) {
this.exceptions = exceptions;
}
}

View File

@ -2,19 +2,24 @@ package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* Created by tsampikos on 31/10/2016. * Created by dpie on 04/01/2021.
*/ */
@JsonPropertyOrder({"Platform", "Data_Type", "Access_Method", "Performance"})
public class ReportItem { public class ReportItem {
private List<ItemIdentifier> itemIdentifiers = new ArrayList<>(); private List<ItemIdentifier> itemIdentifiers = new ArrayList<>();
private String itemPublisher; private String itemPublisher;
private String itemPlatform; private String platform;
private String itemDataType; private String dataType;
private String accessMethod;
private String itemName; private String itemName;
private List<ItemPerformance> itemPerformances = new ArrayList<>(); private List<ItemPerformance> itemPerformances = new ArrayList<>();
@ -22,41 +27,31 @@ public class ReportItem {
public ReportItem() { public ReportItem() {
} }
public ReportItem(String itemPublisher, String itemPlatform, String itemDataType, String itemName) { public ReportItem(String itemPublisher, String platform, String dataType,
String accessMethod, String itemName) {
this.itemPublisher = itemPublisher; this.itemPublisher = itemPublisher;
this.itemPlatform = itemPlatform; this.platform = platform;
this.itemDataType = itemDataType; this.dataType = dataType;
this.accessMethod = accessMethod;
this.itemName = itemName; this.itemName = itemName;
} }
@JsonProperty("ItemIdentifier") @JsonProperty("Platform")
public List<ItemIdentifier> getItemIdentifiers() {
return itemIdentifiers;
}
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonProperty("ItemPublisher")
public String getItemPublisher() {
return itemPublisher;
}
@JsonProperty("ItemPlatform")
public String getItemPlatform() { public String getItemPlatform() {
return itemPlatform; return platform;
} }
@JsonProperty("ItemDataType") @JsonProperty("Data_Type")
public String getItemDataType() { public String getDataType() {
return itemDataType; return dataType;
} }
@JsonInclude(JsonInclude.Include.NON_EMPTY) @JsonProperty("Access_Method")
@JsonProperty("ItemName") public String getAccessMethod() {
public String getItemName() { return accessMethod;
return itemName;
} }
@JsonProperty("ItemPerformance") @JsonProperty("Performance")
public List<ItemPerformance> getItemPerformances() { public List<ItemPerformance> getItemPerformances() {
return itemPerformances; return itemPerformances;
} }
@ -67,9 +62,5 @@ public class ReportItem {
public void addPerformance(ItemPerformance itemPerformance) { public void addPerformance(ItemPerformance itemPerformance) {
itemPerformances.add(itemPerformance); itemPerformances.add(itemPerformance);
} }
public void setItemPlatform(String itemPlatform) {
this.itemPlatform = itemPlatform;
}
} }

View File

@ -0,0 +1,87 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package eu.dnetlib.usagestats.sushilite.domain;
/**
*
* @author dpie
*/
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dpie on 25/10/2016.
*/
//@JsonPropertyOrder({"Description", "Service_Active", "Registry_URL", "Note", "Alerts"})
public class ReportPR {
private ReportHeaderPR reportHeader;
private boolean serviceActive;
private String registry_url;
private String note;
private List<Alert> alerts = new ArrayList();
private List<ReportItem> reportItems = new ArrayList();
final String createdBy="OpenAIRE Usage Counts Service";
// public ReportPR() {
// }
public ReportPR(String created,String customerID, String reportID, String reportName, String insitutionName, List<InstitutionID> institutionID, List<ReportException> exceptions,
List<Filter> reportFilters,List<ReportItem> reportItems) {
this.reportHeader = new ReportHeaderPR(createdBy, customerID, reportID, "5", reportName, insitutionName, institutionID);
this.reportItems = reportItems;
List<ReportAttribute> reportAttributes=new ArrayList();
reportAttributes.add(new ReportAttribute("Attributes_To_Show",("Data_Type|Access_Method" )));
reportHeader.setExceptions(exceptions);
reportHeader.setCreated(created);
reportHeader.setReportFiters(reportFilters);
reportHeader.setReportAttributes(reportAttributes);
reportHeader.setExceptions(exceptions);
}
@JsonProperty("Report_Header")
public ReportHeaderPR getReportHeader() {
return reportHeader;
}
@JsonProperty("Report_Items")
public List<ReportItem> getReportItems() {
return reportItems;
}
// @JsonProperty("ServiceActive")
// public boolean getServiceActive() {
// return serviceActive;
// }
//
// @JsonProperty("Registry_URL")
// public String getRegistryURL() {
// return registry_url;
// }
//
// @JsonProperty("Note")
// public String getNote() {
// return note;
// }
//
// @JsonProperty("Alerts")
// public List<Alert> getAlerts() {
// return alerts;
// }
public void setReportPR(ReportHeaderPR reportHeader) {
this.reportHeader = reportHeader;
}
}

View File

@ -0,0 +1,67 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package eu.dnetlib.usagestats.sushilite.domain;
/**
*
* @author dpie
*/
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dpie on 25/10/2016.
*/
@JsonPropertyOrder({"Description", "Service_Active", "Registry_URL", "Note", "Alerts"})
public class ReportStatus {
private String description;
private boolean serviceActive;
private String registry_url;
private String note;
private List<Alert> alerts = new ArrayList();
public ReportStatus() {
}
public ReportStatus(String description, boolean serviceActive, String registry_url, String note,List<Alert> alerts) {
this.description = description;
this.serviceActive = serviceActive;
this.registry_url = registry_url;
this.note = note;
this.alerts = alerts;
}
@JsonProperty("Description")
public String getDescription() {
return description;
}
@JsonProperty("ServiceActive")
public boolean getServiceActive() {
return serviceActive;
}
@JsonProperty("Registry_URL")
public String getRegistryURL() {
return registry_url;
}
@JsonProperty("Note")
public String getNote() {
return note;
}
@JsonProperty("Alerts")
public List<Alert> getAlerts() {
return alerts;
}
}

View File

@ -0,0 +1,48 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.List;
@JsonPropertyOrder({"Report_Name", "Report_ID", "Release", "Report_Description", "Path"})
public class ReportSupported {
private String report_name;
private String report_id;
private String release;
private String description;
private String path;
public ReportSupported(String report_name, String report_id, String release, String description, String path) {
this.report_name = report_name;
this.report_id = report_id;
this.release = release;
this.description = description;
this.path = path;
}
@JsonProperty("Report_Name")
public String getReport_Name() {
return report_name;
}
@JsonProperty("Report_ID")
public String getReport_ID() {
return report_id;
}
@JsonProperty("Release")
public String getRelease() {
return release;
}
@JsonProperty("Report_Description")
public String getReport_Description() {
return description;
}
@JsonProperty("Path")
public String getPath() {
return path;
}
}