1
2
3
4
5
6
7
8
9
10
11
12
13
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
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
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
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
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
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
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
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
148 ex.printStackTrace();
149 throw new RuntimeException(ex);
150 }
151 }
152
153 }