Index: lams_tool_vote/conf/language/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/conf/language/Attic/ApplicationResources.properties,v diff -u -r1.9 -r1.10 --- lams_tool_vote/conf/language/ApplicationResources.properties 24 Apr 2006 12:57:15 -0000 1.9 +++ lams_tool_vote/conf/language/ApplicationResources.properties 24 Apr 2006 13:10:16 -0000 1.10 @@ -117,6 +117,7 @@ label.cancel =Cancel feedback =Please address the following issues before submit.
+error.maxNominationCount.invalid =Please correct this: The "Max Nominations" field in Advanced section is invalid. error.default.content.notSetup =The tool initialization error: The tool default content has not been set up properly. error.questions.submitted.none =Please correct this: No questions have been submitted. Please also note that the questions with no candidate answers are being automatically removed. error.question.empty =Please correct this: The question text can not be empty. Index: lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java =================================================================== RCS file: /usr/local/cvsroot/lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java,v diff -u -r1.9 -r1.10 --- lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 24 Apr 2006 12:57:15 -0000 1.9 +++ lams_tool_vote/src/java/org/lamsfoundation/lams/tool/vote/web/VoteAction.java 24 Apr 2006 13:10:16 -0000 1.10 @@ -261,15 +261,16 @@ logger.debug("verifyDuplicatesOptionsMap: " + verifyDuplicatesOptionsMap); request.getSession().removeAttribute(USER_EXCEPTION_OPTIONS_DUPLICATE); if (verifyDuplicatesOptionsMap == false) - { + { errors= new ActionMessages(); errors.add(Globals.ERROR_KEY,new ActionMessage("error.options.duplicate")); request.getSession().setAttribute(USER_EXCEPTION_OPTIONS_DUPLICATE, new Boolean(true).toString()); logger.debug("add error.options.duplicate to ActionMessages"); saveErrors(request,errors); voteAuthoringForm.resetUserAction(); return (mapping.findForward(LOAD_QUESTIONS)); - } + } + logger.debug("submitting mapOptionsContent:" + mapOptionsContent); @@ -280,6 +281,33 @@ VoteContent voteContent=authoringUtil.saveOrUpdateVoteContent(mapOptionsContent, voteService, voteAuthoringForm, request); logger.debug("voteContent: " + voteContent); + String maxNomCount=voteAuthoringForm.getMaxNominationCount(); + logger.debug("maxNomCount:" + maxNomCount); + + if (maxNomCount.equals("0")) + { + errors= new ActionMessages(); + errors.add(Globals.ERROR_KEY,new ActionMessage("error.maxNominationCount.invalid")); + logger.debug("add error.maxNominationCount.invalid to ActionMessages"); + saveErrors(request,errors); + voteAuthoringForm.resetUserAction(); + return (mapping.findForward(LOAD_QUESTIONS)); + } + + try + { + int intMaxNomCount=new Integer(maxNomCount).intValue(); + logger.debug("intMaxNomCount : " +intMaxNomCount); + } + catch(NumberFormatException e) + { + errors= new ActionMessages(); + errors.add(Globals.ERROR_KEY,new ActionMessage("error.maxNominationCount.invalid")); + saveErrors(request,errors); + voteAuthoringForm.resetUserAction(); + return (mapping.findForward(LOAD_QUESTIONS)); + } + logger.debug("start persisting offline files metadata"); AuthoringUtil.persistFilesMetaData(request, true, voteContent);