Changes in ItemIdentifiers

This commit is contained in:
Dimitris 2021-02-25 10:10:26 +02:00
parent 74d1a1877d
commit 9e1e31285c
5 changed files with 23 additions and 48 deletions

View File

@ -16,7 +16,7 @@ import java.util.List;
public class COUNTER_Item_Component { public class COUNTER_Item_Component {
private String itemName; private String itemName;
private List<COUNTER_Item_Identifier> itemIdentifiers = new ArrayList<>(); private List<COUNTER_Item_Identifiers> itemIdentifiers = new ArrayList<>();
private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>(); private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>();
private List<COUNTER_Item_Dates> itemDates = new ArrayList<>(); private List<COUNTER_Item_Dates> itemDates = new ArrayList<>();
private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>(); private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>();
@ -39,7 +39,7 @@ public class COUNTER_Item_Component {
} }
public void addIdentifier(COUNTER_Item_Identifier itemIdentifier) { public void addIdentifier(COUNTER_Item_Identifiers itemIdentifier) {
itemIdentifiers.add(itemIdentifier); itemIdentifiers.add(itemIdentifier);
} }
} }

View File

@ -1,29 +0,0 @@
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

@ -16,7 +16,7 @@ import java.util.List;
public class COUNTER_Item_Parent { public class COUNTER_Item_Parent {
private String itemName; private String itemName;
private List<COUNTER_Item_Identifier> itemIdentifiers = new ArrayList<>(); private List<COUNTER_Item_Identifiers> itemIdentifiers = new ArrayList<>();
private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>(); private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>();
private List<COUNTER_Item_Dates> itemDates = new ArrayList<>(); private List<COUNTER_Item_Dates> itemDates = new ArrayList<>();
private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>(); private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>();
@ -38,7 +38,7 @@ public class COUNTER_Item_Parent {
} }
public void addIdentifier(COUNTER_Item_Identifier itemIdentifier) { public void addIdentifier(COUNTER_Item_Identifiers itemIdentifier) {
itemIdentifiers.add(itemIdentifier); itemIdentifiers.add(itemIdentifier);
} }
} }

View File

@ -6,7 +6,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* Created by tsampikos on 31/10/2016. * Created by D.Pierrakos
*/ */
public class COUNTER_Item_Performance { public class COUNTER_Item_Performance {
@ -16,17 +16,17 @@ public class COUNTER_Item_Performance {
public COUNTER_Item_Performance() { public COUNTER_Item_Performance() {
} }
public COUNTER_Item_Performance(String start, String end, String ft_count, public COUNTER_Item_Performance(String start, String end, String downloads,
String abstr) { String views) {
period = new Period(start, end); period = new Period(start, end);
if (ft_count != null && abstr != null) { if (downloads != null && views != null) {
instances.add(new Instance("Total_Items_Requests", ft_count)); instances.add(new Instance("Total_Items_Requests", downloads));
instances.add(new Instance("Total_Items_Investigations", abstr)); instances.add(new Instance("Total_Items_Investigations", views));
} }
else if(ft_count != null && abstr == null ) else if(downloads != null && views == null )
instances.add(new Instance("Total_Items_Requests", ft_count)); instances.add(new Instance("Total_Items_Requests", downloads));
else if(ft_count == null && abstr != null ) else if(downloads == null && views != null )
instances.add(new Instance("Total_Items_Investigations",abstr)); instances.add(new Instance("Total_Items_Investigations",views));
} }
@JsonProperty("Period") @JsonProperty("Period")

View File

@ -15,7 +15,7 @@ import java.util.List;
public class COUNTER_Item_Usage { public class COUNTER_Item_Usage {
private String item; private String item;
private List<COUNTER_Item_Identifier> itemIdentifiers = new ArrayList<>(); private List<COUNTER_Item_Identifiers> itemIdentifiers = new ArrayList<>();
private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>(); private List<COUNTER_Item_Contributors> itemContributors = new ArrayList<>();
private List<COUNTER_Item_Dates> itemDates = new ArrayList<>(); private List<COUNTER_Item_Dates> itemDates = new ArrayList<>();
private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>(); private List<COUNTER_Item_Attributes> itemAttributes = new ArrayList<>();
@ -43,7 +43,7 @@ public class COUNTER_Item_Usage {
this.yop = yop; this.yop = yop;
this.accessType = acccesType; this.accessType = acccesType;
this.accessMethod = accessMethod; this.accessMethod = accessMethod;
this.itemIdentifiers = null; //this.itemIdentifiers = itemIdentifiers;
this.itemContributors = null; this.itemContributors = null;
this.itemDates = null; this.itemDates = null;
this.itemAttributes = null; this.itemAttributes = null;
@ -61,7 +61,7 @@ public class COUNTER_Item_Usage {
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
@JsonProperty("Item_ID") @JsonProperty("Item_ID")
public List<COUNTER_Item_Identifier> getItemIdentifiers() { public List<COUNTER_Item_Identifiers> getItemIdentifiers() {
return itemIdentifiers; return itemIdentifiers;
} }
@ -137,10 +137,12 @@ public class COUNTER_Item_Usage {
return itemPerformances; return itemPerformances;
} }
public void addIdentifier(COUNTER_Item_Identifier itemIdentifier) { public void addIdentifier(COUNTER_Item_Identifiers itemIdentifier) {
itemIdentifiers.add(itemIdentifier); itemIdentifiers.add(itemIdentifier);
} }
public void setIdentifier(List<COUNTER_Item_Identifiers> itemIdentifier) {
this.itemIdentifiers=itemIdentifier;
}
public void addItemContributors(COUNTER_Item_Contributors itemContributor) { public void addItemContributors(COUNTER_Item_Contributors itemContributor) {
itemContributors.add(itemContributor); itemContributors.add(itemContributor);
} }
@ -168,4 +170,6 @@ public class COUNTER_Item_Usage {
public void addPerformance(COUNTER_Item_Performance itemPerformance) { public void addPerformance(COUNTER_Item_Performance itemPerformance) {
itemPerformances.add(itemPerformance); itemPerformances.add(itemPerformance);
} }
} }