Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Lookupable |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 1.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/ecl1.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.krad.lookup; | |
17 | ||
18 | import org.kuali.rice.krad.uif.container.Group; | |
19 | import org.kuali.rice.krad.uif.container.LookupView; | |
20 | import org.kuali.rice.krad.uif.container.View; | |
21 | import org.kuali.rice.krad.uif.field.LinkField; | |
22 | import org.kuali.rice.krad.uif.service.ViewHelperService; | |
23 | import org.kuali.rice.krad.web.form.LookupForm; | |
24 | ||
25 | import java.util.Collection; | |
26 | import java.util.List; | |
27 | import java.util.Map; | |
28 | ||
29 | /** | |
30 | * Provides contract for implementing a lookup within the lookup framework | |
31 | * | |
32 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
33 | */ | |
34 | public interface Lookupable extends ViewHelperService, java.io.Serializable { | |
35 | ||
36 | /** | |
37 | * Invoked to carry out the lookup search based on the given map of key/value search | |
38 | * values | |
39 | * | |
40 | * @param form - lookup form instance containing the lookup data | |
41 | * @param searchCriteria - map of criteria currently set | |
42 | * @param bounded - indicates whether the results should be limited (if necessary) to the max search | |
43 | * result limit configured | |
44 | * @return the list of result objects, possibly bounded | |
45 | */ | |
46 | public Collection<?> performSearch(LookupForm form, Map<String, String> searchCriteria, boolean bounded); | |
47 | ||
48 | /** | |
49 | * Invoked when the clear action is requested to result the search fields to | |
50 | * their initial default values | |
51 | * | |
52 | * @param form - lookup form instance containing the lookup data | |
53 | * @param searchCriteria - map of criteria currently set | |
54 | * @return map of criteria with field values reset to defaults | |
55 | */ | |
56 | public Map<String, String> performClear(LookupForm form, Map<String, String> searchCriteria); | |
57 | ||
58 | /** | |
59 | * Invoked to perform validation on the search criteria before the search is performed | |
60 | * | |
61 | * @param form - lookup form instance containing the lookup data | |
62 | * @param searchCriteria - map of criteria where key is search property name and value is | |
63 | * search value (which can include wildcards) | |
64 | * @param boolean true if validation was successful, false if there were errors and the search | |
65 | * should not be performed | |
66 | */ | |
67 | public boolean validateSearchParameters(LookupForm form, Map<String, String> searchCriteria); | |
68 | ||
69 | /** | |
70 | * Sets the class for the data object the lookup will be provided on | |
71 | * | |
72 | * @param dataObjectClass - data object class for lookup | |
73 | */ | |
74 | public void setDataObjectClass(Class<?> dataObjectClass); | |
75 | ||
76 | /** | |
77 | * Returns the class for the data object the lookup is configured with | |
78 | * | |
79 | * @return Class<?> data object class | |
80 | */ | |
81 | public Class<?> getDataObjectClass(); | |
82 | ||
83 | /** | |
84 | * Sets the field conversion map on the lookupable | |
85 | * | |
86 | * <p> | |
87 | * The field conversions map specifies the mappings for return fields. When the | |
88 | * user selects a row to return, for each configured field conversion the corresponding value | |
89 | * from the result row will be sent back as the value for the field on the calling field. | |
90 | * </p> | |
91 | * | |
92 | * @param fieldConversions - map of field conversions where key is name of the property on result | |
93 | * data object to get value for, and map value is the name of the field to send the value back as (name | |
94 | * of the field on the calling view) | |
95 | */ | |
96 | public void setFieldConversions(Map<String, String> fieldConversions); | |
97 | ||
98 | /** | |
99 | * Sets List of fields on the lookupable that should be made read only in the search | |
100 | * criteria group | |
101 | * | |
102 | * @param readOnlyFieldsList - list of read only fields | |
103 | */ | |
104 | public void setReadOnlyFieldsList(List<String> readOnlyFieldsList); | |
105 | ||
106 | /** | |
107 | * Invoked to build the return URL for a result row | |
108 | * | |
109 | * <p> | |
110 | * Based on the line contained in the field context, the URL for returning the role is constructed and | |
111 | * set as the href for the link field. If a return link cannot be constructed the field should be set | |
112 | * to not render | |
113 | * </p> | |
114 | * | |
115 | * @param returnLinkField - link field that will be used to render the return URL | |
116 | * @param model - lookup form containing the data | |
117 | */ | |
118 | public void getReturnUrlForResults(LinkField returnLinkField, Object model); | |
119 | ||
120 | /** | |
121 | * Invoked to build a maintenance URL for a result row | |
122 | * | |
123 | * <p> | |
124 | * Based on the line contained in the field context and the given maintenance method that should be called a | |
125 | * URL is constructed and set as the href on the link field. If a maintenance link cannot be constructed the | |
126 | * field should be set to not render | |
127 | * </p> | |
128 | * | |
129 | * @param actionLinkField - link field that will be used to return the maintenance URL | |
130 | * @param model - lookup form containing the data | |
131 | * @param maintenanceMethodToCall - name of the method that should be invoked in the maintenance controller | |
132 | */ | |
133 | public void getMaintenanceActionLink(LinkField actionLinkField, Object model, String maintenanceMethodToCall); | |
134 | } |