Package org.encuestame.utils.enums

Examples of org.encuestame.utils.enums.SearchPeriods


          .getTypeSearchResult(filterValue(typeSearch));

      final CommentOptions statusComm = CommentOptions
          .getCommentOption(filterValue(status));

      final SearchPeriods searchPeriod = SearchPeriods
          .getPeriodString(filterValue(period));

      final Map<String, Object> jsonResponse = new HashMap<String, Object>();
      final List<CommentBean> commentsByStatus = getCommentService()
          .retrieveCommentsByTypeAndStatus(id, type, maxResults,
View Full Code Here


        try {
            log.debug("Range " + range);
            log.debug("Maximum " + maxItem);

            SearchPeriods periodValue = (period.isEmpty() ? SearchPeriods.ALLTIME
                    : SearchPeriods.getPeriodString(period));
            TypeSearchResult typeValue = (type.isEmpty() ? TypeSearchResult.ALL
                    : TypeSearchResult.getTypeSearchResult(type));
            TypeSearchResult searchType = TypeSearchResult
                    .getTypeSearchResult(typeOfSearch);
View Full Code Here

            List<HashTagListGraphData> tagStats = new ArrayList<HashTagListGraphData>();
            final TypeSearchResult filterType = TypeSearchResult
                    .getTypeSearchResult(filter);
            //final SearchPeriods periodSearch = SearchPeriods.getPeriodString(period);
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            final SearchPeriods searchPeriods = SearchPeriods.getPeriodString(period);
            if (searchPeriods == null) {
                setError("Period not valid", response);
            } else {
                if (filterType.equals(TypeSearchResult.HASHTAG)) {
                    tagStats = getStatisticsService().getTotalUsagebyHashtagAndDateRangeListGraph(tagName,
View Full Code Here

            throws JsonGenerationException, JsonMappingException, IOException {
        try {
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            final HashTagStatsBean tagStatsBean = new HashTagStatsBean();
            final TypeSearchResult filterType = TypeSearchResult.getTypeSearchResult(filter);
            final SearchPeriods searchPeriod = SearchPeriods.getPeriodString(period);
            if (filterType == null) {
                throw new EnMeNoResultsFoundException("type not found");
            } else {
                if (filterType.equals(TypeSearchResult.HASHTAGRATED)) {
                    // hits /period
View Full Code Here

            List<HashTagDetailStats> tagStats = new ArrayList<HashTagDetailStats>();
            final TypeSearchResult filterType = TypeSearchResult
                    .getTypeSearchResult(filter);
            //final SearchPeriods periodSearch = SearchPeriods.getPeriodString(period);
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            final SearchPeriods searchPeriods = SearchPeriods.getPeriodString(period);
            if (searchPeriods == null) {
                setError("Period not valid", response);
            } else {
                if (filterType.equals(TypeSearchResult.HASHTAG)) {
                    tagStats = getStatisticsService().getTotalUsagebyHashtagAndDateRangeGraph(tagName,
View Full Code Here

    /**
     * Test search periods enum.
     */
    @Test
    public void testSearchPeriods(){
        final SearchPeriods twentyFourHoursOpt = SearchPeriods.getPeriodString("24");
        assertEquals("Should be equals", "24", twentyFourHoursOpt.toString());

        final SearchPeriods sevenDaysOpt = SearchPeriods.getPeriodString("7");
        assertEquals("Should be equals", "7", sevenDaysOpt.toString());

        final SearchPeriods thirtyDaysOpt = SearchPeriods.getPeriodString("30");
        assertEquals("Should be equals", "30", thirtyDaysOpt.toString());

        final SearchPeriods allTimeOpt = SearchPeriods.getPeriodString("all");
        assertEquals("Should be equals", "all", allTimeOpt.toString());
    }
View Full Code Here

            final String period,
            final Integer label,
            final HttpServletRequest request) {
        String dataRangeLabel = null;
        HashTagRate tagRateLabel;
        final SearchPeriods periodSelected = SearchPeriods
                .getPeriodString(period);

        if (periodSelected.equals(SearchPeriods.ONEYEAR)) {
            tagRateLabel = HashTagRate.getHashTagMonthLabel(Integer
                    .toString(label));
            dataRangeLabel = this.convertHashTagDataRangeLabelMessage(
                    tagRateLabel, request, new Object[] {});
        } else if (periodSelected.equals(SearchPeriods.ALLTIME)) {
            dataRangeLabel = String.valueOf(label);
        } else if (periodSelected.equals(SearchPeriods.THIRTYDAYS)) {
            dataRangeLabel = String.valueOf(label);
        } else if (periodSelected.equals(SearchPeriods.TWENTYFOURHOURS)) {
            dataRangeLabel = String.valueOf(label);
        } else if (periodSelected.equals(SearchPeriods.SEVENDAYS)) {
            tagRateLabel = HashTagRate.getHashTagWeekDayLabel(
                    Integer
                    .toString(label));
            dataRangeLabel = this.convertHashTagDataRangeLabelMessage(tagRateLabel,
                    request, new Object[] {});
View Full Code Here

        log.debug("Period Results: " + period);
        final List<TweetPoll> items = new ArrayList<TweetPoll>();
        if (period == null) {
            throw new EnMeSearchException("search params required.");
        } else {
            final SearchPeriods periodSelected = SearchPeriods
                    .getPeriodString(period);
            if (periodSelected.equals(SearchPeriods.TWENTYFOURHOURS)) {
                items.addAll(getFrontEndDao().getTweetPollFrontEndLast24(start,
                        maxResults));
            } else if (periodSelected.equals(SearchPeriods.SEVENDAYS)) {
                items.addAll(getFrontEndDao().getTweetPollFrontEndLast7Days(
                        start, maxResults));
            } else if (periodSelected.equals(SearchPeriods.THIRTYDAYS)) {
                items.addAll(getFrontEndDao().getTweetPollFrontEndLast30Days(
                        start, maxResults));
            } else if (periodSelected.equals(SearchPeriods.ALLTIME)) {
                items.addAll(getFrontEndDao().getTweetPollFrontEndAllTime(
                        start, maxResults));
            }
            results.addAll(ConvertDomainBean.convertListToTweetPollBean(items));
            for (TweetPollBean tweetPoll : results) {
View Full Code Here

        log.debug("Max Results " + maxResults);
        final List<Survey> items = new ArrayList<Survey>();
        if (period == null) {
            throw new EnMeSearchException("search params required.");
        } else {
            final SearchPeriods periodSelected = SearchPeriods
                    .getPeriodString(period);
            if (periodSelected.equals(SearchPeriods.TWENTYFOURHOURS)) {
                items.addAll(getFrontEndDao().getSurveyFrontEndLast24(start,
                        maxResults));
            } else if (periodSelected.equals(SearchPeriods.SEVENDAYS)) {
                items.addAll(getFrontEndDao().getSurveyFrontEndLast7Days(start,
                        maxResults));
            } else if (periodSelected.equals(SearchPeriods.THIRTYDAYS)) {
                items.addAll(getFrontEndDao().getSurveyFrontEndLast30Days(
                        start, maxResults));
            } else if (periodSelected.equals(SearchPeriods.ALLTIME)) {
                items.addAll(getFrontEndDao().getSurveyFrontEndAllTime(start,
                        maxResults));
            }
            log.debug("TweetPoll " + items.size());
            results.addAll(ConvertDomainBean.convertListSurveyToBean(items));
View Full Code Here

        maxResults = maxResults == null ? this.MAX_RESULTS : maxResults;
        final List<Poll> items = new ArrayList<Poll>();
        if (period == null) {
            throw new EnMeSearchException("search params required");
        } else {
            final SearchPeriods periodSelected = SearchPeriods
                    .getPeriodString(period);
            if (periodSelected.equals(SearchPeriods.TWENTYFOURHOURS)) {
                items.addAll(getFrontEndDao().getPollFrontEndLast24(start,
                        maxResults));
            } else if (periodSelected.equals(SearchPeriods.SEVENDAYS)) {
                items.addAll(getFrontEndDao().getPollFrontEndLast7Days(start,
                        maxResults));
            } else if (periodSelected.equals(SearchPeriods.THIRTYDAYS)) {
                items.addAll(getFrontEndDao().getPollFrontEndLast30Days(start,
                        maxResults));
            } else if (periodSelected.equals(SearchPeriods.ALLTIME)) {
                items.addAll(getFrontEndDao().getPollFrontEndAllTime(start,
                        maxResults));
            }
            log.debug("Poll:--> " + items.size());
            results.addAll(ConvertDomainBean.convertListToPollBean((items)));
View Full Code Here

TOP

Related Classes of org.encuestame.utils.enums.SearchPeriods

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.