View Javadoc

1   /**
2    * Copyright 2005-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/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.kns.service;
17  
18  import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
19  import org.kuali.rice.kns.inquiry.Inquirable;
20  import org.kuali.rice.kns.lookup.LookupResultsService;
21  import org.kuali.rice.kns.lookup.Lookupable;
22  
23  /**
24   * Service locator for the KRAD Web module
25   *
26   * @author Kuali Rice Team (rice.collab@kuali.org)
27   * @deprecated As of release 2.0
28   */
29  @Deprecated
30  public class KNSServiceLocator {
31  
32      public static final String BUSINESS_OBJECT_AUTHORIZATION_SERVICE = "businessObjectAuthorizationService";
33      public static final String BUSINESS_OBJECT_METADATA_SERVICE = "businessObjectMetaDataService";
34      public static final String BUSINESS_OBJECT_DICTIONARY_SERVICE = "businessObjectDictionaryService";
35      public static final String DATA_DICTIONARY_SERVICE = "dataDictionaryService";
36      public static final String DICTIONARY_VALIDATION_SERVICE = "dictionaryValidationService";
37      public static final String LOOKUP_RESULTS_SERVICE = "lookupResultsService";
38      public static final String KUALI_INQUIRABLE = "kualiInquirable";
39      public static final String KUALI_LOOKUPABLE = "kualiLookupable";
40      public static final String MAINTENANCE_DOCUMENT_DICTIONARY_SERVICE = "maintenanceDocumentDictionaryService";
41      public static final String TRANSACTIONAL_DOCUMENT_DICTIONARY_SERVICE = "transactionalDocumentDictionaryService";
42      public static final String SESSION_DOCUMENT_SERVICE = "knsSessionDocumentService";
43  
44      public static <T extends Object> T getService(String serviceName) {
45          return GlobalResourceLoader.<T>getService(serviceName);
46      }
47  
48      public static BusinessObjectAuthorizationService getBusinessObjectAuthorizationService() {
49          return getService(BUSINESS_OBJECT_AUTHORIZATION_SERVICE);
50      }
51  
52      public static BusinessObjectMetaDataService getBusinessObjectMetaDataService() {
53          return getService(BUSINESS_OBJECT_METADATA_SERVICE);
54      }
55  
56      public static DictionaryValidationService getDictionaryValidationService() {
57  	return (DictionaryValidationService) getService(DICTIONARY_VALIDATION_SERVICE);
58      }
59  
60      public static LookupResultsService getLookupResultsService() {
61          return (LookupResultsService) getService(LOOKUP_RESULTS_SERVICE);
62      }
63  
64      public static Inquirable getKualiInquirable() {
65          return getService(KUALI_INQUIRABLE);
66      }
67  
68      public static Lookupable getKualiLookupable() {
69          return getService(KUALI_LOOKUPABLE);
70      }
71  
72      public static MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService() {
73          return getService(MAINTENANCE_DOCUMENT_DICTIONARY_SERVICE);
74      }
75  
76      public static TransactionalDocumentDictionaryService getTransactionalDocumentDictionaryService() {
77          return (TransactionalDocumentDictionaryService) getService(TRANSACTIONAL_DOCUMENT_DICTIONARY_SERVICE);
78      }
79  
80      public static SessionDocumentService getSessionDocumentService() {
81          return  getService(SESSION_DOCUMENT_SERVICE);
82      }
83  
84      public static Lookupable getLookupable(String lookupableName) {
85          return getService(lookupableName);
86      }
87  
88      public static DataDictionaryService getDataDictionaryService() {
89          return getService(DATA_DICTIONARY_SERVICE);
90      }
91  
92      public static BusinessObjectDictionaryService getBusinessObjectDictionaryService() {
93          return getService(BUSINESS_OBJECT_DICTIONARY_SERVICE);
94      }
95  }