Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/util/NbWebUtil.java
===================================================================
RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/util/NbWebUtil.java,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/util/NbWebUtil.java 20 Jul 2005 05:26:55 -0000 1.1
@@ -0,0 +1,115 @@
+/*
+ *Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ *
+ *This program is free software; you can redistribute it and/or modify
+ *it under the terms of the GNU General Public License as published by
+ *the Free Software Foundation; either version 2 of the License, or
+ *(at your option) any later version.
+ *
+ *This program is distributed in the hope that it will be useful,
+ *but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ *GNU General Public License for more details.
+ *
+ *You should have received a copy of the GNU General Public License
+ *along with this program; if not, write to the Free Software
+ *Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ *USA
+ *
+ *http://www.gnu.org/licenses/gpl.txt
+ */
+
+
+/*
+ * Created on Jul 20, 2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.lamsfoundation.lams.tool.noticeboard.util;
+
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.lamsfoundation.lams.tool.noticeboard.NbApplicationException;
+import org.lamsfoundation.lams.tool.noticeboard.NoticeboardConstants;
+import org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent;
+
+/**
+ * @author mtruong
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class NbWebUtil {
+
+ private NbWebUtil() {}
+
+ /**
+ * Converts the request parameter toolContentId
, from a string to a Long
+ * @author mtruong
+ */
+
+ public static Long convertToLong(String toolContentId)
+ {
+ Long contentId = new Long(Long.parseLong(toolContentId));
+ return contentId;
+ }
+
+ public static void cleanAuthoringSession(HttpServletRequest request)
+ {
+ request.getSession().removeAttribute(NoticeboardConstants.TOOL_CONTENT_ID);
+ }
+
+ public static void cleanLearnerSession(HttpServletRequest request)
+ {
+ request.getSession().removeAttribute(NoticeboardConstants.READ_ONLY_MODE);
+ // request.getSession().removeAttribute(NoticeboardConstants.IS_TOOL_COMPLETED);
+ }
+
+ public static void cleanMonitoringSession(HttpServletRequest request)
+ {
+ request.getSession().removeAttribute(NoticeboardConstants.TOOL_CONTENT_ID_INMONITORMODE);
+ request.getSession().removeAttribute(NoticeboardConstants.TITLE);
+ request.getSession().removeAttribute(NoticeboardConstants.CONTENT);
+ request.getSession().removeAttribute(NoticeboardConstants.OFFLINE_INSTRUCTIONS);
+ request.getSession().removeAttribute(NoticeboardConstants.ONLINE_INSTRUCTIONS);
+
+ }
+
+ /**
+ *
This method checks the two tool content flags, defineLater and contentInUse
+ * to determine whether the tool content is modifiable or not. Returns true is content is
+ * modifiable and false otherwise
+ *
Tool content is modifiable if:
+ *