Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/LearningAction.java =================================================================== diff -u -r46493c428028f29e93bcc2d9c0f24d34bd1bca3b -r78d238fd8e412e53dbe46d1d8f2a2b572139d955 --- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/LearningAction.java (.../LearningAction.java) (revision 46493c428028f29e93bcc2d9c0f24d34bd1bca3b) +++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/LearningAction.java (.../LearningAction.java) (revision 78d238fd8e412e53dbe46d1d8f2a2b572139d955) @@ -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 =================================================================== diff -u -re1053836420dd4940305875bd72be4639bab407e -r78d238fd8e412e53dbe46d1d8f2a2b572139d955 --- lams_tool_gmap/web/pages/learning/gmap.jsp (.../gmap.jsp) (revision e1053836420dd4940305875bd72be4639bab407e) +++ lams_tool_gmap/web/pages/learning/gmap.jsp (.../gmap.jsp) (revision 78d238fd8e412e53dbe46d1d8f2a2b572139d955) @@ -16,11 +16,11 @@ ${gmapDTO.title} - - + +

${gmapDTO.instructions}

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