Index: lams_tool_sbmt/.classpath
===================================================================
diff -u -r6e82909292de55410ca3e9d48ed9a05a7034068e -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/.classpath (.../.classpath) (revision 6e82909292de55410ca3e9d48ed9a05a7034068e)
+++ lams_tool_sbmt/.classpath (.../.classpath) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -8,5 +8,6 @@
+
Index: lams_tool_sbmt/build.xml
===================================================================
diff -u -r70b701967db5c0cbdb29201c2525bccf30d86377 -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/build.xml (.../build.xml) (revision 70b701967db5c0cbdb29201c2525bccf30d86377)
+++ lams_tool_sbmt/build.xml (.../build.xml) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -174,7 +174,7 @@
-
@@ -184,7 +184,7 @@
-
+
Index: lams_tool_sbmt/conf/language/ApplicationResources.properties
===================================================================
diff -u -r70b701967db5c0cbdb29201c2525bccf30d86377 -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 70b701967db5c0cbdb29201c2525bccf30d86377)
+++ lams_tool_sbmt/conf/language/ApplicationResources.properties (.../ApplicationResources.properties) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -98,3 +98,6 @@
#======= End labels: Exported 89 labels for en AU =====
+
+#======== New label since 12/05/2006 =========
+authoring.msg.cancel.save=Do you want to close this window without saving?
\ No newline at end of file
Index: lams_tool_sbmt/conf/xdoclet/struts-actions.xml
===================================================================
diff -u -rcaa2067252ae8e286a8872b400208db6b5fed4eb -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision caa2067252ae8e286a8872b400208db6b5fed4eb)
+++ lams_tool_sbmt/conf/xdoclet/struts-actions.xml (.../struts-actions.xml) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -17,3 +17,7 @@
/>
+
+
+
\ No newline at end of file
Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java
===================================================================
diff -u -rd9c7ddef141d19423b6ab2914d153c2cb748f187 -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java (.../AuthoringAction.java) (revision d9c7ddef141d19423b6ab2914d153c2cb748f187)
+++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/AuthoringAction.java (.../AuthoringAction.java) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -44,6 +44,7 @@
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;
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.sbmt.InstructionFiles;
import org.lamsfoundation.lams.tool.sbmt.SubmitFilesContent;
@@ -151,6 +152,8 @@
} catch (Exception e) {
log.error(e);
}
+
+ request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,Boolean.TRUE);
return mapping.findForward("success");
}
/**
@@ -246,7 +249,7 @@
HttpServletRequest request, HttpServletResponse response) {
Long contentID = new Long(WebUtil.readLongParam(request,AttributeNames.PARAM_TOOL_CONTENT_ID));
-
+ request.getSession().setAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID,contentID);
//get back the upload file list and display them on page
submitFilesService = SubmitFilesServiceProxy.getSubmitFilesService(this
.getServlet().getServletContext());
Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ClearSessionAction.java
===================================================================
diff -u
--- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ClearSessionAction.java (revision 0)
+++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ClearSessionAction.java (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -0,0 +1,52 @@
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * ****************************************************************
+ */
+
+/* $Id$ */
+package org.lamsfoundation.lams.tool.sbmt.web;
+
+import javax.servlet.http.HttpSession;
+
+import org.lamsfoundation.lams.authoring.web.LamsAuthoringFinishAction;
+import org.lamsfoundation.lams.tool.ToolAccessMode;
+import org.lamsfoundation.lams.tool.sbmt.util.SbmtConstants;
+import org.lamsfoundation.lams.web.util.AttributeNames;
+
+/**
+ * This class give a chance to clear HttpSession when user save/close authoring page.
+ * @author Steve.Ni
+ *
+ * @version $Revision$
+ */
+public class ClearSessionAction extends LamsAuthoringFinishAction {
+
+ @Override
+ public void clearSession(HttpSession session, ToolAccessMode mode) {
+ if(mode.isAuthor()){
+ session.removeAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID);
+ session.removeAttribute(SbmtConstants.ATTACHMENT_LIST);
+ session.removeAttribute(SbmtConstants.DELETED_ATTACHMENT_LIST);
+ }
+ }
+
+
+}
Index: lams_tool_sbmt/web/WEB-INF/lams.tld
===================================================================
diff -u -r9bf9b53faf1c91294d4c2d9a306cb896e131d373 -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/web/WEB-INF/lams.tld (.../lams.tld) (revision 9bf9b53faf1c91294d4c2d9a306cb896e131d373)
+++ lams_tool_sbmt/web/WEB-INF/lams.tld (.../lams.tld) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -275,7 +275,11 @@
/WEB-INF/tags/SetEditor.tag
+ AuthoringButton
+ /WEB-INF/tags/AuthoringButton.tag
+
+
headItems
/WEB-INF/tags/headItems.tag
-
+
Index: lams_tool_sbmt/web/WEB-INF/struts/struts-config.xml
===================================================================
diff -u -r387e02f25594fa9e7f80e4d3fa7620b28fd9f69f -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 387e02f25594fa9e7f80e4d3fa7620b28fd9f69f)
+++ lams_tool_sbmt/web/WEB-INF/struts/struts-config.xml (.../struts-config.xml) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -211,6 +211,10 @@
/>
+
+
+
Index: lams_tool_sbmt/web/WEB-INF/tags/AuthoringButton.tag
===================================================================
diff -u
--- lams_tool_sbmt/web/WEB-INF/tags/AuthoringButton.tag (revision 0)
+++ lams_tool_sbmt/web/WEB-INF/tags/AuthoringButton.tag (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -0,0 +1,90 @@
+<%
+/****************************************************************
+ * Copyright (C) 2005 LAMS Foundation (http://lamsfoundation.org)
+ * =============================================================
+ * License Information: http://lamsfoundation.org/licensing/lams/2.0/
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2.0
+ * as published by the Free Software Foundation.
+ *
+ * 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
+ * ****************************************************************
+ */
+
+ /**
+ * AuthoringButton.tag
+ * Author: Dapeng Ni
+ * Description: Creates the save/cancel button for authoring page
+ */
+
+ %>
+<%@ tag body-content="scriptless" %>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-html" prefix="html" %>
+
+<%@ attribute name="formID" required="true" rtexprvalue="true" %>
+<%@ attribute name="toolSignature" required="true" rtexprvalue="true" %>
+<%@ attribute name="toolContentID" required="true" rtexprvalue="true" %>
+<%@ attribute name="clearSessionActionUrl" required="true" rtexprvalue="true" %>
+
+<%-- Optional attribute --%>
+<%@ attribute name="accessMode" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="saveButtonLabelKey" required="false" rtexprvalue="true" %>
+<%@ attribute name="cancelConfirmMsgKey" required="false" rtexprvalue="true" %>
+
+<%-- Default value for message key --%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_sbmt/web/WEB-INF/web.xml
===================================================================
diff -u -rad683fcaeabe83c702b599c5c866bb7d30cd7191 -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/web/WEB-INF/web.xml (.../web.xml) (revision ad683fcaeabe83c702b599c5c866bb7d30cd7191)
+++ lams_tool_sbmt/web/WEB-INF/web.xml (.../web.xml) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -248,6 +248,7 @@
STAFF
+ TEACHER
@@ -278,6 +279,7 @@
AUTHOR
STAFF
+ TEACHER
ADMIN
SYSADMIN
Index: lams_tool_sbmt/web/authoring/authoring.jsp
===================================================================
diff -u -re6e6aa4b83b6a5f62f7cae530495663c3bab242e -r4166df6f6aeb3bf252c4365751108e34b5481f67
--- lams_tool_sbmt/web/authoring/authoring.jsp (.../authoring.jsp) (revision e6e6aa4b83b6a5f62f7cae530495663c3bab242e)
+++ lams_tool_sbmt/web/authoring/authoring.jsp (.../authoring.jsp) (revision 4166df6f6aeb3bf252c4365751108e34b5481f67)
@@ -65,10 +65,10 @@
+ focus="title" styleId="authoringForm" enctype="multipart/form-data">
-
+
@@ -100,15 +100,14 @@
-
-
-
-
-
-
-
-
+<%-- Default value
+ cancelButtonLabelKey="label.authoring.cancel.button"
+ saveButtonLabelKey="label.authoring.save.button"
+ cancelConfirmMsgKey="authoring.msg.cancel.save"
+ accessMode="author"
+ --%>
+
+