85 lines
2.2 KiB
Java
85 lines
2.2 KiB
Java
package eu.eudat.model.publicapi.organisation;
|
|
|
|
import eu.eudat.commons.enums.ReferenceType;
|
|
import eu.eudat.data.old.Organisation;
|
|
import eu.eudat.model.DmpReference;
|
|
import eu.eudat.model.Reference;
|
|
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.UUID;
|
|
|
|
public class OrganizationPublicModel {
|
|
private String label;
|
|
private String name;
|
|
private String id;
|
|
private String reference;
|
|
private int status;
|
|
private String tag; // how the external source is displayed. ex: "Cristin".
|
|
private String key; // the external source. ex: "cristin".
|
|
|
|
public String getLabel() {
|
|
return label;
|
|
}
|
|
public void setLabel(String label) {
|
|
this.label = label;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public String getId() {
|
|
return id;
|
|
}
|
|
public void setId(String id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public String getReference() {
|
|
return reference;
|
|
}
|
|
public void setReference(String reference) {
|
|
this.reference = reference;
|
|
}
|
|
|
|
public int getStatus() {
|
|
return status;
|
|
}
|
|
public void setStatus(int status) {
|
|
this.status = status;
|
|
}
|
|
|
|
public String getTag() {
|
|
return tag;
|
|
}
|
|
public void setTag(String tag) {
|
|
this.tag = tag;
|
|
}
|
|
|
|
public String getKey() {
|
|
return key;
|
|
}
|
|
public void setKey(String key) {
|
|
this.key = key;
|
|
}
|
|
|
|
public static OrganizationPublicModel fromDmpReference(DmpReference dmpReference) {
|
|
if (dmpReference.getReference().getType() != ReferenceType.Organizations)
|
|
return null;
|
|
OrganizationPublicModel model = new OrganizationPublicModel();
|
|
Reference reference = dmpReference.getReference();
|
|
model.setId(reference.getId().toString());
|
|
model.setReference(reference.getReference());
|
|
model.setLabel(reference.getLabel());
|
|
model.setName(reference.getLabel());
|
|
if (reference.getReference() != null)
|
|
model.setKey(reference.getReference().substring(0, reference.getReference().indexOf(":")));
|
|
|
|
return model;
|
|
}
|
|
}
|