Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -re2579c7237d999e97bd81743032184a1e79955ed --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAction.java (.../McAction.java) (revision e2579c7237d999e97bd81743032184a1e79955ed) @@ -13,7 +13,7 @@ * * 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 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * * http://www.gnu.org/licenses/gpl.txt @@ -52,7 +52,9 @@ import org.lamsfoundation.lams.tool.mc.pojos.McQueContent; import org.lamsfoundation.lams.tool.mc.service.IMcService; import org.lamsfoundation.lams.tool.mc.service.McServiceProxy; +import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; +import org.lamsfoundation.lams.web.util.AttributeNames; /** * * @author Ozgur Demirtas @@ -188,6 +190,11 @@ AuthoringUtil.readData(request, mcAuthoringForm, false); mcAuthoringForm.resetUserAction(); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + + request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); return null; } @@ -226,6 +233,11 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + Map mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("mapQuestionsContent after shrinking: " + mapQuestionsContent); @@ -373,6 +385,11 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + Map mapWeights= AuthoringUtil.repopulateMap(request, "questionWeight"); request.getSession().setAttribute(MAP_WEIGHTS, mapWeights); @@ -481,11 +498,19 @@ ServletException { /* determine whether the request is from Monitoring url Edit Activity*/ + McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; + logger.debug("mcAuthoringForm : " + mcAuthoringForm); + String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + IMcService mcService =McUtils.getToolService(request); if (mcService == null) { @@ -545,6 +570,10 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, requestByStarter); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + Map mapGeneralOptionsContent=(Map)request.getSession().getAttribute(MAP_GENERAL_OPTIONS_CONTENT); logger.debug("initial test: current mapGeneralOptionsContent: " + mapGeneralOptionsContent); @@ -972,7 +1001,11 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); logger.debug("setting EDIT_OPTIONS_MODE to 1"); @@ -1120,6 +1153,10 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + mcAuthoringForm.setEditOptionsMode(new Integer(1).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(1)); @@ -1257,6 +1294,10 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + Map mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("mapQuestionsContent before move down: " + mapQuestionsContent); @@ -1416,6 +1457,10 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + Map mapQuestionsContent=AuthoringUtil.repopulateMap(request, "questionContent"); logger.debug("mapQuestionsContent before move down: " + mapQuestionsContent); @@ -1549,12 +1594,19 @@ ServletException { logger.debug("dispatching doneOptions..."); + McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; + logger.debug("mcAuthoringForm: " + mcAuthoringForm); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); String destination=McUtils.getDestination(sourceMcStarter); logger.debug("destination: " + destination); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + IMcService mcService =McUtils.getToolService(request); if (mcService == null) { @@ -1565,7 +1617,7 @@ request.getSession().setAttribute(TOOL_SERVICE, mcService); logger.debug("mcService : " + mcService); - + boolean performDoneOptions=performDoneOptions(mapping, form, request, response, false, false); logger.debug("performDoneOptions: " + performDoneOptions); @@ -1614,7 +1666,11 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, requestByStarter); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + mcAuthoringForm.setEditOptionsMode(new Integer(0).toString()); request.getSession().setAttribute(EDIT_OPTIONS_MODE, new Integer(0)); logger.debug("setting EDIT_OPTIONS_MODE to 0"); @@ -1810,6 +1866,11 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; request.getSession().setAttribute(SUBMIT_SUCCESS, new Integer(0)); McUtils.debugMaps(request); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + IMcService mcService =McUtils.getToolService(request); @@ -1868,7 +1929,12 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; IMcService mcService =McUtils.getToolService(request); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); @@ -2356,6 +2422,11 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; IMcService mcService =McUtils.getToolService(request); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); @@ -2417,7 +2488,12 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; IMcService mcService =McUtils.getToolService(request); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); @@ -2478,7 +2554,12 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; IMcService mcService =McUtils.getToolService(request); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); @@ -2570,6 +2651,11 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + logger.debug("will uploadFile for online file:"); McAttachmentDTO mcAttachmentDTO=AuthoringUtil.uploadFile(request, mcAuthoringForm, false); @@ -2644,6 +2730,11 @@ McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; IMcService mcService =McUtils.getToolService(request); + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); logger.debug("sourceMcStarter: " + sourceMcStarter); @@ -2702,6 +2793,10 @@ logger.debug("destination: " + destination); AuthoringUtil.readData(request, mcAuthoringForm, false); + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); mcAuthoringForm.resetUserAction(); @@ -2750,6 +2845,11 @@ McUtils.debugMaps(request); McAuthoringForm mcAuthoringForm = (McAuthoringForm) form; + + String contentFolderID = WebUtil.readStrParam(request, AttributeNames.PARAM_CONTENT_FOLDER_ID); + logger.debug("contentFolderID: " + contentFolderID); + mcAuthoringForm.setContentFolderID(contentFolderID); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceMcStarter = (String) request.getAttribute(SOURCE_MC_STARTER); Index: lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -re2579c7237d999e97bd81743032184a1e79955ed --- lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_lamc/src/java/org/lamsfoundation/lams/tool/mc/web/McAuthoringForm.java (.../McAuthoringForm.java) (revision e2579c7237d999e97bd81743032184a1e79955ed) @@ -14,15 +14,14 @@ * * 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 + * 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.mc.web; -import org.lamsfoundation.lams.tool.mc.web.McLearningForm; import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.tool.mc.McAppConstants; @@ -113,6 +112,7 @@ protected String statsMonitoring; protected String edit; + private String contentFolderID; public void resetUserAction() { @@ -878,5 +878,18 @@ public void setReflectionSubject(String reflectionSubject) { this.reflectionSubject = reflectionSubject; } + + /** + * @return Returns the contentFolderID. + */ + public String getContentFolderID() { + return contentFolderID; + } + /** + * @param contentFolderID The contentFolderID to set. + */ + public void setContentFolderID(String contentFolderID) { + this.contentFolderID = contentFolderID; + } }