Index: lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java,v diff -u -r1.38 -r1.39 --- lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 11 Jul 2012 18:07:02 -0000 1.38 +++ lams_central/src/java/org/lamsfoundation/lams/web/HomeAction.java 26 Jul 2012 15:11:22 -0000 1.39 @@ -177,9 +177,9 @@ //show lesson intro page if required if (lesson.isEnableLessonIntro()) { - req.setAttribute("lessonName", lesson.getLessonName()); - req.setAttribute("lessonDescription", lesson.getLessonDescription()); + req.setAttribute("lesson", lesson); req.setAttribute("displayDesignImage", lesson.isDisplayDesignImage()); + req.setAttribute("isMonitor", lesson.getLessonClass().isStaffMember(getRealUser(user))); //check if we need to create learning design SVG if (lesson.isDisplayDesignImage()) { Index: lams_central/src/java/org/lamsfoundation/lams/web/action/EditLessonIntroAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/action/EditLessonIntroAction.java,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_central/src/java/org/lamsfoundation/lams/web/action/EditLessonIntroAction.java 26 Jul 2012 15:11:22 -0000 1.1 @@ -0,0 +1,110 @@ +/**************************************************************** + * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org) + * ============================================================= + * License Information: http://lamsfoundation.org/licensing/lams/2.0/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2.0 + * as published by the Free Software Foundation. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 * USA + * + * http://www.gnu.org/licenses/gpl.txt + * **************************************************************** + */ + +/* $Id: EditLessonIntroAction.java,v 1.1 2012/07/26 15:11:22 andreyb Exp $ */ +package org.lamsfoundation.lams.web.action; + +import java.io.IOException; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.apache.struts.actions.DispatchAction; +import org.lamsfoundation.lams.lesson.Lesson; +import org.lamsfoundation.lams.lesson.dao.ILessonDAO; +import org.lamsfoundation.lams.lesson.service.ILessonService; +import org.lamsfoundation.lams.util.WebUtil; +import org.lamsfoundation.lams.web.util.AttributeNames; +import org.springframework.web.context.WebApplicationContext; +import org.springframework.web.context.support.WebApplicationContextUtils; + +/** + * Edit lesson intro page. + * + * @struts:action path="/editLessonIntro" validate="false" parameter="method" + * @struts:action-forward name="editLessonIntro" path="/editLessonIntro.jsp" + * + */ +public class EditLessonIntroAction extends DispatchAction { + + private static ILessonService lessonService; + + private static ILessonDAO lessonDAO; + + /** + * Edit lesson intro page. + */ + public ActionForward edit(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) + throws IOException, ServletException { + + Long lessonId = WebUtil.readLongParam(req, AttributeNames.PARAM_LESSON_ID); + Lesson lesson = getLessonService().getLesson(lessonId); + req.setAttribute("lesson", lesson); + req.setAttribute("displayDesignImage", lesson.isDisplayDesignImage()); + req.setAttribute(AttributeNames.PARAM_CONTENT_FOLDER_ID, lesson.getLearningDesign().getContentFolderID()); + + return mapping.findForward("editLessonIntro"); + } + + /** + * Save lesson intro page. + */ + public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) + throws IOException, ServletException { + + Long lessonId = WebUtil.readLongParam(req, AttributeNames.PARAM_LESSON_ID); + Lesson lesson = getLessonService().getLesson(lessonId); + String lessonName = WebUtil.readStrParam(req, "lessonName"); + String lessonDescription = WebUtil.readStrParam(req, "lessonDescription"); + boolean displayDesignImage = WebUtil.readBooleanParam(req, "displayDesignImage"); + + //sore lesson in DB + lesson.setLessonName(lessonName); + lesson.setLessonDescription(lessonDescription); + lesson.setDisplayDesignImage(displayDesignImage); + getLessonDAO().saveLesson(lesson); + + return null; + } + + private ILessonService getLessonService() { + if (lessonService == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + lessonService = (ILessonService) ctx.getBean("lessonService"); + } + return lessonService; + } + + private ILessonDAO getLessonDAO() { + if (lessonDAO == null) { + WebApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(getServlet() + .getServletContext()); + lessonDAO = (ILessonDAO) ctx.getBean("lessonDAO"); + } + return lessonDAO; + } +} Index: lams_central/web/editLessonIntro.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/editLessonIntro.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_central/web/editLessonIntro.jsp 26 Jul 2012 15:11:22 -0000 1.1 @@ -0,0 +1,86 @@ + + +<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %> +<%@ taglib uri="tags-lams" prefix="lams" %> +<%@ taglib uri="tags-fmt" prefix="fmt" %> +<%@ taglib uri="tags-core" prefix="c" %> +<%@ taglib uri="tags-html" prefix="html" %> + + + + + <fmt:message key="title.learner.window"/> + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + +
+ +
+ + + +
+ checked="checked" class="noBorder" value="true"/> + +
+ +


+ + + + + +
+ +
+ + + + + +
Index: lams_central/web/lessonIntro.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/lessonIntro.jsp,v diff -u -r1.2 -r1.3 --- lams_central/web/lessonIntro.jsp 20 Mar 2012 14:36:30 -0000 1.2 +++ lams_central/web/lessonIntro.jsp 26 Jul 2012 15:11:22 -0000 1.3 @@ -6,44 +6,53 @@ <%@ taglib uri="tags-fmt" prefix="fmt" %> <%@ taglib uri="tags-core" prefix="c" %> <%@ taglib uri="tags-html" prefix="html" %> - - - - -learner.jsp?mode=${mode}&portfolioEnabled=${portfolioEnabled}&presenceEnabledPatch=${presenceEnabledPatch}&presenceImEnabled=${presenceImEnabled}&title=${title}&createDateTime=${createDateTime}&serverUrl=${serverUrl}&presenceUrl=${presenceUrl}&lessonID=${lessonID} + +mode=${mode}&portfolioEnabled=${portfolioEnabled}&presenceEnabledPatch=${presenceEnabledPatch}&presenceImEnabled=${presenceImEnabled}&title=${title}&createDateTime=${createDateTime}&serverUrl=${serverUrl}&presenceUrl=${presenceUrl}&lessonID=${lessonID} <fmt:message key="title.learner.window"/> + + + +
+ + +
+ + + +
+
-

${lessonName}

+

${lesson.lessonName}

-

${lessonDescription}

+

${lesson.lessonDescription}

-
+
Sequence Preview -
+
Sequence Preview @@ -52,7 +61,7 @@
- +