Пример #1
0
 /*
  * (non-Javadoc)
  * @see org.encuestame.core.service.imp.IStatisticsService#getTotalSocialLinksbyHashTagUsageAndDateRangeListGraph(java.lang.String, org.encuestame.utils.enums.SearchPeriods, javax.servlet.http.HttpServletRequest)
  */
 @Override
 public List<HashTagListGraphData> getTotalSocialLinksbyHashTagUsageAndDateRangeListGraph(
     String tagName, SearchPeriods period, HttpServletRequest request)
     throws EnMeSearchException, EnMeNoResultsFoundException {
   List<HashTagListGraphData> tagDetailStatsBySocial = new ArrayList<HashTagListGraphData>();
   List<ItemStatDetail> tpSocialSavePublishedDetail = new ArrayList<ItemStatDetail>();
   List<TweetPollSavedPublishedStatus> tpSavedPublished =
       new ArrayList<TweetPollSavedPublishedStatus>();
   if (period == null) {
     throw new EnMeSearchException("search params required.");
   } else {
     final List<TweetPoll> tpolls =
         getTweetPollsByHashTag(tagName, null, null, TypeSearchResult.HASHTAG, period);
     for (TweetPoll tweetPoll : tpolls) {
       final ItemStatDetail statDetail = new ItemStatDetail();
       tpSavedPublished =
           getTweetPollDao()
               .getSocialLinksByTypeAndDateRange(
                   tweetPoll, null, null, TypeSearchResult.TWEETPOLL);
       statDetail.setDate(tweetPoll.getCreateDate());
       statDetail.setItemId(Long.valueOf(tpSavedPublished.size()));
       // FIXME: itemId should be the id of something, now store a "total" value.
       // tpSocialSavePublishedDetail.addAll(ConvertDomainBean.convertTweetPollSavedPublishedStatusListToItemDetailBean(tpSavedPublished));
       tpSocialSavePublishedDetail.add(statDetail);
     }
     this.removeDuplicatleItemOutOfRange(tpSocialSavePublishedDetail, period.toDays());
     tagDetailStatsBySocial.addAll(
         this.groupListItemStatDetail(tpSocialSavePublishedDetail, period, request));
     return tagDetailStatsBySocial;
   }
 }