1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.rice.kew.framework;
17
18 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
19 import org.kuali.rice.kew.api.KewApiConstants;
20 import org.kuali.rice.kew.framework.actionlist.ActionListCustomizationHandlerService;
21 import org.kuali.rice.kew.framework.actionlist.ActionListCustomizationMediator;
22 import org.kuali.rice.kew.framework.document.search.DocumentSearchCustomizationHandlerService;
23 import org.kuali.rice.kew.framework.document.security.DocumentSecurityHandlerService;
24 import org.kuali.rice.kew.framework.rule.attribute.WorkflowRuleAttributeHandlerService;
25 import org.kuali.rice.kew.framework.validation.RuleValidationAttributeExporterService;
26 import org.kuali.rice.ksb.api.KsbApiServiceLocator;
27
28 import javax.xml.namespace.QName;
29
30
31
32
33 public class KewFrameworkServiceLocator {
34
35 public static final String DOCUMENT_SEARCH_CUSTOMIZATION_HANDLER_SERVICE = "documentSearchCustomizationHandlerService";
36 public static final String DOCUMENT_SECURITY_HANDLER_SERVICE = "documentSecurityHandlerService";
37 public static final String RULE_VALIDATION_ATTRIBUTE_EXPORTER_SERVICE = "ruleValidationAttributeExporterService";
38 public static final String ACTION_LIST_CUSTOMIZATION_MEDIATOR = "rice.kew.actionListCustomizationMediator";
39 public static final String ACTION_LIST_CUSTOMIZATION_HANDLER_SERVICE = "actionListCustomizationHandlerService";
40 public static final String WORKFLOW_RULE_ATTRIBUTE_HANDLER_SERVICE = "workflowRuleAttributeHandlerService";
41
42
43 static <T> T getService(String serviceName) {
44 return GlobalResourceLoader.<T>getService(serviceName);
45 }
46
47 static <T> T getServiceOnBus(String serviceName, String applicationId) {
48 return (T)KsbApiServiceLocator.getServiceBus().getService(new QName(KewApiConstants.Namespaces.KEW_NAMESPACE_2_0, serviceName), applicationId);
49 }
50
51 public static DocumentSearchCustomizationHandlerService getDocumentSearchCustomizationHandlerService(
52 String applicationId) {
53 return getServiceOnBus(DOCUMENT_SEARCH_CUSTOMIZATION_HANDLER_SERVICE, applicationId);
54 }
55
56 public static DocumentSecurityHandlerService getDocumentSecurityHandlerService(
57 String applicationId) {
58 return getServiceOnBus(DOCUMENT_SECURITY_HANDLER_SERVICE, applicationId);
59 }
60
61 public static RuleValidationAttributeExporterService getRuleValidationAttributeExporterService(String applicationId) {
62 return getServiceOnBus(RULE_VALIDATION_ATTRIBUTE_EXPORTER_SERVICE, applicationId);
63 }
64
65 public static WorkflowRuleAttributeHandlerService getWorkflowRuleAttributeHandlerService(String applicationId) {
66 return getServiceOnBus(WORKFLOW_RULE_ATTRIBUTE_HANDLER_SERVICE, applicationId);
67 }
68
69 public static ActionListCustomizationMediator getActionListCustomizationMediator() {
70 return getService(ACTION_LIST_CUSTOMIZATION_MEDIATOR);
71 }
72
73 public static ActionListCustomizationHandlerService getActionListCustomizationHandlerService(
74 String applicationId) {
75 return getServiceOnBus(ACTION_LIST_CUSTOMIZATION_HANDLER_SERVICE, applicationId);
76 }
77 }