1 /*
2 * Copyright 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/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.rice.kew.api.document;
17
18 import org.kuali.rice.core.api.exception.RiceIllegalArgumentException;
19 import org.kuali.rice.kew.api.action.ActionRequest;
20 import org.kuali.rice.kew.api.action.ActionTaken;
21
22 import javax.jws.WebParam;
23 import java.util.List;
24
25 /**
26 * TODO ... annotate for JAX-WS!
27 *
28 * @author Kuali Rice Team (rice.collab@kuali.org)
29 */
30 public interface WorkflowDocumentService {
31
32 Document getDocument(String documentId);
33
34 boolean doesDocumentExist(String documentId);
35
36 DocumentContent getDocumentContent(String documentId);
37
38 List<ActionRequest> getRootActionRequests(@WebParam(name = "documentId") String documentId);
39
40 public List<ActionRequest> getActionRequests(String documentId, String nodeName, String principalId);
41
42 List<ActionTaken> getActionsTaken(@WebParam(name = "documentId") String documentId);
43
44 // public DocumentDetailDTO getDocumentDetailFromAppId(String documentTypeName, String appId) throws WorkflowException;
45 //
46 // public RouteHeaderDTO getRouteHeaderWithPrincipal(
47 // @WebParam(name = "principalId") String principalId,
48 // @WebParam(name = "documentId") String documentId)
49 // throws WorkflowException;
50 //
51 // public RouteHeaderDTO getRouteHeader(
52 // @WebParam(name = "documentId") String documentId)
53 // throws WorkflowException;
54 //
55
56 public DocumentDetail getDocumentDetail(@WebParam(name = "documentId") String documentId);
57
58 // public RouteNodeInstanceDTO getNodeInstance(
59 // @WebParam(name = "nodeInstanceId") Long nodeInstanceId)
60 // throws WorkflowException;
61 //
62 // public Long getNewResponsibilityId() throws WorkflowException;
63 //
64 //
65 // public ActionRequestDTO[] getActionRequests(
66 // @WebParam(name = "documentId") String documentId,
67 // @WebParam(name = "nodeName") String nodeName,
68 // @WebParam(name = "principalId") String principalId)
69 // throws WorkflowException;
70 //
71 // public String getAppDocId(
72 // @WebParam(name = "documentId") String documentId);
73 //
74 //
75 // public DocumentSearchResultDTO performDocumentSearch(
76 // @WebParam(name = "criteriaVO") DocumentSearchCriteriaDTO criteriaVO)
77 // throws WorkflowException;
78 //
79 // public DocumentSearchResultDTO performDocumentSearchWithPrincipal(
80 // @WebParam(name = "principalId") String principalId,
81 // @WebParam(name = "criteriaVO") DocumentSearchCriteriaDTO criteriaVO)
82 // throws WorkflowException;
83 //
84 // public RouteNodeInstanceDTO[] getDocumentRouteNodeInstances(
85 // @WebParam(name = "documentId") String documentId)
86 // throws WorkflowException;
87
88 public List<RouteNodeInstance> getRouteNodeInstances(String documentId);
89
90 public List<RouteNodeInstance> getActiveRouteNodeInstances(
91 @WebParam(name = "documentId") String documentId);
92
93 // public RouteNodeInstanceDTO[] getTerminalNodeInstances(
94 // @WebParam(name = "documentId") String documentId)
95 // throws WorkflowException;
96 //
97 // public DocumentContentDTO getDocumentContent(
98 // @WebParam(name = "documentId") String documentId)
99 // throws WorkflowException;
100
101 public List<String> getPreviousRouteNodeNames(@WebParam(name = "documentId") String documentId);
102
103
104 // public String getDocumentStatus(
105 // @WebParam(name = "documentId") String documentId)
106 // throws WorkflowException;
107 //
108 // public RouteNodeInstanceDTO[] getCurrentNodeInstances(
109 // @WebParam(name = "documentId") String documentId)
110 // throws WorkflowException;
111 //
112 // public String[] getPrincipalIdsWithPendingActionRequestByActionRequestedAndDocId(
113 // @WebParam(name = "actionRequestedCd") String actionRequestedCd,
114 // @WebParam(name = "documentId") String documentId)
115 // throws WorkflowException;
116 //
117 //
118 // public String getDocumentInitiatorPrincipalId(
119 // @WebParam(name = "documentId") String documentId)
120 // throws WorkflowException;
121 //
122 // /**
123 // * Returns the principal ID of the user who routed the given document.
124 // * <b>null</b> if the document can not be found.
125 // *
126 // * @throws WorkflowException
127 // */
128 // public String getDocumentRoutedByPrincipalId(
129 // @WebParam(name = "documentId") String documentId)
130 // throws WorkflowException;
131 //
132 // @XmlJavaTypeAdapter(value = MapStringStringAdapter.class)
133 // public Map<String, String> getActionsRequested(
134 // @WebParam(name = "principalId") String principalId,
135 // @WebParam(name = "documentId") String documentId);
136 //
137 // /**
138 // *
139 // * This method does a direct search for the searchableAttribute without
140 // * going through the doc search.
141 // *
142 // * @param documentId
143 // * @param key
144 // * @return
145 // */
146 // public String[] getSearchableAttributeStringValuesByKey(
147 // @WebParam(name = "documentId") String documentId,
148 // @WebParam(name = "key") String key);
149 //
150 // /**
151 // *
152 // * This method does a direct search for the searchableAttribute without
153 // * going through the doc search.
154 // *
155 // * @param documentId
156 // * @param key
157 // * @return
158 // */
159 // @XmlJavaTypeAdapter(value = SqlTimestampAdapter.class)
160 // public Timestamp[] getSearchableAttributeDateTimeValuesByKey(
161 // @WebParam(name = "documentId") String documentId,
162 // @WebParam(name = "key") String key);
163 //
164 // /**
165 // *
166 // * This method does a direct search for the searchableAttribute without
167 // * going through the doc search.
168 // *
169 // * @param documentId
170 // * @param key
171 // * @return
172 // */
173 // public BigDecimal[] getSearchableAttributeFloatValuesByKey(
174 // @WebParam(name = "documentId") String documentId,
175 // @WebParam(name = "key") String key);
176 //
177 // /**
178 // *
179 // * This method does a direct search for the searchableAttribute without
180 // * going through the doc search.
181 // *
182 // * @param documentId
183 // * @param key
184 // * @return
185 // */
186 // public Long[] getSearchableAttributeLongValuesByKey(
187 // @WebParam(name = "documentId") String documentId,
188 // @WebParam(name = "key") String key);
189 //
190 // public String getFutureRequestsKey(
191 // @WebParam(name = "principalId") String principalId);
192 //
193 // public String getReceiveFutureRequestsValue();
194 //
195 // public String getDoNotReceiveFutureRequestsValue();
196 //
197 // public String getClearFutureRequestsValue();
198 //
199 // public DocumentStatusTransitionDTO[] getDocumentStatusTransitionHistory(
200 // @WebParam(name = "documentId") String documentId)
201 // throws WorkflowException;
202 //
203
204 /**
205 * TODO - document that this "ignores" the request to create the link if it already exists,
206 * returning the existing link if there is one
207 *
208 * TODO - also document that this method actually creates two links in the db, one from the document being
209 * linked to the target and vice-versa
210 */
211 DocumentLink addDocumentLink(DocumentLink documentLink) throws RiceIllegalArgumentException;
212
213 DocumentLink deleteDocumentLink(String documentLinkId) throws RiceIllegalArgumentException;
214
215 List<DocumentLink> deleteDocumentLinksByDocumentId(String originatingDocumentId) throws RiceIllegalArgumentException;
216
217 List<DocumentLink> getOutgoingDocumentLinks(String originatingDocumentId) throws RiceIllegalArgumentException;
218
219 List<DocumentLink> getIncomingDocumentLinks(String originatingDocumentId) throws RiceIllegalArgumentException;
220
221 DocumentLink getDocumentLink(String documentLinkId) throws RiceIllegalArgumentException;
222
223 }