Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/MonitoringAction.java
===================================================================
diff -u -rcd91e8c512cb9f4e299672e839e5a949cfe349df -r941ce68be457b4cb4fcf2d830a44a9361f6f5370
--- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision cd91e8c512cb9f4e299672e839e5a949cfe349df)
+++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 941ce68be457b4cb4fcf2d830a44a9361f6f5370)
@@ -62,175 +62,160 @@
* @struts.action-forward name="success" path="tiles:/monitoring/main"
* @struts.action-forward name="gmap_display"
* path="tiles:/monitoring/gmap_display"
- * @struts.action-forward name="notebook" path="/pages/monitoring/notebook.jsp"
+ * @struts.action-forward name="notebook" path="/pages/monitoring/notebook.jsp"
*
*/
public class MonitoringAction extends LamsDispatchAction {
- private static Logger log = Logger.getLogger(MonitoringAction.class);
+ private static Logger log = Logger.getLogger(MonitoringAction.class);
- public IGmapService gmapService;
+ public IGmapService gmapService;
- public ActionForward unspecified(ActionMapping mapping, ActionForm form,
- HttpServletRequest request, HttpServletResponse response) {
+ public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
- setupService();
+ setupService();
- Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID));
-
- String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
-
- Gmap gmap = gmapService.getGmapByContentId(toolContentID);
-
- if (gmap == null) {
- // TODO error page.
- }
+ Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID));
- GmapDTO gmapDT0 = new GmapDTO(gmap);
-
- // Adding the markers lists to a map with tool sessions as the key
- //Map > sessionMarkersMap = new HashMap >();
- for (GmapSessionDTO sessionDTO : gmapDT0.getSessionDTOs())
- {
- Long toolSessionID = sessionDTO.getSessionID();
- sessionDTO.setMarkerDTOs(gmapService.getGmapMarkersBySessionId(toolSessionID));
-
- for (GmapUserDTO userDTO :sessionDTO.getUserDTOs())
- {
- // get the notebook entry.
- NotebookEntry notebookEntry = gmapService.getEntry(toolSessionID,
- CoreNotebookConstants.NOTEBOOK_TOOL,
- GmapConstants.TOOL_SIGNATURE, userDTO.getUserId().intValue()
- );
- if (notebookEntry != null)
- {
- userDTO.setFinishedReflection(true);
- //userDTO.setNotebookEntry(notebookEntry.getEntry());
- }
- else
- {
- userDTO.setFinishedReflection(false);
- }
- sessionDTO.getUserDTOs().add(userDTO);
- }
- }
-
- // get the gmap API key from the config table and add it to the session
- GmapConfigItem gmapKey = gmapService.getConfigItem(GmapConfigItem.KEY_GMAP_KEY);
- if (gmapKey != null && gmapKey.getConfigValue() != null)
- {
- request.setAttribute(GmapConstants.ATTR_GMAP_KEY, gmapKey.getConfigValue());
- }
-
- request.setAttribute("gmapDTO", gmapDT0);
- request.setAttribute("contentFolderID", contentFolderID);
- return mapping.findForward("success");
+ String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID);
+
+ Gmap gmap = gmapService.getGmapByContentId(toolContentID);
+
+ if (gmap == null) {
+ // TODO error page.
}
-
- /**
- * set up gmapService
- */
- private void setupService() {
- if (gmapService == null) {
- gmapService = GmapServiceProxy.getGmapService(this
- .getServlet().getServletContext());
+
+ GmapDTO gmapDT0 = new GmapDTO(gmap);
+
+ // Adding the markers lists to a map with tool sessions as the key
+ //Map > sessionMarkersMap = new HashMap >();
+ for (GmapSessionDTO sessionDTO : gmapDT0.getSessionDTOs()) {
+ Long toolSessionID = sessionDTO.getSessionID();
+ sessionDTO.setMarkerDTOs(gmapService.getGmapMarkersBySessionId(toolSessionID));
+
+ for (GmapUserDTO userDTO : sessionDTO.getUserDTOs()) {
+ // get the notebook entry.
+ NotebookEntry notebookEntry = gmapService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL,
+ GmapConstants.TOOL_SIGNATURE, userDTO.getUserId().intValue());
+ if (notebookEntry != null) {
+ userDTO.setFinishedReflection(true);
+ //userDTO.setNotebookEntry(notebookEntry.getEntry());
+ } else {
+ userDTO.setFinishedReflection(false);
}
+ sessionDTO.getUserDTOs().add(userDTO);
+ }
}
-
- /**
- * Allows teachers to edit/remove existing markers
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- * @throws Exception
- */
- public ActionForward saveMarkers(ActionMapping mapping, ActionForm form,
- HttpServletRequest request, HttpServletResponse response) throws Exception
- {
- MonitoringForm monitoringForm = (MonitoringForm) form;
- Long toolSessionID = monitoringForm.getToolSessionID();
- //Long toolSessionID = WebUtil.readLongParam(request, "toolSessionID");
+ // get the gmap API key from the config table and add it to the session
+ GmapConfigItem gmapKey = gmapService.getConfigItem(GmapConfigItem.KEY_GMAP_KEY);
+ if (gmapKey != null && gmapKey.getConfigValue() != null) {
+ request.setAttribute(GmapConstants.ATTR_GMAP_KEY, gmapKey.getConfigValue());
+ }
- GmapUser gmapUser = getCurrentUser(toolSessionID);
+ request.setAttribute("gmapDTO", gmapDT0);
+ request.setAttribute("contentFolderID", contentFolderID);
+ return mapping.findForward("success");
+ }
- if (gmapUser != null) {
+ /**
+ * set up gmapService
+ */
+ private void setupService() {
+ if (gmapService == null) {
+ gmapService = GmapServiceProxy.getGmapService(this.getServlet().getServletContext());
+ }
+ }
- //MonitoringForm monitoringForm = (MonitoringForm) 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();
- gmapService.updateMarkerListFromXML(monitoringForm.getMarkersXML(), gmap, gmapUser, true, gmapSession);
-
- } else {
- log.error("saveMarkers(): couldn't find GmapUser with id: "
- + gmapUser.getUserId() + "and toolSessionID: "
- + toolSessionID);
- }
+ /**
+ * Allows teachers to edit/remove existing markers
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ * @throws Exception
+ */
+ public ActionForward saveMarkers(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) throws Exception {
- return unspecified(mapping, form, request, response);
+ MonitoringForm monitoringForm = (MonitoringForm) form;
+ Long toolSessionID = monitoringForm.getToolSessionID();
+ //Long toolSessionID = WebUtil.readLongParam(request, "toolSessionID");
+
+ GmapUser gmapUser = getCurrentUser(toolSessionID);
+
+ if (gmapUser != null) {
+
+ //MonitoringForm monitoringForm = (MonitoringForm) 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();
+ gmapService.updateMarkerListFromXML(monitoringForm.getMarkersXML(), gmap, gmapUser, true, gmapSession);
+
+ } else {
+ log.error("saveMarkers(): couldn't find GmapUser with id: " + gmapUser.getUserId() + "and toolSessionID: "
+ + toolSessionID);
}
-
- /**
- * Get the current user
- * @param toolSessionId
- * @return
- */
- private GmapUser getCurrentUser(Long toolSessionId) {
- UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(
- AttributeNames.USER);
- // attempt to retrieve user using userId and toolSessionId
- GmapUser gmapUser = gmapService
- .getUserByUserIdAndSessionId(new Long(user.getUserID()
- .intValue()), toolSessionId);
+ return unspecified(mapping, form, request, response);
+ }
- if (gmapUser == null) {
- GmapSession gmapSession = gmapService
- .getSessionBySessionId(toolSessionId);
- gmapUser = gmapService.createGmapUser(user,
- gmapSession);
- }
+ /**
+ * Get the current user
+ *
+ * @param toolSessionId
+ * @return
+ */
+ private GmapUser getCurrentUser(Long toolSessionId) {
+ UserDTO user = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER);
- return gmapUser;
+ // attempt to retrieve user using userId and toolSessionId
+ GmapUser gmapUser = gmapService.getUserByUserIdAndSessionId(new Long(user.getUserID().intValue()),
+ toolSessionId);
+
+ if (gmapUser == null) {
+ GmapSession gmapSession = gmapService.getSessionBySessionId(toolSessionId);
+ gmapUser = gmapService.createGmapUser(user, gmapSession);
}
-
- /**
- * Opens a user's reflection
- * @param mapping
- * @param form
- * @param request
- * @param response
- * @return
- */
- public ActionForward openNotebook(ActionMapping mapping,
- ActionForm form, HttpServletRequest request,
- HttpServletResponse response) {
-
- //MonitoringForm monitorForm = (MonitoringForm) form;
- Long toolSessionId = WebUtil.readLongParam(request, "toolSessionID", false);
- Long userID = WebUtil.readLongParam(request, "userID", false);
-
- GmapUser gmapUser = gmapService.getUserByUserIdAndSessionId(userID, toolSessionId);
-
- NotebookEntry notebookEntry = gmapService.getEntry(toolSessionId,
- CoreNotebookConstants.NOTEBOOK_TOOL,
- GmapConstants.TOOL_SIGNATURE,
- userID.intValue());
-
- GmapUserDTO gmapUserDTO = new GmapUserDTO(gmapUser);
- gmapUserDTO.setNotebookEntry(notebookEntry.getEntry());
-
- request.setAttribute("gmapUserDTO", gmapUserDTO);
-
- return mapping.findForward("notebook");
- }
+
+ return gmapUser;
+ }
+
+ /**
+ * Opens a user's reflection
+ *
+ * @param mapping
+ * @param form
+ * @param request
+ * @param response
+ * @return
+ */
+ public ActionForward openNotebook(ActionMapping mapping, ActionForm form, HttpServletRequest request,
+ HttpServletResponse response) {
+
+ //MonitoringForm monitorForm = (MonitoringForm) form;
+ Long toolSessionId = WebUtil.readLongParam(request, "toolSessionID", false);
+ Long userID = WebUtil.readLongParam(request, "userID", false);
+
+ GmapUser gmapUser = gmapService.getUserByUserIdAndSessionId(userID, toolSessionId);
+
+ NotebookEntry notebookEntry = gmapService.getEntry(toolSessionId, CoreNotebookConstants.NOTEBOOK_TOOL,
+ GmapConstants.TOOL_SIGNATURE, userID.intValue());
+
+ GmapUserDTO gmapUserDTO = new GmapUserDTO(gmapUser);
+ gmapUserDTO.setNotebookEntry(notebookEntry.getEntry());
+
+ request.setAttribute("gmapUserDTO", gmapUserDTO);
+
+ return mapping.findForward("notebook");
+ }
}
Index: lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/servlets/ExportServlet.java
===================================================================
diff -u -ra8324ce68a8de301097e84ef4919751ecd0b8fe8 -r941ce68be457b4cb4fcf2d830a44a9361f6f5370
--- lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision a8324ce68a8de301097e84ef4919751ecd0b8fe8)
+++ lams_tool_gmap/src/java/org/lamsfoundation/lams/tool/gmap/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 941ce68be457b4cb4fcf2d830a44a9361f6f5370)
@@ -55,204 +55,182 @@
public class ExportServlet extends AbstractExportPortfolioServlet {
- private static final long serialVersionUID = -2829707715037631881L;
+ private static final long serialVersionUID = -2829707715037631881L;
- private static Logger logger = Logger.getLogger(ExportServlet.class);
-
- // list of images that need to be copied for export
- static String[] GMAP_IMAGES = {"blue_Marker.png", "paleblue_Marker.png",
- "red_Marker.png", "yellow_Marker.png", "tree_closed.gif", "tree_open.gif"};
+ private static Logger logger = Logger.getLogger(ExportServlet.class);
- private final String FILENAME = "gmap_main.html";
+ // list of images that need to be copied for export
+ static String[] GMAP_IMAGES = { "blue_Marker.png", "paleblue_Marker.png", "red_Marker.png", "yellow_Marker.png",
+ "tree_closed.gif", "tree_open.gif" };
- private IGmapService gmapService;
+ private final String FILENAME = "gmap_main.html";
- protected String doExport(HttpServletRequest request,
- HttpServletResponse response, String directoryName, Cookie[] cookies)
- {
+ private IGmapService gmapService;
- if (gmapService == null) {
- gmapService = GmapServiceProxy.getGmapService(getServletContext());
- }
+ protected String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies) {
- try
- {
- if (StringUtils.equals(mode, ToolAccessMode.LEARNER.toString()))
- {
- request.getSession().setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.LEARNER);
- doLearnerExport(request, response, directoryName, cookies);
- }
- else if (StringUtils.equals(mode, ToolAccessMode.TEACHER.toString()))
- {
- request.getSession().setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER);
- doTeacherExport(request, response, directoryName, cookies);
- }
- }
- catch (GmapException e)
- {
- logger.error("Cannot perform export for gmap tool.");
- }
-
- // get the gmap API key from the config table and add it to the session
- GmapConfigItem gmapKey = gmapService.getConfigItem(GmapConfigItem.KEY_GMAP_KEY);
- if (gmapKey != null && gmapKey.getConfigValue() != null)
- {
- request.getSession().setAttribute(GmapConstants.ATTR_GMAP_KEY, gmapKey.getConfigValue());
- }
-
- String basePath = request.getScheme() + "://" + request.getServerName()
- + ":" + request.getServerPort() + request.getContextPath();
-
- // Attempting to export required images
- try
- {
- CustomToolImageBundler imageBundler = new CustomToolImageBundler();
- imageBundler.bundle(request, cookies, directoryName, getImagesUrlDir(), GMAP_IMAGES);
- }
- catch (Exception e)
- {
- logger.error("Could not export gmap images, some images may be missing in export portfolio", e);
- }
-
-
- writeResponseToFile(basePath + "/pages/export/exportPortfolio.jsp",
- directoryName, FILENAME, cookies);
+ if (gmapService == null) {
+ gmapService = GmapServiceProxy.getGmapService(getServletContext());
+ }
- return FILENAME;
+ try {
+ if (StringUtils.equals(mode, ToolAccessMode.LEARNER.toString())) {
+ request.getSession().setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.LEARNER);
+ doLearnerExport(request, response, directoryName, cookies);
+ } else if (StringUtils.equals(mode, ToolAccessMode.TEACHER.toString())) {
+ request.getSession().setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER);
+ doTeacherExport(request, response, directoryName, cookies);
+ }
+ } catch (GmapException e) {
+ logger.error("Cannot perform export for gmap tool.");
}
- protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
- if (toolContentID == null && toolSessionID == null) {
- logger.error("Tool content Id or and session Id are null. Unable to activity title");
- } else {
- if (gmapService == null) {
- gmapService = GmapServiceProxy.getGmapService(getServletContext());
- }
+ // get the gmap API key from the config table and add it to the session
+ GmapConfigItem gmapKey = gmapService.getConfigItem(GmapConfigItem.KEY_GMAP_KEY);
+ if (gmapKey != null && gmapKey.getConfigValue() != null) {
+ request.getSession().setAttribute(GmapConstants.ATTR_GMAP_KEY, gmapKey.getConfigValue());
+ }
- Gmap content = null;
- if ( toolContentID != null ) {
- content = gmapService.getGmapByContentId(toolContentID);
- } else {
- GmapSession session=gmapService.getSessionBySessionId(toolSessionID);
- if ( session != null )
- content = session.getGmap();
- }
- if ( content != null ) {
- activityTitle = content.getTitle();
- }
- }
- return super.doOfflineExport(request, response, directoryName, cookies);
+ String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
+ + request.getContextPath();
+
+ // Attempting to export required images
+ try {
+ CustomToolImageBundler imageBundler = new CustomToolImageBundler();
+ imageBundler.bundle(request, cookies, directoryName, getImagesUrlDir(), GMAP_IMAGES);
+ } catch (Exception e) {
+ logger.error("Could not export gmap images, some images may be missing in export portfolio", e);
}
-
- private void doLearnerExport(HttpServletRequest request,
- HttpServletResponse response, String directoryName, Cookie[] cookies)
- throws GmapException {
- logger.debug("doExportLearner: toolContentID:" + toolSessionID);
+ writeResponseToFile(basePath + "/pages/export/exportPortfolio.jsp", directoryName, FILENAME, cookies);
- // check if toolContentID available
- if (toolSessionID == null) {
- String error = "Tool Session ID is missing. Unable to continue";
- logger.error(error);
- throw new GmapException(error);
- }
+ return FILENAME;
+ }
- GmapSession gmapSession = gmapService.getSessionBySessionId(toolSessionID);
-
- Gmap gmap = gmapSession.getGmap();
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ if (gmapService == null) {
+ gmapService = GmapServiceProxy.getGmapService(getServletContext());
+ }
- UserDTO lamsUserDTO = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER);
+ Gmap content = null;
+ if (toolContentID != null) {
+ content = gmapService.getGmapByContentId(toolContentID);
+ } else {
+ GmapSession session = gmapService.getSessionBySessionId(toolSessionID);
+ if (session != null)
+ content = session.getGmap();
+ }
+ if (content != null) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
- GmapUser gmapUser = gmapService.getUserByUserIdAndSessionId(new Long(lamsUserDTO.getUserID()),toolSessionID);
- GmapUserDTO gmapUserDTO = new GmapUserDTO(gmapUser);
+ private void doLearnerExport(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies) throws GmapException {
- // construct dto's
- GmapDTO gmapDTO = new GmapDTO(gmap);
- gmapDTO.setGmapMarkers(gmapService.getGmapMarkersBySessionId(toolSessionID));
-
+ logger.debug("doExportLearner: toolContentID:" + toolSessionID);
- GmapSessionDTO sessionDTO = new GmapSessionDTO(gmapSession);
- // if reflectOnActivity is enabled add userDTO.
- if (gmap.isReflectOnActivity()) {
+ // check if toolContentID available
+ if (toolSessionID == null) {
+ String error = "Tool Session ID is missing. Unable to continue";
+ logger.error(error);
+ throw new GmapException(error);
+ }
- // get the entry.
- NotebookEntry entry = gmapService.getEntry(toolSessionID,
- CoreNotebookConstants.NOTEBOOK_TOOL,
- GmapConstants.TOOL_SIGNATURE, gmapUser.getUserId().intValue());
+ GmapSession gmapSession = gmapService.getSessionBySessionId(toolSessionID);
- if (entry != null) {
- gmapUserDTO.finishedReflection = true;
- gmapUserDTO.notebookEntry = entry.getEntry();
- } else {
- gmapUserDTO.finishedReflection = false;
- }
- sessionDTO.getUserDTOs().add(gmapUserDTO);
- }
-
- request.getSession().setAttribute("gmapUserDTO", gmapUserDTO);
- request.getSession().setAttribute("sessionDTO", sessionDTO);
- gmapDTO.getSessionDTOs().add(sessionDTO);
- request.getSession().setAttribute("gmapDTO", gmapDTO);
+ Gmap gmap = gmapSession.getGmap();
+
+ UserDTO lamsUserDTO = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER);
+
+ GmapUser gmapUser = gmapService.getUserByUserIdAndSessionId(new Long(lamsUserDTO.getUserID()), toolSessionID);
+ GmapUserDTO gmapUserDTO = new GmapUserDTO(gmapUser);
+
+ // construct dto's
+ GmapDTO gmapDTO = new GmapDTO(gmap);
+ gmapDTO.setGmapMarkers(gmapService.getGmapMarkersBySessionId(toolSessionID));
+
+ GmapSessionDTO sessionDTO = new GmapSessionDTO(gmapSession);
+ // if reflectOnActivity is enabled add userDTO.
+ if (gmap.isReflectOnActivity()) {
+
+ // get the entry.
+ NotebookEntry entry = gmapService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL,
+ GmapConstants.TOOL_SIGNATURE, gmapUser.getUserId().intValue());
+
+ if (entry != null) {
+ gmapUserDTO.finishedReflection = true;
+ gmapUserDTO.notebookEntry = entry.getEntry();
+ } else {
+ gmapUserDTO.finishedReflection = false;
+ }
+ sessionDTO.getUserDTOs().add(gmapUserDTO);
}
- private void doTeacherExport(HttpServletRequest request,
- HttpServletResponse response, String directoryName, Cookie[] cookies)
- throws GmapException
- {
+ request.getSession().setAttribute("gmapUserDTO", gmapUserDTO);
+ request.getSession().setAttribute("sessionDTO", sessionDTO);
+ gmapDTO.getSessionDTOs().add(sessionDTO);
+ request.getSession().setAttribute("gmapDTO", gmapDTO);
+ }
- logger.debug("doExportTeacher: toolContentID:" + toolContentID);
+ private void doTeacherExport(HttpServletRequest request, HttpServletResponse response, String directoryName,
+ Cookie[] cookies) throws GmapException {
- // check if toolContentID available
- if (toolContentID == null)
- {
- String error = "Tool Content ID is missing. Unable to continue";
- logger.error(error);
- throw new GmapException(error);
- }
+ logger.debug("doExportTeacher: toolContentID:" + toolContentID);
- Gmap gmap = gmapService.getGmapByContentId(toolContentID);
+ // check if toolContentID available
+ if (toolContentID == null) {
+ String error = "Tool Content ID is missing. Unable to continue";
+ logger.error(error);
+ throw new GmapException(error);
+ }
- GmapDTO gmapDTO = new GmapDTO(gmap);
-
- for (GmapSessionDTO gmapSessionDTO : gmapDTO.getSessionDTOs() )
- {
- gmapSessionDTO.setMarkerDTOs(gmapService.getGmapMarkersBySessionId(gmapSessionDTO.getSessionID()));
-
- // if reflectOnActivity is enabled add all userDTO.
- if (gmap.isReflectOnActivity()) {
+ Gmap gmap = gmapService.getGmapByContentId(toolContentID);
- for (GmapUserDTO gmapUserDTO : gmapSessionDTO.getUserDTOs())
- {
- // get the entry.
- NotebookEntry entry = gmapService.getEntry(gmapSessionDTO.getSessionID(),
- CoreNotebookConstants.NOTEBOOK_TOOL,
- GmapConstants.TOOL_SIGNATURE, gmapUserDTO.getUserId()
- .intValue());
- if (entry != null) {
- gmapUserDTO.finishedReflection = true;
- gmapUserDTO.notebookEntry = entry.getEntry();
- } else {
- gmapUserDTO.finishedReflection = false;
- }
- gmapSessionDTO.getUserDTOs().add(gmapUserDTO);
- }
- }
+ GmapDTO gmapDTO = new GmapDTO(gmap);
+
+ for (GmapSessionDTO gmapSessionDTO : gmapDTO.getSessionDTOs()) {
+ gmapSessionDTO.setMarkerDTOs(gmapService.getGmapMarkersBySessionId(gmapSessionDTO.getSessionID()));
+
+ // if reflectOnActivity is enabled add all userDTO.
+ if (gmap.isReflectOnActivity()) {
+
+ for (GmapUserDTO gmapUserDTO : gmapSessionDTO.getUserDTOs()) {
+ // get the entry.
+ NotebookEntry entry = gmapService.getEntry(gmapSessionDTO.getSessionID(),
+ CoreNotebookConstants.NOTEBOOK_TOOL, GmapConstants.TOOL_SIGNATURE, gmapUserDTO.getUserId()
+ .intValue());
+ if (entry != null) {
+ gmapUserDTO.finishedReflection = true;
+ gmapUserDTO.notebookEntry = entry.getEntry();
+ } else {
+ gmapUserDTO.finishedReflection = false;
+ }
+ gmapSessionDTO.getUserDTOs().add(gmapUserDTO);
}
-
- request.getSession().setAttribute("gmapDTO", gmapDTO);
+ }
}
-
- private String getImagesUrlDir()
- {
- String gmapUrlPath = Configuration.get(ConfigurationKeys.SERVER_URL);
- if ( gmapUrlPath == null )
- {
- logger.error("Unable to get path to the LAMS Gmap URL from the configuration table. Gmap images export failed");
- return "";
- } else {
- gmapUrlPath = gmapUrlPath + "/tool/" + GmapConstants.TOOL_SIGNATURE + "/images/";
- return gmapUrlPath;
- }
+
+ request.getSession().setAttribute("gmapDTO", gmapDTO);
+ }
+
+ private String getImagesUrlDir() {
+ String gmapUrlPath = Configuration.get(ConfigurationKeys.SERVER_URL);
+ if (gmapUrlPath == null) {
+ logger
+ .error("Unable to get path to the LAMS Gmap URL from the configuration table. Gmap images export failed");
+ return "";
+ } else {
+ gmapUrlPath = gmapUrlPath + "/tool/" + GmapConstants.TOOL_SIGNATURE + "/images/";
+ return gmapUrlPath;
}
+ }
}
Index: lams_tool_gmap/web/pages/learning/gmap.jsp
===================================================================
diff -u -r6a57078ba37aa7459ac8b400e717e33a350c9cfd -r941ce68be457b4cb4fcf2d830a44a9361f6f5370
--- lams_tool_gmap/web/pages/learning/gmap.jsp (.../gmap.jsp) (revision 6a57078ba37aa7459ac8b400e717e33a350c9cfd)
+++ lams_tool_gmap/web/pages/learning/gmap.jsp (.../gmap.jsp) (revision 941ce68be457b4cb4fcf2d830a44a9361f6f5370)
@@ -28,8 +28,6 @@
${gmapDTO.instructions}
-
-