Revision 57578
Added by Konstantina Galouni over 4 years ago
SubCategory.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.List; |
4 | 4 |
|
5 |
public class SubCategory { |
|
5 |
public class SubCategory<StringOrIndicator> {
|
|
6 | 6 |
private String name; |
7 | 7 |
private String alias; |
8 |
private String description; |
|
9 | 8 |
private boolean isActive; |
10 | 9 |
private boolean isPublic; |
11 |
private List<Indicator> charts; |
|
12 |
private List<Indicator> numbers; |
|
10 |
private List<StringOrIndicator> charts;
|
|
11 |
private List<StringOrIndicator> numbers;
|
|
13 | 12 |
|
13 |
public SubCategory() {} |
|
14 |
public SubCategory(SubCategory subCategory) { |
|
15 |
name = subCategory.getName(); |
|
16 |
alias = subCategory.getAlias(); |
|
17 |
isActive = subCategory.getIsActive(); |
|
18 |
isPublic = subCategory.getIsPublic(); |
|
19 |
} |
|
20 |
|
|
14 | 21 |
public String getName() { |
15 | 22 |
return name; |
16 | 23 |
} |
... | ... | |
27 | 34 |
this.alias = alias; |
28 | 35 |
} |
29 | 36 |
|
30 |
public String getDescription() { |
|
31 |
return description; |
|
32 |
} |
|
33 |
|
|
34 |
public void setDescription(String description) { |
|
35 |
this.description = description; |
|
36 |
} |
|
37 |
|
|
38 |
public boolean isActive() { |
|
37 |
public boolean getIsActive() { |
|
39 | 38 |
return isActive; |
40 | 39 |
} |
41 | 40 |
|
42 |
public void setActive(boolean active) {
|
|
43 |
isActive = active;
|
|
41 |
public void setIsActive(boolean isActive) {
|
|
42 |
this.isActive = isActive;
|
|
44 | 43 |
} |
45 | 44 |
|
46 |
public boolean isPublic() {
|
|
45 |
public boolean getIsPublic() {
|
|
47 | 46 |
return isPublic; |
48 | 47 |
} |
49 | 48 |
|
50 |
public void setPublic(boolean aPublic) {
|
|
51 |
isPublic = aPublic;
|
|
49 |
public void setIsPublic(boolean isPublic) {
|
|
50 |
this.isPublic = isPublic;
|
|
52 | 51 |
} |
53 | 52 |
|
54 |
public List<Indicator> getCharts() { |
|
53 |
public List<StringOrIndicator> getCharts() {
|
|
55 | 54 |
return charts; |
56 | 55 |
} |
57 | 56 |
|
58 |
public void setCharts(List<Indicator> charts) { |
|
57 |
public void setCharts(List<StringOrIndicator> charts) {
|
|
59 | 58 |
this.charts = charts; |
60 | 59 |
} |
61 | 60 |
|
62 |
public List<Indicator> getNumbers() { |
|
61 |
public List<StringOrIndicator> getNumbers() {
|
|
63 | 62 |
return numbers; |
64 | 63 |
} |
65 | 64 |
|
66 |
public void setNumbers(List<Indicator> numbers) { |
|
65 |
public void setNumbers(List<StringOrIndicator> numbers) {
|
|
67 | 66 |
this.numbers = numbers; |
68 | 67 |
} |
69 | 68 |
} |
Also available in: Unified diff
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)