|
From: Michael K. <ko...@us...> - 2006-12-06 09:41:34
|
Update of /cvsroot/cobricks/cobricks2/src/org/cobricks/course In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10626/course Added Files: CourseModuleSubProgramRel.java Log Message: --- NEW FILE: CourseModuleSubProgramRel.java --- /* * Copyright (c) 2006-2007 Cobricks Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted under the terms of the Cobricks Software * License, either version 1.0 of the License, or (at your option) any * later version (see www.cobricks.de). * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. */ package org.cobricks.course; import java.util.Map; import org.apache.log4j.Logger; /** * * @author mic...@ac... * @version $Date: 2006/12/06 09:41:29 $ */ public class CourseModuleSubProgramRel { static Logger logger = Logger.getLogger(CourseModuleSubProgramRel.class); int cspid; int cmid; String csppos; String cspcomment; String cspcomment_en; CourseModule cm; CourseSubProgram csp; /** * */ public CourseModuleSubProgramRel() { } public int getModuleId() { return cmid; } public int getSubProgramId() { return cspid; } public String getPos() { return csppos; } public String getComment() { return cspcomment; } public String getCommentEn() { return cspcomment_en; } public CourseModule getModule() { return cm; } public CourseSubProgram getSubProgram() { return csp; } /** * Load course attributes from a Map object - e.g. one retrieved * from a database */ public void loadFromMap(Map map, CourseManager courseManager) { loadFromMap(map, courseManager, null); } public void loadFromMap(Map map, CourseManager courseManager, CourseModule cm) { Integer tmpi = (Integer)map.get("cmid"); if (tmpi!=null) cmid = tmpi.intValue(); if (cm == null) { try { this.cm = courseManager.getCourseModule(cmid); } catch (Exception e) { } } else { this.cm = cm; } tmpi = (Integer)map.get("cspid"); if (tmpi!=null) cspid = tmpi.intValue(); try { csp = courseManager.getSubProgram(cspid); } catch (Exception e) { } csppos = (String)map.get("csppos"); cspcomment = (String)map.get("cspcomment"); cspcomment_en = (String)map.get("cspcomment_en"); } } |