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