forked from D-Net/dnet-hadoop
[graph provision]fixed wf definition, revised serialization of the usage counts measures
This commit is contained in:
parent
92f018d196
commit
834461ba26
|
@ -170,30 +170,19 @@ public class XmlSerializationUtils {
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
// <measure downloads="0" views="0">infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE</measure>
|
// <measure views="0" datasource="infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE" />
|
||||||
|
// <measure downloads="0" datasource="infrastruct_::f66f1bd369679b5b077dcdf006089556||OpenAIRE" />
|
||||||
public static String usageMeasureAsXmlElement(String name, Measure measure) {
|
public static String usageMeasureAsXmlElement(String name, Measure measure) {
|
||||||
HashSet<String> dsIds = Optional
|
|
||||||
.ofNullable(measure.getUnit())
|
|
||||||
.map(
|
|
||||||
m -> m
|
|
||||||
.stream()
|
|
||||||
.map(KeyValue::getKey)
|
|
||||||
.collect(Collectors.toCollection(HashSet::new)))
|
|
||||||
.orElse(new HashSet<>());
|
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
dsIds.forEach(dsId -> {
|
for (KeyValue kv : measure.getUnit()) {
|
||||||
sb
|
sb
|
||||||
.append("<")
|
.append("<")
|
||||||
.append(name);
|
.append(name)
|
||||||
for (KeyValue kv : measure.getUnit()) {
|
|
||||||
sb.append(" ").append(attr(measure.getId(), kv.getValue()));
|
|
||||||
}
|
|
||||||
sb
|
|
||||||
.append(" ")
|
.append(" ")
|
||||||
.append(attr("datasource", dsId))
|
.append(attr(measure.getId(), kv.getValue()))
|
||||||
|
.append(attr("datasource", kv.getKey()))
|
||||||
.append(" />");
|
.append(" />");
|
||||||
});
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>validateXML</name>
|
<name>validateXML</name>
|
||||||
<description>should the payload converter validate the XMLs</description>
|
|
||||||
<value>false</value>
|
<value>false</value>
|
||||||
|
<description>should the payload converter validate the XMLs</description>
|
||||||
</property>
|
</property>
|
||||||
<property>
|
<property>
|
||||||
<name>relPartitions</name>
|
<name>relPartitions</name>
|
||||||
|
|
Loading…
Reference in New Issue