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