001    /**
002     * Copyright 2010 The Kuali Foundation Licensed under the
003     * Educational Community License, Version 2.0 (the "License"); you may
004     * not use this file except in compliance with the License. You may
005     * obtain a copy of the License at
006     *
007     * http://www.osedu.org/licenses/ECL-2.0
008     *
009     * Unless required by applicable law or agreed to in writing,
010     * software distributed under the License is distributed on an "AS IS"
011     * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012     * or implied. See the License for the specific language governing
013     * permissions and limitations under the License.
014     */
015    
016    package org.kuali.student.lum.program.server;
017    
018    import java.util.List;
019    
020    import org.kuali.student.common.ui.server.gwt.BaseRpcGwtServletAbstract;
021    import org.kuali.student.common.versionmanagement.dto.VersionDisplayInfo;
022    import org.kuali.student.core.statement.dto.ReqComponentInfo;
023    import org.kuali.student.core.statement.dto.ReqComponentTypeInfo;
024    import org.kuali.student.core.statement.dto.StatementTreeViewInfo;
025    import org.kuali.student.core.statement.dto.StatementTypeInfo;
026    import org.kuali.student.core.statement.ui.client.widgets.rules.ReqComponentInfoUi;
027    import org.kuali.student.lum.lu.dto.CluInfo;
028    import org.kuali.student.lum.lu.service.LuService;
029    import org.kuali.student.lum.program.client.rpc.StatementRpcService;
030    
031    public class StatementRpcServlet extends BaseRpcGwtServletAbstract<LuService> implements StatementRpcService {
032    
033            private static final long serialVersionUID = 1L;
034            private StatementRpcService statmentDataService;
035    
036            public void setStatmentDataService(StatementRpcService statmentDataService) {
037                    this.statmentDataService = statmentDataService;
038            }
039    
040            @Override
041            public List<StatementTypeInfo> getStatementTypesForStatementTypeForCourse(
042                            String statementTypeKey) throws Exception {
043                    return statmentDataService
044                                    .getStatementTypesForStatementTypeForCourse(statementTypeKey);
045            }
046    
047            @Override
048            public List<StatementTypeInfo> getStatementTypesForStatementType(
049                            String statementTypeKey) throws Exception {
050                    return statmentDataService
051                                    .getStatementTypesForStatementType(statementTypeKey);
052            }
053    
054            @Override
055            public List<ReqComponentTypeInfo> getReqComponentTypesForStatementType(
056                            String luStatementTypeKey) throws Exception {
057                    return statmentDataService
058                                    .getReqComponentTypesForStatementType(luStatementTypeKey);
059            }
060    
061            @Override
062            public String translateReqComponentToNL(ReqComponentInfo reqComponentInfo,
063                            String nlUsageTypeKey, String language) throws Exception {
064                    return statmentDataService.translateReqComponentToNL(reqComponentInfo,
065                                    nlUsageTypeKey, language);
066            }
067    
068            @Override
069            public String translateStatementTreeViewToNL(
070                            StatementTreeViewInfo statementTreeViewInfo, String nlUsageTypeKey,
071                            String language) throws Exception {
072                    return statmentDataService.translateStatementTreeViewToNL(
073                                    statementTreeViewInfo, nlUsageTypeKey, language);
074            }
075    
076            @Override
077            public List<String> translateReqComponentToNLs(
078                            ReqComponentInfoUi reqComponentInfo, String[] nlUsageTypeKeys,
079                            String language) throws Exception {
080                    return statmentDataService.translateReqComponentToNLs(reqComponentInfo,
081                                    nlUsageTypeKeys, language);
082            }
083    
084            @Override
085            public CluInfo getClu(String cluId) throws Exception {
086                    return statmentDataService.getClu(cluId);
087            }
088    
089            @Override
090            public VersionDisplayInfo getCurrentVersion(String refObjectTypeURI,
091                            String refObjectId) throws Exception {
092                    return statmentDataService.getCurrentVersion(refObjectTypeURI,
093                                    refObjectId);
094            }
095    
096    }