View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.lum.program.server;
17  
18  import java.util.List;
19  
20  import org.kuali.student.r2.core.versionmanagement.dto.VersionDisplayInfo;
21  import org.kuali.student.r1.core.statement.dto.ReqComponentInfo;
22  import org.kuali.student.r1.core.statement.dto.ReqComponentTypeInfo;
23  import org.kuali.student.r1.core.statement.dto.StatementTreeViewInfo;
24  import org.kuali.student.r1.core.statement.dto.StatementTypeInfo;
25  import org.kuali.student.common.ui.server.gwt.BaseRpcGwtServletAbstract;
26  import org.kuali.student.core.statement.ui.client.widgets.rules.ReqComponentInfoUi;
27  import org.kuali.student.r2.lum.clu.dto.CluInfo;
28  import org.kuali.student.r2.lum.clu.service.CluService;
29  import org.kuali.student.lum.program.client.rpc.StatementRpcService;
30  
31  public class StatementRpcServlet extends BaseRpcGwtServletAbstract<CluService> implements StatementRpcService {
32  
33      private static final long serialVersionUID = 1L;
34      private StatementRpcService statmentDataService;
35  
36      public void setStatmentDataService(StatementRpcService statmentDataService) {
37  
38          this.statmentDataService = statmentDataService;
39      }
40  
41      @Override
42      public List<StatementTypeInfo> getStatementTypesForStatementTypeForCourse(
43              String statementTypeKey) throws Exception {
44          try
45          {
46              return statmentDataService
47                      .getStatementTypesForStatementTypeForCourse(statementTypeKey);
48          } catch (Exception ex) {
49              // Log exception 
50              ex.printStackTrace();
51              throw new RuntimeException(ex);
52          }
53      }
54  
55      @Override
56      public List<StatementTypeInfo> getStatementTypesForStatementType(
57              String statementTypeKey) throws Exception {
58          try
59          {
60              return statmentDataService
61                      .getStatementTypesForStatementType(statementTypeKey);
62          } catch (Exception ex) {
63              // Log exception 
64              ex.printStackTrace();
65              throw new RuntimeException(ex);
66          }
67      }
68  
69      @Override
70      public List<ReqComponentTypeInfo> getReqComponentTypesForStatementType(
71              String luStatementTypeKey) throws Exception {
72          try
73          {
74              return statmentDataService
75                      .getReqComponentTypesForStatementType(luStatementTypeKey);
76          } catch (Exception ex) {
77              // Log exception 
78              ex.printStackTrace();
79              throw new RuntimeException(ex);
80          }
81      }
82  
83      @Override
84      public String translateReqComponentToNL(ReqComponentInfo reqComponentInfo,
85              String nlUsageTypeKey, String language) throws Exception {
86          try
87          {
88              return statmentDataService.translateReqComponentToNL(reqComponentInfo,
89                      nlUsageTypeKey, language);
90          } catch (Exception ex) {
91              // Log exception 
92              ex.printStackTrace();
93              throw new RuntimeException(ex);
94          }
95      }
96  
97      @Override
98      public String translateStatementTreeViewToNL(
99              StatementTreeViewInfo statementTreeViewInfo, String nlUsageTypeKey,
100             String language) throws Exception {
101         try
102         {
103             return statmentDataService.translateStatementTreeViewToNL(
104                     statementTreeViewInfo, nlUsageTypeKey, language);
105         } catch (Exception ex) {
106             // Log exception 
107             ex.printStackTrace();
108             throw new RuntimeException(ex);
109         }
110     }
111 
112     @Override
113     public List<String> translateReqComponentToNLs(
114             ReqComponentInfoUi reqComponentInfo, String[] nlUsageTypeKeys,
115             String language) throws Exception {
116         try
117         {
118             return statmentDataService.translateReqComponentToNLs(reqComponentInfo,
119                     nlUsageTypeKeys, language);
120         } catch (Exception ex) {
121             // Log exception 
122             ex.printStackTrace();
123             throw new RuntimeException(ex);
124         }
125     }
126 
127     @Override
128     public CluInfo getClu(String cluId) throws Exception {
129         try
130         {
131             return statmentDataService.getClu(cluId);
132         } catch (Exception ex) {
133             // Log exception 
134             ex.printStackTrace();
135             throw new RuntimeException(ex);
136         }
137     }
138 
139     @Override
140     public VersionDisplayInfo getCurrentVersion(String refObjectTypeURI,
141             String refObjectId) throws Exception {
142         try
143         {
144             return statmentDataService.getCurrentVersion(refObjectTypeURI,
145                     refObjectId);
146         } catch (Exception ex) {
147             // Log exception 
148             ex.printStackTrace();
149             throw new RuntimeException(ex);
150         }
151     }
152 
153 }