Mercurial > hg > LGDataverses
diff src/main/java/edu/harvard/iq/dataverse/DatasetAuthor.java @ 10:a50cf11e5178
Rewrite LGDataverse completely upgrading to dataverse4.0
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Tue, 08 Sep 2015 17:00:21 +0200 |
| parents | |
| children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetAuthor.java Tue Sep 08 17:00:21 2015 +0200 @@ -0,0 +1,92 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +package edu.harvard.iq.dataverse; + +import java.util.Comparator; + + +/** + * + * @author skraffmiller + */ + +public class DatasetAuthor { + + public static Comparator<DatasetAuthor> DisplayOrder = new Comparator<DatasetAuthor>(){ + @Override + public int compare(DatasetAuthor o1, DatasetAuthor o2) { + return o1.getDisplayOrder()-o2.getDisplayOrder(); + } + }; + + private DatasetVersion datasetVersion; + public DatasetVersion getDatasetVersion() { + return datasetVersion; + } + public void setDatasetVersion(DatasetVersion metadata) { + this.datasetVersion = metadata; + } + + //@NotBlank(message = "Please enter an Author Name for your dataset.") + private DatasetField name; + + public DatasetField getName() { + return this.name; + } + public void setName(DatasetField name) { + this.name = name; + } + + private int displayOrder; + public int getDisplayOrder() { + return this.displayOrder; + } + public void setDisplayOrder(int displayOrder) { + this.displayOrder = displayOrder; + } + + private DatasetField affiliation; + public DatasetField getAffiliation() { + return this.affiliation; + } + public void setAffiliation(DatasetField affiliation) { + this.affiliation = affiliation; + } + + private String idType; + + public String getIdType() { + return idType; + } + + public void setIdType(String idType) { + this.idType = idType; + } + + private String idValue; + + + public String getIdValue() { + return idValue; + } + + public void setIdValue(String idValue) { + this.idValue = idValue; + if (!this.idValue.isEmpty()){ + setIdType("ORCID"); + } else { + setIdType(""); + } + } + + public boolean isEmpty() { + return ( (affiliation==null || affiliation.getValue().trim().equals("")) + && (name==null || name.getValue().trim().equals("")) + ); + } + +}
