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