r3237 - in branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main: java/org/chorem/pollen/ui/actions/poll webapp/WEB-INF/jsp/poll
Author: tchemit Date: 2012-04-06 09:51:35 +0200 (Fri, 06 Apr 2012) New Revision: 3237 Url: http://chorem.org/repositories/revision/pollen/3237 Log: refactor LoadPoll and SavePoll Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-04-05 23:47:56 UTC (rev 3236) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/AbstractPollForm.java 2012-04-06 07:51:35 UTC (rev 3237) @@ -23,17 +23,27 @@ */ package org.chorem.pollen.ui.actions.poll; +import com.google.common.base.Function; +import com.google.common.base.Preconditions; +import com.google.common.collect.Lists; import com.google.common.collect.Maps; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.chorem.pollen.business.persistence.Choice; +import org.chorem.pollen.business.persistence.PersonToList; import org.chorem.pollen.business.persistence.Poll; import org.chorem.pollen.business.persistence.PollAccount; +import org.chorem.pollen.business.persistence.VotingList; import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.I18nAble; import org.chorem.pollen.common.PollType; import org.chorem.pollen.common.VoteCountingType; +import org.chorem.pollen.services.PollenServiceFunctions; import org.chorem.pollen.services.impl.PollService; import org.chorem.pollen.ui.actions.PollenActionSupport; +import java.util.Collection; +import java.util.List; import java.util.Map; /** @@ -54,6 +64,21 @@ private Map<String, String> choiceTypes; + /** Text choices. */ + private List<Choice> textChoices; + + /** Image choices. */ + private List<Choice> imageChoices; + + /** Date choices. */ + private List<Choice> dateChoices; + + /** restricted Voting lists. */ + private List<VotingList> restrictedVotingList; + + /** Group voting lists. */ + private List<VotingList> groupVotingList; + private boolean notification; private boolean reminder; @@ -62,27 +87,23 @@ private int reminderHourCountdown = 2; -// private String textChoiceTokenId; -// -// private String dateChoiceTokenId; -// -// private String imageChoiceTokenId; -// -// private String votingListTokenId; + private transient PollService pollService; -// private int nbTextChoices; -// -// private int nbDateChoices; -// -// private int nbImageChoices; -// -// private int nbVotingLists; + /** To create a new personToList. */ + private transient Function<PersonToList, PersonToList> persontoListCreator; -// private String actionLabel; + /** To create a new votingList. */ + private transient Function<VotingList, VotingList> votingListCreator; - private transient PollService pollService; + /** To create a new text choice. */ + private transient Function<Choice, Choice> textChoiceCreator; + /** To create a new date choice. */ + private transient Function<Choice, Choice> dateChoiceCreator; + /** To create a new image choice. */ + private transient Function<Choice, Choice> imageChoiceCreator; + @Override public String getPageLogo() { return "Creation"; @@ -99,38 +120,6 @@ return poll; } -// public int getNbTextChoices() { -// return nbTextChoices; -// } -// -// public String getTextChoiceTokenId() { -// return textChoiceTokenId; -// } -// -// public int getNbDateChoices() { -// return nbDateChoices; -// } -// -// public String getDateChoiceTokenId() { -// return dateChoiceTokenId; -// } -// -// public int getNbImageChoices() { -// return nbImageChoices; -// } -// -// public String getImageChoiceTokenId() { -// return imageChoiceTokenId; -// } -// -// public int getNbVotingLists() { -// return nbVotingLists; -// } -// -// public String getVotingListTokenId() { -// return votingListTokenId; -// } - public boolean isInformationsError() { return false; } @@ -151,6 +140,26 @@ return choiceTypes; } + public List<Choice> getTextChoices() { + return textChoices; + } + + public List<Choice> getImageChoices() { + return imageChoices; + } + + public List<Choice> getDateChoices() { + return dateChoices; + } + + public List<VotingList> getRestrictedVotingList() { + return restrictedVotingList; + } + + public List<VotingList> getGroupVotingList() { + return groupVotingList; + } + public boolean isNotification() { return notification; } @@ -229,6 +238,10 @@ return 1; } + public boolean isClone() { + return false; + } + protected boolean isEdit() { return StringUtils.isNotEmpty(getPoll().getTopiaId()); } @@ -238,70 +251,55 @@ // remove all stuff from session getPollenSession().clearDynamicData(); -// actionLabel = isEdit() ? _("pollen.action.editPoll") : -// _("pollen.action.createPoll"); - pollTypes = decorateToName(PollType.values()); choiceTypes = decorateToName(ChoiceType.values()); voteCountingTypes = decorateToName(VoteCountingType.values()); -// nbTextChoices = nbDateChoices = nbImageChoices = getNbChoices(); -// nbVotingLists = getDefaultNbVotingLists(); -// -// String tokenSuffix = getServiceContext().createPollenUrlId(); -// -// textChoiceTokenId = DisplayTextChoice.CHOICE_TOKEN + "_" + -// tokenSuffix; -// -// dateChoiceTokenId = DisplayDateChoice.CHOICE_TOKEN + "_" + -// tokenSuffix; -// -// imageChoiceTokenId = DisplayImageChoice.CHOICE_TOKEN + "_" + -// tokenSuffix; -// -// ChoiceType pollChoiceType; -// // Retrieve choiceType from parameters, the poll object will be updated after prepare -// String choiceTypeParam = getNonEmptyParameterValue("poll.choiceType"); -// if (choiceTypeParam == null) { -// -// // Default value will be initiliazed on poll instanciation -// pollChoiceType = getPoll().getChoiceType(); -// -// } else { -// pollChoiceType = ChoiceType.valueOf(choiceTypeParam); -// } -// -// if (log.isInfoEnabled()) { -// log.info("choice type " + pollChoiceType); -// } -// -// Map<Integer, Choice> choices = null; -// String tokenId = null; -// -// switch (pollChoiceType) { -// case TEXT: -// choices = buildTextChoices(nbTextChoices); -// tokenId = textChoiceTokenId; -// break; -// case DATE: -// choices = buildDateChoices(nbDateChoices); -// tokenId = dateChoiceTokenId; -// break; -// case IMAGE: -// choices = buildImageChoices(nbImageChoices); -// tokenId = imageChoiceTokenId; -// break; -// } -//// getPollenSession().putDynamicData(tokenId, choices); -// -// // load votingLists -// -// votingListTokenId = DisplayVotingList.VOTING_LIST_TOKEN + "_" + -// tokenSuffix; -// Map<Integer, VotingList> votingLists = buildVotingLists(nbVotingLists); -// getPollenSession().putDynamicData(votingListTokenId, votingLists); + textChoices = Lists.newArrayList(); + imageChoices = Lists.newArrayList(); + dateChoices = Lists.newArrayList(); + + restrictedVotingList = Lists.newArrayList(); + groupVotingList = Lists.newArrayList(); } + public Function<PersonToList, PersonToList> getPersontoListCreator() { + if (persontoListCreator == null) { + persontoListCreator = PollenServiceFunctions.newPersonToListCreator(isClone(), serviceContext); + } + return persontoListCreator; + } + + public Function<VotingList, VotingList> getVotingListCreator() { + if (votingListCreator == null) { + votingListCreator = PollenServiceFunctions.newVotingListCreator(isClone(), + serviceContext, + getPersontoListCreator()); + } + return votingListCreator; + } + + public Function<Choice, Choice> getTextChoiceCreator() { + if (textChoiceCreator == null) { + textChoiceCreator = PollenServiceFunctions.newTextChoiceCreator(isClone()); + } + return textChoiceCreator; + } + + public Function<Choice, Choice> getDateChoiceCreator() { + if (dateChoiceCreator == null) { + dateChoiceCreator = PollenServiceFunctions.newDateChoiceCreator(isClone()); + } + return dateChoiceCreator; + } + + public Function<Choice, Choice> getImageChoiceCreator() { + if (imageChoiceCreator == null) { + imageChoiceCreator = PollenServiceFunctions.newImageChoiceCreator(isClone()); + } + return imageChoiceCreator; + } + private <E extends Enum<E> & I18nAble> Map<String, String> decorateToName(E... values) { Map<String, String> result = Maps.newLinkedHashMap(); for (E value : values) { @@ -309,4 +307,94 @@ } return result; } + + protected void loadChoicesAndvotingLists(Poll poll, + Collection<Choice> pollChoices, + Collection<VotingList> pollVotinLists, + boolean fillLists) { + + Preconditions.checkNotNull(poll); + Preconditions.checkNotNull(poll.getChoiceType()); + Preconditions.checkNotNull(poll.getPollType()); + + + if (CollectionUtils.isNotEmpty(pollChoices)) { + + //push back choices + + switch (poll.getChoiceType()) { + + case TEXT: + getTextChoices().addAll(pollChoices); + break; + case DATE: + getDateChoices().addAll(pollChoices); + break; + case IMAGE: + getImageChoices().addAll(pollChoices); + break; + } + } + + if (CollectionUtils.isNotEmpty(pollVotinLists)) { + + // push back voting lists + + switch (poll.getPollType()) { + + case FREE: + // not voting lists + break; + case RESTRICTED: + getRestrictedVotingList().addAll(pollVotinLists); + break; + case GROUP: + getGroupVotingList().addAll(pollVotinLists); + break; + } + } + + if (fillLists) { + + // refill lists + + int defaultMaxChoices = 5; + int defaultMaxVoting = 5; + + fillLists(defaultMaxChoices, defaultMaxVoting); + } + } + + protected void fillLists(int defaultMaxChoices, int defaultMaxVoting) { + + PollenServiceFunctions.fillChoiceList(textChoices, + defaultMaxChoices, + getTextChoiceCreator()); + + PollenServiceFunctions.fillChoiceList(dateChoices, + defaultMaxChoices, + getDateChoiceCreator()); + + PollenServiceFunctions.fillChoiceList(imageChoices, + defaultMaxChoices, + getImageChoiceCreator()); + + if (CollectionUtils.isEmpty(restrictedVotingList)) { + restrictedVotingList.add(getVotingListCreator().apply(null)); + } + for (VotingList votingList : restrictedVotingList) { + PollenServiceFunctions.fillVotingList(votingList, + getPersontoListCreator(), + defaultMaxVoting); + } + if (CollectionUtils.isEmpty(groupVotingList)) { + groupVotingList.add(getVotingListCreator().apply(null)); + } + for (VotingList votingList : groupVotingList) { + PollenServiceFunctions.fillVotingList(votingList, + getPersontoListCreator(), + defaultMaxVoting); + } + + } } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java 2012-04-05 23:47:56 UTC (rev 3236) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/LoadPoll.java 2012-04-06 07:51:35 UTC (rev 3237) @@ -23,17 +23,11 @@ */ package org.chorem.pollen.ui.actions.poll; -import com.google.common.base.Function; -import com.google.common.collect.Lists; -import org.apache.commons.collections.CollectionUtils; import org.chorem.pollen.bean.PollUri; import org.chorem.pollen.business.persistence.Choice; -import org.chorem.pollen.business.persistence.PersonToList; import org.chorem.pollen.business.persistence.PollAccount; import org.chorem.pollen.business.persistence.UserAccount; import org.chorem.pollen.business.persistence.VotingList; -import org.chorem.pollen.common.PollType; -import org.chorem.pollen.services.PollenServiceFunctions; import java.util.List; @@ -50,21 +44,6 @@ private boolean clone; - /** Text choices. */ - private List<Choice> textChoices; - - /** Image choices. */ - private List<Choice> imageChoices; - - /** Date choices. */ - private List<Choice> dateChoices; - - /** restricted Voting lists. */ - private List<VotingList> restrictedVotingList; - - /** Group voting lists. */ - private List<VotingList> groupVotingList; - public PollUri getUriId() { return pollUri; } @@ -73,6 +52,7 @@ this.pollUri = pollUri; } + @Override public boolean isClone() { return clone; } @@ -81,51 +61,11 @@ this.clone = clone; } - public List<Choice> getTextChoices() { - return textChoices; - } - - public List<Choice> getImageChoices() { - return imageChoices; - } - - public List<Choice> getDateChoices() { - return dateChoices; - } - - public List<VotingList> getRestrictedVotingList() { - return restrictedVotingList; - } - - public List<VotingList> getGroupVotingList() { - return groupVotingList; - } - @Override public String execute() throws Exception { prepareFormPage(); - textChoices = Lists.newArrayList(); - imageChoices = Lists.newArrayList(); - dateChoices = Lists.newArrayList(); - restrictedVotingList = Lists.newArrayList(); - groupVotingList = Lists.newArrayList(); - - Function<PersonToList, PersonToList> persontoListCreator = - PollenServiceFunctions.newPersonToListCreator(clone, serviceContext); - Function<VotingList, VotingList> votingListCreator = - PollenServiceFunctions.newVotingListCreator(clone, - serviceContext, - persontoListCreator); - - Function<Choice, Choice> textChoiceCreator = - PollenServiceFunctions.newTextChoiceCreator(clone); - Function<Choice, Choice> dateChoiceCreator = - PollenServiceFunctions.newDateChoiceCreator(clone); - Function<Choice, Choice> imageChoiceCreator = - PollenServiceFunctions.newImageChoiceCreator(clone); - if (pollUri == null) { // create a new poll @@ -148,78 +88,19 @@ creator.setTopiaId(null); creator.setAccountId(serviceContext.createPollenUrlId()); } - - // -- Choice -- // - if (!poll.isChoiceEmpty()) { - - // reload choices - - switch (poll.getChoiceType()) { - - case TEXT: - textChoices.addAll(Lists.transform(poll.getChoice(), textChoiceCreator)); - break; - case DATE: - dateChoices.addAll(Lists.transform(poll.getChoice(), dateChoiceCreator)); - break; - case IMAGE: - imageChoices.addAll(Lists.transform(poll.getChoice(), imageChoiceCreator)); - break; - } - } - - // -- VotingList -- // - if (poll.getPollType() != PollType.FREE) { - - // reload voting lists - if (!poll.isVotingListEmpty()) { - switch (poll.getPollType()) { - - case FREE: - // nothing to load - break; - case RESTRICTED: - restrictedVotingList.addAll(Lists.transform( - poll.getVotingList(), votingListCreator)); - break; - case GROUP: - groupVotingList.addAll(Lists.transform( - poll.getVotingList(), votingListCreator)); - break; - } - - } - } } - if (!isVoteStarted()) { - // can edit choices and voting lists, so fill them + List<Choice> pollChoices = poll.getChoice(); + List<VotingList> pollVotingLists = poll.getVotingList(); - int defaultMaxChoices = 5; - PollenServiceFunctions.fillChoiceList(textChoices, defaultMaxChoices, textChoiceCreator); - PollenServiceFunctions.fillChoiceList(dateChoices, defaultMaxChoices, dateChoiceCreator); - PollenServiceFunctions.fillChoiceList(imageChoices, defaultMaxChoices, imageChoiceCreator); + loadChoicesAndvotingLists(poll, + pollChoices, + pollVotingLists, + !isVoteStarted()); - int defaultMaxVoting = 5; - if (CollectionUtils.isEmpty(restrictedVotingList)) { - restrictedVotingList.add(votingListCreator.apply(null)); - } - for (VotingList votingList : restrictedVotingList) { - PollenServiceFunctions.fillVotingList(votingList, - persontoListCreator, - defaultMaxVoting); - } - if (CollectionUtils.isEmpty(groupVotingList)) { - groupVotingList.add(votingListCreator.apply(null)); - } - for (VotingList votingList : groupVotingList) { - PollenServiceFunctions.fillVotingList(votingList, - persontoListCreator, - defaultMaxVoting); - } - } return SUCCESS; } + } Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-05 23:47:56 UTC (rev 3236) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/java/org/chorem/pollen/ui/actions/poll/SavePoll.java 2012-04-06 07:51:35 UTC (rev 3237) @@ -23,14 +23,12 @@ */ package org.chorem.pollen.ui.actions.poll; -import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.opensymphony.xwork2.Preparable; import com.opensymphony.xwork2.interceptor.annotations.InputConfig; -import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -52,7 +50,6 @@ import org.chorem.pollen.business.persistence.VotingListImpl; import org.chorem.pollen.common.ChoiceType; import org.chorem.pollen.common.PollType; -import org.chorem.pollen.services.PollenServiceFunctions; import org.chorem.pollen.services.impl.PollService; import org.chorem.pollen.services.impl.PreventRuleService; import org.chorem.pollen.services.impl.UserService; @@ -61,6 +58,7 @@ import java.io.File; import java.text.ParseException; +import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.List; @@ -91,9 +89,6 @@ private static final Pattern IMAGE_CHOICE_NAME_PATTERN = Pattern.compile("imageChoice_(\\d+)\\.name"); -// private static final Pattern VOTING_LIST_NAME_PATTERN = -// Pattern.compile("votingList_(\\d+)\\.name"); - private String userId; /** Uploaded images (for choice type poll). */ @@ -105,10 +100,13 @@ /** Uploaded images name (from use desktop) (for choice type poll). */ private List<String> imageChoiceFileName; + /** Flag when there is some errors on the information panel. */ protected boolean informationsError; - protected boolean optionsError; + /** Flag when there is some errors on the options panel. */ + private boolean optionsError; + /** * All the parameters send by request used to build back choices of the * poll. @@ -122,50 +120,15 @@ private Map<Integer, Choice> choices; /** - * Indexed voting lists retreive from parameters the pollType selected in - * form . (Other voting lists are lost). + * Indexed voting lists retreive from parameters for the pollType selected + * in form. (Other voting lists are lost). */ private Map<Integer, VotingList> votingLists; - /** Text choices. */ - private List<Choice> textChoices; - - /** Image choices. */ - private List<Choice> imageChoices; - - /** Date choices. */ - private List<Choice> dateChoices; - - /** restricted Voting lists. */ - private List<VotingList> restrictedVotingList; - - /** Group voting lists. */ - private List<VotingList> groupVotingList; - public void setUserId(String userId) { this.userId = userId; } - public List<Choice> getTextChoices() { - return textChoices; - } - - public List<Choice> getImageChoices() { - return imageChoices; - } - - public List<Choice> getDateChoices() { - return dateChoices; - } - - public List<VotingList> getRestrictedVotingList() { - return restrictedVotingList; - } - - public List<VotingList> getGroupVotingList() { - return groupVotingList; - } - @Override public void prepare() throws Exception { @@ -191,15 +154,12 @@ switch (pollChoiceType) { case TEXT: - choices = buildTextChoices(); break; case DATE: - choices = buildDateChoices(); break; case IMAGE: - choices = buildImageChoices(); break; } @@ -214,7 +174,6 @@ // empty voting list votingLists = Maps.newTreeMap(); - break; case RESTRICTED: @@ -225,7 +184,6 @@ // group voting lists votingLists = buildVotingLists(pollType); - break; } } @@ -233,84 +191,17 @@ @Override public String input() { - //push back choices + Collection<Choice> pollChoices = choices.values(); + Collection<VotingList> pollVotinLists = votingLists.values(); - textChoices = Lists.newArrayList(); - imageChoices = Lists.newArrayList(); - dateChoices = Lists.newArrayList(); - - switch (poll.getChoiceType()) { - - case TEXT: - textChoices.addAll(choices.values()); - break; - case DATE: - dateChoices.addAll(choices.values()); - break; - case IMAGE: - imageChoices.addAll(choices.values()); - break; - } - - // push back voting lists - - restrictedVotingList = Lists.newArrayList(); - groupVotingList = Lists.newArrayList(); - - switch (poll.getPollType()) { - - case FREE: - // not voting lists - break; - case RESTRICTED: - restrictedVotingList.addAll(votingLists.values()); - break; - case GROUP: - groupVotingList.addAll(votingLists.values()); - break; - } - - // refill lists - - Function<PersonToList, PersonToList> persontoListCreator = - PollenServiceFunctions.newPersonToListCreator(false, serviceContext); - Function<VotingList, VotingList> votingListCreator = - PollenServiceFunctions.newVotingListCreator(false, - serviceContext, - persontoListCreator); - - Function<Choice, Choice> textChoiceCreator = - PollenServiceFunctions.newTextChoiceCreator(false); - Function<Choice, Choice> dateChoiceCreator = - PollenServiceFunctions.newDateChoiceCreator(false); - Function<Choice, Choice> imageChoiceCreator = - PollenServiceFunctions.newImageChoiceCreator(false); - - int defaultMaxChoices = 5; - PollenServiceFunctions.fillChoiceList(textChoices, defaultMaxChoices, textChoiceCreator); - PollenServiceFunctions.fillChoiceList(dateChoices, defaultMaxChoices, dateChoiceCreator); - PollenServiceFunctions.fillChoiceList(imageChoices, defaultMaxChoices, imageChoiceCreator); - - int defaultMaxVoting = 5; - if (CollectionUtils.isEmpty(restrictedVotingList)) { - restrictedVotingList.add(votingListCreator.apply(null)); - } - for (VotingList votingList : restrictedVotingList) { - PollenServiceFunctions.fillVotingList(votingList, - persontoListCreator, - defaultMaxVoting); - } - if (CollectionUtils.isEmpty(groupVotingList)) { - groupVotingList.add(votingListCreator.apply(null)); - } - for (VotingList votingList : groupVotingList) { - PollenServiceFunctions.fillVotingList(votingList, - persontoListCreator, - defaultMaxVoting); - } + loadChoicesAndvotingLists(poll, + pollChoices, + pollVotinLists, + true); return INPUT; } + @Override public void validate() { @@ -352,7 +243,6 @@ // nothing to validate } else { -// Map<Integer, VotingList> votingLists = getOrderedVotingLists(); Set<String> groups = Sets.newHashSet(); Set<String> voters = Sets.newHashSet(); @@ -404,7 +294,6 @@ if (!isFreePoll()) { -// Map<Integer, VotingList> votingLists = getOrderedVotingLists(); for (Integer index : votingLists.keySet()) { VotingList votingList = votingLists.get(index); poll.addVotingList(votingList); @@ -508,30 +397,6 @@ return result; } -// protected Map<Integer, Choice> getOrderedChoices() { -// Map<Integer, Choice> result = null; -//// switch (getPoll().getChoiceType()) { -//// case TEXT: -//// result = getPollenSession().getDynamicData(getTextChoiceTokenId()); -//// break; -//// case DATE: -//// result = getPollenSession().getDynamicData(getDateChoiceTokenId()); -//// break; -//// case IMAGE: -//// result = getPollenSession().getDynamicData(getImageChoiceTokenId()); -//// break; -//// } -// return result; -// } - -// protected Map<Integer, VotingList> getOrderedVotingLists() { -// -// Map<Integer, VotingList> result = null; -//// result = getPollenSession().getDynamicData( -//// getVotingListTokenId()); -// return result; -// } - protected boolean validateVotingList(int votingListNumber, VotingList votingList, Set<String> groups, @@ -736,7 +601,6 @@ result = reindexMap(result, maxNumber); int size = result.size(); -// nbTextChoices = Math.max(nbDefault, size); log.info("nbTextChoices (from request) = " + size); logChoice(result); return result; @@ -773,7 +637,6 @@ result = reindexMap(result, maxNumber); int size = result.size(); -// nbDateChoices = Math.max(nbDefault, size); log.info("nbDateChoices (from request) = " + size); logChoice(result); return result; @@ -824,7 +687,6 @@ } result = reindexMap(result, maxNumber); int size = result.size(); -// nbImageChoices = Math.max(nbDefault, size); log.info("nbImageChoices (from request) = " + size); logChoice(result); return result; @@ -868,7 +730,6 @@ result = reindexMap(result, maxNumber); int size = result.size(); -// nbVotingLists = Math.max(nbDefault, size); log.info("nbVotingList [" + pollType + "] (from request) = " + size); // add personToList maps to session (but just now, since votingList Modified: branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp =================================================================== --- branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-05 23:47:56 UTC (rev 3236) +++ branches/pollen-1.2.6-struts2/pollen-ui-struts2/src/main/webapp/WEB-INF/jsp/poll/create.jsp 2012-04-06 07:51:35 UTC (rev 3237) @@ -169,8 +169,6 @@ <br/> - <%--<%@include file="createPoll_votingLists.jsp" %>--%> - <fieldset> <legend><s:text name="pollen.common.pollType"/></legend> <s:radio key='poll.pollType' list="pollTypes"
participants (1)
-
tchemit@users.chorem.org