// ************************* CONSTRUCTOR ************************************
@Deprecated //for hibernate use only
- protected Identifier(){};
+ protected Identifier(){}
public Identifier (String identifier, IdentifierType type){
this.identifier = identifier;
this.type = identifierType;
}
+ public String getUrl() {
+ try {
+ if (type == null || isBlank(type.getUrlPattern()) || isBlank(this.identifier) ) {
+ return null;
+ }else {
+ return type.getUrlPattern().replace("{@ID}", this.identifier);
+ }
+ } catch (Exception e) {
+ return "error creating url pattern";
+ }
+ }
+
//****************** CLONE ************************************************/
@Override
return new IdentifierType(description, label, labelAbbrev, null);
}
+ //#10260
+ //a pattern representing an URL and which includes the placeholde "{@ID}"
+ //which will be replaced by the actual identifier
private String urlPattern;
//******************* CONSTRUCTOR ***********************************/
// ******************** GETTER /SETTER *********
+
+ /**
+ * A pattern which represents an URL and which includes the placeholde "{@ID}"
+ * which will be replaced by the actual identifier
+ * @see https://dev.e-taxonomy.eu/redmine/issues/10260
+ */
public String getUrlPattern() {
return urlPattern;
}
+ /**
+ * @param urlPattern the url pattern
+ * @see #getUrlPattern()
+ */
public void setUrlPattern(String urlPattern) {
this.urlPattern = urlPattern;
}