Package org.encuestame.utils.web.search

Examples of org.encuestame.utils.web.search.TweetPollSearchBean


              @RequestParam(value = "period", required = false) String period,
              @PathVariable final String type,
              HttpServletRequest request, HttpServletResponse response)
              throws JsonGenerationException, JsonMappingException, IOException {
          final Map<String, Object> jsonResponse = new HashMap<String, Object>();
          final TweetPollSearchBean tpollSearchBean = new TweetPollSearchBean();
          try {
              log.debug("search.json" + typeSearch);
              log.debug("search.json" + keyword);
              log.debug("search.json" + max);
              log.debug("search.json" + start);
              log.debug("search.json socialNetworks" + socialNetworks);
              log.debug("search.json socialAccountNetworks " + socialAccountNetworks);
              log.debug("search.json isCompleted " + isPublished);
              log.debug("search.json" + isCompleted);
              log.debug("search.json favourite" + isFavourite);
              // Create TweetpollSearchBean
              tpollSearchBean.setIsComplete(isCompleted == null ? false : isCompleted);
              tpollSearchBean.setIsFavourite(isFavourite == null ? false : isFavourite);
              tpollSearchBean.setIsPublished(isPublished == null ? false : isPublished);
              tpollSearchBean.setIsScheduled(isScheduled == null ? false : isScheduled);
              tpollSearchBean.setKeyword(keyword == null ? null : keyword.isEmpty() ? null : keyword);
              tpollSearchBean.setMax(max);
              //tpollSearchBean.setPeriod(period); it's not used, will be removed in the future.
              tpollSearchBean.setSearchResult(null);
              tpollSearchBean.setStart(start);
              tpollSearchBean.setTypeSearch(TypeSearch.getSearchString(typeSearch));
              tpollSearchBean.setProviders(socialNetworks == null ? ListUtils.EMPTY_LIST : ConvertDomainBean.convertSocialProviderStringToProvider(socialNetworks));
              tpollSearchBean.setSocialAccounts(socialAccountNetworks == null ? ListUtils.EMPTY_LIST : socialAccountNetworks);
                      //socialNetworks.size() == 0 ? null : ConvertDomainBean.convertSocialProviderStringToProvider(socialNetworks));
            final TypeSearchResult typeResult = TypeSearchResult.getTypeSearchResult(type);
      if (typeResult.equals(TypeSearchResult.TWEETPOLL)) {
        final List<SearchBean> list = (List<SearchBean>) getTweetPollService().filterTweetPollByItemsByTypeSearch(
                        tpollSearchBean, request);
View Full Code Here


            @RequestParam(value = "_scheduled", required = false) Boolean isScheduled,
            @RequestParam(value = "period", required = false) String period,
            HttpServletRequest request, HttpServletResponse response)
            throws JsonGenerationException, JsonMappingException, IOException {
        final Map<String, Object> jsonResponse = new HashMap<String, Object>();
        final TweetPollSearchBean tpollSearchBean = new TweetPollSearchBean();
        try {
            log.debug("search.json" + typeSearch);
            log.debug("search.json" + keyword);
            log.debug("search.json" + max);
            log.debug("search.json" + start);
            log.debug("search.json socialNetworks" + socialNetworks);
            log.debug("search.json socialAccountNetworks " + socialAccountNetworks);
            log.debug("search.json isCompleted " + isPublished);
            log.debug("search.json" + isCompleted);
            log.debug("search.json favourite" + isFavourite);
            // Create TweetpollSearchBean
            tpollSearchBean.setIsComplete(isCompleted == null ? false : isCompleted);
            tpollSearchBean.setIsFavourite(isFavourite == null ? false : isFavourite);
            tpollSearchBean.setIsPublished(isPublished == null ? false : isPublished);
            tpollSearchBean.setIsScheduled(isScheduled == null ? false : isScheduled);
            tpollSearchBean.setKeyword(keyword == null ? null : keyword.isEmpty() ? null : keyword);
            tpollSearchBean.setMax(max);
            //tpollSearchBean.setPeriod(period); it's not used, will be removed in the future.
            tpollSearchBean.setSearchResult(null);
            tpollSearchBean.setStart(start);
            tpollSearchBean.setTypeSearch(TypeSearch.getSearchString(typeSearch));
            tpollSearchBean.setProviders(socialNetworks == null ? ListUtils.EMPTY_LIST : ConvertDomainBean.convertSocialProviderStringToProvider(socialNetworks));
            tpollSearchBean.setSocialAccounts(socialAccountNetworks == null ? ListUtils.EMPTY_LIST : socialAccountNetworks);
            final List<SearchBean> list = (List<SearchBean>) getTweetPollService().filterTweetPollByItemsByTypeSearch(
                    tpollSearchBean, request);

            log.debug("/api/survey/tweetpoll/search.json---------------->  "+ list.size());
            jsonResponse.put("tweetPolls", list);
View Full Code Here

    /**
     * Test {@link TweetPollSearchBean}
     */
    @Test
    public void testTweetPollSearchBean(){
      final TweetPollSearchBean tpollSearchBean = new TweetPollSearchBean();

      tpollSearchBean.setIsComplete(Boolean.TRUE);
      tpollSearchBean.setIsFavourite(Boolean.FALSE);
      tpollSearchBean.setIsPublished(Boolean.TRUE);
      tpollSearchBean.setIsScheduled(Boolean.FALSE);
      tpollSearchBean.setKeyword("deport");
      tpollSearchBean.setMax(10);
      //tpollSearchBean.setProviders(providers);
      tpollSearchBean.setSearchResult(TypeSearchResult.ALL);
      //tpollSearchBean.setSocialAccounts(socialAccounts)
      tpollSearchBean.setStart(0);
      tpollSearchBean.setTypeSearch(TypeSearch.LASTWEEK);


    }
View Full Code Here

     * @param username
     * @return
     * @throws EnMeNoResultsFoundException
     */
    public List<TweetPollBean> getTweetPolls(final String username, final HttpServletRequest httpServletRequest) throws EnMeNoResultsFoundException{
        return getTweetPollService().getTweetsPollsByUserName(username, httpServletRequest, new TweetPollSearchBean());
    }
View Full Code Here

    createTweetPollPublicated(true, true, new Date(), this.userAccount,
        question1);
    createTweetPollPublicated(true, true, new Date(), this.userAccount,
        question2);
    final UserAccount secUser = createUserAccount("diana", this.user);
    final TweetPollSearchBean tpSearchBean = createTweetpollSearchBean(
        Boolean.FALSE, Boolean.FALSE, Boolean.FALSE, Boolean.FALSE,
        "xxx", "7", 10, 0, TypeSearch.BYOWNER);
    List<SocialProvider> enums = new ArrayList<SocialProvider>();
    enums.add(SocialProvider.FACEBOOK);
    enums.add(SocialProvider.TWITTER);
    tpSearchBean.setProviders(ListUtils.EMPTY_LIST);
    tpSearchBean.setSocialAccounts(ListUtils.EMPTY_LIST);
    final List<TweetPollBean> tweetPollsByUser = getTweetPollService()
        .getTweetsPollsByUserName(getUsernameLogged(), null,
            tpSearchBean);

    // assertEquals("Should be equals", 2 , tweetPollsByUser.size());
View Full Code Here

    getTweetPoll().saveOrUpdate(tp2);

    final TweetPoll tp3 = createPublishedTweetPoll(
        getSpringSecurityLoggedUserAccount().getAccount(), q3);
    final TweetPollSearchBean tpSearch = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, "your",
        "24", 10, 0, TypeSearch.LASTWEEK);
    final List<SearchBean> tpoll = getTweetPollService()
        .filterTweetPollByItemsByTypeSearch(tpSearch, this.request);
View Full Code Here

    getTweetPoll().saveOrUpdate(tp2);

    final TweetPoll tp3 = createPublishedTweetPoll(
        getSpringSecurityLoggedUserAccount().getAccount(), q3);
    final TweetPollSearchBean tpSearch = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, "your",
        "24", 10, 0, TypeSearch.BYOWNER);
    final List<SearchBean> tpollSearch = getTweetPollService()
        .filterTweetPollByItemsByTypeSearch(tpSearch, this.request);
View Full Code Here

    this.createTweetPollItems(this.creationDate.toDate(),
        getSpringSecurityLoggedUserAccount().getAccount(),
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE);

    // Published - completed - Favourite - Scheduled
    final TweetPollSearchBean tpSearch = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, Boolean.FALSE,
        "What", "24", 10, 0, TypeSearch.BYOWNER);
    final List<SearchBean> tpollsByOwner = getTweetPollService()
        .filterTweetPollByItemsByTypeSearch(tpSearch, this.request);
    assertEquals("Should be equals", 3, tpollsByOwner.size());
View Full Code Here

    final TweetPoll tp2 = createDefaultTweetPollPublicated(true, true,
        true, this.userAccount,
        createQuestion("Why the sky is red", "html"), dt.toDate());

    final TweetPollSearchBean tpbean222 = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, " ",
        "7", 10, 0, TypeSearch.ALL);

    final TweetPollSearchBean tpbean22 = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, " ",
        "7", 10, 0, TypeSearch.SCHEDULED);

    final List<TweetPollBean> tpall = getTweetPollService()
        .getTweetsPollsByUserName(this.userAccount.getUsername(),
View Full Code Here

    tp.setScheduleTweetPoll(Boolean.TRUE);
    tp.setFavourites(Boolean.TRUE);
    getTweetPoll().saveOrUpdate(tp);

    final TweetPollSearchBean tpbean22 = createTweetpollSearchBean(
        Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, Boolean.TRUE, " ",
        "7", 10, 0, TypeSearch.FAVOURITES);
    final List<SearchBean> tpLastWeek = getTweetPollService()
        .searchTweetsPollFavourites(this.userAccount.getUsername(),
            this.request, tpbean22);
View Full Code Here

TOP

Related Classes of org.encuestame.utils.web.search.TweetPollSearchBean

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.