Removed version and changelog. It seems not needed
This commit is contained in:
parent
92c986ad27
commit
83d14611c7
|
@ -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<Version, String> changelog;
|
||||
|
||||
protected TemplateProperty template;
|
||||
protected Map<String, TemplateVariable> 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<Version, String> 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<String, String> getChangelogWithVersionAsString() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
for (Version typeVersion : changelog.keySet()) {
|
||||
map.put(typeVersion.toString(), changelog.get(typeVersion));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChangelog(Map<Version, String> changelog) {
|
||||
this.changelog = changelog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setChangelogWithVersionAsString(Map<String, String> 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;
|
||||
|
|
|
@ -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<Version, String> getChangelog();
|
||||
|
||||
@JsonIgnore
|
||||
public void setChangelog(Map<Version, String> 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<String, String> getChangelogWithVersionAsString();
|
||||
|
||||
@JsonIgnore
|
||||
@JsonSetter(value=CHANGELOG_PROPERTY)
|
||||
public void setChangelogWithVersionAsString(Map<String, String> 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();
|
||||
|
|
Loading…
Reference in New Issue