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  import org.kuali.rice.krad.service.BusinessObjectService;
24  import org.kuali.rice.krad.service.DataObjectMetaDataService;
25  import org.kuali.rice.krad.service.DocumentHeaderService;
26  import org.kuali.rice.krad.service.KeyValuesService;
27  import org.kuali.rice.krad.service.PersistenceService;
28  import org.kuali.rice.krad.service.PersistenceStructureService;
29  import org.kuali.rice.krad.service.SequenceAccessorService;
30  import org.kuali.rice.krad.service.util.OjbCollectionHelper;
31  import org.springframework.transaction.PlatformTransactionManager;
32  import org.springframework.transaction.support.TransactionTemplate;
33  
34  /**
35   * Service locator for the KRAD Web module
36   *
37   * @author Kuali Rice Team (rice.collab@kuali.org)
38   * @deprecated As of release 2.0
39   */
40  @Deprecated
41  public class KNSServiceLocator {
42  
43      public static final String BUSINESS_OBJECT_AUTHORIZATION_SERVICE = "businessObjectAuthorizationService";
44      public static final String BUSINESS_OBJECT_METADATA_SERVICE = "businessObjectMetaDataService";
45      public static final String BUSINESS_OBJECT_DICTIONARY_SERVICE = "businessObjectDictionaryService";
46      public static final String DATA_DICTIONARY_SERVICE = "dataDictionaryService";
47      public static final String DICTIONARY_VALIDATION_SERVICE = "knsDictionaryValidationService";
48      public static final String DOCUMENT_HELPER_SERVICE = "documentHelperService";
49      public static final String LOOKUP_RESULTS_SERVICE = "lookupResultsService";
50      public static final String KUALI_INQUIRABLE = "kualiInquirable";
51      public static final String KUALI_LOOKUPABLE = "kualiLookupable";
52      public static final String MAINTENANCE_DOCUMENT_DICTIONARY_SERVICE = "maintenanceDocumentDictionaryService";
53      public static final String TRANSACTIONAL_DOCUMENT_DICTIONARY_SERVICE = "transactionalDocumentDictionaryService";
54      public static final String KNS_SESSION_DOCUMENT_SERVICE = "knsSessionDocumentService";
55      public static final String WORKFLOW_ATTRIBUTE_PROPERTY_RESOLUTION_SERVICE = "workflowAttributesPropertyResolutionService";
56      public static final String TRANSACTION_MANAGER = "transactionManager";
57      public static final String TRANSACTION_TEMPLATE = "transactionTemplate";
58      public static final String MAINTENANCE_DOCUMENT_AUTHORIZATION_SERVICE = "maintenanceDocumentAuthorizationService";
59      public static final String BUSINESS_OBJECT_SERVICE = "businessObjectService";
60      public static final String DATA_OBJECT_METADATA_SERVICE = "dataObjectMetaDataService";
61      public static final String KEY_VALUES_SERVICE = "keyValuesService";
62      public static final String SESSION_DOCUMENT_SERVICE = "knsSessionDocumentService";
63      public static final String OJB_COLLECTION_HELPER = "ojbCollectionHelper";
64      public static final String PERSISTENCE_SERVICE = "persistenceService";
65      public static final String PERSISTENCE_STRUCTURE_SERVICE = "persistenceStructureService";
66      public static final String SEQUENCE_ACCESSOR_SERVICE = "sequenceAccessorService";
67      public static final String DOCUMENT_HEADER_SERVICE = "documentHeaderService";
68  
69      @Deprecated
70      public static <T extends Object> T getService(String serviceName) {
71          return GlobalResourceLoader.<T>getService(serviceName);
72      }
73  
74      @Deprecated
75      public static BusinessObjectAuthorizationService getBusinessObjectAuthorizationService() {
76          return getService(BUSINESS_OBJECT_AUTHORIZATION_SERVICE);
77      }
78  
79      @Deprecated
80      public static BusinessObjectMetaDataService getBusinessObjectMetaDataService() {
81          return getService(BUSINESS_OBJECT_METADATA_SERVICE);
82      }
83  
84      @Deprecated
85      public static DictionaryValidationService getKNSDictionaryValidationService() {
86  	    return (DictionaryValidationService) getService(DICTIONARY_VALIDATION_SERVICE);
87      }
88  
89      @Deprecated
90      public static LookupResultsService getLookupResultsService() {
91          return (LookupResultsService) getService(LOOKUP_RESULTS_SERVICE);
92      }
93  
94      @Deprecated
95      public static Inquirable getKualiInquirable() {
96          return getService(KUALI_INQUIRABLE);
97      }
98  
99      @Deprecated
100     public static Lookupable getKualiLookupable() {
101         return getService(KUALI_LOOKUPABLE);
102     }
103 
104     @Deprecated
105     public static MaintenanceDocumentDictionaryService getMaintenanceDocumentDictionaryService() {
106         return getService(MAINTENANCE_DOCUMENT_DICTIONARY_SERVICE);
107     }
108 
109     @Deprecated
110     public static TransactionalDocumentDictionaryService getTransactionalDocumentDictionaryService() {
111         return (TransactionalDocumentDictionaryService) getService(TRANSACTIONAL_DOCUMENT_DICTIONARY_SERVICE);
112     }
113 
114     @Deprecated
115     public static org.kuali.rice.kns.service.SessionDocumentService getKNSSessionDocumentService() {
116         return  getService(KNS_SESSION_DOCUMENT_SERVICE);
117     }
118 
119     @Deprecated
120     public static Lookupable getLookupable(String lookupableName) {
121         return getService(lookupableName);
122     }
123 
124     @Deprecated
125     public static DataDictionaryService getDataDictionaryService() {
126         return getService(DATA_DICTIONARY_SERVICE);
127     }
128 
129     @Deprecated
130     public static BusinessObjectDictionaryService getBusinessObjectDictionaryService() {
131         return getService(BUSINESS_OBJECT_DICTIONARY_SERVICE);
132     }
133 
134     @Deprecated
135     public static DocumentHelperService getDocumentHelperService() {
136         return getService(DOCUMENT_HELPER_SERVICE);
137     }
138 
139     @Deprecated
140     public static Question getQuestion(String questionName) {
141         return (Question) getService(questionName);
142     }
143 
144     @Deprecated
145     public static WorkflowAttributePropertyResolutionService getWorkflowAttributePropertyResolutionService() {
146     	return (WorkflowAttributePropertyResolutionService) getService(WORKFLOW_ATTRIBUTE_PROPERTY_RESOLUTION_SERVICE);
147     }
148 
149     @Deprecated
150     public static PlatformTransactionManager getTransactionManager() {
151 	    return (PlatformTransactionManager) getService(TRANSACTION_MANAGER);
152     }
153 
154     @Deprecated
155     public static TransactionTemplate getTransactionTemplate() {
156 	    return (TransactionTemplate) getService(TRANSACTION_TEMPLATE);
157     }
158 
159     @Deprecated
160     public static BusinessObjectAuthorizationService getMaintenanceDocumentAuthorizationService() {
161     	return (BusinessObjectAuthorizationService) getService(MAINTENANCE_DOCUMENT_AUTHORIZATION_SERVICE);
162     }
163 
164     @Deprecated
165     public static BusinessObjectService getBusinessObjectService(){
166         return (BusinessObjectService) getService(BUSINESS_OBJECT_SERVICE);
167     }
168 
169     @Deprecated
170     public static DataObjectMetaDataService getDataObjectMetaDataService() {
171         return (DataObjectMetaDataService) getService(DATA_OBJECT_METADATA_SERVICE);
172     }
173 
174     @Deprecated
175     public static KeyValuesService getKeyValuesService() {
176         return getService(KEY_VALUES_SERVICE);
177     }
178 
179     @Deprecated
180     public static SessionDocumentService getSessionDocumentService() {
181         return getService(SESSION_DOCUMENT_SERVICE);
182     }
183 
184     @Deprecated
185     public static OjbCollectionHelper getOjbCollectionHelper() {
186         return (OjbCollectionHelper) getService(OJB_COLLECTION_HELPER);
187     }
188     @Deprecated
189     public static DocumentHeaderService getDocumentHeaderService() {
190         return getService(DOCUMENT_HEADER_SERVICE);
191     }
192 
193 
194     @Deprecated
195     public static PersistenceService getPersistenceService() {
196         return getService(PERSISTENCE_SERVICE);
197     }
198 
199     @Deprecated
200     public static PersistenceStructureService getPersistenceStructureService() {
201         return getService(PERSISTENCE_STRUCTURE_SERVICE);
202     }
203 
204     @Deprecated
205     public static SequenceAccessorService getSequenceAccessorService() {
206         return getService(SEQUENCE_ACCESSOR_SERVICE);
207     }
208 
209 }