Index: lams_common/src/java/org/lamsfoundation/lams/web/servlet/AbstractExportPortfolioServlet.java
===================================================================
diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_common/src/java/org/lamsfoundation/lams/web/servlet/AbstractExportPortfolioServlet.java (.../AbstractExportPortfolioServlet.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf)
+++ lams_common/src/java/org/lamsfoundation/lams/web/servlet/AbstractExportPortfolioServlet.java (.../AbstractExportPortfolioServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -29,19 +29,25 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
import java.net.MalformedURLException;
+import java.net.URLEncoder;
import javax.servlet.ServletException;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
+import org.lamsfoundation.lams.util.Configuration;
+import org.lamsfoundation.lams.util.ConfigurationKeys;
import org.lamsfoundation.lams.util.FileUtil;
import org.lamsfoundation.lams.util.HttpUrlConnectionUtil;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.tool.ToolAccessMode;
+import org.lamsfoundation.lams.web.session.SessionManager;
import org.lamsfoundation.lams.web.util.AttributeNames;
@@ -61,6 +67,10 @@
* to the method writeResponseToFile which is responsible for making
* the HttpURLConnection to that url and write the response to disk.
*
+ * If the tool wants to do something special for activities run offline
+ * then it needs to implement doOfflineExport. Otherwise a default
+ * offline message will be displayed.
+ *
* If needed, the tool should be able to generate as many files
* as needed (to fit in with the hierarchical structure)
* although only the name of the main HTML file should be returned.
@@ -75,10 +85,13 @@
private static final String EXPORT_ERROR_MSG = "This activity does not support portfolio export";
private static final String EXPORT_ERROR_FILENAME = "portfolioExportNotSupported.html";
+
protected Long userID = null;
protected Long toolSessionID = null;
protected Long toolContentID = null;
protected String mode = null;
+ protected boolean isOffline = false;
+ protected String activityTitle = null;
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
@@ -88,7 +101,7 @@
Cookie[] cookies = request.getCookies();
-
+
directoryName = WebUtil.readStrParam(request, AttributeNames.PARAM_DIRECTORY_NAME);
//put the path together again, since the given directory was a relative one.
@@ -118,7 +131,12 @@
log.debug("Export is conducted in mode: " + mode);
}
- mainFileName = doExport(request, response, absoluteDirectoryPath, cookies);
+ isOffline = WebUtil.readBooleanParam(request, AttributeNames.PARAM_OFFLINE);
+
+ if ( isOffline )
+ mainFileName = doOfflineExport(request, response, absoluteDirectoryPath, cookies);
+ else
+ mainFileName = doExport(request, response, absoluteDirectoryPath, cookies);
if (log.isDebugEnabled()) {
log.debug("The name of main html file is "+mainFileName);
@@ -154,6 +172,33 @@
*/
abstract protected String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies);
+ /**
+ * This method allows the tool to call all necessary export pages
+ * for when an activity is run offline. A default implementation is
+ * given so that if the tool doesn't want to do anything special, it can
+ * allow the default page to be displayed.
+ * special then it should implement this method.
+ * @param directoryName
+ * @return
+ */
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+
+ String url = Configuration.get(ConfigurationKeys.SERVER_URL) + "/learning/exportPortfolio/offline.jsp";
+
+ // Can't put it on the request easily, as the title doesn't seem to be written out correctly even though
+ // we have encoded it. Can't put it in the ordinary session as we will be calling a URL in the learner web-app
+ // from a tool web-app.
+ HttpSession sharedsession = SessionManager.getSession();
+ if(sharedsession != null){
+ sharedsession.setAttribute("epActivityTitle", activityTitle);
+ writeResponseToFile(url,directoryName, "index.html", cookies);
+ sharedsession.removeAttribute("epActivityTitle");
+ } else {
+ writeResponseToFile(url,directoryName, "index.html", cookies);
+ }
+ return "index.html";
+ }
+
private String checkDirectoryName(String directoryName)
{
String validDirectoryName;
@@ -165,6 +210,7 @@
return validDirectoryName;
}
+
/**
* Sets up the HttpURLCOnnection, it will read the response from
* the URL given by urlToConnectTo
and write it to the
Index: lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java
===================================================================
diff -u -r4ca1b4e69d135a796d7db5eab3206e24e9503619 -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java (.../AttributeNames.java) (revision 4ca1b4e69d135a796d7db5eab3206e24e9503619)
+++ lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java (.../AttributeNames.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -66,6 +66,8 @@
public static final String PARAM_LIB = "library";
+ public static final String PARAM_OFFLINE = "offline";
+
public static final String ATTR_MODE = "mode";
public static final String ATTR_USERNAME = "username";
public static final String ATTR_UPDATE_PROGRESS_BAR = "updateProgressBar";
Index: lams_learning/conf/language/lams/ApplicationResources.properties
===================================================================
diff -u -r2c1bd1d2babb133e68dd1b56f41f2d06897084c4 -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_learning/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 2c1bd1d2babb133e68dd1b56f41f2d06897084c4)
+++ lams_learning/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -82,3 +82,4 @@
#======= End labels: Exported 74 labels for en AU =====
+export.portfolio.run.offline.message=This activity was not done on the computer.
\ No newline at end of file
Index: lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/PortfolioBuilder.java
===================================================================
diff -u -r3992a81b8656ef88ac03e0e751023f301837594a -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/PortfolioBuilder.java (.../PortfolioBuilder.java) (revision 3992a81b8656ef88ac03e0e751023f301837594a)
+++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/PortfolioBuilder.java (.../PortfolioBuilder.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -164,10 +164,10 @@
ToolActivity toolActivity = (ToolActivity) activity;
Tool tool = toolActivity.getTool();
- if (accessMode == ToolAccessMode.LEARNER)
- exportUrlForTool = tool.getExportPortfolioLearnerUrl();
- else
+ if (accessMode == ToolAccessMode.TEACHER)
exportUrlForTool = tool.getExportPortfolioClassUrl();
+ else
+ exportUrlForTool = tool.getExportPortfolioLearnerUrl();
/*
* Append parameters to the export url.
@@ -187,6 +187,7 @@
{
exportUrlForTool = WebUtil.appendParameterToURL(exportUrlForTool, AttributeNames.PARAM_TOOL_CONTENT_ID, toolActivity.getToolContentId().toString());
}
+ exportUrlForTool = WebUtil.appendParameterToURL(exportUrlForTool, AttributeNames.PARAM_OFFLINE, activity.getRunOffline().toString());
}
ActivityPortfolio p = createActivityPortfolio(activity);
@@ -248,6 +249,7 @@
}
exportUrlForTool = WebUtil.appendParameterToURL(exportUrlForTool, AttributeNames.PARAM_ACTIVITY_ID, activity.getActivityId().toString());
exportUrlForTool = WebUtil.appendParameterToURL(exportUrlForTool, AttributeNames.PARAM_LESSON_ID, lesson.getLessonId().toString());
+ exportUrlForTool = WebUtil.appendParameterToURL(exportUrlForTool, AttributeNames.PARAM_OFFLINE, activity.getRunOffline().toString());
}
return exportUrlForTool;
}
Index: lams_learning/web/exportPortfolio/offline.jsp
===================================================================
diff -u
--- lams_learning/web/exportPortfolio/offline.jsp (revision 0)
+++ lams_learning/web/exportPortfolio/offline.jsp (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -0,0 +1,56 @@
+<%--
+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 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
+ USA
+
+ http://www.gnu.org/licenses/gpl.txt
+--%>
+
+<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
+<%@ page import="org.lamsfoundation.lams.web.session.SessionManager" %>
+
+<%@ taglib uri="tags-html" prefix="html"%>
+<%@ taglib uri="tags-core" prefix="c" %>
+<%@ taglib uri="tags-fmt" prefix="fmt" %>
+<%@ taglib uri="tags-lams" prefix="lams" %>
+
+
+
+
+
+<%=SessionManager.getSession().getAttribute("epActivityTitle")%>
+
+ ${activityTitle}
+
+
+
+
+
+
+
+
+
${activityTitle}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/servlets/ExportServlet.java
===================================================================
diff -u -r816d737357c53cf37f8c1805a9baf5d5166cc3c1 -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 816d737357c53cf37f8c1805a9baf5d5166cc3c1)
+++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -93,6 +93,26 @@
return FILENAME;
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ IChatService service = ChatServiceProxy.getChatService(getServletContext());
+ Chat chat = null;
+ if ( toolContentID != null ) {
+ chat = service.getChatByContentId(toolContentID);
+ } else {
+ ChatSession session = chatService.getSessionBySessionId(toolSessionID);
+ if ( session != null )
+ chat = session.getChat();
+ }
+ if ( chat != null ) {
+ activityTitle = chat.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
private void doLearnerExport(HttpServletRequest request,
HttpServletResponse response, String directoryName, Cookie[] cookies)
throws ChatException {
Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/ExportServlet.java
===================================================================
diff -u -r9244b34c4fb2d5f290f730e2417d70aa08caf6bb -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/ExportServlet.java (.../ExportServlet.java) (revision 9244b34c4fb2d5f290f730e2417d70aa08caf6bb)
+++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -79,6 +79,26 @@
}
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ IForumService forumService = ForumServiceProxy.getForumService(getServletContext());
+ Forum forum = null;
+ if ( toolContentID != null ) {
+ forum = forumService.getForumByContentId(toolContentID);
+ } else {
+ ForumToolSession session = forumService.getSessionBySessionId(toolSessionID);
+ if ( session != null )
+ forum = session.getForum();
+ }
+ if ( forum != null ) {
+ activityTitle = forum.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
{
Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java
===================================================================
diff -u -r51190e07e3d8dfaee600d9912e0a3d723363570a -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java (.../ExportServlet.java) (revision 51190e07e3d8dfaee600d9912e0a3d723363570a)
+++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -76,6 +76,26 @@
return FILENAME;
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ IMcService mcService = McServiceProxy.getMcService(getServletContext());
+ McContent content = null;
+ if ( toolContentID != null ) {
+ content=mcService.retrieveMc(toolContentID);
+ } else {
+ McSession session=mcService.retrieveMcSession(toolSessionID);
+ if ( session != null )
+ content = session.getMcContent();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
/**
* learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
*
Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java
===================================================================
diff -u -r2430616cfd8c9d742059dfb24ab85c6ce9186159 -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision 2430616cfd8c9d742059dfb24ab85c6ce9186159)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -69,6 +69,26 @@
return FILENAME;
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ IQaService service = QaServiceProxy.getQaService(getServletContext());
+ QaContent content = null;
+ if ( toolContentID != null ) {
+ content=service.retrieveQa(toolContentID);
+ } else {
+ QaSession session=service.retrieveQaSession(toolSessionID);
+ if ( session != null )
+ content = session.getQaContent();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
{
logger.debug("starting learner mode...");
Index: lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/servlet/ExportServlet.java
===================================================================
diff -u -rd8a763186a3bf55404b11c4f18df68153b9b84c8 -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision d8a763186a3bf55404b11c4f18df68153b9b84c8)
+++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -40,6 +40,7 @@
import org.lamsfoundation.lams.tool.rsrc.ResourceConstants;
import org.lamsfoundation.lams.tool.rsrc.dto.Summary;
import org.lamsfoundation.lams.tool.rsrc.model.Resource;
+import org.lamsfoundation.lams.tool.rsrc.model.ResourceSession;
import org.lamsfoundation.lams.tool.rsrc.model.ResourceUser;
import org.lamsfoundation.lams.tool.rsrc.service.IResourceService;
import org.lamsfoundation.lams.tool.rsrc.service.ResourceApplicationException;
@@ -94,7 +95,29 @@
return FILENAME;
}
+
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ IResourceService service = ResourceServiceProxy.getResourceService(getServletContext());
+ Resource content = null;
+ if ( toolContentID != null ) {
+ content = service.getResourceByContentId(toolContentID);
+ } else {
+ ResourceSession session=service.getResourceSessionBySessionId(toolSessionID);
+ if ( session != null )
+ content = session.getResource();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
+
public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, HashMap sessionMap)
throws ResourceApplicationException {
Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbExportServlet.java
===================================================================
diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbExportServlet.java (.../NbExportServlet.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf)
+++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbExportServlet.java (.../NbExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -28,8 +28,13 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.apache.log4j.Logger;
import org.lamsfoundation.lams.tool.ToolAccessMode;
import org.lamsfoundation.lams.tool.noticeboard.NbApplicationException;
+import org.lamsfoundation.lams.tool.noticeboard.NoticeboardContent;
+import org.lamsfoundation.lams.tool.noticeboard.NoticeboardSession;
+import org.lamsfoundation.lams.tool.noticeboard.service.INoticeboardService;
+import org.lamsfoundation.lams.tool.noticeboard.service.NoticeboardServiceProxy;
import org.lamsfoundation.lams.util.WebUtil;
import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet;
import org.lamsfoundation.lams.web.servlet.ExportPortfolioServletException;
@@ -42,6 +47,29 @@
public class NbExportServlet extends AbstractExportPortfolioServlet {
private final String FILENAME = "nb_main.html";
+ private static Logger logger = Logger.getLogger(NbExportServlet.class);
+
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null)
+ {
+ String error = "Tool content Id or and session Id are null. Unable to set activity title";
+ logger.error(error);
+ } else {
+ INoticeboardService service = NoticeboardServiceProxy.getNbService(getServletContext());
+ NoticeboardContent content = null;
+ if ( toolContentID != null ) {
+ content = service.retrieveNoticeboard(toolContentID);
+ } else {
+ NoticeboardSession session=service.retrieveNoticeboardSession(toolSessionID);
+ if ( session != null )
+ content = session.getNbContent();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
{
Index: lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java
===================================================================
diff -u -r72154354672e85f1117ba5f94044c94477e36a6e -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 72154354672e85f1117ba5f94044c94477e36a6e)
+++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -89,6 +89,29 @@
return FILENAME;
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ if (notebookService == null) {
+ notebookService = NotebookServiceProxy.getNotebookService(getServletContext());
+ }
+
+ Notebook content = null;
+ if ( toolContentID != null ) {
+ content = notebookService.getNotebookByContentId(toolContentID);
+ } else {
+ NotebookSession session=notebookService.getSessionBySessionId(toolSessionID);
+ if ( session != null )
+ content = session.getNotebook();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
private void doLearnerExport(HttpServletRequest request,
HttpServletResponse response, String directoryName, Cookie[] cookies)
throws NotebookException {
Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java
===================================================================
diff -u -r6e4c940264dd2cf14a47b246efa456c71e385ea5 -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java (.../ExportServlet.java) (revision 6e4c940264dd2cf14a47b246efa456c71e385ea5)
+++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -37,7 +37,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
@@ -220,6 +219,27 @@
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ ISubmitFilesService service = SubmitFilesServiceProxy.getSubmitFilesService(getServletContext());
+
+ SubmitFilesContent content = null;
+ if ( toolContentID != null ) {
+ content = service.getSubmitFilesContent(toolContentID);
+ } else {
+ SubmitFilesSession session=service.getSessionById(toolSessionID);
+ if ( session != null )
+ content = session.getContent();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
public Map learner(HttpServletRequest request,
HttpServletResponse response, String directoryName, Cookie[] cookies, ISubmitFilesService sbmtService, HashMap sessionMap) {
Index: lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java
===================================================================
diff -u -r0edacde89fb315c54ed60643a06ef7d3e7b5bb89 -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision 0edacde89fb315c54ed60643a06ef7d3e7b5bb89)
+++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -100,6 +100,26 @@
return FILENAME;
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ IScribeService service = ScribeServiceProxy.getScribeService(getServletContext());
+
+ Scribe content = null;
+ if ( toolContentID != null ) {
+ content = service.getScribeByContentId(toolContentID);
+ } else {
+ ScribeSession session=service.getSessionBySessionId(toolSessionID);
+ if ( session != null )
+ content = session.getScribe();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
private void doLearnerExport(HttpServletRequest request,
HttpServletResponse response, String directoryName, Cookie[] cookies)
throws ScribeException {
Index: lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java
===================================================================
diff -u -r103eacc68afe9e0df0c7bae49c482eb34873165a -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision 103eacc68afe9e0df0c7bae49c482eb34873165a)
+++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -91,6 +91,27 @@
return FILENAME;
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ ISurveyService service = SurveyServiceProxy.getSurveyService(getServletContext());
+
+ Survey content = null;
+ if ( toolContentID != null ) {
+ content = service.getSurveyByContentId(toolContentID);
+ } else {
+ SurveySession session=service.getSurveySessionBySessionId(toolSessionID);
+ if ( session != null )
+ content = session.getSurvey();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
+
public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies, HashMap sessionMap)
throws SurveyApplicationException {
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java
===================================================================
diff -u -r040ca18cc1cfa0972682b6572502802d7a4ad54b -re7046600ee8bfa53d053e0aee33a16b52ad0e8e2
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 040ca18cc1cfa0972682b6572502802d7a4ad54b)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision e7046600ee8bfa53d053e0aee33a16b52ad0e8e2)
@@ -86,6 +86,26 @@
return FILENAME;
}
+ protected String doOfflineExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) {
+ if (toolContentID == null && toolSessionID == null) {
+ logger.error("Tool content Id or and session Id are null. Unable to activity title");
+ } else {
+ IVoteService service = VoteServiceProxy.getVoteService(getServletContext());
+
+ VoteContent content = null;
+ if ( toolContentID != null ) {
+ content = service.retrieveVote(toolContentID);
+ } else {
+ VoteSession session=service.retrieveVoteSession(toolSessionID);
+ if ( session != null )
+ content = session.getVoteContent();
+ }
+ if ( content != null ) {
+ activityTitle = content.getTitle();
+ }
+ }
+ return super.doOfflineExport(request, response, directoryName, cookies);
+ }
public boolean learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies)
{
boolean generateCharts = false;