1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.ui.api.app.registry;
35
36 import info.magnolia.cms.security.operations.AccessDefinition;
37 import info.magnolia.ui.api.app.App;
38 import info.magnolia.ui.api.app.AppDescriptor;
39 import info.magnolia.ui.api.app.SubAppDescriptor;
40
41 import java.util.LinkedHashMap;
42 import java.util.Map;
43
44
45
46
47 public class ConfiguredAppDescriptor implements AppDescriptor {
48
49 private String name;
50
51 private String label;
52
53 private boolean enabled = true;
54
55 private String icon;
56
57 private String theme;
58
59 private Class<? extends App> appClass;
60
61 private Map<String, SubAppDescriptor> subApps = new LinkedHashMap<>();
62
63 private AccessDefinition permissions;
64
65 private String i18nBasename;
66
67 private boolean htmlCaption;
68
69 @Override
70 public String getName() {
71 return name;
72 }
73
74 public void setName(String name) {
75 this.name = name;
76 }
77
78 @Override
79 public String getLabel() {
80 return this.label;
81 }
82
83 public void setLabel(String label) {
84 this.label = label;
85 }
86
87 @Override
88 public boolean isEnabled() {
89 return enabled;
90 }
91
92 public void setEnabled(boolean enabled) {
93 this.enabled = enabled;
94 }
95
96 @Override
97 public String getIcon() {
98 return icon;
99 }
100
101 public void setIcon(String icon) {
102 this.icon = icon;
103 }
104
105 @Override
106 public String getTheme() {
107 return theme;
108 }
109
110 public void setTheme(String theme) {
111 this.theme = theme;
112 }
113
114 @Override
115 public Class<? extends App> getAppClass() {
116 return appClass;
117 }
118
119 public void setAppClass(Class<? extends App> appClass) {
120 this.appClass = appClass;
121 }
122
123 @Override
124 public Map<String, SubAppDescriptor> getSubApps() {
125 return subApps;
126 }
127
128 public void setSubApps(Map<String, SubAppDescriptor> subApps) {
129 this.subApps = subApps;
130 }
131
132 public void addSubApp(SubAppDescriptor subApp) {
133 subApps.put(subApp.getName(), subApp);
134 }
135
136 @Override
137 public AccessDefinition getPermissions() {
138 return permissions;
139 }
140
141 public void setPermissions(AccessDefinition permissions) {
142 this.permissions = permissions;
143 }
144
145 @Override
146 public String getI18nBasename() {
147 return i18nBasename;
148 }
149
150 public void setI18nBasename(String i18nBasename) {
151 this.i18nBasename = i18nBasename;
152 }
153
154 @Override
155 public boolean isHtmlCaption() {
156 return htmlCaption;
157 }
158
159 public void setHtmlCaption(boolean htmlCaption) {
160 this.htmlCaption = htmlCaption;
161 }
162 }