Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/ActivityAction.java =================================================================== diff -u -r36c2ed010b8a3893b895d781be1a219f2380e62d -r0cbb25df35aa6fc1339d195f69b1aeef7a372680 --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/ActivityAction.java (.../ActivityAction.java) (revision 36c2ed010b8a3893b895d781be1a219f2380e62d) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/ActivityAction.java (.../ActivityAction.java) (revision 0cbb25df35aa6fc1339d195f69b1aeef7a372680) @@ -31,10 +31,8 @@ import org.lamsfoundation.lams.learning.web.bean.SessionBean; import org.lamsfoundation.lams.learning.web.form.ActivityForm; import org.lamsfoundation.lams.learning.web.util.ActionMappings; -import org.lamsfoundation.lams.learning.web.util.ActionMappingsWithToolWait; import org.lamsfoundation.lams.usermanagement.*; -import org.lamsfoundation.lams.web.action.Action; import org.lamsfoundation.lams.lesson.*; import org.lamsfoundation.lams.learningdesign.*; import org.springframework.web.context.WebApplicationContext; @@ -45,39 +43,12 @@ * Creation date: 01-12-2005 * */ -public class ActivityAction extends Action { +public class ActivityAction extends LearnerAction { protected static final String ACTIVITY_REQUEST_ATTRIBUTE = "activity"; protected static final String LEARNER_PROGRESS_REQUEST_ATTRIBUTE = "learnerprogress"; - //protected ActionMappings actionMappings = new ActionMappingsWithToolWait(); - //protected ActionMappings actionMappings; - /** - * Gets the session bean from session. - * @return SessionBean for this request, null if no session. - */ - protected static SessionBean getSessionBean(HttpServletRequest request) { - HttpSession session = request.getSession(false); - if (session == null) { - return null; - } - SessionBean sessionBean = (SessionBean)session.getAttribute(SessionBean.NAME); - return sessionBean; - } - - /** - * Sets the session bean for this session. - */ - protected static void setSessionBean(SessionBean sessionBean, HttpServletRequest request) { - HttpSession session = request.getSession(false); - if (session == null) { - return; - } - session.setAttribute(SessionBean.NAME, sessionBean); - } - - /** * Get the learner service. */ protected ILearnerService getLearnerService(HttpServletRequest request) { @@ -105,7 +76,7 @@ LearnerProgress learnerProgress = (LearnerProgress)request.getAttribute(ActivityAction.LEARNER_PROGRESS_REQUEST_ATTRIBUTE); if (learnerProgress == null) { SessionBean sessionBean = getSessionBean(request); - User learner = sessionBean.getLeaner(); + User learner = sessionBean.getLearner(); Lesson lesson = sessionBean.getLesson(); ILearnerService learnerService = getLearnerService(request); Index: lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java =================================================================== diff -u --- lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java (revision 0) +++ lams_learning/src/java/org/lamsfoundation/lams/learning/web/action/LearnerAction.java (revision 0cbb25df35aa6fc1339d195f69b1aeef7a372680) @@ -0,0 +1,60 @@ +/* +Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +USA + +http://www.gnu.org/licenses/gpl.txt +*/ + +package org.lamsfoundation.lams.learning.web.action; + +import javax.servlet.http.*; + +import org.lamsfoundation.lams.learning.web.bean.SessionBean; +import org.lamsfoundation.lams.web.action.Action; + +/** + * MyEclipse Struts + * Creation date: 01-12-2005 + * + */ +public class LearnerAction extends Action { + + /** + * Gets the session bean from session. + * @return SessionBean for this request, null if no session. + */ + protected SessionBean getSessionBean(HttpServletRequest request) { + HttpSession session = request.getSession(false); + if (session == null) { + return null; + } + SessionBean sessionBean = (SessionBean)session.getAttribute(SessionBean.NAME); + return sessionBean; + } + + /** + * Sets the session bean for this session. + */ + protected void setSessionBean(SessionBean sessionBean, HttpServletRequest request) { + HttpSession session = request.getSession(false); + if (session == null) { + return; + } + session.setAttribute(SessionBean.NAME, sessionBean); + } + +} \ No newline at end of file