Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/ExportPortfolioDTO.java
===================================================================
diff -u -r7e4c0870acdbc0f8835aae86d648796392d0e62c -rc95a3c1916cce09b1a5467306f3eaf4a57b22727
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/ExportPortfolioDTO.java (.../ExportPortfolioDTO.java) (revision 7e4c0870acdbc0f8835aae86d648796392d0e62c)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/ExportPortfolioDTO.java (.../ExportPortfolioDTO.java) (revision c95a3c1916cce09b1a5467306f3eaf4a57b22727)
@@ -49,7 +49,7 @@
protected List listUserEntries;
protected List listMonitoredAnswersContainerDto;
-
+ protected boolean allowText;
public int compareTo(Object o)
{
@@ -176,4 +176,12 @@
public void setShowResults(String showResults) {
this.showResults = showResults;
}
+
+ public boolean isAllowText() {
+ return allowText;
+ }
+
+ public void setAllowText(boolean allowText) {
+ this.allowText = allowText;
+ }
}
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java
===================================================================
diff -u -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 -rc95a3c1916cce09b1a5467306f3eaf4a57b22727
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/ExportServlet.java (.../ExportServlet.java) (revision c95a3c1916cce09b1a5467306f3eaf4a57b22727)
@@ -137,7 +137,9 @@
logger.error(error);
throw new VoteApplicationException(error);
}
-
+
+ exportPortfolioDTO.setAllowText(content.isAllowText());
+
VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO();
VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction();
@@ -193,6 +195,8 @@
throw new VoteApplicationException(error);
}
+ exportPortfolioDTO.setAllowText(content.isAllowText());
+
VoteGeneralMonitoringDTO voteGeneralMonitoringDTO=new VoteGeneralMonitoringDTO();
VoteMonitoringAction voteMonitoringAction= new VoteMonitoringAction();
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java
===================================================================
diff -u -r9c4cf38aadd15baa1d9729353a2b76221334bb44 -rc95a3c1916cce09b1a5467306f3eaf4a57b22727
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision 9c4cf38aadd15baa1d9729353a2b76221334bb44)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/MonitoringUtil.java (.../MonitoringUtil.java) (revision c95a3c1916cce09b1a5467306f3eaf4a57b22727)
@@ -53,6 +53,8 @@
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.tool.vote.service.VoteServicePOJO;
+import org.lamsfoundation.lams.tool.vote.service.VoteServiceProxy;
import org.lamsfoundation.lams.util.MessageService;
/**
@@ -678,7 +680,7 @@
* @return
*/
public static List prepareChartDTO(HttpServletRequest request, IVoteService voteService, VoteMonitoringForm voteMonitoringForm,
- Long toolContentID)
+ Long toolContentID, MessageService messageService)
{
logger.debug("start preparing ChartDTO with voteMonitoringForm: " + voteMonitoringForm);
logger.debug("start preparing ChartDTO with toolContentID: " + toolContentID);
@@ -838,8 +840,10 @@
}
logger.debug("final share: " + share);
- mapStandardNominationsContent.put(mapIndex.toString(), "Open Vote");
- mapStandardNominationsHTMLedContent.put(mapIndex.toString(), "Open Vote");
+ if (voteContent.isAllowText()) {
+ 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());
/**following are needed just for proper iteration in the summary jsp*/
@@ -1241,9 +1245,11 @@
}
logger.debug("final share: " + share);
-
- mapStandardNominationsContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote"));
- mapStandardNominationsHTMLedContent.put(mapIndex.toString(), messageService.getMessage("label.open.vote"));
+
+ if(voteContent.isAllowText()) {
+ 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/VoteMonitoringAction.java
===================================================================
diff -u -rf9356efe2fe0d2e08e10c52543c5ea80822196c9 -rc95a3c1916cce09b1a5467306f3eaf4a57b22727
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision f9356efe2fe0d2e08e10c52543c5ea80822196c9)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringAction.java (.../VoteMonitoringAction.java) (revision c95a3c1916cce09b1a5467306f3eaf4a57b22727)
@@ -198,18 +198,19 @@
HttpServletRequest request,
HttpServletResponse response,
IVoteService voteService,
+ MessageService messageService,
VoteGeneralMonitoringDTO voteGeneralMonitoringDTO
) throws IOException,
ServletException
{
logger.debug("calling submitSession...voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO);
- commonSubmitSessionCode(form, request, voteService,voteGeneralMonitoringDTO);
+ commonSubmitSessionCode(form, request, voteService, messageService, voteGeneralMonitoringDTO);
logger.debug("post commonSubmitSessionCode: " +voteGeneralMonitoringDTO);
return (mapping.findForward(LOAD_MONITORING));
}
- protected void commonSubmitSessionCode(ActionForm form, HttpServletRequest request,IVoteService voteService,
+ protected void commonSubmitSessionCode(ActionForm form, HttpServletRequest request,IVoteService voteService, MessageService messageService,
VoteGeneralMonitoringDTO voteGeneralMonitoringDTO) throws IOException, ServletException
{
logger.debug("starting commonSubmitSessionCode...voteGeneralMonitoringDTO:" + voteGeneralMonitoringDTO);
@@ -228,15 +229,15 @@
VoteContent voteContent=voteService.retrieveVote(new Long(toolContentID));
logger.debug("existing voteContent:" + voteContent);
-
-
+
+
if (currentMonitoredToolSession.equals("All"))
{
voteGeneralMonitoringDTO.setSelectionCase(new Long(2));
request.setAttribute(SELECTION_CASE, new Long(2));
logger.debug("generate DTO for All sessions: ");
- List listVoteAllSessionsDTO=MonitoringUtil.prepareChartDTO(request, voteService, voteMonitoringForm, voteContent.getVoteContentId());
+ List listVoteAllSessionsDTO=MonitoringUtil.prepareChartDTO(request, voteService, voteMonitoringForm, voteContent.getVoteContentId(), messageService);
logger.debug("listVoteAllSessionsDTO: " + listVoteAllSessionsDTO);
voteGeneralMonitoringDTO.setListVoteAllSessionsDTO(listVoteAllSessionsDTO);
}
@@ -405,7 +406,8 @@
public ActionForward submitSession(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
- HttpServletResponse response)
+ HttpServletResponse response,
+ MessageService messageService)
throws IOException,ServletException
{
logger.debug("dispathcing submitSession..");
@@ -414,7 +416,7 @@
VoteGeneralMonitoringDTO voteGeneralMonitoringDTO= new VoteGeneralMonitoringDTO();
- commonSubmitSessionCode(form, request, voteService,voteGeneralMonitoringDTO);
+ commonSubmitSessionCode(form, request, voteService, messageService, voteGeneralMonitoringDTO);
logger.debug("post commonSubmitSessionCode: " +voteGeneralMonitoringDTO);
@@ -1469,7 +1471,7 @@
logger.debug("submitting session to refresh the data from the database: ");
- return submitSession(mapping, form, request, response, voteService, voteGeneralMonitoringDTO);
+ return submitSession(mapping, form, request, response, voteService, getMessageService(), voteGeneralMonitoringDTO);
}
@@ -1613,7 +1615,7 @@
MonitoringUtil.buildVoteStatsDTO(request,voteService, voteContent);
logger.debug("submitting session to refresh the data from the database: ");
- return submitSession(mapping, form, request, response, voteService, voteGeneralMonitoringDTO);
+ return submitSession(mapping, form, request, response, voteService, getMessageService(), voteGeneralMonitoringDTO);
}
@@ -3835,7 +3837,7 @@
* Return ResourceService bean.
*/
private MessageService getMessageService() {
- return (MessageService) VoteServiceProxy.getMessageService(getServlet().getServletContext());
+ return VoteServiceProxy.getMessageService(getServlet().getServletContext());
}
}
\ No newline at end of file
Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java
===================================================================
diff -u -r00759d7592ccc90e8769763524afb69546f641d4 -rc95a3c1916cce09b1a5467306f3eaf4a57b22727
--- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision 00759d7592ccc90e8769763524afb69546f641d4)
+++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteMonitoringStarterAction.java (.../VoteMonitoringStarterAction.java) (revision c95a3c1916cce09b1a5467306f3eaf4a57b22727)
@@ -54,6 +54,7 @@
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.util.MessageService;
import org.lamsfoundation.lams.web.util.AttributeNames;
import org.lamsfoundation.lams.web.util.SessionMap;
@@ -108,6 +109,8 @@
IVoteService voteService = VoteServiceProxy.getVoteService(getServlet().getServletContext());
logger.debug("voteService: " + voteService);
+ MessageService messageService = VoteServiceProxy.getMessageService(getServlet().getServletContext());
+
VoteMonitoringForm voteMonitoringForm = (VoteMonitoringForm) form;
logger.debug("voteMonitoringForm: " + voteMonitoringForm);
@@ -205,7 +208,7 @@
//voteMonitoringAction.prepareReflectionData(request, voteContent, voteService, null, false);
logger.debug("calling submitSession with selectedToolSessionId" + voteMonitoringForm.getSelectedToolSessionId());
- return voteMonitoringAction.submitSession(mapping, voteMonitoringForm, request, response, voteService, voteGeneralMonitoringDTO);
+ return voteMonitoringAction.submitSession(mapping, voteMonitoringForm, request, response, voteService, messageService, voteGeneralMonitoringDTO);
}
Index: lams_tool_vote/web/export/ExportContent.jsp
===================================================================
diff -u -r2e9dc3798ab786dc455c429b78330b253ce8fe49 -rc95a3c1916cce09b1a5467306f3eaf4a57b22727
--- lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision 2e9dc3798ab786dc455c429b78330b253ce8fe49)
+++ lams_tool_vote/web/export/ExportContent.jsp (.../ExportContent.jsp) (revision c95a3c1916cce09b1a5467306f3eaf4a57b22727)
@@ -66,37 +66,40 @@
-
-
-
-
-
- |
-
-
-
- |
- |
-
-
-
-
-
-
-
-
- |
-
-
- |
-
-
-
-
- |
-
+
+
+
+
+
+
+ |
+
+
+
+ |
+ |
+
+
+
+
+
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
+
+
@@ -135,42 +138,43 @@
-
-
-
-
-
- |
-
-
-
- |
- |
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
- |
-
- |
- |
-
-
-
-
-
- |
-
+
+
+
+
+
+ |
+
+
+
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+ |
+ |
+
+
+
+
+
+ |
+
+