WIP: align Solr JSON records to the explore portal requirements

This commit is contained in:
Claudio Atzori 2024-06-19 15:32:52 +02:00
parent f422a58b95
commit 39fa75ae3f
5 changed files with 79 additions and 20 deletions

View File

@ -6,25 +6,20 @@ public class Pid implements Serializable {
private static final long serialVersionUID = -943684282582228545L;
private String type;
private String value;
public static Pid newInstance(String type, String value) {
private String typeCode;
private String typeLabel;
public static Pid newInstance(String value, String typeCode, String typeLabel) {
Pid p = new Pid();
p.setType(type);
p.setValue(value);
p.setTypeCode(typeCode);
p.setTypeLabel(typeLabel);
return p;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getValue() {
return value;
}
@ -32,4 +27,20 @@ public class Pid implements Serializable {
public void setValue(String value) {
this.value = value;
}
public String getTypeCode() {
return typeCode;
}
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getTypeLabel() {
return typeLabel;
}
public void setTypeLabel(String typeLabel) {
this.typeLabel = typeLabel;
}
}

View File

@ -39,6 +39,7 @@ public class RelatedRecord implements Serializable {
private String acronym;
private CodeLabel contracttype;
private Funding funding;
private String validationDate;
public RelatedRecordHeader getHeader() {
return header;
@ -215,4 +216,12 @@ public class RelatedRecord implements Serializable {
public void setFunding(Funding funding) {
this.funding = funding;
}
public String getValidationDate() {
return validationDate;
}
public void setValidationDate(String validationDate) {
this.validationDate = validationDate;
}
}

View File

@ -14,12 +14,15 @@ public class RelatedRecordHeader implements Serializable {
private RecordType relatedRecordType;
public static RelatedRecordHeader newInstance(String relationType, String relationClass, String relatedIdentifier, RecordType relatedRecordType) {
private String relationProvenance;
public static RelatedRecordHeader newInstance(String relationType, String relationClass, String relatedIdentifier, RecordType relatedRecordType, String relationProvenance) {
RelatedRecordHeader header = new RelatedRecordHeader();
header.setRelationType(relationType);
header.setRelationClass(relationClass);
header.setRelatedIdentifier(relatedIdentifier);
header.setRelatedRecordType(relatedRecordType);
header.setRelationProvenance(relationProvenance);
return header;
}
@ -54,4 +57,12 @@ public class RelatedRecordHeader implements Serializable {
public void setRelatedRecordType(RecordType relatedRecordType) {
this.relatedRecordType = relatedRecordType;
}
public String getRelationProvenance() {
return relationProvenance;
}
public void setRelationProvenance(String relationProvenance) {
this.relationProvenance = relationProvenance;
}
}

View File

@ -7,6 +7,8 @@ public class SolrRecordHeader implements Serializable {
private static final long serialVersionUID = -6052397109220149426L;
public enum Status { UNDER_CURATION }
/**
* The OpenAIRE identifiers for this record
*/
@ -19,13 +21,20 @@ public class SolrRecordHeader implements Serializable {
private RecordType recordType;
private Status status = null;
private Boolean deletedbyinference;
public static SolrRecordHeader newInstance(String id, List<String> originalId, RecordType recordType, Boolean deletedbyinference) {
return newInstance(id, originalId, recordType, null, deletedbyinference);
}
public static SolrRecordHeader newInstance(String id, List<String> originalId, RecordType recordType, Status status, Boolean deletedbyinference) {
SolrRecordHeader header = new SolrRecordHeader();
header.setId(id);
header.setOriginalId(originalId);
header.setRecordType(recordType);
header.setStatus(status);
header.setDeletedbyinference(deletedbyinference);
return header;
}
@ -58,6 +67,14 @@ public class SolrRecordHeader implements Serializable {
return deletedbyinference;
}
public Status getStatus() {
return status;
}
public void setStatus(Status status) {
this.status = status;
}
public void setDeletedbyinference(Boolean deletedbyinference) {
this.deletedbyinference = deletedbyinference;
}

View File

@ -8,12 +8,15 @@ public class Subject implements Serializable {
private String value;
private String type;
private String typeCode;
public static Subject newInstance(String value, String type) {
private String typeLabel;
public static Subject newInstance(String value, String typeCode, String typeLabel) {
Subject s = new Subject();
s.setValue(value);
s.setType(type);
s.setTypeCode(typeCode);
s.setTypeLabel(typeLabel);
return s;
}
@ -25,11 +28,19 @@ public class Subject implements Serializable {
this.value = value;
}
public String getType() {
return type;
public String getTypeCode() {
return typeCode;
}
public void setType(String type) {
this.type = type;
public void setTypeCode(String typeCode) {
this.typeCode = typeCode;
}
public String getTypeLabel() {
return typeLabel;
}
public void setTypeLabel(String typeLabel) {
this.typeLabel = typeLabel;
}
}