2024-03-06 00:48:31 +01:00
|
|
|
package eu.dnetlib.uoamonitorservice.primitives;
|
2019-11-04 10:03:49 +01:00
|
|
|
|
|
|
|
import java.util.List;
|
1. Stakeholder.java: Create constructor and copy constructor & change getters-setters for 'isDeafult', 'isPublic' and 'isActive' fields.
2. Topic.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields.
3. Category.java: Create constructor and copy constructor & change getters-setters for 'isOverview, 'isPublic' and 'isActive' fields & remove field 'description'.
4. SubCategory.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields & remove field 'description' &
make charts and numbers (List) generic (String or Indicator).
5. Indicator.java: Change getters-setters for 'indicatorPaths', 'isPublic' and 'isActive' fields & create method: public boolean hasType(String str), to check if "chart" or "number".
6. IndicatorPath.java: Add fields in schema (chartObject, parameters, filters) & add in enum IndicatorPathType types: pie, line, image.
7. MongoDBStakeholderDAO.java & StakeholderDAO.java: Add method: Stakeholder findByAlias(String Alias)
8. StakeholderController.java:
a. Add method: public Stakeholder setIndicatorsForStakeholder(Stakeholder stakeholder) to replace indicator ids with Indicator objects
(used by: getAllStakeholders, getAllDefaultStakeholders, getAllRealStakeholders, getStakeholder (by alias))
b. Add method: public Stakeholder getStakeholder(@PathVariable("alias") String alias) - /stakeholder/{alias}
c. Add method: public Stakeholder saveStakeholder(@RequestBody Stakeholder stakeholder) - /stakeholder/save
d. Add method: public boolean deleteIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/{id}
e. Add method: public Indicator saveIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/save (in body send Indicator object)
2019-11-11 17:38:36 +01:00
|
|
|
import java.util.Map;
|
2019-11-04 10:03:49 +01:00
|
|
|
|
|
|
|
public class IndicatorPath {
|
|
|
|
private IndicatorPathType type; // for charts is type of chart {table, bar, column, etc}
|
2023-05-03 12:02:56 +02:00
|
|
|
private Format format = Format.NUMBER; // for numbers is if number is percentage or not
|
2020-01-10 11:48:24 +01:00
|
|
|
private String source; // for numbers is the service {statistics, search, metrics} for charts is the tool {stats-tool,old,metrics, image}
|
2019-11-04 10:03:49 +01:00
|
|
|
private String url;
|
|
|
|
private List<String> jsonPath;
|
1. Stakeholder.java: Create constructor and copy constructor & change getters-setters for 'isDeafult', 'isPublic' and 'isActive' fields.
2. Topic.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields.
3. Category.java: Create constructor and copy constructor & change getters-setters for 'isOverview, 'isPublic' and 'isActive' fields & remove field 'description'.
4. SubCategory.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields & remove field 'description' &
make charts and numbers (List) generic (String or Indicator).
5. Indicator.java: Change getters-setters for 'indicatorPaths', 'isPublic' and 'isActive' fields & create method: public boolean hasType(String str), to check if "chart" or "number".
6. IndicatorPath.java: Add fields in schema (chartObject, parameters, filters) & add in enum IndicatorPathType types: pie, line, image.
7. MongoDBStakeholderDAO.java & StakeholderDAO.java: Add method: Stakeholder findByAlias(String Alias)
8. StakeholderController.java:
a. Add method: public Stakeholder setIndicatorsForStakeholder(Stakeholder stakeholder) to replace indicator ids with Indicator objects
(used by: getAllStakeholders, getAllDefaultStakeholders, getAllRealStakeholders, getStakeholder (by alias))
b. Add method: public Stakeholder getStakeholder(@PathVariable("alias") String alias) - /stakeholder/{alias}
c. Add method: public Stakeholder saveStakeholder(@RequestBody Stakeholder stakeholder) - /stakeholder/save
d. Add method: public boolean deleteIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/{id}
e. Add method: public Indicator saveIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/save (in body send Indicator object)
2019-11-11 17:38:36 +01:00
|
|
|
private String chartObject;
|
|
|
|
private Map<String, String> parameters;
|
2019-11-22 16:50:59 +01:00
|
|
|
private Map<String, String> filters;
|
|
|
|
//private Map<String, Map<String, String>> filters;
|
2019-11-04 10:03:49 +01:00
|
|
|
|
2019-12-19 16:04:25 +01:00
|
|
|
public IndicatorPath() {}
|
|
|
|
|
|
|
|
public IndicatorPath(IndicatorPath indicatorPath) {
|
|
|
|
setType(indicatorPath.getType());
|
2023-05-03 12:02:56 +02:00
|
|
|
setFormat(indicatorPath.getFormat());
|
2019-12-19 16:04:25 +01:00
|
|
|
source = indicatorPath.getSource();
|
|
|
|
url = indicatorPath.getUrl();
|
|
|
|
jsonPath = indicatorPath.getJsonPath();
|
|
|
|
chartObject = indicatorPath.getChartObject();
|
|
|
|
parameters = indicatorPath.getParameters();
|
|
|
|
filters = indicatorPath.getFilters();
|
2019-11-04 10:03:49 +01:00
|
|
|
}
|
|
|
|
|
2019-12-19 16:04:25 +01:00
|
|
|
public String getType() {
|
|
|
|
if(type == null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return type.name();
|
|
|
|
}
|
|
|
|
|
|
|
|
// public IndicatorPathType getType() {
|
|
|
|
// return type;
|
|
|
|
// }
|
|
|
|
|
|
|
|
public void setType(String type) {
|
|
|
|
if(type == null) {
|
|
|
|
this.type = null;
|
|
|
|
} else {
|
2024-04-12 10:37:28 +02:00
|
|
|
this.type = IndicatorPathType.valueOf(type);
|
2019-12-19 16:04:25 +01:00
|
|
|
}
|
2019-11-04 10:03:49 +01:00
|
|
|
}
|
|
|
|
|
2023-05-03 12:02:56 +02:00
|
|
|
public String getFormat() {
|
|
|
|
if(format == null) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return format.name();
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setFormat(String format) {
|
|
|
|
if(format == null) {
|
|
|
|
this.format = null;
|
|
|
|
} else {
|
2024-04-12 10:37:28 +02:00
|
|
|
this.format = Format.valueOf(format);
|
2023-05-03 12:02:56 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-11-04 10:03:49 +01:00
|
|
|
public String getSource() {
|
|
|
|
return source;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setSource(String source) {
|
|
|
|
this.source = source;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getUrl() {
|
|
|
|
return url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setUrl(String url) {
|
|
|
|
this.url = url;
|
|
|
|
}
|
|
|
|
|
|
|
|
public List<String> getJsonPath() {
|
|
|
|
return jsonPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setJsonPath(List<String> jsonPath) {
|
|
|
|
this.jsonPath = jsonPath;
|
|
|
|
}
|
1. Stakeholder.java: Create constructor and copy constructor & change getters-setters for 'isDeafult', 'isPublic' and 'isActive' fields.
2. Topic.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields.
3. Category.java: Create constructor and copy constructor & change getters-setters for 'isOverview, 'isPublic' and 'isActive' fields & remove field 'description'.
4. SubCategory.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields & remove field 'description' &
make charts and numbers (List) generic (String or Indicator).
5. Indicator.java: Change getters-setters for 'indicatorPaths', 'isPublic' and 'isActive' fields & create method: public boolean hasType(String str), to check if "chart" or "number".
6. IndicatorPath.java: Add fields in schema (chartObject, parameters, filters) & add in enum IndicatorPathType types: pie, line, image.
7. MongoDBStakeholderDAO.java & StakeholderDAO.java: Add method: Stakeholder findByAlias(String Alias)
8. StakeholderController.java:
a. Add method: public Stakeholder setIndicatorsForStakeholder(Stakeholder stakeholder) to replace indicator ids with Indicator objects
(used by: getAllStakeholders, getAllDefaultStakeholders, getAllRealStakeholders, getStakeholder (by alias))
b. Add method: public Stakeholder getStakeholder(@PathVariable("alias") String alias) - /stakeholder/{alias}
c. Add method: public Stakeholder saveStakeholder(@RequestBody Stakeholder stakeholder) - /stakeholder/save
d. Add method: public boolean deleteIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/{id}
e. Add method: public Indicator saveIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/save (in body send Indicator object)
2019-11-11 17:38:36 +01:00
|
|
|
|
|
|
|
public String getChartObject() {
|
|
|
|
return chartObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setChartObject(String chartObject) {
|
|
|
|
this.chartObject = chartObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Map<String, String> getParameters() {
|
|
|
|
return parameters;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setParameters(Map<String, String> parameters) {
|
|
|
|
this.parameters = parameters;
|
|
|
|
}
|
|
|
|
|
2019-11-22 16:50:59 +01:00
|
|
|
public Map<String, String> getFilters() {
|
1. Stakeholder.java: Create constructor and copy constructor & change getters-setters for 'isDeafult', 'isPublic' and 'isActive' fields.
2. Topic.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields.
3. Category.java: Create constructor and copy constructor & change getters-setters for 'isOverview, 'isPublic' and 'isActive' fields & remove field 'description'.
4. SubCategory.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields & remove field 'description' &
make charts and numbers (List) generic (String or Indicator).
5. Indicator.java: Change getters-setters for 'indicatorPaths', 'isPublic' and 'isActive' fields & create method: public boolean hasType(String str), to check if "chart" or "number".
6. IndicatorPath.java: Add fields in schema (chartObject, parameters, filters) & add in enum IndicatorPathType types: pie, line, image.
7. MongoDBStakeholderDAO.java & StakeholderDAO.java: Add method: Stakeholder findByAlias(String Alias)
8. StakeholderController.java:
a. Add method: public Stakeholder setIndicatorsForStakeholder(Stakeholder stakeholder) to replace indicator ids with Indicator objects
(used by: getAllStakeholders, getAllDefaultStakeholders, getAllRealStakeholders, getStakeholder (by alias))
b. Add method: public Stakeholder getStakeholder(@PathVariable("alias") String alias) - /stakeholder/{alias}
c. Add method: public Stakeholder saveStakeholder(@RequestBody Stakeholder stakeholder) - /stakeholder/save
d. Add method: public boolean deleteIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/{id}
e. Add method: public Indicator saveIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/save (in body send Indicator object)
2019-11-11 17:38:36 +01:00
|
|
|
return filters;
|
|
|
|
}
|
|
|
|
|
2019-11-22 16:50:59 +01:00
|
|
|
public void setFilters(Map<String, String> filters) {
|
1. Stakeholder.java: Create constructor and copy constructor & change getters-setters for 'isDeafult', 'isPublic' and 'isActive' fields.
2. Topic.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields.
3. Category.java: Create constructor and copy constructor & change getters-setters for 'isOverview, 'isPublic' and 'isActive' fields & remove field 'description'.
4. SubCategory.java: Create constructor and copy constructor & change getters-setters for 'isPublic' and 'isActive' fields & remove field 'description' &
make charts and numbers (List) generic (String or Indicator).
5. Indicator.java: Change getters-setters for 'indicatorPaths', 'isPublic' and 'isActive' fields & create method: public boolean hasType(String str), to check if "chart" or "number".
6. IndicatorPath.java: Add fields in schema (chartObject, parameters, filters) & add in enum IndicatorPathType types: pie, line, image.
7. MongoDBStakeholderDAO.java & StakeholderDAO.java: Add method: Stakeholder findByAlias(String Alias)
8. StakeholderController.java:
a. Add method: public Stakeholder setIndicatorsForStakeholder(Stakeholder stakeholder) to replace indicator ids with Indicator objects
(used by: getAllStakeholders, getAllDefaultStakeholders, getAllRealStakeholders, getStakeholder (by alias))
b. Add method: public Stakeholder getStakeholder(@PathVariable("alias") String alias) - /stakeholder/{alias}
c. Add method: public Stakeholder saveStakeholder(@RequestBody Stakeholder stakeholder) - /stakeholder/save
d. Add method: public boolean deleteIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/{id}
e. Add method: public Indicator saveIndicator(...) - /{stakeholder}/{topic}/{category}/{subcategory}/indicator/save (in body send Indicator object)
2019-11-11 17:38:36 +01:00
|
|
|
this.filters = filters;
|
|
|
|
}
|
2019-11-04 10:03:49 +01:00
|
|
|
}
|