1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
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.core.document.dto.DocumentCategoryInfo; |
30 | |
import org.kuali.student.r2.core.document.dto.DocumentInfo; |
31 | |
import org.kuali.student.r2.core.document.dto.RefDocRelationInfo; |
32 | |
|
33 | |
import javax.jws.WebParam; |
34 | |
import java.util.List; |
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | 0 | public class DocumentServiceDecorator implements DocumentService { |
44 | |
|
45 | |
private DocumentService nextDecorator; |
46 | |
|
47 | |
public DocumentService getNextDecorator() throws OperationFailedException { |
48 | 0 | if (null == nextDecorator) { |
49 | 0 | throw new OperationFailedException("Misconfigured application: nextDecorator is null"); |
50 | |
} |
51 | 0 | return nextDecorator; |
52 | |
} |
53 | |
|
54 | |
public void setNextDecorator(DocumentService nextDecorator) { |
55 | 0 | this.nextDecorator = nextDecorator; |
56 | 0 | } |
57 | |
|
58 | |
@Override |
59 | |
public DocumentInfo getDocument(@WebParam(name = "documentId") String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
60 | 0 | return getNextDecorator().getDocument(documentId, contextInfo); |
61 | |
} |
62 | |
|
63 | |
@Override |
64 | |
public List<DocumentInfo> getDocumentsByIds(@WebParam(name = "documentIds") List<String> documentIds, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
65 | 0 | return getNextDecorator().getDocumentsByIds(documentIds, contextInfo); |
66 | |
} |
67 | |
|
68 | |
@Override |
69 | |
public List<ValidationResultInfo> validateDocument(@WebParam(name = "validationTypeKey") String validationTypeKey, @WebParam(name = "documentInfo") DocumentInfo documentInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
70 | 0 | return getNextDecorator().validateDocument(validationTypeKey, documentInfo, contextInfo); |
71 | |
} |
72 | |
|
73 | |
@Override |
74 | |
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 { |
75 | 0 | return getNextDecorator().createDocument(documentTypeKey, documentCategoryKey, documentInfo, contextInfo); |
76 | |
} |
77 | |
|
78 | |
@Override |
79 | |
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 { |
80 | 0 | return getNextDecorator().updateDocument(documentId, documentInfo, contextInfo); |
81 | |
} |
82 | |
|
83 | |
@Override |
84 | |
public StatusInfo deleteDocument(@WebParam(name = "documentId") String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
85 | 0 | return getNextDecorator().deleteDocument(documentId, contextInfo); |
86 | |
} |
87 | |
|
88 | |
@Override |
89 | |
public DocumentCategoryInfo getDocumentCategory(@WebParam(name = "documentCategoryKey") String documentCategoryKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
90 | 0 | return getNextDecorator().getDocumentCategory(documentCategoryKey, contextInfo); |
91 | |
} |
92 | |
|
93 | |
@Override |
94 | |
public List<DocumentCategoryInfo> getDocumentCategories(@WebParam(name = "contextInfo") ContextInfo contextInfo) throws OperationFailedException { |
95 | 0 | return getNextDecorator().getDocumentCategories(contextInfo); |
96 | |
} |
97 | |
|
98 | |
@Override |
99 | |
public List<DocumentCategoryInfo> getDocumentCategoriesByDocumentId(@WebParam(name = "documentId") String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
100 | 0 | return getNextDecorator().getDocumentCategoriesByDocumentId(documentId, contextInfo); |
101 | |
} |
102 | |
|
103 | |
@Override |
104 | |
public StatusInfo removeDocumentCategoryFromDocument(@WebParam(name = "documentId") String documentId, @WebParam(name = "documentCategoryKey") String documentCategoryKey, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
105 | 0 | return getNextDecorator().removeDocumentCategoryFromDocument(documentId, documentCategoryKey, contextInfo); |
106 | |
} |
107 | |
|
108 | |
@Override |
109 | |
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 { |
110 | 0 | return getNextDecorator().addDocumentCategoryToDocument(documentId, documentCategoryKey, contextInfo); |
111 | |
} |
112 | |
|
113 | |
@Override |
114 | |
public RefDocRelationInfo getRefDocRelation(@WebParam(name = "refDocRelationId") String refDocRelationId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
115 | 0 | return getNextDecorator().getRefDocRelation(refDocRelationId, contextInfo); |
116 | |
} |
117 | |
|
118 | |
@Override |
119 | |
public List<RefDocRelationInfo> getRefDocRelationsByDocument(@WebParam(name = "documentId") String documentId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
120 | 0 | return getNextDecorator().getRefDocRelationsByDocument(documentId, contextInfo); |
121 | |
} |
122 | |
|
123 | |
@Override |
124 | |
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 { |
125 | 0 | return getNextDecorator().getRefDocRelationsByRef(refObjectTypeKey, refObjectId, contextInfo); |
126 | |
} |
127 | |
|
128 | |
@Override |
129 | |
public List<ValidationResultInfo> validateRefDocRelation(@WebParam(name = "validationTypeKey") String validationTypeKey, @WebParam(name = "refDocRelationInfo") RefDocRelationInfo refDocRelationInfo, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException { |
130 | 0 | return getNextDecorator().validateRefDocRelation(validationTypeKey, refDocRelationInfo, contextInfo); |
131 | |
} |
132 | |
|
133 | |
@Override |
134 | |
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 { |
135 | 0 | return getNextDecorator().createRefDocRelation(refObjectTypeKey, refObjectId, documentId, refDocRelationTypeKey, refDocRelationInfo, contextInfo); |
136 | |
} |
137 | |
|
138 | |
@Override |
139 | |
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 { |
140 | 0 | return getNextDecorator().updateRefDocRelation(refDocRelationId, refDocRelationInfo, contextInfo); |
141 | |
} |
142 | |
|
143 | |
@Override |
144 | |
public StatusInfo deleteRefDocRelation(@WebParam(name = "refDocRelationId") String refDocRelationId, @WebParam(name = "contextInfo") ContextInfo contextInfo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException { |
145 | 0 | return getNextDecorator().deleteRefDocRelation(refDocRelationId, contextInfo); |
146 | |
} |
147 | |
|
148 | |
} |