1
0
Fork 0

serialisation of APCs int he XML records

This commit is contained in:
Alessia Bardi 2022-02-11 11:00:20 +01:00
parent 1f8302dc37
commit 600ede1798
4 changed files with 48 additions and 3 deletions

View File

@ -348,9 +348,9 @@ public abstract class AbstractMdRecordToOafMapper {
r.setContext(prepareContexts(doc, info));
r.setExternalReference(new ArrayList<>()); // NOT PRESENT IN MDSTORES
r
.setProcessingchargeamount(field(doc.valueOf("//oaf:processingchargeamount"), info));
.setProcessingchargeamount(field(doc.valueOf("//oaf:processingchargeamount"), info));
r
.setProcessingchargecurrency(field(doc.valueOf("//oaf:processingchargeamount/@currency"), info));
.setProcessingchargecurrency(field(doc.valueOf("//oaf:processingchargeamount/@currency"), info));
r.setInstance(instances);
r.setBestaccessright(OafMapperUtils.createBestAccessRights(instances));

View File

@ -398,6 +398,16 @@ public class XmlRecordFactory implements Serializable {
if (r.getResourcetype() != null) {
metadata.add(XmlSerializationUtils.mapQualifier("resourcetype", r.getResourcetype()));
}
if (r.getProcessingchargeamount() != null) {
metadata
.add(
XmlSerializationUtils
.asXmlElement("processingchargeamount", r.getProcessingchargeamount().getValue()));
metadata
.add(
XmlSerializationUtils
.asXmlElement("processingchargecurrency", r.getProcessingchargecurrency().getValue()));
}
}
switch (type) {

View File

@ -66,6 +66,9 @@ public class XmlRecordFactoryTest {
assertEquals("10.5689/LIB.2018.2853550", doc.valueOf("//instance/alternateidentifier/text()"));
assertEquals(3, doc.selectNodes("//instance").size());
assertEquals("1721.47", doc.valueOf("//processingchargeamount/text()"));
assertEquals("EUR", doc.valueOf("//processingchargecurrency/text()"));
}
@Test

View File

@ -1655,5 +1655,37 @@
},
"value": "Understanding Electromigration in Cu-CNT Composite Interconnects A Multiscale Electrothermal Simulation Study"
}
]
],
"processingchargeamount": {
"value": "1721.47",
"dataInfo": {
"invisible": true,
"inferred": false,
"deletedbyinference": false,
"trust": "0.9",
"inferenceprovenance": "",
"provenanceaction": {
"classid": "sysimport:crosswalk:datasetarchive",
"classname": "sysimport:crosswalk:datasetarchive",
"schemeid": "dnet:provenanceActions",
"schemename": "dnet:provenanceActions"
}
}
},
"processingchargecurrency": {
"value": "EUR",
"dataInfo": {
"invisible": true,
"inferred": false,
"deletedbyinference": false,
"trust": "0.9",
"inferenceprovenance": "",
"provenanceaction": {
"classid": "sysimport:crosswalk:datasetarchive",
"classname": "sysimport:crosswalk:datasetarchive",
"schemeid": "dnet:provenanceActions",
"schemename": "dnet:provenanceActions"
}
}
}
}