Beta version 1403202021
This commit is contained in:
parent
9e1e31285c
commit
11f02ed515
|
@ -0,0 +1,29 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by D.Pierrakos
|
||||
*/
|
||||
public class COUNTER_Dataset_Attributes {
|
||||
private String type;
|
||||
private String value;
|
||||
|
||||
public COUNTER_Dataset_Attributes() {
|
||||
}
|
||||
|
||||
public COUNTER_Dataset_Attributes(String type, String value) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonProperty("Type")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@JsonProperty("Value")
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by D.Pierrakos
|
||||
*/
|
||||
public class COUNTER_Dataset_Contributors {
|
||||
|
||||
private String type = null;
|
||||
private String name = null;
|
||||
private String identifier = null;
|
||||
|
||||
public COUNTER_Dataset_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;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by D.Pierrakos
|
||||
*/
|
||||
public class COUNTER_Dataset_Dates {
|
||||
private String type;
|
||||
private String value;
|
||||
|
||||
public COUNTER_Dataset_Dates() {
|
||||
}
|
||||
|
||||
public COUNTER_Dataset_Dates(String type, String value) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonProperty("Type")
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@JsonProperty("Value")
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
|
@ -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_Dataset_Identifiers {
|
||||
|
||||
private String type = null;
|
||||
private String value = null;
|
||||
|
||||
public COUNTER_Dataset_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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,149 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by D.Pierrakos
|
||||
*/
|
||||
public class COUNTER_Dataset_Performance {
|
||||
|
||||
private Period period;
|
||||
private List<Instance> instances = new ArrayList<>();
|
||||
|
||||
public COUNTER_Dataset_Performance() {
|
||||
}
|
||||
|
||||
public COUNTER_Dataset_Performance(String start, String end, String downloads,
|
||||
String views, String uniqueDownloads, String uniqueViews) {
|
||||
period = new Period(start, end);
|
||||
if (downloads != null && views != null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views != null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads != null && views != null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views != null && uniqueDownloads == null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
} else if (downloads == null && views == null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads == null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Requests", downloads));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads == null && uniqueViews == null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Dataset_Investigations", views));
|
||||
}
|
||||
} else if (downloads == null && views == null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads == null && views == null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Dataset_Investigations", uniqueViews));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JsonProperty("Period")
|
||||
public Period getPeriod() {
|
||||
return period;
|
||||
}
|
||||
|
||||
// @JsonProperty("Category")
|
||||
// public String getCategory() {
|
||||
// return "Requests";
|
||||
// }
|
||||
@JsonProperty("Instance")
|
||||
public List<Instance> getInstance() {
|
||||
return instances;
|
||||
}
|
||||
}
|
|
@ -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_Dataset_Report {
|
||||
|
||||
private SUSHI_Report_Header reportHeader;
|
||||
private List<COUNTER_Dataset_Usage> reportDatasets = new ArrayList();
|
||||
final String createdBy="OpenAIRE UsageCounts Service";
|
||||
|
||||
|
||||
public COUNTER_Dataset_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_Dataset_Usage> reportDatasets) {
|
||||
|
||||
|
||||
this.reportHeader = new SUSHI_Report_Header(createdBy, customerID, reportID, "5", reportName, insitutionName, institutionID);
|
||||
this.reportDatasets = reportDatasets;
|
||||
|
||||
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_Datasets")
|
||||
public List<COUNTER_Dataset_Usage> getReportDatasets() {
|
||||
return reportDatasets;
|
||||
}
|
||||
|
||||
public void setReportPR(SUSHI_Report_Header reportHeader) {
|
||||
this.reportHeader = reportHeader;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,167 @@
|
|||
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({"Dataset_Title", "Publisher", "YOP","Access_Method", "Performance"})
|
||||
//old ReportItem class
|
||||
public class COUNTER_Dataset_Usage {
|
||||
|
||||
private String datasetTitle;
|
||||
private List<COUNTER_Dataset_Identifiers> datasetIdentifiers = new ArrayList<>();
|
||||
private List<COUNTER_Dataset_Contributors> datasetContributors = new ArrayList<>();
|
||||
private List<COUNTER_Dataset_Dates> datasetDates = new ArrayList<>();
|
||||
private List<COUNTER_Dataset_Attributes> datasetAttributes = 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 accessMethod;
|
||||
|
||||
private List<COUNTER_Dataset_Performance> datasetPerformances = new ArrayList<>();
|
||||
|
||||
public COUNTER_Dataset_Usage() {
|
||||
}
|
||||
|
||||
public COUNTER_Dataset_Usage(String datasetTitle, String publisher, String platform, String dataType,
|
||||
String yop, String accessMethod) {
|
||||
this.datasetTitle = datasetTitle;
|
||||
this.publisher = publisher;
|
||||
this.platform = platform;
|
||||
this.dataType = dataType;
|
||||
this.yop = yop;
|
||||
this.accessMethod = accessMethod;
|
||||
//this.itemIdentifiers = itemIdentifiers;
|
||||
this.datasetContributors = null;
|
||||
this.datasetDates = null;
|
||||
this.datasetAttributes = null;
|
||||
this.publisherIdentifiers = null;
|
||||
this.itemParent = null;
|
||||
this.itemComponents = null;
|
||||
|
||||
}
|
||||
|
||||
@JsonProperty("Dataset_Title")
|
||||
public String getItem() {
|
||||
return datasetTitle;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Dataset_ID")
|
||||
public List<COUNTER_Dataset_Identifiers> getDatasetIdentifiers() {
|
||||
return datasetIdentifiers;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Dataset_Contributors")
|
||||
public List<COUNTER_Dataset_Contributors> getDatasetContributors() {
|
||||
return datasetContributors;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Dataset_Dates")
|
||||
public List<COUNTER_Dataset_Dates> getDatasetDates() {
|
||||
return datasetDates;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Dataset_Attributes")
|
||||
public List<COUNTER_Dataset_Attributes> getDatasetAttributes() {
|
||||
return datasetAttributes;
|
||||
}
|
||||
|
||||
@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_Method")
|
||||
public String getAccessMethod() {
|
||||
return accessMethod;
|
||||
}
|
||||
|
||||
@JsonProperty("Performance")
|
||||
public List<COUNTER_Dataset_Performance> getItemPerformances() {
|
||||
return datasetPerformances;
|
||||
}
|
||||
|
||||
public void addIdentifier(COUNTER_Dataset_Identifiers datasetIdentifier) {
|
||||
datasetIdentifiers.add(datasetIdentifier);
|
||||
}
|
||||
public void setIdentifier(List<COUNTER_Dataset_Identifiers> datasetIdentifier) {
|
||||
this.datasetIdentifiers=datasetIdentifier;
|
||||
}
|
||||
public void addDatasetContributors(COUNTER_Dataset_Contributors datasetContributor) {
|
||||
datasetContributors.add(datasetContributor);
|
||||
}
|
||||
|
||||
public void addDatasetDates(COUNTER_Dataset_Dates itemDate) {
|
||||
datasetDates.add(itemDate);
|
||||
}
|
||||
|
||||
public void addDatasetAttributes(COUNTER_Dataset_Attributes datasetAttribute) {
|
||||
datasetAttributes.add(datasetAttribute);
|
||||
}
|
||||
|
||||
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_Dataset_Performance datasetPerformance) {
|
||||
datasetPerformances.add(datasetPerformance);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -17,16 +17,120 @@ public class COUNTER_Item_Performance {
|
|||
}
|
||||
|
||||
public COUNTER_Item_Performance(String start, String end, String downloads,
|
||||
String views) {
|
||||
String views, String uniqueDownloads, String uniqueViews) {
|
||||
period = new Period(start, end);
|
||||
if (downloads != null && views != null) {
|
||||
instances.add(new Instance("Total_Items_Requests", downloads));
|
||||
instances.add(new Instance("Total_Items_Investigations", views));
|
||||
if (downloads != null && views != null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views != null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads != null && views != null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views != null && uniqueDownloads == null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
} else if (downloads == null && views == null && uniqueDownloads != null && uniqueViews != null) {
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads != null && views == null && uniqueDownloads == null && uniqueViews == null) {
|
||||
if (!downloads.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Requests", downloads));
|
||||
}
|
||||
} else if (downloads == null && views != null && uniqueDownloads == null && uniqueViews == null) {
|
||||
if (!views.equals("0")) {
|
||||
instances.add(new Instance("Total_Item_Investigations", views));
|
||||
}
|
||||
} else if (downloads == null && views == null && uniqueDownloads != null && uniqueViews == null) {
|
||||
if (!uniqueDownloads.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Requests", uniqueDownloads));
|
||||
}
|
||||
} else if (downloads == null && views == null && uniqueDownloads == null && uniqueViews != null) {
|
||||
if (!uniqueViews.equals("0")) {
|
||||
instances.add(new Instance("Unique_Item_Investigations", uniqueViews));
|
||||
}
|
||||
}
|
||||
else if(downloads != null && views == null )
|
||||
instances.add(new Instance("Total_Items_Requests", downloads));
|
||||
else if(downloads == null && views != null )
|
||||
instances.add(new Instance("Total_Items_Investigations",views));
|
||||
}
|
||||
|
||||
@JsonProperty("Period")
|
||||
|
|
|
@ -122,6 +122,7 @@ public class COUNTER_Item_Usage {
|
|||
return yop;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Access_Type")
|
||||
public String getAccessType() {
|
||||
return accessType;
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
package eu.dnetlib.usagestats.sushilite.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 31/10/2016.
|
||||
*/
|
||||
public class Instance {
|
||||
|
||||
private String metricType;
|
||||
private String count;
|
||||
|
||||
|
@ -17,13 +19,15 @@ public class Instance {
|
|||
this.count = count;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("MetricType")
|
||||
public String getMetricType() {
|
||||
return metricType;
|
||||
}
|
||||
return metricType;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Count")
|
||||
public String getCount() {
|
||||
return count;
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package eu.dnetlib.usagestats.sushilite.domain;
|
|||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Created by tsampikos on 31/10/2016.
|
||||
* Created by D.Pierrakos
|
||||
*/
|
||||
public class Period {
|
||||
private String begin;
|
||||
|
@ -17,12 +17,12 @@ public class Period {
|
|||
this.end = end;
|
||||
}
|
||||
|
||||
@JsonProperty("Begin")
|
||||
@JsonProperty("Begin_Date")
|
||||
public String getBegin() {
|
||||
return begin;
|
||||
}
|
||||
|
||||
@JsonProperty("End")
|
||||
@JsonProperty("End_Date")
|
||||
public String getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
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({"Customer_ID", "Requestor_ID", "Name", "Notes", "Institution_ID"})
|
||||
public class SUSHI_Consortium_Member_List {
|
||||
|
||||
private String customerID;
|
||||
private String requestorID;
|
||||
private String name;
|
||||
private String notes;
|
||||
private List<SUSHI_Org_Identifiers> institutionID = new ArrayList();
|
||||
|
||||
|
||||
public SUSHI_Consortium_Member_List() {
|
||||
}
|
||||
|
||||
public SUSHI_Consortium_Member_List(String customerID, String requestorID,
|
||||
String name, String notes, List<SUSHI_Org_Identifiers> institutionID) {
|
||||
this.customerID = customerID;
|
||||
this.requestorID = requestorID;
|
||||
this.name = name;
|
||||
this.notes = notes;
|
||||
this.institutionID = institutionID;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Customer_ID")
|
||||
public String getCustomerID() {
|
||||
return customerID;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Requestor_ID")
|
||||
public String getRequestorID() {
|
||||
return requestorID;
|
||||
}
|
||||
|
||||
@JsonProperty("Name")
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@JsonProperty("Notes")
|
||||
public String getNotes() {
|
||||
return notes;
|
||||
}
|
||||
|
||||
@JsonProperty("Institution_ID")
|
||||
public List<SUSHI_Org_Identifiers> getInstitutionID() {
|
||||
return institutionID;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* 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 D.Pierrakos
|
||||
*/
|
||||
@JsonPropertyOrder({"Report_Name", "Report_ID", "Release", "Report_Description", "Path"})
|
||||
public class SUSHI_Report_List {
|
||||
|
||||
private String reportName;
|
||||
private String reportID;
|
||||
private String release;
|
||||
private String reportDescription;
|
||||
private String path;
|
||||
|
||||
public SUSHI_Report_List() {
|
||||
}
|
||||
|
||||
public SUSHI_Report_List(String reportName, String reportID, String release, String reportDescription, String path) {
|
||||
this.reportName = reportName;
|
||||
this.reportID = reportID;
|
||||
this.release = release;
|
||||
this.reportDescription = reportDescription;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@JsonProperty("Report_Name")
|
||||
public String getreportName() {
|
||||
return reportName;
|
||||
}
|
||||
|
||||
@JsonProperty("Report_ID")
|
||||
public String getReportID() {
|
||||
return reportID;
|
||||
}
|
||||
|
||||
@JsonProperty("Report_Description")
|
||||
public String getReportDescription() {
|
||||
return reportDescription;
|
||||
}
|
||||
|
||||
@JsonProperty("Path")
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
}
|
|
@ -17,10 +17,10 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by dpie on 25/10/2016.
|
||||
* Created by D.Pierrakos
|
||||
*/
|
||||
@JsonPropertyOrder({"Description", "Service_Active", "Registry_URL", "Note", "Alerts"})
|
||||
public class ReportStatus {
|
||||
public class SUSHI_Service_Status {
|
||||
|
||||
private String description;
|
||||
private boolean serviceActive;
|
||||
|
@ -28,10 +28,10 @@ public class ReportStatus {
|
|||
private String note;
|
||||
private List<Alert> alerts = new ArrayList();
|
||||
|
||||
public ReportStatus() {
|
||||
public SUSHI_Service_Status() {
|
||||
}
|
||||
|
||||
public ReportStatus(String description, boolean serviceActive, String registry_url, String note,List<Alert> alerts) {
|
||||
public SUSHI_Service_Status(String description, boolean serviceActive, String registry_url, String note,List<Alert> alerts) {
|
||||
this.description = description;
|
||||
this.serviceActive = serviceActive;
|
||||
this.registry_url = registry_url;
|
||||
|
@ -44,7 +44,7 @@ public class ReportStatus {
|
|||
return description;
|
||||
}
|
||||
|
||||
@JsonProperty("ServiceActive")
|
||||
@JsonProperty("Service_Active")
|
||||
public boolean getServiceActive() {
|
||||
return serviceActive;
|
||||
}
|
Loading…
Reference in New Issue