Beta 15032021
This commit is contained in:
parent
11f02ed515
commit
dc7fbe13ab
|
@ -21,7 +21,7 @@ import java.util.List;
|
|||
//@JsonPropertyOrder({"Description", "Service_Active", "Registry_URL", "Note", "Alerts"})
|
||||
public class COUNTER_Dataset_Report {
|
||||
|
||||
private SUSHI_Report_Header reportHeader;
|
||||
private SUSHI_Report_Header_DSR reportHeader;
|
||||
private List<COUNTER_Dataset_Usage> reportDatasets = new ArrayList();
|
||||
final String createdBy="OpenAIRE UsageCounts Service";
|
||||
|
||||
|
@ -30,7 +30,7 @@ public class COUNTER_Dataset_Report {
|
|||
List<Filter> reportFilters,List<COUNTER_Dataset_Usage> reportDatasets) {
|
||||
|
||||
|
||||
this.reportHeader = new SUSHI_Report_Header(createdBy, customerID, reportID, "5", reportName, insitutionName, institutionID);
|
||||
this.reportHeader = new SUSHI_Report_Header_DSR(createdBy, customerID, reportID, "5", reportName);
|
||||
this.reportDatasets = reportDatasets;
|
||||
|
||||
List<ReportAttribute> reportAttributes=new ArrayList();
|
||||
|
@ -45,7 +45,7 @@ public class COUNTER_Dataset_Report {
|
|||
}
|
||||
|
||||
@JsonProperty("Report_Header")
|
||||
public SUSHI_Report_Header getReportHeader() {
|
||||
public SUSHI_Report_Header_DSR getReportHeader() {
|
||||
return reportHeader;
|
||||
}
|
||||
@JsonProperty("Report_Datasets")
|
||||
|
@ -53,7 +53,7 @@ public class COUNTER_Dataset_Report {
|
|||
return reportDatasets;
|
||||
}
|
||||
|
||||
public void setReportPR(SUSHI_Report_Header reportHeader) {
|
||||
public void setReportPR(SUSHI_Report_Header_DSR reportHeader) {
|
||||
this.reportHeader = reportHeader;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,10 @@ public class COUNTER_Dataset_Usage {
|
|||
this.platform = platform;
|
||||
this.dataType = dataType;
|
||||
this.yop = yop;
|
||||
this.accessMethod = accessMethod;
|
||||
if(accessMethod.equals("regular"))
|
||||
this.accessMethod = "Regular";
|
||||
if(accessMethod.equals("machine"))
|
||||
this.accessMethod = "Machine";
|
||||
//this.itemIdentifiers = itemIdentifiers;
|
||||
this.datasetContributors = null;
|
||||
this.datasetDates = null;
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 26/10/2016.
|
||||
*/
|
||||
public class Contact {
|
||||
|
||||
@JsonProperty("Contact")
|
||||
public String getContact() {
|
||||
return "OpenAIRE Helpdesk";
|
||||
}
|
||||
|
||||
@JsonProperty("E-mail")
|
||||
public String getEmail() {
|
||||
return "helpdesk@openaire.eu";
|
||||
}
|
||||
|
||||
public Contact() {
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 31/10/2016.
|
||||
*/
|
||||
public class Customer {
|
||||
private String id = null;
|
||||
|
||||
public void setReportItems(List<COUNTER_Platform_Usage> reportItems) {
|
||||
this.reportItems = reportItems;
|
||||
}
|
||||
|
||||
private List<COUNTER_Platform_Usage> reportItems = new ArrayList<>();
|
||||
|
||||
public Customer() {
|
||||
}
|
||||
|
||||
public Customer(String id, List<COUNTER_Platform_Usage> reportItems) {
|
||||
this.id = id;
|
||||
this.reportItems = reportItems;
|
||||
}
|
||||
|
||||
@JsonProperty("ID")
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@JsonProperty("ReportItems")
|
||||
public List<COUNTER_Platform_Usage> getReportItems() {
|
||||
return reportItems;
|
||||
}
|
||||
}
|
|
@ -1,50 +0,0 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Report {
|
||||
private String created;
|
||||
private String version;
|
||||
private String name;
|
||||
|
||||
private Vendor vendor = new Vendor();
|
||||
|
||||
private Customer customer;
|
||||
|
||||
public Report() {
|
||||
}
|
||||
|
||||
public Report(String created, String name, String version, String requestor, List<COUNTER_Platform_Usage> reportItems) {
|
||||
this.created = created;
|
||||
this.version = version;
|
||||
this.name = name + ":" + version;
|
||||
this.customer = new Customer(requestor, reportItems);
|
||||
}
|
||||
|
||||
@JsonProperty("@Created")
|
||||
public String getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
@JsonProperty("@Version")
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
@JsonProperty("@Name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@JsonProperty("Vendor")
|
||||
public Vendor getVendor() {
|
||||
return vendor;
|
||||
}
|
||||
|
||||
@JsonProperty("Customer")
|
||||
public Customer getCustomer() {
|
||||
return customer;
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 25/10/2016.
|
||||
*/
|
||||
public class ReportResponse {
|
||||
|
||||
private String created;
|
||||
private List<SUSHI_Error_Model> reportExceptions = new ArrayList<>();
|
||||
private Requestor requestor;
|
||||
private ReportDefinition reportDefinition;
|
||||
private ReportWrapper reportWrapper;
|
||||
|
||||
public ReportResponse() {
|
||||
}
|
||||
|
||||
public ReportResponse(String reportName, String release, String requestorId, String beginDate,
|
||||
String endDate, String repositoryIdentifier, String itemIdentifier,
|
||||
String itemDataType, String hasDoi, String granularity, String callback, List<COUNTER_Platform_Usage> reportItems, List<SUSHI_Error_Model> reportExceptions) {
|
||||
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ");
|
||||
Date date = new Date();
|
||||
created = dateFormat.format(date);
|
||||
|
||||
if (!reportExceptions.isEmpty()) {
|
||||
this.reportExceptions = reportExceptions;
|
||||
}
|
||||
|
||||
requestor = new Requestor(requestorId);
|
||||
|
||||
reportDefinition = new ReportDefinition(reportName, release, beginDate, endDate, repositoryIdentifier, itemIdentifier, itemDataType, granularity, Integer.toString(reportItems.size()));
|
||||
|
||||
Report report = new Report(created, reportName, release, requestorId, reportItems);
|
||||
reportWrapper = new ReportWrapper(report);
|
||||
}
|
||||
|
||||
@JsonProperty("@Created")
|
||||
public String getCreated() {
|
||||
return created;
|
||||
}
|
||||
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Exception")
|
||||
public List<SUSHI_Error_Model> getReportExceptions() {
|
||||
return reportExceptions;
|
||||
}
|
||||
|
||||
@JsonProperty("Requestor")
|
||||
public Requestor getRequestor() {
|
||||
return requestor;
|
||||
}
|
||||
|
||||
@JsonProperty("ReportDefinition")
|
||||
public ReportDefinition getReportDefinition() {
|
||||
return reportDefinition;
|
||||
}
|
||||
|
||||
@JsonProperty("Report")
|
||||
public ReportWrapper getReportWrapper() {
|
||||
return reportWrapper;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 26/10/2016.
|
||||
*/
|
||||
public class ReportResponseWrapper {
|
||||
private ReportResponse reportResponse;
|
||||
|
||||
public ReportResponseWrapper() {}
|
||||
|
||||
public ReportResponseWrapper(ReportResponse reportResponse) {
|
||||
this.reportResponse = reportResponse;
|
||||
}
|
||||
|
||||
@JsonProperty("ReportResponse")
|
||||
public ReportResponse getReportResponse() {
|
||||
return reportResponse;
|
||||
}
|
||||
|
||||
public void setReportResponse(ReportResponse reportResponse) {
|
||||
this.reportResponse = reportResponse;
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 26/10/2016.
|
||||
*/
|
||||
public class ReportWrapper {
|
||||
private Report report;
|
||||
|
||||
public ReportWrapper() {
|
||||
}
|
||||
|
||||
public ReportWrapper(Report report) {
|
||||
this.report = report;
|
||||
}
|
||||
|
||||
@JsonProperty("Report")
|
||||
public Report getReport() {
|
||||
return report;
|
||||
}
|
||||
|
||||
public void setReport(Report report) {
|
||||
this.report = report;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
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 D.Pierrakos
|
||||
*/
|
||||
@JsonPropertyOrder({"Report_Name", "Report_ID", "Release", "Created", "Created_By", "Customer_ID", "Report_Filters", "Report_Attributes", "Exceptions"})
|
||||
public class SUSHI_Report_Header_DSR {
|
||||
|
||||
private String created;
|
||||
private String createdBy;
|
||||
private String customerID;
|
||||
private String reportID;
|
||||
private String release;
|
||||
private String reportName;
|
||||
private List<Filter> reportFiters = new ArrayList();
|
||||
private List<ReportAttribute> reportAttributes = new ArrayList();
|
||||
private List<SUSHI_Error_Model> exceptions = new ArrayList();
|
||||
|
||||
|
||||
public SUSHI_Report_Header_DSR() {
|
||||
}
|
||||
|
||||
public SUSHI_Report_Header_DSR(String createdBy, String customerID, String reportID,
|
||||
String release, String reportName) {
|
||||
//this.created = created;
|
||||
this.createdBy = createdBy;
|
||||
this.customerID = customerID;
|
||||
this.reportID = reportID;
|
||||
this.release = release;
|
||||
this.reportName = reportName;
|
||||
|
||||
}
|
||||
|
||||
@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("Report_Filters")
|
||||
public List<Filter> getReportFilters() {
|
||||
return reportFiters;
|
||||
}
|
||||
|
||||
@JsonProperty("Report_Attributes")
|
||||
public List<ReportAttribute> getReportAttributes() {
|
||||
return reportAttributes;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Exceptions")
|
||||
public List<SUSHI_Error_Model> 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<SUSHI_Error_Model> exceptions) {
|
||||
this.exceptions = exceptions;
|
||||
}
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 26/10/2016.
|
||||
*/
|
||||
public class Vendor {
|
||||
|
||||
private Contact contact = new Contact();
|
||||
|
||||
public Vendor() {
|
||||
}
|
||||
|
||||
@JsonProperty("Name")
|
||||
public String getName() {
|
||||
return "OpenAIRE";
|
||||
}
|
||||
|
||||
@JsonProperty("Contact")
|
||||
public Contact getContact() {
|
||||
return contact;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue