Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java,v diff -u -r1.1 -r1.2 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java 3 Apr 2009 00:00:30 -0000 1.1 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/dao/hibernate/MindmapRequestDAO.java 28 Apr 2009 05:33:02 -0000 1.2 @@ -59,7 +59,7 @@ List list = this.getHibernateTemplate().find(SQL_QUERY_FIND_REQUEST_BY_UNIQUE_ID, new Object[]{uniqueId, userId, mindmapId, globalId}); if (list != null && list.size() > 0) - return (MindmapRequest) list.get(0); + return (MindmapRequest) list.get(list.size()-1); else return null; } Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java,v diff -u -r1.4 -r1.5 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java 20 Apr 2009 05:04:42 -0000 1.4 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/LearningAction.java 28 Apr 2009 05:34:17 -0000 1.5 @@ -112,7 +112,7 @@ // Retrieve the session and content. MindmapSession mindmapSession = mindmapService.getSessionBySessionId(toolSessionID); if (mindmapSession == null) { - throw new MindmapException("Cannot retreive session with toolSessionID" + toolSessionID); + throw new MindmapException("Cannot retreive session with toolSessionID: " + toolSessionID); } Mindmap mindmap = mindmapSession.getMindmap(); @@ -184,10 +184,6 @@ } request.setAttribute("mindmapType", mindmapType); - // Saving lastActionID - Long lastActionId = mindmapService.getLastGlobalIdByMindmapId(mindmap.getUid()); - mindmap.setLastActionId(lastActionId); - // pollServer Parameter String pollServerParam = Configuration.get(ConfigurationKeys.SERVER_URL) + "tool/lamind10/learning.do?dispatch=pollServerAction%26mindmapId=" + mindmap.getUid() + "%26userId=" @@ -282,7 +278,9 @@ int requestType = notifyRequestModel.getType(); // TODO: if request was previously created - Long lastActionId = mindmapService.getMindmapByUid(mindmapId).getLastActionId(); + Long lastActionId = WebUtil.readLongParam(request, "lastActionId", false); + //= mindmapService.getMindmapByUid(mindmapId).getLastActionId(); + MindmapRequest mindmapRequest = mindmapService.getRequestByUniqueId(notifyRequestModel.getID(), userId, mindmapId, lastActionId); @@ -304,14 +302,13 @@ if (requestType == 0) { // if node is created not by author or by other user... cannot delete if (mindmapNode.getUser() == mindmapService.getUserByUID(userId)) { - List childNodes = mindmapService - .getMindmapNodeByParentId(notifyRequestModel.getNodeID(), mindmapId); + List childNodes = mindmapService.getMindmapNodeByParentId(notifyRequestModel.getNodeID(), mindmapId); if (childNodes == null || childNodes.size() == 0) // check for Father { mindmapService.deleteNodeByUniqueMindmapUser(notifyRequestModel.getNodeID(), mindmapId, userId); mindmapRequest = saveMindmapRequest(mindmapRequest, requestType, notifyRequestModel, userId, mindmapId, null); - notifyResponse = generateNotifyResponse(1, mindmapRequest.getUniqueId(), null); + notifyResponse = generateNotifyResponse(1, mindmapRequest.getGlobalId(), null); } else notifyResponse = generateNotifyResponse(0, null, null); } else { @@ -330,7 +327,7 @@ .getMindmapByUid(mindmapId)); mindmapRequest = saveMindmapRequest(mindmapRequest, requestType, notifyRequestModel, userId, mindmapId, uniqueId); - notifyResponse = generateNotifyResponse(1, mindmapRequest.getUniqueId(), uniqueId); + notifyResponse = generateNotifyResponse(1, mindmapRequest.getGlobalId(), uniqueId); } // change color else if (requestType == 2) { @@ -340,7 +337,7 @@ mindmapService.saveOrUpdateMindmapNode(mindmapNode); mindmapRequest = saveMindmapRequest(mindmapRequest, requestType, notifyRequestModel, userId, mindmapId, null); - notifyResponse = generateNotifyResponse(1, mindmapRequest.getUniqueId(), null); + notifyResponse = generateNotifyResponse(1, mindmapRequest.getGlobalId(), null); } else { notifyResponse = generateNotifyResponse(0, null, null); } @@ -353,13 +350,16 @@ mindmapService.saveOrUpdateMindmapNode(mindmapNode); mindmapRequest = saveMindmapRequest(mindmapRequest, requestType, notifyRequestModel, userId, mindmapId, null); - notifyResponse = generateNotifyResponse(1, mindmapRequest.getUniqueId(), null); + notifyResponse = generateNotifyResponse(1, mindmapRequest.getGlobalId(), null); } else { notifyResponse = generateNotifyResponse(0, null, null); } } } else { - notifyResponse = generateNotifyResponse(0, null, null); + if (requestType == 1) + notifyResponse = generateNotifyResponse(1, mindmapRequest.getGlobalId(), mindmapRequest.getNodeChildId()); + else + notifyResponse = generateNotifyResponse(1, mindmapRequest.getGlobalId(), null); } try { @@ -450,7 +450,7 @@ if (nodesList != null && nodesList.size() > 0) rootMindmapNode = (MindmapNode) nodesList.get(0); else - log.error("notifyServerAction(): Error finding node while changing text or color!"); + log.error("pollServerAction(): Error finding node while changing text or color!"); } MindmapNode mindmapNode = null; @@ -459,7 +459,7 @@ if (nodesList != null && nodesList.size() > 0) mindmapNode = (MindmapNode) nodesList.get(0); else - log.error("notifyServerAction(): Error finding node while creating a node!"); + log.error("pollServerAction(): Error finding node while creating a node!"); } // delete node if (requestType == 0) { @@ -560,14 +560,18 @@ XStream xstream = new XStream(); xstream.alias("branch", NodeModel.class); String mindmapContent = xstream.toXML(currentNodeModel); - + + // Saving lastActionID + Long lastActionId = mindmapService.getLastGlobalIdByMindmapId(mindmap.getUid()); + //mindmap.setLastActionId(lastActionId); + // adding lastActionId if (mindmap.isMultiUserMode()) if (mindmap.isLockOnFinished() && !mindmapUser.isFinishedActivity()) - mindmapContent = "\n" + mindmapContent + "\n" + mindmap.getLastActionId() + mindmapContent = "\n" + mindmapContent + "\n" + lastActionId + "\n"; else if (!mindmap.isLockOnFinished()) - mindmapContent = "\n" + mindmapContent + "\n" + mindmap.getLastActionId() + mindmapContent = "\n" + mindmapContent + "\n" + lastActionId + "\n"; try { Index: lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java,v diff -u -r1.4 -r1.5 --- lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java 20 Apr 2009 05:04:42 -0000 1.4 +++ lams_tool_mindmap/src/java/org/lamsfoundation/lams/tool/mindmap/web/actions/MonitoringAction.java 28 Apr 2009 05:34:17 -0000 1.5 @@ -102,7 +102,7 @@ request.setAttribute("mindmapDTO", mindmapDTO); request.setAttribute("contentFolderID", contentFolderID); request.setAttribute("isGroupedActivity", isGroupedActivity); - request.setAttribute("toolSessionID", session.getUid()); + request.setAttribute("toolSessionID", session.getSessionId()); return mapping.findForward("success"); } Index: lams_tool_mindmap/web/images/mindmap_locked.swf =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/images/mindmap_locked.swf,v diff -u -r1.4 -r1.5 Binary files differ Index: lams_tool_mindmap/web/images/mindmap_multiuser.swf =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/images/mindmap_multiuser.swf,v diff -u -r1.4 -r1.5 Binary files differ Index: lams_tool_mindmap/web/images/mindmap_singleuser.swf =================================================================== RCS file: /usr/local/cvsroot/lams_tool_mindmap/web/images/mindmap_singleuser.swf,v diff -u -r1.4 -r1.5 Binary files differ