1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api; |
17 | |
|
18 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
19 | |
import org.kuali.rice.kew.api.responsibility.ResponsibilityChangeQueue; |
20 | |
import org.kuali.rice.kew.api.action.WorkflowDocumentActionsService; |
21 | |
import org.kuali.rice.kew.api.actionlist.ActionListService; |
22 | |
import org.kuali.rice.kew.api.doctype.DocumentTypeService; |
23 | |
import org.kuali.rice.kew.api.document.WorkflowDocumentService; |
24 | |
import org.kuali.rice.kew.api.document.attribute.DocumentAttributeIndexingQueue; |
25 | |
import org.kuali.rice.kew.api.extension.ExtensionRepositoryService; |
26 | |
import org.kuali.rice.kew.api.group.GroupMembershipChangeQueue; |
27 | |
import org.kuali.rice.kew.api.mail.ImmediateEmailReminderQueue; |
28 | |
import org.kuali.rice.kew.api.note.NoteService; |
29 | |
import org.kuali.rice.kew.api.peopleflow.PeopleFlowService; |
30 | |
import org.kuali.rice.kew.api.preferences.PreferencesService; |
31 | |
import org.kuali.rice.kew.api.repository.type.KewTypeRepositoryService; |
32 | |
import org.kuali.rice.kew.api.rule.RuleService; |
33 | |
import org.kuali.rice.ksb.api.KsbApiServiceLocator; |
34 | |
|
35 | |
import javax.xml.namespace.QName; |
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | 0 | public class KewApiServiceLocator { |
42 | |
|
43 | |
|
44 | |
public static final String WORKFLOW_DOCUMENT_ACTIONS_SERVICE = "rice.kew.workflowDocumentActionsService"; |
45 | |
public static final String WORKFLOW_DOCUMENT_SERVICE = "rice.kew.workflowDocumentService"; |
46 | |
public static final String ACTION_LIST_SERVICE = "rice.kew.actionListService"; |
47 | |
public static final String DOCUMENT_TYPE_SERVICE = "rice.kew.documentTypeService"; |
48 | |
public static final String NOTE_SERVICE = "rice.kew.noteService"; |
49 | |
public static final String EXTENSION_REPOSITORY_SERVICE = "rice.kew.extensionRepositoryService"; |
50 | |
public static final String RULE_SERVICE = "rice.kew.ruleService"; |
51 | |
public static final String KEW_TYPE_REPOSITORY_SERVICE = "rice.kew.kewTypeRepositoryService"; |
52 | |
public static final String PEOPLE_FLOW_SERVICE = "rice.kew.peopleFlowService"; |
53 | |
public static final String PREFERENCES_SERVICE = "rice.kew.preferencesService"; |
54 | |
|
55 | 0 | public static final QName DOCUMENT_ATTRIBUTE_INDEXING_QUEUE_NAME = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0, "documentAttributeIndexingQueue"); |
56 | 0 | public static final QName GROUP_MEMBERSHIP_CHANGE_QUEUE_NAME = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0, "groupMembershipChangeQueue"); |
57 | 0 | public static final QName IMMEDIATE_EMAIL_REMINDER_QUEUE = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0, "immediateEmailReminderQueue"); |
58 | 0 | public static final QName RESPONSIBILITY_CHANGE_QUEUE = new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0, "responsibilityChangeQueue"); |
59 | |
|
60 | |
static <T> T getService(String serviceName) { |
61 | 0 | return GlobalResourceLoader.<T>getService(serviceName); |
62 | |
} |
63 | |
|
64 | |
public static WorkflowDocumentActionsService getWorkflowDocumentActionsService() { |
65 | 0 | return getService(WORKFLOW_DOCUMENT_ACTIONS_SERVICE); |
66 | |
} |
67 | |
|
68 | |
public static WorkflowDocumentService getWorkflowDocumentService() { |
69 | 0 | return getService(WORKFLOW_DOCUMENT_SERVICE); |
70 | |
} |
71 | |
|
72 | |
public static ActionListService getActionListService() { |
73 | 0 | return getService(ACTION_LIST_SERVICE); |
74 | |
} |
75 | |
|
76 | |
public static DocumentTypeService getDocumentTypeService() { |
77 | 0 | return getService(DOCUMENT_TYPE_SERVICE); |
78 | |
} |
79 | |
|
80 | |
public static NoteService getNoteService() { |
81 | 0 | return getService(NOTE_SERVICE); |
82 | |
} |
83 | |
|
84 | |
public static RuleService getRuleService() { |
85 | 0 | return getService(RULE_SERVICE); |
86 | |
} |
87 | |
|
88 | |
public static ExtensionRepositoryService getExtensionRepositoryService() { |
89 | 0 | return getService(EXTENSION_REPOSITORY_SERVICE); |
90 | |
} |
91 | |
|
92 | |
public static KewTypeRepositoryService getKewTypeRepositoryService() { |
93 | 0 | return getService(KEW_TYPE_REPOSITORY_SERVICE); |
94 | |
} |
95 | |
|
96 | |
public static PeopleFlowService getPeopleFlowService() { |
97 | 0 | return getService(PEOPLE_FLOW_SERVICE); |
98 | |
} |
99 | |
|
100 | |
public static DocumentAttributeIndexingQueue getDocumentAttributeIndexingQueue() { |
101 | 0 | return getDocumentAttributeIndexingQueue(null); |
102 | |
} |
103 | |
|
104 | |
public static DocumentAttributeIndexingQueue getDocumentAttributeIndexingQueue(String applicationId) { |
105 | 0 | return (DocumentAttributeIndexingQueue)KsbApiServiceLocator.getMessageHelper().getServiceAsynchronously(DOCUMENT_ATTRIBUTE_INDEXING_QUEUE_NAME, applicationId); |
106 | |
} |
107 | |
|
108 | |
public static GroupMembershipChangeQueue getGroupMembershipChangeQueue() { |
109 | 0 | return (GroupMembershipChangeQueue)KsbApiServiceLocator.getMessageHelper().getServiceAsynchronously(GROUP_MEMBERSHIP_CHANGE_QUEUE_NAME); |
110 | |
} |
111 | |
|
112 | |
public static ResponsibilityChangeQueue getResponsibilityChangeQueue() { |
113 | 0 | return (ResponsibilityChangeQueue)KsbApiServiceLocator.getMessageHelper().getServiceAsynchronously( |
114 | |
RESPONSIBILITY_CHANGE_QUEUE); |
115 | |
} |
116 | |
|
117 | |
public static ImmediateEmailReminderQueue getImmediateEmailReminderQueue() { |
118 | 0 | return KsbApiServiceLocator.getMessageHelper().getServiceAsynchronously(IMMEDIATE_EMAIL_REMINDER_QUEUE); |
119 | |
} |
120 | |
|
121 | |
public static PreferencesService getPreferencesService() { |
122 | 0 | return getService(PREFERENCES_SERVICE); |
123 | |
} |
124 | |
} |