1 /**
2 * Copyright 2005-2012 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.krad.uif.widget;
17
18 import org.apache.commons.lang.StringUtils;
19 import org.kuali.rice.krad.bo.DataObjectRelationship;
20 import org.kuali.rice.krad.datadictionary.parse.BeanTag;
21 import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute;
22 import org.kuali.rice.krad.datadictionary.parse.BeanTags;
23 import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
24 import org.kuali.rice.krad.uif.UifParameters;
25 import org.kuali.rice.krad.uif.component.BindingInfo;
26 import org.kuali.rice.krad.uif.component.Component;
27 import org.kuali.rice.krad.uif.container.CollectionGroup;
28 import org.kuali.rice.krad.uif.element.Action;
29 import org.kuali.rice.krad.uif.field.InputField;
30 import org.kuali.rice.krad.uif.util.ViewModelUtils;
31 import org.kuali.rice.krad.uif.view.View;
32 import org.kuali.rice.krad.util.KRADUtils;
33
34 import java.util.HashMap;
35 import java.util.List;
36 import java.util.Map;
37
38 /**
39 * Widget for navigating to a lookup from a field (called a quickfinder)
40 *
41 * @author Kuali Rice Team (rice.collab@kuali.org)
42 */
43 @BeanTags({@BeanTag(name = "quickFinder", parent = "Uif-QuickFinder"),
44 @BeanTag(name = "quickFinderByScript", parent = "Uif-QuickFinderByScript"),
45 @BeanTag(name = "collectionQuickFinder", parent = "Uif-CollectionQuickFinder")})
46 public class QuickFinder extends WidgetBase {
47 private static final long serialVersionUID = 3302390972815386785L;
48
49 // lookup configuration
50 private String baseLookupUrl;
51 private String dataObjectClassName;
52 private String viewName;
53
54 private String referencesToRefresh;
55
56 private Map<String, String> fieldConversions;
57 private Map<String, String> lookupParameters;
58
59 // lookup view options
60 private String readOnlySearchFields;
61
62 private Boolean hideReturnLink;
63 private Boolean suppressActions;
64 private Boolean autoSearch;
65 private Boolean lookupCriteriaEnabled;
66 private Boolean supplementalActionsEnabled;
67 private Boolean disableSearchButtons;
68 private Boolean headerBarEnabled;
69 private Boolean showMaintenanceLinks;
70
71 private Boolean multipleValuesSelect;
72 private String lookupCollectionName;
73
74 private Action quickfinderAction;
75 private LightBox lightBoxLookup;
76
77 public QuickFinder() {
78 super();
79
80 fieldConversions = new HashMap<String, String>();
81 lookupParameters = new HashMap<String, String>();
82 }
83
84 /**
85 * The following initialization is performed:
86 *
87 * <ul>
88 * <li>Set defaults for binding</li>
89 * </ul>
90 *
91 * @see org.kuali.rice.krad.uif.component.ComponentBase#performInitialization(org.kuali.rice.krad.uif.view.View,
92 * java.lang.Object)
93 */
94 @Override
95 public void performInitialization(View view, Object model) {
96 super.performInitialization(view, model);
97
98 if (quickfinderAction != null) {
99 quickfinderAction.setActionScript("voidAction");
100 }
101 }
102
103 /**
104 * The following finalization is performed:
105 *
106 * <ul>
107 * <li>
108 * Sets defaults on collectionLookup such as collectionName, and the class if not set
109 *
110 * <p>
111 * If the data object class was not configured for the lookup, the class configured for the collection group will
112 * be used if it has a lookup defined. If not data object class is found for the lookup it will be disabled. The
113 * collection name is also defaulted to the binding path for this collection group, so the results returned from
114 * the lookup will populate this collection. Finally field conversions will be generated based on the PK fields of
115 * the collection object class
116 * </p>
117 * </li>
118 * </ul>
119 *
120 * @see org.kuali.rice.krad.uif.widget.Widget#performFinalize(org.kuali.rice.krad.uif.view.View,
121 * java.lang.Object, org.kuali.rice.krad.uif.component.Component)
122 */
123 @Override
124 public void performFinalize(View view, Object model, Component parent) {
125 super.performFinalize(view, model, parent);
126
127 if (!isRender()) {
128 return;
129 }
130
131 if (parent instanceof InputField) {
132 InputField field = (InputField) parent;
133
134 // determine lookup class, field conversions and lookup parameters in
135 // not set
136 if (StringUtils.isBlank(dataObjectClassName)) {
137 DataObjectRelationship relationship = getRelationshipForField(view, model, field);
138
139 // if no relationship found cannot have a quickfinder
140 if (relationship == null) {
141 setRender(false);
142 return;
143 }
144
145 dataObjectClassName = relationship.getRelatedClass().getName();
146
147 if ((fieldConversions == null) || fieldConversions.isEmpty()) {
148 generateFieldConversions(field, relationship);
149 }
150
151 if ((lookupParameters == null) || lookupParameters.isEmpty()) {
152 generateLookupParameters(field, relationship);
153 }
154 }
155
156 // adjust paths based on associated attribute field
157 updateFieldConversions(field.getBindingInfo());
158 updateLookupParameters(field.getBindingInfo());
159 } else if (parent instanceof CollectionGroup) {
160 CollectionGroup collectionGroup = (CollectionGroup) parent;
161
162 // check to see if data object class is configured for lookup, if so we will assume it should be enabled
163 // if not and the class configured for the collection group is lookupable, use that
164 if (StringUtils.isBlank(getDataObjectClassName())) {
165 Class<?> collectionObjectClass = collectionGroup.getCollectionObjectClass();
166 boolean isCollectionClassLookupable = KRADServiceLocatorWeb.getViewDictionaryService().isLookupable(
167 collectionObjectClass);
168 if (isCollectionClassLookupable) {
169 setDataObjectClassName(collectionObjectClass.getName());
170
171 if ((fieldConversions == null) || fieldConversions.isEmpty()) {
172 // use PK fields for collection class
173 List<String> collectionObjectPKFields =
174 KRADServiceLocatorWeb.getDataObjectMetaDataService().listPrimaryKeyFieldNames(
175 collectionObjectClass);
176
177 for (String pkField : collectionObjectPKFields) {
178 fieldConversions.put(pkField, pkField);
179 }
180 }
181 } else {
182 // no available data object class to lookup so need to disable quickfinder
183 setRender(false);
184 }
185 }
186
187 // set the lookup return collection name to this collection path
188 if (isRender() && StringUtils.isBlank(getLookupCollectionName())) {
189 setLookupCollectionName(collectionGroup.getBindingInfo().getBindingPath());
190 }
191 }
192
193 quickfinderAction.addActionParameter(UifParameters.BASE_LOOKUP_URL, baseLookupUrl);
194 quickfinderAction.addActionParameter(UifParameters.DATA_OBJECT_CLASS_NAME, dataObjectClassName);
195
196 if (!fieldConversions.isEmpty()) {
197 quickfinderAction.addActionParameter(UifParameters.CONVERSION_FIELDS, KRADUtils.buildMapParameterString(
198 fieldConversions));
199 }
200
201 if (!lookupParameters.isEmpty()) {
202 quickfinderAction.addActionParameter(UifParameters.LOOKUP_PARAMETERS, KRADUtils.buildMapParameterString(
203 lookupParameters));
204 }
205
206 addActionParameterIfNotNull(UifParameters.VIEW_NAME, viewName);
207 addActionParameterIfNotNull(UifParameters.READ_ONLY_FIELDS, readOnlySearchFields);
208 addActionParameterIfNotNull(UifParameters.HIDE_RETURN_LINK, hideReturnLink);
209 addActionParameterIfNotNull(UifParameters.SUPRESS_ACTIONS, suppressActions);
210 addActionParameterIfNotNull(UifParameters.REFERENCES_TO_REFRESH, referencesToRefresh);
211 addActionParameterIfNotNull(UifParameters.AUTO_SEARCH, autoSearch);
212 addActionParameterIfNotNull(UifParameters.LOOKUP_CRITERIA_ENABLED, lookupCriteriaEnabled);
213 addActionParameterIfNotNull(UifParameters.SUPPLEMENTAL_ACTIONS_ENABLED, supplementalActionsEnabled);
214 addActionParameterIfNotNull(UifParameters.DISABLE_SEARCH_BUTTONS, disableSearchButtons);
215 addActionParameterIfNotNull(UifParameters.HEADER_BAR_ENABLED, headerBarEnabled);
216 addActionParameterIfNotNull(UifParameters.SHOW_MAINTENANCE_LINKS, showMaintenanceLinks);
217 addActionParameterIfNotNull(UifParameters.MULTIPLE_VALUES_SELECT, multipleValuesSelect);
218 addActionParameterIfNotNull(UifParameters.LOOKUP_COLLECTION_NAME, lookupCollectionName);
219
220 // TODO:
221 // org.kuali.rice.kns.util.FieldUtils.populateQuickfinderDefaultsForLookup(Class,
222 // String, Field)
223 }
224
225 protected void addActionParameterIfNotNull(String parameterName, Object parameterValue) {
226 if ((parameterValue != null) && StringUtils.isNotBlank(parameterValue.toString())) {
227 quickfinderAction.addActionParameter(parameterName, parameterValue.toString());
228 }
229 }
230
231 protected DataObjectRelationship getRelationshipForField(View view, Object model, InputField field) {
232 String propertyName = field.getBindingInfo().getBindingName();
233
234 // get object instance and class for parent
235 Object parentObject = ViewModelUtils.getParentObjectForMetadata(view, model, field);
236 Class<?> parentObjectClass = null;
237 if (parentObject != null) {
238 parentObjectClass = parentObject.getClass();
239 }
240
241 // get relationship from metadata service
242 return KRADServiceLocatorWeb.getDataObjectMetaDataService().getDataObjectRelationship(parentObject,
243 parentObjectClass, propertyName, "", true, true, false);
244 }
245
246 protected void generateFieldConversions(InputField field, DataObjectRelationship relationship) {
247 fieldConversions = new HashMap<String, String>();
248 for (Map.Entry<String, String> entry : relationship.getParentToChildReferences().entrySet()) {
249 String fromField = entry.getValue();
250 String toField = entry.getKey();
251
252 // TODO: displayedFieldnames in
253 // org.kuali.rice.kns.lookup.LookupUtils.generateFieldConversions(BusinessObject,
254 // String, DataObjectRelationship, String, List, String)
255
256 fieldConversions.put(fromField, toField);
257 }
258 }
259
260 protected void generateLookupParameters(InputField field, DataObjectRelationship relationship) {
261 lookupParameters = new HashMap<String, String>();
262 for (Map.Entry<String, String> entry : relationship.getParentToChildReferences().entrySet()) {
263 String fromField = entry.getKey();
264 String toField = entry.getValue();
265
266 // TODO: displayedFieldnames and displayedQFFieldNames in
267 // generateLookupParameters(BusinessObject,
268 // String, DataObjectRelationship, String, List, String)
269
270 if (relationship.getUserVisibleIdentifierKey() == null || relationship.getUserVisibleIdentifierKey().equals(
271 fromField)) {
272 lookupParameters.put(fromField, toField);
273 }
274 }
275 }
276
277 /**
278 * Adjusts the path on the field conversion to property to match the binding
279 * path prefix of the given <code>BindingInfo</code>
280 *
281 * @param bindingInfo - binding info instance to copy binding path prefix from
282 */
283 public void updateFieldConversions(BindingInfo bindingInfo) {
284 Map<String, String> adjustedFieldConversions = new HashMap<String, String>();
285 for (String fromField : fieldConversions.keySet()) {
286 String toField = fieldConversions.get(fromField);
287 String adjustedToFieldPath = bindingInfo.getPropertyAdjustedBindingPath(toField);
288
289 adjustedFieldConversions.put(fromField, adjustedToFieldPath);
290 }
291
292 this.fieldConversions = adjustedFieldConversions;
293 }
294
295 /**
296 * Adjusts the path on the lookup parameter from property to match the binding
297 * path prefix of the given <code>BindingInfo</code>
298 *
299 * @param bindingInfo - binding info instance to copy binding path prefix from
300 */
301 public void updateLookupParameters(BindingInfo bindingInfo) {
302 Map<String, String> adjustedLookupParameters = new HashMap<String, String>();
303 for (String fromField : lookupParameters.keySet()) {
304 String toField = lookupParameters.get(fromField);
305 String adjustedFromFieldPath = bindingInfo.getPropertyAdjustedBindingPath(fromField);
306
307 adjustedLookupParameters.put(adjustedFromFieldPath, toField);
308 }
309
310 this.lookupParameters = adjustedLookupParameters;
311 }
312
313 /**
314 * @see org.kuali.rice.krad.uif.component.ComponentBase#getComponentsForLifecycle()
315 */
316 @Override
317 public List<Component> getComponentsForLifecycle() {
318 List<Component> components = super.getComponentsForLifecycle();
319
320 components.add(quickfinderAction);
321 components.add(lightBoxLookup);
322
323 return components;
324 }
325
326 /**
327 * Returns the URL for the lookup for which parameters will be added
328 *
329 * <p>
330 * The base URL includes the domain, context, and controller mapping for the lookup invocation. Parameters are
331 * then added based on configuration to complete the URL. This is generally defaulted to the application URL and
332 * internal KRAD servlet mapping, but can be changed to invoke another application such as the Rice standalone
333 * server
334 * </p>
335 *
336 * @return String lookup base URL
337 */
338 @BeanTagAttribute(name = "baseLookupUrl")
339 public String getBaseLookupUrl() {
340 return this.baseLookupUrl;
341 }
342
343 /**
344 * Setter for the lookup base url (domain, context, and controller)
345 *
346 * @param baseLookupUrl
347 */
348 public void setBaseLookupUrl(String baseLookupUrl) {
349 this.baseLookupUrl = baseLookupUrl;
350 }
351
352 /**
353 * Full class name the lookup should be provided for
354 *
355 * <p>
356 * This is passed on to the lookup request for the data object the lookup should be rendered for. This is then
357 * used by the lookup framework to select the lookup view (if more than one lookup view exists for the same
358 * data object class name, the {@link #getViewName()} property should be specified to select the view to render).
359 * </p>
360 *
361 * @return String lookup class name
362 */
363 @BeanTagAttribute(name = "dataOjbectClassName")
364 public String getDataObjectClassName() {
365 return this.dataObjectClassName;
366 }
367
368 /**
369 * Setter for the class name that lookup should be provided for
370 *
371 * @param dataObjectClassName
372 */
373 public void setDataObjectClassName(String dataObjectClassName) {
374 this.dataObjectClassName = dataObjectClassName;
375 }
376
377 /**
378 * When multiple target lookup views exists for the same data object class, the view name can be set to
379 * determine which one to use
380 *
381 * <p>
382 * When creating multiple lookup views for the same data object class, the view name can be specified for the
383 * different versions (for example 'simple' and 'advanced'). When multiple lookup views exist the view name must
384 * be sent with the data object class for the request. Note the view id can be alternatively used to uniquely
385 * identify the lookup view
386 * </p>
387 */
388 @BeanTagAttribute(name = "viewName")
389 public String getViewName() {
390 return this.viewName;
391 }
392
393 /**
394 * Setter for the view name configured on the lookup view that should be invoked by the quickfinder widget
395 *
396 * @param viewName
397 */
398 public void setViewName(String viewName) {
399 this.viewName = viewName;
400 }
401
402 /**
403 * List of property names on the model that should be refreshed when the lookup returns
404 *
405 * <p>
406 * Note this is only relevant when the return by script option is not enabled (meaning the server will be invoked
407 * on the lookup return call)
408 * </p>
409 *
410 * <p>
411 * When a lookup return call is made (to return a result value) the controller refresh method will be invoked. If
412 * refresh properties are configured, a call to refresh those references from the database will be made. This is
413 * useful if the lookup returns a foreign key field and the related record is needed.
414 * </p>
415 *
416 * @return String list of property names to refresh
417 * TODO: refactor this to be a List type
418 */
419 @BeanTagAttribute(name = "referencesToRefresh")
420 public String getReferencesToRefresh() {
421 return this.referencesToRefresh;
422 }
423
424 /**
425 * Setter for the list of property names that should be refreshed when the lookup returns
426 *
427 * @param referencesToRefresh
428 */
429 public void setReferencesToRefresh(String referencesToRefresh) {
430 this.referencesToRefresh = referencesToRefresh;
431 }
432
433 /**
434 * Map that determines what properties from a result lookup row (if selected) will be returned to properties on
435 * the calling view
436 *
437 * <p>
438 * The purpose of using the lookup is to search for a particular value and return that value to the form being
439 * completed. In order for the lookup framework to return the field back to us, we must specify the name of the
440 * field on the data object class whose value we need, and the name of the field on the calling view. Furthermore,
441 * we can choose to have the lookup return additional fields that populate other form fields or informational
442 * properties (see ‘Field Queries and Informational Properties’). These pairs of fields are known as
443 * ‘field conversions’.
444 * </p>
445 *
446 * <p>
447 * The fieldConversions property is a Map. Each entry represents a field that will be returned back from the
448 * lookup, with the entry key being the field name on the data object class, and the entry value being the field
449 * name on the calling view. It is helpful to think of this as a from-to mapping. Pulling from the data object
450 * field (map key) to the calling view field (map value).
451 * </p>
452 *
453 * @return Map<String, String> mapping of lookup data object property names to view property names
454 */
455 @BeanTagAttribute(name = "fieldConversions", type = BeanTagAttribute.AttributeType.MAPVALUE)
456 public Map<String, String> getFieldConversions() {
457 return this.fieldConversions;
458 }
459
460 /**
461 * Setter for the map that determines what properties on a lookup result row are returned and how they map to
462 * properties on the calling view
463 *
464 * @param fieldConversions
465 */
466 public void setFieldConversions(Map<String, String> fieldConversions) {
467 this.fieldConversions = fieldConversions;
468 }
469
470 /**
471 * Map that determines what properties from a calling view will be sent to properties on that are rendered
472 * for the lookup view's search fields (they can be hidden)
473 *
474 * <p>
475 * When invoking a lookup view, we can pre-populate search fields on the lookup view with data from the view
476 * that called the lookup. The user can then perform the search with these values, or (if edited is allowed or
477 * the fields are not hidden) change the passed in values. When the lookup is invoked, the values for the
478 * properties configured within the lookup parameters Map will be pulled and passed along as values for the
479 * lookup view properties
480 * </p>
481 *
482 * @return Map<String, String> mapping of calling view properties to lookup view search fields
483 */
484 @BeanTagAttribute(name = "lookupParameters", type = BeanTagAttribute.AttributeType.MAPVALUE)
485 public Map<String, String> getLookupParameters() {
486 return this.lookupParameters;
487 }
488
489 /**
490 * Setter for the map that determines what property values on the calling view will be sent to properties on the
491 * lookup views search fields
492 *
493 * @param lookupParameters
494 */
495 public void setLookupParameters(Map<String, String> lookupParameters) {
496 this.lookupParameters = lookupParameters;
497 }
498
499 /**
500 * Comma delimited String of property names on the lookup view that should be read only
501 *
502 * <p>
503 * When requesting a lookup view, property names for fields that are rendered as search criteria can be marked
504 * as read-only. This is usually done when a lookup parameter for that property is sent in and the user should
505 * not be allowed to change the value
506 * </p>
507 *
508 * @return String property names (delimited by a comma) whose criteria fields should be read-only on the
509 * lookup view
510 */
511 @BeanTagAttribute(name = "readOnlySearchFields")
512 public String getReadOnlySearchFields() {
513 return this.readOnlySearchFields;
514 }
515
516 /**
517 * Setter for property names for criteria fields on the lookup view that should be read-only (multiple property
518 * names are specified using a comma delimiter)
519 *
520 * @param readOnlySearchFields
521 */
522 public void setReadOnlySearchFields(String readOnlySearchFields) {
523 this.readOnlySearchFields = readOnlySearchFields;
524 }
525
526 /**
527 * Indicates whether the return links for lookup results should be rendered
528 *
529 * <p>
530 * A lookup view can be invoked to allow the user to select a value (or set of values) to return back to the
531 * calling view. For single value lookups this is done with a return link that is rendered for each row. This
532 * return link can be disabled by setting this property to true
533 * </p>
534 *
535 * @return boolean true if the return link should not be shown, false if it should be
536 */
537 @BeanTagAttribute(name = "hideReturnLink")
538 public Boolean getHideReturnLink() {
539 return this.hideReturnLink;
540 }
541
542 /**
543 * Setter for the hide return link indicator
544 *
545 * @param hideReturnLink
546 */
547 public void setHideReturnLink(Boolean hideReturnLink) {
548 this.hideReturnLink = hideReturnLink;
549 }
550
551 /**
552 * Indicates whether the maintenance actions (or others) are rendered on the invoked lookup view
553 *
554 * <p>
555 * By default a lookup view will add an actions column for the result table that display maintenance links (in
556 * addition to a new link at the top of the page) if a maintenance action is available. Custom links can also be
557 * added to the action column as necessary. This flag can be set to true to suppress the rendering of the actions
558 * for the lookup call.
559 * </p>
560 *
561 * <p>
562 * An example of when this might be useful is when invoking a lookup to return a value to a value. Generally in
563 * these cases you don't want to the user going off to another view (such as the maintenance view)
564 * </p>
565 *
566 * @return boolean true if actions should be rendered, false if not
567 */
568 @BeanTagAttribute(name = "supressActions")
569 public Boolean getSuppressActions() {
570 return suppressActions;
571 }
572
573 /**
574 * Setter for the suppress actions indicator
575 *
576 * @param suppressActions
577 */
578 public void setSuppressActions(Boolean suppressActions) {
579 this.suppressActions = suppressActions;
580 }
581
582 /**
583 * Indicates whether the search should be executed when first rendering the lookup view
584 *
585 * <p>
586 * By default the lookup view is rendered, the user enters search values and executes the results. This flag can
587 * be set to true to indicate the search should be performed before showing the screen to the user. This is
588 * generally used when search criteria is being passed in as well
589 * </p>
590 *
591 * @return boolean true if the search should be performed initially, false if not
592 */
593 @BeanTagAttribute(name = "autoSearch")
594 public Boolean getAutoSearch() {
595 return this.autoSearch;
596 }
597
598 /**
599 * Setter for the auto search indicator
600 *
601 * @param autoSearch
602 */
603 public void setAutoSearch(Boolean autoSearch) {
604 this.autoSearch = autoSearch;
605 }
606
607 /**
608 * Indicates whether the lookup criteria (search group) should be enabled on the invoked lookup view
609 *
610 * <p>
611 * Setting the this to false will not display the lookup criteria but only the results. Therefore this is only
612 * useful when setting {@link #getAutoSearch()} to true and passing in criteria
613 * </p>
614 *
615 * @return true if lookup criteria should be displayed, false if not
616 */
617 @BeanTagAttribute(name = "lookupCriteriaEnabled")
618 public Boolean getLookupCriteriaEnabled() {
619 return this.lookupCriteriaEnabled;
620 }
621
622 /**
623 * Setter for enabling the lookup criteria group
624 *
625 * @param lookupCriteriaEnabled
626 */
627 public void setLookupCriteriaEnabled(Boolean lookupCriteriaEnabled) {
628 this.lookupCriteriaEnabled = lookupCriteriaEnabled;
629 }
630
631 /**
632 * TODO: not implemented currently
633 *
634 * @return
635 */
636 @BeanTagAttribute(name = "supplementalActionsEnabled")
637 public Boolean getSupplementalActionsEnabled() {
638 return this.supplementalActionsEnabled;
639 }
640
641 public void setSupplementalActionsEnabled(Boolean supplementalActionsEnabled) {
642 this.supplementalActionsEnabled = supplementalActionsEnabled;
643 }
644
645 /**
646 * TODO: not implemented currently
647 *
648 * @return
649 */
650 @BeanTagAttribute(name = "disabledSearchButtons")
651 public Boolean getDisableSearchButtons() {
652 return this.disableSearchButtons;
653 }
654
655 public void setDisableSearchButtons(Boolean disableSearchButtons) {
656 this.disableSearchButtons = disableSearchButtons;
657 }
658
659 /**
660 * TODO: not implemented currently
661 *
662 * @return
663 */
664 @BeanTagAttribute(name = "headerBarEnabled")
665 public Boolean getHeaderBarEnabled() {
666 return this.headerBarEnabled;
667 }
668
669 public void setHeaderBarEnabled(Boolean headerBarEnabled) {
670 this.headerBarEnabled = headerBarEnabled;
671 }
672
673 /**
674 * Indicates whether the maintenance action links should be rendered for the invoked lookup view
675 *
676 * <p>
677 * If a maintenance view exists for the data object associated with the lookup view, the framework will add
678 * links to initiate a new maintenance document. This flag can be used to disable the rendering of these links
679 * </p>
680 *
681 * <p>
682 * Note this serves similar purpose to {@link #getSuppressActions()} but the intent is to only remove the
683 * maintenance links in this situation, not the complete actions column TODO: this is not in place!
684 * </p>
685 *
686 * @return boolean true if maintenance links should be shown on the lookup view, false if not
687 */
688 @BeanTagAttribute(name = "showMaintenanceLinks")
689 public Boolean getShowMaintenanceLinks() {
690 return this.showMaintenanceLinks;
691 }
692
693 /**
694 * Setter for the show maintenance links indicator
695 *
696 * @param showMaintenanceLinks
697 */
698 public void setShowMaintenanceLinks(Boolean showMaintenanceLinks) {
699 this.showMaintenanceLinks = showMaintenanceLinks;
700 }
701
702 /**
703 * Action component that is used to rendered for the field for invoking the quickfinder action (bringin up the
704 * lookup)
705 *
706 * <p>
707 * Through the action configuration the image (or link, button) rendered for the quickfinder can be modified. In
708 * addition to other action component settings
709 * </p>
710 *
711 * @return Action instance rendered for quickfinder
712 */
713 @BeanTagAttribute(name = "quickfinderAction", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
714 public Action getQuickfinderAction() {
715 return this.quickfinderAction;
716 }
717
718 /**
719 * Setter for the action field component to render for the quickfinder
720 *
721 * @param quickfinderAction
722 */
723 public void setQuickfinderAction(Action quickfinderAction) {
724 this.quickfinderAction = quickfinderAction;
725 }
726
727 /**
728 * Setter for the light box lookup widget
729 *
730 * @param lightBoxLookup <code>LightBoxLookup</code> widget to set
731 */
732 public void setLightBoxLookup(LightBox lightBoxLookup) {
733 this.lightBoxLookup = lightBoxLookup;
734 }
735
736 /**
737 * LightBoxLookup widget for the field
738 *
739 * <p>
740 * The light box lookup widget will change the lookup behaviour to open the
741 * lookup in a light box.
742 * </p>
743 *
744 * @return the <code>DirectInquiry</code> field DirectInquiry
745 */
746 @BeanTagAttribute(name = "lightBoxLookup", type = BeanTagAttribute.AttributeType.SINGLEBEAN)
747 public LightBox getLightBoxLookup() {
748 return lightBoxLookup;
749 }
750
751 /**
752 * Indicates whether a multi-values lookup should be requested
753 *
754 * @return boolean true if multi-value lookup should be requested, false for normal lookup
755 */
756 @BeanTagAttribute(name = "MultipleValuesSelect")
757 public Boolean getMultipleValuesSelect() {
758 return multipleValuesSelect;
759 }
760
761 /**
762 * Setter for the multi-values lookup indicator
763 *
764 * @param multipleValuesSelect
765 */
766 public void setMultipleValuesSelect(Boolean multipleValuesSelect) {
767 this.multipleValuesSelect = multipleValuesSelect;
768 }
769
770 /**
771 * For the case of multi-value lookup, indicates the collection that should be populated with
772 * the return results
773 *
774 * <p>
775 * Note when the quickfinder is associated with a <code>CollectionGroup</code>, this property is
776 * set automatically from the collection name associated with the group
777 * </p>
778 *
779 * @return String collection name (must be full binding path)
780 */
781 @BeanTagAttribute(name = "lookupCollectionName")
782 public String getLookupCollectionName() {
783 return lookupCollectionName;
784 }
785
786 /**
787 * Setter for the name of the collection that should be populated with lookup results
788 *
789 * @param lookupCollectionName
790 */
791 public void setLookupCollectionName(String lookupCollectionName) {
792 this.lookupCollectionName = lookupCollectionName;
793 }
794 }