Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/LearningAction.java,v diff -u -r1.8 -r1.9 --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/LearningAction.java 4 Jul 2008 05:41:42 -0000 1.8 +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/LearningAction.java 8 Jul 2008 02:23:41 -0000 1.9 @@ -197,27 +197,8 @@ if (gmapUser != null) { - LearningForm learningForm = (LearningForm) form; - - // TODO fix idType to use real value not 999 + LearningForm learningForm = (LearningForm) form; - /* - if (gmapUser.getEntryUID() == null) { - gmapUser.setEntryUID(gmapService.createNotebookEntry( - toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, GmapConstants.TOOL_SIGNATURE, - gmapUser.getUserId().intValue(), learningForm - .getEntryText())); - } else { - // update existing entry. - gmapService.updateEntry(gmapUser.getEntryUID(), - learningForm.getEntryText()); - } - - gmapUser.setFinishedActivity(true); - gmapService.saveOrUpdateGmapUser(gmapUser); - */ - - // Retrieve the session and content. GmapSession gmapSession = gmapService.getSessionBySessionId(toolSessionID); if (gmapSession == null) { @@ -250,7 +231,40 @@ return null; // TODO need to return proper page. } + + + public ActionForward saveMarkers(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) throws Exception + { + Long toolSessionID = WebUtil.readLongParam(request, "toolSessionID"); + + GmapUser gmapUser = getCurrentUser(toolSessionID); + + if (gmapUser != null) { + + LearningForm learningForm = (LearningForm) form; + + // Retrieve the session and content. + GmapSession gmapSession = gmapService.getSessionBySessionId(toolSessionID); + if (gmapSession == null) { + throw new GmapException("Cannot retreive session with toolSessionID"+ toolSessionID); + } + + // update the marker list + Gmap gmap = gmapSession.getGmap(); + updateMarkerListFromXML(learningForm.getMarkersXML(), gmap, gmapUser, gmapSession); + + } else { + log.error("saveMarkers(): couldn't find GmapUser with id: " + + gmapUser.getUserId() + "and toolSessionID: " + + toolSessionID); + } + + //return mapping.findForward("gmap"); + return unspecified(mapping, form, request, response); + } + private void updateMarkerListFromXML(String markerXML, Gmap gmap, GmapUser guser, GmapSession session) { Index: lams_tool_gmap/web/pages/learning/gmap.jsp =================================================================== RCS file: /usr/local/cvsroot/lams_tool_gmap/web/pages/learning/gmap.jsp,v diff -u -r1.9 -r1.10 --- lams_tool_gmap/web/pages/learning/gmap.jsp 7 Jul 2008 23:52:07 -0000 1.9 +++ lams_tool_gmap/web/pages/learning/gmap.jsp 8 Jul 2008 02:23:41 -0000 1.10 @@ -16,11 +16,11 @@ ${gmapDTO.title} - - + +

${gmapDTO.instructions}

@@ -51,7 +51,11 @@
- + + button.save + + + button.finish