Package org.encuestame.utils.web

Examples of org.encuestame.utils.web.PollDetailBean


                        velocityEngine, HTML_TEMPLATES + "/tweetpoll_votes.vm", "utf-8", model);
                embebedBody.setAditionalInfo(tpollDetail.getResults());
            } else if (TypeSearchResult.POLL.equals(typeItem)) {
                // generate poll body
                final Poll poll = getPollService().getPollById(pollId);
                final PollDetailBean detailBean = getPollService().getPollDetailInfo(poll.getPollId());
                model.put("owner_picture", domain + "/picture/profile/" + poll.getEditorOwner().getUsername() + "/thumbnail");
                model.put("editorOwner", poll.getEditorOwner());
                model.put("title", poll.getQuestion().getQuestion());
                model.put("date_published", EnMeUtils.formatDate(poll.getCreateDate(), "HH:mm - d MMMM yyyy"));
                model.put("poll", poll);
                model.put("action", WidgetUtil.getDomain(request) + "/poll/vote/post");
                model.put("detailBean", detailBean);
                model.put("vote_title", "Vote");
                text = VelocityEngineUtils.mergeTemplateIntoString(
                        velocityEngine, HTML_TEMPLATES + "/poll_form.vm", "utf-8", model);
            else if (TypeSearchResult.POLLRESULT.equals(typeItem)) {
                // generate poll body
                final Poll poll = getPollService().getPollById(pollId);
                final PollDetailBean detailBean = getPollService().getPollDetailInfo(poll.getPollId());
                model.put("owner_picture", domain + "/picture/profile/" + poll.getEditorOwner().getUsername() + "/thumbnail");
                model.put("editorOwner", poll.getEditorOwner());
                model.put("question", poll.getQuestion());
                model.put("url", EnMeUtils.createUrlPollAccess(domain, poll));
                model.put("answersList", detailBean.getResults());
                model.put("date_published", EnMeUtils.formatDate(poll.getCreateDate(), "HH:mm - d MMMM yyyy"));
                text = VelocityEngineUtils.mergeTemplateIntoString(
                        velocityEngine, HTML_TEMPLATES + "/tweetpoll_votes.vm", "utf-8", model);
                embebedBody.setAditionalInfo(detailBean.getResults());
            } else if (TypeSearchResult.HASHTAG.equals(typeItem)) {
                // generate hashtag body
                model.put("hellow", "world");
                text = VelocityEngineUtils.mergeTemplateIntoString(
                        velocityEngine, HTML_TEMPLATES + "/hashtag.vm", "utf-8", model);
View Full Code Here


    /*
     * (non-Javadoc)
     * @see org.encuestame.core.service.imp.IPollService#getPollDetailInfo(java.lang.Long)
     */
    public PollDetailBean getPollDetailInfo(final Long pollId) throws EnMeNoResultsFoundException{
        final PollDetailBean detail = new PollDetailBean();
        final Poll poll = getPoll(pollId);
        detail.setPollBean(ConvertDomainBean.convertPollDomainToBean(poll));
        detail.setResults(this.getResultVotes(poll));
        //FIXME: Next line is repeated, please review
        this.calculatePercents(detail.getResults());
        //set the list of answers
        detail.setListAnswers(ConvertDomainBean
                .convertAnswersToQuestionAnswerBean(getQuestionDao()
                        .getAnswersByQuestionId(poll.getQuestion().getQid())));
        //set the comments.
        detail.getPollBean().setTotalComments(this.getTotalCommentsbyType(detail.getPollBean().getId(), TypeSearchResult.POLL));
        return detail;
    }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.web.PollDetailBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.