Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringAction.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r353b0a8b7e6537666d2a8ccfb75982871e92bdb8 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringAction.java (.../NbAuthoringAction.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringAction.java (.../NbAuthoringAction.java) (revision 353b0a8b7e6537666d2a8ccfb75982871e92bdb8) @@ -34,6 +34,7 @@ import org.apache.struts.action.ActionMapping; import org.apache.struts.util.MessageResources; import org.lamsfoundation.lams.authoring.web.AuthoringConstants; +import org.lamsfoundation.lams.tool.ToolAccessMode; import org.lamsfoundation.lams.tool.noticeboard.NbApplicationException; import org.lamsfoundation.lams.tool.noticeboard.NoticeboardConstants; import org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent; @@ -47,38 +48,25 @@ import org.lamsfoundation.lams.web.util.AttributeNames; /** - * @author mtruong + *
+ * This class is a simple combination of NbAuthoringStarterAction and NbAuthoringAction. It has been created for the + * purpose of supporting the new authoring page which is done using DHTML. + *
* - *- * This class is a simple combination of NbAuthoringStarterAction and NbAuthoringAction. - * It has been created for the purpose of supporting the new authoring page which is done using - * DHTML. - *
+ *+ * The unspecified method, is the same as the execute method for NbAuthoringStarterAction. It will get called when the + * method parameter is not specified (that is on first entry into the authoring environment). + *
* - *- * The unspecified method, is the same as the execute method for NbAuthoringStarterAction. - * It will get called when the method parameter is not specified (that is on first entry - * into the authoring environment). - *
- * - *- * The save, upload and delete method is the same as that of NbAuthoringAction, to see its explanation, - * please see org.lamsfoundation.lams.tool.noticeboard.web.NbAuthoringAction - *
- * - * - * - * - * - * - * - * - * - * + *+ * The save, upload and delete method is the same as that of NbAuthoringAction, to see its explanation, please see + * org.lamsfoundation.lams.tool.noticeboard.web.NbAuthoringAction + *
+ * + * @author mtruong */ - public class NbAuthoringAction extends LamsDispatchAction { - static Logger logger = Logger.getLogger(NbAuthoringAction.class.getName()); + private static Logger logger = Logger.getLogger(NbAuthoringAction.class.getName()); public final static String FORM = "NbAuthoringForm"; /** Get the user from the shared session */ @@ -98,6 +86,10 @@ @Override public ActionForward unspecified(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws NbApplicationException { + /* + * Retrieve the Service + */ + INoticeboardService nbService = NoticeboardServiceProxy.getNbService(getServlet().getServletContext()); //to ensure that we are working with a new form, not one from previous session NbAuthoringForm nbForm = new NbAuthoringForm(); @@ -113,11 +105,6 @@ */ nbForm.setDefineLater(request.getParameter(NoticeboardConstants.DEFINE_LATER)); - /* - * Retrieve the Service - */ - INoticeboardService nbService = NoticeboardServiceProxy.getNbService(getServlet().getServletContext()); - if (!contentExists(nbService, contentId)) { // Pre-fill the form with the default content //NoticeboardContent nb = nbService.retrieveNoticeboard(NoticeboardConstants.DEFAULT_CONTENT_ID); @@ -138,8 +125,8 @@ nbForm.setTitle(nb.getTitle()); nbForm.setBasicContent(nb.getContent()); - } else //content already exists on the database - { + //content already exists on the database + } else { //get the values from the database NoticeboardContent nb = nbService.retrieveNoticeboard(contentId); @@ -154,9 +141,13 @@ */ nbForm.populateFormWithNbContentValues(nb); nbForm.setContentFolderID(contentFolderId); - nb.setDefineLater(Boolean.parseBoolean(nbForm.getDefineLater())); + boolean isDefineLater = Boolean.parseBoolean(nbForm.getDefineLater()); + nb.setDefineLater(isDefineLater); nbService.saveNoticeboard(nb); + if (isDefineLater) { + request.setAttribute(AttributeNames.ATTR_MODE, ToolAccessMode.TEACHER.toString()); + } } request.setAttribute(FORM, nbForm); Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r353b0a8b7e6537666d2a8ccfb75982871e92bdb8 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java (.../NbAuthoringForm.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java (.../NbAuthoringForm.java) (revision 353b0a8b7e6537666d2a8ccfb75982871e92bdb8) @@ -33,8 +33,6 @@ import org.apache.struts.action.ActionMapping; import org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent; -//import org.lamsfoundation.lams.tool.noticeboard.NoticeboardConstants; - /** *ActionForm which holds the state of the noticeboard form content in the Authoring * environment. Stores all values in the session scope.
@@ -47,17 +45,6 @@ * the maximum filesize that can be uploaded is a property that is in the UploadFileUtil. * */ - -/** - * Creation Date: 19-05-05 - * - * - * - * - * - * - */ - public class NbAuthoringForm extends ActionForm { private static final long serialVersionUID = -8425012664714570196L; Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbMonitoringAction.java =================================================================== diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r353b0a8b7e6537666d2a8ccfb75982871e92bdb8 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbMonitoringAction.java (.../NbMonitoringAction.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbMonitoringAction.java (.../NbMonitoringAction.java) (revision 353b0a8b7e6537666d2a8ccfb75982871e92bdb8) @@ -54,25 +54,10 @@ import org.lamsfoundation.lams.web.util.AttributeNames; /** - * @author mtruong - * * The buttons are a switch between tabs and will forward to a jsp and display * the appropriate page. - * - * - */ - -/** - * Creation Date: 14-07-05 * - * - * - * - * - * - * - * - * + * @author mtruong */ public class NbMonitoringAction extends LamsDispatchAction { Index: lams_tool_nb/web/monitoring/monitoring.jsp =================================================================== diff -u -r0f43a76093ebdfc8dfde3de70990efbe5cad56ee -r353b0a8b7e6537666d2a8ccfb75982871e92bdb8 --- lams_tool_nb/web/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 0f43a76093ebdfc8dfde3de70990efbe5cad56ee) +++ lams_tool_nb/web/monitoring/monitoring.jsp (.../monitoring.jsp) (revision 353b0a8b7e6537666d2a8ccfb75982871e92bdb8) @@ -1,6 +1,4 @@ - - <%@ include file="/includes/taglibs.jsp"%> <%@ page import="java.util.HashMap"%> @@ -23,7 +21,6 @@