Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MaintenanceDocumentDictionaryService |
|
| 1.0;1 |
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 org.kuali.rice.kns.bo.PersistableBusinessObject; | |
19 | import org.kuali.rice.kns.datadictionary.*; | |
20 | import org.kuali.rice.kns.document.MaintenanceDocument; | |
21 | import org.kuali.rice.kns.rule.BusinessRule; | |
22 | ||
23 | import java.util.Collection; | |
24 | import java.util.List; | |
25 | ||
26 | /** | |
27 | * Defines methods that a MaintenanceDocumentDictionary Service must provide. Defines the API for the interacting | |
28 | * with Document-related entries in the data dictionary. | |
29 | * | |
30 | *@author Kuali Rice Team (rice.collab@kuali.org) | |
31 | */ | |
32 | public interface MaintenanceDocumentDictionaryService { | |
33 | /** | |
34 | * Retrieves the label for a maintenance document. | |
35 | * | |
36 | * @param docTypeName | |
37 | * @return The label as a String. | |
38 | */ | |
39 | @Deprecated | |
40 | public String getMaintenanceLabel(String docTypeName); | |
41 | ||
42 | /** | |
43 | * Retrieves the description of the maintenance document. | |
44 | * | |
45 | * @param docTypeName | |
46 | * @return The description as a String. | |
47 | */ | |
48 | public String getMaintenanceDescription(String docTypeName); | |
49 | ||
50 | /** | |
51 | * Retrieves an instance of the class that represents the maintenance document. This is done by | |
52 | * | |
53 | * @param docTypeName | |
54 | * @return A class instance. | |
55 | */ | |
56 | public Class getMaintainableClass(String docTypeName); | |
57 | ||
58 | /** | |
59 | * The document type name for a class instance. | |
60 | * | |
61 | * @param businessObjectClass | |
62 | * @return The document type name for the class as a String. | |
63 | */ | |
64 | public String getDocumentTypeName(Class businessObjectClass); | |
65 | ||
66 | /** | |
67 | * The collection of ReferenceDefinition objects defined as DefaultExistenceChecks for the MaintenanceDocument. | |
68 | * | |
69 | * @param businessObjectClass | |
70 | * @return A Collection of ReferenceDefinitions | |
71 | */ | |
72 | public Collection getDefaultExistenceChecks(Class businessObjectClass); | |
73 | ||
74 | /** | |
75 | * The collection of ReferenceDefinition objects defined as DefaultExistenceChecks for the MaintenanceDocument. | |
76 | * | |
77 | * @param docTypeName | |
78 | * @return A Collection of ReferenceDefinitions | |
79 | */ | |
80 | public Collection getDefaultExistenceChecks(String docTypeName); | |
81 | ||
82 | /** | |
83 | * A List of field names used as locking keys | |
84 | * | |
85 | * @param docTypeName | |
86 | * @return A List of strings | |
87 | */ | |
88 | public List getLockingKeys(String docTypeName); | |
89 | ||
90 | /** | |
91 | * A List of maintainable section object instances corresponding to the document type name. | |
92 | * | |
93 | * @param docTypeName | |
94 | * @return A List of maintable section objects. | |
95 | */ | |
96 | @Deprecated | |
97 | public List<MaintainableSectionDefinition> getMaintainableSections(String docTypeName); | |
98 | ||
99 | /** | |
100 | * The instance of the business object class associated with this document type name. | |
101 | * | |
102 | * @param docTypeName | |
103 | * @return The class instance corresponding to the document type name. | |
104 | */ | |
105 | public Class getBusinessObjectClass(String docTypeName); | |
106 | ||
107 | ||
108 | /** | |
109 | * @param document | |
110 | * @return businessRulesClass associated with the given document's type | |
111 | */ | |
112 | public Class<? extends BusinessRule> getBusinessRulesClass(MaintenanceDocument document); | |
113 | ||
114 | /** | |
115 | * | |
116 | * This method returns the defaultValue as it would appear in the UI on a maintenance document. | |
117 | * | |
118 | * If both a defaultValue and a defaultValueFinderClass is present in the MaintainableFieldDefinition instance, then the | |
119 | * defaultValue will be preferentially returned. If only one is present, then that will be returned. | |
120 | * | |
121 | * Note that if a defaultValueFinderClass value is present, then this method will attempt to create a new instance of the | |
122 | * specified class. If this attempt to generate a new instance fails, the error will be suppressed, and an null result will be | |
123 | * returned. | |
124 | * | |
125 | * @param boClass - the class of BO being maintained | |
126 | * @param fieldName - the fieldName of the attribute for which the default is desired | |
127 | * @return the default if one is available, null otherwise | |
128 | * | |
129 | */ | |
130 | @Deprecated | |
131 | public String getFieldDefaultValue(Class boClass, String fieldName); | |
132 | ||
133 | /** | |
134 | * | |
135 | * This method returns the defaultValue as it would appear in the UI on a maintenance document. | |
136 | * | |
137 | * If both a defaultValue and a defaultValueFinderClass is present in the MaintainableFieldDefinition instance, then the | |
138 | * defaultValue will be preferentially returned. If only one is present, then that will be returned. | |
139 | * | |
140 | * Note that if a defaultValueFinderClass value is present, then this method will attempt to create a new instance of the | |
141 | * specified class. If this attempt to generate a new instance fails, the error will be suppressed, and an null result will be | |
142 | * returned. | |
143 | * | |
144 | * @param docTypeName - the document type name of the maintainable | |
145 | * @param fieldName - the fieldName of the attribute for which the default is desired | |
146 | * @return the default if one is available, null otherwise | |
147 | * | |
148 | */ | |
149 | @Deprecated | |
150 | public String getFieldDefaultValue(String docTypeName, String fieldName); | |
151 | ||
152 | /** | |
153 | * | |
154 | * This method returns the defaultValue as it would appear in the UI on a maintenance document for a collection. | |
155 | * | |
156 | * If both a defaultValue and a defaultValueFinderClass is present in the MaintainableFieldDefinition instance, then the | |
157 | * defaultValue will be preferentially returned. If only one is present, then that will be returned. | |
158 | * | |
159 | * Note that if a defaultValueFinderClass value is present, then this method will attempt to create a new instance of the | |
160 | * specified class. If this attempt to generate a new instance fails, the error will be suppressed, and an null result will be | |
161 | * returned. | |
162 | * | |
163 | * @param docTypeName - the document type name of the maintainable | |
164 | * @param collectionName - the name attribute of the collection to which the field belongs | |
165 | * @param fieldName - the fieldName of the attribute for which the default is desired | |
166 | * @return the default if one is available, null otherwise | |
167 | */ | |
168 | @Deprecated | |
169 | public String getCollectionFieldDefaultValue(String docTypeName, String collectionName, String fieldName); | |
170 | ||
171 | /** | |
172 | * Returns whether or not this document's data dictionary file has flagged it to allow document copies. | |
173 | * | |
174 | * @param document | |
175 | * @return True if copies are allowed, false otherwise. | |
176 | */ | |
177 | public Boolean getAllowsCopy(MaintenanceDocument document); | |
178 | ||
179 | /** | |
180 | * Returns whether or not this document's data dictionary file has flagged it to allow maintenance new | |
181 | * or copy actions. | |
182 | * | |
183 | * @param document | |
184 | * @return True if new or copy maintenance actions are allowed | |
185 | */ | |
186 | public Boolean getAllowsNewOrCopy(String docTypeName); | |
187 | ||
188 | ||
189 | /** | |
190 | * Returns the business object used to store the values for the given collection. | |
191 | * | |
192 | * @param docTypeName | |
193 | * @param collectionName | |
194 | * @return | |
195 | */ | |
196 | public Class getCollectionBusinessObjectClass( String docTypeName, String collectionName ); | |
197 | ||
198 | /** | |
199 | * Returns the definition for the maintainable item identified by "itemName". | |
200 | * | |
201 | * @param docTypeName | |
202 | * @param itemName | |
203 | * @return The item or <b>null</b> if the item does not exist. | |
204 | */ | |
205 | @Deprecated | |
206 | public MaintainableItemDefinition getMaintainableItem( String docTypeName, String itemName ); | |
207 | ||
208 | /** | |
209 | * Returns the definition for the maintainable field identified by "fieldName". | |
210 | * | |
211 | * @param docTypeName | |
212 | * @param fieldName | |
213 | * @return The field or <b>null</b> if the item does not exist or is not a field. | |
214 | */ | |
215 | @Deprecated | |
216 | public MaintainableFieldDefinition getMaintainableField( String docTypeName, String fieldName ); | |
217 | ||
218 | /** | |
219 | * Returns the definition for the maintainable collection identified by "collectionName". | |
220 | * | |
221 | * @param docTypeName | |
222 | * @param collectionName | |
223 | * @return The collection or <b>null</b> if the item does not exist or is not a collection. | |
224 | */ | |
225 | @Deprecated | |
226 | public MaintainableCollectionDefinition getMaintainableCollection( String docTypeName, String collectionName ); | |
227 | ||
228 | /* They are returned in order of discovery (depth-first search) */ | |
229 | /** | |
230 | * Gets a list of all top-level maintainable collections on the document. | |
231 | * | |
232 | * | |
233 | * @param docTypeName | |
234 | * @return | |
235 | */ | |
236 | @Deprecated | |
237 | public List<MaintainableCollectionDefinition> getMaintainableCollections( String docTypeName ); | |
238 | ||
239 | /** | |
240 | * Returns a list of all collections within the given collection | |
241 | * | |
242 | * @param parentCollection | |
243 | * @return | |
244 | */ | |
245 | @Deprecated | |
246 | public List<MaintainableCollectionDefinition> getMaintainableCollections( MaintainableCollectionDefinition parentCollection ); | |
247 | ||
248 | ||
249 | /** | |
250 | * Validates the maintenance document contains values for the fields declared as required in the | |
251 | * maintenance document data dictionary file. | |
252 | * | |
253 | * @param document | |
254 | */ | |
255 | @Deprecated | |
256 | public void validateMaintenanceRequiredFields(MaintenanceDocument document); | |
257 | ||
258 | /** | |
259 | * validates the collections of the maintenance document checking to see if duplicate entries in the collection exist | |
260 | * @param document | |
261 | */ | |
262 | public void validateMaintainableCollectionsForDuplicateEntries(MaintenanceDocument document); | |
263 | ||
264 | @Deprecated | |
265 | public void validateMaintainableCollectionsAddLineRequiredFields(MaintenanceDocument document, PersistableBusinessObject businessObject, String collectionName ); | |
266 | ||
267 | public MaintenanceDocumentEntry getMaintenanceDocumentEntry(String docTypeName); | |
268 | ||
269 | //for issue KULRice 3072, checking PK copy prop | |
270 | public boolean getPreserveLockingKeysOnCopy(Class businessObjectClass); | |
271 | ||
272 | //for issue KULRice 3070 | |
273 | public Boolean getAllowsRecordDeletion(Class businessObjectClass); | |
274 | //for issue KULRice3070 | |
275 | public Boolean getAllowsRecordDeletion(MaintenanceDocument document); | |
276 | ||
277 | /** | |
278 | * @param businessObjectClass - business object class for maintenance definition | |
279 | * @return Boolean indicating whether translating of codes is configured to true in maintenance definition | |
280 | */ | |
281 | @Deprecated | |
282 | public Boolean translateCodes(Class businessObjectClass); | |
283 | ||
284 | } |