Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/beans/AuthoringSessionBean.java =================================================================== diff -u -r2c7fad9a475a52c2c9384bec5dad64a77cc02561 -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/beans/AuthoringSessionBean.java (.../AuthoringSessionBean.java) (revision 2c7fad9a475a52c2c9384bec5dad64a77cc02561) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/beans/AuthoringSessionBean.java (.../AuthoringSessionBean.java) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -28,6 +28,7 @@ import java.util.LinkedList; import java.util.List; +import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.chat.model.ChatAttachment; public class AuthoringSessionBean { @@ -42,7 +43,9 @@ List unsavedOfflineFilesList = new LinkedList(); List deletedFilesList = new LinkedList(); - + + ToolAccessMode mode; + public String getAuthSessionId() { return authSessionId; } @@ -92,4 +95,12 @@ List unsavedOnlineFilesList) { this.unsavedOnlineFilesList = unsavedOnlineFilesList; } + + public ToolAccessMode getMode() { + return mode; + } + + public void setMode(ToolAccessMode mode) { + this.mode = mode; + } } Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/dto/ChatDTO.java =================================================================== diff -u -r4630ac9ce3a1936b940556f7c99c39f3aeca0a40 -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/dto/ChatDTO.java (.../ChatDTO.java) (revision 4630ac9ce3a1936b940556f7c99c39f3aeca0a40) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/dto/ChatDTO.java (.../ChatDTO.java) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -45,6 +45,7 @@ instructions = chat.getInstructions(); onlineInstructions = chat.getOnlineInstructions(); offlineInstructions = chat.getOfflineInstructions(); + contentInUse = chat.getContentInUse(); onlineInstructionsFiles = new TreeSet(); offlineInstructionsFiles = new TreeSet(); @@ -77,14 +78,16 @@ public String onlineInstructions; public String offlineInstructions; - + + public boolean defineLater; + + public boolean contentInUse; + public Set onlineInstructionsFiles; public Set offlineInstructionsFiles; public Set sessionDTOs; - - public boolean chatEditable; public Set getSessionDTOs() { return sessionDTOs; @@ -152,11 +155,11 @@ this.toolContentId = toolContentID; } - public boolean isChatEditable() { - return chatEditable; + public Boolean getContentInUse() { + return contentInUse; } - public void setChatEditable(boolean chatEditable) { - this.chatEditable = chatEditable; + public void setContentInUse(Boolean contentInUse) { + this.contentInUse = contentInUse; } } \ No newline at end of file Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java =================================================================== diff -u -r58e095878c96cda00252c0ba5bd34a025d193116 -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java (.../ChatService.java) (revision 58e095878c96cda00252c0ba5bd34a025d193116) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/service/ChatService.java (.../ChatService.java) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -242,20 +242,27 @@ public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException { - // TODO Auto-generated method stub - + Chat chat = chatDAO.getByContentId(toolContentId); + if(chat == null){ + throw new ToolException("Could not find tool with toolContentID: " + toolContentId); + } + chat.setDefineLater(true); + chatDAO.saveOrUpdate(chat); } public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException { - // TODO Auto-generated method stub - + Chat chat = chatDAO.getByContentId(toolContentId); + if(chat == null){ + throw new ToolException("Could not find tool with toolContentID: " + toolContentId); + } + chat.setRunOffline(true); + chatDAO.saveOrUpdate(chat); } public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException { // TODO Auto-generated method stub - } /** Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/util/ChatConstants.java =================================================================== diff -u -r8196a61e08cee435b3e910d6f80d6197265a51d2 -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/util/ChatConstants.java (.../ChatConstants.java) (revision 8196a61e08cee435b3e910d6f80d6197265a51d2) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/util/ChatConstants.java (.../ChatConstants.java) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -40,6 +40,13 @@ public static final int MONITORING_SUMMARY_MAX_MESSAGES = 5; + + // Attribute names + public static final String ATTR_MESSAGE = "message"; + + // Parameter names + public static final String PARAM_PARENT_PAGE = "parentPage"; + // TODO this is temporary for developement. this should not remain here. static final String XMPPDOMAIN = "shaun.melcoe.mq.edu.au"; static final String XMPPCONFERENCE = "conference.shaun.melcoe.mq.edu.au"; Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/AuthoringAction.java =================================================================== diff -u -ra2247a3aaf24b18f41ace047f494196f50bc6d03 -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision a2247a3aaf24b18f41ace047f494196f50bc6d03) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/AuthoringAction.java (.../AuthoringAction.java) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -42,6 +42,7 @@ import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.authoring.web.AuthoringConstants; import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler; +import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.chat.beans.AuthoringSessionBean; import org.lamsfoundation.lams.tool.chat.model.Chat; import org.lamsfoundation.lams.tool.chat.model.ChatAttachment; @@ -61,6 +62,7 @@ * scope="request" validate="false" * * @struts.action-forward name="success" path="tiles:/authoring/main" + * @struts.action-forward name="message_page" path="tiles:/generic/message" */ public class AuthoringAction extends LamsDispatchAction { @@ -77,9 +79,6 @@ protected ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - // set up the form. - AuthoringForm authForm = (AuthoringForm) form; - // Extract toolContentID from parameters. Long toolContentID = new Long(WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_CONTENT_ID)); @@ -88,13 +87,6 @@ + toolContentID); } - // create a new authoringSessionBean and add to session - AuthoringSessionBean authSession = new AuthoringSessionBean(); - String id = ChatConstants.AUTH_SESSION_ID - + createAuthSessionId(request.getSession()); - authSession.setAuthSessionId(id); - request.getSession().setAttribute(id, authSession); - // set up chatService if (chatService == null) { chatService = ChatServiceProxy.getChatService(this.getServlet() @@ -110,11 +102,42 @@ // TODO NOTE: this causes DB orphans when LD not saved. } + // check if content in use is set + if (chat.getContentInUse()) { + // Cannot edit while content is in use. + request.setAttribute(ChatConstants.ATTR_MESSAGE, getResources(request).getMessage( + "error.content.locked")); + return mapping.findForward("message_page"); + } + + // set the defineLater flag so that learners cannot use content while we + // are editing. + // This flag is released when updateContent is called. + chat.setDefineLater(true); + chatService.saveOrUpdateChat(chat); + + // set the access mode. + ToolAccessMode mode = getAccessMode(request); + request.setAttribute(AttributeNames.ATTR_MODE, mode.toString()); + + // create a new authoringSessionBean and add to session + AuthoringSessionBean authSession = new AuthoringSessionBean(); + String id = ChatConstants.AUTH_SESSION_ID + + createAuthSessionId(request.getSession()); + authSession.setAuthSessionId(id); + authSession.setMode(mode); + request.getSession().setAttribute(id, authSession); + + // set up the form. + AuthoringForm authForm = (AuthoringForm) form; + // populating the AuthoringForm using Chat content - populateAuthForm((AuthoringForm) form, chat); + populateAuthForm(authForm, chat); resetAuthSession(authSession, chat); + authForm.setAuthSession(authSession); authForm.setAuthSessionId(authSession.getAuthSessionId()); + return mapping.findForward("success"); } @@ -133,7 +156,9 @@ public ActionForward updateContent(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - // Local History 10:29, started change. + + setAccessMode(request, form); + // TODO need error checking. AuthoringForm authForm = (AuthoringForm) form; @@ -146,27 +171,27 @@ chatService = ChatServiceProxy.getChatService(this.getServlet() .getServletContext()); } - Chat content = chatService.getChatByContentId(authForm - .getToolContentID()); + Chat chat = chatService.getChatByContentId(authForm.getToolContentID()); // copy form inputs to content - populateChat(content, authForm); + populateChat(chat, authForm); // adding unsaved uploaded files. - Set attachments = content.getChatAttachments(); + Set attachments = chat.getChatAttachments(); if (attachments == null) { attachments = new HashSet(); } attachments.addAll(authSession.getUnsavedOnlineFilesList()); attachments.addAll(authSession.getUnsavedOfflineFilesList()); // Removing attachments marked for deletion. - List deletedAttachments = authSession.getDeletedFilesList(); - for(ChatAttachment delAtt:deletedAttachments) { + List deletedAttachments = authSession + .getDeletedFilesList(); + for (ChatAttachment delAtt : deletedAttachments) { // remove from repository chatService.deleteFromRepository(delAtt.getFileUuid(), delAtt .getFileVersionId()); - + // remove from ChatAttachments Iterator attIter = attachments.iterator(); while (attIter.hasNext()) { @@ -179,71 +204,86 @@ } // set attachments in case it didnt exist - content.setChatAttachments(attachments); + chat.setChatAttachments(attachments); - // saving changes. - content.setUpdateDate(new Date()); - chatService.saveOrUpdateChat(content); + // set the update date + chat.setUpdateDate(new Date()); - request.setAttribute("updateContentSuccess", new Boolean(true)); + // releasing defineLater flag so that learner can start using the tool. + chat.setDefineLater(false); - // update form and return to page. - resetAuthSession(authSession, content); - authForm.setAuthSession(authSession); - - request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,Boolean.TRUE); + // persist changes. + chatService.saveOrUpdateChat(chat); + + request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG, + Boolean.TRUE); + return mapping.findForward("success"); } public ActionForward uploadOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + + setAccessMode(request, form); + return uploadFile(mapping, form, IToolContentHandler.TYPE_ONLINE, request); } public ActionForward uploadOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { + + setAccessMode(request, form); + return uploadFile(mapping, form, IToolContentHandler.TYPE_OFFLINE, request); } public ActionForward deleteOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - - AuthoringForm au = (AuthoringForm)form; - - Long myLong = au.getDeleteFileUuid(); - - return deleteFile(mapping, form, IToolContentHandler.TYPE_ONLINE, request); + + setAccessMode(request, form); + + return deleteFile(mapping, form, IToolContentHandler.TYPE_ONLINE, + request); } public ActionForward deleteOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - return deleteFile(mapping, form, IToolContentHandler.TYPE_OFFLINE, request); + setAccessMode(request, form); + + return deleteFile(mapping, form, IToolContentHandler.TYPE_OFFLINE, + request); } public ActionForward removeUnsavedOnline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - return removeUnsaved(mapping, form, IToolContentHandler.TYPE_ONLINE, request); + setAccessMode(request, form); + + return removeUnsaved(mapping, form, IToolContentHandler.TYPE_ONLINE, + request); } - - public ActionForward removeUnsavedOffline(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - return removeUnsaved(mapping, form, IToolContentHandler.TYPE_OFFLINE, request); + setAccessMode(request, form); + + return removeUnsaved(mapping, form, IToolContentHandler.TYPE_OFFLINE, + request); } /* ========== Private Methods ********** */ - + private ActionForward uploadFile(ActionMapping mapping, ActionForm form, String type, HttpServletRequest request) { + setAccessMode(request, form); + AuthoringForm authForm = (AuthoringForm) form; // retrieving authoring session bean @@ -286,77 +326,84 @@ authForm.setAuthSession(authSession); request.setAttribute("unsavedChanges", new Boolean(true)); + return mapping.findForward("success"); } - private ActionForward deleteFile(ActionMapping mapping, ActionForm form, String type, HttpServletRequest request) { + private ActionForward deleteFile(ActionMapping mapping, ActionForm form, + String type, HttpServletRequest request) { AuthoringForm authForm = (AuthoringForm) form; // retrieving authoring session bean AuthoringSessionBean authSession = (AuthoringSessionBean) request .getSession().getAttribute(authForm.getAuthSessionId()); - + List fileList; if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { fileList = authSession.getOfflineFilesList(); } else { fileList = authSession.getOnlineFilesList(); } - + Iterator iter = fileList.iterator(); - - while(iter.hasNext()) { + + while (iter.hasNext()) { ChatAttachment att = (ChatAttachment) iter.next(); - + if (att.getFileUuid().equals(authForm.getDeleteFileUuid())) { - // move to delete file list, at next updateContent it will be deleted + // move to delete file list, at next updateContent it will be + // deleted authSession.getDeletedFilesList().add(att); - + // remove from this list iter.remove(); break; } } - + authForm.setAuthSession(authSession); request.setAttribute("unsavedChanges", new Boolean(true)); + return mapping.findForward("success"); } - private ActionForward removeUnsaved(ActionMapping mapping, ActionForm form, String type, HttpServletRequest request) { + + private ActionForward removeUnsaved(ActionMapping mapping, ActionForm form, + String type, HttpServletRequest request) { AuthoringForm authForm = (AuthoringForm) form; // retrieving authoring session bean AuthoringSessionBean authSession = (AuthoringSessionBean) request .getSession().getAttribute(authForm.getAuthSessionId()); - + List unsavedAttachments; - + if (StringUtils.equals(IToolContentHandler.TYPE_OFFLINE, type)) { unsavedAttachments = authSession.getUnsavedOfflineFilesList(); } else { unsavedAttachments = authSession.getUnsavedOnlineFilesList(); } - + Iterator iter = unsavedAttachments.iterator(); - while(iter.hasNext()) { + while (iter.hasNext()) { ChatAttachment remAtt = (ChatAttachment) iter.next(); - + if (remAtt.getFileUuid().equals(authForm.getDeleteFileUuid())) { // delete from repository chatService.deleteFromRepository(remAtt.getFileUuid(), remAtt .getFileVersionId()); - - // remove from session list + + // remove from session list iter.remove(); break; - } - } - + } + } + authForm.setAuthSession(authSession); request.setAttribute("unsavedChanges", new Boolean(true)); + return mapping.findForward("success"); } - + /** * Populates a Chat using inputs in AuthoringForm. * @@ -412,4 +459,37 @@ } } } + + /** + * Get ToolAccessMode from HttpRequest parameters. Default value is AUTHOR + * mode. + * + * @param request + * @return + */ + private ToolAccessMode getAccessMode(HttpServletRequest request) { + ToolAccessMode mode; + String modeStr = request.getParameter(AttributeNames.ATTR_MODE); + if (StringUtils.equalsIgnoreCase(modeStr, ToolAccessMode.TEACHER + .toString())) + mode = ToolAccessMode.TEACHER; + else + mode = ToolAccessMode.AUTHOR; + return mode; + } + + /** + * Set the request attribute 'mode'using value stored in + * AuthoringSessionBean. + * + * @param request + * @param form + */ + private void setAccessMode(HttpServletRequest request, ActionForm form) { + AuthoringForm authForm = (AuthoringForm) form; + AuthoringSessionBean authSession = (AuthoringSessionBean) request + .getSession().getAttribute(authForm.getAuthSessionId()); + request.setAttribute(AttributeNames.ATTR_MODE, authSession.getMode() + .toString()); + } } \ No newline at end of file Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/LearningAction.java =================================================================== diff -u -rb870f1d2089affc9df675604f5d509c86b9d1b78 -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/LearningAction.java (.../LearningAction.java) (revision b870f1d2089affc9df675604f5d509c86b9d1b78) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/LearningAction.java (.../LearningAction.java) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -56,7 +56,8 @@ * @version * * @struts.action path="/learning" parameter="dispatch" - * @struts.action-forward name="success" path="tiles:/learning/main" + * @struts.action-forward name="chat_client" path="tiles:/learning/main" + * @struts.action-forward name="message_page" path="tiles:/generic/message" */ public class LearningAction extends LamsDispatchAction { @@ -66,54 +67,82 @@ private IChatService chatService; -public ActionForward unspecified(ActionMapping mapping, ActionForm form, + public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // 'toolSessionID' and 'mode' paramters are expected to be present. // TODO need to catch exceptions and handle errors. - ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, AttributeNames.PARAM_MODE, - MODE_OPTIONAL); - Long toolSessionID = WebUtil.readLongParam(request, AttributeNames.PARAM_TOOL_SESSION_ID); - + ToolAccessMode mode = WebUtil.readToolAccessModeParam(request, + AttributeNames.PARAM_MODE, MODE_OPTIONAL); + + Long toolSessionID = WebUtil.readLongParam(request, + AttributeNames.PARAM_TOOL_SESSION_ID); + // set up chatService if (chatService == null) { chatService = ChatServiceProxy.getChatService(this.getServlet() .getServletContext()); } - - // Retreive the session - ChatSession chatSession = chatService.getSessionBySessionId(toolSessionID); + + // Retrieve the session and content. + ChatSession chatSession = chatService + .getSessionBySessionId(toolSessionID); if (chatSession == null) { - throw new ChatException("Cannot retreive session with toolSessionId" + toolSessionID); + throw new ChatException( + "Cannot retreive session with toolSessionID" + + toolSessionID); } - + + Chat chat = chatSession.getChat(); + + // check defineLater + if (chat.getDefineLater()) { + request.setAttribute(ChatConstants.ATTR_MESSAGE, getResources(request).getMessage( + "message.defineLaterSet")); + return mapping.findForward("message_page"); + } + + // check runOffline + if (chat.getRunOffline()) { + request.setAttribute(ChatConstants.ATTR_MESSAGE, getResources(request).getMessage( + "message.runOfflineSet")); + return mapping.findForward("message_page"); + } + // Retrieve the current user ChatUser chatUser = getCurrentUser(toolSessionID); - + // Create the room if it doesnt exist if (chatSession.getJabberRoom() == null) { chatService.createJabberRoom(chatSession); chatService.saveOrUpdateChatSession(chatSession); - } - - Chat chat = chatSession.getChat(); - + } + request.setAttribute("XMPPDOMAIN", ChatConstants.XMPPDOMAIN); request.setAttribute("USERNAME", chatUser.getUserId()); request.setAttribute("PASSWORD", chatUser.getUserId()); request.setAttribute("CONFERENCEROOM", chatSession.getJabberRoom()); request.setAttribute("NICK", chatUser.getJabberNickname()); request.setAttribute("MODE", "learner"); request.setAttribute("USER_UID", chatUser.getUid()); - request.setAttribute("LEARNER_FINISHED", chatUser.getFinishedActivity()); + request + .setAttribute("LEARNER_FINISHED", chatUser + .getFinishedActivity()); request.setAttribute("LOCK_ON_FINISHED", chat.getLockOnFinished()); - + request.setAttribute("chatTitle", chat.getTitle()); request.setAttribute("chatInstructions", chat.getInstructions()); - - return mapping.findForward("success"); - - } private ChatUser getCurrentUser(Long toolSessionId) { + + // Ensure that the content is use flag is set. + if (!chat.getContentInUse()) { + chat.setContentInUse(new Boolean(true)); + chatService.saveOrUpdateChat(chat); + } + + return mapping.findForward("chat_client"); + } + + private ChatUser getCurrentUser(Long toolSessionId) { UserDTO user = (UserDTO) SessionManager.getSession().getAttribute( AttributeNames.USER); @@ -129,26 +158,28 @@ return chatUser; } - - public ActionForward finishActivity (ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { - + + public ActionForward finishActivity(ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) { + Long chatUserUID = WebUtil.readLongParam(request, "chatUserUID"); - + // set the finished flag ChatUser chatUser = chatService.getUserByUID(chatUserUID); if (chatUser != null) { chatUser.setFinishedActivity(true); chatService.saveOrUpdateChatUser(chatUser); } else { - log.error("finishActivity(): couldn't find ChatUser with uid: " + chatUserUID ); + log.error("finishActivity(): couldn't find ChatUser with uid: " + + chatUserUID); } - + ToolSessionManager sessionMgrService = ChatServiceProxy - .getChatSessionManager(getServlet().getServletContext()); + .getChatSessionManager(getServlet().getServletContext()); // get back login user DTO // get session from shared session. - + HttpSession ss = SessionManager.getSession(); UserDTO user = (UserDTO) ss.getAttribute(AttributeNames.USER); Long userID = new Long(user.getUserID().longValue()); @@ -165,7 +196,7 @@ } catch (IOException e) { throw new ChatException(e); } - + return null; // TODO need to return proper page. } } Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/MonitoringAction.java =================================================================== diff -u -red877d9ed00f97ae1eeb47a0d08417c2ae3f8670 -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision ed877d9ed00f97ae1eeb47a0d08417c2ae3f8670) +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/actions/MonitoringAction.java (.../MonitoringAction.java) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -89,7 +89,7 @@ } Chat chat = chatService.getChatByContentId(toolContentID); ChatDTO chatDTO = new ChatDTO(chat); - + Map sessCountMap = chatService .getMessageCountBySession(chat.getUid()); @@ -125,9 +125,6 @@ chatDTO.getSessionDTOs().add(sessionDTO); } - - chatDTO.setChatEditable(this.isChatEditable(chat)); - request.setAttribute("monitoringDTO", chatDTO); return mapping.findForward("success"); } @@ -238,22 +235,4 @@ return chatUser; } - - // TODO need to double check this. - private boolean isChatEditable(Chat chat) { - if ((chat.getDefineLater() == true) && (chat.getContentInUse() == true)) { - log - .error("An exception has occurred: There is a bug in this tool, conflicting flags are set"); - return false; - } else if ((chat.getDefineLater() == true) - && (chat.getContentInUse() == false)) - return true; - else if ((chat.getDefineLater() == false) - && (chat.getContentInUse() == false)) - return true; - else - // (content.isContentInUse()==true && content.isDefineLater() == - // false) - return false; - } } Index: lams_tool_chat/web/WEB-INF/struts/tiles-defs.xml =================================================================== diff -u -r0ac012d04d1fa2ee4df7139645ba7fecaa8b2a6e -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/web/WEB-INF/struts/tiles-defs.xml (.../tiles-defs.xml) (revision 0ac012d04d1fa2ee4df7139645ba7fecaa8b2a6e) +++ lams_tool_chat/web/WEB-INF/struts/tiles-defs.xml (.../tiles-defs.xml) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -1,39 +1,47 @@ - + - + - + - + + + + + + + + + - - - - - + --> + + + - + @@ -60,25 +66,19 @@ - + - + - + - - - - - - @@ -88,34 +88,23 @@ - + - + - + - + - + - + - - - - - - - - - + Index: lams_tool_chat/web/WEB-INF/tags/AuthoringButton.tag =================================================================== diff -u -r2b3d7902eba19ec19df28ddfdab299f6a794d15b -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 2b3d7902eba19ec19df28ddfdab299f6a794d15b) +++ lams_tool_chat/web/WEB-INF/tags/AuthoringButton.tag (.../AuthoringButton.tag) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -44,6 +44,7 @@ <%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %> <%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %> <%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %> +<%@ attribute name="defineLater" required="false" rtexprvalue="true" %> <%-- Default value for message key --%> @@ -62,22 +63,22 @@

Index: lams_tool_chat/web/common/empty.jsp =================================================================== diff -u --- lams_tool_chat/web/common/empty.jsp (revision 0) +++ lams_tool_chat/web/common/empty.jsp (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -0,0 +1 @@ \ No newline at end of file Index: lams_tool_chat/web/common/message.jsp =================================================================== diff -u --- lams_tool_chat/web/common/message.jsp (revision 0) +++ lams_tool_chat/web/common/message.jsp (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -0,0 +1,5 @@ +<%@ include file="/common/taglibs.jsp"%> + +

+ ${requestScope.message}; +

\ No newline at end of file Index: lams_tool_chat/web/pages/authoring/authoring.jsp =================================================================== diff -u -r0ac012d04d1fa2ee4df7139645ba7fecaa8b2a6e -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 0ac012d04d1fa2ee4df7139645ba7fecaa8b2a6e) +++ lams_tool_chat/web/pages/authoring/authoring.jsp (.../authoring.jsp) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -20,12 +20,6 @@
- - - - - - @@ -37,12 +31,16 @@ + + + + - <%-- Form Controls --%> - +
Index: lams_tool_chat/web/pages/monitoring/editActivity.jsp =================================================================== diff -u -r0ac012d04d1fa2ee4df7139645ba7fecaa8b2a6e -r47041304a9d027531f04cc2a0217b7dda2acc913 --- lams_tool_chat/web/pages/monitoring/editActivity.jsp (.../editActivity.jsp) (revision 0ac012d04d1fa2ee4df7139645ba7fecaa8b2a6e) +++ lams_tool_chat/web/pages/monitoring/editActivity.jsp (.../editActivity.jsp) (revision 47041304a9d027531f04cc2a0217b7dda2acc913) @@ -25,16 +25,19 @@

- + + - +

+ +