001/**
002 * Copyright 2005-2016 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.maintenance;
017
018import org.kuali.rice.kns.document.authorization.MaintenanceDocumentRestrictions;
019import org.kuali.rice.krad.bo.BusinessObject;
020import org.kuali.rice.krad.bo.PersistableBusinessObject;
021import org.kuali.rice.kns.document.MaintenanceDocument;
022import org.kuali.rice.krad.lookup.SelectiveReferenceRefresher;
023
024import java.util.Collection;
025import java.util.List;
026import java.util.Map;
027
028/**
029 * Defines basic methods that all maintainable objects must provide
030 */
031@Deprecated
032public interface Maintainable extends org.kuali.rice.krad.maintenance.Maintainable, SelectiveReferenceRefresher {
033
034    public String getDocumentTitle(MaintenanceDocument document);
035
036    /**
037     * Returns instance of the business object that is being maintained.
038     */
039    @Deprecated
040    public PersistableBusinessObject getBusinessObject();
041
042    /**
043     * Called from a lookup return by the maintenance action.
044     */
045    @Deprecated
046    public void refresh(String refreshCaller, Map fieldValues, MaintenanceDocument document);
047
048    /**
049     * Sets an instance of a business object to be maintained.
050     */
051    @Deprecated
052    public void setBusinessObject(PersistableBusinessObject object);
053
054    @Deprecated
055    public Class getBoClass();
056
057    @Deprecated
058    public void setBoClass(Class boClass);
059
060    /**
061     * This method will cause the Maintainable implementation to save/store the
062     * relevant business object(s). This typically is called only after the
063     * maint document has gone through state to final.
064     */
065    @Deprecated
066    public void saveBusinessObject();
067
068    @Deprecated
069    public void addMultipleValueLookupResults(MaintenanceDocument document, String collectionName,
070            Collection<PersistableBusinessObject> rawValues, boolean needsBlank, PersistableBusinessObject bo);
071
072    @Deprecated
073    public List<String> getDuplicateIdentifierFieldsFromDataDictionary(String docTypeName, String collectionName);
074
075    @Deprecated
076    public List<String> getMultiValueIdentifierList(Collection maintCollection, List<String> duplicateIdentifierFields);
077
078    @Deprecated
079    public boolean hasBusinessObjectExisted(BusinessObject bo, List<String> existingIdentifierList,
080            List<String> duplicateIdentifierFields);
081
082    /**
083     * Blanks out or sets the default of any value specified as restricted
084     * within the {@link MaintenanceDocumentRestrictions} instance.
085     *
086     * This method should only be called if this maintainable represents the new
087     * maintainable of the maintenance document.
088     *
089     * @param maintenanceDocumentRestrictions
090     */
091    @Deprecated
092    public void clearBusinessObjectOfRestrictedValues(MaintenanceDocumentRestrictions maintenanceDocumentRestrictions);
093
094    public boolean isBoNotesEnabled();
095
096    /**
097     * Gives chance to a maintainable object to prepare and return a
098     * maintainable object which might be external to the system
099     *
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}