/kns/src/main/java/org/kuali/rice/kns/service/MaintenanceDocumentDictionaryService.java

https://github.com/sbower/kuali-rice-1 · Java · 305 lines · 56 code · 34 blank · 215 comment · 0 complexity · db7234d8b931c0c4a9ae5d2c583ad50d MD5 · raw file

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