View Javadoc

1   /**
2    * Copyright 2005-2013 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.krad.service;
17  
18  import org.kuali.rice.core.api.CoreConstants;
19  import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
20  import org.kuali.rice.krad.lookup.Lookupable;
21  import org.kuali.rice.krad.uif.service.AttributeQueryService;
22  import org.kuali.rice.krad.uif.service.ExpressionEvaluatorService;
23  import org.kuali.rice.krad.uif.service.ViewDictionaryService;
24  import org.kuali.rice.krad.uif.service.ViewService;
25  import org.kuali.rice.krad.workflow.service.WorkflowDocumentService;
26  
27  /**
28   * Service locator for the KRAD Web module
29   *
30   * @author Kuali Rice Team (rice.collab@kuali.org)
31   */
32  public class KRADServiceLocatorWeb {
33  
34      public static final class Namespaces {
35          public static final String MODULE_NAME = "krad";
36          public static final String KRAD_NAMESPACE_PREFIX =
37                  CoreConstants.Namespaces.ROOT_NAMESPACE_PREFIX + "/" + MODULE_NAME;
38  
39          /**
40           * Namespace for the krad module which is compatible with Kuali Rice 2.0.x.
41           */
42          public static final String KRAD_NAMESPACE_2_0 =
43                  KRAD_NAMESPACE_PREFIX + "/" + CoreConstants.Versions.VERSION_2_0;
44  
45      }
46  
47      public static final String DATA_DICTIONARY_REMOTE_FIELD_SERVICE = "dataDictionaryRemoteFieldService";
48      public static final String DOCUMENT_DICTIONARY_SERVICE = "documentDictionaryService";
49      public static final String SESSION_DOCUMENT_SERVICE = "sessionDocumentService";
50      public static final String DATA_OBJECT_AUTHORIZATION_SERVICE = "dataObjectAuthorizationService";
51      public static final String MAINTENANCE_DOCUMENT_SERVICE = "maintenanceDocumentService";
52      public static final String WORKFLOW_DOCUMENT_SERVICE = "workflowDocumentService";
53      public static final String EXCEPTION_INCIDENT_REPORT_SERVICE = "kradExceptionIncidentService";
54      public static final String FEEDBACK_REPORT_SERVICE = "kradFeedbackService";
55      public static final String DATA_DICTIONARY_SERVICE = "dataDictionaryService";
56      public static final String DOCUMENT_HEADER_SERVICE = "documentHeaderService";
57      public static final String PESSIMISTIC_LOCK_SERVICE = "pessimisticLockService";
58      public static final String PERSISTENCE_SERVICE_OJB = "persistenceServiceOjb";
59      public static final String KUALI_MODULE_SERVICE = "kualiModuleService";
60      public static final String KUALI_RULE_SERVICE = "kualiRuleService";
61      public static final String DOCUMENT_SERVICE = "documentService";
62      public static final String DOCUMENT_SERIALIZER_SERVICE = "documentSerializerService";
63      public static final String LOOKUP_SERVICE = "lookupService";
64      public static final String DICTIONARY_VALIDATION_SERVICE = "dictionaryValidationService";
65      public static final String DEFAULT_INACTIVATION_BLOCKING_DETECTION_SERVICE = "inactivationBlockingDetectionService";
66      public static final String DATA_OBJECT_METADATA_SERVICE = "dataObjectMetaDataService";
67      public static final String EXPRESSION_EVALUATOR_SERVICE = "expressionEvaluatorService";
68      public static final String VIEW_SERVICE = "viewService";
69      public static final String VIEW_DICTIONARY_SERVICE = "viewDictionaryService";
70      public static final String VIEW_VALIDATION_SERVICE = "viewValidationService";
71      public static final String ATTRIBUTE_QUERY_SERVICE = "attributeQueryService";
72  
73      public static <T extends Object> T getService(String serviceName) {
74          return GlobalResourceLoader.<T>getService(serviceName);
75      }
76  
77      public static DocumentDictionaryService getDocumentDictionaryService() {
78          return getService(DOCUMENT_DICTIONARY_SERVICE);
79      }
80  
81      public static SessionDocumentService getSessionDocumentService() {
82          return getService(SESSION_DOCUMENT_SERVICE);
83      }
84  
85      public static DataObjectAuthorizationService getDataObjectAuthorizationService() {
86          return getService(DATA_OBJECT_AUTHORIZATION_SERVICE);
87      }
88  
89      public static MaintenanceDocumentService getMaintenanceDocumentService() {
90          return getService(MAINTENANCE_DOCUMENT_SERVICE);
91      }
92  
93      public static WorkflowDocumentService getWorkflowDocumentService() {
94          return getService(WORKFLOW_DOCUMENT_SERVICE);
95      }
96  
97      public static final KualiExceptionIncidentService getKualiExceptionIncidentService() {
98          return getService(EXCEPTION_INCIDENT_REPORT_SERVICE);
99      }
100 
101     public static final KualiFeedbackService getKualiFeedbackService() {
102         return getService(FEEDBACK_REPORT_SERVICE);
103     }
104 
105     public static DataDictionaryService getDataDictionaryService() {
106         return getService(DATA_DICTIONARY_SERVICE);
107     }
108 
109     public static DocumentHeaderService getDocumentHeaderService() {
110         return getService(DOCUMENT_HEADER_SERVICE);
111     }
112 
113     public static PessimisticLockService getPessimisticLockService() {
114         return getService(PESSIMISTIC_LOCK_SERVICE);
115     }
116 
117     public static Lookupable getLookupable(String lookupableName) {
118         return getService(lookupableName);
119     }
120 
121     public static PersistenceService getPersistenceServiceOjb() {
122         return getService(PERSISTENCE_SERVICE_OJB);
123     }
124 
125     public static KualiModuleService getKualiModuleService() {
126         return getService(KUALI_MODULE_SERVICE);
127     }
128 
129     public static KualiRuleService getKualiRuleService() {
130         return getService(KUALI_RULE_SERVICE);
131     }
132 
133     public static DocumentService getDocumentService() {
134         return getService(DOCUMENT_SERVICE);
135     }
136 
137     public static DocumentSerializerService getDocumentSerializerService() {
138         return (DocumentSerializerService) getService(DOCUMENT_SERIALIZER_SERVICE);
139     }
140 
141     public static LookupService getLookupService() {
142         return (LookupService) getService(LOOKUP_SERVICE);
143     }
144 
145     public static DictionaryValidationService getDictionaryValidationService() {
146         return (DictionaryValidationService) getService(DICTIONARY_VALIDATION_SERVICE);
147     }
148 
149     public static InactivationBlockingDetectionService getInactivationBlockingDetectionService(String serviceName) {
150         return (InactivationBlockingDetectionService) getService(serviceName);
151     }
152 
153     public static DataObjectMetaDataService getDataObjectMetaDataService() {
154         return (DataObjectMetaDataService) getService(DATA_OBJECT_METADATA_SERVICE);
155     }
156 
157     public static ExpressionEvaluatorService getExpressionEvaluatorService() {
158         return (ExpressionEvaluatorService) getService(EXPRESSION_EVALUATOR_SERVICE);
159     }
160 
161     public static ViewService getViewService() {
162         return (ViewService) getService(VIEW_SERVICE);
163     }
164 
165     public static ViewDictionaryService getViewDictionaryService() {
166         return (ViewDictionaryService) getService(VIEW_DICTIONARY_SERVICE);
167     }
168 
169     public static ViewValidationService getViewValidationService() {
170         return (ViewValidationService) getService(VIEW_VALIDATION_SERVICE);
171     }
172 
173     public static AttributeQueryService getAttributeQueryService() {
174         return (AttributeQueryService) getService(ATTRIBUTE_QUERY_SERVICE);
175     }
176 
177     public static DataDictionaryRemoteFieldService getDataDictionaryRemoteFieldService() {
178         return (DataDictionaryRemoteFieldService) getService(DATA_DICTIONARY_REMOTE_FIELD_SERVICE);
179     }
180 }