Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
DocumentService |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2009 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 1.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/ecl1.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.student.r2.core.document.service; | |
17 | ||
18 | import org.kuali.student.r2.common.dto.ContextInfo; | |
19 | import org.kuali.student.r2.common.dto.StatusInfo; | |
20 | import org.kuali.student.r2.common.dto.ValidationResultInfo; | |
21 | import org.kuali.student.r2.common.exceptions.DataValidationErrorException; | |
22 | import org.kuali.student.r2.common.exceptions.DoesNotExistException; | |
23 | import org.kuali.student.r2.common.exceptions.InvalidParameterException; | |
24 | import org.kuali.student.r2.common.exceptions.MissingParameterException; | |
25 | import org.kuali.student.r2.common.exceptions.OperationFailedException; | |
26 | import org.kuali.student.r2.common.exceptions.PermissionDeniedException; | |
27 | import org.kuali.student.r2.common.exceptions.ReadOnlyException; | |
28 | import org.kuali.student.r2.common.exceptions.VersionMismatchException; | |
29 | import org.kuali.student.r2.common.util.constants.DocumentServiceConstants; | |
30 | ||
31 | import org.kuali.student.r2.core.document.dto.DocumentCategoryInfo; | |
32 | import org.kuali.student.r2.core.document.dto.DocumentInfo; | |
33 | import org.kuali.student.r2.core.document.dto.RefDocRelationInfo; | |
34 | ||
35 | import javax.jws.WebParam; | |
36 | import javax.jws.WebService; | |
37 | import javax.jws.soap.SOAPBinding; | |
38 | import java.util.List; | |
39 | ||
40 | /** | |
41 | * | |
42 | * The Document Service supports the management of document objects. Relations | |
43 | * between stored documents and external entities are managed through | |
44 | * | |
45 | * the respective entity service. | |
46 | * | |
47 | * @Version 2.0 | |
48 | * @Author tom | |
49 | * @Author Sri komandur@uw.edu | |
50 | * | |
51 | */ | |
52 | @WebService(name = "DocumentService", targetNamespace = DocumentServiceConstants.NAMESPACE) | |
53 | @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) | |
54 | public interface DocumentService { | |
55 | ||
56 | /** | |
57 | * Retrieves information about a document | |
58 | * | |
59 | * @param documentId identifier of the document | |
60 | * @param contextInfo Context information containing the principalId and locale | |
61 | * information about the caller of service operation | |
62 | * @return information about a document | |
63 | * @throws DoesNotExistException documentId not found | |
64 | * @throws InvalidParameterException invalid documentId, contextInfo | |
65 | * @throws MissingParameterException documentId, contextInfo not specified | |
66 | * @throws OperationFailedException unable to complete request | |
67 | * @throws PermissionDeniedException authorization failure | |
68 | */ | |
69 | public DocumentInfo getDocument(@WebParam(name="documentId")String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
70 | ||
71 | /** | |
72 | * Retrieves information about documents from a list of identifiers | |
73 | * | |
74 | * @param documentIds list of document identifiers | |
75 | * @param contextInfo Context information containing the principalId and locale | |
76 | * information about the caller of service operation | |
77 | * @return list of document information | |
78 | * @throws DoesNotExistException one of more documentIds not found | |
79 | * @throws InvalidParameterException invalid documentIds, contextInfo | |
80 | * @throws MissingParameterException documentIds, contextInfo not specified | |
81 | * @throws OperationFailedException unable to complete request | |
82 | * @throws PermissionDeniedException authorization failure | |
83 | */ | |
84 | public List<DocumentInfo> getDocumentsByIds(@WebParam(name="documentIds")List<String> documentIds, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
85 | ||
86 | /** | |
87 | * Validates a document. Depending on the value of validationType, | |
88 | * this validation could be limited to tests on just the current object | |
89 | * and its directly contained sub-objects or expanded to perform all | |
90 | * tests related to this object. If an identifier is present for the | |
91 | * document (and/or one of its contained sub-objects) and a record is found | |
92 | * for that identifier, the validation checks if the document can be shifted | |
93 | * to the new values. If an identifier is not present or a record cannot | |
94 | * be found for the identifier, it is assumed that the record does not exist | |
95 | * and as such, the checks performed will be much shallower, typically | |
96 | * mimicking those performed by setting the validationType to the current | |
97 | * object. | |
98 | * | |
99 | * @param validationTypeKey identifier of the extent of validation | |
100 | * @param documentInfo document information to be tested. | |
101 | * @param contextInfo Context information containing the principalId and locale | |
102 | * information about the caller of service operation | |
103 | * @return results from performing the validation | |
104 | * @throws DoesNotExistException validationTypeKey not found | |
105 | * @throws InvalidParameterException invalid validationTypeKey, documentInfo, contextInfo | |
106 | * @throws MissingParameterException validationTypeKey, documentInfo, contextInfo not specified | |
107 | * @throws OperationFailedException unable to complete request | |
108 | */ | |
109 | public List<ValidationResultInfo> validateDocument(@WebParam(name="validationTypeKey")String validationTypeKey, @WebParam(name="documentInfo")DocumentInfo documentInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
110 | ||
111 | /** | |
112 | * Creates a new document | |
113 | * | |
114 | * @param documentTypeKey identifier of the document type | |
115 | * @param documentCategoryKey identifier of the document category | |
116 | * @param documentInfo detailed information on the document | |
117 | * @param contextInfo Context information containing the principalId and | |
118 | * locale information about the caller of service | |
119 | * operation | |
120 | * @return detailed information on the document created | |
121 | * @throws DataValidationErrorException One or more values invalid for this operation | |
122 | * @throws DoesNotExistException Id or Key does not exist | |
123 | * @throws InvalidParameterException invalid documentTypeKey, documentCategoryKey, documentInfo, contextInfo | |
124 | * @throws MissingParameterException documentTypeKey, documentCategoryKey, documentInfo, contextInfo not specified | |
125 | * @throws OperationFailedException unable to complete request | |
126 | * @throws PermissionDeniedException authorization failure | |
127 | * @throws ReadOnlyException attempted update of readonly data | |
128 | */ | |
129 | public DocumentInfo createDocument(@WebParam(name="documentTypeKey")String documentTypeKey, @WebParam(name="documentCategoryKey")String documentCategoryKey, @WebParam(name="documentInfo")DocumentInfo documentInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException; | |
130 | ||
131 | /** | |
132 | * Updates an existing document | |
133 | * | |
134 | * @param documentId identifier of the document to update | |
135 | * @param documentInfo updated information for the document | |
136 | * @param contextInfo Context information containing the principalId and locale | |
137 | * information about the caller of service operation | |
138 | * @return updated information on the document | |
139 | * @throws DataValidationErrorException One or more values invalid for this operation | |
140 | * @throws DoesNotExistException Document being updated does not exist | |
141 | * @throws InvalidParameterException invalid documentId, documentInfo, contextInfo | |
142 | * @throws MissingParameterException documentId, documentInfo, contextInfo not specified | |
143 | * @throws OperationFailedException unable to complete request | |
144 | * @throws PermissionDeniedException authorization failure | |
145 | * @throws ReadOnlyException attempted update of readonly data | |
146 | * @throws VersionMismatchException The action was attempted on an out of date version. | |
147 | */ | |
148 | public DocumentInfo updateDocument(@WebParam(name="documentId")String documentId, @WebParam(name="documentInfo")DocumentInfo documentInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException, VersionMismatchException; | |
149 | ||
150 | /** | |
151 | * Deletes an existing document | |
152 | * | |
153 | * @param documentId identifier of the document to delete | |
154 | * @param contextInfo Context information containing the principalId and locale | |
155 | * information about the caller of service operation | |
156 | * @return status of the operation (success, failed) | |
157 | * @throws DoesNotExistException Document to delete does not exist | |
158 | * @throws InvalidParameterException invalid documentId, contextInfo | |
159 | * @throws MissingParameterException documentId, contextInfo not specified | |
160 | * @throws OperationFailedException unable to complete request | |
161 | * @throws PermissionDeniedException authorization failure | |
162 | */ | |
163 | public StatusInfo deleteDocument(@WebParam(name="documentId")String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
164 | ||
165 | /** | |
166 | * Retrieves information about a particular document category | |
167 | * | |
168 | * @param documentCategoryKey document category identifier | |
169 | * @param contextInfo Context information containing the principalId and locale | |
170 | * information about the caller of service operation | |
171 | * @return document category information | |
172 | * @throws DoesNotExistException specified documentCategoryKey not found | |
173 | * @throws InvalidParameterException invalid documentCategoryKey, contextInfo | |
174 | * @throws MissingParameterException documentCategoryKey, contextInfo not specified | |
175 | * @throws OperationFailedException unable to complete request | |
176 | * | |
177 | */ | |
178 | public DocumentCategoryInfo getDocumentCategory(@WebParam(name="documentCategoryKey")String documentCategoryKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
179 | ||
180 | /** | |
181 | * Retrieves the list of document categories known by this service | |
182 | * | |
183 | * @param contextInfo Context information containing the principalId and locale | |
184 | * information about the caller of service operation | |
185 | * @return list of document category information | |
186 | * @throws MissingParameterException contextInfo not specified | |
187 | * @throws OperationFailedException unable to complete request | |
188 | * | |
189 | */ | |
190 | public List<DocumentCategoryInfo> getDocumentCategories(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws OperationFailedException; | |
191 | ||
192 | /** | |
193 | * Retrieves category information for a document | |
194 | * | |
195 | * @param documentId identifier of the document | |
196 | * @param contextInfo Context information containing the principalId and locale | |
197 | * information about the caller of service operation | |
198 | * @return list of document category information | |
199 | * @throws DoesNotExistException documentId not found | |
200 | * @throws InvalidParameterException invalid documentId, contextInfo | |
201 | * @throws MissingParameterException documentId, contextInfo not specified | |
202 | * @throws OperationFailedException unable to complete request | |
203 | * @throws PermissionDeniedException authorization failure | |
204 | */ | |
205 | public List<DocumentCategoryInfo> getDocumentCategoriesByDocumentId(@WebParam(name = "documentId") String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
206 | ||
207 | /** | |
208 | * Removes an existing category from a document | |
209 | * | |
210 | * @param documentId identifier of the document | |
211 | * @param documentCategoryKey identifier of the document category | |
212 | * @param contextInfo Context information containing the principalId and locale | |
213 | * information about the caller of service operation | |
214 | * @return status of the operation (success, failed) | |
215 | * @throws DoesNotExistException documentId, documentCategoryKey does not exist | |
216 | * @throws InvalidParameterException invalid documentId, documentCategoryKey, contextInfo | |
217 | * @throws MissingParameterException documentId, documentCategoryKey, contextInfo not specified | |
218 | * @throws OperationFailedException unable to complete request | |
219 | * @throws PermissionDeniedException authorization failure | |
220 | */ | |
221 | public StatusInfo removeDocumentCategoryFromDocument(@WebParam(name="documentId")String documentId, @WebParam(name="documentCategoryKey")String documentCategoryKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
222 | ||
223 | /** | |
224 | * Adds an existing document category to a document | |
225 | * | |
226 | * @param documentId identifier of the document | |
227 | * @param documentCategoryKey identifier of the document category | |
228 | * @param contextInfo Context information containing the principalId and locale | |
229 | * information about the caller of service operation | |
230 | * @return status of the operation (success, failed) | |
231 | * @throws DataValidationErrorException One or more values invalid for this operation | |
232 | * @throws DoesNotExistException documentId, documentCategoryKey does not exist | |
233 | * @throws InvalidParameterException invalid documentId, documentCategoryKey, contextInfo | |
234 | * @throws MissingParameterException documentId, documentCategoryKey, contextInfo not specified | |
235 | * @throws OperationFailedException unable to complete request | |
236 | * @throws PermissionDeniedException authorization failure | |
237 | * @throws VersionMismatchException action was attempted on an out of date version | |
238 | */ | |
239 | public StatusInfo addDocumentCategoryToDocument(@WebParam(name="documentId")String documentId, @WebParam(name="documentCategoryKey")String documentCategoryKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException; | |
240 | ||
241 | /** | |
242 | * Retrieves information about a relationship between a reference | |
243 | * and document | |
244 | * | |
245 | * @param refDocRelationId reference document relationship identifier | |
246 | * @param contextInfo Context information containing the principalId and locale | |
247 | * information about the caller of service operation | |
248 | * @return information about a relationship between a reference and a document | |
249 | * @throws DoesNotExistException specified relationship not found | |
250 | * @throws InvalidParameterException invalid refDocRelationId, contextInfo | |
251 | * @throws MissingParameterException refDocRelationId, contextInfo not specified | |
252 | * @throws OperationFailedException unable to complete request | |
253 | * @throws PermissionDeniedException authorization failure | |
254 | */ | |
255 | public RefDocRelationInfo getRefDocRelation(@WebParam(name="refDocRelationId")String refDocRelationId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
256 | ||
257 | /** | |
258 | * Retrieves information about reference document relationships | |
259 | * for a particular document | |
260 | * | |
261 | * @param documentId document identifier | |
262 | * @param contextInfo Context information containing the principalId and locale | |
263 | * information about the caller of service operation | |
264 | * @return list of reference document relationships | |
265 | * @throws DoesNotExistException specified document not found | |
266 | * @throws InvalidParameterException invalid documentId, contextInfo | |
267 | * @throws MissingParameterException documentId, contextInfo not specified | |
268 | * @throws OperationFailedException unable to complete request | |
269 | * @throws PermissionDeniedException authorization failure | |
270 | */ | |
271 | public List<RefDocRelationInfo> getRefDocRelationsByDocument(@WebParam(name = "documentId") String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
272 | ||
273 | /** | |
274 | * Retrieves information about reference document relationships for a | |
275 | * particular reference | |
276 | * | |
277 | * @param refObjectTypeKey reference type | |
278 | * @param refObjectId reference identifier | |
279 | * @param contextInfo Context information containing the principalId and locale | |
280 | * information about the caller of service operation | |
281 | * @return list of reference document relationships | |
282 | * @throws DoesNotExistException specified refId, refObjectTypeKey not found | |
283 | * @throws InvalidParameterException invalid refId, refObjectTypeKey, contextInfo | |
284 | * @throws MissingParameterException refId, refObjectTypeKey, contextInfo not specified | |
285 | * @throws OperationFailedException unable to complete request | |
286 | * @throws PermissionDeniedException authorization failure | |
287 | */ | |
288 | public List<RefDocRelationInfo> getRefDocRelationsByRef(@WebParam(name="refObjectTypeKey")String refObjectTypeKey, @WebParam(name="refObjectId")String refObjectId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
289 | ||
290 | /** | |
291 | * Validates a reference document relationship. Depending on the | |
292 | * value of validationType, this validation could be limited to tests on | |
293 | * just the current object and its directly contained sub-objects or | |
294 | * expanded to perform all tests related to this object. If an identifier | |
295 | * is present for the comment (and/or one of its contained sub-objects) | |
296 | * and a record is found for that identifier, the validation checks if the | |
297 | * comment can be shifted to the new values. If an identifier is not present | |
298 | * or a record cannot be found for the identifier, it is assumed that the | |
299 | * record does not exist and as such, the checks performed will be much | |
300 | * shallower, typically mimicking those performed by setting the | |
301 | * validationType to the current object. | |
302 | * | |
303 | * @param validationTypeKey identifier of the extent of validation | |
304 | * @param refDocRelationInfo reference document relationship information to be tested | |
305 | * @param contextInfo Context information containing the principalId and locale | |
306 | * information about the caller of service operation | |
307 | * @return results from performing the validation | |
308 | * @throws DoesNotExistException validationTypeKey not found | |
309 | * @throws InvalidParameterException invalid validationTypeKey, refDocRelationInfo, contextInfo | |
310 | * @throws MissingParameterException missing validationTypeKey, refDocRelationInfo, contextInfo | |
311 | * @throws OperationFailedException unable to complete request | |
312 | */ | |
313 | public List<ValidationResultInfo> validateRefDocRelation(@WebParam(name="validationTypeKey")String validationTypeKey, @WebParam(name="refDocRelationInfo")RefDocRelationInfo refDocRelationInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException; | |
314 | ||
315 | /** | |
316 | * Creates a relationship between a reference and a document. | |
317 | * | |
318 | * @param refObjectTypeKey reference type | |
319 | * @param refObjectId identifier of the reference | |
320 | * @param documentId identifier of the document | |
321 | * @param refDocRelationTypeKey type of relationship between reference and document | |
322 | * @param refDocRelationInfo detailed information about the reference/document relationship | |
323 | * @param contextInfo Context information containing the principalId and locale | |
324 | * information about the caller of service operation | |
325 | * @return detailed information about the relationship | |
326 | * @throws DataValidationErrorException One or more values invalid for this operation | |
327 | * @throws DoesNotExistException Id or Key does not exist | |
328 | * @throws InvalidParameterException invalid refObjectTypeKey, refObjectId, documentId, refDocRelationTypeKey, refDocRelationInfo, contextInfo | |
329 | * @throws MissingParameterException refObjectTypeKey, refObjectId, documentId, refDocRelationTypeKey, refDocRelationInfo, contextInfo not specified | |
330 | * @throws OperationFailedException unable to complete request | |
331 | * @throws PermissionDeniedException authorization failure | |
332 | * @throws ReadOnlyException attempted update of readonly data | |
333 | */ | |
334 | public RefDocRelationInfo createRefDocRelation(@WebParam(name="refObjectTypeKey")String refObjectTypeKey, @WebParam(name="refObjectId")String refObjectId, @WebParam(name="documentId")String documentId, @WebParam(name="refDocRelationTypeKey")String refDocRelationTypeKey, @WebParam(name="refDocRelationInfo")RefDocRelationInfo refDocRelationInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException, DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, ReadOnlyException; | |
335 | ||
336 | /** | |
337 | * Updates a relationship between a reference and a document | |
338 | * | |
339 | * @param refDocRelationId identifier of a relationship between a reference and document | |
340 | * @param refDocRelationInfo detailed information about the relationship between a reference and document | |
341 | * @param contextInfo Context information containing the principalId and locale | |
342 | * information about the caller of service operation | |
343 | * @return detailed information about the relationship between a reference and document | |
344 | * @throws DataValidationErrorException One or more values invalid for this operation | |
345 | * @throws InvalidParameterException invalid refDocRelationId, refDocRelationInfo, contextInfo | |
346 | * @throws MissingParameterException refDocRelationId, refDocRelationInfo, contextInfo not specified | |
347 | * @throws OperationFailedException unable to complete request | |
348 | * @throws PermissionDeniedException authorization failure | |
349 | * @throws VersionMismatchException action was attempted on an out of date version | |
350 | */ | |
351 | public RefDocRelationInfo updateRefDocRelation(@WebParam(name="refDocRelationId")String refDocRelationId, @WebParam(name="refDocRelationInfo")RefDocRelationInfo refDocRelationInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DataValidationErrorException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, VersionMismatchException; | |
352 | ||
353 | /** | |
354 | * Removes a relationship between a reference and a document | |
355 | * | |
356 | * @param refDocRelationId identifier of the relationship between the reference and document | |
357 | * @param contextInfo Context information containing the principalId and locale | |
358 | * information about the caller of service operation | |
359 | * @return status of the operation (success, failed) | |
360 | * @throws DoesNotExistException relationship does not exist | |
361 | * @throws InvalidParameterException invalid refDocRelationId, contextInfo | |
362 | * @throws MissingParameterException refDocRelationId, contextInfo not specified | |
363 | * @throws OperationFailedException unable to complete request | |
364 | * @throws PermissionDeniedException authorization failure | |
365 | */ | |
366 | public StatusInfo deleteRefDocRelation(@WebParam(name="refDocRelationId")String refDocRelationId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException; | |
367 | ||
368 | } |