Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java =================================================================== diff -u -r1584ef78e1cf4a5bbdc726bda5345d69be190801 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 1584ef78e1cf4a5bbdc726bda5345d69be190801) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteAppConstants.java (.../VoteAppConstants.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -63,12 +63,18 @@ public static final String VOTE_NOMINATION_VIEWER ="voteNominationViewer"; public static final String LEARNER_PROGRESS_USERID ="learnerProgressUserId"; public static final String MAX_NOMINATION_COUNT ="maxNominationCount"; + public static final String ALLOW_TEXT ="allowText"; public static final String ALLOW_TEXT_ENTRY ="allowTextEntry"; public static final String VOTE_CHANGABLE ="voteChangable"; public static final String LOCK_ON_FINISH ="lockOnFinish"; public static final String REPORT_VIEW_ONLY ="reportViewOnly"; public static final String USER_ENTRY ="userEntry"; + public static final String ATTACHMENT_LIST_KEY = "attachmentListKey"; + public static final String DELETED_ATTACHMENT_LIST_KEY = "deletedAttachmentListKey"; + public static final String ACTIVITY_TITLE_KEY = "activityTitleKey"; + public static final String ACTIVITY_INSTRUCTIONS_KEY = "activityInstructionsKey"; + public static final String AUTHORING ="authoring"; public static final String SOURCE_VOTE_STARTER ="sourceVoteStarter"; public static final String REMOVABLE_OPTION_INDEX ="removableOptionIndex"; @@ -79,7 +85,16 @@ public static final String SUBMIT_SUCCESS ="sbmtSuccess"; public static final String REQUEST_LEARNING_REPORT ="requestLearningReport"; public static final String REQUEST_LEARNING_REPORT_PROGRESS ="requestLearningReportProgress"; + public static final String VOTE_GENERAL_AUTHORING_DTO ="voteGeneralAuthoringDTO"; + public static final String MAP_OPTIONS_CONTENT_KEY ="mapOptionsContentKey"; + public static final String HTTP_SESSION_ID ="httpSessionID"; + public static final String DEFAULT_ONLINE_INST ="online instructions"; + public static final String DEFAULT_OFFLINE_INST ="offline instructions"; + public static final String ONLINE_INSTRUCTIONS_KEY = "onlineInstructionsKey"; + public static final String OFFLINE_INSTRUCTIONS_KEY = "offlineInstructionsKey"; + + /* * authoring mode controllers */ @@ -170,9 +185,13 @@ public static final String SUBMIT_OFFLINE_FILE ="submitOfflineFile"; public static final String SUBMIT_ONLINE_FILE ="submitOnlineFile"; public static final String LIST_UPLOADED_OFFLINE_FILENAMES ="listUploadedOfflineFileNames"; + public static final String LIST_UPLOADED_OFFLINE_FILENAMES_KEY ="listUploadedOfflineFileNamesKey"; public static final String LIST_UPLOADED_ONLINE_FILENAMES ="listUploadedOnlineFileNames"; + public static final String LIST_UPLOADED_ONLINE_FILENAMES_KEY ="listUploadedOnlineFileNamesKey"; public static final String LIST_OFFLINEFILES_METADATA ="listOfflineFilesMetadata"; + public static final String LIST_OFFLINEFILES_METADATA_KEY ="listOfflineFilesMetadataKey"; public static final String LIST_ONLINEFILES_METADATA ="listOnlineFilesMetadata"; + public static final String LIST_ONLINEFILES_METADATA_KEY ="listOnlineFilesMetadataKey"; public static final String LIST_VOTE_ALLSESSIONS_DTO ="listVoteAllSessionsDTO"; public static final String ATTACHMENT_LIST ="attachmentList"; public static final String DELETED_ATTACHMENT_LIST ="deletedAttachmentList"; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralAuthoringDTO.java =================================================================== diff -u --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralAuthoringDTO.java (revision 0) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteGeneralAuthoringDTO.java (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -0,0 +1,552 @@ +/*************************************************************************** + * 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 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.vote; + +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang.builder.ToStringBuilder; + + + +/** + *

DTO that holds authoring properties for authoring jsps + *

+ * + * @author Ozgur Demirtas + */ +public class VoteGeneralAuthoringDTO implements Comparable +{ + protected String activeModule; + protected String defineLaterInEditMode; + protected String submissionAttempt; + protected String sbmtSuccess; + protected String exceptionMaxNominationInvalid; + protected String toolContentID; + protected String defaultContentId; + protected String defaultContentIdStr; + protected String isDefineLater; + protected String activityTitle; + protected String activityInstructions; + protected int maxOptionIndex; + protected String defaultOptionContent; + protected String richTextOfflineInstructions; + protected String richTextOnlineInstructions; + + protected List listUploadedOfflineFileNames; + protected List listUploadedOnlineFileNames; + protected List listOfflineFilesMetadata; + protected List listOnlineFilesMetadata; + + protected String onlineInstructions; + protected String offlineInstructions; + + protected String allowText; + protected String voteChangable; + protected String lockOnFinish; + protected String maxNominationCount; + + protected String editActivityEditMode; + protected Map mapOptionsContent; + protected String userExceptionMaxNominationInvalid; + protected String userExceptionNoToolSessions; + protected String userExceptionFilenameEmpty; + protected String isMonitoredContentInUse; + protected String validationError; + protected String userExceptionOptionsDuplicate; + protected String httpSessionID; + + + /** + * @return Returns the httpSessionID. + */ + public String getHttpSessionID() { + return httpSessionID; + } + /** + * @param httpSessionID The httpSessionID to set. + */ + public void setHttpSessionID(String httpSessionID) { + this.httpSessionID = httpSessionID; + } + /** + * @return Returns the maxNominationCount. + */ + public String getMaxNominationCount() { + return maxNominationCount; + } + /** + * @param maxNominationCount The maxNominationCount to set. + */ + public void setMaxNominationCount(String maxNominationCount) { + this.maxNominationCount = maxNominationCount; + } + /** + * @return Returns the activeModule. + */ + public String getActiveModule() { + return activeModule; + } + /** + * @param listOfflineFilesMetadata The listOfflineFilesMetadata to set. + */ + public void setListOfflineFilesMetadata(List listOfflineFilesMetadata) { + this.listOfflineFilesMetadata = listOfflineFilesMetadata; + } + /** + * @param listOnlineFilesMetadata The listOnlineFilesMetadata to set. + */ + public void setListOnlineFilesMetadata(List listOnlineFilesMetadata) { + this.listOnlineFilesMetadata = listOnlineFilesMetadata; + } + /** + * @param listUploadedOnlineFileNames The listUploadedOnlineFileNames to set. + */ + public void setListUploadedOnlineFileNames(List listUploadedOnlineFileNames) { + this.listUploadedOnlineFileNames = listUploadedOnlineFileNames; + } + + + /** + * @return Returns the isMonitoredContentInUse. + */ + public String getIsMonitoredContentInUse() { + return isMonitoredContentInUse; + } + /** + * @param isMonitoredContentInUse The isMonitoredContentInUse to set. + */ + public void setIsMonitoredContentInUse(String isMonitoredContentInUse) { + this.isMonitoredContentInUse = isMonitoredContentInUse; + } + /** + * @param activeModule The activeModule to set. + */ + public void setActiveModule(String activeModule) { + this.activeModule = activeModule; + } + /** + * @return Returns the activityInstructions. + */ + public String getActivityInstructions() { + return activityInstructions; + } + /** + * @param activityInstructions The activityInstructions to set. + */ + public void setActivityInstructions(String activityInstructions) { + this.activityInstructions = activityInstructions; + } + /** + * @return Returns the activityTitle. + */ + public String getActivityTitle() { + return activityTitle; + } + /** + * @param activityTitle The activityTitle to set. + */ + public void setActivityTitle(String activityTitle) { + this.activityTitle = activityTitle; + } + /** + * @return Returns the defaultContentId. + */ + public String getDefaultContentId() { + return defaultContentId; + } + /** + * @param defaultContentId The defaultContentId to set. + */ + public void setDefaultContentId(String defaultContentId) { + this.defaultContentId = defaultContentId; + } + /** + * @return Returns the defaultContentIdStr. + */ + public String getDefaultContentIdStr() { + return defaultContentIdStr; + } + /** + * @param defaultContentIdStr The defaultContentIdStr to set. + */ + public void setDefaultContentIdStr(String defaultContentIdStr) { + this.defaultContentIdStr = defaultContentIdStr; + } + /** + * @return Returns the defaultOptionContent. + */ + public String getDefaultOptionContent() { + return defaultOptionContent; + } + /** + * @param defaultOptionContent The defaultOptionContent to set. + */ + public void setDefaultOptionContent(String defaultOptionContent) { + this.defaultOptionContent = defaultOptionContent; + } + /** + * @return Returns the defineLaterInEditMode. + */ + public String getDefineLaterInEditMode() { + return defineLaterInEditMode; + } + /** + * @param defineLaterInEditMode The defineLaterInEditMode to set. + */ + public void setDefineLaterInEditMode(String defineLaterInEditMode) { + this.defineLaterInEditMode = defineLaterInEditMode; + } + /** + * @return Returns the exceptionMaxNominationInvalid. + */ + public String getExceptionMaxNominationInvalid() { + return exceptionMaxNominationInvalid; + } + /** + * @param exceptionMaxNominationInvalid The exceptionMaxNominationInvalid to set. + */ + public void setExceptionMaxNominationInvalid( + String exceptionMaxNominationInvalid) { + this.exceptionMaxNominationInvalid = exceptionMaxNominationInvalid; + } + /** + * @return Returns the isDefineLater. + */ + public String getIsDefineLater() { + return isDefineLater; + } + /** + * @param isDefineLater The isDefineLater to set. + */ + public void setIsDefineLater(String isDefineLater) { + this.isDefineLater = isDefineLater; + } + + /** + * @return Returns the listUploadedOfflineFileNames. + */ + public List getListUploadedOfflineFileNames() { + return listUploadedOfflineFileNames; + } + /** + * @param listUploadedOfflineFileNames The listUploadedOfflineFileNames to set. + */ + public void setListUploadedOfflineFileNames( + List listUploadedOfflineFileNames) { + this.listUploadedOfflineFileNames = listUploadedOfflineFileNames; + } + /** + * @return Returns the maxOptionIndex. + */ + public int getMaxOptionIndex() { + return maxOptionIndex; + } + /** + * @param maxOptionIndex The maxOptionIndex to set. + */ + public void setMaxOptionIndex(int maxOptionIndex) { + this.maxOptionIndex = maxOptionIndex; + } + /** + * @return Returns the richTextOfflineInstructions. + */ + public String getRichTextOfflineInstructions() { + return richTextOfflineInstructions; + } + /** + * @param richTextOfflineInstructions The richTextOfflineInstructions to set. + */ + public void setRichTextOfflineInstructions( + String richTextOfflineInstructions) { + this.richTextOfflineInstructions = richTextOfflineInstructions; + } + /** + * @return Returns the richTextOnlineInstructions. + */ + public String getRichTextOnlineInstructions() { + return richTextOnlineInstructions; + } + /** + * @param richTextOnlineInstructions The richTextOnlineInstructions to set. + */ + public void setRichTextOnlineInstructions(String richTextOnlineInstructions) { + this.richTextOnlineInstructions = richTextOnlineInstructions; + } + /** + * @return Returns the sbmtSuccess. + */ + public String getSbmtSuccess() { + return sbmtSuccess; + } + /** + * @param sbmtSuccess The sbmtSuccess to set. + */ + public void setSbmtSuccess(String sbmtSuccess) { + this.sbmtSuccess = sbmtSuccess; + } + /** + * @return Returns the submissionAttempt. + */ + public String getSubmissionAttempt() { + return submissionAttempt; + } + /** + * @param submissionAttempt The submissionAttempt to set. + */ + public void setSubmissionAttempt(String submissionAttempt) { + this.submissionAttempt = submissionAttempt; + } + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + + /** + * @return Returns the offlineInstructions. + */ + public String getOfflineInstructions() { + return offlineInstructions; + } + /** + * @param offlineInstructions The offlineInstructions to set. + */ + public void setOfflineInstructions(String offlineInstructions) { + this.offlineInstructions = offlineInstructions; + } + /** + * @return Returns the onlineInstructions. + */ + public String getOnlineInstructions() { + return onlineInstructions; + } + /** + * @param onlineInstructions The onlineInstructions to set. + */ + public void setOnlineInstructions(String onlineInstructions) { + this.onlineInstructions = onlineInstructions; + } + /** + * @return Returns the listOfflineFilesMetadata. + */ + public List getListOfflineFilesMetadata() { + return listOfflineFilesMetadata; + } + /** + * @return Returns the listOnlineFilesMetadata. + */ + public List getListOnlineFilesMetadata() { + return listOnlineFilesMetadata; + } + /** + * @return Returns the listUploadedOnlineFileNames. + */ + public List getListUploadedOnlineFileNames() { + return listUploadedOnlineFileNames; + } + + + /** + * @return Returns the allowText. + */ + public String getAllowText() { + return allowText; + } + /** + * @param allowText The allowText to set. + */ + public void setAllowText(String allowText) { + this.allowText = allowText; + } + /** + * @return Returns the lockOnFinish. + */ + public String getLockOnFinish() { + return lockOnFinish; + } + /** + * @param lockOnFinish The lockOnFinish to set. + */ + public void setLockOnFinish(String lockOnFinish) { + this.lockOnFinish = lockOnFinish; + } + /** + * @return Returns the voteChangable. + */ + public String getVoteChangable() { + return voteChangable; + } + /** + * @param voteChangable The voteChangable to set. + */ + public void setVoteChangable(String voteChangable) { + this.voteChangable = voteChangable; + } + /** + * @return Returns the mapOptionsContent. + */ + public Map getMapOptionsContent() { + return mapOptionsContent; + } + /** + * @param mapOptionsContent The mapOptionsContent to set. + */ + public void setMapOptionsContent(Map mapOptionsContent) { + this.mapOptionsContent = mapOptionsContent; + } + + /** + * @return Returns the userExceptionMaxNominationInvalid. + */ + public String getUserExceptionMaxNominationInvalid() { + return userExceptionMaxNominationInvalid; + } + /** + * @param userExceptionMaxNominationInvalid The userExceptionMaxNominationInvalid to set. + */ + public void setUserExceptionMaxNominationInvalid( + String userExceptionMaxNominationInvalid) { + this.userExceptionMaxNominationInvalid = userExceptionMaxNominationInvalid; + } + /** + * @return Returns the userExceptionOptionsDuplicate. + */ + public String getUserExceptionOptionsDuplicate() { + return userExceptionOptionsDuplicate; + } + /** + * @param userExceptionOptionsDuplicate The userExceptionOptionsDuplicate to set. + */ + public void setUserExceptionOptionsDuplicate( + String userExceptionOptionsDuplicate) { + this.userExceptionOptionsDuplicate = userExceptionOptionsDuplicate; + } + /** + * @return Returns the validationError. + */ + public String getValidationError() { + return validationError; + } + /** + * @param validationError The validationError to set. + */ + public void setValidationError(String validationError) { + this.validationError = validationError; + } + + /** + * @return Returns the editActivityEditMode. + */ + public String getEditActivityEditMode() { + return editActivityEditMode; + } + + /** + * @param editActivityEditMode The editActivityEditMode to set. + */ + public void setEditActivityEditMode(String editActivityEditMode) { + this.editActivityEditMode = editActivityEditMode; + } + /** + * @return Returns the userExceptionNoToolSessions. + */ + public String getUserExceptionNoToolSessions() { + return userExceptionNoToolSessions; + } + /** + * @param userExceptionNoToolSessions The userExceptionNoToolSessions to set. + */ + public void setUserExceptionNoToolSessions( + String userExceptionNoToolSessions) { + this.userExceptionNoToolSessions = userExceptionNoToolSessions; + } + + /** + * @return Returns the userExceptionFilenameEmpty. + */ + public String getUserExceptionFilenameEmpty() { + return userExceptionFilenameEmpty; + } + /** + * @param userExceptionFilenameEmpty The userExceptionFilenameEmpty to set. + */ + public void setUserExceptionFilenameEmpty(String userExceptionFilenameEmpty) { + this.userExceptionFilenameEmpty = userExceptionFilenameEmpty; + } + public int compareTo(Object o) + { + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = (VoteGeneralAuthoringDTO) o; + + if (voteGeneralAuthoringDTO == null) + return 1; + else + return 0; + } + + public String toString() { + return new ToStringBuilder(this) + .append("activeModule: ", activeModule) + .append("defineLaterInEditMode: ", defineLaterInEditMode) + .append("submissionAttempt: ", submissionAttempt) + .append("sbmtSuccess: ", sbmtSuccess) + .append("exceptionMaxNominationInvalid: ", exceptionMaxNominationInvalid) + .append("toolContentID: ", toolContentID) + .append("defaultContentId: ", defaultContentId) + .append("defaultContentIdStr: ", defaultContentIdStr) + .append("isDefineLater: ", isDefineLater) + .append("allowText: ", allowText) + .append("voteChangable: ", voteChangable) + .append("lockOnFinish: ", lockOnFinish) + .append("maxNominationCount: ", maxNominationCount) + .append("activityTitle: ", activityTitle) + .append("activityInstructions: ", activityInstructions) + .append("maxOptionIndex: ", maxOptionIndex) + .append("defaultOptionContent: ", defaultOptionContent) + .append("richTextOfflineInstructions: ", richTextOfflineInstructions) + .append("richTextOnlineInstructions: ", richTextOnlineInstructions) + .append("listUploadedOfflineFileNames: ", listUploadedOfflineFileNames) + .append("listUploadedOnlineFileNames: ", listUploadedOnlineFileNames) + .append("listOfflineFilesMetadata: ", listOfflineFilesMetadata) + .append("listOnlineFilesMetadata: ", listOnlineFilesMetadata) + .append("mapOptionsContent: ", mapOptionsContent) + .append("onlineInstructions: ", onlineInstructions) + .append("offlineInstructions: ", offlineInstructions) + .append("userExceptionMaxNominationInvalid: ", userExceptionMaxNominationInvalid) + .append("userExceptionFilenameEmpty: ", userExceptionFilenameEmpty) + .append("isMonitoredContentInUse: ", isMonitoredContentInUse) + .append("validationError: ", validationError) + .append("userExceptionOptionsDuplicate: ", userExceptionOptionsDuplicate) + .append("userExceptionNoToolSessions: ", userExceptionNoToolSessions) + .append("httpSessionID: ", httpSessionID) + .append("editActivityEditMode: ", editActivityEditMode) + .toString(); + } +} Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/VoteUtils.java (.../VoteUtils.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -180,27 +180,37 @@ } - public static void setDefaultSessionAttributes(HttpServletRequest request, VoteContent defaultVoteContent, VoteAuthoringForm voteAuthoringForm) + public static void readContentValues(HttpServletRequest request, VoteContent defaultVoteContent, + VoteAuthoringForm voteAuthoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { + logger.debug("setting authoring screen properties"); /*should never be null anyway as default content MUST exist in the db*/ if(defaultVoteContent == null) throw new NullPointerException("Default VoteContent cannot be null"); - voteAuthoringForm.setTitle(defaultVoteContent.getTitle()); - voteAuthoringForm.setInstructions(defaultVoteContent.getInstructions()); - voteAuthoringForm.setOnlineInstructions(defaultVoteContent.getOnlineInstructions()); - voteAuthoringForm.setOfflineInstructions(defaultVoteContent.getOfflineInstructions()); + //voteAuthoringForm.setTitle(defaultVoteContent.getTitle()); + //voteAuthoringForm.setInstructions(defaultVoteContent.getInstructions()); - //determine the status of radio boxes + voteAuthoringForm.setAllowText(defaultVoteContent.isAllowText()?ON:OFF); + voteAuthoringForm.setAllowTextEntry(defaultVoteContent.isAllowText()?ON:OFF); voteAuthoringForm.setVoteChangable(defaultVoteContent.isVoteChangable()?ON:OFF); voteAuthoringForm.setLockOnFinish(defaultVoteContent.isLockOnFinish()?ON:OFF); + voteAuthoringForm.setOnlineInstructions(defaultVoteContent.getOnlineInstructions()); + voteAuthoringForm.setOfflineInstructions(defaultVoteContent.getOfflineInstructions()); + + voteGeneralAuthoringDTO.setAllowText(defaultVoteContent.isAllowText()?ON:OFF); + voteGeneralAuthoringDTO.setVoteChangable(defaultVoteContent.isVoteChangable()?ON:OFF); + voteGeneralAuthoringDTO.setLockOnFinish(defaultVoteContent.isLockOnFinish()?ON:OFF); + voteGeneralAuthoringDTO.setOnlineInstructions(defaultVoteContent.getOnlineInstructions()); + voteGeneralAuthoringDTO.setOfflineInstructions(defaultVoteContent.getOfflineInstructions()); String maxNomcount= defaultVoteContent.getMaxNominationCount(); logger.debug("maxNomcount: " + maxNomcount); if (maxNomcount.equals("")) maxNomcount="0"; voteAuthoringForm.setMaxNominationCount(maxNomcount); + voteGeneralAuthoringDTO.setMaxNominationCount(maxNomcount); } @@ -235,7 +245,7 @@ } - public static void saveInSessionRichText(HttpServletRequest request) + public static void saveRichText(HttpServletRequest request, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { logger.debug("doing persistRichText: "); String richTextTitle = request.getParameter(TITLE); @@ -247,30 +257,35 @@ if (richTextTitle != null) { - request.getSession().setAttribute(ACTIVITY_TITLE, richTextTitle); + //request.getSession().setAttribute(ACTIVITY_TITLE, richTextTitle); + voteGeneralAuthoringDTO.setActivityTitle(richTextTitle); } String noHTMLTitle = stripHTML(richTextTitle); logger.debug("noHTMLTitle: " + noHTMLTitle); if (richTextInstructions != null) { - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, richTextInstructions); + //request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, richTextInstructions); + voteGeneralAuthoringDTO.setActivityInstructions(richTextInstructions); } String richTextOfflineInstructions=request.getParameter(RICHTEXT_OFFLINEINSTRUCTIONS); logger.debug("read parameter richTextOfflineInstructions: " + richTextOfflineInstructions); - String richTextOnlineInstructions=request.getParameter(RICHTEXT_ONLINEINSTRUCTIONS); - logger.debug("read parameter richTextOnlineInstructions: " + richTextOnlineInstructions); - + if ((richTextOfflineInstructions != null) && (richTextOfflineInstructions.length() > 0)) { - request.getSession().setAttribute(RICHTEXT_OFFLINEINSTRUCTIONS,richTextOfflineInstructions); + //request.getSession().setAttribute(RICHTEXT_OFFLINEINSTRUCTIONS,richTextOfflineInstructions); + voteGeneralAuthoringDTO.setRichTextOfflineInstructions(richTextOfflineInstructions); } + + String richTextOnlineInstructions=request.getParameter(RICHTEXT_ONLINEINSTRUCTIONS); + logger.debug("read parameter richTextOnlineInstructions: " + richTextOnlineInstructions); if ((richTextOnlineInstructions != null) && (richTextOnlineInstructions.length() > 0)) { - request.getSession().setAttribute(RICHTEXT_ONLINEINSTRUCTIONS,richTextOnlineInstructions); + //request.getSession().setAttribute(RICHTEXT_ONLINEINSTRUCTIONS,richTextOnlineInstructions); + voteGeneralAuthoringDTO.setRichTextOnlineInstructions(richTextOnlineInstructions); } } @@ -454,20 +469,20 @@ } } - public static void setDefineLater(HttpServletRequest request, boolean value) + public static void setDefineLater(HttpServletRequest request, boolean value, IVoteService voteService, String toolContentID) { - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService:" + voteService); + //IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); + //logger.debug("voteService:" + voteService); - Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId:" + toolContentId); + //Long toolContentId=(Long)request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID:" + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("voteContent:" + voteContent); if (voteContent != null) { voteContent.setDefineLater(value); - logger.debug("defineLater has been set to true"); + logger.debug("defineLater has been set to value: " + value); voteService.updateVote(voteContent); } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java =================================================================== diff -u -r1584ef78e1cf4a5bbdc726bda5345d69be190801 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 1584ef78e1cf4a5bbdc726bda5345d69be190801) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/IVoteService.java (.../IVoteService.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -55,7 +55,7 @@ public void createVote(VoteContent voteContent) throws VoteApplicationException; - public VoteContent retrieveVote(Long toolContentId) throws VoteApplicationException; + public VoteContent retrieveVote(Long toolContentID) throws VoteApplicationException; public VoteUsrAttempt getAttemptByUID(Long uid) throws VoteApplicationException; @@ -212,15 +212,15 @@ public void copyToolContent(Long fromContentId, Long toContentId) throws ToolException; - public void setAsDefineLater(Long toolContentId) throws DataMissingException, ToolException; + public void setAsDefineLater(Long toolContentID) throws DataMissingException, ToolException; - public void setAsRunOffline(Long toolContentId) throws DataMissingException, ToolException; + public void setAsRunOffline(Long toolContentID) throws DataMissingException, ToolException; - public void removeToolContent(Long toolContentId, boolean removeSessionData) throws SessionDataExistsException, ToolException; + public void removeToolContent(Long toolContentID, boolean removeSessionData) throws SessionDataExistsException, ToolException; public boolean existsSession(Long toolSessionId); - public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentId) throws ToolException; + public void createToolSession(Long toolSessionId, String toolSessionName, Long toolContentID) throws ToolException; public void removeToolSession(Long toolSessionId) throws DataMissingException, ToolException; Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java =================================================================== diff -u -r22789974b076931e27e1e37ed7d91bd17f4f9cb6 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 22789974b076931e27e1e37ed7d91bd17f4f9cb6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/AuthoringUtil.java (.../AuthoringUtil.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -40,18 +40,17 @@ import org.lamsfoundation.lams.contentrepository.FileException; import org.lamsfoundation.lams.contentrepository.NodeKey; import org.lamsfoundation.lams.contentrepository.RepositoryCheckedException; -import org.lamsfoundation.lams.tool.exception.ToolException; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteAttachmentDTO; import org.lamsfoundation.lams.tool.vote.VoteComparator; -import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteUploadedFile; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; /** * @@ -230,9 +229,10 @@ * @return VoteAttachmentDTO * @throws RepositoryCheckedException */ - public static VoteAttachmentDTO uploadFile(HttpServletRequest request, VoteAuthoringForm voteAuthoringForm, boolean isOfflineFile) throws RepositoryCheckedException + public static VoteAttachmentDTO uploadFile(HttpServletRequest request, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, + boolean isOfflineFile, SessionMap sessionMap) throws RepositoryCheckedException { - logger.debug("doing uploadFile..."); + logger.debug("doing uploadFile...: " + sessionMap); logger.debug("isOfflineFile:" + isOfflineFile); InputStream stream=null; @@ -268,15 +268,17 @@ if (fileName.length() > 0) { - List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES); + //List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES); + List listUploadedOfflineFileNames=(List)sessionMap.get(LIST_UPLOADED_OFFLINE_FILENAMES_KEY); logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames); int index=findFileNameIndex(listUploadedOfflineFileNames, fileName); logger.debug("index:" + index); if (index == 0) { listUploadedOfflineFileNames.add(fileName); logger.debug("listUploadedOfflineFileNames after add :" + listUploadedOfflineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); + //request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); + sessionMap.put(LIST_UPLOADED_OFFLINE_FILENAMES_KEY, listUploadedOfflineFileNames); } } @@ -311,21 +313,22 @@ if (fileName.length() > 0) { - List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES); + //List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES); + List listUploadedOnlineFileNames=(List)sessionMap.get(LIST_UPLOADED_ONLINE_FILENAMES_KEY); logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames); int index=findFileNameIndex(listUploadedOnlineFileNames, fileName); logger.debug("index:" + index); if (index == 0) { listUploadedOnlineFileNames.add(fileName); logger.debug("listUploadedOnlineFileNames after add :" + listUploadedOnlineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); + //request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); + sessionMap.put(LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); } } } - IVoteService voteService =VoteUtils.getToolService(request); - logger.debug("calling uploadFile with:"); + logger.debug("calling uploadFile with:"); logger.debug("istream:" + stream); logger.debug("filename:" + fileName); logger.debug("mimeType:" + mimeType); @@ -350,6 +353,7 @@ voteAttachmentDTO.setFilename(fileName); voteAttachmentDTO.setOfflineFile(isOfflineFile); + logger.debug("uploadFile ends with sessionMap:" + sessionMap); return voteAttachmentDTO; } @@ -413,32 +417,37 @@ * @param filename * @param offlineFile */ - public static void removeFileItem(HttpServletRequest request, String filename, String offlineFile) + public static void removeFileItem(HttpServletRequest request, String filename, String offlineFile, SessionMap sessionMap) { + logger.debug("starting removeFileItem, sessionMap:" + sessionMap); logger.debug("offlineFile:" + offlineFile); if (offlineFile.equals("1")) { logger.debug("will remove an offline file"); - List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES); + //List listUploadedOfflineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_OFFLINE_FILENAMES); + List listUploadedOfflineFileNames=(List)sessionMap.get(LIST_UPLOADED_OFFLINE_FILENAMES_KEY); logger.debug("listUploadedOfflineFileNames:" + listUploadedOfflineFileNames); listUploadedOfflineFileNames.remove(filename); logger.debug("removed offline filename:" + filename); logger.debug("listUploadedOfflineFileNames after remove :" + listUploadedOfflineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); + //request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); + sessionMap.put(LIST_UPLOADED_OFFLINE_FILENAMES_KEY, listUploadedOfflineFileNames); } else { logger.debug("will remove an online file"); - List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES); + //List listUploadedOnlineFileNames=(List)request.getSession().getAttribute(LIST_UPLOADED_ONLINE_FILENAMES); + List listUploadedOnlineFileNames=(List)sessionMap.get(LIST_UPLOADED_ONLINE_FILENAMES_KEY); logger.debug("listUploadedOnlineFileNames:" + listUploadedOnlineFileNames); listUploadedOnlineFileNames.remove(filename); logger.debug("removed online filename:" + filename); logger.debug("listUploadedOnlineFileNames after remove :" + listUploadedOnlineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); + //request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); + sessionMap.put(LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); } } @@ -504,21 +513,23 @@ * @param isOfflineFile * @param voteContent */ - public static void persistFilesMetaData(HttpServletRequest request, boolean isOfflineFile, VoteContent voteContent) + public static void persistFilesMetaData(HttpServletRequest request, IVoteService voteService, + boolean isOfflineFile, VoteContent voteContent, SessionMap sessionMap) { - IVoteService voteService =VoteUtils.getToolService(request); - - List listFilesMetaData=null; - logger.debug("doing persistFilesMetaData..."); + logger.debug("doing persistFilesMetaData... sessionMap" + sessionMap); + List listFilesMetaData=null; logger.debug("isOfflineFile:" + isOfflineFile); if (isOfflineFile) { - listFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); + //listFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); + listFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); } else { - listFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); + //listFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); + listFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + } logger.debug("listFilesMetaData:" + listFilesMetaData); @@ -566,14 +577,15 @@ * @param request * @param voteContent */ - public static void removeRedundantOfflineFileItems(HttpServletRequest request, VoteContent voteContent) + public static void removeRedundantOfflineFileItems(HttpServletRequest request, IVoteService voteService, + VoteContent voteContent, SessionMap sessionMap) { - IVoteService voteService =VoteUtils.getToolService(request); - + logger.debug("starting removeRedundantOfflineFileItems:" + sessionMap); List allOfflineFilenames=voteService.retrieveVoteUploadedOfflineFilesName(voteContent.getUid()); logger.debug("allOfflineFilenames:" + allOfflineFilenames); - List listOfflineFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); + //List listOfflineFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); List listUploadedOfflineFileNames=extractFileNames(listOfflineFilesMetaData); @@ -617,14 +629,16 @@ * @param request * @param voteContent */ - public static void removeRedundantOnlineFileItems(HttpServletRequest request, VoteContent voteContent) + public static void removeRedundantOnlineFileItems(HttpServletRequest request, IVoteService voteService, + VoteContent voteContent, SessionMap sessionMap) { - IVoteService voteService =VoteUtils.getToolService(request); - + logger.debug("starting removeRedundantOnlineFileItems:" + sessionMap); + List allOnlineFilenames=voteService.retrieveVoteUploadedOnlineFilesName(voteContent.getUid()); logger.debug("allOnlineFilenames:" + allOnlineFilenames); - List listOnlineFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); + //List listOnlineFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); List listUploadedOnlineFileNames=extractFileNames(listOnlineFilesMetaData); @@ -663,76 +677,25 @@ } } } + - /** - * simulatePropertyInspector_RunOffline(HttpServletRequest request) - * @param request - */ - public void simulatePropertyInspector_RunOffline(HttpServletRequest request) + protected Map reconstructOptionContentMapForAdd(Map mapOptionsContent, HttpServletRequest request) { - IVoteService voteService =VoteUtils.getToolService(request); - - String toolContentId=(String)request.getSession().getAttribute(TOOL_CONTENT_ID); - if ((toolContentId != null) && (!toolContentId.equals(""))) - { - logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId)); - try - { - voteService.setAsRunOffline(new Long(toolContentId)); - } - catch(ToolException e) - { - logger.debug("we should never come here"); - } - - logger.debug("post-RunAsOffline"); - } - logger.debug("end of simulating RunOffline on content id: " + toolContentId); - } - - /** - * Normally, a request to set defineLaterproperty of the content comes directly from container through the property inspector. - * What we do below is simulate that for development purposes. - * @param request - */ - public void simulatePropertyInspector_setAsDefineLater(HttpServletRequest request) - { - IVoteService voteService =VoteUtils.getToolService(request); - - String toolContentId=(String)request.getSession().getAttribute(TOOL_CONTENT_ID); - if ((toolContentId != null) && (!toolContentId.equals(""))) - { - logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId)); - try - { - voteService.setAsDefineLater(new Long(toolContentId)); - } - catch(ToolException e) - { - logger.debug("we should never come here"); - } - - logger.debug("post-setAsDefineLater"); - } - logger.debug("end of simulating setAsDefineLater on content id: " + toolContentId); - } - - - - protected void reconstructOptionContentMapForAdd(Map mapOptionsContent, HttpServletRequest request) - { logger.debug("doing reconstructOptionContentMapForAdd."); logger.debug("pre-add Map content: " + mapOptionsContent); logger.debug("pre-add Map size: " + mapOptionsContent.size()); - repopulateMap(mapOptionsContent, request); - + mapOptionsContent=repopulateMap(mapOptionsContent, request); + logger.debug("mapOptionsContent: " + mapOptionsContent); mapOptionsContent.put(new Long(mapOptionsContent.size()+1).toString(), ""); - request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); + //request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); logger.debug("post-add Map is: " + mapOptionsContent); logger.debug("post-add count " + mapOptionsContent.size()); + + return mapOptionsContent; } + protected void reconstructOptionContentMapForRemove(Map mapOptionsContent, HttpServletRequest request, VoteAuthoringForm voteAuthoringForm) @@ -742,11 +705,12 @@ logger.debug("pre-delete map content: " + mapOptionsContent); logger.debug("optIndex: " + optIndex); - String defLater=(String)request.getSession().getAttribute(ACTIVE_MODULE); + //String defLater=(String)request.getSession().getAttribute(ACTIVE_MODULE); + String defLater=voteAuthoringForm.getActiveModule(); logger.debug("defLater: " + defLater); String removableOptIndex=null; - if (defLater.equals(MONITORING)) + if ((defLater != null) && (defLater.equals(MONITORING))) { removableOptIndex=(String)request.getSession().getAttribute(REMOVABLE_QUESTION_INDEX); logger.debug("removableOptIndex: " + removableOptIndex); @@ -763,24 +727,29 @@ mapOptionsContent.remove(new Long(longOptIndex).toString()); logger.debug("removed the question content with index: " + longOptIndex); - request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); + //request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); logger.debug("post-delete count " + mapOptionsContent.size()); logger.debug("post-delete map content: " + mapOptionsContent); } - protected void repopulateMap(Map mapOptionsContent, HttpServletRequest request) + protected Map repopulateMap(Map mapOptionsContent, HttpServletRequest request) { - logger.debug("optIndex: " + request.getSession().getAttribute("optIndex")); - long optIndex= new Long(request.getSession().getAttribute("optIndex").toString()).longValue(); - logger.debug("optIndex: " + optIndex); + //logger.debug("optIndex: " + request.getSession().getAttribute("optIndex")); + //long optIndex= new Long(request.getSession().getAttribute("optIndex").toString()).longValue(); + //logger.debug("optIndex: " + optIndex); + + + logger.debug("starting repopulateMap"); + int intOptionIndex= mapOptionsContent.size(); + logger.debug("intOptionIndex: " + intOptionIndex); /* if there is data in the Map remaining from previous session remove those */ mapOptionsContent.clear(); logger.debug("Map got initialized: " + mapOptionsContent); - for (long i=0; i < optIndex ; i++) + for (long i=0; i < intOptionIndex ; i++) { String candidateOptionEntry =request.getParameter("optionContent" + i); if (i==0) @@ -795,14 +764,15 @@ logger.debug("added new entry."); } } + return mapOptionsContent; } /** * * @param mapOptionsContent * @param request */ - protected void reconstructOptionsContentMapForSubmit(Map mapOptionsContent, HttpServletRequest request) + protected Map reconstructOptionsContentMapForSubmit(Map mapOptionsContent, HttpServletRequest request) { logger.debug("pre-submit Map:" + mapOptionsContent); logger.debug("pre-submit Map size :" + mapOptionsContent.size()); @@ -821,8 +791,9 @@ } mapOptionsContent=(TreeMap)mapFinalOptionsContent; - request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); + //request.getSession().setAttribute("mapOptionsContent", mapOptionsContent); logger.debug("final mapOptionsContent:" + mapOptionsContent); + return mapOptionsContent; } @@ -831,19 +802,21 @@ logger.debug("removing unused entries... "); logger.debug("mapOptionsContent: " + mapOptionsContent); - String toolContentId=voteAuthoringForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); - if ((toolContentId == null) || toolContentId.equals("")) + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + /* + if ((toolContentID == null) || toolContentID.equals("")) { - logger.debug("getting toolContentId from session."); + logger.debug("getting toolContentID from session."); Long longToolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - toolContentId=longToolContentId.toString(); - logger.debug("toolContentId: " + toolContentId); + toolContentID=longToolContentId.toString(); + logger.debug("toolContentID: " + toolContentID); } - logger.debug("final toolContentId: " + toolContentId); + logger.debug("final toolContentID: " + toolContentID); + */ - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentId)); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("voteContent: " + voteContent); if (voteContent != null) @@ -915,40 +888,47 @@ * @param request * @return */ - public VoteContent saveOrUpdateVoteContent(Map mapOptionsContent, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, HttpServletRequest request) + public VoteContent saveOrUpdateVoteContent(Map mapOptionsContent, IVoteService voteService, VoteAuthoringForm voteAuthoringForm, + HttpServletRequest request, SessionMap sessionMap) { UserDTO toolUser = (UserDTO) SessionManager.getSession().getAttribute(AttributeNames.USER); + logger.debug("toolUser: " + toolUser); - String richTextTitle = request.getParameter("title"); - String richTextInstructions = request.getParameter("instructions"); + String richTextTitle = request.getParameter(TITLE); + String richTextInstructions = request.getParameter(INSTRUCTIONS); + logger.debug("richTextTitle: " + richTextTitle); logger.debug("richTextInstructions: " + richTextInstructions); String voteChangable = voteAuthoringForm.getVoteChangable(); logger.debug("voteChangable: " + voteChangable); - String lockedOnFinish=voteAuthoringForm.getLockOnFinish(); - logger.debug("lockedOnFinish: " + lockedOnFinish); + String lockOnFinish=voteAuthoringForm.getLockOnFinish(); + logger.debug("lockOnFinish: " + lockOnFinish); - String allowText=voteAuthoringForm.getAllowText(); - logger.debug("allowText: " + allowText); + String allowTextEntry=voteAuthoringForm.getAllowText(); + logger.debug("allowTextEntry: " + allowTextEntry); String maxNomcount= voteAuthoringForm.getMaxNominationCount(); logger.debug("maxNomcount: " + maxNomcount); - String richTextOfflineInstructions=(String)request.getSession().getAttribute(RICHTEXT_OFFLINEINSTRUCTIONS); + //String richTextOfflineInstructions=(String)request.getSession().getAttribute(RICHTEXT_OFFLINEINSTRUCTIONS); + String richTextOfflineInstructions=(String)sessionMap.get(OFFLINE_INSTRUCTIONS_KEY); logger.debug("richTextOfflineInstructions: " + richTextOfflineInstructions); - String richTextOnlineInstructions=(String)request.getSession().getAttribute(RICHTEXT_ONLINEINSTRUCTIONS); + + //String richTextOnlineInstructions=(String)request.getSession().getAttribute(RICHTEXT_ONLINEINSTRUCTIONS); + String richTextOnlineInstructions=(String)sessionMap.get(ONLINE_INSTRUCTIONS_KEY); logger.debug("richTextOnlineInstructions: " + richTextOnlineInstructions); boolean setCommonContent=true; - if ((lockedOnFinish == null) || (voteChangable == null)) + if ((lockOnFinish == null) || (voteChangable == null)) { setCommonContent=false; } logger.debug("setCommonContent: " + setCommonContent); - String activeModule=(String)request.getSession().getAttribute(ACTIVE_MODULE); + //String activeModule=(String)request.getSession().getAttribute(ACTIVE_MODULE); + String activeModule=voteAuthoringForm.getActiveModule(); logger.debug("activeModule: " + activeModule); boolean voteChangableBoolean=false; @@ -960,10 +940,10 @@ if (voteChangable.equalsIgnoreCase(ON)) voteChangableBoolean=true; - if (lockedOnFinish.equalsIgnoreCase(ON)) + if (lockOnFinish.equalsIgnoreCase(ON)) lockedOnFinishBoolean=true; - if (allowText.equalsIgnoreCase(ON)) + if (allowTextEntry.equalsIgnoreCase(ON)) allowTextBoolean=true; } @@ -992,13 +972,12 @@ logger.debug("userId: " + userId); - Long toolContentIdLong =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentIdLong: " + toolContentIdLong); + //Long toolContentIDLong =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + //logger.debug("toolContentIDLong: " + toolContentIDLong); + String toolContentID =voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - String toolContentId=toolContentIdLong.toString(); - logger.debug("toolContentId: " + toolContentId); - - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentId)); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("voteContent: " + voteContent); boolean newContent=false; @@ -1010,14 +989,15 @@ logger.debug("setting common content values..." + richTextTitle + " " + richTextInstructions); - voteContent.setVoteContentId(new Long(toolContentId)); + voteContent.setVoteContentId(new Long(toolContentID)); voteContent.setTitle(richTextTitle); voteContent.setInstructions(richTextInstructions); voteContent.setUpdateDate(new Date(System.currentTimeMillis())); /**keep updating this one*/ logger.debug("userId: " + userId); voteContent.setCreatedBy(userId); /**make sure we are setting the userId from the User object above*/ logger.debug("end of setting common content values..."); + logger.debug("activeModule: " + activeModule); if ((!activeModule.equals(DEFINE_LATER)) && (setCommonContent)) { @@ -1042,7 +1022,7 @@ voteService.updateVote(voteContent); } - voteContent=voteService.retrieveVote(new Long(toolContentId)); + voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("voteContent: " + voteContent); voteContent=createOptiosContent(mapOptionsContent, voteService, voteContent); @@ -1060,6 +1040,7 @@ */ protected VoteContent createOptiosContent(Map mapOptionsContent, IVoteService voteService, VoteContent voteContent) { + logger.debug("starting createOptiosContent: " + voteContent); logger.debug("content uid is: " + voteContent.getUid()); List questions=voteService.retrieveVoteQueContentsByToolContentId(voteContent.getUid().longValue()); logger.debug("questions: " + questions); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -666,17 +666,17 @@ * @param request * @param voteService * @param voteMonitoringForm - * @param toolContentId + * @param toolContentID * @return */ - public static List prepareChartDTO(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentId) + public static List prepareChartDTO(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentID) { logger.debug("start preparing ChartDTO with voteMonitoringForm: " + voteMonitoringForm); - logger.debug("start preparing ChartDTO with toolContentId: " + toolContentId); + logger.debug("start preparing ChartDTO with toolContentID: " + toolContentID); List listVoteAllSessionsDTO= new LinkedList(); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); logger.debug("will be building groups question data for content:..." + voteContent); @@ -870,16 +870,16 @@ * @param request * @param voteService * @param voteMonitoringForm - * @param toolContentId + * @param toolContentID * @param toolSessionUid */ public static void prepareChartData(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, - String toolContentId, String toolSessionUid, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO) + String toolContentID, String toolSessionUid, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO) { logger.debug("starting prepareChartData, voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); - logger.debug("starting prepareChartData, toolContentId: " + toolContentId); + logger.debug("starting prepareChartData, toolContentID: " + toolContentID); logger.debug("starting prepareChartData, toolSessionUid: " + toolSessionUid); - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentId)); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid()); logger.debug("starting prepareChartData, voteMonitoringForm: " + voteMonitoringForm); @@ -1093,14 +1093,14 @@ * @param request * @param voteService * @param voteMonitoringForm - * @param toolContentId + * @param toolContentID * @param toolSessionUid */ - public static void prepareChartDataForExportLearner(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentId, Long toolSessionUid) + public static void prepareChartDataForExportLearner(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid) { - logger.debug("starting prepareChartDataForExportLearner, toolContentId: " + toolContentId); + logger.debug("starting prepareChartDataForExportLearner, toolContentID: " + toolContentID); logger.debug("starting prepareChartDataForExportLearner, toolSessionUid: " + toolSessionUid); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid()); logger.debug("starting prepareChartDataForExport, voteMonitoringForm: " + voteMonitoringForm); @@ -1321,14 +1321,14 @@ * @param request * @param voteService * @param voteMonitoringForm - * @param toolContentId + * @param toolContentID * @param toolSessionUid */ - public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentId, Long toolSessionUid) + public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid) { - logger.debug("starting prepareChartDataForExportTeacher, toolContentId: " + toolContentId); + logger.debug("starting prepareChartDataForExportTeacher, toolContentID: " + toolContentID); logger.debug("starting prepareChartDataForExportTeacher, toolSessionUid: " + toolSessionUid); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("starting prepareChartData, voteContent uid: " + voteContent.getUid()); logger.debug("starting prepareChartDataForExport, voteMonitoringForm: " + voteMonitoringForm); logger.debug("existing voteContent:" + voteContent); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java (.../VoteAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -45,12 +45,13 @@ import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteAttachmentDTO; import org.lamsfoundation.lams.tool.vote.VoteComparator; +import org.lamsfoundation.lams.tool.vote.VoteGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.web.action.LamsDispatchAction; -import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; /** * * @author Ozgur Demirtas @@ -68,6 +69,47 @@ * Struts action class as all of them are handled in * CustomStrutsExceptionHandler. * + * + + + + + + + + + + + + + + + * */ public class VoteAction extends LamsDispatchAction implements VoteAppConstants { @@ -105,7 +147,7 @@ * main content/question content management and workflow logic * - * if the passed toolContentId exists in the db, we need to get the relevant data into the Map + * if the passed toolContentID exists in the db, we need to get the relevant data into the Map * if not, create the default Map */ public ActionForward unspecified(ActionMapping mapping, @@ -116,66 +158,97 @@ { VoteUtils.cleanUpUserExceptions(request); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - IVoteService voteService =VoteUtils.getToolService(request); - VoteUtils.saveInSessionRichText(request); + repopulateRequestParameters(request, voteAuthoringForm); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); voteAuthoringForm.resetUserAction(); return null; } - public boolean isNewNominationAdded(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) + public boolean isNewNominationAdded(ActionMapping mapping, ActionForm form, HttpServletRequest request, + HttpServletResponse response) { logger.debug("doing isNewNominationAdded"); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); + + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); AuthoringUtil authoringUtil= new AuthoringUtil(); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); + logger.debug("mapOptionsContent: " + mapOptionsContent); - String richTextTitle = request.getParameter("title"); - String richTextInstructions = request.getParameter("instructions"); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); - VoteUtils.saveInSessionRichText(request); - - authoringUtil.reconstructOptionContentMapForAdd(mapOptionsContent, request); - - mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); + mapOptionsContent=authoringUtil.reconstructOptionContentMapForAdd(mapOptionsContent, request); logger.debug("final mapOptionsContent: " + mapOptionsContent); int maxIndex=mapOptionsContent.size(); - request.getSession().setAttribute(MAX_OPTION_INDEX, new Integer(maxIndex)); - logger.debug("MAX_OPTION_INDEX: " + request.getSession().getAttribute(MAX_OPTION_INDEX)); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry=(String)mapOptionsContent.get("1"); logger.debug("firstEntry: " + firstEntry); - request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, firstEntry); - - - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - if (voteService == null) - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); - - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); + logger.debug("voteContent: " + voteContent); + /*true means there is at least 1 response*/ if (voteContent != null) { if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); + + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + return true; } @@ -203,63 +276,90 @@ String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - return (mapping.findForward(destination)); } public boolean isNominationRemoved(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { logger.debug("starting isNominationRemoved"); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); + + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); AuthoringUtil authoringUtil= new AuthoringUtil(); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); + //Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); logger.debug("mapOptionsContent: " + mapOptionsContent); authoringUtil.reconstructOptionContentMapForRemove(mapOptionsContent, request, voteAuthoringForm); - mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - int maxIndex=mapOptionsContent.size(); - request.getSession().setAttribute(MAX_OPTION_INDEX, new Integer(maxIndex)); - logger.debug("MAX_OPTION_INDEX: " + request.getSession().getAttribute(MAX_OPTION_INDEX)); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry=(String)mapOptionsContent.get("1"); logger.debug("firstEntry: " + firstEntry); - request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - if (voteService == null) - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); - - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + String toolContentID =voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); /*true means there is at least 1 response*/ if (voteContent != null) { if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + + return true; } @@ -277,9 +377,6 @@ String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - return (mapping.findForward(destination)); } @@ -297,55 +394,74 @@ { logger.debug("doing submitContent.."); + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); - voteAuthoringForm.setSubmissionAttempt(new Boolean(true).toString()); - request.setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - if (voteService == null) - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO= new VoteGeneralAuthoringDTO(); + repopulateRequestParameters(request, voteAuthoringForm); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + + voteAuthoringForm.setSubmissionAttempt(new Boolean(true).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(true).toString()); + + request.setAttribute(VALIDATION_ERROR, new Boolean(false).toString()); + voteGeneralAuthoringDTO.setValidationError(new Boolean(false).toString()); + + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); + + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); + logger.debug("voteContent: " + voteContent); + /*true means there is at least 1 response*/ if (voteContent != null) { if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); ActionMessages errors= new ActionMessages(); errors=validateSubmit(request, errors, voteAuthoringForm); if (errors.size() > 0) { logger.debug("returning back to from to fix errors:"); - request.getSession().setAttribute(EDITACTIVITY_EDITMODE, new Boolean(true)); + voteGeneralAuthoringDTO.setEditActivityEditMode(new Boolean(true).toString()); request.setAttribute(VALIDATION_ERROR, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setValidationError(new Boolean(true).toString()); return false; } - List attachmentList = (List) request.getSession().getAttribute(ATTACHMENT_LIST); - List deletedAttachmentList = (List) request.getSession().getAttribute(DELETED_ATTACHMENT_LIST); + List attachmentList=(List)sessionMap.get(ATTACHMENT_LIST_KEY); + logger.debug("attachmentList :" +attachmentList); + + List deletedAttachmentList = (List)sessionMap.get(DELETED_ATTACHMENT_LIST_KEY); + logger.debug("deletedAttachmentList :" +deletedAttachmentList); + + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); + logger.debug("mapOptionsContent: " + mapOptionsContent); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("mapOptionsContent :" +mapOptionsContent); - if (mapOptionsContent == null) mapOptionsContent= new TreeMap(new VoteComparator()); @@ -357,29 +473,29 @@ { logger.debug("back to user, nominationsDuplicate :" +nominationsDuplicate); request.setAttribute(USER_EXCEPTION_OPTIONS_DUPLICATE, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionOptionsDuplicate(new Boolean(true).toString()); return false; } int maxIndex=mapOptionsContent.size(); - request.getSession().setAttribute(MAX_OPTION_INDEX, new Integer(maxIndex)); - logger.debug("MAX_OPTION_INDEX: " + request.getSession().getAttribute(MAX_OPTION_INDEX)); + logger.debug("maxIndex :" +maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + String firstEntry=(String)mapOptionsContent.get("1"); logger.debug("firstEntry: " + firstEntry); - request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); AuthoringUtil authoringUtil= new AuthoringUtil(); - authoringUtil.reconstructOptionsContentMapForSubmit(mapOptionsContent, request); - logger.debug("before saveOrUpdateVoteContent."); + mapOptionsContent=authoringUtil.reconstructOptionsContentMapForSubmit(mapOptionsContent, request); + logger.debug("before saveOrUpdateVoteContent, mapOptionsContent" + mapOptionsContent); - logger.debug("submitting mapOptionsContent:" + mapOptionsContent); - - /*to remove deleted entries in the questions table based on mapQuestionContent */ + /*to remove deleted entries in the questions table based on mapQuestionContent */ authoringUtil.removeRedundantOptions(mapOptionsContent, voteService, voteAuthoringForm, request); logger.debug("end of removing unused entries... "); - voteContent=authoringUtil.saveOrUpdateVoteContent(mapOptionsContent, voteService, voteAuthoringForm, request); + voteContent=authoringUtil.saveOrUpdateVoteContent(mapOptionsContent, voteService, voteAuthoringForm, request, sessionMap); logger.debug("voteContent: " + voteContent); String maxNomCount=voteAuthoringForm.getMaxNominationCount(); @@ -396,7 +512,7 @@ { if (maxNomCount.equals("0")) { - request.setAttribute(USER_EXCEPTION_MAXNOMINATION_INVALID, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionMaxNominationInvalid(new Boolean(true).toString()); return false; } @@ -407,44 +523,65 @@ } catch(NumberFormatException e) { - request.setAttribute(USER_EXCEPTION_MAXNOMINATION_INVALID, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionMaxNominationInvalid(new Boolean(true).toString()); return false; } } logger.debug("start persisting offline files metadata"); - AuthoringUtil.persistFilesMetaData(request, true, voteContent); + AuthoringUtil.persistFilesMetaData(request, voteService, true, voteContent, sessionMap); logger.debug("start persisting online files metadata"); - AuthoringUtil.persistFilesMetaData(request, false, voteContent); + AuthoringUtil.persistFilesMetaData(request, voteService, false, voteContent, sessionMap ); /* making sure only the filenames in the session cache are persisted and the others in the db are removed*/ logger.debug("start removing redundant offline files metadata"); - AuthoringUtil.removeRedundantOfflineFileItems(request, voteContent); + AuthoringUtil.removeRedundantOfflineFileItems(request, voteService, voteContent, sessionMap); logger.debug("start removing redundant online files metadata"); - AuthoringUtil.removeRedundantOnlineFileItems(request, voteContent); + AuthoringUtil.removeRedundantOnlineFileItems(request, voteService, voteContent, sessionMap); logger.debug("done removing redundant files"); - } } errors.clear(); errors.add(Globals.ERROR_KEY, new ActionMessage("sbmt.successful")); - request.setAttribute(SUBMIT_SUCCESS, new Boolean(true).toString()); - logger.debug("setting SUBMIT_SUCCESS to 1."); - Long strToolContentId=(Long)request.getSession().getAttribute(AttributeNames.PARAM_TOOL_CONTENT_ID); - logger.debug("strToolContentId: " + strToolContentId); - VoteUtils.setDefineLater(request, false); + logger.debug("toolContentID: " + toolContentID); + VoteUtils.setDefineLater(request, false, voteService, toolContentID); saveErrors(request,errors); - - VoteUtils.setDefineLater(request, false); logger.debug("define later set to false"); voteAuthoringForm.resetUserAction(); + voteAuthoringForm.setSbmtSuccess(new Boolean(true).toString()); + voteGeneralAuthoringDTO.setSbmtSuccess(new Boolean(true).toString()); + logger.debug("setting SUBMIT_SUCCESS to 1."); + + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + + return true; } @@ -457,6 +594,8 @@ VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + repopulateRequestParameters(request, voteAuthoringForm); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); logger.debug("sourceVoteStarter: " + sourceVoteStarter); @@ -468,16 +607,14 @@ logger.debug("isContentSubmitted :" +isContentSubmitted); if (isContentSubmitted == true) + { voteAuthoringForm.setSbmtSuccess(new Boolean(true).toString()); + } + logger.debug("final submit status :" +voteAuthoringForm.getSbmtSuccess()); - logger.debug("final duplicate status :" +request.getAttribute(USER_EXCEPTION_OPTIONS_DUPLICATE)); logger.debug("fwding to destination :" +destination); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - - request.setAttribute(AuthoringConstants.LAMS_AUTHORING_SUCCESS_FLAG,Boolean.TRUE); return (mapping.findForward(destination)); } @@ -489,18 +626,32 @@ HttpServletResponse response) { logger.debug("starting isMoveNominationDown..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + VoteUtils.cleanUpUserExceptions(request); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); - voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); - IVoteService voteService =VoteUtils.getToolService(request); + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); Map mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); logger.debug("mapOptionsContent before move down: " + mapOptionsContent); logger.debug("mapOptionsContent size move down: " + mapOptionsContent.size()); + /* perform a move down if there are at least 2 nominations*/ if (mapOptionsContent.size() > 1) @@ -514,42 +665,66 @@ { mapOptionsContent= AuthoringUtil.shiftMap(mapOptionsContent, optIndex,movableOptionEntry, "down"); logger.debug("mapOptionsContent after move down: " + mapOptionsContent); - request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); - logger.debug("updated Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); + //request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); + //logger.debug("updated Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); } } voteAuthoringForm.resetUserAction(); - mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); + mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); logger.debug("mapOptionsContent: " + mapOptionsContent); + int maxIndex=mapOptionsContent.size(); - request.getSession().setAttribute(MAX_OPTION_INDEX, new Integer(maxIndex)); - logger.debug("MAX_OPTION_INDEX: " + request.getSession().getAttribute(MAX_OPTION_INDEX)); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry=(String)mapOptionsContent.get("1"); logger.debug("firstEntry: " + firstEntry); - request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); - /*true means there is at least 1 response*/ + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); + logger.debug("voteContent: " + voteContent); + + /*true means there is at least 1 response*/ if (voteContent != null) { if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + return true; } @@ -580,9 +755,6 @@ boolean isMoveNominationDown=isMoveNominationDown(mapping, form, request, response); logger.debug("isMoveNominationDown:" + isMoveNominationDown); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - return (mapping.findForward(destination)); } @@ -602,22 +774,35 @@ HttpServletResponse response) { logger.debug("starting isMoveNominationUp..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + VoteUtils.cleanUpUserExceptions(request); - VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; - + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); - voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - IVoteService voteService =VoteUtils.getToolService(request); + repopulateRequestParameters(request, voteAuthoringForm); + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); Map mapOptionsContent=AuthoringUtil.repopulateMap(request, "optionContent"); logger.debug("mapOptionsContent before move down: " + mapOptionsContent); @@ -635,42 +820,63 @@ { mapOptionsContent= AuthoringUtil.shiftMap(mapOptionsContent, optIndex,movableOptionEntry, "up"); logger.debug("mapOptionsContent after move down: " + mapOptionsContent); - request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); - logger.debug("updated Options Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT)); + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); } } voteAuthoringForm.resetUserAction(); - - mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); + + mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); logger.debug("mapOptionsContent: " + mapOptionsContent); + int maxIndex=mapOptionsContent.size(); - request.getSession().setAttribute(MAX_OPTION_INDEX, new Integer(maxIndex)); - logger.debug("MAX_OPTION_INDEX: " + request.getSession().getAttribute(MAX_OPTION_INDEX)); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); String firstEntry=(String)mapOptionsContent.get("1"); logger.debug("firstEntry: " + firstEntry); - request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); + logger.debug("voteContent: " + voteContent); /*true means there is at least 1 response*/ if (voteContent != null) { if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(false).toString()); - logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(false).toString()); + logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to false"); } else { - request.getSession().setAttribute(USER_EXCEPTION_NO_TOOL_SESSIONS, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionNoToolSessions(new Boolean(true).toString()); logger.debug("USER_EXCEPTION_NO_TOOL_SESSIONS is set to true"); } } + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + logger.debug("before fwd: mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + return true; } @@ -690,9 +896,6 @@ boolean isMoveNominationUp=isMoveNominationUp(mapping, form, request, response); logger.debug("isMoveNominationUp:" + isMoveNominationUp); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - return (mapping.findForward(destination)); } @@ -706,6 +909,7 @@ */ protected ActionMessages validateSubmit(HttpServletRequest request, ActionMessages errors, VoteAuthoringForm voteAuthoringForm) { + logger.debug("starting validateSubmit"); String title = voteAuthoringForm.getTitle(); logger.debug("title: " + title); @@ -763,44 +967,93 @@ { VoteUtils.cleanUpUserExceptions(request); logger.debug("dispatching submitOfflineFile..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); + + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); + logger.debug("mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + String firstEntry=(String)mapOptionsContent.get("1"); + logger.debug("firstEntry: " + firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); - IVoteService voteService =VoteUtils.getToolService(request); /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); logger.debug("will uploadFile for offline file:"); - VoteAttachmentDTO voteAttachmentDTO=AuthoringUtil.uploadFile(request, voteAuthoringForm, true); + VoteAttachmentDTO voteAttachmentDTO=AuthoringUtil.uploadFile(request, voteService, voteAuthoringForm, true, sessionMap); logger.debug("returned voteAttachmentDTO:" + voteAttachmentDTO); + logger.debug("returned sessionMap:" + sessionMap); + + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + if (voteAttachmentDTO != null) + { + listOfflineFilesMetaData.add(voteAttachmentDTO); + } + + logger.debug("listOfflineFilesMetaData after add:" + listOfflineFilesMetaData); + sessionMap.put(LIST_OFFLINEFILES_METADATA_KEY, listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + if (voteAttachmentDTO == null) { ActionMessages errors= new ActionMessages(); errors= new ActionMessages(); - request.getSession().setAttribute(USER_EXCEPTION_FILENAME_EMPTY, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionFilenameEmpty(new Boolean(true).toString()); errors.add(Globals.ERROR_KEY,new ActionMessage("error.fileName.empty")); saveErrors(request,errors); voteAuthoringForm.resetUserAction(); persistInRequestError(request,"error.fileName.empty"); - + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + return (mapping.findForward(destination)); } - - List listOfflineFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); - logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); - listOfflineFilesMetaData.add(voteAttachmentDTO); - logger.debug("listOfflineFilesMetaData after add:" + listOfflineFilesMetaData); - request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + + voteAuthoringForm.resetUserAction(); return (mapping.findForward(destination)); } @@ -826,43 +1079,93 @@ { VoteUtils.cleanUpUserExceptions(request); logger.debug("dispatching submitOnlineFiles..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); + + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); + logger.debug("mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + String firstEntry=(String)mapOptionsContent.get("1"); + logger.debug("firstEntry: " + firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); + + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); - IVoteService voteService =VoteUtils.getToolService(request); /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); logger.debug("will uploadFile for online file:"); - VoteAttachmentDTO voteAttachmentDTO=AuthoringUtil.uploadFile(request, voteAuthoringForm, false); + VoteAttachmentDTO voteAttachmentDTO=AuthoringUtil.uploadFile(request, voteService, voteAuthoringForm, false, sessionMap); logger.debug("returned voteAttachmentDTO:" + voteAttachmentDTO); + logger.debug("returned sessionMap:" + sessionMap); + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + if (voteAttachmentDTO != null) + { + listOnlineFilesMetaData.add(voteAttachmentDTO); + } + logger.debug("listOnlineFilesMetaData after add:" + listOnlineFilesMetaData); + + sessionMap.put(LIST_ONLINEFILES_METADATA_KEY, listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + if (voteAttachmentDTO == null) { ActionMessages errors= new ActionMessages(); errors= new ActionMessages(); - request.getSession().setAttribute(USER_EXCEPTION_FILENAME_EMPTY, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setUserExceptionFilenameEmpty(new Boolean(true).toString()); errors.add(Globals.ERROR_KEY,new ActionMessage("error.fileName.empty")); saveErrors(request,errors); voteAuthoringForm.resetUserAction(); persistInRequestError(request,"error.fileName.empty"); - + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + return (mapping.findForward(destination)); } - - List listOnlineFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); - logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); - listOnlineFilesMetaData.add(voteAttachmentDTO); - logger.debug("listOnlineFilesMetaData after add:" + listOnlineFilesMetaData); - request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); - + + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + voteAuthoringForm.resetUserAction(); return (mapping.findForward(destination)); } @@ -888,29 +1191,70 @@ { VoteUtils.cleanUpUserExceptions(request); logger.debug("dispatching deleteOfflineFile..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); - voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - IVoteService voteService =VoteUtils.getToolService(request); + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); + logger.debug("mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + String firstEntry=(String)mapOptionsContent.get("1"); + logger.debug("firstEntry: " + firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); + + + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); String uuid =voteAuthoringForm.getUuid(); logger.debug("uuid:" + uuid); - List listOfflineFilesMetaData =(List)request.getSession().getAttribute(LIST_OFFLINEFILES_METADATA); + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); listOfflineFilesMetaData=AuthoringUtil.removeFileItem(listOfflineFilesMetaData, uuid); logger.debug("listOfflineFilesMetaData after remove:" + listOfflineFilesMetaData); - request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); - + sessionMap.put(LIST_OFFLINEFILES_METADATA_KEY, listOfflineFilesMetaData); + + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); + logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + + voteAuthoringForm.resetUserAction(); return (mapping.findForward(destination)); @@ -936,29 +1280,70 @@ { VoteUtils.cleanUpUserExceptions(request); logger.debug("dispatching deleteOnlineFile..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService: " + voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); - voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - IVoteService voteService =VoteUtils.getToolService(request); + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); + logger.debug("mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + String firstEntry=(String)mapOptionsContent.get("1"); + logger.debug("firstEntry: " + firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); + + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - VoteUtils.saveInSessionRichText(request); + VoteUtils.saveRichText(request, voteGeneralAuthoringDTO); String uuid =voteAuthoringForm.getUuid(); logger.debug("uuid:" + uuid); - List listOnlineFilesMetaData =(List)request.getSession().getAttribute(LIST_ONLINEFILES_METADATA); + List listOnlineFilesMetaData =(List)sessionMap.get(LIST_ONLINEFILES_METADATA_KEY); logger.debug("listOnlineFilesMetaData:" + listOnlineFilesMetaData); listOnlineFilesMetaData=AuthoringUtil.removeFileItem(listOnlineFilesMetaData, uuid); logger.debug("listOnlineFilesMetaData after remove:" + listOnlineFilesMetaData); - request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); - + sessionMap.put(LIST_ONLINEFILES_METADATA_KEY, listOnlineFilesMetaData); + + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + + List listOfflineFilesMetaData =(List)sessionMap.get(LIST_OFFLINEFILES_METADATA_KEY); + logger.debug("listOfflineFilesMetaData:" + listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(httpSessionID, sessionMap); + voteAuthoringForm.resetUserAction(); return (mapping.findForward(destination)); @@ -984,60 +1369,117 @@ ToolException { logger.debug("dispatching editActivityQuestions..."); + + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; logger.debug("voteAuthoringForm :" +voteAuthoringForm); - voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService: " + voteService); - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - } + repopulateRequestParameters(request, voteAuthoringForm); + + String httpSessionID=voteAuthoringForm.getHttpSessionID(); + logger.debug("httpSessionID: " + httpSessionID); + + SessionMap sessionMap=(SessionMap)request.getSession().getAttribute(httpSessionID); + logger.debug("sessionMap: " + sessionMap); + + Map mapOptionsContent=(Map)sessionMap.get(MAP_OPTIONS_CONTENT_KEY); + logger.debug("mapOptionsContent: " + mapOptionsContent); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + + int maxIndex=mapOptionsContent.size(); + logger.debug("maxIndex: " + maxIndex); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + + String firstEntry=(String)mapOptionsContent.get("1"); + logger.debug("firstEntry: " + firstEntry); + voteGeneralAuthoringDTO.setDefaultOptionContent(firstEntry); + + voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); + + /* determine whether the request is from Monitoring url Edit Activity*/ String sourceVoteStarter = (String) request.getAttribute(SOURCE_VOTE_STARTER); logger.debug("sourceVoteStarter: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); - String toolContentId=voteAuthoringForm.getToolContentId(); - logger.debug("toolContentId: " + toolContentId); - if ((toolContentId== null) || toolContentId.equals("")) - { - logger.debug("getting toolContentId from session."); - Long longToolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - toolContentId=longToolContentId.toString(); - logger.debug("toolContentId: " + toolContentId); - } + voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); + + String toolContentID=voteAuthoringForm.getToolContentID(); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentId)); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); logger.debug("existing voteContent:" + voteContent); boolean isContentInUse=VoteUtils.isContentInUse(voteContent); logger.debug("isContentInUse:" + isContentInUse); - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); + voteGeneralAuthoringDTO.setIsMonitoredContentInUse(new Boolean(false).toString()); if (isContentInUse == true) { logger.debug("monitoring url does not allow editActivity since the content is in use."); persistInRequestError(request,"error.content.inUse"); - request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(true).toString()); + voteGeneralAuthoringDTO.setIsMonitoredContentInUse(new Boolean(true).toString()); } - VoteUtils.setDefineLater(request, true); + VoteUtils.setDefineLater(request, true, voteService, toolContentID); - Map mapOptionsContent=(Map)request.getSession().getAttribute(MAP_OPTIONS_CONTENT); - logger.debug("final mapOptionsContent: " + mapOptionsContent); - + logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); + logger.debug("forwarding to : " + destination); return mapping.findForward(destination); } + protected void repopulateRequestParameters(HttpServletRequest request, VoteAuthoringForm voteAuthoringForm) + { + logger.debug("starting repopulateRequestParameters"); + + String toolContentID=request.getParameter(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); + voteAuthoringForm.setToolContentID(toolContentID); + + String activeModule=request.getParameter(ACTIVE_MODULE); + logger.debug("activeModule: " + activeModule); + voteAuthoringForm.setActiveModule(activeModule); + + String httpSessionID=request.getParameter(HTTP_SESSION_ID); + logger.debug("httpSessionID: " + httpSessionID); + voteAuthoringForm.setHttpSessionID(httpSessionID); + + String defaultContentIdStr=request.getParameter(DEFAULT_CONTENT_ID_STR); + logger.debug("defaultContentIdStr: " + defaultContentIdStr); + voteAuthoringForm.setDefaultContentIdStr(defaultContentIdStr); + + String defineLaterInEditMode=request.getParameter(DEFINE_LATER_IN_EDIT_MODE); + logger.debug("defineLaterInEditMode: " + defineLaterInEditMode); + voteAuthoringForm.setDefineLaterInEditMode(defineLaterInEditMode); + + String voteChangable=request.getParameter(VOTE_CHANGABLE); + logger.debug("voteChangable: " + voteChangable); + voteAuthoringForm.setVoteChangable(voteChangable); + + String lockOnFinish=request.getParameter(LOCK_ON_FINISH); + logger.debug("lockOnFinish: " + lockOnFinish); + voteAuthoringForm.setLockOnFinish(lockOnFinish); + + String allowText=request.getParameter(ALLOW_TEXT); + logger.debug("allowText: " + allowText); + voteAuthoringForm.setAllowText(allowText); + + String maxNominationCount=request.getParameter(MAX_NOMINATION_COUNT); + logger.debug("maxNominationCount: " + maxNominationCount); + voteAuthoringForm.setMaxNominationCount(maxNominationCount); + } + /** * persists error messages to request scope @@ -1052,4 +1494,4 @@ saveErrors(request,errors); } } - \ No newline at end of file + Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java =================================================================== diff -u -r22789974b076931e27e1e37ed7d91bd17f4f9cb6 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision 22789974b076931e27e1e37ed7d91bd17f4f9cb6) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAuthoringForm.java (.../VoteAuthoringForm.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -22,6 +22,7 @@ package org.lamsfoundation.lams.tool.vote.web; +import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.struts.upload.FormFile; import org.lamsfoundation.lams.tool.vote.VoteAppConstants; @@ -80,7 +81,7 @@ protected String instructions; protected String isRemoveContent; - protected String toolContentId; + protected String toolContentID; /* instructions content */ @@ -92,18 +93,23 @@ protected String richTextOfflineInstructions; protected String richTextOnlineInstructions; + protected String defineLaterInEditMode; + /* proxy controllers for Monitoring tabs */ protected String summaryMonitoring; protected String instructionsMonitoring; protected String editActivityMonitoring; protected String statsMonitoring; protected String edit; - protected String exceptionMaxNominationInvalid; - + protected String defaultContentIdStr; + protected String defaultContentId; + protected String isDefineLater; protected String submissionAttempt; + protected String defaultOptionContent; + protected String httpSessionID; public void resetUserAction() { @@ -162,7 +168,7 @@ this.selectedIndex=null; this.deletableOptionIndex=null; this.isRemoveContent=null; - this.toolContentId=null; + this.toolContentID=null; this.onlineInstructions=null; this.offlineInstructions=null; @@ -193,6 +199,30 @@ } + /** + * @return Returns the defaultContentId. + */ + public String getDefaultContentId() { + return defaultContentId; + } + /** + * @param defaultContentId The defaultContentId to set. + */ + public void setDefaultContentId(String defaultContentId) { + this.defaultContentId = defaultContentId; + } + /** + * @return Returns the defaultContentIdStr. + */ + public String getDefaultContentIdStr() { + return defaultContentIdStr; + } + /** + * @param defaultContentIdStr The defaultContentIdStr to set. + */ + public void setDefaultContentIdStr(String defaultContentIdStr) { + this.defaultContentIdStr = defaultContentIdStr; + } /** * @return Returns the isRemoveContent. */ @@ -290,19 +320,8 @@ public void setTitle(String title) { this.title = title; } + /** - * @return Returns the toolContentId. - */ - public String getToolContentId() { - return toolContentId; - } - /** - * @param toolContentId The toolContentId to set. - */ - public void setToolContentId(String toolContentId) { - this.toolContentId = toolContentId; - } - /** * @return Returns the offlineInstructions. */ public String getOfflineInstructions() { @@ -774,4 +793,93 @@ this.submissionAttempt = submissionAttempt; } + /** + * @return Returns the defineLaterInEditMode. + */ + public String getDefineLaterInEditMode() { + return defineLaterInEditMode; + } + /** + * @param defineLaterInEditMode The defineLaterInEditMode to set. + */ + public void setDefineLaterInEditMode(String defineLaterInEditMode) { + this.defineLaterInEditMode = defineLaterInEditMode; + } + /** + * @return Returns the toolContentID. + */ + public String getToolContentID() { + return toolContentID; + } + /** + * @param toolContentID The toolContentID to set. + */ + public void setToolContentID(String toolContentID) { + this.toolContentID = toolContentID; + } + + /** + * @return Returns the isDefineLater. + */ + public String getIsDefineLater() { + return isDefineLater; + } + /** + * @param isDefineLater The isDefineLater to set. + */ + public void setIsDefineLater(String isDefineLater) { + this.isDefineLater = isDefineLater; + } + + /** + * @return Returns the defaultOptionContent. + */ + public String getDefaultOptionContent() { + return defaultOptionContent; + } + /** + * @param defaultOptionContent The defaultOptionContent to set. + */ + public void setDefaultOptionContent(String defaultOptionContent) { + this.defaultOptionContent = defaultOptionContent; + } + + /** + * @return Returns the httpSessionID. + */ + public String getHttpSessionID() { + return httpSessionID; + } + /** + * @param httpSessionID The httpSessionID to set. + */ + public void setHttpSessionID(String httpSessionID) { + this.httpSessionID = httpSessionID; + } + + public String toString() { + return new ToStringBuilder(this) + .append("activeModule: ", activeModule) + .append("defineLaterInEditMode: ", defineLaterInEditMode) + .append("submissionAttempt: ", submissionAttempt) + .append("sbmtSuccess: ", sbmtSuccess) + .append("exceptionMaxNominationInvalid: ", exceptionMaxNominationInvalid) + .append("isDefineLater: ", isDefineLater) + .append("toolContentID: ", toolContentID) + .append("allowText: ", allowText) + .append("voteChangable: ", voteChangable) + .append("lockOnFinish: ", lockOnFinish) + .append("defaultContentId: ", defaultContentId) + .append("defaultContentIdStr: ", defaultContentIdStr) + .append("maxNominationCount: ", maxNominationCount) + .append("defaultOptionContent: ", defaultOptionContent) + .append("activityTitle: ", activityTitle) + .append("activityInstructions: ", activityInstructions) + .append("richTextOfflineInstructions: ", richTextOfflineInstructions) + .append("richTextOnlineInstructions: ", richTextOnlineInstructions) + .append("onlineInstructions: ", onlineInstructions) + .append("offlineInstructions: ", offlineInstructions) + .toString(); + } + } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java (.../VoteChartGenerator.java) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java (.../VoteChartGenerator.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -78,10 +78,10 @@ voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); logger.debug("voteService: " + voteService); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentSessionId)); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -r176368e713ee9dee5b8c206e3f979dfc839f95cd -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 176368e713ee9dee5b8c206e3f979dfc839f95cd) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -196,7 +196,6 @@ VoteUtils.cleanUpUserExceptions(request); voteLearningForm.setMaxNominationCountReached(new Boolean(false).toString()); - VoteUtils.saveInSessionRichText(request); return null; } @@ -862,7 +861,6 @@ String userEntry=request.getParameter(USER_ENTRY); logger.debug("userEntry: " + userEntry); voteLearningForm.setUserEntry(userEntry); - } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -140,10 +140,10 @@ String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); logger.debug("currentMonitoredToolSession: " + currentMonitoredToolSession); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); /* SELECTION_CASE == 1 indicates a selected group other than "All" */ @@ -192,19 +192,14 @@ boolean showUserEntriesBySession, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO) { logger.debug("doing refreshSummaryData." + voteGeneralLearnerFlowDTO); + logger.debug("voteService." + voteService); if (voteService == null) { logger.debug("will retrieve voteService"); voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); logger.debug("retrieving voteService from session: " + voteService); } - if (voteService == null) - { - voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService: " + voteService); - } - logger.debug("voteService: " + voteService); logger.debug("isUserNamesVisible: " + isUserNamesVisible); @@ -446,10 +441,10 @@ logger.debug("retrieving voteService from session: " + voteService); } - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); /* this section is related to summary tab. Starts here. */ @@ -494,10 +489,10 @@ logger.debug("retrieving voteService from session: " + voteService); } - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) @@ -564,10 +559,10 @@ logger.debug("retrieving voteService from session: " + voteService); } - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); @@ -625,25 +620,24 @@ ToolException { logger.debug("dispatching editActivityQuestions..."); - + + IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); + if (voteService == null) + voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); + logger.debug("voteService :" +voteService); + VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form; logger.debug("voteMonitoringForm :" +voteMonitoringForm); request.getSession().setAttribute(IS_MONITORED_CONTENT_IN_USE, new Boolean(false).toString()); request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); - VoteUtils.setDefineLater(request, true); - - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - if (voteService == null) - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("voteService :" +voteService); - - - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteUtils.setDefineLater(request, true, voteService, toolContentID.toString()); + + VoteContent voteContent=voteService.retrieveVote(toolContentID); /*true means there is at least 1 response*/ if (voteContent != null) { @@ -867,10 +861,10 @@ logger.debug("showOpen votes set to true: "); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); @@ -949,10 +943,10 @@ logger.debug("hiding the user entry : " + voteUsrAttempt.getUserEntry()); voteService.hideOpenVote(voteUsrAttempt); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); @@ -1006,10 +1000,10 @@ voteService.showOpenVote(voteUsrAttempt); logger.debug("voteUsrAttempt: " + voteUsrAttempt); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); String currentMonitoredToolSession=voteMonitoringForm.getSelectedToolSessionId(); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -99,11 +99,11 @@ IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); /*true means there is at least 1 response*/ if (voteService.studentActivityOccurredStandardAndOpen(voteContent)) { @@ -125,7 +125,7 @@ request.getSession().setAttribute(IS_PORTFOLIO_EXPORT, new Boolean(false).toString()); voteMonitoringForm.setShowOpenVotesSection(new Boolean(false).toString()); - logger.debug("calling submitSession:" + toolContentId); + logger.debug("calling submitSession:" + toolContentID); return voteMonitoringAction.submitSession(mapping, form, request, response); } @@ -148,10 +148,10 @@ VoteUtils.saveTimeZone(request); /* we have made sure TOOL_CONTENT_ID is passed */ - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); - VoteContent voteContent=voteService.retrieveVote(toolContentId); + VoteContent voteContent=voteService.retrieveVote(toolContentID); logger.debug("existing voteContent:" + voteContent); if (voteContent == null) @@ -272,9 +272,9 @@ { try { - long toolContentId=new Long(strToolContentId).longValue(); - logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentId)); - request.getSession().setAttribute(TOOL_CONTENT_ID,new Long(toolContentId)); + long toolContentID=new Long(strToolContentId).longValue(); + logger.debug("passed TOOL_CONTENT_ID : " + new Long(toolContentID)); + request.getSession().setAttribute(TOOL_CONTENT_ID,new Long(toolContentID)); } catch(NumberFormatException e) { Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java =================================================================== diff -u -r42c1b74cbc393836dc6e71afbb4223c27690e40e -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 42c1b74cbc393836dc6e71afbb4223c27690e40e) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteStarterAction.java (.../VoteStarterAction.java) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -68,11 +68,64 @@ * Tool path The URL path for the tool should be /tool/$TOOL_SIG. * - The author is given warnings when the content in use by learners OR when the content is being edited in the Monitoring interface. + The author is given warnings when the content in use by learners OR when the content is being edited in the Monitoring interface. + + + + + + + + + + + + + + + + + + + + */ package org.lamsfoundation.lams.tool.vote.web; import java.io.IOException; +import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -94,12 +147,14 @@ import org.lamsfoundation.lams.tool.vote.VoteAppConstants; import org.lamsfoundation.lams.tool.vote.VoteApplicationException; import org.lamsfoundation.lams.tool.vote.VoteComparator; +import org.lamsfoundation.lams.tool.vote.VoteGeneralAuthoringDTO; import org.lamsfoundation.lams.tool.vote.VoteUtils; import org.lamsfoundation.lams.tool.vote.pojos.VoteContent; import org.lamsfoundation.lams.tool.vote.pojos.VoteQueContent; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.web.util.SessionMap; public class VoteStarterAction extends Action implements VoteAppConstants { @@ -115,38 +170,49 @@ logger.debug("init authoring mode. removed attributes..."); VoteAuthoringForm voteAuthoringForm = (VoteAuthoringForm) form; + VoteGeneralAuthoringDTO voteGeneralAuthoringDTO = new VoteGeneralAuthoringDTO(); - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); + IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); logger.debug("voteService: " + voteService); - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from cache: " + voteService); - } - request.getSession().setAttribute(TOOL_SERVICE, voteService); voteAuthoringForm.setSubmissionAttempt(new Boolean(false).toString()); voteAuthoringForm.setSbmtSuccess(new Boolean(false).toString()); - String servletPath=request.getServletPath(); + voteGeneralAuthoringDTO.setSubmissionAttempt(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setSbmtSuccess(new Boolean(false).toString()); + + String servletPath=request.getServletPath(); logger.debug("getServletPath: "+ servletPath); if (servletPath.indexOf("authoringStarter") > 0) { logger.debug("request is for authoring module"); - request.getSession().setAttribute(ACTIVE_MODULE, AUTHORING); voteAuthoringForm.setActiveModule(AUTHORING); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(true)); + voteGeneralAuthoringDTO.setActiveModule(AUTHORING); + + voteAuthoringForm.setDefineLaterInEditMode(new Boolean(true).toString()); + voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(true).toString()); } else { logger.debug("request is for define later module. either direct or by monitoring module"); - request.getSession().setAttribute(ACTIVE_MODULE, DEFINE_LATER); voteAuthoringForm.setActiveModule(DEFINE_LATER); - request.getSession().setAttribute(DEFINE_LATER_IN_EDIT_MODE, new Boolean(false)); + voteGeneralAuthoringDTO.setActiveModule(DEFINE_LATER); + + voteAuthoringForm.setDefineLaterInEditMode(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setDefineLaterInEditMode(new Boolean(false).toString()); } - initialiseAttributes(request); + initialiseAttributes(request, voteGeneralAuthoringDTO); + + + SessionMap sessionMap = new SessionMap(); + sessionMap.put(ATTACHMENT_LIST_KEY, new ArrayList()); + sessionMap.put(DELETED_ATTACHMENT_LIST_KEY, new ArrayList()); + sessionMap.put(ACTIVITY_TITLE_KEY, ""); + sessionMap.put(ACTIVITY_INSTRUCTIONS_KEY, ""); + voteAuthoringForm.setHttpSessionID(sessionMap.getSessionID()); + voteGeneralAuthoringDTO.setHttpSessionID(sessionMap.getSessionID()); + /* determine whether the request is from Monitoring url Edit Activity. * null sourceVoteStarter indicates that the request is from authoring url. * */ @@ -156,8 +222,9 @@ voteAuthoringForm.resetRadioBoxes(); voteAuthoringForm.setExceptionMaxNominationInvalid(new Boolean(false).toString()); + voteGeneralAuthoringDTO.setExceptionMaxNominationInvalid(new Boolean(false).toString()); - ActionForward validateSignature=readSignature(request,mapping); + ActionForward validateSignature=readSignature(request,mapping, voteService, voteAuthoringForm); logger.debug("validateSignature: " + validateSignature); if (validateSignature != null) { @@ -172,22 +239,23 @@ strToolContentId=request.getParameter(AttributeNames.PARAM_TOOL_CONTENT_ID); logger.debug("strToolContentId: " + strToolContentId); + /* this will be fixed when making changes to Monitoring module */ if (strToolContentId == null) { /*it is possible that the original request for authoring module is coming from monitoring url which keeps the TOOL_CONTENT_ID in the session*/ - Long toolContentId =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); - logger.debug("toolContentId: " + toolContentId); - if (toolContentId != null) + Long toolContentID =(Long) request.getSession().getAttribute(TOOL_CONTENT_ID); + logger.debug("toolContentID: " + toolContentID); + if (toolContentID != null) { - strToolContentId= toolContentId.toString(); + strToolContentId= toolContentID.toString(); logger.debug("cached strToolContentId from the session: " + strToolContentId); } else { logger.debug("we should IDEALLY not arrive here. The TOOL_CONTENT_ID is NOT available from the url or the session."); /*use default content instead of giving a warning*/ - String defaultContentId=(String) request.getSession().getAttribute(DEFAULT_CONTENT_ID); + String defaultContentId=voteAuthoringForm.getDefaultContentId(); logger.debug("using Voting defaultContentId: " + defaultContentId); strToolContentId=defaultContentId; } @@ -197,27 +265,25 @@ if ((strToolContentId == null) || (strToolContentId.equals(""))) { VoteUtils.cleanUpSessionAbsolute(request); - request.getSession().setAttribute(USER_EXCEPTION_CONTENTID_REQUIRED, new Boolean(true).toString()); - persistInRequestError(request,"error.contentId.required"); + saveInRequestError(request,"error.contentId.required"); VoteUtils.cleanUpSessionAbsolute(request); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } /* Process incoming tool content id. - * Either exists or not exists in the db yet, a toolContentId must be passed to the tool from the container */ - long toolContentId=0; + * Either exists or not exists in the db yet, a toolContentID must be passed to the tool from the container */ + long toolContentID=0; try { - toolContentId=new Long(strToolContentId).longValue(); - logger.debug("passed TOOL_CONTENT_ID : " + toolContentId); - request.getSession().setAttribute(TOOL_CONTENT_ID, new Long(strToolContentId)); + toolContentID=new Long(strToolContentId).longValue(); + logger.debug("passed TOOL_CONTENT_ID : " + toolContentID); + voteAuthoringForm.setToolContentID(new Long(strToolContentId).toString()); } catch(NumberFormatException e) { VoteUtils.cleanUpSessionAbsolute(request); - request.getSession().setAttribute(USER_EXCEPTION_NUMBERFORMAT, new Boolean(true).toString()); - persistInRequestError(request,"error.numberFormatException"); + saveInRequestError(request,"error.numberFormatException"); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -233,14 +299,15 @@ Map mapOptionsContent= new TreeMap(new VoteComparator()); logger.debug("mapOptionsContent: " + mapOptionsContent); - if (!existsContent(toolContentId, request)) + if (!existsContent(toolContentID, request, voteService)) { logger.debug("getting default content"); /*fetch default content*/ - String defaultContentIdStr=(String) request.getSession().getAttribute(DEFAULT_CONTENT_ID_STR); - logger.debug("defaultContentIdStr:" + defaultContentIdStr); + String defaultContentIdStr=voteAuthoringForm.getDefaultContentIdStr(); logger.debug("will get content for defaultContentIdStr:" + defaultContentIdStr); - retrieveContent(request, mapping, voteAuthoringForm, mapOptionsContent, new Long(defaultContentIdStr).longValue()); + retrieveContent(request, voteService, voteAuthoringForm, voteGeneralAuthoringDTO, mapOptionsContent, + new Long(defaultContentIdStr).longValue(), sessionMap); + } else { @@ -252,8 +319,7 @@ { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("student activity occurred on this content:" + voteContent); - request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString()); - persistInRequestError(request, "error.content.inUse"); + saveInRequestError(request, "error.content.inUse"); return (mapping.findForward(ERROR_LIST)); } @@ -265,15 +331,15 @@ { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("student activity occurred on this content:" + voteContent); - request.getSession().setAttribute(USER_EXCEPTION_CONTENT_IN_USE, new Boolean(true).toString()); - persistInRequestError(request, "error.content.inUse"); + saveInRequestError(request, "error.content.inUse"); return (mapping.findForward(ERROR_LIST)); } } logger.debug("will get content for strToolContentId:" + strToolContentId); - retrieveContent(request, mapping, voteAuthoringForm, mapOptionsContent, new Long(strToolContentId).longValue()); + retrieveContent(request, voteService, voteAuthoringForm, voteGeneralAuthoringDTO, mapOptionsContent, + new Long(strToolContentId).longValue(), sessionMap); } } @@ -285,16 +351,19 @@ logger.debug("will return to jsp with: " + sourceVoteStarter); String destination=VoteUtils.getDestination(sourceVoteStarter); logger.debug("destination: " + destination); - logger.debug("active module is: " + voteAuthoringForm.getActiveModule()); + + logger.debug("voteGeneralAuthoringDTO: " + voteGeneralAuthoringDTO); + request.setAttribute(VOTE_GENERAL_AUTHORING_DTO, voteGeneralAuthoringDTO); - logger.debug("final ACTIVITY_TITLE is: " + request.getSession().getAttribute(ACTIVITY_TITLE)); + logger.debug("persisting sessionMap into session: " + sessionMap); + request.getSession().setAttribute(sessionMap.getSessionID(), sessionMap); return (mapping.findForward(destination)); } - protected void initialiseAttributes(HttpServletRequest request) + protected void initialiseAttributes(HttpServletRequest request, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO) { logger.debug("starting initialiseAttributes..."); @@ -305,38 +374,33 @@ LinkedList listUploadedOfflineFileNames= new LinkedList(); LinkedList listUploadedOnlineFileNames= new LinkedList(); - request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES,listUploadedOfflineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES,listUploadedOnlineFileNames); + voteGeneralAuthoringDTO.setListUploadedOfflineFileNames(listUploadedOfflineFileNames); + voteGeneralAuthoringDTO.setListUploadedOnlineFileNames (listUploadedOnlineFileNames); LinkedList listOfflineFilesMetaData= new LinkedList(); LinkedList listOnlineFilesMetaData= new LinkedList(); - request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); - request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); + + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); } /** * each tool has a signature. Voting tool's signature is stored in MY_SIGNATURE. The default tool content id and * other depending content ids are obtained in this method. - * if all the default content has been setup properly the method persists DEFAULT_CONTENT_ID in the session. + * if all the default content has been setup properly the method saves DEFAULT_CONTENT_ID in the session. * * readSignature(HttpServletRequest request, ActionMapping mapping) * @param request * @param mapping * @return ActionForward */ - public ActionForward readSignature(HttpServletRequest request, ActionMapping mapping) + public ActionForward readSignature(HttpServletRequest request, ActionMapping mapping, IVoteService voteService, + VoteAuthoringForm voteAuthoringForm) { - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); - logger.debug("voteService: " + voteService); - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - } - request.getSession().setAttribute(TOOL_SERVICE, voteService); + logger.debug("start reading tool signature: " + voteService); + //request.getSession().setAttribute(TOOL_SERVICE, voteService); /* * retrieve the default content id based on tool signature */ @@ -350,17 +414,15 @@ { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("default content id has not been setup"); - persistInRequestError(request,"error.defaultContent.notSetup"); - request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); + saveInRequestError(request,"error.defaultContent.notSetup"); return (mapping.findForward(ERROR_LIST)); } } catch(Exception e) { VoteUtils.cleanUpSessionAbsolute(request); logger.debug("error getting the default content id: " + e.getMessage()); - persistInRequestError(request,"error.defaultContent.notSetup"); - request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); + saveInRequestError(request,"error.defaultContent.notSetup"); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } @@ -378,8 +440,7 @@ logger.debug("voteContent is null: " + voteContent); VoteUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default content"); - persistInRequestError(request,"error.defaultContent.notSetup"); - request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); + saveInRequestError(request,"error.defaultContent.notSetup"); return (mapping.findForward(ERROR_LIST)); } logger.debug("using voteContent: " + voteContent); @@ -392,78 +453,49 @@ logger.debug("other problems: " + e); VoteUtils.cleanUpSessionAbsolute(request); logger.debug("Exception occured: No default question content"); - persistInRequestError(request,"error.defaultContent.notSetup"); - request.getSession().setAttribute(USER_EXCEPTION_DEFAULTCONTENT_NOTSETUP, new Boolean(true).toString()); + saveInRequestError(request,"error.defaultContent.notSetup"); logger.debug("forwarding to: " + ERROR_LIST); return (mapping.findForward(ERROR_LIST)); } logger.debug("Voting tool has the default content id: " + defaultContentID); - request.getSession().setAttribute(DEFAULT_CONTENT_ID_STR, new Long(defaultContentID).toString()); - request.getSession().setAttribute(DEFAULT_CONTENT_ID, new Long(defaultContentID).toString()); + + voteAuthoringForm.setDefaultContentId(new Long(defaultContentID).toString()); + voteAuthoringForm.setDefaultContentIdStr(new Long(defaultContentID).toString()); return null; - } - protected void retrieveContent(HttpServletRequest request, ActionMapping mapping, VoteAuthoringForm voteAuthoringForm, Map mapOptionsContent, long toolContentId) + protected void retrieveContent(HttpServletRequest request, IVoteService voteService, + VoteAuthoringForm voteAuthoringForm, VoteGeneralAuthoringDTO voteGeneralAuthoringDTO, + Map mapOptionsContent, long toolContentID, SessionMap sessionMap) { - logger.debug("starting retrieve content for toolContentId: " + toolContentId); - - IVoteService voteService = (IVoteService)request.getSession().getAttribute(TOOL_SERVICE); + logger.debug("starting retrieve content for toolContentID: " + toolContentID); logger.debug("voteService: " + voteService); - if (voteService == null) - { - logger.debug("will retrieve voteService"); - voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext()); - logger.debug("retrieving voteService from session: " + voteService); - } - request.getSession().setAttribute(TOOL_SERVICE, voteService); - logger.debug("getting existing content with id:" + toolContentId); - VoteContent voteContent = voteService.retrieveVote(new Long(toolContentId)); + logger.debug("getting existing content with id:" + toolContentID); + VoteContent voteContent = voteService.retrieveVote(new Long(toolContentID)); logger.debug("voteContent: " + voteContent); - VoteUtils.setDefaultSessionAttributes(request, voteContent, voteAuthoringForm); + VoteUtils.readContentValues(request, voteContent, voteAuthoringForm, voteGeneralAuthoringDTO); logger.debug("form title is: : " + voteAuthoringForm.getTitle()); - request.getSession().setAttribute(IS_DEFINE_LATER, new Boolean(voteContent.isDefineLater())); - - voteAuthoringForm.setTitle(voteContent.getTitle()); - voteAuthoringForm.setInstructions(voteContent.getInstructions()); - + voteAuthoringForm.setIsDefineLater(new Boolean(voteContent.isDefineLater()).toString()); + voteGeneralAuthoringDTO.setIsDefineLater(new Boolean(voteContent.isDefineLater()).toString()); + if (voteContent.getTitle() == null) { - request.getSession().setAttribute(ACTIVITY_TITLE, "Voting Title"); - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, "Voting Instructions"); + voteGeneralAuthoringDTO.setActivityTitle("Voting Title"); + voteGeneralAuthoringDTO.setActivityInstructions("Voting Instructions"); } else { - request.getSession().setAttribute(ACTIVITY_TITLE, voteContent.getTitle()); - request.getSession().setAttribute(ACTIVITY_INSTRUCTIONS, voteContent.getInstructions()); + voteGeneralAuthoringDTO.setActivityTitle(voteContent.getTitle()); + voteGeneralAuthoringDTO.setActivityInstructions(voteContent.getInstructions()); } - logger.debug("Title is: " + voteContent.getTitle()); - logger.debug("Instructions is: " + voteContent.getInstructions()); - if ((voteAuthoringForm.getTitle() == null) || (voteAuthoringForm.getTitle().equals(""))) - { - logger.debug("resetting title"); - String activityTitle=(String)request.getSession().getAttribute(ACTIVITY_TITLE); - logger.debug("activityTitle: " + activityTitle); - voteAuthoringForm.setTitle(activityTitle); - } - - if ((voteAuthoringForm.getInstructions() == null) || (voteAuthoringForm.getInstructions().equals(""))) - { - logger.debug("resetting instructions"); - String activityInstructions=(String)request.getSession().getAttribute(ACTIVITY_INSTRUCTIONS); - logger.debug("activityInstructions: " + activityInstructions); - voteAuthoringForm.setInstructions(activityInstructions); - } - - /* * get the nominations */ @@ -484,48 +516,67 @@ */ if (mapIndex.longValue() == 1) { - request.getSession().setAttribute(DEFAULT_OPTION_CONTENT, voteQueContent.getQuestion()); + voteGeneralAuthoringDTO.setDefaultOptionContent(voteQueContent.getQuestion()); } mapIndex=new Long(mapIndex.longValue()+1); } } logger.debug("Map initialized with existing contentid to: " + mapOptionsContent); - request.getSession().setAttribute(MAP_OPTIONS_CONTENT, mapOptionsContent); - logger.debug("starter initialized the Comparable Map: " + request.getSession().getAttribute(MAP_OPTIONS_CONTENT) ); + voteGeneralAuthoringDTO.setMapOptionsContent(mapOptionsContent); + sessionMap.put(MAP_OPTIONS_CONTENT_KEY, mapOptionsContent); int maxIndex=mapOptionsContent.size(); - request.getSession().setAttribute(MAX_OPTION_INDEX, new Integer(maxIndex)); - logger.debug("MAX_OPTION_INDEX: " + request.getSession().getAttribute(MAX_OPTION_INDEX)); - - - logger.debug("final title: " + voteAuthoringForm.getTitle()); - logger.debug("final ins: " + voteAuthoringForm.getInstructions()); - - request.getSession().setAttribute(RICHTEXT_OFFLINEINSTRUCTIONS, voteContent.getOfflineInstructions()); - request.getSession().setAttribute(RICHTEXT_ONLINEINSTRUCTIONS, voteContent.getOnlineInstructions()); + voteGeneralAuthoringDTO.setMaxOptionIndex(maxIndex); + voteGeneralAuthoringDTO.setRichTextOfflineInstructions(voteContent.getOfflineInstructions()); + voteGeneralAuthoringDTO.setRichTextOnlineInstructions(voteContent.getOnlineInstructions()); + + + if ((voteContent.getOnlineInstructions() == null) || (voteContent.getOnlineInstructions().length() == 0)) + { + voteGeneralAuthoringDTO.setRichTextOnlineInstructions(DEFAULT_ONLINE_INST); + sessionMap.put(ONLINE_INSTRUCTIONS_KEY, DEFAULT_ONLINE_INST); + } + + if ((voteContent.getOfflineInstructions() == null) || (voteContent.getOfflineInstructions().length() == 0)) + { + voteGeneralAuthoringDTO.setRichTextOfflineInstructions(DEFAULT_OFFLINE_INST); + sessionMap.put(OFFLINE_INSTRUCTIONS_KEY, DEFAULT_OFFLINE_INST); + } + + /*process offline files metadata*/ List listOfflineFilesMetaData=voteService.getOfflineFilesMetaData(voteContent.getUid()); logger.debug("existing listOfflineFilesMetaData, to be structured as VoteAttachmentDTO: " + listOfflineFilesMetaData); listOfflineFilesMetaData=AuthoringUtil.populateMetaDataAsAttachments(listOfflineFilesMetaData); logger.debug("populated listOfflineFilesMetaData: " + listOfflineFilesMetaData); - request.getSession().setAttribute(LIST_OFFLINEFILES_METADATA, listOfflineFilesMetaData); + voteGeneralAuthoringDTO.setListOfflineFilesMetadata(listOfflineFilesMetaData); + sessionMap.put(LIST_OFFLINEFILES_METADATA_KEY, listOfflineFilesMetaData); + List listUploadedOfflineFileNames=AuthoringUtil.populateMetaDataAsFilenames(listOfflineFilesMetaData); logger.debug("returned from db listUploadedOfflineFileNames: " + listUploadedOfflineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_OFFLINE_FILENAMES, listUploadedOfflineFileNames); + voteGeneralAuthoringDTO.setListUploadedOfflineFileNames(listUploadedOfflineFileNames); + sessionMap.put(LIST_UPLOADED_OFFLINE_FILENAMES_KEY, listUploadedOfflineFileNames); + + /*process online files metadata*/ List listOnlineFilesMetaData=voteService.getOnlineFilesMetaData(voteContent.getUid()); logger.debug("existing listOnlineFilesMetaData, to be structured as VoteAttachmentDTO: " + listOnlineFilesMetaData); listOnlineFilesMetaData=AuthoringUtil.populateMetaDataAsAttachments(listOnlineFilesMetaData); logger.debug("populated listOnlineFilesMetaData: " + listOnlineFilesMetaData); - request.getSession().setAttribute(LIST_ONLINEFILES_METADATA, listOnlineFilesMetaData); + voteGeneralAuthoringDTO.setListOnlineFilesMetadata(listOnlineFilesMetaData); + sessionMap.put(LIST_ONLINEFILES_METADATA_KEY, listOnlineFilesMetaData); + List listUploadedOnlineFileNames=AuthoringUtil.populateMetaDataAsFilenames(listOnlineFilesMetaData); logger.debug("returned from db listUploadedOnlineFileNames: " + listUploadedOnlineFileNames); - request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES, listUploadedOnlineFileNames); + //request.getSession().setAttribute(LIST_UPLOADED_ONLINE_FILENAMES, listUploadedOnlineFileNames); + voteGeneralAuthoringDTO.setListUploadedOnlineFileNames(listUploadedOnlineFileNames); + + sessionMap.put(LIST_UPLOADED_ONLINE_FILENAMES_KEY, listUploadedOnlineFileNames); /* @@ -538,16 +589,14 @@ HttpServletRequest request, HttpServletResponse response, IVoteService voteService) throws IOException, ServletException, VoteApplicationException { logger.debug("passed voteService: " + voteService); - request.getSession().setAttribute(TOOL_SERVICE, voteService); logger.debug("calling execute..."); return execute(mapping, form, request, response); } - protected boolean existsContent(long toolContentId, HttpServletRequest request) + protected boolean existsContent(long toolContentID, HttpServletRequest request, IVoteService voteService) { - IVoteService voteService =VoteUtils.getToolService(request); - VoteContent voteContent=voteService.retrieveVote(new Long(toolContentId)); + VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID)); if (voteContent == null) return false; @@ -556,11 +605,11 @@ /** - * persists error messages to request scope + * saves error messages to request scope * @param request * @param message */ - public void persistInRequestError(HttpServletRequest request, String message) + public void saveInRequestError(HttpServletRequest request, String message) { ActionMessages errors= new ActionMessages(); errors.add(Globals.ERROR_KEY, new ActionMessage(message)); Index: lams_tool_vote/web/WEB-INF/struts-config.xml =================================================================== diff -u -r793f2f3e75e63dda9c5b717317c8ad9553546e93 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 793f2f3e75e63dda9c5b717317c8ad9553546e93) +++ lams_tool_vote/web/WEB-INF/struts-config.xml (.../struts-config.xml) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -32,7 +32,7 @@ @@ -123,6 +123,7 @@ - - + + + initEditor(""); } @@ -132,13 +132,13 @@

@@ -149,8 +149,11 @@ + + + - + @@ -164,7 +167,7 @@ - + @@ -173,7 +176,7 @@ - + Index: lams_tool_vote/web/authoring/BasicContent.jsp =================================================================== diff -u -ra396ea2b749c1c978c3e9cfe05e427581dc6a1f7 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision a396ea2b749c1c978c3e9cfe05e427581dc6a1f7) +++ lams_tool_vote/web/authoring/BasicContent.jsp (.../BasicContent.jsp) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -37,20 +37,24 @@ @@ -61,13 +65,13 @@
- - images/success.gif" align="left" width=20 height=20> + + images/success.gif" align="left" width=20 height=20> + - - images/error.jpg" align="left" width=20 height=20> + + images/error.jpg" align="left" width=20 height=20> + - - images/error.jpg" align="left" width=20 height=20> + + images/error.jpg" align="left" width=20 height=20> + - - images/error.jpg" align="left" width=20 height=20> + + images/error.jpg" align="left" width=20 height=20> +
@@ -78,7 +82,7 @@ @@ -90,22 +94,22 @@ - - + + - + - @@ -146,14 +149,14 @@
- +
- +
- +
- + - + @@ -115,19 +119,18 @@ - + images/up.gif" align=left onclick="javascript:submitModifyNomination('','moveNominationUp');"> - + images/down.gif" align=left onclick="javascript:submitModifyNomination('','moveNominationDown');"> images/up.gif" align=left onclick="javascript:submitModifyNomination('','moveNominationUp');">
- +

- + Index: lams_tool_vote/web/authoring/InstructionsContent.jsp =================================================================== diff -u -r24da718dcf089cf564defc1341e7df46e943a956 -r80d305915ce2c3952f34ed08e8b4740188dde18c --- lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision 24da718dcf089cf564defc1341e7df46e943a956) +++ lams_tool_vote/web/authoring/InstructionsContent.jsp (.../InstructionsContent.jsp) (revision 80d305915ce2c3952f34ed08e8b4740188dde18c) @@ -35,15 +35,15 @@
- +
- + -
@@ -75,7 +75,7 @@
+ @@ -89,15 +89,15 @@
- +
- + @@ -129,7 +129,7 @@ -
@@ -120,7 +120,7 @@ - images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOnlineFile');"> + images/delete.gif" align=left onclick="javascript:submitDeleteFile('','deleteOfflineFile');">
+