Coverage Report - org.kuali.student.common.ui.server.gwt.StatementRpcServlet
 
Classes in this File Line Coverage Branch Coverage Complexity
StatementRpcServlet
0%
0/18
0%
0/2
1.6
 
 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.common.ui.server.gwt;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.List;
 20  
 
 21  
 import org.apache.log4j.Logger;
 22  
 import org.kuali.student.common.ui.client.service.StatementRpcService;
 23  
 import org.kuali.student.core.statement.dto.ReqComponentInfo;
 24  
 import org.kuali.student.core.statement.dto.ReqComponentTypeInfo;
 25  
 import org.kuali.student.core.statement.dto.StatementTreeViewInfo;
 26  
 import org.kuali.student.core.statement.dto.StatementTypeInfo;
 27  
 import org.kuali.student.core.statement.service.StatementService;
 28  
 
 29  
 import com.google.gwt.user.server.rpc.RemoteServiceServlet;
 30  
 
 31  0
 public class StatementRpcServlet extends RemoteServiceServlet implements StatementRpcService {
 32  
 
 33  0
     final static Logger LOG = Logger.getLogger(StatementRpcServlet.class);
 34  
     
 35  
     private StatementService statementService;
 36  
     
 37  
     private static final long serialVersionUID = 822326113643828855L;
 38  
 
 39  
     @Override
 40  
     public List<StatementTypeInfo> getStatementTypesForStatementType(String statementTypeKey) throws Exception {
 41  0
         List<String> statementTypeNames = statementService.getStatementTypesForStatementType(statementTypeKey);
 42  0
         List<StatementTypeInfo> statementTypes = new ArrayList<StatementTypeInfo>();
 43  0
         for (String statementTypeName : statementTypeNames) {
 44  0
             statementTypes.add(statementService.getStatementType(statementTypeName));
 45  
         }
 46  0
         return statementTypes;
 47  
     }
 48  
     
 49  
     public List<ReqComponentTypeInfo> getReqComponentTypesForStatementType(String luStatementTypeKey) throws Exception {
 50  
                 
 51  0
         List<ReqComponentTypeInfo> reqComponentTypeInfoList = null;
 52  
         try { 
 53  0
             reqComponentTypeInfoList = statementService.getReqComponentTypesForStatementType(luStatementTypeKey);
 54  0
         } catch (Exception ex) {
 55  0
             LOG.error(ex);
 56  0
             throw new Exception("Unable to find Requirement Component Types based on LU Statement Type Key:" + luStatementTypeKey, ex);
 57  0
         }
 58  
         
 59  0
         return reqComponentTypeInfoList;
 60  
     }
 61  
 
 62  
     @Override
 63  
     public String translateStatementTreeViewToNL(StatementTreeViewInfo statementTreeViewInfo, String nlUsageTypeKey, String language) throws Exception {
 64  0
         return statementService.translateStatementTreeViewToNL(statementTreeViewInfo, nlUsageTypeKey, language);
 65  
     }
 66  
 
 67  
     @Override
 68  
     public String translateReqComponentToNL(ReqComponentInfo reqComponentInfo, String nlUsageTypeKey, String language) throws Exception {
 69  0
         return statementService.translateReqComponentToNL(reqComponentInfo, nlUsageTypeKey, language);
 70  
     }
 71  
 
 72  
     public void setStatementService(StatementService statementService) {
 73  0
         this.statementService = statementService;
 74  0
     }
 75  
 }