Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
NotificationWorkflowDocument |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2007 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.ken.document.kew; | |
17 | ||
18 | import org.kuali.rice.ken.util.NotificationConstants; | |
19 | import org.kuali.rice.kew.api.WorkflowDocument; | |
20 | import org.kuali.rice.kew.api.WorkflowDocumentFactory; | |
21 | import org.kuali.rice.kew.exception.WorkflowException; | |
22 | ||
23 | /** | |
24 | * This class extends the KEW WorkflowDocument object and becomes our gateway for get a handle on | |
25 | * KEW documents in workflow. | |
26 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
27 | */ | |
28 | public final class NotificationWorkflowDocument { | |
29 | ||
30 | private static final long serialVersionUID = 6125662798733898964L; | |
31 | ||
32 | /** | |
33 | * Constructs a NotificationWorkflowDocument instance - this essentially creates a new routable | |
34 | * document in KEW for the given user. | |
35 | * @param principalId | |
36 | * @throws WorkflowException | |
37 | */ | |
38 | public static WorkflowDocument createNotificationDocument(String principalId) { | |
39 | 0 | return WorkflowDocumentFactory.createDocument(principalId, |
40 | NotificationConstants.KEW_CONSTANTS.NOTIFICATION_DOC_TYPE, null); | |
41 | } | |
42 | ||
43 | /** | |
44 | * Constructs a NotificationWorkflowDocument instance - this essentially creates a new routable | |
45 | * document in KEW for the given user and document type name. | |
46 | * @param user | |
47 | * @param documentTypeName | |
48 | * @throws WorkflowException | |
49 | */ | |
50 | public static WorkflowDocument createNotificationDocument(String principalId, String documentTypeName) { | |
51 | 0 | return WorkflowDocumentFactory.createDocument(principalId, documentTypeName, null); |
52 | } | |
53 | ||
54 | /** | |
55 | * Constructs a NotificationWorkflowDocument instance - this one is used to get a handle on a | |
56 | * workflow document that was already created in the system. | |
57 | * @param user | |
58 | * @param documentId | |
59 | * @throws WorkflowException | |
60 | */ | |
61 | public static WorkflowDocument loadNotificationDocument(String principalId, String documentId) { | |
62 | 0 | return WorkflowDocumentFactory.loadDocument(principalId, documentId); |
63 | } | |
64 | ||
65 | 0 | private NotificationWorkflowDocument() {} |
66 | ||
67 | } |