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.core.api.uif;
17  
18  /**
19   * Defines configuration for an attribute which may be used as part of a lookups.  This includes indicating if the
20   * field is displayed in the lookup criteria or lookup result set, as well as defining information about this field
21   * if it used as part of a range-based lookup.
22   *
23   * <p>The range bounds allows the party executing the lookup against this attribute to enter a value for both ends
24   * (lower and upper bounds) in order to determine if the attribute is "between" those two values.</p>
25   *
26   * <p>Note that an attribute range only makes sense if the {@code DataType} of the attribute is
27   * a date or numerical data type.  The consumer of these settings is free to ignore the given
28   * attribute range information if it does not believe it is possible to successfully present a range-based
29   * lookup option based on the data type (or other settings) of the {@code AttributeField}.</p>
30   *
31   * @author Kuali Rice Team (rice.collab@kuali.org)
32   */
33  public interface AttributeLookupSettings {
34  
35      /**
36       * Returns true if this field should be included as part of the lookup criteria, false if not.
37       *
38       * @return true if this field should be included as part of the lookup criteria, false if not
39       */
40      boolean isInCriteria();
41  
42      /**
43       * Returns true if this field should be included in the result set of the lookup, false if not.
44       *
45       * @return true if this field should be included in the result set of the lookup, false if not
46       */
47      boolean isInResults();
48  
49      /**
50       * Returns true if lookups against this field should be handled as a lookup operation supporting a range-based
51       * search of data against the field.
52       *
53       * @return true if lookups against this attribute should allow for ranged lookup fields, false otherwise
54       */
55      boolean isRanged();
56  
57      /**
58       * Returns the name to assign to the lower bound of the range.  It is important to ensure that this
59       * does not conflict with any other attribute names being used on the lookup.
60       *
61       * @return the name of the lower bound of the range
62       */
63      String getLowerBoundName();
64  
65      /**
66       * Returns the label to use for the lower bound of the range.  If no label is defined, then the
67       * framework will generate one.
68       *
69       * @return the label of the lower bound of the range
70       */
71      String getLowerBoundLabel();
72  
73  
74      /**
75       * Returns true if the lower bound should be treated as inclusive when executing a ranged
76       * lookup against the attribute, false if it should be treated as exclusive.
77       *
78       * @return true if the lower bound is inclusive, false if it is exclusive
79       */
80      boolean isLowerBoundInclusive();
81  
82      /**
83       * Returns the name to assign to the upper bound of the range.  It is important to ensure that this
84       * does not conflict with any other attribute names being used on the lookup.
85       *
86       * @return the name of the upper bound of the range
87       */
88      String getUpperBoundName();
89  
90      /**
91       * Returns the label to use for the upper bound of the range.  If no label is defined, then the
92       * framework will generate one.
93       *
94       * @return the label of the upper bound of the range
95       */
96      String getUpperBoundLabel();
97  
98      /**
99       * Returns true if the upper bound should be treated as inclusive when executing a ranged
100      * lookup against the attribute, false if it should be treated as exclusive.
101      *
102      * @return true if the upper bound is inclusive, false if it is exclusive
103      */
104     boolean isUpperBoundInclusive();
105 
106 /**
107      * Indicates if lookups which use this attribute should execute the lookup against this attribute
108      * in a case sensitive fashion.  If this method returns null, it means that the system-level
109      * default for case sensitivity of attributes on lookups should be used.
110      *
111      * @return true if the attribute should be case sensitive on lookups, false if it should not, and
112      * null if the system-level default should be used
113      */
114     Boolean isCaseSensitive();
115 
116 }