log.debug("detailTweetPollController "+id);
log.debug("detailTweetPollController "+slug);
try {
final String ipAddress = getIpClient(request);
slug = filterValue(slug);
final TweetPoll tweetPoll = getTweetPollService().getTweetPollByIdSlugName(id, slug);
// if the tweetpoll is not published we send a 404 page
if (tweetPoll.getPublishTweetPoll()) {
this.checkTweetPollStatus(tweetPoll);
boolean tweetPollVisite = getFrontService().checkPreviousHit(ipAddress, tweetPoll.getTweetPollId(), TypeSearchResult.TWEETPOLL);
// TODO: Check that previous hash Tag hit has been visited the same day.
if (!tweetPollVisite) {
getFrontService().registerHit(tweetPoll, null, null, null, ipAddress, HitCategory.VISIT);
}
model.addAttribute("tweetpoll", ConvertDomainBean.convertTweetPollToBean(tweetPoll));
final List<HashTag> hashtagsBean = new ArrayList<HashTag>(tweetPoll.getHashTags());
model.addAttribute("hashtags", ConvertDomainBean.convertListHashTagsToBean(hashtagsBean));
model.addAttribute("isModerated", tweetPoll.getShowComments() == null ? false : (tweetPoll.getShowComments().equals(CommentOptions.MODERATE) ? true : false));
//answers.
final List<TweetPollSwitch> answers = getTweetPollService().getTweetPollSwitch(tweetPoll);
model.addAttribute("answers", answers);
return "tweetpoll/detail";
} else {