Examples of TweetPoll


Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

   * @throws IOException
   */
  @Test
  public void testRetrieveSocialNetworksPublicationsbyGeoLocation()
      throws ServletException, IOException {
    final TweetPoll tp2 = this.createPublishedTweetPoll(
        this.userAcc.getAccount(),
        createQuestion("What is your favorite television show?",
            this.userAcc.getAccount()), new Date());

    tp2.setLocationLatitude(40.4167F);
    tp2.setLocationLongitude(-3.70325F);
    tp2.getHashTags().add(this.tag);
    getTweetPoll().saveOrUpdate(tp2);

    assertNotNull(tp2);

    final SocialAccount socialAccount = createDefaultSettedSocialAccount(this.userAcc);
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @throws IOException
     */
  @Test
  public void testRemoveTweetPollJsonService() throws ServletException,
      IOException {
    final TweetPoll tpollBefore = this.tp1;
    initService("/api/survey/tweetpoll/" + this.tp1.getTweetPollId(), MethodJson.DELETE);
    final JSONObject response = callJsonService();
    assertSuccessResponse(response);
    final TweetPoll tpollAfter = getTweetPoll().getTweetPollById(
        tpollBefore.getTweetPollId());
    Assert.assertNull(tpollAfter);
  }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @param username
     * @return
     * @throws EnMeNoResultsFoundException
     */
    public TweetPoll getTweetPollById(final Long tweetPollId, final String username) throws EnMeNoResultsFoundException {
        TweetPoll tweetPoll = null;
        if (username != null) {
            tweetPoll = getTweetPollDao()
                    .getTweetPollByIdandUserId(tweetPollId,
                            getUserAccount(username).getAccount().getUid());
        } else {
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

        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 {
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

        /* Question **/
        final Question question = createQuestion("What is your favorite type of movies?", "");

        /* TweetPoll **/
        final TweetPoll myTweetPoll = createPublishedTweetPoll(question, userAcc);

        /* Poll **/
        final Poll myPoll = createPoll(creationDate, question, userAcc, Boolean.TRUE, Boolean.TRUE);

        /* Survey **/
        final Survey mySurvey = createDefaultSurvey(userAcc.getAccount(), "My First Encuestame Survey", creationDate);

        // 2- Add HashTag to TweetPoll, Poll or Survey
        myTweetPoll.getHashTags().add(hashtag1);
        getTweetPoll().saveOrUpdate(myTweetPoll);

        myPoll.getHashTags().add(hashtag1);
        getPollDao().saveOrUpdate(myPoll);

View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

     * @throws ServletException
     */
    @Test
    public void testRetrieveGenericStats() throws ServletException, IOException{
        final Question question = createQuestion("Black or White?", "");
        final TweetPoll tweetpoll = createPublishedTweetPoll(5L, question, getSpringSecurityLoggedUserAccount());
        // TWEETPOLL
        initService("/api/common/stats/generic.json", MethodJson.GET);
        setParameter("id", tweetpoll.getTweetPollId().toString());
        setParameter("filter", "TWEETPOLL");
        final JSONObject response = callJsonService();
        final JSONObject success = getSucess(response);
        final JSONObject genericStatsData = (JSONObject) success.get("generic");
        Assert.assertEquals(genericStatsData.get("hits").toString(), tweetpoll.getHits().toString());

        // HASHTAG
        final HashTag hashtag = createHashTag("software");
        hashtag.setHits(20L);
        getHashTagDao().saveOrUpdate(hashtag);
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

        @Before
        public void initMVc() {
            final UserAccount userAccount = createUserAccount("jota", createAccount());
            createFakesTweetPoll(userAccount);
            final TweetPoll tp1 = (TweetPoll) getHibernateTemplate().find("from TweetPoll").get(0);
            final Question q1 = tp1.getQuestion();
            final QuestionAnswer a1 = createQuestionAnswer("yes", q1, "12345");
            final QuestionAnswer a2 = createQuestionAnswer("no", q1, "12346");
            this.tpswitch = createTweetPollSwitch(a1, tp1);
            final TweetPollSwitch tps2 = createTweetPollSwitch(a2, tp1);
        }
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

            final Long itemId,
            final Integer max,
            final Integer start) throws EnMeExpcetion{
        final List<Comment> comments = new ArrayList<Comment>();
        if (searchResult.equals(TypeSearchResult.TWEETPOLL)) {
            final TweetPoll tweetPoll = getTweetPollService().getTweetPollPublishedById(
                    itemId);
             comments.addAll(this.getCommentsbyTweetPoll(tweetPoll, max, start));
        } else if (searchResult.equals(TypeSearchResult.POLL)) {
            final Poll poll = getPollService().getPollById(itemId);
            comments.addAll(getCommentsOperations().getCommentsbPoll(poll, max, start));
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

        comment.setParentId(commentBean.getParentId());
        comment.setDislikeVote(0L);
        comment.setLikeVote(0L);
        comment.setUser(getUserAccount(getUserPrincipalUsername()));
        if (TypeSearchResult.TWEETPOLL.equals(commentBean.getType())) {
            final TweetPoll tweetPoll = getTweetPollById(commentBean.getId());
            comment.setTweetPoll(tweetPoll);
            comment.setCommentOptions(tweetPoll.getShowComments() == null ? CommentOptions.PUBLISHED : tweetPoll.getShowComments());
        } else if (TypeSearchResult.POLL.equals(commentBean.getType())) {
            final Poll poll = getPollById(commentBean.getId());
            comment.setPoll(poll);
            comment.setCommentOptions(poll.getShowComments()  == null ? CommentOptions.PUBLISHED : poll.getShowComments());
        } else if (TypeSearchResult.SURVEY.equals(commentBean.getType())) {
View Full Code Here

Examples of org.encuestame.persistence.domain.tweetpoll.TweetPoll

      final TypeSearchResult itemType,
      final CommentOptions commentOptions, final SearchPeriods period) throws EnMeNoResultsFoundException {
    Long totalComments = 0L;

    if(itemType.equals(TypeSearchResult.TWEETPOLL)){
      final TweetPoll tpoll = this.getTweetPollById(id);
      totalComments = getCommentsOperations().getTotalCommentsbyItem(tpoll.getTweetPollId(), itemType, commentOptions, period);
    }
    else if(itemType.equals(TypeSearchResult.POLL)){
      final Poll poll = this.getPollById(id);
      totalComments = getCommentsOperations().getTotalCommentsbyItem(poll.getPollId(), itemType, commentOptions, period);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.