Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java =================================================================== diff -u -r11fb8bf2f44d98981db355cda320dd4a22638343 -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision 11fb8bf2f44d98981db355cda320dd4a22638343) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServicePOJO.java (.../VoteServicePOJO.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -85,6 +85,7 @@ import org.lamsfoundation.lams.usermanagement.User; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; import org.lamsfoundation.lams.usermanagement.service.IUserManagementService; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.util.audit.IAuditService; import org.lamsfoundation.lams.util.wddx.WDDXProcessor; @@ -130,6 +131,8 @@ private ICoreNotebookService coreNotebookService; private IToolContentHandler voteToolContentHandler = null; private VoteOutputFactory voteOutputFactory; + + private MessageService messageService; public VoteServicePOJO(){} @@ -2667,4 +2670,17 @@ public void setVoteOutputFactory(VoteOutputFactory voteOutputFactory) { this.voteOutputFactory = voteOutputFactory; } + + /** + * @return Returns the MessageService. + */ + public MessageService getMessageService() { + return messageService; + } + /** + * @param messageService The MessageService to set. + */ + public void setMessageService(MessageService messageService) { + this.messageService = messageService; + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java =================================================================== diff -u -r08950e1090443c3423a3d1c587416a2fccd8bbdf -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java (.../VoteServiceProxy.java) (revision 08950e1090443c3423a3d1c587416a2fccd8bbdf) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/service/VoteServiceProxy.java (.../VoteServiceProxy.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -26,6 +26,7 @@ import org.lamsfoundation.lams.tool.ToolContentManager; import org.lamsfoundation.lams.tool.ToolSessionManager; +import org.lamsfoundation.lams.util.MessageService; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.support.WebApplicationContextUtils; @@ -62,10 +63,20 @@ return (ToolContentManager)getVoteDomainService(servletContext); } + public static final MessageService getMessageService(ServletContext servletContext){ + return (MessageService) getVoteMessageService(servletContext); + } + private static Object getVoteDomainService(ServletContext servletContext) { WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); return wac.getBean("voteService"); + } + + private static Object getVoteMessageService(ServletContext servletContext) + { + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + return wac.getBean("lavoteMessageService"); } } \ No newline at end of file Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml =================================================================== diff -u -rf4a9e406393661cd82a15e0ce1ac7405976f004e -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml (.../voteApplicationContext.xml) (revision f4a9e406393661cd82a15e0ce1ac7405976f004e) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/voteApplicationContext.xml (.../voteApplicationContext.xml) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -11,6 +11,12 @@ + + org.lamsfoundation.lams.tool.vote.ApplicationResources + + + + @@ -65,8 +71,7 @@ - - org.lamsfoundation.lams.tool.vote.ApplicationResources + @@ -86,7 +91,8 @@ - + + Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java =================================================================== diff -u -r7e4c0870acdbc0f8835aae86d648796392d0e62c -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision 7e4c0870acdbc0f8835aae86d648796392d0e62c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -47,6 +47,7 @@ import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.util.ChartUtil; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.web.servlet.AbstractExportPortfolioServlet; /** *

Enables exporting portfolio for teacher and learner modes.

@@ -110,6 +111,7 @@ exportPortfolioDTO.setPortfolioExportMode("learner"); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); + MessageService messageService = VoteServiceProxy.getMessageService(getServletContext()); if (userID == null || toolSessionID == null) { @@ -144,7 +146,7 @@ MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), - voteSession.getUid(), exportPortfolioDTO); + voteSession.getUid(), exportPortfolioDTO, messageService); // VoteChartGenerator.create{Pie|Bar}Chart expects these to be session attributes if ( voteSession.getVoteContent().isShowResults() ) { @@ -173,7 +175,8 @@ exportPortfolioDTO.setPortfolioExportMode("teacher"); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); - + MessageService messageService = VoteServiceProxy.getMessageService(getServletContext()); + if (toolContentID==null) { String error="Tool Content Id is missing. Unable to continue"; @@ -195,7 +198,7 @@ voteMonitoringAction.refreshSummaryData(request, content, voteService, true, false, null, null, false, null, voteGeneralMonitoringDTO, exportPortfolioDTO); - MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null, exportPortfolioDTO); + MonitoringUtil.prepareChartDataForExportTeacher(request, voteService, null, content.getVoteContentId(), null, exportPortfolioDTO, messageService); // VoteChartGenerator.create{Pie|Bar}Chart expects these to be session attributes request.getSession().setAttribute(MAP_STANDARD_NOMINATIONS_CONTENT, exportPortfolioDTO.getMapStandardNominationsContent()); request.getSession().setAttribute(MAP_STANDARD_RATES_CONTENT, exportPortfolioDTO.getMapStandardRatesContent()); @@ -231,5 +234,5 @@ { logger.error("exception creating chart: ",e) ; } - } + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java =================================================================== diff -u -rc9ab620bc529d50039985fe9f823eda3b099edde -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision c9ab620bc529d50039985fe9f823eda3b099edde) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -53,6 +53,7 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteSession; import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; +import org.lamsfoundation.lams.util.MessageService; /** * @@ -887,7 +888,7 @@ */ public static void prepareChartData(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm, String toolContentID, String toolSessionUid, VoteGeneralLearnerFlowDTO voteGeneralLearnerFlowDTO, - VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) + VoteGeneralMonitoringDTO voteGeneralMonitoringDTO, MessageService messageService) { logger.debug("starting prepareChartData, voteGeneralLearnerFlowDTO: " + voteGeneralLearnerFlowDTO); logger.debug("starting prepareChartData, toolContentID: " + toolContentID); @@ -1076,8 +1077,8 @@ logger.debug("final share: " + share); if(voteContent.isAllowText()) { - mapStandardNominationsContent.put(mapIndex.toString(), "Open Vote"); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), "Open Vote"); + mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); + mapStandardNominationsHTMLedContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); } mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString()); @@ -1133,7 +1134,7 @@ * @param toolSessionUid */ public static void prepareChartDataForExportTeacher(HttpServletRequest request, IVoteService voteService, - VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid, ExportPortfolioDTO exportPortfolioDTO) + VoteMonitoringForm voteMonitoringForm, Long toolContentID, Long toolSessionUid, ExportPortfolioDTO exportPortfolioDTO, MessageService messageService) { logger.debug("starting prepareChartDataForExportTeacher, toolContentID: " + toolContentID); logger.debug("starting prepareChartDataForExportTeacher, toolSessionUid: " + toolSessionUid); @@ -1240,8 +1241,8 @@ logger.debug("final share: " + share); - mapStandardNominationsContent.put(mapIndex.toString(), "Open Vote"); - mapStandardNominationsHTMLedContent.put(mapIndex.toString(), "Open Vote"); + mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); + mapStandardNominationsHTMLedContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote")); mapStandardRatesContent.put(mapIndex.toString(), new Double(share).toString()); mapStandardUserCount.put(mapIndex.toString(), new Integer(userEnteredVotesCount).toString()); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java =================================================================== diff -u -r8ac899b7d4b4fb15385b284920c66a40bf30c086 -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java (.../VoteChartGenerator.java) (revision 8ac899b7d4b4fb15385b284920c66a40bf30c086) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteChartGenerator.java (.../VoteChartGenerator.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -48,6 +48,7 @@ import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.util.ChartUtil; +import org.lamsfoundation.lams.util.MessageService; /** *

