View Javadoc

1   /**
2    * Copyright 2005-2011 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.kns.web.struts.form;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.rice.kns.lookup.LookupUtils;
20  import org.kuali.rice.kns.lookup.Lookupable;
21  import org.kuali.rice.kns.service.KNSServiceLocator;
22  import org.kuali.rice.kns.web.ui.Field;
23  import org.kuali.rice.kns.web.ui.Row;
24  import org.kuali.rice.krad.service.DataDictionaryService;
25  import org.kuali.rice.krad.service.KRADServiceLocator;
26  import org.kuali.rice.krad.service.KRADServiceLocatorWeb;
27  import org.kuali.rice.krad.util.ExternalizableBusinessObjectUtils;
28  import org.kuali.rice.krad.util.KRADConstants;
29  
30  import javax.servlet.http.HttpServletRequest;
31  import java.util.HashMap;
32  import java.util.Iterator;
33  import java.util.List;
34  import java.util.Map;
35  
36  /**
37   * This class is the action form for all lookups.
38   */
39  public class LookupForm extends KualiForm {
40      private static final long serialVersionUID = 1L;
41  
42      private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(LookupForm.class);
43  
44      private String formKey;
45      private Map<String, String> fields;
46      private Map fieldsForLookup;
47      private String lookupableImplServiceName;
48      private String conversionFields;
49      private Map fieldConversions;
50      private String businessObjectClassName;
51      private Lookupable lookupable;
52      private boolean hideReturnLink = false;
53      private boolean suppressActions = false;
54      private boolean multipleValues = false;
55      private String lookupAnchor;
56      private String readOnlyFields;
57      private List readOnlyFieldsList;
58      private String referencesToRefresh;
59      private boolean searchUsingOnlyPrimaryKeyValues;
60      private String primaryKeyFieldLabels;
61      private boolean showMaintenanceLinks = false;
62      private String docNum;
63      private String htmlDataType;
64      private String lookupObjectId;
65  	private boolean lookupCriteriaEnabled = true;
66      private boolean supplementalActionsEnabled = false;
67      private boolean actionUrlsExist = false;
68      private boolean ddExtraButton = false;
69  	private boolean headerBarEnabled = true;
70  	private boolean disableSearchButtons = false;
71      
72      /**
73       * @see KualiForm#addRequiredNonEditableProperties()
74       */
75      public void addRequiredNonEditableProperties(){
76      	super.addRequiredNonEditableProperties();
77      	registerRequiredNonEditableProperty(KRADConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME);
78      	registerRequiredNonEditableProperty(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE);
79      	registerRequiredNonEditableProperty(KRADConstants.DISPATCH_REQUEST_PARAMETER);
80      	registerRequiredNonEditableProperty(KRADConstants.DOC_FORM_KEY);
81      	registerRequiredNonEditableProperty(KRADConstants.REFRESH_CALLER);
82      	registerRequiredNonEditableProperty(KRADConstants.DOC_NUM);
83      	registerRequiredNonEditableProperty(KRADConstants.REFERENCES_TO_REFRESH);
84      	registerRequiredNonEditableProperty(KRADConstants.FORM_KEY);
85      	registerRequiredNonEditableProperty(KRADConstants.CONVERSION_FIELDS_PARAMETER);
86      	registerRequiredNonEditableProperty(KRADConstants.FIELDS_CONVERSION_PARAMETER);
87      	registerRequiredNonEditableProperty(KRADConstants.HIDE_LOOKUP_RETURN_LINK);
88      	registerRequiredNonEditableProperty(KRADConstants.MULTIPLE_VALUE);
89      	registerRequiredNonEditableProperty(KRADConstants.BACK_LOCATION);
90      	registerRequiredNonEditableProperty(KRADConstants.LOOKUP_ANCHOR);
91      	registerRequiredNonEditableProperty("searchUsingOnlyPrimaryKeyValues");
92      	registerRequiredNonEditableProperty(KRADConstants.MULTIPLE_VALUE_LOOKUP_PREVIOUSLY_SELECTED_OBJ_IDS_PARAM);
93      	registerRequiredNonEditableProperty(KRADConstants.TableRenderConstants.VIEWED_PAGE_NUMBER);
94      }
95      
96      /**
97  	 * @return the htmlDataType
98  	 */
99  	public String getHtmlDataType() {
100 		return this.htmlDataType;
101 	}
102 
103 	/**
104 	 * @param htmlDataType the htmlDataType to set
105 	 */
106 	public void setHtmlDataType(String htmlDataType) {
107 		this.htmlDataType = htmlDataType;
108 	}
109 
110 	/**
111 	 * @return the docNum
112 	 */
113 	public String getDocNum() {
114 		return this.docNum;
115 	}
116 
117 	/**
118 	 * @param docNum the docNum to set
119 	 */
120 	public void setDocNum(String docNum) {
121 		this.docNum = docNum;
122 	}
123 
124 	/**
125      * Whether the results contain at least one row that is returnable.
126      */
127     private boolean hasReturnableRow;
128     
129     
130     // used for internal purposes in populate
131     private Map requestParameters;
132     
133     /**
134      * Stores the incoming request parameters so that they can be passed to the Lookupable implementation.
135      */
136     @Override
137     public void postprocessRequestParameters(Map requestParameters) {
138         this.requestParameters = requestParameters;
139         super.postprocessRequestParameters(requestParameters);
140     }
141 
142     /**
143      * Picks out business object name from the request to get retrieve a lookupable and set properties.
144      */
145     public void populate(HttpServletRequest request) {
146         super.populate(request);
147 
148         DataDictionaryService ddService = KRADServiceLocatorWeb.getDataDictionaryService();
149 
150         try {
151             Lookupable localLookupable = null;
152             if (StringUtils.isBlank(getParameter(request, KRADConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME)) && StringUtils.isBlank(getLookupableImplServiceName())) {
153                 // get the business object class for the lookup
154                 String localBusinessObjectClassName = getParameter(request, KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE);
155                 if ( ExternalizableBusinessObjectUtils.isExternalizableBusinessObjectInterface(localBusinessObjectClassName) ) {
156                 	Class localBusinessObjectClass = Class.forName(localBusinessObjectClassName);
157                 	localBusinessObjectClassName = KRADServiceLocatorWeb.getKualiModuleService().getResponsibleModuleService(localBusinessObjectClass).getExternalizableBusinessObjectImplementation(localBusinessObjectClass).getName();
158                 }
159                 setBusinessObjectClassName(localBusinessObjectClassName);
160                 if (StringUtils.isBlank(localBusinessObjectClassName)) {
161                     LOG.error("Business object class not passed to lookup.");
162                     throw new RuntimeException("Business object class not passed to lookup.");
163                 }
164 
165                 // call data dictionary service to get lookup impl for bo class
166                 String lookupImplID = KRADServiceLocatorWeb.getBusinessObjectDictionaryService().getLookupableID(Class.forName(localBusinessObjectClassName));
167                 if (lookupImplID == null) {
168                     lookupImplID = "kualiLookupable";
169                 }
170 
171                 setLookupableImplServiceName(lookupImplID);
172             }
173             localLookupable = KNSServiceLocator.getLookupable(getLookupableImplServiceName());
174 
175             if (localLookupable == null) {
176                 LOG.error("Lookup impl not found for lookup impl name " + getLookupableImplServiceName());
177                 throw new RuntimeException("Lookup impl not found for lookup impl name " + getLookupableImplServiceName());
178             }
179 
180 			// set parameters on lookupable
181             localLookupable.setParameters(requestParameters);
182             requestParameters = null;
183             
184             if (getParameter(request, KRADConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME) != null) {
185                 setLookupableImplServiceName(getParameter(request, KRADConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME));
186             }
187 
188             if (getParameter(request, KRADConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME) != null) {
189                 setLookupableImplServiceName(getParameter(request, KRADConstants.LOOKUPABLE_IMPL_ATTRIBUTE_NAME));
190             }
191 
192             // check the doc form key is empty before setting so we don't override a restored lookup form
193             if (request.getAttribute(KRADConstants.DOC_FORM_KEY) != null && StringUtils.isBlank(this.getFormKey())) {
194                 setFormKey((String) request.getAttribute(KRADConstants.DOC_FORM_KEY));
195             }
196             else if (getParameter(request, KRADConstants.DOC_FORM_KEY) != null && StringUtils.isBlank(this.getFormKey())) {
197                 setFormKey(getParameter(request, KRADConstants.DOC_FORM_KEY));
198             }
199             
200             if (getParameter(request, KRADConstants.DOC_NUM) != null) {
201                 setDocNum(getParameter(request, KRADConstants.DOC_NUM));
202            }
203 
204             String returnLocation = getParameter(request, "returnLocation");
205             if (StringUtils.isNotBlank(returnLocation)) {
206                 setBackLocation(returnLocation);
207                 localLookupable.getLookupableHelperService().setBackLocation(returnLocation);
208             }
209 
210             if (getParameter(request, "conversionFields") != null) {
211                 setConversionFields(getParameter(request, "conversionFields"));
212             }
213             if (getParameter(request, KRADConstants.EXTRA_BUTTON_SOURCE) != null) {
214             	//these are not sourced from the DD/Lookupable
215             	ddExtraButton=false;
216                 setExtraButtonSource(getParameter(request, KRADConstants.EXTRA_BUTTON_SOURCE));
217             }
218             if (getParameter(request, KRADConstants.EXTRA_BUTTON_PARAMS) != null) {
219                 setExtraButtonParams(getParameter(request, KRADConstants.EXTRA_BUTTON_PARAMS));
220             }
221             String value = getParameter(request, "multipleValues");
222             if (value != null) {
223                 if ("YES".equals(value.toUpperCase())) {
224                     setMultipleValues(true);
225                 }
226                 else {
227                     setMultipleValues(new Boolean(getParameter(request, "multipleValues")).booleanValue());
228                 }
229             }
230             if (getParameter(request, KRADConstants.REFERENCES_TO_REFRESH) != null) {
231                 setReferencesToRefresh(getParameter(request, KRADConstants.REFERENCES_TO_REFRESH));
232             }
233 
234             if (getParameter(request, "readOnlyFields") != null) {
235                 setReadOnlyFields(getParameter(request, "readOnlyFields"));
236                 setReadOnlyFieldsList(LookupUtils.translateReadOnlyFieldsToList(this.readOnlyFields));
237                 localLookupable.setReadOnlyFieldsList(getReadOnlyFieldsList());
238             }
239 
240             // init lookupable with bo class
241             localLookupable.setBusinessObjectClass(Class.forName(getBusinessObjectClassName()));
242             Map<String, String> fieldValues = new HashMap<String, String>();
243             Map<String, String> formFields = getFields();
244             Class boClass = Class.forName(getBusinessObjectClassName());
245 
246             for (Iterator iter = localLookupable.getRows().iterator(); iter.hasNext();) {
247                 Row row = (Row) iter.next();
248 
249                 for (Iterator iterator = row.getFields().iterator(); iterator.hasNext();) {
250                     Field field = (Field) iterator.next();
251 
252                     // check whether form already has value for field
253                     if (formFields != null && formFields.containsKey(field.getPropertyName())) {
254                         field.setPropertyValue(formFields.get(field.getPropertyName()));
255                     }
256 
257                     // override values with request
258                     if (getParameter(request, field.getPropertyName()) != null) {
259                     	if(!Field.MULTI_VALUE_FIELD_TYPES.contains(field.getFieldType())) {
260                     		field.setPropertyValue(getParameter(request, field.getPropertyName()).trim());
261                     	} else {
262                     		//multi value, set to values
263                     		field.setPropertyValues(getParameterValues(request, field.getPropertyName()));
264                     	}
265                     }
266 
267             		field.setPropertyValue(org.kuali.rice.krad.lookup.LookupUtils
268                             .forceUppercase(boClass, field.getPropertyName(), field.getPropertyValue()));
269                 	fieldValues.put(field.getPropertyName(), field.getPropertyValue());
270                 	//LOG.info("field name/value added was: " + field.getPropertyName() + field.getPropertyValue());
271                 	localLookupable.applyFieldAuthorizationsFromNestedLookups(field);
272                 }
273             }
274 
275             if (localLookupable.checkForAdditionalFields(fieldValues)) {
276                 for (Iterator iter = localLookupable.getRows().iterator(); iter.hasNext();) {
277                     Row row = (Row) iter.next();
278 
279                     for (Iterator iterator = row.getFields().iterator(); iterator.hasNext();) {
280                         Field field = (Field) iterator.next();
281 
282                         // check whether form already has value for field
283                         if (formFields != null && formFields.containsKey(field.getPropertyName())) {
284                             field.setPropertyValue(formFields.get(field.getPropertyName()));
285                         }
286 
287                         // override values with request
288                         if (getParameter(request, field.getPropertyName()) != null) {
289                         	if(!Field.MULTI_VALUE_FIELD_TYPES.contains(field.getFieldType())) {
290                         		field.setPropertyValue(getParameter(request, field.getPropertyName()).trim());
291                         	} else {
292                         		//multi value, set to values
293                         		field.setPropertyValues(getParameterValues(request, field.getPropertyName()));
294                         	}
295                         }
296                         fieldValues.put(field.getPropertyName(), field.getPropertyValue());
297                     }
298                 }
299                
300             }
301             fieldValues.put(KRADConstants.DOC_FORM_KEY, this.getFormKey());
302             fieldValues.put(KRADConstants.BACK_LOCATION, this.getBackLocation());
303             if(this.getDocNum() != null){
304             	fieldValues.put(KRADConstants.DOC_NUM, this.getDocNum());
305             }
306             if (StringUtils.isNotBlank(getReferencesToRefresh())) {
307                 fieldValues.put(KRADConstants.REFERENCES_TO_REFRESH, this.getReferencesToRefresh());
308             }
309 
310             this.setFields(fieldValues);
311 
312             setFieldConversions(LookupUtils.translateFieldConversions(this.conversionFields));
313             localLookupable.setFieldConversions(getFieldConversions());
314             if(StringUtils.isNotEmpty(localLookupable.getExtraButtonSource())) {
315             	setExtraButtonSource(localLookupable.getExtraButtonSource());
316             	//also set the boolean so the jsp can use an action button
317             	ddExtraButton=true;
318             }
319             if(StringUtils.isNotEmpty(localLookupable.getExtraButtonParams())) {
320             	setExtraButtonParams(localLookupable.getExtraButtonParams());
321             }
322             setLookupable(localLookupable);
323             setFieldsForLookup(fieldValues);
324 
325             // if showMaintenanceLinks is not already true, only show maintenance links if the lookup was called from the portal (or index.html for the generated applications)
326             if (!isShowMaintenanceLinks()) {
327             	if (StringUtils.contains(getBackLocation(), "/"+ KRADConstants.PORTAL_ACTION)
328             			|| StringUtils.contains(getBackLocation(), "/index.html")) {
329             		showMaintenanceLinks = true;
330             	}
331             }
332         }
333         catch (ClassNotFoundException e) {
334             LOG.error("Business Object class " + getBusinessObjectClassName() + " not found");
335             throw new RuntimeException("Business Object class " + getBusinessObjectClassName() + " not found", e);
336         }
337     }
338 
339     /**
340      * @return Returns the lookupableImplServiceName.
341      */
342     public String getLookupableImplServiceName() {
343         return lookupableImplServiceName;
344     }
345 
346     /**
347      * @param lookupableImplServiceName The lookupableImplServiceName to set.
348      */
349     public void setLookupableImplServiceName(String lookupableImplServiceName) {
350         this.lookupableImplServiceName = lookupableImplServiceName;
351     }
352 
353     /**
354      * @return Returns the formKey.
355      */
356     public String getFormKey() {
357         return formKey;
358     }
359 
360     /**
361      * @param formKey The formKey to set.
362      */
363     public void setFormKey(String formKey) {
364         this.formKey = formKey;
365     }
366 
367     /**
368      * @return Returns the fields.
369      */
370     public Map<String, String> getFields() {
371         return fields;
372     }
373 
374     /**
375      * @param fields The fields to set.
376      */
377     public void setFields(Map<String, String> fields) {
378         this.fields = fields;
379     }
380 
381     /**
382      * @return Returns the conversionFields.
383      */
384     public String getConversionFields() {
385         return conversionFields;
386     }
387 
388     /**
389      * @param conversionFields The conversionFields to set.
390      */
391     public void setConversionFields(String conversionFields) {
392         this.conversionFields = conversionFields;
393     }
394 
395     /**
396      * @return Returns the fieldConversions.
397      */
398     public Map getFieldConversions() {
399         return fieldConversions;
400     }
401 
402     /**
403      * @param fieldConversions The fieldConversions to set.
404      */
405     public void setFieldConversions(Map fieldConversions) {
406         this.fieldConversions = fieldConversions;
407     }
408 
409     /**
410      * @return Returns the businessObjectClassName.
411      */
412     public String getBusinessObjectClassName() {
413         return businessObjectClassName;
414     }
415 
416     /**
417      * @param businessObjectClassName The businessObjectClassName to set.
418      */
419     public void setBusinessObjectClassName(String businessObjectClassName) {
420         this.businessObjectClassName = businessObjectClassName;
421     }
422 
423 
424     /**
425      * @return Returns the kualiLookupable.
426      */
427     public Lookupable getLookupable() {
428         return lookupable;
429     }
430 
431 
432     /**
433      * @param lookupable The kualiLookupable to set.
434      */
435     public void setLookupable(Lookupable lookupable) {
436         this.lookupable = lookupable;
437     }
438 
439 
440     /**
441      * @return Returns the hideReturnLink.
442      */
443     public boolean isHideReturnLink() {
444         return hideReturnLink;
445     }
446 
447     /**
448      * @param suppressActions The suppressActions to set.
449      */
450     public void setSuppressActions(boolean suppressActions) {
451         this.suppressActions = suppressActions;
452     }
453 
454     /**
455      * @return Returns the suppressActions.
456      */
457     public boolean isSuppressActions() {
458         return suppressActions;
459     }
460 
461 
462     /**
463      * @param hideReturnLink The hideReturnLink to set.
464      */
465     public void setHideReturnLink(boolean hideReturnLink) {
466         this.hideReturnLink = hideReturnLink;
467     }
468 
469     // TODO: remove these once DD changes have been made
470     public String getExtraButtonParams() {
471         return extraButtons.get(0).getExtraButtonParams();
472     }
473 
474     // TODO: remove these once DD changes have been made
475     public void setExtraButtonParams(String extraButtonParams) {
476         extraButtons.get(0).setExtraButtonParams( extraButtonParams );
477     }
478 
479     // TODO: remove these once DD changes have been made
480     public String getExtraButtonSource() {
481         return extraButtons.get(0).getExtraButtonSource();
482     }
483 
484     // TODO: remove these once DD changes have been made
485     public void setExtraButtonSource(String extraButtonSource) {
486         extraButtons.get(0).setExtraButtonSource( extraButtonSource );
487     }
488 
489 
490     /**
491      *
492      * @return whether this form returns multiple values
493      */
494     public boolean isMultipleValues() {
495         return multipleValues;
496     }
497 
498     /**
499      *
500      * @param multipleValues - specify whether this form returns multiple values (i.e. a Collection)
501      */
502     public void setMultipleValues(boolean multipleValues) {
503         this.multipleValues = multipleValues;
504     }
505 
506     public String getLookupAnchor() {
507         return lookupAnchor;
508     }
509 
510     public void setLookupAnchor(String lookupAnchor) {
511         this.lookupAnchor = lookupAnchor;
512     }
513 
514     /**
515      * Gets the fieldsForLookup attribute.
516      * @return Returns the fieldsForLookup.
517      */
518     public Map getFieldsForLookup() {
519         return fieldsForLookup;
520     }
521 
522     /**
523      * Sets the fieldsForLookup attribute value.
524      * @param fieldsForLookup The fieldsForLookup to set.
525      */
526     public void setFieldsForLookup(Map fieldsForLookup) {
527         this.fieldsForLookup = fieldsForLookup;
528     }
529 
530     /**
531      * Gets the readOnlyFields attribute.
532      * @return Returns the readOnlyFields.
533      */
534     public String getReadOnlyFields() {
535         return readOnlyFields;
536     }
537 
538     /**
539      * Sets the readOnlyFields attribute value.
540      * @param readOnlyFields The readOnlyFields to set.
541      */
542     public void setReadOnlyFields(String readOnlyFields) {
543         this.readOnlyFields = readOnlyFields;
544     }
545 
546     /**
547      * Gets the readOnlyFieldsList attribute.
548      * @return Returns the readOnlyFieldsList.
549      */
550     public List getReadOnlyFieldsList() {
551         return readOnlyFieldsList;
552     }
553 
554     /**
555      * Sets the readOnlyFieldsList attribute value.
556      * @param readOnlyFieldsList The readOnlyFieldsList to set.
557      */
558     public void setReadOnlyFieldsList(List readOnlyFieldsList) {
559         this.readOnlyFieldsList = readOnlyFieldsList;
560     }
561 
562     public String getReferencesToRefresh() {
563         return referencesToRefresh;
564     }
565 
566     public void setReferencesToRefresh(String referencesToRefresh) {
567         this.referencesToRefresh = referencesToRefresh;
568     }
569 
570     public String getPrimaryKeyFieldLabels() {
571         return primaryKeyFieldLabels;
572     }
573 
574     public void setPrimaryKeyFieldLabels(String primaryKeyFieldLabels) {
575         this.primaryKeyFieldLabels = primaryKeyFieldLabels;
576     }
577 
578     public boolean isSearchUsingOnlyPrimaryKeyValues() {
579         return searchUsingOnlyPrimaryKeyValues;
580     }
581 
582     public void setSearchUsingOnlyPrimaryKeyValues(boolean searchUsingOnlyPrimaryKeyValues) {
583         this.searchUsingOnlyPrimaryKeyValues = searchUsingOnlyPrimaryKeyValues;
584     }
585 
586     /**
587      * Gets the showMaintenanceLinks attribute.
588      * @return Returns the showMaintenanceLinks.
589      */
590     public boolean isShowMaintenanceLinks() {
591         return showMaintenanceLinks;
592     }
593 
594     /**
595      * Sets the showMaintenanceLinks attribute value.
596      * @param showMaintenanceLinks The showMaintenanceLinks to set.
597      */
598     public void setShowMaintenanceLinks(boolean showMaintenanceLinks) {
599         this.showMaintenanceLinks = showMaintenanceLinks;
600     }
601 
602     /**
603      * Returns whether the results contain at least one row that is returnable
604      * 
605      * @return
606      */
607     public boolean isHasReturnableRow() {
608         return this.hasReturnableRow;
609     }
610 
611     /**
612      * Sets whether the results contain at least one row that is returnable
613      * 
614      * @param hasReturnableRow
615      */
616     public void setHasReturnableRow(boolean hasReturnableRow) {
617         this.hasReturnableRow = hasReturnableRow;
618     }
619 
620 	/**
621 	 * @return the lookupObjectId
622 	 */
623 	public String getLookupObjectId() {
624 		return this.lookupObjectId;
625 	}
626 
627 	/**
628 	 * @param lookupObjectId the lookupObjectId to set
629 	 */
630 	public void setLookupObjectId(String lookupObjectId) {
631 		this.lookupObjectId = lookupObjectId;
632 	}
633 
634 	/**
635 	 * @return the lookupCriteriaEnabled
636 	 */
637 	public boolean isLookupCriteriaEnabled() {
638 		return this.lookupCriteriaEnabled;
639 	}
640 
641 	/**
642 	 * @param lookupCriteriaEnabled the lookupCriteriaEnabled to set
643 	 */
644 	public void setLookupCriteriaEnabled(boolean lookupCriteriaEnabled) {
645 		this.lookupCriteriaEnabled = lookupCriteriaEnabled;
646 	}
647 
648 	/**
649 	 * @return the supplementalActionsEnabled
650 	 */
651 	public boolean isSupplementalActionsEnabled() {
652 		return this.supplementalActionsEnabled;
653 	}
654 
655 	/**
656 	 * @param supplementalActionsEnabled the supplementalActionsEnabled to set
657 	 */
658 	public void setSupplementalActionsEnabled(boolean supplementalActionsEnabled) {
659 		this.supplementalActionsEnabled = supplementalActionsEnabled;
660 	}
661 
662 
663 	/**
664 	 * @param actionUrlsExist the actionUrlsExist to set
665 	 */
666 	public void setActionUrlsExist(boolean actionUrlsExist) {
667 		this.actionUrlsExist = actionUrlsExist;
668 	}
669 
670 	/**
671 	 * @return the actionUrlsExist
672 	 */
673 	public boolean isActionUrlsExist() {
674 		return actionUrlsExist;
675 	}
676 
677 	/**
678 	 * @return the ddExtraButton
679 	 */
680 	public boolean isDdExtraButton() {
681 		return this.ddExtraButton;
682 	}
683 
684 	/**
685 	 * @param ddExtraButton the ddExtraButton to set
686 	 */
687 	public void setDdExtraButton(boolean ddExtraButton) {
688 		this.ddExtraButton = ddExtraButton;
689 	}
690 
691 	public boolean isHeaderBarEnabled() {
692 		return headerBarEnabled;
693 	}
694 
695 	public void setHeaderBarEnabled(boolean headerBarEnabled) {
696 		this.headerBarEnabled = headerBarEnabled;
697 	}	
698 
699 	public boolean isDisableSearchButtons() {
700 		return this.disableSearchButtons;
701 	}
702 
703 	public void setDisableSearchButtons(boolean disableSearchButtons) {
704 		this.disableSearchButtons = disableSearchButtons;
705 	}
706 	
707 	/**
708 	 * Determines whether the search/clear buttons should be rendering based on the form property
709 	 * and what is configured in the data dictionary for the lookup
710 	 * 
711 	 * @return boolean true if the buttons should be rendered, false if they should not be
712 	 */
713 	public boolean getRenderSearchButtons() {
714 		boolean renderSearchButtons = true;
715 
716 		if (disableSearchButtons
717 				|| KRADServiceLocatorWeb.getBusinessObjectDictionaryService().disableSearchButtonsInLookup(
718 						getLookupable().getBusinessObjectClass())) {
719 			renderSearchButtons = false;
720 		}
721 
722 		return renderSearchButtons;
723 	}
724 }