From 83d14611c7d5b1ca2f5fcea3d337d815a025d7ba Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Fri, 22 Oct 2021 10:16:05 +0200 Subject: [PATCH] Removed version and changelog. It seems not needed --- .../impl/entities/QueryTemplateImpl.java | 70 ------------------- .../reference/entities/QueryTemplate.java | 38 ---------- 2 files changed, 108 deletions(-) diff --git a/src/main/java/org/gcube/informationsystem/query/templates/impl/entities/QueryTemplateImpl.java b/src/main/java/org/gcube/informationsystem/query/templates/impl/entities/QueryTemplateImpl.java index 1941aa2..8afad25 100644 --- a/src/main/java/org/gcube/informationsystem/query/templates/impl/entities/QueryTemplateImpl.java +++ b/src/main/java/org/gcube/informationsystem/query/templates/impl/entities/QueryTemplateImpl.java @@ -3,14 +3,10 @@ package org.gcube.informationsystem.query.templates.impl.entities; import java.util.HashMap; import java.util.Map; -import org.gcube.com.fasterxml.jackson.annotation.JsonInclude; -import org.gcube.com.fasterxml.jackson.annotation.JsonInclude.Include; -import org.gcube.com.fasterxml.jackson.annotation.JsonProperty; import org.gcube.informationsystem.base.impl.entities.EntityElementImpl; import org.gcube.informationsystem.query.templates.reference.entities.QueryTemplate; import org.gcube.informationsystem.query.templates.reference.properties.TemplateProperty; import org.gcube.informationsystem.query.templates.reference.properties.TemplateVariable; -import org.gcube.informationsystem.utils.Version; /** * @author Luca Frosini (ISTI - CNR) @@ -24,16 +20,11 @@ public class QueryTemplateImpl extends EntityElementImpl implements QueryTemplat protected String name; protected String description; - protected Version version; - @JsonProperty(value = CHANGELOG_PROPERTY, required = true) - @JsonInclude(Include.NON_NULL) - protected Map changelog; protected TemplateProperty template; protected Map templateVariables; public QueryTemplateImpl() { - this.changelog = new HashMap<>(); this.templateVariables = new HashMap<>(); } @@ -57,67 +48,6 @@ public class QueryTemplateImpl extends EntityElementImpl implements QueryTemplat this.description = description; } - @Override - public Version getVersion() { - return version; - } - - @Override - public void setVersion(Version version) { - this.version = version; - } - - @Override - public String getVersionAsString() { - return version.toString(); - } - - @Override - public void setVersion(String version) { - this.version = new Version(version); - } - - @Override - public Map getChangelog() { - return changelog; - } - - @Override - public void addChangelog(Version typeVersion, String changeDescription) { - if(changelog.get(typeVersion)!=null) { - throw new RuntimeException("Changelog for version " + typeVersion.toString() + " alread exists"); - } - changelog.put(typeVersion, changeDescription); - } - - @Override - public Map getChangelogWithVersionAsString() { - Map map = new HashMap<>(); - for (Version typeVersion : changelog.keySet()) { - map.put(typeVersion.toString(), changelog.get(typeVersion)); - } - return map; - } - - @Override - public void setChangelog(Map changelog) { - this.changelog = changelog; - } - - @Override - public void setChangelogWithVersionAsString(Map changelog) { - this.changelog = new HashMap<>(); - for (String version : changelog.keySet()) { - this.changelog.put(new Version(version), changelog.get(version)); - } - } - - @Override - public void addChangelog(String version, String changeDescription) { - Version typeVersion = new Version(version); - addChangelog(typeVersion, changeDescription); - } - @Override public TemplateProperty getTemplate() { return template; diff --git a/src/main/java/org/gcube/informationsystem/query/templates/reference/entities/QueryTemplate.java b/src/main/java/org/gcube/informationsystem/query/templates/reference/entities/QueryTemplate.java index 3d4be23..c3dd9bb 100644 --- a/src/main/java/org/gcube/informationsystem/query/templates/reference/entities/QueryTemplate.java +++ b/src/main/java/org/gcube/informationsystem/query/templates/reference/entities/QueryTemplate.java @@ -5,9 +5,6 @@ import java.util.Map; import org.gcube.com.fasterxml.jackson.annotation.JsonGetter; import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore; import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import org.gcube.com.fasterxml.jackson.annotation.JsonInclude; -import org.gcube.com.fasterxml.jackson.annotation.JsonInclude.Include; -import org.gcube.com.fasterxml.jackson.annotation.JsonSetter; import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize; import org.gcube.informationsystem.base.reference.entities.EntityElement; import org.gcube.informationsystem.query.templates.impl.entities.QueryTemplateImpl; @@ -31,8 +28,6 @@ public interface QueryTemplate extends EntityElement { public static final String NAME_PROPERTY = "name"; public static final String DESCRIPTION_PROPERTY = "description"; - public static final String VERSION_PROPERTY = "version"; - public static final String CHANGELOG_PROPERTY = "changelog"; public static final String TEMPLATE_PROPERTY = "template"; public static final String TEMPLATE_VARIABLES_PROPERTY = "templateVariables"; @@ -47,39 +42,6 @@ public interface QueryTemplate extends EntityElement { public void setDescription(String description); - @JsonIgnore - public Version getVersion(); - - public void setVersion(Version typeVersion); - - @JsonGetter(value = VERSION_PROPERTY) - @ISProperty(name = VERSION_PROPERTY, description = "The version of the Query Template.", readonly = false, mandatory = true, nullable = false) - public String getVersionAsString(); - - @JsonSetter(value = VERSION_PROPERTY) - public void setVersion(String version); - - @JsonIgnore - public Map getChangelog(); - - @JsonIgnore - public void setChangelog(Map changelog); - - @JsonIgnore - public void addChangelog(Version version, String changeDescription); - - @JsonGetter(value = CHANGELOG_PROPERTY) - @JsonInclude(Include.NON_NULL) - @ISProperty(name = CHANGELOG_PROPERTY, description = "Provides the changelog of changes made to the Query Temaplate.", readonly = false, mandatory = true, nullable = false) - public Map getChangelogWithVersionAsString(); - - @JsonIgnore - @JsonSetter(value=CHANGELOG_PROPERTY) - public void setChangelogWithVersionAsString(Map changelog); - - @JsonIgnore - public void addChangelog(String version, String changeDescription); - @JsonGetter(value = TEMPLATE_PROPERTY) @ISProperty(name = TEMPLATE_PROPERTY, description = "The Query Template. It can contains query variables to be replaced to obtain a runnable query.", readonly = false, mandatory = true, nullable = false) public TemplateProperty getTemplate();