1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kns.util; |
17 | |
|
18 | |
import org.apache.commons.beanutils.PropertyUtils; |
19 | |
import org.apache.commons.lang.StringUtils; |
20 | |
import org.kuali.rice.core.api.CoreApiServiceLocator; |
21 | |
import org.kuali.rice.core.api.encryption.EncryptionService; |
22 | |
import org.kuali.rice.core.util.ClassLoaderUtils; |
23 | |
import org.kuali.rice.core.web.format.FormatException; |
24 | |
import org.kuali.rice.kew.util.KEWConstants; |
25 | |
import org.kuali.rice.kim.bo.Person; |
26 | |
import org.kuali.rice.kns.datadictionary.FieldDefinition; |
27 | |
import org.kuali.rice.kns.datadictionary.MaintainableCollectionDefinition; |
28 | |
import org.kuali.rice.kns.datadictionary.control.ButtonControlDefinition; |
29 | |
import org.kuali.rice.kns.web.ui.Field; |
30 | |
import org.kuali.rice.kns.web.ui.PropertyRenderingConfigElement; |
31 | |
import org.kuali.rice.kns.web.ui.Row; |
32 | |
import org.kuali.rice.kns.web.ui.Section; |
33 | |
import org.kuali.rice.krad.bo.MutableInactivatable; |
34 | |
import org.kuali.rice.krad.datadictionary.control.ControlDefinition; |
35 | |
import org.kuali.rice.kns.datadictionary.control.CurrencyControlDefinition; |
36 | |
import org.kuali.rice.kns.datadictionary.control.KualiUserControlDefinition; |
37 | |
import org.kuali.rice.kns.datadictionary.control.LinkControlDefinition; |
38 | |
import org.kuali.rice.kns.document.authorization.FieldRestriction; |
39 | |
import org.kuali.rice.kns.document.authorization.MaintenanceDocumentRestrictions; |
40 | |
import org.kuali.rice.kns.inquiry.Inquirable; |
41 | |
import org.kuali.rice.kns.lookup.HtmlData; |
42 | |
import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData; |
43 | |
import org.kuali.rice.kns.lookup.LookupUtils; |
44 | |
import org.kuali.rice.kns.service.BusinessObjectMetaDataService; |
45 | |
import org.kuali.rice.kns.service.KNSServiceLocator; |
46 | |
import org.kuali.rice.krad.bo.BusinessObject; |
47 | |
import org.kuali.rice.krad.bo.BusinessObjectRelationship; |
48 | |
import org.kuali.rice.krad.bo.KualiCode; |
49 | |
import org.kuali.rice.krad.bo.PersistableBusinessObject; |
50 | |
import org.kuali.rice.kns.datadictionary.BusinessObjectEntry; |
51 | |
import org.kuali.rice.krad.datadictionary.exception.UnknownBusinessClassAttributeException; |
52 | |
import org.kuali.rice.krad.datadictionary.mask.MaskFormatter; |
53 | |
import org.kuali.rice.krad.keyvalues.IndicatorValuesFinder; |
54 | |
import org.kuali.rice.krad.keyvalues.KeyValuesFinder; |
55 | |
import org.kuali.rice.krad.keyvalues.PersistableBusinessObjectValuesFinder; |
56 | |
import org.kuali.rice.krad.valuefinder.ValueFinder; |
57 | |
import org.kuali.rice.krad.service.BusinessObjectDictionaryService; |
58 | |
import org.kuali.rice.krad.service.DataDictionaryService; |
59 | |
import org.kuali.rice.krad.service.KRADServiceLocatorWeb; |
60 | |
import org.kuali.rice.krad.service.KualiModuleService; |
61 | |
import org.kuali.rice.krad.service.ModuleService; |
62 | |
import org.kuali.rice.krad.util.ExternalizableBusinessObjectUtils; |
63 | |
import org.kuali.rice.krad.util.GlobalVariables; |
64 | |
import org.kuali.rice.krad.util.KRADConstants; |
65 | |
import org.kuali.rice.krad.util.KRADPropertyConstants; |
66 | |
import org.kuali.rice.krad.util.MessageMap; |
67 | |
import org.kuali.rice.krad.util.ObjectUtils; |
68 | |
|
69 | |
import java.lang.reflect.InvocationTargetException; |
70 | |
import java.security.GeneralSecurityException; |
71 | |
import java.util.ArrayList; |
72 | |
import java.util.HashMap; |
73 | |
import java.util.Iterator; |
74 | |
import java.util.List; |
75 | |
import java.util.Map; |
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
public final class FieldUtils { |
82 | 0 | private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(FieldUtils.class); |
83 | 0 | private static DataDictionaryService dataDictionaryService = null; |
84 | 0 | private static BusinessObjectMetaDataService businessObjectMetaDataService = null; |
85 | 0 | private static BusinessObjectDictionaryService businessObjectDictionaryService = null; |
86 | 0 | private static KualiModuleService kualiModuleService = null; |
87 | |
|
88 | 0 | private FieldUtils() { |
89 | 0 | throw new UnsupportedOperationException("do not call"); |
90 | |
} |
91 | |
|
92 | |
public static void setInquiryURL(Field field, BusinessObject bo, String propertyName) { |
93 | 0 | HtmlData inquiryHref = new AnchorHtmlData(KRADConstants.EMPTY_STRING, KRADConstants.EMPTY_STRING); |
94 | |
|
95 | 0 | Boolean b = getBusinessObjectDictionaryService().noInquiryFieldInquiry(bo.getClass(), propertyName); |
96 | 0 | if (b == null || !b.booleanValue()) { |
97 | 0 | Class<Inquirable> inquirableClass = getBusinessObjectDictionaryService().getInquirableClass(bo.getClass()); |
98 | 0 | Boolean b2 = getBusinessObjectDictionaryService().forceLookupResultFieldInquiry(bo.getClass(), propertyName); |
99 | 0 | Inquirable inq = null; |
100 | |
try { |
101 | 0 | if ( inquirableClass != null ) { |
102 | 0 | inq = inquirableClass.newInstance(); |
103 | |
} else { |
104 | 0 | inq = KNSServiceLocator.getKualiInquirable(); |
105 | 0 | if ( LOG.isDebugEnabled() ) { |
106 | 0 | LOG.debug( "Default Inquirable Class: " + inq.getClass() ); |
107 | |
} |
108 | |
} |
109 | |
|
110 | 0 | inquiryHref = inq.getInquiryUrl(bo, propertyName, null == b2 ? false : b2.booleanValue() ); |
111 | |
|
112 | 0 | } catch ( Exception ex ) { |
113 | 0 | LOG.error("unable to create inquirable to get inquiry URL", ex ); |
114 | 0 | } |
115 | |
} |
116 | |
|
117 | 0 | field.setInquiryURL(inquiryHref); |
118 | 0 | } |
119 | |
|
120 | |
|
121 | |
|
122 | |
|
123 | |
|
124 | |
|
125 | |
|
126 | |
|
127 | |
|
128 | |
|
129 | |
|
130 | |
|
131 | |
|
132 | |
public static void setFieldControl(Class businessObjectClass, String attributeName, boolean convertForLookup, |
133 | |
Field field) { |
134 | 0 | ControlDefinition control = getDataDictionaryService().getAttributeControlDefinition(businessObjectClass, |
135 | |
attributeName); |
136 | 0 | String fieldType = Field.TEXT; |
137 | |
|
138 | 0 | if (control != null) { |
139 | 0 | if (control.isSelect()) { |
140 | 0 | if (control.getScript() != null && control.getScript().length() > 0) { |
141 | 0 | fieldType = Field.DROPDOWN_SCRIPT; |
142 | 0 | field.setScript(control.getScript()); |
143 | |
} else { |
144 | 0 | fieldType = Field.DROPDOWN; |
145 | |
} |
146 | |
} |
147 | |
|
148 | 0 | if (control.isMultiselect()) { |
149 | 0 | fieldType = Field.MULTISELECT; |
150 | |
} |
151 | |
|
152 | 0 | if (control.isCheckbox()) { |
153 | 0 | fieldType = Field.CHECKBOX; |
154 | |
} |
155 | |
|
156 | 0 | if (control.isRadio()) { |
157 | 0 | fieldType = Field.RADIO; |
158 | |
} |
159 | |
|
160 | 0 | if (control.isHidden()) { |
161 | 0 | fieldType = Field.HIDDEN; |
162 | |
} |
163 | |
|
164 | 0 | if (control.isKualiUser()) { |
165 | 0 | fieldType = Field.KUALIUSER; |
166 | 0 | KualiUserControlDefinition kualiUserControl = (KualiUserControlDefinition) control; |
167 | 0 | field.setUniversalIdAttributeName(kualiUserControl.getUniversalIdAttributeName()); |
168 | 0 | field.setUserIdAttributeName(kualiUserControl.getUserIdAttributeName()); |
169 | 0 | field.setPersonNameAttributeName(kualiUserControl.getPersonNameAttributeName()); |
170 | |
} |
171 | |
|
172 | 0 | if (control.isWorkflowWorkgroup()) { |
173 | 0 | fieldType = Field.WORKFLOW_WORKGROUP; |
174 | |
} |
175 | |
|
176 | 0 | if (control.isFile()) { |
177 | 0 | fieldType = Field.FILE; |
178 | |
} |
179 | |
|
180 | 0 | if (control.isTextarea() && !convertForLookup) { |
181 | 0 | fieldType = Field.TEXT_AREA; |
182 | |
} |
183 | |
|
184 | 0 | if (control.isLookupHidden()) { |
185 | 0 | fieldType = Field.LOOKUP_HIDDEN; |
186 | |
} |
187 | |
|
188 | 0 | if (control.isLookupReadonly()) { |
189 | 0 | fieldType = Field.LOOKUP_READONLY; |
190 | |
} |
191 | |
|
192 | 0 | if (control.isCurrency()) { |
193 | 0 | fieldType = Field.CURRENCY; |
194 | |
} |
195 | |
|
196 | 0 | if (control.isButton()) { |
197 | 0 | fieldType = Field.BUTTON; |
198 | |
} |
199 | |
|
200 | 0 | if (control.isLink()) { |
201 | 0 | fieldType = Field.LINK; |
202 | |
} |
203 | |
|
204 | 0 | if (Field.CURRENCY.equals(fieldType) && control instanceof CurrencyControlDefinition) { |
205 | 0 | CurrencyControlDefinition currencyControl = (CurrencyControlDefinition) control; |
206 | 0 | field.setStyleClass("amount"); |
207 | 0 | field.setSize(currencyControl.getSize()); |
208 | 0 | field.setFormattedMaxLength(currencyControl.getFormattedMaxLength()); |
209 | |
} |
210 | |
|
211 | |
|
212 | 0 | if (Field.TEXT.equals(fieldType)) { |
213 | 0 | Integer size = control.getSize(); |
214 | 0 | if (size != null) { |
215 | 0 | field.setSize(size.intValue()); |
216 | |
} else { |
217 | 0 | field.setSize(30); |
218 | |
} |
219 | 0 | field.setDatePicker(control.isDatePicker()); |
220 | 0 | field.setRanged(control.isRanged()); |
221 | |
} |
222 | |
|
223 | 0 | if (Field.WORKFLOW_WORKGROUP.equals(fieldType)) { |
224 | 0 | Integer size = control.getSize(); |
225 | 0 | if (size != null) { |
226 | 0 | field.setSize(size.intValue()); |
227 | |
} else { |
228 | 0 | field.setSize(30); |
229 | |
} |
230 | |
} |
231 | |
|
232 | |
|
233 | 0 | if (Field.TEXT_AREA.equals(fieldType)) { |
234 | 0 | Integer rows = control.getRows(); |
235 | 0 | if (rows != null) { |
236 | 0 | field.setRows(rows.intValue()); |
237 | |
} else { |
238 | 0 | field.setRows(3); |
239 | |
} |
240 | |
|
241 | 0 | Integer cols = control.getCols(); |
242 | 0 | if (cols != null) { |
243 | 0 | field.setCols(cols.intValue()); |
244 | |
} else { |
245 | 0 | field.setCols(40); |
246 | |
} |
247 | 0 | field.setExpandedTextArea(control.isExpandedTextArea()); |
248 | |
} |
249 | |
|
250 | |
|
251 | 0 | if (Field.DROPDOWN.equals(fieldType) || Field.RADIO.equals(fieldType) |
252 | |
|| Field.DROPDOWN_SCRIPT.equals(fieldType) |
253 | |
|| Field.MULTISELECT.equals(fieldType)) { |
254 | 0 | String keyFinderClassName = control.getValuesFinderClass(); |
255 | |
|
256 | 0 | if (StringUtils.isNotBlank(keyFinderClassName)) { |
257 | |
try { |
258 | 0 | Class keyFinderClass = ClassLoaderUtils.getClass(keyFinderClassName); |
259 | 0 | KeyValuesFinder finder = (KeyValuesFinder) keyFinderClass.newInstance(); |
260 | |
|
261 | 0 | if (finder != null) { |
262 | 0 | if (finder instanceof PersistableBusinessObjectValuesFinder) { |
263 | 0 | ((PersistableBusinessObjectValuesFinder) finder) |
264 | |
.setBusinessObjectClass(ClassLoaderUtils.getClass(control |
265 | |
.getBusinessObjectClass())); |
266 | 0 | ((PersistableBusinessObjectValuesFinder) finder).setKeyAttributeName(control |
267 | |
.getKeyAttribute()); |
268 | 0 | ((PersistableBusinessObjectValuesFinder) finder).setLabelAttributeName(control |
269 | |
.getLabelAttribute()); |
270 | 0 | if (control.getIncludeBlankRow() != null) { |
271 | 0 | ((PersistableBusinessObjectValuesFinder) finder).setIncludeBlankRow(control |
272 | |
.getIncludeBlankRow()); |
273 | |
} |
274 | 0 | ((PersistableBusinessObjectValuesFinder) finder).setIncludeKeyInDescription(control |
275 | |
.getIncludeKeyInLabel()); |
276 | |
} |
277 | 0 | field.setFieldValidValues(finder.getKeyValues()); |
278 | 0 | field.setFieldInactiveValidValues(finder.getKeyValues(false)); |
279 | |
} |
280 | 0 | } catch (InstantiationException e) { |
281 | 0 | LOG.error("Unable to get new instance of finder class: " + keyFinderClassName); |
282 | 0 | throw new RuntimeException("Unable to get new instance of finder class: " + keyFinderClassName); |
283 | 0 | } catch (IllegalAccessException e) { |
284 | 0 | LOG.error("Unable to get new instance of finder class: " + keyFinderClassName); |
285 | 0 | throw new RuntimeException("Unable to get new instance of finder class: " + keyFinderClassName); |
286 | 0 | } |
287 | |
} |
288 | |
} |
289 | |
|
290 | 0 | if (Field.CHECKBOX.equals(fieldType) && convertForLookup) { |
291 | 0 | fieldType = Field.RADIO; |
292 | 0 | field.setFieldValidValues(IndicatorValuesFinder.INSTANCE.getKeyValues()); |
293 | |
} |
294 | |
|
295 | |
|
296 | 0 | if (Field.BUTTON.equals(fieldType)) { |
297 | 0 | ButtonControlDefinition buttonControl = (ButtonControlDefinition) control; |
298 | 0 | field.setImageSrc(buttonControl.getImageSrc()); |
299 | 0 | field.setStyleClass(buttonControl.getStyleClass()); |
300 | |
} |
301 | |
|
302 | |
|
303 | 0 | if (Field.LINK.equals(fieldType)) { |
304 | 0 | LinkControlDefinition linkControl = (LinkControlDefinition) control; |
305 | 0 | field.setStyleClass(linkControl.getStyleClass()); |
306 | 0 | field.setTarget(linkControl.getTarget()); |
307 | 0 | field.setHrefText(linkControl.getHrefText()); |
308 | |
} |
309 | |
|
310 | |
} |
311 | |
|
312 | 0 | field.setFieldType(fieldType); |
313 | 0 | } |
314 | |
|
315 | |
|
316 | |
|
317 | |
|
318 | |
|
319 | |
|
320 | |
|
321 | |
|
322 | |
|
323 | |
|
324 | |
public static Field getPropertyField(Class businessObjectClass, String attributeName, boolean convertForLookup) { |
325 | 0 | Field field = new Field(); |
326 | 0 | field.setPropertyName(attributeName); |
327 | 0 | field.setFieldLabel(getDataDictionaryService().getAttributeLabel(businessObjectClass, attributeName)); |
328 | |
|
329 | 0 | setFieldControl(businessObjectClass, attributeName, convertForLookup, field); |
330 | |
|
331 | 0 | Boolean fieldRequired = getBusinessObjectDictionaryService().getLookupAttributeRequired(businessObjectClass, attributeName); |
332 | 0 | if (fieldRequired != null) { |
333 | 0 | field.setFieldRequired(fieldRequired.booleanValue()); |
334 | |
} |
335 | |
|
336 | 0 | Integer maxLength = getDataDictionaryService().getAttributeMaxLength(businessObjectClass, attributeName); |
337 | 0 | if (maxLength != null) { |
338 | 0 | field.setMaxLength(maxLength.intValue()); |
339 | |
} |
340 | |
|
341 | 0 | Boolean upperCase = null; |
342 | |
try { |
343 | 0 | upperCase = getDataDictionaryService().getAttributeForceUppercase(businessObjectClass, attributeName); |
344 | |
} |
345 | 0 | catch (UnknownBusinessClassAttributeException t) { |
346 | |
|
347 | 0 | LOG.warn( "UnknownBusinessClassAttributeException in fieldUtils.getPropertyField() : " + t.getMessage() ); |
348 | 0 | } |
349 | 0 | if (upperCase != null) { |
350 | 0 | field.setUpperCase(upperCase.booleanValue()); |
351 | |
} |
352 | |
|
353 | 0 | if (!businessObjectClass.isInterface()) { |
354 | |
try { |
355 | 0 | field.setFormatter( |
356 | |
ObjectUtils.getFormatterWithDataDictionary(businessObjectClass.newInstance(), attributeName)); |
357 | 0 | } catch (InstantiationException e) { |
358 | 0 | LOG.info("Unable to get new instance of business object class: " + businessObjectClass.getName(), e); |
359 | |
|
360 | 0 | } catch (IllegalAccessException e) { |
361 | 0 | LOG.info("Unable to get new instance of business object class: " + businessObjectClass.getName(), e); |
362 | |
|
363 | 0 | } |
364 | |
} |
365 | |
|
366 | |
|
367 | 0 | field.setBusinessObjectClassName(businessObjectClass.getName()); |
368 | 0 | field.setFieldHelpName(attributeName); |
369 | 0 | field.setFieldHelpSummary(getDataDictionaryService().getAttributeSummary(businessObjectClass, attributeName)); |
370 | |
|
371 | 0 | return field; |
372 | |
} |
373 | |
|
374 | |
|
375 | |
|
376 | |
|
377 | |
|
378 | |
|
379 | |
|
380 | |
|
381 | |
|
382 | |
|
383 | |
|
384 | |
|
385 | |
|
386 | |
public static void setAdditionalDisplayPropertyForCodes(Class businessObjectClass, String attributeName, PropertyRenderingConfigElement field) { |
387 | |
try { |
388 | 0 | BusinessObjectRelationship relationship = getBusinessObjectMetaDataService().getBusinessObjectRelationship( |
389 | |
(BusinessObject) businessObjectClass.newInstance(), attributeName); |
390 | |
|
391 | 0 | if (relationship != null && attributeName.startsWith(relationship.getParentAttributeName()) |
392 | |
&& KualiCode.class.isAssignableFrom(relationship.getRelatedClass())) { |
393 | 0 | field.setAdditionalDisplayPropertyName(relationship.getParentAttributeName() + "." |
394 | |
+ KRADPropertyConstants.NAME); |
395 | |
} |
396 | 0 | } catch (Exception e) { |
397 | 0 | throw new RuntimeException("Cannot get new instance of class to check for KualiCode references: " |
398 | |
+ e.getMessage()); |
399 | 0 | } |
400 | 0 | } |
401 | |
|
402 | |
|
403 | |
|
404 | |
|
405 | |
|
406 | |
|
407 | |
|
408 | |
|
409 | |
public static List wrapFields(List fields) { |
410 | 0 | return wrapFields(fields, KRADConstants.DEFAULT_NUM_OF_COLUMNS); |
411 | |
} |
412 | |
|
413 | |
|
414 | |
|
415 | |
|
416 | |
|
417 | |
|
418 | |
|
419 | |
|
420 | |
public static List<Row> wrapFields(List<Field> fields, int numberOfColumns) { |
421 | |
|
422 | 0 | List<Row> rows = new ArrayList(); |
423 | 0 | List<Field> fieldOnlyList = new ArrayList(); |
424 | |
|
425 | 0 | List<Field> visableFields = getVisibleFields(fields); |
426 | 0 | List<Field> nonVisableFields = getNonVisibleFields(fields); |
427 | |
|
428 | 0 | int fieldsPosition = 0; |
429 | 0 | for (Field element : visableFields) { |
430 | 0 | if (Field.SUB_SECTION_SEPARATOR.equals(element.getFieldType()) || Field.CONTAINER.equals(element.getFieldType())) { |
431 | 0 | fieldsPosition = createBlankSpace(fieldOnlyList, rows, numberOfColumns, fieldsPosition); |
432 | 0 | List fieldList = new ArrayList(); |
433 | 0 | fieldList.add(element); |
434 | 0 | rows.add(new Row(fieldList)); |
435 | 0 | } |
436 | |
else { |
437 | 0 | if (fieldsPosition < numberOfColumns) { |
438 | 0 | fieldOnlyList.add(element); |
439 | 0 | fieldsPosition++; |
440 | |
} |
441 | |
else { |
442 | 0 | rows.add(new Row(new ArrayList(fieldOnlyList))); |
443 | 0 | fieldOnlyList.clear(); |
444 | 0 | fieldOnlyList.add(element); |
445 | 0 | fieldsPosition = 1; |
446 | |
} |
447 | |
} |
448 | |
} |
449 | 0 | createBlankSpace(fieldOnlyList, rows, numberOfColumns, fieldsPosition); |
450 | |
|
451 | |
|
452 | 0 | if(nonVisableFields != null && !nonVisableFields.isEmpty()){ |
453 | 0 | Row nonVisRow = new Row(); |
454 | 0 | nonVisRow.setFields(nonVisableFields); |
455 | 0 | rows.add(nonVisRow); |
456 | |
} |
457 | |
|
458 | |
|
459 | 0 | return rows; |
460 | |
} |
461 | |
|
462 | |
private static List<Field> getVisibleFields(List<Field> fields){ |
463 | 0 | List<Field> rList = new ArrayList<Field>(); |
464 | |
|
465 | 0 | for(Field f: fields){ |
466 | 0 | if(!Field.HIDDEN.equals(f.getFieldType()) && !Field.BLANK_SPACE.equals(f.getFieldType())){ |
467 | 0 | rList.add(f); |
468 | |
} |
469 | |
} |
470 | |
|
471 | 0 | return rList; |
472 | |
} |
473 | |
|
474 | |
private static List<Field> getNonVisibleFields(List<Field> fields){ |
475 | 0 | List<Field> rList = new ArrayList<Field>(); |
476 | |
|
477 | 0 | for(Field f: fields){ |
478 | 0 | if(Field.HIDDEN.equals(f.getFieldType()) || Field.BLANK_SPACE.equals(f.getFieldType())){ |
479 | 0 | rList.add(f); |
480 | |
} |
481 | |
} |
482 | |
|
483 | 0 | return rList; |
484 | |
} |
485 | |
|
486 | |
|
487 | |
|
488 | |
|
489 | |
|
490 | |
|
491 | |
|
492 | |
|
493 | |
|
494 | |
private static int createBlankSpace(List<Field> fieldOnlyList, List<Row> rows, int numberOfColumns, int fieldsPosition) { |
495 | 0 | int fieldOnlySize = fieldOnlyList.size(); |
496 | 0 | if (fieldOnlySize > 0) { |
497 | 0 | for (int i = 0; i < (numberOfColumns - fieldOnlySize); i++) { |
498 | 0 | Field empty = new Field(); |
499 | 0 | empty.setFieldType(Field.BLANK_SPACE); |
500 | |
|
501 | 0 | empty.setPropertyName(Field.BLANK_SPACE); |
502 | 0 | fieldOnlyList.add(empty); |
503 | |
} |
504 | 0 | rows.add(new Row(new ArrayList(fieldOnlyList))); |
505 | 0 | fieldOnlyList.clear(); |
506 | 0 | fieldsPosition = 0; |
507 | |
} |
508 | 0 | return fieldsPosition; |
509 | |
} |
510 | |
|
511 | |
|
512 | |
|
513 | |
|
514 | |
|
515 | |
|
516 | |
|
517 | |
|
518 | |
|
519 | |
public static Field constructContainerField(String name, String label, List fields) { |
520 | 0 | return constructContainerField(name, label, fields, KRADConstants.DEFAULT_NUM_OF_COLUMNS); |
521 | |
} |
522 | |
|
523 | |
|
524 | |
|
525 | |
|
526 | |
|
527 | |
|
528 | |
|
529 | |
|
530 | |
|
531 | |
|
532 | |
public static Field constructContainerField(String name, String label, List fields, int numberOfColumns) { |
533 | 0 | Field containerField = new Field(); |
534 | 0 | containerField.setPropertyName(name); |
535 | 0 | containerField.setFieldLabel(label); |
536 | 0 | containerField.setFieldType(Field.CONTAINER); |
537 | 0 | containerField.setNumberOfColumnsForCollection(numberOfColumns); |
538 | |
|
539 | 0 | List rows = wrapFields(fields, numberOfColumns); |
540 | 0 | containerField.setContainerRows(rows); |
541 | |
|
542 | 0 | return containerField; |
543 | |
} |
544 | |
|
545 | |
|
546 | |
|
547 | |
|
548 | |
|
549 | |
|
550 | |
|
551 | |
|
552 | |
|
553 | |
public static List<Field> populateFieldsFromBusinessObject(List<Field> fields, BusinessObject bo) { |
554 | 0 | List<Field> populatedFields = new ArrayList<Field>(); |
555 | |
|
556 | 0 | if (bo instanceof PersistableBusinessObject) { |
557 | 0 | ((PersistableBusinessObject) bo).refreshNonUpdateableReferences(); |
558 | |
} |
559 | |
|
560 | 0 | for (Iterator<Field> iter = fields.iterator(); iter.hasNext();) { |
561 | 0 | Field element = iter.next(); |
562 | 0 | if (element.containsBOData()) { |
563 | 0 | String propertyName = element.getPropertyName(); |
564 | |
|
565 | |
|
566 | |
|
567 | |
|
568 | 0 | if (isPropertyNested(propertyName) && !isObjectTreeNonNullAllTheWayDown(bo, propertyName) && ((!element.getFieldType().equals(Field.IMAGE_SUBMIT)) && !(element.getFieldType().equals(Field.CONTAINER)) && (!element.getFieldType().equals(Field.QUICKFINDER)))) { |
569 | 0 | element.setPropertyValue(null); |
570 | |
} |
571 | 0 | else if (PropertyUtils.isReadable(bo, propertyName)) { |
572 | 0 | populateReadableField(element, bo); |
573 | |
} |
574 | |
|
575 | 0 | if (StringUtils.isNotBlank(element.getAlternateDisplayPropertyName())) { |
576 | 0 | String alternatePropertyValue = ObjectUtils.getFormattedPropertyValueUsingDataDictionary(bo, element |
577 | |
.getAlternateDisplayPropertyName()); |
578 | 0 | element.setAlternateDisplayPropertyValue(alternatePropertyValue); |
579 | |
} |
580 | |
|
581 | 0 | if (StringUtils.isNotBlank(element.getAdditionalDisplayPropertyName())) { |
582 | 0 | String additionalPropertyValue = ObjectUtils.getFormattedPropertyValueUsingDataDictionary(bo, element |
583 | |
.getAdditionalDisplayPropertyName()); |
584 | 0 | element.setAdditionalDisplayPropertyValue(additionalPropertyValue); |
585 | |
} |
586 | |
} |
587 | 0 | populatedFields.add(element); |
588 | 0 | } |
589 | |
|
590 | 0 | return populatedFields; |
591 | |
} |
592 | |
|
593 | |
public static void populateReadableField(Field field, BusinessObject businessObject){ |
594 | 0 | Object obj = ObjectUtils.getNestedValue(businessObject, field.getPropertyName()); |
595 | 0 | if (obj != null) { |
596 | 0 | String formattedValue = ObjectUtils.getFormattedPropertyValueUsingDataDictionary(businessObject, field.getPropertyName()); |
597 | 0 | field.setPropertyValue(formattedValue); |
598 | |
|
599 | |
|
600 | 0 | if ( field.getFieldType().equals(Field.KUALIUSER) ) { |
601 | |
|
602 | |
try { |
603 | 0 | if ( StringUtils.isNotBlank(field.getUniversalIdAttributeName()) ) { |
604 | 0 | Object principalId = ObjectUtils.getNestedValue(businessObject, field.getUniversalIdAttributeName()); |
605 | 0 | if ( principalId != null ) { |
606 | 0 | field.setUniversalIdValue(principalId.toString()); |
607 | |
} |
608 | |
} |
609 | 0 | if ( StringUtils.isNotBlank(field.getPersonNameAttributeName()) ) { |
610 | 0 | Object personName = ObjectUtils.getNestedValue(businessObject, field.getPersonNameAttributeName()); |
611 | 0 | if ( personName != null ) { |
612 | 0 | field.setPersonNameValue( personName.toString() ); |
613 | |
} |
614 | |
} |
615 | 0 | } catch ( Exception ex ) { |
616 | 0 | LOG.warn( "Unable to get principal ID or person name property in FieldBridge.", ex ); |
617 | 0 | } |
618 | |
} |
619 | |
} |
620 | |
|
621 | 0 | populateSecureField(field, obj); |
622 | 0 | } |
623 | |
|
624 | |
public static void populateSecureField(Field field, Object fieldValue){ |
625 | |
|
626 | |
|
627 | 0 | if (field.isSecure()) { |
628 | |
try { |
629 | 0 | if (fieldValue != null && fieldValue.toString().endsWith(EncryptionService.HASH_POST_PREFIX)) { |
630 | 0 | field.setEncryptedValue(fieldValue.toString()); |
631 | |
} |
632 | |
else { |
633 | 0 | field.setEncryptedValue(CoreApiServiceLocator.getEncryptionService().encrypt(fieldValue) + EncryptionService.ENCRYPTION_POST_PREFIX); |
634 | |
} |
635 | |
} |
636 | 0 | catch (GeneralSecurityException e) { |
637 | 0 | throw new RuntimeException("Unable to encrypt secure field " + e.getMessage()); |
638 | 0 | } |
639 | |
|
640 | |
} |
641 | 0 | } |
642 | |
|
643 | |
|
644 | |
|
645 | |
|
646 | |
|
647 | |
|
648 | |
|
649 | |
static private boolean isPropertyNested(String propertyName) { |
650 | 0 | return -1 != propertyName.indexOf('.'); |
651 | |
} |
652 | |
|
653 | |
|
654 | |
|
655 | |
|
656 | |
|
657 | |
|
658 | |
|
659 | |
|
660 | |
|
661 | |
static private boolean isObjectTreeNonNullAllTheWayDown(BusinessObject bo, String propertyName) { |
662 | 0 | String[] propertyParts = propertyName.split("\\."); |
663 | |
|
664 | 0 | StringBuffer property = new StringBuffer(); |
665 | 0 | for (int i = 0; i < propertyParts.length - 1; i++) { |
666 | |
|
667 | 0 | property.append((0 == property.length()) ? "" : ".").append(propertyParts[i]); |
668 | |
try { |
669 | 0 | if (null == PropertyUtils.getNestedProperty(bo, property.toString())) { |
670 | 0 | return false; |
671 | |
} |
672 | |
} |
673 | 0 | catch (Throwable t) { |
674 | 0 | LOG.debug("Either getter or setter not specified for property \"" + property.toString() + "\"", t); |
675 | 0 | return false; |
676 | 0 | } |
677 | |
} |
678 | |
|
679 | 0 | return true; |
680 | |
|
681 | |
} |
682 | |
|
683 | |
|
684 | |
|
685 | |
|
686 | |
|
687 | |
|
688 | |
private static boolean containsIntermediateNull(Object bo, String propertyName) { |
689 | 0 | boolean containsNull = false; |
690 | |
|
691 | 0 | if (StringUtils.contains(propertyName, ".")) { |
692 | 0 | String prefix = StringUtils.substringBefore(propertyName, "."); |
693 | 0 | Object propertyValue = ObjectUtils.getPropertyValue(bo, prefix); |
694 | |
|
695 | 0 | if (propertyValue == null) { |
696 | 0 | containsNull = true; |
697 | |
} |
698 | |
else { |
699 | 0 | String suffix = StringUtils.substringAfter(propertyName, "."); |
700 | 0 | containsNull = containsIntermediateNull(propertyValue, suffix); |
701 | |
} |
702 | |
} |
703 | |
|
704 | 0 | return containsNull; |
705 | |
} |
706 | |
|
707 | |
|
708 | |
|
709 | |
|
710 | |
|
711 | |
|
712 | |
|
713 | |
|
714 | |
|
715 | |
public static Map populateBusinessObjectFromMap(BusinessObject bo, Map fieldValues) { |
716 | 0 | return populateBusinessObjectFromMap(bo, fieldValues, ""); |
717 | |
} |
718 | |
|
719 | |
|
720 | |
|
721 | |
|
722 | |
|
723 | |
|
724 | |
|
725 | |
|
726 | |
|
727 | |
|
728 | |
public static Map populateBusinessObjectFromMap(BusinessObject bo, Map<String, ?> fieldValues, String propertyNamePrefix) { |
729 | 0 | Map cachedValues = new HashMap(); |
730 | 0 | MessageMap errorMap = GlobalVariables.getMessageMap(); |
731 | |
|
732 | |
try { |
733 | 0 | for (Iterator<String> iter = fieldValues.keySet().iterator(); iter.hasNext();) { |
734 | 0 | String propertyName = iter.next(); |
735 | |
|
736 | 0 | if (propertyName.endsWith(KRADConstants.CHECKBOX_PRESENT_ON_FORM_ANNOTATION)) { |
737 | |
|
738 | |
|
739 | 0 | if (StringUtils.isNotBlank((String) fieldValues.get(propertyName))) { |
740 | 0 | String checkboxName = StringUtils.removeEnd(propertyName, KRADConstants.CHECKBOX_PRESENT_ON_FORM_ANNOTATION); |
741 | 0 | String checkboxValue = (String) fieldValues.get(checkboxName); |
742 | 0 | if (checkboxValue == null) { |
743 | |
|
744 | 0 | if (PropertyUtils.isWriteable(bo, checkboxName)) { |
745 | 0 | Class type = ObjectUtils.easyGetPropertyType(bo, checkboxName); |
746 | 0 | if (type == Boolean.TYPE || type == Boolean.class) { |
747 | |
|
748 | 0 | ObjectUtils.setObjectProperty(bo, checkboxName, type, "false"); |
749 | |
} |
750 | |
} |
751 | |
} |
752 | 0 | } |
753 | |
|
754 | |
|
755 | |
} |
756 | 0 | else if (PropertyUtils.isWriteable(bo, propertyName) && fieldValues.get(propertyName) != null ) { |
757 | |
|
758 | 0 | Class type = ObjectUtils.easyGetPropertyType(bo, propertyName); |
759 | |
try { |
760 | 0 | Object fieldValue = fieldValues.get(propertyName); |
761 | 0 | ObjectUtils.setObjectProperty(bo, propertyName, type, fieldValue); |
762 | |
} |
763 | 0 | catch (FormatException e) { |
764 | 0 | cachedValues.put(propertyNamePrefix + propertyName, fieldValues.get(propertyName)); |
765 | 0 | errorMap.putError(propertyNamePrefix + propertyName, e.getErrorKey(), e.getErrorArgs()); |
766 | 0 | } |
767 | |
} |
768 | 0 | } |
769 | |
} |
770 | 0 | catch (IllegalAccessException e) { |
771 | 0 | LOG.error("unable to populate business object" + e.getMessage()); |
772 | 0 | throw new RuntimeException(e.getMessage(), e); |
773 | |
} |
774 | 0 | catch (InvocationTargetException e) { |
775 | 0 | LOG.error("unable to populate business object" + e.getMessage()); |
776 | 0 | throw new RuntimeException(e.getMessage(), e); |
777 | |
} |
778 | 0 | catch (NoSuchMethodException e) { |
779 | 0 | LOG.error("unable to populate business object" + e.getMessage()); |
780 | 0 | throw new RuntimeException(e.getMessage(), e); |
781 | 0 | } |
782 | |
|
783 | 0 | return cachedValues; |
784 | |
} |
785 | |
|
786 | |
|
787 | |
|
788 | |
|
789 | |
|
790 | |
|
791 | |
|
792 | |
|
793 | |
|
794 | |
|
795 | |
|
796 | |
public static Field fixFieldForForm(Field field, List keyFieldNames, String namePrefix, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId) { |
797 | 0 | String propertyName = field.getPropertyName(); |
798 | |
|
799 | 0 | if (field.containsBOData()) { |
800 | |
|
801 | |
|
802 | 0 | if (!propertyName.startsWith(KRADConstants.DISPATCH_REQUEST_PARAMETER)) { |
803 | |
|
804 | 0 | if (field.getPropertyPrefix() == null || field.getPropertyPrefix().equals("")) { |
805 | 0 | field.setPropertyName(namePrefix + propertyName); |
806 | |
} |
807 | |
else { |
808 | 0 | field.setPropertyName(field.getPropertyPrefix() + "." + propertyName); |
809 | |
} |
810 | |
} |
811 | |
|
812 | 0 | if (readOnly) { |
813 | 0 | field.setReadOnly(true); |
814 | |
} |
815 | |
|
816 | |
|
817 | 0 | if ( KRADConstants.MAINTENANCE_EDIT_ACTION.equals(maintenanceAction) ) { |
818 | 0 | if (keyFieldNames.contains(propertyName) ) { |
819 | 0 | field.setReadOnly(true); |
820 | 0 | field.setKeyField(true); |
821 | 0 | } else if ( StringUtils.isNotBlank( field.getUniversalIdAttributeName() ) |
822 | |
&& keyFieldNames.contains(field.getUniversalIdAttributeName() ) ) { |
823 | |
|
824 | |
|
825 | 0 | field.setReadOnly(true); |
826 | 0 | field.setKeyField(true); |
827 | |
} |
828 | |
} |
829 | |
|
830 | |
|
831 | 0 | applyAuthorization(field, maintenanceAction, auths, documentStatus, documentInitiatorPrincipalId); |
832 | |
|
833 | |
|
834 | 0 | if (StringUtils.isNotBlank(field.getFieldConversions())) { |
835 | 0 | String fieldConversions = field.getFieldConversions(); |
836 | 0 | String newFieldConversions = KRADConstants.EMPTY_STRING; |
837 | 0 | String[] conversions = StringUtils.split(fieldConversions, KRADConstants.FIELD_CONVERSIONS_SEPARATOR); |
838 | |
|
839 | 0 | for (int l = 0; l < conversions.length; l++) { |
840 | 0 | String conversion = conversions[l]; |
841 | |
|
842 | 0 | String[] conversionPair = StringUtils.split(conversion, KRADConstants.FIELD_CONVERSION_PAIR_SEPARATOR, 2); |
843 | 0 | String conversionFrom = conversionPair[0]; |
844 | 0 | String conversionTo = conversionPair[1]; |
845 | 0 | conversionTo = KRADConstants.MAINTENANCE_NEW_MAINTAINABLE + conversionTo; |
846 | 0 | newFieldConversions += (conversionFrom + KRADConstants.FIELD_CONVERSION_PAIR_SEPARATOR + conversionTo); |
847 | |
|
848 | 0 | if (l < conversions.length) { |
849 | 0 | newFieldConversions += KRADConstants.FIELD_CONVERSIONS_SEPARATOR; |
850 | |
} |
851 | |
} |
852 | |
|
853 | 0 | field.setFieldConversions(newFieldConversions); |
854 | |
} |
855 | |
|
856 | |
|
857 | 0 | if (StringUtils.isNotBlank(field.getInquiryParameters())) { |
858 | 0 | String inquiryParameters = field.getInquiryParameters(); |
859 | 0 | StringBuilder newInquiryParameters = new StringBuilder(); |
860 | 0 | String[] parameters = StringUtils.split(inquiryParameters, KRADConstants.FIELD_CONVERSIONS_SEPARATOR); |
861 | |
|
862 | 0 | for (int l = 0; l < parameters.length; l++) { |
863 | 0 | String parameter = parameters[l]; |
864 | |
|
865 | 0 | String[] parameterPair = StringUtils.split(parameter, KRADConstants.FIELD_CONVERSION_PAIR_SEPARATOR, 2); |
866 | 0 | String conversionFrom = parameterPair[0]; |
867 | 0 | String conversionTo = parameterPair[1]; |
868 | |
|
869 | |
|
870 | 0 | newInquiryParameters.append(KRADConstants.MAINTENANCE_NEW_MAINTAINABLE).append(conversionFrom); |
871 | |
|
872 | 0 | newInquiryParameters.append(KRADConstants.FIELD_CONVERSION_PAIR_SEPARATOR).append(conversionTo); |
873 | |
|
874 | 0 | if (l < parameters.length - 1) { |
875 | 0 | newInquiryParameters.append(KRADConstants.FIELD_CONVERSIONS_SEPARATOR); |
876 | |
} |
877 | |
} |
878 | |
|
879 | 0 | field.setInquiryParameters(newInquiryParameters.toString()); |
880 | |
} |
881 | |
|
882 | 0 | if (Field.KUALIUSER.equals(field.getFieldType())) { |
883 | |
|
884 | 0 | int suffixIndex = field.getPropertyName().indexOf( field.getUserIdAttributeName() ); |
885 | 0 | if ( suffixIndex != -1 ) { |
886 | 0 | field.setPersonNameAttributeName( field.getPropertyName().substring( 0, suffixIndex ) + field.getPersonNameAttributeName() ); |
887 | 0 | field.setUniversalIdAttributeName( field.getPropertyName().substring( 0, suffixIndex ) + field.getUniversalIdAttributeName() ); |
888 | |
} else { |
889 | 0 | field.setPersonNameAttributeName(namePrefix + field.getPersonNameAttributeName()); |
890 | 0 | field.setUniversalIdAttributeName(namePrefix + field.getUniversalIdAttributeName()); |
891 | |
} |
892 | |
|
893 | |
|
894 | |
} |
895 | |
|
896 | |
|
897 | 0 | if (StringUtils.isNotBlank(field.getLookupParameters())) { |
898 | 0 | String lookupParameters = field.getLookupParameters(); |
899 | 0 | String newLookupParameters = KRADConstants.EMPTY_STRING; |
900 | 0 | String[] conversions = StringUtils.split(lookupParameters, KRADConstants.FIELD_CONVERSIONS_SEPARATOR); |
901 | |
|
902 | 0 | for (int m = 0; m < conversions.length; m++) { |
903 | 0 | String conversion = conversions[m]; |
904 | |
|
905 | 0 | String[] conversionPair = StringUtils.split(conversion, KRADConstants.FIELD_CONVERSION_PAIR_SEPARATOR, 2); |
906 | 0 | String conversionFrom = conversionPair[0]; |
907 | 0 | String conversionTo = conversionPair[1]; |
908 | 0 | conversionFrom = KRADConstants.MAINTENANCE_NEW_MAINTAINABLE + conversionFrom; |
909 | 0 | newLookupParameters += (conversionFrom + KRADConstants.FIELD_CONVERSION_PAIR_SEPARATOR + conversionTo); |
910 | |
|
911 | 0 | if (m < conversions.length) { |
912 | 0 | newLookupParameters += KRADConstants.FIELD_CONVERSIONS_SEPARATOR; |
913 | |
} |
914 | |
} |
915 | |
|
916 | 0 | field.setLookupParameters(newLookupParameters); |
917 | |
} |
918 | |
|
919 | |
|
920 | 0 | if (Field.CONTAINER.equals(field.getFieldType())) { |
921 | 0 | List containerRows = field.getContainerRows(); |
922 | 0 | List fixedRows = new ArrayList(); |
923 | |
|
924 | 0 | for (Iterator iter = containerRows.iterator(); iter.hasNext();) { |
925 | 0 | Row containerRow = (Row) iter.next(); |
926 | 0 | List containerFields = containerRow.getFields(); |
927 | 0 | List fixedFields = new ArrayList(); |
928 | |
|
929 | 0 | for (Iterator iterator = containerFields.iterator(); iterator.hasNext();) { |
930 | 0 | Field containerField = (Field) iterator.next(); |
931 | 0 | containerField = fixFieldForForm(containerField, keyFieldNames, namePrefix, maintenanceAction, readOnly, auths, documentStatus, documentInitiatorPrincipalId); |
932 | 0 | fixedFields.add(containerField); |
933 | 0 | } |
934 | |
|
935 | 0 | fixedRows.add(new Row(fixedFields)); |
936 | 0 | } |
937 | |
|
938 | 0 | field.setContainerRows(fixedRows); |
939 | |
} |
940 | |
} |
941 | 0 | return field; |
942 | |
} |
943 | |
|
944 | |
public static void applyAuthorization(Field field, String maintenanceAction, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId) { |
945 | 0 | String fieldName = ""; |
946 | 0 | FieldRestriction fieldAuth = null; |
947 | 0 | Person user = GlobalVariables.getUserSession().getPerson(); |
948 | |
|
949 | 0 | if (field.getPropertyName().startsWith(KRADConstants.MAINTENANCE_NEW_MAINTAINABLE)) { |
950 | |
|
951 | 0 | fieldName = field.getPropertyName().substring(KRADConstants.MAINTENANCE_NEW_MAINTAINABLE.length()); |
952 | |
|
953 | |
|
954 | 0 | if (auths.hasRestriction(fieldName)) { |
955 | 0 | fieldAuth = auths.getFieldRestriction(fieldName); |
956 | 0 | if(KRADConstants.MAINTENANCE_NEW_ACTION.equals(maintenanceAction) || KRADConstants.MAINTENANCE_COPY_ACTION.equals(maintenanceAction)){ |
957 | 0 | if((KEWConstants.ROUTE_HEADER_SAVED_CD.equals(documentStatus) || KEWConstants.ROUTE_HEADER_INITIATED_CD.equals(documentStatus)) |
958 | |
&& user.getPrincipalId().equals(documentInitiatorPrincipalId)){ |
959 | |
|
960 | |
|
961 | |
}else{ |
962 | 0 | if(fieldAuth.isPartiallyMasked()){ |
963 | 0 | field.setSecure(true); |
964 | 0 | fieldAuth.setShouldBeEncrypted(true); |
965 | 0 | MaskFormatter maskFormatter = fieldAuth.getMaskFormatter(); |
966 | 0 | String displayMaskValue = maskFormatter.maskValue(field.getPropertyValue()); |
967 | 0 | field.setDisplayMaskValue(displayMaskValue); |
968 | 0 | populateSecureField(field, field.getPropertyValue()); |
969 | 0 | } |
970 | 0 | else if(fieldAuth.isMasked()){ |
971 | 0 | field.setSecure(true); |
972 | 0 | fieldAuth.setShouldBeEncrypted(true); |
973 | 0 | MaskFormatter maskFormatter = fieldAuth.getMaskFormatter(); |
974 | 0 | String displayMaskValue = maskFormatter.maskValue(field.getPropertyValue()); |
975 | 0 | field.setDisplayMaskValue(displayMaskValue); |
976 | 0 | populateSecureField(field, field.getPropertyValue()); |
977 | |
} |
978 | |
} |
979 | |
} |
980 | |
|
981 | 0 | if (KRADConstants.MAINTENANCE_EDIT_ACTION.equals(maintenanceAction) || KRADConstants.MAINTENANCE_NEWWITHEXISTING_ACTION.equals(maintenanceAction)) { |
982 | |
|
983 | 0 | if(fieldAuth.isPartiallyMasked()){ |
984 | 0 | field.setSecure(true); |
985 | 0 | fieldAuth.setShouldBeEncrypted(true); |
986 | 0 | MaskFormatter maskFormatter = fieldAuth.getMaskFormatter(); |
987 | 0 | String displayMaskValue = maskFormatter.maskValue(field.getPropertyValue()); |
988 | 0 | field.setDisplayMaskValue(displayMaskValue); |
989 | 0 | populateSecureField(field, field.getPropertyValue()); |
990 | 0 | } |
991 | 0 | else if(fieldAuth.isMasked()){ |
992 | 0 | field.setSecure(true); |
993 | 0 | fieldAuth.setShouldBeEncrypted(true); |
994 | 0 | MaskFormatter maskFormatter = fieldAuth.getMaskFormatter(); |
995 | 0 | String displayMaskValue = maskFormatter.maskValue(field.getPropertyValue()); |
996 | 0 | field.setDisplayMaskValue(displayMaskValue); |
997 | 0 | populateSecureField(field, field.getPropertyValue()); |
998 | |
} |
999 | |
} |
1000 | |
|
1001 | 0 | if (Field.isInputField(field.getFieldType()) || field.getFieldType().equalsIgnoreCase(Field.CHECKBOX)) { |
1002 | |
|
1003 | |
|
1004 | 0 | if (fieldAuth.isReadOnly()) { |
1005 | 0 | if (!field.isReadOnly() && !fieldAuth.isMasked() && !fieldAuth.isPartiallyMasked()) { |
1006 | 0 | field.setReadOnly(true); |
1007 | |
} |
1008 | |
} |
1009 | 0 | else if (fieldAuth.isHidden()) { |
1010 | 0 | if (field.getFieldType() != Field.HIDDEN) { |
1011 | 0 | field.setFieldType(Field.HIDDEN); |
1012 | |
} |
1013 | |
} |
1014 | |
} |
1015 | |
|
1016 | 0 | if(Field.BUTTON.equalsIgnoreCase(field.getFieldType()) && fieldAuth.isHidden()){ |
1017 | 0 | field.setFieldType(Field.HIDDEN); |
1018 | |
} |
1019 | |
|
1020 | |
|
1021 | |
|
1022 | 0 | if (field.isReadOnly() && fieldAuth.isHidden()) { |
1023 | 0 | field.setFieldType(Field.HIDDEN); |
1024 | |
} |
1025 | |
|
1026 | |
} |
1027 | |
|
1028 | |
|
1029 | |
} |
1030 | 0 | else if (field.getPropertyName().startsWith(KRADConstants.MAINTENANCE_OLD_MAINTAINABLE)) { |
1031 | |
|
1032 | 0 | fieldName = field.getPropertyName().substring(KRADConstants.MAINTENANCE_OLD_MAINTAINABLE.length()); |
1033 | |
|
1034 | 0 | if (auths.hasRestriction(fieldName)) { |
1035 | 0 | fieldAuth = auths.getFieldRestriction(fieldName); |
1036 | 0 | if(fieldAuth.isPartiallyMasked()){ |
1037 | 0 | field.setSecure(true); |
1038 | 0 | MaskFormatter maskFormatter = fieldAuth.getMaskFormatter(); |
1039 | 0 | String displayMaskValue = maskFormatter.maskValue(field.getPropertyValue()); |
1040 | 0 | field.setDisplayMaskValue(displayMaskValue); |
1041 | 0 | field.setPropertyValue(displayMaskValue); |
1042 | 0 | populateSecureField(field, field.getPropertyValue()); |
1043 | |
|
1044 | |
} |
1045 | |
|
1046 | 0 | if(fieldAuth.isMasked()){ |
1047 | 0 | field.setSecure(true); |
1048 | 0 | MaskFormatter maskFormatter = fieldAuth.getMaskFormatter(); |
1049 | 0 | String displayMaskValue = maskFormatter.maskValue(field.getPropertyValue()); |
1050 | 0 | field.setDisplayMaskValue(displayMaskValue); |
1051 | 0 | field.setPropertyValue(displayMaskValue); |
1052 | 0 | populateSecureField(field, field.getPropertyValue()); |
1053 | |
} |
1054 | |
|
1055 | 0 | if (fieldAuth.isHidden()) { |
1056 | 0 | field.setFieldType(Field.HIDDEN); |
1057 | |
} |
1058 | |
} |
1059 | |
} |
1060 | 0 | } |
1061 | |
|
1062 | |
|
1063 | |
|
1064 | |
|
1065 | |
|
1066 | |
|
1067 | |
|
1068 | |
|
1069 | |
|
1070 | |
|
1071 | |
|
1072 | |
public static List meshSections(List oldSections, List newSections, List keyFieldNames, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId) { |
1073 | 0 | List meshedSections = new ArrayList(); |
1074 | |
|
1075 | 0 | for (int i = 0; i < newSections.size(); i++) { |
1076 | 0 | Section maintSection = (Section) newSections.get(i); |
1077 | 0 | List sectionRows = maintSection.getRows(); |
1078 | 0 | Section oldMaintSection = (Section) oldSections.get(i); |
1079 | 0 | List oldSectionRows = oldMaintSection.getRows(); |
1080 | 0 | List<Row> meshedRows = new ArrayList(); |
1081 | 0 | meshedRows = meshRows(oldSectionRows, sectionRows, keyFieldNames, maintenanceAction, readOnly, auths, documentStatus, documentInitiatorPrincipalId); |
1082 | 0 | maintSection.setRows(meshedRows); |
1083 | 0 | if (StringUtils.isBlank(maintSection.getErrorKey())) { |
1084 | 0 | maintSection.setErrorKey(MaintenanceUtils.generateErrorKeyForSection(maintSection)); |
1085 | |
} |
1086 | 0 | meshedSections.add(maintSection); |
1087 | |
} |
1088 | |
|
1089 | 0 | return meshedSections; |
1090 | |
} |
1091 | |
|
1092 | |
|
1093 | |
|
1094 | |
|
1095 | |
|
1096 | |
|
1097 | |
|
1098 | |
|
1099 | |
|
1100 | |
|
1101 | |
|
1102 | |
public static List meshRows(List oldRows, List newRows, List keyFieldNames, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId) { |
1103 | 0 | List<Row> meshedRows = new ArrayList<Row>(); |
1104 | |
|
1105 | 0 | for (int j = 0; j < newRows.size(); j++) { |
1106 | 0 | Row sectionRow = (Row) newRows.get(j); |
1107 | 0 | List rowFields = sectionRow.getFields(); |
1108 | 0 | Row oldSectionRow = null; |
1109 | 0 | List oldRowFields = new ArrayList(); |
1110 | |
|
1111 | 0 | if (null != oldRows && oldRows.size() > j) { |
1112 | 0 | oldSectionRow = (Row) oldRows.get(j); |
1113 | 0 | oldRowFields = oldSectionRow.getFields(); |
1114 | |
} |
1115 | |
|
1116 | 0 | List meshedFields = meshFields(oldRowFields, rowFields, keyFieldNames, maintenanceAction, readOnly, auths, documentStatus, documentInitiatorPrincipalId); |
1117 | 0 | if (meshedFields.size() > 0) { |
1118 | 0 | Row meshedRow = new Row(meshedFields); |
1119 | 0 | if (sectionRow.isHidden()) { |
1120 | 0 | meshedRow.setHidden(true); |
1121 | |
} |
1122 | |
|
1123 | 0 | meshedRows.add(meshedRow); |
1124 | |
} |
1125 | |
} |
1126 | |
|
1127 | 0 | return meshedRows; |
1128 | |
} |
1129 | |
|
1130 | |
|
1131 | |
|
1132 | |
|
1133 | |
|
1134 | |
|
1135 | |
|
1136 | |
|
1137 | |
|
1138 | |
|
1139 | |
|
1140 | |
|
1141 | |
public static List meshFields(List oldFields, List newFields, List keyFieldNames, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId) { |
1142 | 0 | List meshedFields = new ArrayList(); |
1143 | |
|
1144 | 0 | List newFieldsToMerge = new ArrayList(); |
1145 | 0 | List oldFieldsToMerge = new ArrayList(); |
1146 | |
|
1147 | 0 | for (int k = 0; k < newFields.size(); k++) { |
1148 | 0 | Field newMaintField = (Field) newFields.get(k); |
1149 | 0 | String propertyName = newMaintField.getPropertyName(); |
1150 | |
|
1151 | 0 | if (Field.IMAGE_SUBMIT.equals(newMaintField.getFieldType())) { |
1152 | 0 | meshedFields.add(newMaintField); |
1153 | |
} |
1154 | 0 | else if (Field.CONTAINER.equals(newMaintField.getFieldType())) { |
1155 | 0 | if (oldFields.size() > k) { |
1156 | 0 | Field oldMaintField = (Field) oldFields.get(k); |
1157 | 0 | newMaintField = meshContainerFields(oldMaintField, newMaintField, keyFieldNames, maintenanceAction, readOnly, auths, documentStatus, documentInitiatorPrincipalId); |
1158 | 0 | } |
1159 | |
else { |
1160 | 0 | newMaintField = meshContainerFields(newMaintField, newMaintField, keyFieldNames, maintenanceAction, readOnly, auths, documentStatus, documentInitiatorPrincipalId); |
1161 | |
} |
1162 | 0 | meshedFields.add(newMaintField); |
1163 | |
} |
1164 | |
else { |
1165 | 0 | newMaintField = FieldUtils.fixFieldForForm(newMaintField, keyFieldNames, KRADConstants.MAINTENANCE_NEW_MAINTAINABLE, maintenanceAction, readOnly, auths, documentStatus, documentInitiatorPrincipalId); |
1166 | |
|
1167 | 0 | if (KRADConstants.MAINTENANCE_EDIT_ACTION.equals(maintenanceAction) || KRADConstants.MAINTENANCE_COPY_ACTION.equals(maintenanceAction)) { |
1168 | 0 | Field oldMaintField = (Field) oldFields.get(k); |
1169 | |
|
1170 | |
|
1171 | |
|
1172 | 0 | if (!StringUtils.equalsIgnoreCase(newMaintField.getPropertyValue(), oldMaintField.getPropertyValue()) |
1173 | |
&& !Field.HIDDEN.equals(newMaintField.getFieldType())) { |
1174 | 0 | newMaintField.setHighlightField(true); |
1175 | |
} |
1176 | |
|
1177 | 0 | oldMaintField = FieldUtils.fixFieldForForm(oldMaintField, keyFieldNames, KRADConstants.MAINTENANCE_OLD_MAINTAINABLE, maintenanceAction, true, auths, documentStatus, documentInitiatorPrincipalId); |
1178 | 0 | oldFieldsToMerge.add(oldMaintField); |
1179 | |
} |
1180 | |
|
1181 | 0 | newFieldsToMerge.add(newMaintField); |
1182 | |
|
1183 | 0 | for (Iterator iter = oldFieldsToMerge.iterator(); iter.hasNext();) { |
1184 | 0 | Field element = (Field) iter.next(); |
1185 | 0 | meshedFields.add(element); |
1186 | 0 | } |
1187 | |
|
1188 | 0 | for (Iterator iter = newFieldsToMerge.iterator(); iter.hasNext();) { |
1189 | 0 | Field element = (Field) iter.next(); |
1190 | 0 | meshedFields.add(element); |
1191 | 0 | } |
1192 | |
} |
1193 | |
} |
1194 | 0 | return meshedFields; |
1195 | |
} |
1196 | |
|
1197 | |
|
1198 | |
|
1199 | |
|
1200 | |
|
1201 | |
|
1202 | |
|
1203 | |
|
1204 | |
|
1205 | |
|
1206 | |
|
1207 | |
|
1208 | |
|
1209 | |
protected static boolean isLookupFieldLevelHelpEnabled(Class businessObjectClass, String attributeName) { |
1210 | 0 | return false; |
1211 | |
} |
1212 | |
|
1213 | |
|
1214 | |
|
1215 | |
|
1216 | |
|
1217 | |
|
1218 | |
|
1219 | |
|
1220 | |
|
1221 | |
|
1222 | |
|
1223 | |
|
1224 | |
|
1225 | |
protected static boolean isLookupFieldLevelHelpDisabled(Class businessObjectClass, String attributeName) { |
1226 | 0 | return false; |
1227 | |
} |
1228 | |
|
1229 | |
public static List createAndPopulateFieldsForLookup(List<String> lookupFieldAttributeList, List<String> readOnlyFieldsList, Class businessObjectClass) throws InstantiationException, IllegalAccessException { |
1230 | 0 | List<Field> fields = new ArrayList<Field>(); |
1231 | 0 | BusinessObjectEntry boe = (BusinessObjectEntry) getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(businessObjectClass.getName()); |
1232 | |
|
1233 | 0 | Map<String, Boolean> isHiddenMap = new HashMap<String, Boolean>(); |
1234 | 0 | Map<String, Boolean> isReadOnlyMap = new HashMap<String, Boolean>(); |
1235 | |
|
1236 | |
|
1237 | |
|
1238 | |
|
1239 | |
|
1240 | 0 | if(boe.hasLookupDefinition()){ |
1241 | 0 | List<FieldDefinition> fieldDefs = boe.getLookupDefinition().getLookupFields(); |
1242 | 0 | for(FieldDefinition field : fieldDefs){ |
1243 | 0 | isReadOnlyMap.put(field.getAttributeName(), Boolean.valueOf(field.isReadOnly())); |
1244 | 0 | isHiddenMap.put(field.getAttributeName(), Boolean.valueOf(field.isHidden())); |
1245 | |
} |
1246 | |
} |
1247 | |
|
1248 | 0 | for( String attributeName : lookupFieldAttributeList ) |
1249 | |
{ |
1250 | 0 | Field field = FieldUtils.getPropertyField(businessObjectClass, attributeName, true); |
1251 | |
|
1252 | 0 | if(field.isDatePicker() && field.isRanged()) { |
1253 | |
|
1254 | 0 | Field newDate = createRangeDateField(field); |
1255 | 0 | fields.add(newDate); |
1256 | |
} |
1257 | |
|
1258 | |
BusinessObject newBusinessObjectInstance; |
1259 | 0 | if (ExternalizableBusinessObjectUtils.isExternalizableBusinessObjectInterface(businessObjectClass)) { |
1260 | 0 | ModuleService moduleService = getKualiModuleService().getResponsibleModuleService(businessObjectClass); |
1261 | 0 | newBusinessObjectInstance = (BusinessObject) moduleService.createNewObjectFromExternalizableClass(businessObjectClass); |
1262 | 0 | } |
1263 | |
else { |
1264 | 0 | newBusinessObjectInstance = (BusinessObject) businessObjectClass.newInstance(); |
1265 | |
} |
1266 | |
|
1267 | 0 | field = LookupUtils.setFieldQuickfinder(newBusinessObjectInstance, attributeName, field, lookupFieldAttributeList); |
1268 | 0 | field = LookupUtils.setFieldDirectInquiry(newBusinessObjectInstance, attributeName, field); |
1269 | |
|
1270 | |
|
1271 | 0 | if (!Field.MULTISELECT.equals(field.getFieldType())) { |
1272 | 0 | field.setMaxLength(100); |
1273 | |
} |
1274 | |
|
1275 | |
|
1276 | 0 | if (attributeName.equals(KRADPropertyConstants.ACTIVE) && MutableInactivatable.class.isAssignableFrom(businessObjectClass)) { |
1277 | 0 | field.setPropertyValue(KRADConstants.YES_INDICATOR_VALUE); |
1278 | 0 | field.setDefaultValue(KRADConstants.YES_INDICATOR_VALUE); |
1279 | |
} |
1280 | |
|
1281 | 0 | String defaultValue = getBusinessObjectMetaDataService().getLookupFieldDefaultValue(businessObjectClass, attributeName); |
1282 | 0 | if (defaultValue != null) { |
1283 | 0 | field.setPropertyValue(defaultValue); |
1284 | 0 | field.setDefaultValue(defaultValue); |
1285 | |
} |
1286 | |
|
1287 | 0 | Class defaultValueFinderClass = getBusinessObjectMetaDataService().getLookupFieldDefaultValueFinderClass(businessObjectClass, attributeName); |
1288 | |
|
1289 | 0 | if (defaultValueFinderClass != null) { |
1290 | 0 | field.setPropertyValue(((ValueFinder) defaultValueFinderClass.newInstance()).getValue()); |
1291 | 0 | field.setDefaultValue(((ValueFinder) defaultValueFinderClass.newInstance()).getValue()); |
1292 | |
} |
1293 | 0 | if ( (readOnlyFieldsList != null && readOnlyFieldsList.contains(field.getPropertyName())) |
1294 | |
|| ( isReadOnlyMap.containsKey(field.getPropertyName()) && isReadOnlyMap.get(field.getPropertyName()).booleanValue()) |
1295 | |
) { |
1296 | 0 | field.setReadOnly(true); |
1297 | |
} |
1298 | |
|
1299 | 0 | populateQuickfinderDefaultsForLookup(businessObjectClass, attributeName, field); |
1300 | |
|
1301 | 0 | if ((isHiddenMap.containsKey(field.getPropertyName()) && isHiddenMap.get(field.getPropertyName()).booleanValue())) { |
1302 | 0 | field.setFieldType(Field.HIDDEN); |
1303 | |
} |
1304 | |
|
1305 | 0 | boolean triggerOnChange = getBusinessObjectDictionaryService().isLookupFieldTriggerOnChange(businessObjectClass, attributeName); |
1306 | 0 | field.setTriggerOnChange(triggerOnChange); |
1307 | |
|
1308 | 0 | field.setFieldLevelHelpEnabled(isLookupFieldLevelHelpEnabled(businessObjectClass, attributeName)); |
1309 | 0 | field.setFieldLevelHelpDisabled(isLookupFieldLevelHelpDisabled(businessObjectClass, attributeName)); |
1310 | |
|
1311 | 0 | fields.add(field); |
1312 | 0 | } |
1313 | 0 | return fields; |
1314 | |
} |
1315 | |
|
1316 | |
|
1317 | |
|
1318 | |
|
1319 | |
|
1320 | |
|
1321 | |
|
1322 | |
|
1323 | |
|
1324 | |
|
1325 | |
|
1326 | |
private static void populateQuickfinderDefaultsForLookup( |
1327 | |
Class businessObjectClass, String attributeName, Field field) |
1328 | |
throws InstantiationException, IllegalAccessException { |
1329 | |
|
1330 | 0 | String quickfinderParamString = getBusinessObjectMetaDataService().getLookupFieldQuickfinderParameterString(businessObjectClass, attributeName); |
1331 | 0 | Class<? extends ValueFinder> quickfinderParameterFinderClass = |
1332 | |
getBusinessObjectMetaDataService().getLookupFieldQuickfinderParameterStringBuilderClass(businessObjectClass, attributeName); |
1333 | 0 | if (quickfinderParameterFinderClass != null) { |
1334 | 0 | quickfinderParamString = quickfinderParameterFinderClass.newInstance().getValue(); |
1335 | |
} |
1336 | |
|
1337 | 0 | if (!StringUtils.isEmpty(quickfinderParamString)) { |
1338 | 0 | String [] params = quickfinderParamString.split(","); |
1339 | 0 | if (params != null) for (String param : params) { |
1340 | 0 | if (param.contains(KRADConstants.LOOKUP_PARAMETER_LITERAL_DELIMITER)) { |
1341 | 0 | String[] paramChunks = param.split(KRADConstants.LOOKUP_PARAMETER_LITERAL_DELIMITER, 2); |
1342 | 0 | field.appendLookupParameters( |
1343 | |
KRADConstants.LOOKUP_PARAMETER_LITERAL_PREFIX+KRADConstants.LOOKUP_PARAMETER_LITERAL_DELIMITER+ |
1344 | |
paramChunks[1]+":"+paramChunks[0]); |
1345 | |
} |
1346 | |
} |
1347 | |
} |
1348 | 0 | } |
1349 | |
|
1350 | |
|
1351 | |
|
1352 | |
|
1353 | |
|
1354 | |
|
1355 | |
|
1356 | |
public static Field createRangeDateField(Field field) { |
1357 | 0 | Field newDate = (Field)ObjectUtils.deepCopy(field); |
1358 | 0 | newDate.setFieldLabel(newDate.getFieldLabel()+" "+KRADConstants.LOOKUP_DEFAULT_RANGE_SEARCH_LOWER_BOUND_LABEL); |
1359 | 0 | field.setFieldLabel(field.getFieldLabel()+" "+KRADConstants.LOOKUP_DEFAULT_RANGE_SEARCH_UPPER_BOUND_LABEL); |
1360 | 0 | newDate.setPropertyName(KRADConstants.LOOKUP_RANGE_LOWER_BOUND_PROPERTY_PREFIX+newDate.getPropertyName()); |
1361 | 0 | return newDate; |
1362 | |
} |
1363 | |
|
1364 | |
private static Field meshContainerFields(Field oldMaintField, Field newMaintField, List keyFieldNames, String maintenanceAction, boolean readOnly, MaintenanceDocumentRestrictions auths, String documentStatus, String documentInitiatorPrincipalId) { |
1365 | 0 | List resultingRows = new ArrayList(); |
1366 | 0 | resultingRows.addAll(meshRows(oldMaintField.getContainerRows(), newMaintField.getContainerRows(), keyFieldNames, maintenanceAction, readOnly, auths, documentStatus, documentInitiatorPrincipalId)); |
1367 | 0 | Field resultingField = newMaintField; |
1368 | 0 | resultingField.setFieldType(Field.CONTAINER); |
1369 | |
|
1370 | |
|
1371 | 0 | resultingField.setContainerElementName(newMaintField.getContainerElementName()); |
1372 | 0 | resultingField.setContainerDisplayFields(newMaintField.getContainerDisplayFields()); |
1373 | 0 | resultingField.setNumberOfColumnsForCollection(newMaintField.getNumberOfColumnsForCollection()); |
1374 | |
|
1375 | 0 | resultingField.setContainerRows(resultingRows); |
1376 | 0 | List resultingRowsList = newMaintField.getContainerRows(); |
1377 | 0 | if (resultingRowsList.size() > 0) { |
1378 | 0 | List resultingFieldsList = ((Row) resultingRowsList.get(0)).getFields(); |
1379 | 0 | if (resultingFieldsList.size() > 0) { |
1380 | |
|
1381 | |
|
1382 | 0 | String containedFieldName = ((Field) (resultingFieldsList.get(0))).getPropertyName(); |
1383 | 0 | resultingField.setPropertyName(containedFieldName.substring(0, containedFieldName.lastIndexOf('.'))); |
1384 | |
} |
1385 | 0 | } |
1386 | |
else { |
1387 | 0 | resultingField.setPropertyName(oldMaintField.getPropertyName()); |
1388 | |
} |
1389 | 0 | return resultingField; |
1390 | |
} |
1391 | |
|
1392 | |
|
1393 | |
|
1394 | |
|
1395 | |
|
1396 | |
|
1397 | |
|
1398 | |
|
1399 | |
static final public void modifyFieldToSupportMultipleValueLookups(Field field, String parents, MaintainableCollectionDefinition definition) { |
1400 | 0 | field.setMultipleValueLookedUpCollectionName(parents + definition.getName()); |
1401 | 0 | field.setMultipleValueLookupClassName(definition.getSourceClassName().getName()); |
1402 | 0 | field.setMultipleValueLookupClassLabel(getDataDictionaryService().getDataDictionary().getBusinessObjectEntry(definition.getSourceClassName().getName()).getObjectLabel()); |
1403 | 0 | } |
1404 | |
|
1405 | |
|
1406 | |
|
1407 | |
|
1408 | |
|
1409 | |
|
1410 | |
|
1411 | |
|
1412 | |
static final public boolean isCollectionMultipleLookupEnabled(MaintainableCollectionDefinition definition) { |
1413 | 0 | return definition.getSourceClassName() != null && definition.isIncludeMultipleLookupLine(); |
1414 | |
} |
1415 | |
|
1416 | |
|
1417 | |
|
1418 | |
|
1419 | |
|
1420 | |
|
1421 | |
|
1422 | |
|
1423 | |
public static String scrubWhitespace(String s) { |
1424 | 0 | return s.replaceAll("(\\s)(\\s+)", " "); |
1425 | |
} |
1426 | |
|
1427 | |
private static DataDictionaryService getDataDictionaryService() { |
1428 | 0 | if (dataDictionaryService == null) { |
1429 | 0 | dataDictionaryService = KRADServiceLocatorWeb.getDataDictionaryService(); |
1430 | |
} |
1431 | 0 | return dataDictionaryService; |
1432 | |
} |
1433 | |
|
1434 | |
private static BusinessObjectMetaDataService getBusinessObjectMetaDataService() { |
1435 | 0 | if (businessObjectMetaDataService == null) { |
1436 | 0 | businessObjectMetaDataService = KNSServiceLocator.getBusinessObjectMetaDataService(); |
1437 | |
} |
1438 | 0 | return businessObjectMetaDataService; |
1439 | |
} |
1440 | |
|
1441 | |
private static BusinessObjectDictionaryService getBusinessObjectDictionaryService() { |
1442 | 0 | if (businessObjectDictionaryService == null) { |
1443 | 0 | businessObjectDictionaryService = KRADServiceLocatorWeb.getBusinessObjectDictionaryService(); |
1444 | |
} |
1445 | 0 | return businessObjectDictionaryService; |
1446 | |
} |
1447 | |
|
1448 | |
private static KualiModuleService getKualiModuleService() { |
1449 | 0 | if (kualiModuleService == null) { |
1450 | 0 | kualiModuleService = KRADServiceLocatorWeb.getKualiModuleService(); |
1451 | |
} |
1452 | 0 | return kualiModuleService; |
1453 | |
} |
1454 | |
} |