User user = UserLocalManagerUtil.getUserById(userId);
String questionId = Long.toString(CounterManagerUtil.increment(
PollsQuestion.class.getName()));
PollsQuestion question = PollsQuestionUtil.create(questionId);
Date now = new Date();
Date expirationDate = null;
if (!neverExpires) {
expirationDate = PortalUtil.getDate(
expMonth, expDay, expYear,
new QuestionExpirationDateException());
}
question.setPortletId(portletId);
question.setCompanyId(user.getCompanyId());
question.setUserId(user.getUserId());
question.setUserName(user.getFullName());
question.setCreateDate(now);
question.setModifiedDate(now);
question.setTitle(title);
question.setDescription(description);
question.setExpirationDate(expirationDate);
question.setGroupId("");
PollsQuestionUtil.update(question);
// Add choices