added default value for resulttype field
This commit is contained in:
parent
278fc9d276
commit
5100527400
|
@ -0,0 +1,40 @@
|
|||
package eu.dnetlib.dhp.schema.common;
|
||||
|
||||
import eu.dnetlib.dhp.schema.oaf.Qualifier;
|
||||
|
||||
public class ModelConstants {
|
||||
|
||||
public static final String DNET_RESULT_TYPOLOGIES = "dnet:result_typologies";
|
||||
|
||||
public static final String DATASET_RESULTTYPE_CLASSID = "dataset";
|
||||
public static final String PUBLICATION_RESULTTYPE_CLASSID = "publication";
|
||||
public static final String SOFTWARE_RESULTTYPE_CLASSID = "software";
|
||||
public static final String ORP_RESULTTYPE_CLASSID = "other";
|
||||
|
||||
public static Qualifier PUBLICATION_DEFAULT_RESULTTYPE = new Qualifier();
|
||||
public static Qualifier DATASET_DEFAULT_RESULTTYPE = new Qualifier();
|
||||
public static Qualifier SOFTWARE_DEFAULT_RESULTTYPE = new Qualifier();
|
||||
public static Qualifier ORP_DEFAULT_RESULTTYPE = new Qualifier();
|
||||
|
||||
static {
|
||||
PUBLICATION_DEFAULT_RESULTTYPE.setClassid(PUBLICATION_RESULTTYPE_CLASSID);
|
||||
PUBLICATION_DEFAULT_RESULTTYPE.setClassname(PUBLICATION_RESULTTYPE_CLASSID);
|
||||
PUBLICATION_DEFAULT_RESULTTYPE.setSchemeid(DNET_RESULT_TYPOLOGIES);
|
||||
PUBLICATION_DEFAULT_RESULTTYPE.setSchemename(DNET_RESULT_TYPOLOGIES);
|
||||
|
||||
DATASET_DEFAULT_RESULTTYPE.setClassid(DATASET_RESULTTYPE_CLASSID);
|
||||
DATASET_DEFAULT_RESULTTYPE.setClassname(DATASET_RESULTTYPE_CLASSID);
|
||||
DATASET_DEFAULT_RESULTTYPE.setSchemeid(DNET_RESULT_TYPOLOGIES);
|
||||
DATASET_DEFAULT_RESULTTYPE.setSchemename(DNET_RESULT_TYPOLOGIES);
|
||||
|
||||
SOFTWARE_DEFAULT_RESULTTYPE.setClassid(SOFTWARE_RESULTTYPE_CLASSID);
|
||||
SOFTWARE_DEFAULT_RESULTTYPE.setClassname(SOFTWARE_RESULTTYPE_CLASSID);
|
||||
SOFTWARE_DEFAULT_RESULTTYPE.setSchemeid(DNET_RESULT_TYPOLOGIES);
|
||||
SOFTWARE_DEFAULT_RESULTTYPE.setSchemename(DNET_RESULT_TYPOLOGIES);
|
||||
|
||||
ORP_DEFAULT_RESULTTYPE.setClassid(ORP_RESULTTYPE_CLASSID);
|
||||
ORP_DEFAULT_RESULTTYPE.setClassname(ORP_RESULTTYPE_CLASSID);
|
||||
ORP_DEFAULT_RESULTTYPE.setSchemeid(DNET_RESULT_TYPOLOGIES);
|
||||
ORP_DEFAULT_RESULTTYPE.setSchemename(DNET_RESULT_TYPOLOGIES);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
@ -20,6 +21,10 @@ public class Dataset extends Result implements Serializable {
|
|||
|
||||
private List<GeoLocation> geolocation;
|
||||
|
||||
public Dataset() {
|
||||
setResulttype(ModelConstants.DATASET_DEFAULT_RESULTTYPE);
|
||||
}
|
||||
|
||||
public Field<String> getStoragedate() {
|
||||
return storagedate;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
@ -12,6 +13,10 @@ public class OtherResearchProduct extends Result implements Serializable {
|
|||
|
||||
private List<Field<String>> tool;
|
||||
|
||||
public OtherResearchProduct() {
|
||||
setResulttype(ModelConstants.ORP_DEFAULT_RESULTTYPE);
|
||||
}
|
||||
|
||||
public List<Field<String>> getContactperson() {
|
||||
return contactperson;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -8,6 +9,10 @@ public class Publication extends Result implements Serializable {
|
|||
// publication specific
|
||||
private Journal journal;
|
||||
|
||||
public Publication() {
|
||||
setResulttype(ModelConstants.PUBLICATION_DEFAULT_RESULTTYPE);
|
||||
}
|
||||
|
||||
public Journal getJournal() {
|
||||
return journal;
|
||||
}
|
||||
|
|
|
@ -231,6 +231,9 @@ public class Result extends OafEntity implements Serializable {
|
|||
|
||||
instance = mergeLists(instance, r.getInstance());
|
||||
|
||||
if (r.getBestaccessright() != null && compareTrust(this, r) < 0)
|
||||
bestaccessright = r.getBestaccessright();
|
||||
|
||||
if (r.getResulttype() != null && compareTrust(this, r) < 0) resulttype = r.getResulttype();
|
||||
|
||||
if (r.getLanguage() != null && compareTrust(this, r) < 0) language = r.getLanguage();
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package eu.dnetlib.dhp.schema.oaf;
|
||||
|
||||
import eu.dnetlib.dhp.schema.common.ModelConstants;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
@ -14,6 +15,10 @@ public class Software extends Result implements Serializable {
|
|||
|
||||
private Qualifier programmingLanguage;
|
||||
|
||||
public Software() {
|
||||
setResulttype(ModelConstants.SOFTWARE_DEFAULT_RESULTTYPE);
|
||||
}
|
||||
|
||||
public List<Field<String>> getDocumentationUrl() {
|
||||
return documentationUrl;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue