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