Index: lams_tool_sbmt/conf/xdoclet/filter-mappings.xml =================================================================== diff -u -r0b91d14af990013a1f529eca5d701ebe37a5fc73 -r962c5c1d7944295ea119ff346b96f2bcd8f49d9d --- lams_tool_sbmt/conf/xdoclet/filter-mappings.xml (.../filter-mappings.xml) (revision 0b91d14af990013a1f529eca5d701ebe37a5fc73) +++ lams_tool_sbmt/conf/xdoclet/filter-mappings.xml (.../filter-mappings.xml) (revision 962c5c1d7944295ea119ff346b96f2bcd8f49d9d) @@ -1,6 +1,6 @@ hibernateFilter - *.do + /* SystemSessionFilter Index: lams_tool_sbmt/conf/xdoclet/servlet-mappings.xml =================================================================== diff -u -rd7aed7203c6ebc9f86f1577f3f037c8a0899d409 -r962c5c1d7944295ea119ff346b96f2bcd8f49d9d --- lams_tool_sbmt/conf/xdoclet/servlet-mappings.xml (.../servlet-mappings.xml) (revision d7aed7203c6ebc9f86f1577f3f037c8a0899d409) +++ lams_tool_sbmt/conf/xdoclet/servlet-mappings.xml (.../servlet-mappings.xml) (revision 962c5c1d7944295ea119ff346b96f2bcd8f49d9d) @@ -9,8 +9,13 @@ - - download - /download/* - + + download + /download/* + + + + exportPortfolio + /exportPortfolio + \ No newline at end of file Index: lams_tool_sbmt/conf/xdoclet/servlets.xml =================================================================== diff -u -r1d178e94bec7d2c17be92d2ae7690135deb2ff54 -r962c5c1d7944295ea119ff346b96f2bcd8f49d9d --- lams_tool_sbmt/conf/xdoclet/servlets.xml (.../servlets.xml) (revision 1d178e94bec7d2c17be92d2ae7690135deb2ff54) +++ lams_tool_sbmt/conf/xdoclet/servlets.xml (.../servlets.xml) (revision 962c5c1d7944295ea119ff346b96f2bcd8f49d9d) @@ -27,6 +27,11 @@ + exportPortfolio + org.lamsfoundation.lams.tool.sbmt.web.ExportServlet + + + Connector com.fredck.FCKeditor.connector.ConnectorServlet Index: lams_tool_sbmt/db/sql/tool_insert.sql =================================================================== diff -u -rde9ff3a0c35e017a3c3d3096ee32e7823f5fc37d -r962c5c1d7944295ea119ff346b96f2bcd8f49d9d --- lams_tool_sbmt/db/sql/tool_insert.sql (.../tool_insert.sql) (revision de9ff3a0c35e017a3c3d3096ee32e7823f5fc37d) +++ lams_tool_sbmt/db/sql/tool_insert.sql (.../tool_insert.sql) (revision 962c5c1d7944295ea119ff346b96f2bcd8f49d9d) @@ -46,10 +46,10 @@ 'tool/lasbmt11/learner.do', 'tool/lasbmt11/authoring.do', 'tool/lasbmt11/definelater.do', -'tool/lasbmt11/export.do', +'tool/lasbmt11/exportPortfolio', 'tool/lasbmt11/monitoring.do', -'tool/lasbmt11/monitoring.do', -'tool/lasbmt11/monitoring.do', +'tool/lasbmt11/contribute.do', +'tool/lasbmt11/moderation.do', NOW() ); Index: lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java =================================================================== diff -u --- lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java (revision 0) +++ lams_tool_sbmt/src/java/org/lamsfoundation/lams/tool/sbmt/web/ExportServlet.java (revision 962c5c1d7944295ea119ff346b96f2bcd8f49d9d) @@ -0,0 +1,128 @@ +/* + *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 + */ +package org.lamsfoundation.lams.tool.sbmt.web; + +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Set; + +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang.StringUtils; +import org.apache.log4j.Logger; +import org.lamsfoundation.lams.tool.ToolAccessMode; +import org.lamsfoundation.lams.tool.sbmt.Learner; +import org.lamsfoundation.lams.tool.sbmt.SubmitFilesContent; +import org.lamsfoundation.lams.tool.sbmt.SubmitFilesSession; +import org.lamsfoundation.lams.tool.sbmt.exception.SubmitFilesException; +import org.lamsfoundation.lams.tool.sbmt.service.ISubmitFilesService; +import org.lamsfoundation.lams.tool.sbmt.service.SubmitFilesServiceProxy; +import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet; + +public class ExportServlet extends AbstractExportPortfolioServlet { + private static final long serialVersionUID = -4529093489007108143L; + private static Logger logger = Logger.getLogger(ExportServlet.class); + private final String FILENAME = "sbmt_main.html"; + + + public String doExport(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) + { + if (StringUtils.equals(mode,ToolAccessMode.LEARNER.toString())){ + learner(request,response,directoryName,cookies); + }else if (StringUtils.equals(mode,ToolAccessMode.TEACHER.toString())){ + teacher(request,response,directoryName,cookies); + } + + String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+request.getContextPath(); + writeResponseToFile(basePath+"/export/exportportfolio.jsp",directoryName,FILENAME,cookies); + + return FILENAME; + } + public void learner(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) + { + + ISubmitFilesService sbmtService = SubmitFilesServiceProxy.getSubmitFilesService(getServletContext()); + + if (userID == null || toolSessionID == null) + { + String error = "Tool session Id or user Id is null. Unable to continue"; + logger.error(error); + throw new SubmitFilesException(error); + } + + Learner learner = sbmtService.getLearner(toolSessionID,userID); + + if (learner == null) + { + String error="The user with user id " + userID + " does not exist in this session or session may not exist."; + logger.error(error); + throw new SubmitFilesException(error); + } + + SubmitFilesContent content = sbmtService.getSubmitFilesContent(toolSessionID); + + if (content == null) + { + String error="The content for this activity has not been defined yet."; + logger.error(error); + throw new SubmitFilesException(error); + } + + } + + public void teacher(HttpServletRequest request, HttpServletResponse response, String directoryName, Cookie[] cookies) + { + ISubmitFilesService sbmtService = SubmitFilesServiceProxy.getSubmitFilesService(getServletContext()); + + //check if toolContentId exists in db or not + if (toolContentID==null) + { + String error="Tool Content Id is missing. Unable to continue"; + logger.error(error); + throw new SubmitFilesException(error); + } + + SubmitFilesContent content = sbmtService.getSubmitFilesContent(toolContentID); + + if (content == null) + { + String error="Data is missing from the database. Unable to Continue"; + logger.error(error); + throw new SubmitFilesException(error); + } + //return FileDetailsDTO list according to the given sessionID + Set sessionList = content.getToolSession(); + Iterator iter = sessionList.iterator(); + Map userFilesMap = new HashMap(); + while(iter.hasNext()){ + SubmitFilesSession session = (SubmitFilesSession) iter.next(); + userFilesMap.putAll(sbmtService.getFilesUploadedBySession(session.getSessionID())); + } + request.getSession().setAttribute("report",userFilesMap); + + + + } + +} Index: lams_tool_sbmt/web/WEB-INF/web.xml =================================================================== diff -u -r1d178e94bec7d2c17be92d2ae7690135deb2ff54 -r962c5c1d7944295ea119ff346b96f2bcd8f49d9d --- lams_tool_sbmt/web/WEB-INF/web.xml (.../web.xml) (revision 1d178e94bec7d2c17be92d2ae7690135deb2ff54) +++ lams_tool_sbmt/web/WEB-INF/web.xml (.../web.xml) (revision 962c5c1d7944295ea119ff346b96f2bcd8f49d9d) @@ -43,7 +43,7 @@ hibernateFilter - *.do + /* SystemSessionFilter @@ -85,6 +85,11 @@ + exportPortfolio + org.lamsfoundation.lams.tool.sbmt.web.ExportServlet + + + Connector com.fredck.FCKeditor.connector.ConnectorServlet @@ -121,11 +126,16 @@ /editor/filemanager/browser/default/connectors/jsp/connector - - download - /download/* - + + download + /download/* + + + exportPortfolio + /exportPortfolio + + 120 Index: lams_tool_sbmt/web/export/exportportfolio.jsp =================================================================== diff -u --- lams_tool_sbmt/web/export/exportportfolio.jsp (revision 0) +++ lams_tool_sbmt/web/export/exportportfolio.jsp (revision 962c5c1d7944295ea119ff346b96f2bcd8f49d9d) @@ -0,0 +1,96 @@ +<%@include file="../sharing/share.jsp" %> + + + + All Learner Submission Details + + + + + + + + + + + + + + + + + + , + , provides following submisstion: + + + + + File Path: + + File Path: + + + + + + + + + + + + + + + + + File Description: + + + Date of Submission: + + + Marks: + + + + + + + + + + + + Comments: + + + + + + + + + + + + + + + + > + > + > + > + + + + + + + + + + +
+ + + + + , + , provides following submisstion: + + + + + File Path: + + File Path: + + + + + + + + + + + + + + + + + File Description: + + + Date of Submission: + + + Marks: + + + + + + + + + + + + Comments: + + + + + + + + + + + + + + + + > + > + > + > + + + + +