Commit 22022021

This commit is contained in:
Dimitris 2021-02-22 19:38:10 +02:00
parent f53ead952a
commit 74d1a1877d
22 changed files with 732 additions and 152 deletions

View File

@ -3,16 +3,16 @@ package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Created by tsampikos on 31/10/2016. * Created by D.Pierrakos
*/ */
public class ItemIdentifier { public class COUNTER_Item_Attributes {
private String type; private String type;
private String value; private String value;
public ItemIdentifier() { public COUNTER_Item_Attributes() {
} }
public ItemIdentifier(String type, String value) { public COUNTER_Item_Attributes(String type, String value) {
this.type = type; this.type = type;
this.value = value; this.value = value;
} }

View File

@ -0,0 +1,45 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by D.Pierrakos
*/
@JsonPropertyOrder({"Platform", "Data_Type", "Access_Method", "Performance"})
//old ReportItem class
public class COUNTER_Item_Component {
private String itemName;
private List<COUNTER_Item_Identifier> itemIdentifiers = new ArrayList<>();
private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>();
private List<COUNTER_Item_Dates> itemDates = new ArrayList<>();
private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>();
private String dataType;
private List<COUNTER_Item_Performance> itemPerformance = new ArrayList<>();
public COUNTER_Item_Component() {
}
public COUNTER_Item_Component(String publisher, String platform, String dataType,
String accessMethod, String itemName) {
this.dataType = dataType;
this.itemName = itemName;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Data_Type")
public String getDataType() {
return dataType;
}
public void addIdentifier(COUNTER_Item_Identifier itemIdentifier) {
itemIdentifiers.add(itemIdentifier);
}
}

View File

@ -0,0 +1,35 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by D.Pierrakos
*/
public class COUNTER_Item_Contributors {
private String type = null;
private String name = null;
private String identifier = null;
public COUNTER_Item_Contributors(String type, String name, String identifier) {
this.type = type;
this.name = name;
this.identifier = identifier;
}
@JsonProperty("Type")
public String getType() {
return type;
}
@JsonProperty("Name")
public String getName() {
return name;
}
@JsonProperty("Identifier")
public String getIdentifier() {
return identifier;
}
}

View File

@ -1,19 +1,18 @@
package eu.dnetlib.usagestats.sushilite.domain; package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
/** /**
* Created by dpie on 04/01/2020. * Created by D.Pierrakos
*/ */
public class InstitutionID { public class COUNTER_Item_Dates {
private String type; private String type;
private String value; private String value;
public InstitutionID() { public COUNTER_Item_Dates() {
} }
public InstitutionID(String type, String value) { public COUNTER_Item_Dates(String type, String value) {
this.type = type; this.type = type;
this.value = value; this.value = value;
} }
@ -27,5 +26,4 @@ public class InstitutionID {
public String getValue() { public String getValue() {
return value; return value;
} }
} }

View File

@ -0,0 +1,29 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by D.Pierrakos
*/
public class COUNTER_Item_Identifier {
private String type;
private String value;
public COUNTER_Item_Identifier() {
}
public COUNTER_Item_Identifier(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

@ -0,0 +1,27 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by dpie on 15/01/2021.
*/
public class COUNTER_Item_Identifiers {
private String type = null;
private String value = null;
public COUNTER_Item_Identifiers(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

@ -0,0 +1,44 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by D.Pierrakos
*/
@JsonPropertyOrder({"Platform", "Data_Type", "Access_Method", "Performance"})
//old ReportItem class
public class COUNTER_Item_Parent {
private String itemName;
private List<COUNTER_Item_Identifier> itemIdentifiers = new ArrayList<>();
private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>();
private List<COUNTER_Item_Dates> itemDates = new ArrayList<>();
private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>();
private String dataType;
public COUNTER_Item_Parent() {
}
public COUNTER_Item_Parent(String publisher, String platform, String dataType,
String accessMethod, String itemName) {
this.dataType = dataType;
this.itemName = itemName;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Data_Type")
public String getDataType() {
return dataType;
}
public void addIdentifier(COUNTER_Item_Identifier itemIdentifier) {
itemIdentifiers.add(itemIdentifier);
}
}

View File

@ -8,15 +8,15 @@ import java.util.List;
/** /**
* Created by tsampikos on 31/10/2016. * Created by tsampikos on 31/10/2016.
*/ */
public class ItemPerformance { public class COUNTER_Item_Performance {
private Period period; private Period period;
private List<Instance> instances = new ArrayList<>(); private List<Instance> instances = new ArrayList<>();
public ItemPerformance() { public COUNTER_Item_Performance() {
} }
public ItemPerformance(String start, String end, String ft_count, public COUNTER_Item_Performance(String start, String end, String ft_count,
String abstr) { String abstr) {
period = new Period(start, end); period = new Period(start, end);
if (ft_count != null && abstr != null) { if (ft_count != null && abstr != null) {

View File

@ -0,0 +1,59 @@
/*
* 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 java.util.ArrayList;
import java.util.List;
/**
* Created by D.Pierrakos
*/
//@JsonPropertyOrder({"Description", "Service_Active", "Registry_URL", "Note", "Alerts"})
public class COUNTER_Item_Report {
private SUSHI_Report_Header reportHeader;
private List<COUNTER_Item_Usage> reportItems = new ArrayList();
final String createdBy="OpenAIRE UsageCounts Service";
public COUNTER_Item_Report(String created,String customerID, String reportID, String reportName, String insitutionName, List<SUSHI_Org_Identifiers> institutionID, List<SUSHI_Error_Model> exceptions,
List<Filter> reportFilters,List<COUNTER_Item_Usage> reportItems) {
this.reportHeader = new SUSHI_Report_Header(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 SUSHI_Report_Header getReportHeader() {
return reportHeader;
}
@JsonProperty("Report_Items")
public List<COUNTER_Item_Usage> getReportItems() {
return reportItems;
}
public void setReportPR(SUSHI_Report_Header reportHeader) {
this.reportHeader = reportHeader;
}
}

View File

@ -0,0 +1,171 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by D.Pierrakos
*/
@JsonPropertyOrder({"Platform", "Data_Type", "Access_Method", "Performance"})
//old ReportItem class
public class COUNTER_Item_Usage {
private String item;
private List<COUNTER_Item_Identifier> itemIdentifiers = new ArrayList<>();
private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>();
private List<COUNTER_Item_Dates> itemDates = new ArrayList<>();
private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>();
private String platform;
private String publisher;
private List<COUNTER_Publisher_Identifiers> publisherIdentifiers = new ArrayList<>();
private COUNTER_Item_Parent itemParent = new COUNTER_Item_Parent();
private List<COUNTER_Item_Component> itemComponents = new ArrayList<>();
private String dataType;
private String yop;
private String accessType;
private String accessMethod;
private List<COUNTER_Item_Performance> itemPerformances = new ArrayList<>();
public COUNTER_Item_Usage() {
}
public COUNTER_Item_Usage(String item, String publisher, String platform, String dataType,
String yop, String acccesType, String accessMethod) {
this.item = item;
this.publisher = publisher;
this.platform = platform;
this.dataType = dataType;
this.yop = yop;
this.accessType = acccesType;
this.accessMethod = accessMethod;
this.itemIdentifiers = null;
this.itemContributors = null;
this.itemDates = null;
this.itemAttributes = null;
this.publisherIdentifiers = null;
this.itemParent = null;
this.itemComponents = null;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item")
public String getItem() {
return item;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item_ID")
public List<COUNTER_Item_Identifier> getItemIdentifiers() {
return itemIdentifiers;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item_Contributors")
public List<COUNTER_Item_Contributors> getItemContributors() {
return itemContributors;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item_Dates")
public List<COUNTER_Item_Dates> getItemDates() {
return itemDates;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item_Attributes")
public List<COUNTER_Item_Attributes> getItemAttributes() {
return itemAttributes;
}
@JsonProperty("Platform")
public String getItemPlatform() {
return platform;
}
@JsonProperty("Publisher")
public String getItemPPublisher() {
return publisher;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Publisher_ID")
public List<COUNTER_Publisher_Identifiers> getPublisherIdentifiers() {
return publisherIdentifiers;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item_Parent")
public COUNTER_Item_Parent getItemParent() {
return itemParent;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item_Component")
public List<COUNTER_Item_Component> getItemComponents() {
return itemComponents;
}
@JsonProperty("Data_Type")
public String getDataType() {
return dataType;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("YOP")
public String getYop() {
return yop;
}
@JsonProperty("Access_Type")
public String getAccessType() {
return accessType;
}
@JsonProperty("Access_Method")
public String getAccessMethod() {
return accessMethod;
}
@JsonProperty("Performance")
public List<COUNTER_Item_Performance> getItemPerformances() {
return itemPerformances;
}
public void addIdentifier(COUNTER_Item_Identifier itemIdentifier) {
itemIdentifiers.add(itemIdentifier);
}
public void addItemContributors(COUNTER_Item_Contributors itemContributor) {
itemContributors.add(itemContributor);
}
public void addItemDates(COUNTER_Item_Dates itemDate) {
itemDates.add(itemDate);
}
public void addItemAttributes(COUNTER_Item_Attributes itemAttribute) {
itemAttributes.add(itemAttribute);
}
public void addPublisherIdentifiers(COUNTER_Publisher_Identifiers publisherIdentifier) {
publisherIdentifiers.add(publisherIdentifier);
}
public void addItemParent(COUNTER_Item_Parent itemParent) {
this.itemParent = itemParent;
}
public void addItemComponent(COUNTER_Item_Component itemComponent) {
itemComponents.add(itemComponent);
}
public void addPerformance(COUNTER_Item_Performance itemPerformance) {
itemPerformances.add(itemPerformance);
}
}

View File

@ -0,0 +1,59 @@
/*
* 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 java.util.ArrayList;
import java.util.List;
/**
* Created by dpie on 23/12/2020.
*/
//@JsonPropertyOrder({"Description", "Service_Active", "Registry_URL", "Note", "Alerts"})
public class COUNTER_Platform_Report {
private SUSHI_Report_Header reportHeader;
private List<COUNTER_Platform_Usage> reportItems = new ArrayList();
final String createdBy="OpenAIRE Usage Counts Service";
public COUNTER_Platform_Report(String created,String customerID, String reportID, String reportName, String insitutionName, List<SUSHI_Org_Identifiers> institutionID, List<SUSHI_Error_Model> exceptions,
List<Filter> reportFilters,List<COUNTER_Platform_Usage> reportItems) {
this.reportHeader = new SUSHI_Report_Header(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 SUSHI_Report_Header getReportHeader() {
return reportHeader;
}
@JsonProperty("Report_Items")
public List<COUNTER_Platform_Usage> getReportItems() {
return reportItems;
}
public void setReportPR(SUSHI_Report_Header reportHeader) {
this.reportHeader = reportHeader;
}
}

View File

@ -8,38 +8,32 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* Created by dpie on 04/01/2021. * Created by D.Pierrakos
*/ */
@JsonPropertyOrder({"Platform", "Data_Type", "Access_Method", "Performance"}) @JsonPropertyOrder({"Platform", "Data_Type", "Access_Method", "Performance"})
public class ReportItem { //old ReportItem class
public class COUNTER_Platform_Usage {
private List<ItemIdentifier> itemIdentifiers = new ArrayList<>();
private String itemPublisher;
private String platform; private String platform;
private String dataType; private String dataType;
private String accessMethod; private String accessMethod;
private String itemName;
private List<ItemPerformance> itemPerformances = new ArrayList<>(); private List<COUNTER_Item_Performance> itemPerformances = new ArrayList<>();
public ReportItem() { public COUNTER_Platform_Usage() {
} }
public ReportItem(String itemPublisher, String platform, String dataType, public COUNTER_Platform_Usage(String platform, String dataType, String accessMethod) {
String accessMethod, String itemName) {
this.itemPublisher = itemPublisher;
this.platform = platform; this.platform = platform;
this.dataType = dataType; this.dataType = dataType;
this.accessMethod = accessMethod; this.accessMethod = accessMethod;
this.itemName = itemName;
} }
@JsonProperty("Platform") @JsonProperty("Platform")
public String getItemPlatform() { public String getItemPlatform() {
return platform; return platform;
} }
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Data_Type") @JsonProperty("Data_Type")
public String getDataType() { public String getDataType() {
@ -52,15 +46,11 @@ public class ReportItem {
} }
@JsonProperty("Performance") @JsonProperty("Performance")
public List<ItemPerformance> getItemPerformances() { public List<COUNTER_Item_Performance> getItemPerformances() {
return itemPerformances; return itemPerformances;
} }
public void addIdentifier(ItemIdentifier itemIdentifier) { public void addPerformance(COUNTER_Item_Performance itemPerformance) {
itemIdentifiers.add(itemIdentifier);
}
public void addPerformance(ItemPerformance itemPerformance) {
itemPerformances.add(itemPerformance); itemPerformances.add(itemPerformance);
} }
} }

View File

@ -0,0 +1,27 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by dpie on 15/01/2021.
*/
public class COUNTER_Publisher_Identifiers {
private String type = null;
private String value = null;
public COUNTER_Publisher_Identifiers(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

@ -0,0 +1,59 @@
/*
* 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 java.util.ArrayList;
import java.util.List;
/**
* Created by D.Pierrakos
*/
//@JsonPropertyOrder({"Description", "Service_Active", "Registry_URL", "Note", "Alerts"})
public class COUNTER_Title_Report {
private SUSHI_Report_Header reportHeader;
private List<COUNTER_Platform_Usage> reportItems = new ArrayList();
final String createdBy="OpenAIRE Usage Counts Service";
public COUNTER_Title_Report(String created,String customerID, String reportID, String reportName, String insitutionName, List<SUSHI_Org_Identifiers> institutionID, List<SUSHI_Error_Model> exceptions,
List<Filter> reportFilters,List<COUNTER_Platform_Usage> reportItems) {
this.reportHeader = new SUSHI_Report_Header(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 SUSHI_Report_Header getReportHeader() {
return reportHeader;
}
@JsonProperty("Report_Items")
public List<COUNTER_Platform_Usage> getReportItems() {
return reportItems;
}
public void setReportPR(SUSHI_Report_Header reportHeader) {
this.reportHeader = reportHeader;
}
}

View File

@ -0,0 +1,98 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.util.ArrayList;
import java.util.List;
/**
* Created by dpie on 04/01/2021.
*/
@JsonPropertyOrder({"Title", "Item_ID", "Platform", "Publisher", "Publisher_ID", "Data_Type", "Section_Type", "YOP", "Access_Type", "Access_Method", "Performance"})
//old ReportItem class
public class COUNTER_Title_Usage {
private String title;
private List<COUNTER_Item_Identifiers> itemIdentifiers = new ArrayList<>();
private String platform;
private String publisher;
private List<COUNTER_Publisher_Identifiers> publisherIdentifiers = new ArrayList<>();
private String dataType;
private String sectionType;
private String yop;
private String accessType;
private String accessMethod;
private List<COUNTER_Item_Performance> itemPerformances = new ArrayList<>();
public COUNTER_Title_Usage() {
}
public COUNTER_Title_Usage(String title, String publisher, String platform, String dataType,
String accessMethod, String itemName) {
this.title = title;
this.platform = platform;
this.dataType = dataType;
this.accessMethod = accessMethod;
}
@JsonProperty("Title")
public String getTitle() {
return title;
}
@JsonProperty("Item_ID")
public List<COUNTER_Item_Identifiers> getItemIdentifiers() {
return itemIdentifiers;
}
@JsonProperty("Platform")
public String getItemPlatform() {
return platform;
}
@JsonProperty("Publisher")
public String getPublisher() {
return publisher;
}
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Data_Type")
public String getDataType() {
return dataType;
}
@JsonProperty("Section_Type")
public String getSectionType() {
return sectionType;
}
@JsonProperty("YOP")
public String getYOP() {
return yop;
}
@JsonProperty("Access_Type")
public String getAccessType() {
return accessType;
}
@JsonProperty("Access_Method")
public String getAccessMethod() {
return accessMethod;
}
@JsonProperty("Performance")
public List<COUNTER_Item_Performance> getItemPerformances() {
return itemPerformances;
}
public void addIdentifier(COUNTER_Item_Identifiers itemIdentifier) {
itemIdentifiers.add(itemIdentifier);
}
public void addPerformance(COUNTER_Item_Performance itemPerformance) {
itemPerformances.add(itemPerformance);
}
}

View File

@ -11,16 +11,16 @@ import java.util.List;
public class Customer { public class Customer {
private String id = null; private String id = null;
public void setReportItems(List<ReportItem> reportItems) { public void setReportItems(List<COUNTER_Platform_Usage> reportItems) {
this.reportItems = reportItems; this.reportItems = reportItems;
} }
private List<ReportItem> reportItems = new ArrayList<>(); private List<COUNTER_Platform_Usage> reportItems = new ArrayList<>();
public Customer() { public Customer() {
} }
public Customer(String id, List<ReportItem> reportItems) { public Customer(String id, List<COUNTER_Platform_Usage> reportItems) {
this.id = id; this.id = id;
this.reportItems = reportItems; this.reportItems = reportItems;
} }
@ -31,7 +31,7 @@ public class Customer {
} }
@JsonProperty("ReportItems") @JsonProperty("ReportItems")
public List<ReportItem> getReportItems() { public List<COUNTER_Platform_Usage> getReportItems() {
return reportItems; return reportItems;
} }
} }

View File

@ -16,7 +16,7 @@ public class Report {
public Report() { public Report() {
} }
public Report(String created, String name, String version, String requestor, List<ReportItem> reportItems) { public Report(String created, String name, String version, String requestor, List<COUNTER_Platform_Usage> reportItems) {
this.created = created; this.created = created;
this.version = version; this.version = version;
this.name = name + ":" + version; this.name = name + ":" + version;

View File

@ -1,87 +0,0 @@
/*
* 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

@ -15,7 +15,7 @@ import java.util.List;
public class ReportResponse { public class ReportResponse {
private String created; private String created;
private List<ReportException> reportExceptions = new ArrayList<>(); private List<SUSHI_Error_Model> reportExceptions = new ArrayList<>();
private Requestor requestor; private Requestor requestor;
private ReportDefinition reportDefinition; private ReportDefinition reportDefinition;
private ReportWrapper reportWrapper; private ReportWrapper reportWrapper;
@ -25,7 +25,7 @@ public class ReportResponse {
public ReportResponse(String reportName, String release, String requestorId, String beginDate, public ReportResponse(String reportName, String release, String requestorId, String beginDate,
String endDate, String repositoryIdentifier, String itemIdentifier, String endDate, String repositoryIdentifier, String itemIdentifier,
String itemDataType, String hasDoi, String granularity, String callback, List<ReportItem> reportItems, List<ReportException> reportExceptions) { 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"); DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ");
Date date = new Date(); Date date = new Date();
created = dateFormat.format(date); created = dateFormat.format(date);
@ -50,7 +50,7 @@ public class ReportResponse {
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Exception") @JsonProperty("Exception")
public List<ReportException> getReportExceptions() { public List<SUSHI_Error_Model> getReportExceptions() {
return reportExceptions; return reportExceptions;
} }

View File

@ -9,36 +9,34 @@ import java.util.Date;
/** /**
* Created by tsampikos on 23/11/2016. * Created by tsampikos on 23/11/2016.
*/ */
public class ReportException { public class SUSHI_Error_Model {
private String created; private String code;
private String number;
private String severity; private String severity;
private String message; private String message;
private String helpURL;
private String data; private String data;
public ReportException() { public SUSHI_Error_Model() {
} }
public ReportException(String number, String severity, String message, String data) { public SUSHI_Error_Model(String code, String severity, String message, String helpURL, String data) {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ssZ"); this.helpURL = helpURL;
Date date = new Date();
created = dateFormat.format(date);
this.number = number; this.code = code;
this.severity = severity; this.severity = severity;
this.message = message; this.message = message;
this.data = data; this.data = data;
} }
@JsonProperty("@Created") @JsonProperty("Help_URL")
public String getCreated() { public String getHelpURL() {
return created; return helpURL;
} }
@JsonProperty("Number") @JsonProperty("Code")
public String getNumber() { public String getCode() {
return number; return code;
} }
@JsonProperty("Severity") @JsonProperty("Severity")

View File

@ -0,0 +1,27 @@
package eu.dnetlib.usagestats.sushilite.domain;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Created by dpie on 15/01/2021.
*/
public class SUSHI_Org_Identifiers {
private String type = null;
private String value = null;
public SUSHI_Org_Identifiers(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

@ -15,7 +15,7 @@ import java.util.List;
* Created by dpie on 25/10/2019. * 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"}) @JsonPropertyOrder({"Created", "Created_By", "Customer_ID", "Report_ID", "Release", "Report_Name", "Institution_Name", "Institution_ID", "Report_Filters", "Report_Attributes", "Exceptions"})
public class ReportHeaderPR { public class SUSHI_Report_Header {
private String created; private String created;
private String createdBy; private String createdBy;
@ -24,17 +24,18 @@ public class ReportHeaderPR {
private String release; private String release;
private String reportName; private String reportName;
private String institutionName; private String institutionName;
private List<SUSHI_Org_Identifiers> institutionID = new ArrayList();
private List<Filter> reportFiters = new ArrayList(); private List<Filter> reportFiters = new ArrayList();
private List<ReportAttribute> reportAttributes = new ArrayList(); private List<ReportAttribute> reportAttributes = new ArrayList();
private List<ReportException> exceptions = new ArrayList(); private List<SUSHI_Error_Model> exceptions = new ArrayList();
private List<InstitutionID> institutionID = new ArrayList();
public ReportHeaderPR() {
public SUSHI_Report_Header() {
} }
public ReportHeaderPR(String createdBy, String customerID, String reportID, public SUSHI_Report_Header(String createdBy, String customerID, String reportID,
String release, String reportName, String institutionName, String release, String reportName, String institutionName,
List<InstitutionID> institutionID) { List<SUSHI_Org_Identifiers> institutionID) {
//this.created = created; //this.created = created;
this.createdBy = createdBy; this.createdBy = createdBy;
this.customerID = customerID; this.customerID = customerID;
@ -77,7 +78,7 @@ public class ReportHeaderPR {
} }
@JsonProperty("Institution_ID") @JsonProperty("Institution_ID")
public List<InstitutionID> getInstitutionID() { public List<SUSHI_Org_Identifiers> getInstitutionID() {
return institutionID; return institutionID;
} }
@ -93,7 +94,7 @@ public class ReportHeaderPR {
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Exceptions") @JsonProperty("Exceptions")
public List<ReportException> getExceptions() { public List<SUSHI_Error_Model> getExceptions() {
return exceptions; return exceptions;
} }
@ -130,7 +131,7 @@ public class ReportHeaderPR {
this.reportAttributes = reportAttributes; this.reportAttributes = reportAttributes;
} }
public void setExceptions(List<ReportException> exceptions) { public void setExceptions(List<SUSHI_Error_Model> exceptions) {
this.exceptions = exceptions; this.exceptions = exceptions;
} }
} }