1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kns.datadictionary;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.bo.BusinessObject;
20 import org.kuali.rice.krad.datadictionary.DataDictionary;
21 import org.kuali.rice.krad.datadictionary.exception.AttributeValidationException;
22 import org.kuali.rice.krad.valuefinder.ValueFinder;
23
24 import java.util.List;
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59 @Deprecated
60 public class MaintainableFieldDefinition extends MaintainableItemDefinition implements FieldDefinitionI{
61 private static final long serialVersionUID = -1176087424343479963L;
62
63 protected boolean required = false;
64 protected boolean unconditionallyReadOnly = false;
65 protected boolean readOnlyAfterAdd = false;
66 protected boolean noLookup = false;
67 protected boolean lookupReadOnly = false;
68
69 protected String defaultValue;
70 protected String template;
71 protected Class<? extends ValueFinder> defaultValueFinderClass;
72
73 protected String webUILeaveFieldFunction = "";
74 protected String webUILeaveFieldCallbackFunction = "";
75 protected List<String> webUILeaveFieldFunctionParameters;
76
77 protected Class<? extends BusinessObject> overrideLookupClass;
78 protected String overrideFieldConversions;
79
80 protected String alternateDisplayAttributeName;
81 protected String additionalDisplayAttributeName;
82
83 protected boolean triggerOnChange;
84
85 protected Boolean showFieldLevelHelp = null;
86 protected String fieldLevelHelpUrl = null;
87
88 public MaintainableFieldDefinition() {}
89
90
91
92
93 public boolean isRequired() {
94 return required;
95 }
96
97
98
99
100 public void setRequired(boolean required) {
101 this.required = required;
102 }
103
104
105
106
107 public String getDefaultValue() {
108 return defaultValue;
109 }
110
111
112
113
114
115
116
117 public void setDefaultValue(String defaultValue) {
118 this.defaultValue = defaultValue;
119 }
120
121
122
123
124
125 public Class<? extends ValueFinder> getDefaultValueFinderClass() {
126 return defaultValueFinderClass;
127 }
128
129
130
131
132 public boolean isUnconditionallyReadOnly() {
133 return this.unconditionallyReadOnly;
134 }
135
136
137
138
139 public void setUnconditionallyReadOnly(boolean unconditionallyReadOnly) {
140 this.unconditionallyReadOnly = unconditionallyReadOnly;
141 }
142
143
144
145
146
147 public String getOverrideFieldConversions() {
148 return overrideFieldConversions;
149 }
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168 public void setOverrideFieldConversions(String overrideFieldConversions) {
169 this.overrideFieldConversions = overrideFieldConversions;
170 }
171
172
173
174
175
176
177 public Class<? extends BusinessObject> getOverrideLookupClass() {
178 return overrideLookupClass;
179 }
180
181
182
183
184
185
186
187
188
189 public void completeValidation(Class rootBusinessObjectClass, Class otherBusinessObjectClass) {
190 if (!DataDictionary.isPropertyOf(rootBusinessObjectClass, getName())) {
191 throw new AttributeValidationException("unable to find attribute or collection named '" + getName() + "' in rootBusinessObjectClass '" + rootBusinessObjectClass.getName() + "' (" + "" + ")");
192 }
193
194 if (StringUtils.isNotBlank(getAlternateDisplayAttributeName())) {
195 if (!DataDictionary.isPropertyOf(rootBusinessObjectClass, getAlternateDisplayAttributeName())) {
196 throw new AttributeValidationException("unable to find attribute or collection named '" + getAlternateDisplayAttributeName() + "' in rootBusinessObjectClass '" + rootBusinessObjectClass.getName() + "' (" + "" + ")");
197 }
198 }
199
200 if (StringUtils.isNotBlank(getAdditionalDisplayAttributeName())) {
201 if (!DataDictionary.isPropertyOf(rootBusinessObjectClass, getAdditionalDisplayAttributeName())) {
202 throw new AttributeValidationException("unable to find attribute or collection named '" + getAdditionalDisplayAttributeName() + "' in rootBusinessObjectClass '" + rootBusinessObjectClass.getName() + "' (" + "" + ")");
203 }
204 }
205
206 if (defaultValueFinderClass != null && defaultValue != null) {
207 throw new AttributeValidationException("Both defaultValue and defaultValueFinderClass can not be specified on attribute " + getName() + " in rootBusinessObjectClass " + rootBusinessObjectClass.getName());
208 }
209 }
210
211
212
213
214 public String toString() {
215 return "MaintainableFieldDefinition for field " + getName();
216 }
217
218
219 public String getTemplate() {
220 return template;
221 }
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239 public void setTemplate(String template) {
240 this.template = template;
241 }
242
243
244 public String getWebUILeaveFieldCallbackFunction() {
245 return webUILeaveFieldCallbackFunction;
246 }
247
248
249
250
251
252
253 public void setWebUILeaveFieldCallbackFunction(String webUILeaveFieldCallbackFunction) {
254 this.webUILeaveFieldCallbackFunction = webUILeaveFieldCallbackFunction;
255 }
256
257
258 public String getWebUILeaveFieldFunction() {
259 return webUILeaveFieldFunction;
260 }
261
262
263
264
265
266
267 public void setWebUILeaveFieldFunction(String webUILeaveFieldFunction) {
268 this.webUILeaveFieldFunction = webUILeaveFieldFunction;
269 }
270
271
272 public boolean isReadOnlyAfterAdd() {
273 return readOnlyAfterAdd;
274 }
275
276
277
278
279
280
281 public void setReadOnlyAfterAdd(boolean readOnlyAfterAdd) {
282 this.readOnlyAfterAdd = readOnlyAfterAdd;
283 }
284
285
286
287
288
289
290
291 public void setDefaultValueFinderClass(Class<? extends ValueFinder> defaultValueFinderClass) {
292 this.defaultValueFinderClass = defaultValueFinderClass;
293 }
294
295
296
297
298
299
300
301
302 public void setOverrideLookupClass(Class<? extends BusinessObject> overrideLookupClass) {
303 this.overrideLookupClass = overrideLookupClass;
304 }
305
306
307
308
309 public boolean isNoLookup() {
310 return this.noLookup;
311 }
312
313
314
315
316 public void setNoLookup(boolean noLookup) {
317 this.noLookup = noLookup;
318 }
319
320 public boolean isLookupReadOnly() {
321 return lookupReadOnly;
322 }
323
324 public void setLookupReadOnly(boolean lookupReadOnly) {
325 this.lookupReadOnly = lookupReadOnly;
326 }
327
328 public Boolean isShowFieldLevelHelp() {
329 return showFieldLevelHelp;
330 }
331
332 public void setShowFieldLevelHelp(Boolean showFieldLevelHelp) {
333 this.showFieldLevelHelp = showFieldLevelHelp;
334 }
335
336 public String getFieldLevelHelpUrl() {
337 return fieldLevelHelpUrl;
338 }
339
340 public void setFieldLevelHelpUrl(String fieldLevelHelpUrl) {
341 this.fieldLevelHelpUrl = fieldLevelHelpUrl;
342 }
343
344
345
346
347
348 public String getAlternateDisplayAttributeName() {
349 return this.alternateDisplayAttributeName;
350 }
351
352 public void setAlternateDisplayAttributeName(String alternateDisplayAttributeName) {
353 this.alternateDisplayAttributeName = alternateDisplayAttributeName;
354 }
355
356
357
358
359
360 public String getAdditionalDisplayAttributeName() {
361 return this.additionalDisplayAttributeName;
362 }
363
364 public void setAdditionalDisplayAttributeName(String additionalDisplayAttributeName) {
365 this.additionalDisplayAttributeName = additionalDisplayAttributeName;
366 }
367
368 public boolean isTriggerOnChange() {
369 return this.triggerOnChange;
370 }
371
372 public void setTriggerOnChange(boolean triggerOnChange) {
373 this.triggerOnChange = triggerOnChange;
374 }
375
376
377
378
379 public List<String> getWebUILeaveFieldFunctionParameters() {
380 return this.webUILeaveFieldFunctionParameters;
381 }
382
383
384
385
386 public void setWebUILeaveFieldFunctionParameters(
387 List<String> webUILeaveFieldFunctionParameters) {
388 this.webUILeaveFieldFunctionParameters = webUILeaveFieldFunctionParameters;
389 }
390
391 }