Enables generation of JFreeCharts

@@ -80,15 +81,16 @@ { logger.debug("currentSessionId is specified, generating data for all sessions dto: "); IVoteService voteService = VoteServiceProxy.getVoteService(getServletContext()); - + MessageService messageService = VoteServiceProxy.getMessageService(getServletContext()); + VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentSessionId)); logger.debug("voteSession uid:" + voteSession.getUid()); VoteContent voteContent=voteSession.getVoteContent(); VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), null, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), null, voteGeneralMonitoringDTO, messageService); if ( logger.isDebugEnabled() ) { logger.debug("creating maps MAP_STANDARD_NOMINATIONS_CONTENT and MAP_STANDARD_RATES_CONTENT: " + currentSessionId); Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java =================================================================== diff -u -rc9ab620bc529d50039985fe9f823eda3b099edde -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision c9ab620bc529d50039985fe9f823eda3b099edde) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningAction.java (.../VoteLearningAction.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -64,6 +64,7 @@ import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; +import org.lamsfoundation.lams.util.MessageService; /** *

Action class that controls the logic of tool behavior.

@@ -280,7 +281,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); logger.debug("end of prepareChartData:" + voteContent.getVoteContentId() + " " + voteSession.getUid()); @@ -783,7 +784,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); logger.debug("calling prepareChartData: " + toolContentID); MonitoringUtil.prepareChartData(request, voteService, null, toolContentID.toString(), toolSessionUid.toString(), - voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); voteGeneralLearnerFlowDTO.setReflection(new Boolean(voteContent.isReflect()).toString()); voteGeneralLearnerFlowDTO.setReflectionSubject(voteContent.getReflectionSubject()); @@ -1068,6 +1069,13 @@ logger.debug("userEntry: " + userEntry); voteLearningForm.setUserEntry(userEntry); } + + /** + * Return ResourceService bean. + */ + private MessageService getMessageService() { + return (MessageService) VoteServiceProxy.getMessageService(getServlet().getServletContext()); + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java =================================================================== diff -u -r7e4c0870acdbc0f8835aae86d648796392d0e62c -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision 7e4c0870acdbc0f8835aae86d648796392d0e62c) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteLearningStarterAction.java (.../VoteLearningStarterAction.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -189,6 +189,7 @@ import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; import org.lamsfoundation.lams.usermanagement.dto.UserDTO; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.web.session.SessionManager; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -370,7 +371,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); logger.debug("fwd'ing to: " + EXIT_PAGE); return (mapping.findForward(EXIT_PAGE)); @@ -482,7 +483,7 @@ VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO(); MonitoringUtil.prepareChartData(request, voteService, null, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), voteGeneralLearnerFlowDTO, voteGeneralMonitoringDTO, getMessageService()); String isContentLockOnFinish=voteLearningForm.getLockOnFinish(); @@ -751,4 +752,11 @@ logger.debug("add " + message +" to ActionMessages:"); saveErrors(request,errors); } + + /** + * Return ResourceService bean. + */ + private MessageService getMessageService() { + return (MessageService) VoteServiceProxy.getMessageService(getServlet().getServletContext()); + } } Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java =================================================================== diff -u -r00759d7592ccc90e8769763524afb69546f641d4 -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision 00759d7592ccc90e8769763524afb69546f641d4) +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9) @@ -64,6 +64,7 @@ import org.lamsfoundation.lams.tool.vote.pojos.VoteUsrAttempt; import org.lamsfoundation.lams.tool.vote.service.IVoteService; import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy; +import org.lamsfoundation.lams.util.MessageService; import org.lamsfoundation.lams.util.WebUtil; import org.lamsfoundation.lams.web.action.LamsDispatchAction; import org.lamsfoundation.lams.web.util.AttributeNames; @@ -248,7 +249,7 @@ VoteSession voteSession=voteService.retrieveVoteSession(new Long(currentMonitoredToolSession)); logger.debug("voteSession uid:" + voteSession.getUid()); MonitoringUtil.prepareChartData(request, voteService, voteMonitoringForm, voteContent.getVoteContentId().toString(), - voteSession.getUid().toString(), null, voteGeneralMonitoringDTO); + voteSession.getUid().toString(), null, voteGeneralMonitoringDTO, getMessageService()); logger.debug("post prepareChartData, voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO); @@ -3829,5 +3830,12 @@ return reflectionsContainerDTO; } + + /** + * Return ResourceService bean. + */ + private MessageService getMessageService() { + return (MessageService) VoteServiceProxy.getMessageService(getServlet().getServletContext()); + } } \ No newline at end of file