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 import javax.portlet.PortletConfig;
024
025
028 public class ViewQuestionAction extends EditQuestionAction {
029
030 @Override
031 protected void updateQuestion(
032 PortletConfig portletConfig, ActionRequest actionRequest)
033 throws Exception {
034
035 long questionId = ParamUtil.getLong(actionRequest, "questionId");
036 long choiceId = ParamUtil.getLong(actionRequest, "choiceId");
037
038 PollsVoteServiceUtil.addVote(
039 questionId, choiceId, new ServiceContext());
040
041 PollsUtil.saveVote(actionRequest, questionId);
042 }
043
044 }