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