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.krad.service; 17 18 import org.kuali.rice.krad.datadictionary.MaintenanceDocumentEntry; 19 import org.kuali.rice.krad.document.Document; 20 import org.kuali.rice.krad.document.DocumentAuthorizer; 21 import org.kuali.rice.krad.document.DocumentPresentationController; 22 import org.kuali.rice.krad.maintenance.MaintenanceDocument; 23 import org.kuali.rice.krad.maintenance.Maintainable; 24 import org.kuali.rice.krad.rules.rule.BusinessRule; 25 26 import java.util.Collection; 27 import java.util.List; 28 29 /** 30 * Defines methods that a <code>DocumentEntry</code> Service must provide, and the API for the interacting 31 * with Document-related entries in the data dictionary 32 * 33 * @author Kuali Rice Team (rice.collab@kuali.org) 34 */ 35 public interface DocumentDictionaryService { 36 37 /** 38 * Retrieves the label for the document as described in its data dictionary entry 39 * 40 * @param documentTypeName - document type name for the document entry to retrieve label for 41 * @return String document label 42 */ 43 public String getLabel(String documentTypeName); 44 45 /** 46 * Retrieves the configured document type name for the maintenance document 47 * entry associated with the given data object class 48 * 49 * @param dataObjectClass - data object class for maintenance entry to retrieve 50 * @return String document type name for maintenance document 51 */ 52 public String getMaintenanceDocumentTypeName(Class dataObjectClass); 53 54 /** 55 * Retrieves the full description of the document as described in its data dictionary entry 56 * 57 * @param documentTypeName - document type name for the document entry to retrieve description for 58 * @return String documents full description 59 */ 60 public String getDescription(String documentTypeName); 61 62 /** 63 * Retrieves the collection of ReferenceDefinition objects defined as DefaultExistenceChecks 64 * for the MaintenanceDocument associated with the given data object class 65 * 66 * @param dataObjectClass - data object class for maintenance document 67 * @return Collection reference definitions for default existence checks 68 */ 69 public Collection getDefaultExistenceChecks(Class dataObjectClass); 70 71 /** 72 * Retrieves the collection of ReferenceDefinition objects defined as DefaultExistenceChecks 73 * for the document instance 74 * 75 * @param document - document instance to pull document type for associated document entry 76 * @return Collection reference definitions for default existence checks 77 */ 78 public Collection getDefaultExistenceChecks(Document document); 79 80 /** 81 * Retrieves the collection of ReferenceDefinition objects defined as DefaultExistenceChecks 82 * for the document entry associated with the given document type name 83 * 84 * @param docTypeName - document type name for document entry to pull existence checks for 85 * @return Collection reference definitions for default existence checks 86 */ 87 public Collection getDefaultExistenceChecks(String docTypeName); 88 89 /** 90 * Retrieves the data object class configured for the maintenance entry 91 * associated with the given document type name 92 * 93 * @param docTypeName - document type name associated with maintenance document entry 94 * @return Class<?> data object class associated with maintenance document entry 95 */ 96 public Class<?> getMaintenanceDataObjectClass(String docTypeName); 97 98 /** 99 * Retrieves the maintainable class instance that is configured in the maintenance document 100 * entry associated with the given document type name 101 * 102 * @param docTypeName - document type name to retrieve maintainable for 103 * @return Class<? extends Maintainable> maintainable class for document type name 104 */ 105 public Class<? extends Maintainable> getMaintainableClass(String docTypeName); 106 107 /** 108 * Retrieves the configured business rule class configured for the document entry 109 * that is associated with the document type of the given document instance 110 * 111 * @param document - document instance to retrieve rule class for 112 * @return Class<? extends BusinessRule> businessRulesClass associated with the given document type 113 */ 114 public Class<? extends BusinessRule> getBusinessRulesClass(Document document); 115 116 /** 117 * Returns whether or not this document's data dictionary file has flagged it to allow document copies 118 * 119 * @param document - document instance to check copy flag for 120 * @return boolean true if copies are allowed, false otherwise 121 */ 122 public Boolean getAllowsCopy(Document document); 123 124 /** 125 * Returns whether or not this document's data dictionary file has flagged it to allow maintenance new 126 * or copy actions 127 * 128 * @param docTypeName - document type name to retrieve maintenance document entry for 129 * @return boolean true if new or copy maintenance actions are allowed 130 */ 131 public Boolean getAllowsNewOrCopy(String docTypeName); 132 133 /** 134 * Retrieves the maintenance document entry that is associated with the given document type name 135 * 136 * @param docTypeName - document type name to retrieve maintenance document entry for 137 * @return MaintenanceDocumentEntry instance associated with document type 138 */ 139 public MaintenanceDocumentEntry getMaintenanceDocumentEntry(String docTypeName); 140 141 /** 142 * Retrieves the document class configured on the document entry associated with the 143 * given document type name 144 * 145 * @param documentTypeName - document type name to retrieve class for 146 * @return Class<?> document class associated with document type name 147 */ 148 public Class<?> getDocumentClassByName(String documentTypeName); 149 150 /** 151 * Indicates whether the given data object class is configured to allow record deletions 152 * 153 * @param dataObjectClass - class for the data object to check 154 * @return Boolean true if record deletion is allowed, false if not allowed, null if not configured 155 */ 156 public Boolean getAllowsRecordDeletion(Class dataObjectClass); 157 158 /** 159 * Indicates whether the given maintenance document is configured to allow record deletions 160 * 161 * @param document - maintenance document instance to check 162 * @return Boolean true if record deletion is allowed, false if not allowed, null if not configured 163 */ 164 public Boolean getAllowsRecordDeletion(MaintenanceDocument document); 165 166 /** 167 * Retrieves the list of property names that are configured as locking keys for the maintenance 168 * document entry associated with the given document type name 169 * 170 * @param docTypeName - document type name to retrieve maintenance document entry for 171 * @return List<String> list of locking key property names 172 */ 173 public List<String> getLockingKeys(String docTypeName); 174 175 /** 176 * Indicates whether the configured locking keys for a class should be cleared on a maintenance 177 * copy action or values carried forward 178 * 179 * @param dataObjectClass - class for the data object to check 180 * @return boolean true if locking keys should be copied, false if they should be cleared 181 */ 182 public boolean getPreserveLockingKeysOnCopy(Class dataObjectClass); 183 184 /** 185 * Retrieves the {@link DocumentAuthorizer} configured on the document entry with the given document type 186 * name 187 * 188 * @param documentType - document type name to retrieve document entry and associated authorizer for 189 * @return DocumentAuthorizer authorizer instance 190 */ 191 public DocumentAuthorizer getDocumentAuthorizer(String documentType); 192 193 /** 194 * Retrieves the {@link DocumentAuthorizer} configured on the document entry for the document type associated 195 * with the document instance 196 * 197 * @param document - document instance to retrieve document entry and associated authorizer for 198 * @return DocumentAuthorizer authorizer instance 199 */ 200 public DocumentAuthorizer getDocumentAuthorizer(Document document); 201 202 /** 203 * Retrieves the {@link DocumentPresentationController} configured on the document entry with the given document 204 * type name 205 * 206 * @param documentType - document type name to retrieve document entry and associated presentation controller for 207 * @return DocumentPresentationController instance 208 */ 209 public DocumentPresentationController getDocumentPresentationController(String documentType); 210 211 /** 212 * Retrieves the {@link DocumentPresentationController} configured on the document entry for the document type 213 * associated with the document instance 214 * 215 * @param document - document instance to retrieve document entry and associated presentation controller for 216 * @return DocumentPresentationController instance 217 */ 218 public DocumentPresentationController getDocumentPresentationController(Document document); 219 }