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.service; 17 18 import java.util.List; 19 20 import org.kuali.rice.kns.bo.BusinessObject; 21 import org.kuali.rice.kns.datadictionary.FieldDefinition; 22 import org.kuali.rice.kns.inquiry.InquiryAuthorizer; 23 import org.kuali.rice.kns.inquiry.InquiryPresentationController; 24 import org.kuali.rice.kns.lookup.valueFinder.ValueFinder; 25 26 27 /** 28 * This interface defines the API for the interacting with the data dictionary. 29 */ 30 public interface BusinessObjectDictionaryService { 31 public <T extends BusinessObject> InquiryPresentationController getInquiryPresentationController(Class<T> businessObjectClass); 32 33 public <T extends BusinessObject> InquiryAuthorizer getInquiryAuthorizer(Class<T> businessObjectClass); 34 35 /** 36 * the list of business object class names being maintained 37 */ 38 public List getBusinessObjectClassnames(); 39 40 41 /** 42 * indicates whether business object has lookup defined 43 */ 44 public Boolean isLookupable(Class businessObjectClass); 45 46 47 /** 48 * indicates whether business object has inquiry defined 49 */ 50 public Boolean isInquirable(Class businessObjectClass); 51 52 53 /** 54 * indicates whether business object has maintainable defined 55 */ 56 public Boolean isMaintainable(Class businessObjectClass); 57 58 59 /** 60 * indicates whether business object has an exporter defined 61 */ 62 public Boolean isExportable(Class businessObjectClass); 63 64 /** 65 * the list defined as lookup fields for the business object. 66 */ 67 public List getLookupFieldNames(Class businessObjectClass); 68 69 70 /** 71 * the text to be displayed for the title of business object lookup. 72 */ 73 public String getLookupTitle(Class businessObjectClass); 74 75 76 /** 77 * menu bar html defined for the business object. 78 */ 79 public String getLookupMenuBar(Class businessObjectClass); 80 81 82 /** 83 * source for optional extra button 84 */ 85 public String getExtraButtonSource(Class businessObjectClass); 86 87 88 /** 89 * return parameters for optional extra button 90 */ 91 public String getExtraButtonParams(Class businessObjectClass); 92 93 94 /** 95 * the property names of the bo used to sort the initial result set 96 */ 97 public List getLookupDefaultSortFieldNames(Class businessObjectClass); 98 99 100 /** 101 * the list defined as lookup result fields for the business object. 102 */ 103 public List<String> getLookupResultFieldNames(Class businessObjectClass); 104 105 /** 106 * This method returns the maximum display length of the value of the given field in the lookup results. While the actual value may 107 * be longer than the specified length, this value specifies the maximum length substring that should be displayed. 108 * It is up to the UI layer to intepret the results of the field 109 * 110 * @param businessObjectClass 111 * @param resultFieldName 112 * @return the maximum length of the lookup results field that should be displayed. Returns null 113 * if this value has not been defined. If negative, denotes that the is maximum length is unlimited. 114 */ 115 public Integer getLookupResultFieldMaxLength(Class businessObjectClass, String resultFieldName); 116 117 /** 118 * returns boolean indicating whether lookup result field marked to force an inquiry 119 */ 120 public Boolean forceLookupResultFieldInquiry(Class businessObjectClass, String attributeName); 121 122 123 /** 124 * returns boolean indicating whether lookup result field marked to not do an inquiry 125 */ 126 public Boolean noLookupResultFieldInquiry(Class businessObjectClass, String attributeName); 127 128 129 /** 130 * returns boolean indicating whether lookup search field marked to force a lookup 131 */ 132 public Boolean forceLookupFieldLookup(Class businessObjectClass, String attributeName); 133 134 /** 135 * returns boolean indicating whether lookup search field marked to force an inquiry 136 */ 137 public Boolean forceInquiryFieldLookup(Class businessObjectClass, String attributeName); 138 139 /** 140 * returns boolean indicating whether lookup search field marked to not do a lookup 141 */ 142 public Boolean noLookupFieldLookup(Class businessObjectClass, String attributeName); 143 144 145 /** 146 * returns boolean indicating whether lookup search field marked to not do a direct inquiry 147 */ 148 public Boolean noDirectInquiryFieldLookup(Class businessObjectClass, String attributeName); 149 150 151 /** 152 * returns boolean indicating whether inquiry result field marked to force an inquiry 153 */ 154 public Boolean forceInquiryFieldInquiry(Class businessObjectClass, String attributeName); 155 156 157 /** 158 * returns boolean indicating whether inquiry result field marked to not do an inquiry 159 */ 160 public Boolean noInquiryFieldInquiry(Class businessObjectClass, String attributeName); 161 162 /** 163 * returns boolean indicating whether lookup result field to use shortLabel 164 */ 165 public Boolean getLookupResultFieldUseShortLabel(Class businessObjectClass, String attributeName); 166 167 /** 168 * returns boolean indicating whether lookup result field should be totaled 169 */ 170 public Boolean getLookupResultFieldTotal(Class businessObjectClass, String attributeName); 171 172 /** 173 * returns String indicating the default search value for the lookup field 174 */ 175 public String getLookupFieldDefaultValue(Class businessObjectClass, String attributeName); 176 177 178 /** 179 * returns Class used to generate a lookup field default value 180 */ 181 public Class getLookupFieldDefaultValueFinderClass(Class businessObjectClass, String attributeName); 182 183 /** 184 * See {@link FieldDefinition#getQuickfinderParameterString()}. 185 * returns String indicating the default search value for the lookup field. 186 */ 187 public String getLookupFieldQuickfinderParameterString(Class businessObjectClass, String attributeName); 188 189 190 /** 191 * returns Class used to generate quickfinder lookup field default values. 192 * See {@link FieldDefinition#getQuickfinderParameterStringBuilderClass()}. 193 */ 194 public Class<? extends ValueFinder> getLookupFieldQuickfinderParameterStringBuilderClass(Class businessObjectClass, String attributeName); 195 196 197 /** 198 * returns String indicating the result set limit for the lookup 199 */ 200 public Integer getLookupResultSetLimit(Class businessObjectClass); 201 202 /** 203 * @return number of search columns configured for the lookup associated with the class 204 */ 205 public Integer getLookupNumberOfColumns(Class businessObjectClass); 206 207 /** 208 * returns String indicating the location of the lookup icon. 209 */ 210 public String getSearchIconOverride(Class businessObjectClass); 211 212 /** 213 * indicates whether a field is required for a lookup 214 */ 215 public Boolean getLookupAttributeRequired(Class businessObjectClass, String attributeName); 216 217 /** 218 * indicates whether a field is read only for a lookup 219 */ 220 public Boolean getLookupAttributeReadOnly(Class businessObjectClass, String attributeName); 221 222 223 /** 224 * the list defined as inquiry fields for the business object and inquiry section. 225 */ 226 public List getInquiryFieldNames(Class businessObjectClass, String sectionTitle); 227 228 229 /** 230 * the list defined as inquiry sections for the business object. 231 */ 232 public List getInquirySections(Class businessObjectClass); 233 234 235 /** 236 * the text to be displayed for the title of business object inquiry. 237 */ 238 public String getInquiryTitle(Class businessObjectClass); 239 240 241 /** 242 * the class to be used for building inquiry pages. 243 */ 244 public Class getInquirableClass(Class businessObjectClass); 245 246 /** 247 * the text to be displayed for the title of business object maintenance document. 248 */ 249 public String getMaintainableLabel(Class businessObjectClass); 250 251 252 /** 253 * the attribute to be associated with for object level markings 254 */ 255 public String getTitleAttribute(Class businessObjectClass); 256 257 258 /** 259 * the Lookupable implementation id for the associated Lookup, if one has been specified 260 */ 261 public String getLookupableID(Class businessObjectClass); 262 263 264 /** 265 * This method takes any business object and recursively walks through it checking to see if any attributes need to be forced to 266 * uppercase based on settings in the data dictionary 267 * 268 * @param bo 269 */ 270 public void performForceUppercase(BusinessObject bo); 271 272 273 public Boolean areNotesSupported(Class businessObjectClass); 274 275 /** 276 * returns whether on a lookup, field/attribute values with wildcards and operators should treat them as literal characters 277 * 278 * @param businessObjectClass 279 * @param attributeName 280 * @return 281 */ 282 public boolean isLookupFieldTreatWildcardsAndOperatorsAsLiteral(Class businessObjectClass, String attributeName); 283 284 /** 285 * returns String giving alternate display attribute name for lookup field if configured, or null 286 */ 287 public String getLookupFieldAlternateDisplayAttributeName(Class businessObjectClass, String attributeName); 288 289 /** 290 * returns String giving alternate display attribute name for inquiry field if configured, or null 291 */ 292 public String getInquiryFieldAlternateDisplayAttributeName(Class businessObjectClass, String attributeName); 293 294 /** 295 * returns String giving additional display attribute name for lookup field if configured, or null 296 */ 297 298 public String getLookupFieldAdditionalDisplayAttributeName(Class businessObjectClass, String attributeName); 299 300 /** 301 * returns String giving additional display attribute name for inquiry field if configured, or null 302 */ 303 public String getInquiryFieldAdditionalDisplayAttributeName(Class businessObjectClass, String attributeName); 304 305 /** 306 * @param businessObjectClass - business object class for lookup definition 307 * @return Boolean indicating whether translating of codes is configured to true in lookup definition 308 */ 309 public Boolean tranlateCodesInLookup(Class businessObjectClass); 310 311 /** 312 * @param businessObjectClass - business object class for inquiry definition 313 * @return Boolean indicating whether translating of codes is configured to true in inquiry definition 314 */ 315 public Boolean tranlateCodesInInquiry(Class businessObjectClass); 316 317 /** 318 * Indicates whether a lookup field has been configured to trigger on value change 319 * 320 * @param businessObjectClass - Class for business object to lookup 321 * @param attributeName - name of attribute in the business object to check configuration for 322 * @return true if field is configured to trigger on value change, false if not 323 */ 324 public boolean isLookupFieldTriggerOnChange(Class businessObjectClass, String attributeName); 325 326 /** 327 * Indicates whether the search and clear buttons should be disabled based on the data 328 * dictionary configuration 329 * 330 * @param businessObjectClass 331 * - business object class for lookup definition 332 * @return Boolean indicating whether disable search buttons is configured to true in lookup 333 * definition 334 */ 335 public boolean disableSearchButtonsInLookup(Class businessObjectClass); 336 337 /** 338 * Returns the list of attributes that should be used for grouping when determing the current 339 * status of a business object that implements InactivateableFromTo 340 * 341 * @param businessObjectClass - business object class to get configured list for 342 * @return List of string attribute names that gives the group by list 343 */ 344 public List<String> getGroupByAttributesForEffectiveDating(Class businessObjectClass); 345 }