Index: lams_common/src/java/org/lamsfoundation/lams/web/servlet/AbstractExportPortfolioServlet.java =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/web/servlet/AbstractExportPortfolioServlet.java,v diff -u -r1.10 -r1.11 --- lams_common/src/java/org/lamsfoundation/lams/web/servlet/AbstractExportPortfolioServlet.java 17 Sep 2006 06:14:21 -0000 1.10 +++ lams_common/src/java/org/lamsfoundation/lams/web/servlet/AbstractExportPortfolioServlet.java 21 Nov 2007 00:44:39 -0000 1.11 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java,v diff -u -r1.18 -r1.19 --- lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java 28 Jun 2007 06:43:59 -0000 1.18 +++ lams_common/src/java/org/lamsfoundation/lams/web/util/AttributeNames.java 21 Nov 2007 00:44:39 -0000 1.19 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_learning/conf/language/lams/ApplicationResources.properties,v diff -u -r1.8 -r1.9 --- lams_learning/conf/language/lams/ApplicationResources.properties 13 Nov 2007 11:50:26 -0000 1.8 +++ lams_learning/conf/language/lams/ApplicationResources.properties 21 Nov 2007 00:46:50 -0000 1.9 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/PortfolioBuilder.java,v diff -u -r1.12 -r1.13 --- lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/PortfolioBuilder.java 13 Nov 2007 07:42:39 -0000 1.12 +++ lams_learning/src/java/org/lamsfoundation/lams/learning/export/service/PortfolioBuilder.java 21 Nov 2007 00:45:21 -0000 1.13 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_learning/web/exportPortfolio/Attic/offline.jsp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ lams_learning/web/exportPortfolio/offline.jsp 21 Nov 2007 00:47:21 -0000 1.1 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/servlets/ExportServlet.java,v diff -u -r1.7 -r1.8 --- lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/servlets/ExportServlet.java 1 Nov 2006 23:57:58 -0000 1.7 +++ lams_tool_chat/src/java/org/lamsfoundation/lams/tool/chat/web/servlets/ExportServlet.java 21 Nov 2007 00:47:45 -0000 1.8 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/ExportServlet.java,v diff -u -r1.13 -r1.14 --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/ExportServlet.java 7 Nov 2007 23:36:15 -0000 1.13 +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/web/actions/ExportServlet.java 21 Nov 2007 00:47:54 -0000 1.14 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java,v diff -u -r1.15 -r1.16 --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java 15 Aug 2007 03:54:50 -0000 1.15 +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/ExportServlet.java 21 Nov 2007 00:48:02 -0000 1.16 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java,v diff -u -r1.15 -r1.16 --- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 31 May 2007 06:29:43 -0000 1.15 +++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/ExportServlet.java 21 Nov 2007 00:48:14 -0000 1.16 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/servlet/ExportServlet.java,v diff -u -r1.9 -r1.10 --- lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/servlet/ExportServlet.java 8 Nov 2007 00:31:27 -0000 1.9 +++ lams_tool_larsrc/src/java/org/lamsfoundation/lams/tool/rsrc/web/servlet/ExportServlet.java 21 Nov 2007 00:48:33 -0000 1.10 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbExportServlet.java,v diff -u -r1.7 -r1.8 --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbExportServlet.java 17 Sep 2006 06:26:25 -0000 1.7 +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbExportServlet.java 21 Nov 2007 00:48:41 -0000 1.8 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java,v diff -u -r1.6 -r1.7 --- lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java 22 May 2007 07:13:08 -0000 1.6 +++ lams_tool_notebook/src/java/org/lamsfoundation/lams/tool/notebook/web/servlets/ExportServlet.java 21 Nov 2007 00:48:49 -0000 1.7 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java,v diff -u -r1.13 -r1.14 --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java 8 Nov 2007 01:28:44 -0000 1.13 +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java 21 Nov 2007 00:48:59 -0000 1.14 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java,v diff -u -r1.9 -r1.10 --- lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java 16 Nov 2007 07:49:40 -0000 1.9 +++ lams_tool_scribe/src/java/org/lamsfoundation/lams/tool/scribe/web/servlets/ExportServlet.java 21 Nov 2007 00:49:09 -0000 1.10 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java,v diff -u -r1.6 -r1.7 --- lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java 28 Sep 2006 05:44:02 -0000 1.6 +++ lams_tool_survey/src/java/org/lamsfoundation/lams/tool/survey/web/servlet/ExportServlet.java 21 Nov 2007 00:49:19 -0000 1.7 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java,v diff -u -r1.19 -r1.20 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java 28 Sep 2007 01:00:39 -0000 1.19 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java 21 Nov 2007 00:49:30 -0000 1.20 @@ -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;