diff --git a/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java b/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java index d47a749..f0dfb09 100644 --- a/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java +++ b/src/main/java/eu/dnetlib/uoamonitorservice/entities/Stakeholder.java @@ -14,6 +14,16 @@ enum StakeholderType FUNDER, RI, PROJECT, ORGANIZATION; } +enum Locale { + EN("en"), EU("eu"); + + public final String label; + + private Locale(String label) { + this.label = label; + } +} + public class Stakeholder { @Id @@ -31,6 +41,7 @@ public class Stakeholder { private String alias; private String description; private String defaultId = null; + private Locale locale = Locale.EU; private Visibility visibility = Visibility.PRIVATE; private Date creationDate; private Date updateDate; @@ -53,6 +64,7 @@ public class Stakeholder { alias = stakeholder.getAlias(); description = stakeholder.getDescription(); defaultId = stakeholder.getDefaultId(); + setLocale(stakeholder.getLocale()); setVisibility(stakeholder.getVisibility()); creationDate = stakeholder.getCreationDate(); updateDate = stakeholder.getUpdateDate(); @@ -166,6 +178,20 @@ public class Stakeholder { this.defaultId = defaultId; } + public String getLocale() { + return locale.label; + } + + public void setLocale(String label) { + Locale locale = null; + for (Locale l : Locale.values()) { + if (l.label.equals(label)) { + locale = l; + } + } + this.locale = locale; + } + public Visibility getVisibility() { //return visibility.getLabel(); return visibility;