Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/Attic/NbAuthoringStarterAction.java,v diff -u -r1.5 -r1.6 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java 20 Jul 2005 04:15:56 -0000 1.5 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringStarterAction.java 20 Jul 2005 05:24:40 -0000 1.6 @@ -43,12 +43,9 @@ import org.lamsfoundation.lams.tool.noticeboard.service.NoticeboardServiceProxy; import org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent; -import org.lamsfoundation.lams.tool.noticeboard.util.NbAuthoringUtil; - import org.lamsfoundation.lams.tool.noticeboard.NbApplicationException; -import org.lamsfoundation.lams.util.WebUtil; -import org.lamsfoundation.lams.tool.noticeboard.util.NbMonitoringUtil; +import org.lamsfoundation.lams.tool.noticeboard.util.NbWebUtil; /**TODO: change into one utility class */ import org.apache.struts.action.ActionMessages; import org.apache.struts.action.ActionMessage; @@ -87,7 +84,7 @@ NbAuthoringForm nbForm = (NbAuthoringForm)form; - Long contentId = NbAuthoringUtil.convertToLong(request.getParameter(NoticeboardConstants.TOOL_CONTENT_ID)); + Long contentId = NbWebUtil.convertToLong(request.getParameter(NoticeboardConstants.TOOL_CONTENT_ID)); nbForm.setToolContentId(contentId.toString()); if(contentId == null) @@ -104,7 +101,7 @@ nbForm.setDefineLater((String)request.getParameter(NoticeboardConstants.DEFINE_LATER)); - NbAuthoringUtil.cleanSession(request); /** TODO: remove this, info no longer stored in session, using ActionForms instead */ + NbWebUtil.cleanAuthoringSession(request); request.getSession().setAttribute(NoticeboardConstants.TOOL_CONTENT_ID, contentId); @@ -126,7 +123,7 @@ nb.getOfflineInstructions(), new Date(System.currentTimeMillis())); - nbContentNew.setDefineLater(true); //the author would currently be editing this content, so set defineLater to true so students cant access activity + nbContentNew = setTrueIfDefineLaterIsSet(nbForm, nbContentNew); //save new tool content into db nbService.saveNoticeboard(nbContentNew); @@ -145,12 +142,12 @@ * author is not allowed to edit content */ - if (NbMonitoringUtil.isContentEditable(nb)) + if (NbWebUtil.isContentEditable(nb)) { /* Define later set to true when the edit activity tab is brought up * So that users cannot start using the content while the staff member is editing the content */ nbForm.populateFormWithNbContentValues(nb); - nb.setDefineLater(true); + nb = setTrueIfDefineLaterIsSet(nbForm, nb); nbService.updateNoticeboard(nb); } else @@ -186,5 +183,18 @@ } + private NoticeboardContent setTrueIfDefineLaterIsSet(NbAuthoringForm form, NoticeboardContent content) + { + if(form.getDefineLater() != null) + { + if (form.getDefineLater().equals("true")) + { + //if the defineLater flag is set to true, then set defineLater in the NoticeboardContent object to true too + content.setDefineLater(true); + } + } + return content; + } + } \ No newline at end of file