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