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