Compare commits
2 Commits
master
...
indicatorP
Author | SHA1 | Date |
---|---|---|
Konstantinos Triantafyllou | a1e5a421af | |
Konstantinos Triantafyllou | 668dd704ff |
|
@ -0,0 +1,12 @@
|
||||||
|
function addIndicatorPathGroups() {
|
||||||
|
var indicators = db.indicator.find({});
|
||||||
|
indicators.forEach(indicator => {
|
||||||
|
var paths = indicator.indicatorPaths;
|
||||||
|
delete indicator.indicatorPaths;
|
||||||
|
indicator.indicatorPathGroups = [];
|
||||||
|
indicator.indicatorPathGroups.push({title: '', indicatorPaths: paths});
|
||||||
|
db.indicator.save(indicator);
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
addIndicatorPathGroups();
|
|
@ -2,6 +2,7 @@ package eu.dnetlib.uoamonitorservice.entities;
|
||||||
|
|
||||||
import eu.dnetlib.uoamonitorservice.generics.Common;
|
import eu.dnetlib.uoamonitorservice.generics.Common;
|
||||||
import eu.dnetlib.uoamonitorservice.primitives.IndicatorPath;
|
import eu.dnetlib.uoamonitorservice.primitives.IndicatorPath;
|
||||||
|
import eu.dnetlib.uoamonitorservice.primitives.IndicatorPathGroup;
|
||||||
import eu.dnetlib.uoamonitorservice.primitives.IndicatorSize;
|
import eu.dnetlib.uoamonitorservice.primitives.IndicatorSize;
|
||||||
import eu.dnetlib.uoamonitorservice.primitives.IndicatorType;
|
import eu.dnetlib.uoamonitorservice.primitives.IndicatorType;
|
||||||
|
|
||||||
|
@ -13,7 +14,7 @@ public class Indicator extends Common {
|
||||||
private IndicatorSize width; //small,medium,large
|
private IndicatorSize width; //small,medium,large
|
||||||
private IndicatorSize height = IndicatorSize.MEDIUM; //small,medium,large
|
private IndicatorSize height = IndicatorSize.MEDIUM; //small,medium,large
|
||||||
private List<String> tags; // this field is not used anywhere now
|
private List<String> tags; // this field is not used anywhere now
|
||||||
private List<IndicatorPath> indicatorPaths;
|
private List<IndicatorPathGroup> indicatorPathGroups;
|
||||||
|
|
||||||
public Indicator() {}
|
public Indicator() {}
|
||||||
|
|
||||||
|
@ -26,7 +27,7 @@ public class Indicator extends Common {
|
||||||
creationDate = indicator.getCreationDate();
|
creationDate = indicator.getCreationDate();
|
||||||
updateDate = indicator.getUpdateDate();
|
updateDate = indicator.getUpdateDate();
|
||||||
visibility = indicator.getVisibility();
|
visibility = indicator.getVisibility();
|
||||||
indicatorPaths = indicator.getIndicatorPaths();
|
indicatorPathGroups = indicator.getIndicatorPathGroups();
|
||||||
tags = indicator.getTags();
|
tags = indicator.getTags();
|
||||||
setType(indicator.getType());
|
setType(indicator.getType());
|
||||||
width = indicator.getWidth();
|
width = indicator.getWidth();
|
||||||
|
@ -54,7 +55,7 @@ public class Indicator extends Common {
|
||||||
(old.getHeight() == null || old.getHeight().equals(indicator.getHeight()))) {
|
(old.getHeight() == null || old.getHeight().equals(indicator.getHeight()))) {
|
||||||
indicator.setHeight(this.getHeight());
|
indicator.setHeight(this.getHeight());
|
||||||
}
|
}
|
||||||
indicator.setIndicatorPaths(this.getIndicatorPaths());
|
indicator.setIndicatorPathGroups(this.getIndicatorPathGroups());
|
||||||
return indicator;
|
return indicator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,11 +106,11 @@ public class Indicator extends Common {
|
||||||
this.tags = tags;
|
this.tags = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<IndicatorPath> getIndicatorPaths() {
|
public List<IndicatorPathGroup> getIndicatorPathGroups() {
|
||||||
return indicatorPaths;
|
return indicatorPathGroups;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIndicatorPaths(List<IndicatorPath> indicatorPaths) {
|
public void setIndicatorPathGroups(List<IndicatorPathGroup> indicatorPathGroups) {
|
||||||
this.indicatorPaths = indicatorPaths;
|
this.indicatorPathGroups = indicatorPathGroups;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ public class IndicatorPath {
|
||||||
private String chartObject;
|
private String chartObject;
|
||||||
private Map<String, String> parameters;
|
private Map<String, String> parameters;
|
||||||
private Map<String, String> filters;
|
private Map<String, String> filters;
|
||||||
//private Map<String, Map<String, String>> filters;
|
|
||||||
|
|
||||||
public IndicatorPath() {}
|
public IndicatorPath() {}
|
||||||
|
|
||||||
|
@ -34,10 +33,6 @@ public class IndicatorPath {
|
||||||
return type.name();
|
return type.name();
|
||||||
}
|
}
|
||||||
|
|
||||||
// public IndicatorPathType getType() {
|
|
||||||
// return type;
|
|
||||||
// }
|
|
||||||
|
|
||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
if(type == null) {
|
if(type == null) {
|
||||||
this.type = null;
|
this.type = null;
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package eu.dnetlib.uoamonitorservice.primitives;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class IndicatorPathGroup {
|
||||||
|
String title;
|
||||||
|
List<IndicatorPath> indicatorPaths;
|
||||||
|
|
||||||
|
public IndicatorPathGroup() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public IndicatorPathGroup(String title, List<IndicatorPath> indicatorPaths) {
|
||||||
|
this.title = title;
|
||||||
|
this.indicatorPaths = indicatorPaths;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<IndicatorPath> getIndicatorPaths() {
|
||||||
|
return indicatorPaths;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIndicatorPaths(List<IndicatorPath> indicatorPaths) {
|
||||||
|
this.indicatorPaths = indicatorPaths;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue