View Javadoc
1   /*
2    * Copyright 2009 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.ole.module.purap.document.authorization;
17  
18  import org.kuali.ole.sys.context.SpringContext;
19  import org.kuali.rice.core.api.config.property.ConfigurationService;
20  import org.kuali.rice.core.api.exception.KualiException;
21  
22  import java.text.MessageFormat;
23  
24  public class DocumentInitiationException extends KualiException {
25      public DocumentInitiationException(String messageKey, Object[] messageParameters) {
26          super(MessageFormat.format(getConfigurationService().getPropertyValueAsString(messageKey), messageParameters));
27      }
28  
29      public DocumentInitiationException(String messageKey, Object[] messageParameters, boolean hideIncidentReport) {
30          super(MessageFormat.format(getConfigurationService().getPropertyValueAsString(messageKey), messageParameters), hideIncidentReport);
31      }
32  
33      private static ConfigurationService configurationService;
34  
35      private static ConfigurationService getConfigurationService() {
36          if (configurationService == null) {
37              configurationService = SpringContext.getBean(ConfigurationService.class);
38          }
39          return configurationService;
40      }
41  }