partial implementation of xml serialization
This commit is contained in:
parent
411ab9b27f
commit
34026cea35
|
@ -266,6 +266,7 @@ public class SolrRecordMapper {
|
|||
|
||||
final Instance instance = new Instance();
|
||||
|
||||
// TODO verificare il valore (dovrebbe essere classid="0004" classname="Conference object")
|
||||
instance.setInstancetype(re.getResourceType());
|
||||
instance.setCollectedfrom(collectedFrom);
|
||||
instance.setHostedby(hostedBy);
|
||||
|
|
|
@ -132,27 +132,26 @@ public class XMLSolrSerializer {
|
|||
}
|
||||
}
|
||||
|
||||
private static void addResultInstance(final Element childrenNode, final Instance p) {
|
||||
// TODO Auto-generated method stub
|
||||
/*
|
||||
private static void addResultInstance(final Element childrenNode, final Instance i) {
|
||||
final Element instanceNode = childrenNode.addElement("instance");
|
||||
|
||||
//TODO manca il code o il name
|
||||
addStructuredField(instanceNode, "instancetype", i.getInstancetype(), ModelConstants.DNET_PUBLICATION_RESOURCE, null);
|
||||
|
||||
addStructuredField(instanceNode, "accessright", i.getAccessright().getCode(), i.getAccessright().getLabel(), ModelConstants.DNET_ACCESS_MODES, null);
|
||||
|
||||
final Element collectedFrom = instanceNode.addElement("collectedfrom");
|
||||
collectedFrom.addAttribute("id", i.getCollectedfrom().getDsId());
|
||||
collectedFrom.addAttribute("name", i.getCollectedfrom().getDsName());
|
||||
|
||||
final Element hostedBy = instanceNode.addElement("hostedby");
|
||||
hostedBy.addAttribute("id", i.getHostedby().getDsId());
|
||||
hostedBy.addAttribute("name", i.getHostedby().getDsName());
|
||||
|
||||
if (i.getUrl() != null) {
|
||||
i.getUrl().forEach(url -> instanceNode.addElement("webresource").addElement("url").addText(url));
|
||||
}
|
||||
|
||||
<children>
|
||||
<instance>
|
||||
<accessright classid="CLOSED" classname="Closed Access" schemeid="dnet:access_modes" schemename="dnet:access_modes" />
|
||||
<collectedfrom name="Croatian Scientific Bibliography - CROSBI" id="openaire____::345c9d171ef3c5d706d08041d506428c" />
|
||||
<hostedby name="Croatian Scientific Bibliography - CROSBI" id="openaire____::345c9d171ef3c5d706d08041d506428c" />
|
||||
<dateofacceptance>2013-01-01</dateofacceptance>
|
||||
<instancetype classid="0004" classname="Conference object" schemeid="dnet:publication_resource" schemename="dnet:publication_resource" />
|
||||
<refereed classid="0002" classname="nonPeerReviewed" schemeid="dnet:review_levels" schemename="dnet:review_levels" />
|
||||
<webresource>
|
||||
<url>https://www.bib.irb.hr/683750</url>
|
||||
</webresource>
|
||||
</instance>
|
||||
</children>
|
||||
</result>
|
||||
*/
|
||||
}
|
||||
|
||||
private static void addRelProject(final Element relsNode, final RelatedRecord p) {
|
||||
|
|
Loading…
Reference in New Issue