001
014
015 package com.liferay.portlet.polls.action;
016
017 import com.liferay.portal.kernel.util.ParamUtil;
018 import com.liferay.portal.service.ServiceContext;
019 import com.liferay.portlet.polls.service.PollsVoteServiceUtil;
020 import com.liferay.portlet.polls.util.PollsUtil;
021
022 import javax.portlet.ActionRequest;
023
024
027 public class ViewQuestionAction extends EditQuestionAction {
028
029 protected void updateQuestion(ActionRequest actionRequest)
030 throws Exception {
031
032 long questionId = ParamUtil.getLong(actionRequest, "questionId");
033 long choiceId = ParamUtil.getLong(actionRequest, "choiceId");
034
035 PollsVoteServiceUtil.addVote(
036 questionId, choiceId, new ServiceContext());
037
038 PollsUtil.saveVote(actionRequest, questionId);
039 }
040
041 }