Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/notebookApplicationContext.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/notebookApplicationContext.xml,v
diff -u -r1.9.2.1 -r1.9.2.2
--- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/notebookApplicationContext.xml 16 Aug 2014 11:20:42 -0000 1.9.2.1
+++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/notebookApplicationContext.xml 2 Sep 2014 21:20:37 -0000 1.9.2.2
@@ -32,6 +32,8 @@
+
+
Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/INotebookService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/INotebookService.java,v
diff -u -r1.9 -r1.9.2.1
--- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/INotebookService.java 17 Jan 2014 22:10:27 -0000 1.9
+++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/INotebookService.java 2 Sep 2014 21:20:37 -0000 1.9.2.1
@@ -44,71 +44,73 @@
* @params newContentID
* @return
*/
- public Notebook copyDefaultContent(Long newContentID);
+ Notebook copyDefaultContent(Long newContentID);
/**
* Returns an instance of the Notebook tools default content.
*
* @return
*/
- public Notebook getDefaultContent();
+ Notebook getDefaultContent();
/**
* @param toolSignature
* @return
*/
- public Long getDefaultContentIdBySignature(String toolSignature);
+ Long getDefaultContentIdBySignature(String toolSignature);
/**
* @param toolContentID
* @return
*/
- public Notebook getNotebookByContentId(Long toolContentID);
+ Notebook getNotebookByContentId(Long toolContentID);
/**
* @param notebook
*/
- public void saveOrUpdateNotebook(Notebook notebook);
+ void saveOrUpdateNotebook(Notebook notebook);
/**
* @param toolSessionId
* @return
*/
- public NotebookSession getSessionBySessionId(Long toolSessionId);
+ NotebookSession getSessionBySessionId(Long toolSessionId);
/**
* @param notebookSession
*/
- public void saveOrUpdateNotebookSession(NotebookSession notebookSession);
+ void saveOrUpdateNotebookSession(NotebookSession notebookSession);
/**
*
* @param userId
* @param toolSessionId
* @return
*/
- public NotebookUser getUserByUserIdAndSessionId(Long userId, Long toolSessionId);
+ NotebookUser getUserByUserIdAndSessionId(Long userId, Long toolSessionId);
/**
*
* @param uid
* @return
*/
- public NotebookUser getUserByUID(Long uid);
+ NotebookUser getUserByUID(Long uid);
/**
*
* @param notebookUser
*/
- public void saveOrUpdateNotebookUser(NotebookUser notebookUser);
+ void saveOrUpdateNotebookUser(NotebookUser notebookUser);
/**
*
* @param user
* @param notebookSession
* @return
*/
- public NotebookUser createNotebookUser(UserDTO user, NotebookSession notebookSession);
+ NotebookUser createNotebookUser(UserDTO user, NotebookSession notebookSession);
+
+ boolean notifyUser(Integer userId, String comment);
/**
*
Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java,v
diff -u -r1.31 -r1.31.2.1
--- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java 6 Jun 2014 16:42:39 -0000 1.31
+++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/service/NotebookService.java 2 Sep 2014 21:20:37 -0000 1.31.2.1
@@ -34,7 +34,7 @@
import org.apache.log4j.Logger;
import org.lamsfoundation.lams.contentrepository.client.IToolContentHandler;
-import org.lamsfoundation.lams.contentrepository.service.IRepositoryService;
+import org.lamsfoundation.lams.events.IEventNotificationService;
import org.lamsfoundation.lams.learning.service.ILearnerService;
import org.lamsfoundation.lams.learningdesign.service.ExportToolContentException;
import org.lamsfoundation.lams.learningdesign.service.IExportToolContentService;
@@ -61,6 +61,7 @@
import org.lamsfoundation.lams.tool.notebook.util.NotebookException;
import org.lamsfoundation.lams.tool.service.ILamsToolService;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
+import org.lamsfoundation.lams.util.MessageService;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.util.audit.IAuditService;
@@ -92,6 +93,10 @@
private IExportToolContentService exportContentService;
private ICoreNotebookService coreNotebookService;
+
+ private IEventNotificationService eventNotificationService;
+
+ private MessageService messageService;
private NotebookOutputFactory notebookOutputFactory;
@@ -408,13 +413,18 @@
saveOrUpdateNotebookUser(notebookUser);
return notebookUser;
}
+
+ @Override
+ public boolean notifyUser(Integer userId, String comment) {
+ boolean isHtmlFormat = false;
- public IAuditService getAuditService() {
- return auditService;
+ return eventNotificationService.sendMessage(null, userId, IEventNotificationService.DELIVERY_METHOD_MAIL,
+ getLocalisedMessage("event.teacher.comment.subject", new Object[] {}),
+ getLocalisedMessage("event.teacher.comment.body", new Object[] { comment }), isHtmlFormat);
}
- public void setAuditService(IAuditService auditService) {
- this.auditService = auditService;
+ private String getLocalisedMessage(String key, Object[] args) {
+ return messageService.getMessage(key, args);
}
/* ===============Methods implemented from ToolContentImport102Manager =============== */
@@ -515,13 +525,29 @@
this.exportContentService = exportContentService;
}
+ public IAuditService getAuditService() {
+ return auditService;
+ }
+
+ public void setAuditService(IAuditService auditService) {
+ this.auditService = auditService;
+ }
+
public ICoreNotebookService getCoreNotebookService() {
return coreNotebookService;
}
public void setCoreNotebookService(ICoreNotebookService coreNotebookService) {
this.coreNotebookService = coreNotebookService;
}
+
+ public void setEventNotificationService(IEventNotificationService eventNotificationService) {
+ this.eventNotificationService = eventNotificationService;
+ }
+
+ public void setMessageService(MessageService messageService) {
+ this.messageService = messageService;
+ }
public NotebookOutputFactory getNotebookOutputFactory() {
return notebookOutputFactory;
Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java,v
diff -u -r1.13 -r1.13.2.1
--- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java 17 Jul 2014 18:04:10 -0000 1.13
+++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/actions/MonitoringAction.java 2 Sep 2014 21:20:37 -0000 1.13.2.1
@@ -24,17 +24,21 @@
package org.lamsfoundation.lams.tool.notebook.web.actions;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
import java.util.TimeZone;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
+import org.lamsfoundation.lams.events.IEventNotificationService;
import org.lamsfoundation.lams.notebook.model.NotebookEntry;
import org.lamsfoundation.lams.tool.notebook.dto.NotebookDTO;
import org.lamsfoundation.lams.tool.notebook.dto.NotebookEntryDTO;
@@ -45,6 +49,7 @@
import org.lamsfoundation.lams.tool.notebook.service.INotebookService;
import org.lamsfoundation.lams.tool.notebook.service.NotebookServiceProxy;
import org.lamsfoundation.lams.tool.notebook.util.NotebookConstants;
+import org.lamsfoundation.lams.usermanagement.User;
import org.lamsfoundation.lams.usermanagement.dto.UserDTO;
import org.lamsfoundation.lams.util.DateUtil;
import org.lamsfoundation.lams.util.WebUtil;
@@ -122,17 +127,23 @@
HttpServletRequest request, HttpServletResponse response) throws Exception {
setupService();
- String teachersComment = WebUtil.readStrParam(request, "teachersComment");
+ String teachersComment = WebUtil.readStrParam(request, "value", true);
Long userUid = WebUtil.readLongParam(request, NotebookConstants.PARAM_USER_UID);
+ boolean isNotifyLearner = WebUtil.readBooleanParam(request, "isNotifyLearner");
NotebookUser user = notebookService.getUserByUID(userUid);
- //check user had available notebook entry
- if (user.getEntryUID() != null) {
- Long toolSessionID = user.getNotebookSession().getSessionId();
- user.setTeachersComment(teachersComment);
- notebookService.saveOrUpdateNotebookUser(user);
+ //check user had available notebook entry and teachersComment is not blank
+ if ((user.getEntryUID() == null) && StringUtils.isNotBlank(teachersComment)) {
+ return null;
}
+ user.setTeachersComment(teachersComment);
+ notebookService.saveOrUpdateNotebookUser(user);
+
+ if (isNotifyLearner) {
+ notebookService.notifyUser(user.getUserId().intValue(), teachersComment);
+ }
+
return null;
}
Fisheye: Tag 1.1.2.1 refers to a dead (removed) revision in file `lams_tool_notebook/web/includes/javascript/jinplace-1.0.1.js'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_tool_notebook/web/pages/monitoring/summary.jsp
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_notebook/web/pages/monitoring/summary.jsp,v
diff -u -r1.15 -r1.15.2.1
--- lams_tool_notebook/web/pages/monitoring/summary.jsp 17 Jul 2014 18:04:10 -0000 1.15
+++ lams_tool_notebook/web/pages/monitoring/summary.jsp 2 Sep 2014 21:20:37 -0000 1.15.2.1
@@ -26,6 +26,27 @@
#session-list > h1 {
margin-left: -10px;
}
+
+ .comment-area {
+ background-color: whitesmoke;
+ }
+
+ .comment-area input.jip-ok-button {
+ margin: 7px 7px 5px 20px;
+ }
+
+ .comment-area input.jip-cancel-button {
+ margin-right: 5px;
+ }
+
+ .comment-area #notify-learner {
+ margin-right: 5px;
+ vertical-align: middle;
+ }
+
+ .jip-button {
+ padding: 4px;
+ }
-
+
+