[downloadsAndViews] changed the serialization for downloads and views
This commit is contained in:
parent
128c143394
commit
3955ceaa76
|
@ -170,18 +170,19 @@ public class XmlSerializationUtils {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// <measure views="0" datasource="infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE" />
|
// <measure id="views" count="0" datasource="infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE" />
|
||||||
// <measure downloads="0" datasource="infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE" />
|
// <measure id="downloads" count="0" datasource="infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE" />
|
||||||
public static String usageMeasureAsXmlElement(String name, Measure measure) {
|
public static String usageMeasureAsXmlElement(String name, Measure measure) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (KeyValue kv : measure.getUnit()) {
|
for (KeyValue kv : measure.getUnit()) {
|
||||||
sb
|
sb
|
||||||
.append("<")
|
.append("<")
|
||||||
.append(name)
|
.append(name)
|
||||||
.append(" ")
|
.append(" ")
|
||||||
.append(attr(measure.getId(), kv.getValue()))
|
.append(attr("id", measure.getId()))
|
||||||
.append(attr("datasource", kv.getKey()))
|
.append(attr("count", kv.getValue()))
|
||||||
.append(" />");
|
.append(attr("datasource", kv.getKey()))
|
||||||
|
.append(" />");
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue