1 /**
2 * Copyright 2005-2016 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.maintenance;
17
18 import org.kuali.rice.kns.document.authorization.MaintenanceDocumentRestrictions;
19 import org.kuali.rice.krad.bo.BusinessObject;
20 import org.kuali.rice.krad.bo.PersistableBusinessObject;
21 import org.kuali.rice.kns.document.MaintenanceDocument;
22 import org.kuali.rice.krad.lookup.SelectiveReferenceRefresher;
23
24 import java.util.Collection;
25 import java.util.List;
26 import java.util.Map;
27
28 /**
29 * Defines basic methods that all maintainable objects must provide
30 */
31 @Deprecated
32 public interface Maintainable extends org.kuali.rice.krad.maintenance.Maintainable, SelectiveReferenceRefresher {
33
34 public String getDocumentTitle(MaintenanceDocument document);
35
36 /**
37 * Returns instance of the business object that is being maintained.
38 */
39 @Deprecated
40 public PersistableBusinessObject getBusinessObject();
41
42 /**
43 * Called from a lookup return by the maintenance action.
44 */
45 @Deprecated
46 public void refresh(String refreshCaller, Map fieldValues, MaintenanceDocument document);
47
48 /**
49 * Sets an instance of a business object to be maintained.
50 */
51 @Deprecated
52 public void setBusinessObject(PersistableBusinessObject object);
53
54 @Deprecated
55 public Class getBoClass();
56
57 @Deprecated
58 public void setBoClass(Class boClass);
59
60 /**
61 * This method will cause the Maintainable implementation to save/store the
62 * relevant business object(s). This typically is called only after the
63 * maint document has gone through state to final.
64 */
65 @Deprecated
66 public void saveBusinessObject();
67
68 @Deprecated
69 public void addMultipleValueLookupResults(MaintenanceDocument document, String collectionName,
70 Collection<PersistableBusinessObject> rawValues, boolean needsBlank, PersistableBusinessObject bo);
71
72 @Deprecated
73 public List<String> getDuplicateIdentifierFieldsFromDataDictionary(String docTypeName, String collectionName);
74
75 @Deprecated
76 public List<String> getMultiValueIdentifierList(Collection maintCollection, List<String> duplicateIdentifierFields);
77
78 @Deprecated
79 public boolean hasBusinessObjectExisted(BusinessObject bo, List<String> existingIdentifierList,
80 List<String> duplicateIdentifierFields);
81
82 /**
83 * Blanks out or sets the default of any value specified as restricted
84 * within the {@link MaintenanceDocumentRestrictions} instance.
85 *
86 * This method should only be called if this maintainable represents the new
87 * maintainable of the maintenance document.
88 *
89 * @param maintenanceDocumentRestrictions
90 */
91 @Deprecated
92 public void clearBusinessObjectOfRestrictedValues(MaintenanceDocumentRestrictions maintenanceDocumentRestrictions);
93
94 public boolean isBoNotesEnabled();
95
96 /**
97 * Gives chance to a maintainable object to prepare and return a
98 * maintainable object which might be external to the system
99 *
100 * @return
101 */
102 @Deprecated
103 public void prepareBusinessObject(BusinessObject businessObject);
104
105 // 3070
106 @Deprecated
107 public void deleteBusinessObject();
108
109 @Deprecated
110 boolean isOldBusinessObjectInDocument();
111
112 /**
113 * Indicates whether inactive records for the given collection should be
114 * display.
115 *
116 * @param collectionName - name of the collection (or sub-collection) to check inactive
117 * record display setting
118 * @return true if inactive records should be displayed, false otherwise
119 */
120 @Deprecated
121 public boolean getShowInactiveRecords(String collectionName);
122
123 /**
124 * Returns the Map used to control the state of inactive record collection
125 * display. Exposed for setting from the maintenance jsp.
126 */
127 @Deprecated
128 public Map<String, Boolean> getInactiveRecordDisplay();
129
130 /**
131 * Indicates to maintainble whether or not inactive records should be
132 * displayed for the given collection name.
133 *
134 * @param collectionName - name of the collection (or sub-collection) to set inactive
135 * record display setting
136 * @param showInactive - true to display inactive, false to not display inactive
137 * records
138 */
139 @Deprecated
140 public void setShowInactiveRecords(String collectionName, boolean showInactive);
141
142 /**
143 * Populates the new collection lines based on key/value pairs.
144 *
145 * @param fieldValues
146 * @return
147 */
148 @Deprecated
149 public Map<String, String> populateNewCollectionLines(Map<String, String> fieldValues,
150 MaintenanceDocument maintenanceDocument, String methodToCall);
151
152 /**
153 * Gets the holder for the "add line" for a collection on the business
154 * object
155 *
156 * @param collectionName
157 * @return
158 */
159 @Deprecated
160 public PersistableBusinessObject getNewCollectionLine(String collectionName);
161
162 /**
163 * Adds the new line for the given collection to the business object's
164 * collection.
165 *
166 * @param collectionName
167 */
168 @Deprecated
169 public void addNewLineToCollection(String collectionName);
170
171 /**
172 * KULRICE-4264 - a hook to change the state of the business object, which
173 * is the "new line" of a collection, before it is validated
174 *
175 * @param colName
176 * @param colClass
177 * @param addBO
178 */
179 @Deprecated
180 public void processBeforeAddLine(String colName, Class colClass, BusinessObject addBO);
181
182 /**
183 * Set default values.
184 *
185 * @param docTypeName
186 */
187 @Deprecated
188 public void setGenerateDefaultValues(String docTypeName);
189
190 /**
191 * Set default values for blank required fields.
192 *
193 * @param docTypeName
194 */
195 @Deprecated
196 public void setGenerateBlankRequiredValues(String docTypeName);
197
198 /**
199 * Returns a list of Section objects that specify how to render the view for
200 * the maintenance object.
201 *
202 * @param oldMaintainable - If this is the new maintainable, the old is passed in for
203 * reference. If it is the old maintainable, then null will be
204 * passed in
205 * @return
206 */
207 @Deprecated
208 public List getSections(MaintenanceDocument maintenanceDocument, Maintainable oldMaintainable);
209
210 /**
211 * This method populates the business object based on key/value pairs.
212 *
213 * @param fieldValues
214 * @param maintenanceDocument
215 * @return
216 */
217 @Deprecated
218 public Map populateBusinessObject(Map<String, String> fieldValues, MaintenanceDocument maintenanceDocument,
219 String methodToCall);
220
221 /**
222 * Returns a string that will be displayed as title on the maintenance
223 * screen.
224 */
225 @Deprecated
226 public String getMaintainableTitle();
227
228 public void setupNewFromExisting(MaintenanceDocument document,
229 Map<String, String[]> parameters);
230
231 public void processAfterCopy(MaintenanceDocument document,
232 Map<String, String[]> requestParameters);
233
234 public void processAfterEdit(MaintenanceDocument document,
235 Map<String, String[]> requestParameters);
236
237 public void processAfterNew(MaintenanceDocument document,
238 Map<String, String[]> requestParameters);
239
240 public void processAfterPost(MaintenanceDocument document,
241 Map<String, String[]> requestParameters);
242 }