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.lu.ui.course.server.gwt;
17  
18  import java.util.List;
19  
20  import org.apache.log4j.Logger;
21  import org.kuali.student.common.ui.server.gwt.BaseRpcGwtServletAbstract;
22  import org.kuali.student.lum.lu.ui.course.client.service.LuRpcService;
23  import org.kuali.student.r2.common.util.ContextUtils;
24  import org.kuali.student.r2.core.versionmanagement.dto.VersionDisplayInfo;
25  import org.kuali.student.r2.lum.clu.dto.CluInfo;
26  import org.kuali.student.r2.lum.clu.dto.CluLoRelationInfo;
27  import org.kuali.student.r2.lum.clu.service.CluService;
28  
29  /**
30   * This is a description of what this class does - Will Gomes don't forget to
31   * fill this in.
32   * 
33   * @author Kuali Student Team
34   * 
35   */
36  public class LuRpcGwtServlet extends BaseRpcGwtServletAbstract<CluService>
37  		implements LuRpcService {
38  
39  	private static final long serialVersionUID = 1L;
40  	final static Logger LOG = Logger.getLogger(LuRpcGwtServlet.class);
41  	/**
42  	 * @see org.kuali.student.lum.lu.ui.course.client.service.LuRemoteService#createClu(java.lang.String,
43  	 *      org.kuali.student.lum.lu.dto.CluInfo)
44  	 */
45  	@Override
46  	public CluInfo createClu(String luTypeKey, CluInfo cluInfo) {
47  		try {
48  			return service.createClu(luTypeKey, cluInfo, ContextUtils.getContextInfo());
49  		} catch (Exception e) {
50  			LOG.error(e);
51  		}
52  		return null;
53  	}
54  
55  	/**
56  	 * @see org.kuali.student.lum.lu.ui.course.client.service.LuRemoteService#updateClu(java.lang.String,
57  	 *      org.kuali.student.lum.lu.dto.CluInfo)
58  	 */
59  	@Override
60  	public CluInfo updateClu(String cluId, CluInfo cluInfo) {
61  		try {
62  			return service.updateClu(cluId, cluInfo, ContextUtils.getContextInfo());
63  		} catch (Exception e) {
64  			LOG.error(e);
65  		}
66  		return null;
67  	}
68  	
69  	@Override
70  	public List<CluLoRelationInfo> getCluLoRelationsByClu(String cluId) {
71  		try {
72  			return service.getCluLoRelationsByClu(cluId, ContextUtils.getContextInfo());
73  		} catch (Exception e) {
74  			LOG.error(e);
75  		}
76  		return null;
77  	}
78  
79  	@Override
80  	public CluInfo getClu(String cluId) {
81  		try {
82  			return service.getClu(cluId, ContextUtils.getContextInfo());
83  		} catch (Exception e) {
84  			LOG.error(e);
85  		}
86  		return null;
87  	}
88  
89  	
90      @Override
91      public VersionDisplayInfo getCurrentVersion(String refObjectTypeURI, String refObjectId) {
92  		try {
93  			return service.getCurrentVersion(refObjectTypeURI, refObjectId, ContextUtils.getContextInfo());
94  			
95  		} catch (Exception e) {
96  			LOG.error(e);
97  		}
98  		return null;
99      }
100 }