001/** 002 * Copyright 2005-2018 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kns.lookup; 017 018import org.kuali.rice.kns.document.authorization.BusinessObjectRestrictions; 019import org.kuali.rice.kns.web.struts.form.LookupForm; 020import org.kuali.rice.kns.web.ui.Column; 021import org.kuali.rice.kns.web.ui.Field; 022import org.kuali.rice.kns.web.ui.ResultRow; 023import org.kuali.rice.kns.web.ui.Row; 024import org.kuali.rice.krad.bo.BusinessObject; 025 026import java.io.Serializable; 027import java.util.Collection; 028import java.util.List; 029import java.util.Map; 030 031/** 032 * This class defines an interface for lookupables. 033 * 034 * They should act as facades for LookupableHelperServices and also expose bean handlers 035 * (getCreateNewUrl, getHtmlMenuBar, getTitle, getRows, getExtraButton{Source,Params}) 036 * 037 * @deprecated Use {@link org.kuali.rice.krad.lookup.Lookupable}. 038 */ 039@Deprecated 040public interface Lookupable extends Serializable { 041 042 /** 043 * Initializes the lookup with a businss object class. This value originates 044 * from the UI via LookupForm population. 045 * 046 * It is required that implementations of this method will initialize the 047 * search area used by the UI to provide the search form. In particular, 048 * it will ensure that getRows() will return valid results 049 * 050 * @param boClass 051 */ 052 public void setBusinessObjectClass(Class<? extends BusinessObject> businessObjectClass); 053 054 /** 055 * 056 * @return Returns the dataObjectClass this lookupable is representing 057 * 058 */ 059 public Class<? extends BusinessObject> getBusinessObjectClass(); 060 061 /** 062 * Initializes the lookup with the given Map of parameters. 063 * 064 * @param parameters 065 */ 066 public void setParameters(Map<String, String[]> parameters); 067 068 /** 069 * @return Returns the parameters passed to this lookup 070 */ 071 public Map<String, String[]> getParameters(); 072 073 /** 074 * @return the html to be displayed as a menu bar 075 */ 076 public String getHtmlMenuBar(); 077 078 /** 079 * @return the html to be displayed as a supplemental menu bar 080 */ 081 public String getSupplementalMenuBar(); 082 083 /** 084 * @return List of Row objects used to render the search area 085 */ 086 public List<Row> getRows(); 087 088 /** 089 * @return String displayed as title for the lookup 090 */ 091 public String getTitle(); 092 093 /** 094 * @return String url for the location to return to after the lookup 095 */ 096 public String getReturnLocation(); 097 098 /** 099 * @return List of Column objects used to render the result table 100 */ 101 public List<Column> getColumns(); 102 103 /** 104 * Validates the values filled in as search criteria, also checks for required field values. 105 * 106 * @param fieldValues - Map of property/value pairs 107 */ 108 public void validateSearchParameters(Map<String, String> fieldValues); 109 110 /** 111 * 112 * This method performs the lookup and returns a collection of lookup items 113 * @param lookupForm 114 * @param resultTable 115 * @param bounded 116 * @return results of lookup 117 */ 118 public Collection<? extends BusinessObject> performLookup(LookupForm lookupForm, List<ResultRow> resultTable, boolean bounded); 119 120 /** 121 * Performs a search and returns result list. 122 * 123 * @param fieldValues - Map of property/value pairs 124 * @return List of business objects found by the search 125 * @throws Exception 126 */ 127 public List<? extends BusinessObject> getSearchResults(Map<String, String> fieldValues); 128 129 /** 130 * Similar to getSearchResults, but the number of returned rows is not bounded 131 * 132 * @param fieldValues 133 * @return 134 */ 135 public List<? extends BusinessObject> getSearchResultsUnbounded(Map<String, String> fieldValues); 136 137 /** 138 * @return String providing source for optional extra button 139 */ 140 public String getExtraButtonSource(); 141 142 /** 143 * @return String providing return parameters for optional extra button 144 */ 145 public String getExtraButtonParams(); 146 147 /** 148 * Determines if there should be more search fields rendered based on already entered search criteria. 149 * 150 * @param fieldValues - Map of property/value pairs 151 * @return boolean 152 */ 153 public boolean checkForAdditionalFields(Map<String, String> fieldValues); 154 155 /** 156 * Builds the return value url. 157 * 158 * @param businessObject - Instance of a business object containing the return values 159 * @param fieldConversions - Map of conversions mapping bo names to caller field names. 160 * @param lookupImpl - Current lookup impl name 161 * @return String url called when selecting a row from the result set 162 */ 163 public HtmlData getReturnUrl(BusinessObject businessObject, Map<String, String> fieldConversions, String lookupImpl, BusinessObjectRestrictions businessObjectRestrictions); 164 165 /** 166 * Builds the Url for a maintenance new document for the lookup business object class 167 * @param businessObject 168 * @return String rendered on Lookup screen for maintenance new document 169 */ 170 public String getCreateNewUrl(); 171 172 /** 173 * Sets the requested fields conversions in the lookupable 174 * 175 * @param fieldConversions 176 */ 177 public void setFieldConversions(Map<String, String> fieldConversions); 178 179 /** 180 * Sets the requested read only fields list in the lookupable 181 * 182 * @param readOnlyFieldsList 183 */ 184 public void setReadOnlyFieldsList(List<String> readOnlyFieldsList); 185 186 /** 187 * Sets the helper service for instance 188 * @param helper the helper service 189 */ 190 public void setLookupableHelperService(LookupableHelperService helper); 191 192 /** 193 * Returns the LookupableHelperService designated to help this lookup 194 * @return 195 */ 196 public LookupableHelperService getLookupableHelperService(); 197 198 /** 199 * Returns whether this search was performed using the values of the primary keys only 200 * 201 * @return 202 */ 203 public boolean isSearchUsingOnlyPrimaryKeyValues(); 204 205 /** 206 * Returns a comma delimited list of primary key field labels, as defined in the DD 207 * 208 * @return 209 */ 210 public String getPrimaryKeyFieldLabels(); 211 212 /** 213 * This method returns a list of the default columns used to sort the result set. For multiple value lookups, 214 * this method does not change when different columns are sorted. 215 * 216 * @return 217 */ 218 public List<String> getDefaultSortColumns(); 219 220 /** 221 * 222 * This method allows for customization of the lookup clear 223 * 224 */ 225 public void performClear(LookupForm lookupForm); 226 227 /** 228 * 229 * This method checks whether the header non maint actions should be shown 230 * 231 */ 232 public boolean shouldDisplayHeaderNonMaintActions(); 233 234 /** 235 * 236 * This method checks whether the criteria should be shown 237 * 238 */ 239 public boolean shouldDisplayLookupCriteria(); 240 241 /** 242 * 243 * This method is called from a custom action button or script 244 * 245 */ 246 public boolean performCustomAction(boolean ignoreErrors); 247 248 /** 249 * 250 * get extra field 251 * 252 * @return 253 */ 254 public Field getExtraField(); 255 256 /** 257 * method returns the extraOnLoad variable. The 258 * varible is currently accessed in page.tag and is called in the onLoad. 259 * it allows us to inject javascript onload. 260 */ 261 public String getExtraOnLoad(); 262 263 public void setExtraOnLoad(String extraOnLoad); 264 public void applyFieldAuthorizationsFromNestedLookups(Field field); 265 266 /** 267 * Performs conditional logic (based on current search values or other parameters) to 268 * override field hidden, read-only, and required attributes previously set. 269 */ 270 public void applyConditionalLogicForFieldDisplay(); 271}