Examples of TypeSearchResult


Examples of org.encuestame.utils.enums.TypeSearchResult

            final String mycomment,
            final Long tweetPollId,
            final String type,
            final Long relatedCommentId , boolean published) throws EnMeNoResultsFoundException, EnmeNotAllowedException {
        final CommentBean bean = new CommentBean();
         final TypeSearchResult typeResult = TypeSearchResult.getTypeSearchResult(filterValue(type));
         bean.setComment(filterValue(mycomment));
         bean.setCreatedAt(Calendar.getInstance().getTime());
         bean.setParentId(relatedCommentId);
         bean.setId(tweetPollId);
         bean.setType(typeResult);
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

      @RequestParam(value = "period", required = true) String period,
      @PathVariable final String typeSearch,
      @PathVariable final String status, HttpServletRequest request,
      HttpServletResponse response) {
    try {
      final TypeSearchResult type = TypeSearchResult
          .getTypeSearchResult(filterValue(typeSearch));

      final CommentOptions statusComm = CommentOptions
          .getCommentOption(filterValue(status));
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

            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);
            List<ItemGeoLocationBean> itemsByLocation = new ArrayList<ItemGeoLocationBean>();
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            if (searchType.equals(TypeSearchResult.ALL)) {
                itemsByLocation = getLocationService().retrieveItemsByGeo(
                        range, maxItem, typeValue, longitude, latitude,
                        periodValue);
                log.debug("Items by geo location " + itemsByLocation.size());
                jsonResponse.put("itemsByGeo", itemsByLocation);
            } else if (searchType.equals(TypeSearchResult.HASHTAG)) {
                if (tagName == null) {
                    throw new EnMeSearchException("search params required.");
                } else {

                    itemsByLocation = getLocationService()
                            .retreiveHashTagUsebyGeoLo(range, maxItem,
                                    typeValue, longitude, latitude, tagName,
                                    periodValue);
                    log.debug("Hashtag use by geo location "
                            + itemsByLocation.size());
                    jsonResponse.put("hashtagUsebyGeo", itemsByLocation);
                }

            } else if (searchType.equals(TypeSearchResult.SOCIALNETWORK)) {
                itemsByLocation = getLocationService()
                        .retrieveSocialNetworksPublicationsbyGeoLocation(range,
                                maxItem, typeValue, longitude, latitude,
                                periodValue);
                log.debug("Social publications  by geo location "
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

            HttpServletRequest request, HttpServletResponse response)
            throws JsonGenerationException, JsonMappingException, IOException {
        try {
            //FUTURE: Add SEARCHPERIODS Filter.
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            final TypeSearchResult searchResult = TypeSearchResult.getTypeSearchResult(type);
            // by tweetpoll
            if (TypeSearchResult.TWEETPOLL.equals(searchResult) && !id.isEmpty()) {
                final TweetPoll tweetPoll = getTweetPollService().getTweetPollById(Long.valueOf(id), null);
                jsonResponse.put("links", getTweetPollService()
                        .getTweetPollLinks(tweetPoll, null, null, TypeSearchResult.getTypeSearchResult(type)));
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

        String text = "";
        try {
            @SuppressWarnings("rawtypes")
            final Map model = new HashMap();
            final String domain = WidgetUtil.getRelativeDomain(request);
            final TypeSearchResult typeItem = TypeSearchResult.getTypeSearchResult(type);
            final EmbeddedType embeddedType = EmbeddedType.getEmbeddedType(embedded);
            final JavascriptEmbebedBody embebedBody = new JavascriptEmbebedBody();
            final ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
            response.setContentType("text/javascript; charset=UTF-8");
            model.put("domain", domain);
            model.put("embedded_type", embeddedType.toString().toLowerCase());
            model.put("typeItem", typeItem.toString().toLowerCase());
            model.put("itemId", itemId);
            model.put("class_type", TypeSearchResult.getCSSClass(typeItem));
            model.put("domain_config", WidgetUtil.getDomain(request, true));
            if (TypeSearchResult.TWEETPOLL.equals(typeItem)) {
                final TweetPoll tp = getTweetPollService().getTweetPollById(itemId);
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

        String text = "";
        final int max_results = 1;
        try {
            @SuppressWarnings("rawtypes")
            final Map model = new HashMap();
            final TypeSearchResult typeItem = TypeSearchResult.getTypeSearchResult(type);
            final JavascriptEmbebedBody embebedBody = new JavascriptEmbebedBody();
            final ObjectWriter ow = new ObjectMapper().writer().withDefaultPrettyPrinter();
            final String domain = WidgetUtil.getDomain(request, true);
            final String logo = EnMePlaceHolderConfigurer.getProperty("application.logo.icon");
            model.put("logo_enme", domain + "/resources/" + logo);
            model.put("domain", domain);
            model.put("typeItem", typeItem.toString().toLowerCase());
            model.put("itemId", pollId);
            model.put("domain_config", domain);
            response.setContentType("text/javascript; charset=UTF-8");
            if (TypeSearchResult.TWEETPOLL.equals(typeItem)) {
                // generate tweetpoll body
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

      @PathVariable String actionType,
      @RequestParam(value = "keyword", required = true) String keyword,
      HttpServletRequest request, HttpServletResponse response) {

    final Map<String, Object> jsonResponse = new HashMap<String, Object>();
     final TypeSearchResult typ = TypeSearchResult.getTypeSearchResult(actionType);
      if (keyword != null) {
    try {

        if (typ.equals(TypeSearchResult.TWEETPOLL)) {
          jsonResponse.put("folders", getTweetPollService()
              .retrieveFoldersbyKeyword( keyword));
          setItemResponse(jsonResponse);
        } else if (typ.equals(TypeSearchResult.POLL)) {
          jsonResponse.put("folders", getPollService()
              .retrieveFoldersbyKeyword(keyword));

        } else if (typ.equals(TypeSearchResult.SURVEY)) {
          // TODO: Missing service to retrieve surveys folder
        }

    } catch (Exception e) {
      log.error(e);
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

              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);
          jsonResponse.put("tweetPolls", list);
          log.debug("/api/survey/tweetpoll/search.json---------------->  "
            + list.size());
       // Convert Tweetpoll or Survey to SearchBean
      } else if (typeResult.equals(TypeSearchResult.POLL)) {
        final List<PollBean> pollBeanList = getPollService().filterPollByItemsByType(null, keyword, max, start);

      } else {
        throw new EnmeFailOperation("operation not valid");
      }
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

            @RequestParam(value = "period", required = false) String period,
            @RequestParam(value = "filter", required = true) String filter,
            HttpServletRequest request, HttpServletResponse response) {
        try {
            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,
                                    searchPeriods, request);
                } else if (filterType.equals(TypeSearchResult.SOCIALNETWORK)) {
                    tagStats = getStatisticsService().getTotalSocialLinksbyHashTagUsageAndDateRangeListGraph(tagName, searchPeriods, request);
                } else if (filterType.equals(TypeSearchResult.HITS)) {
                    tagStats = getStatisticsService().getTotalHitsUsagebyHashTagAndDateRangeListGraph(tagName, searchPeriods, request);
                } else if (filterType.equals(TypeSearchResult.VOTES)) {
                    tagStats = getStatisticsService().getTotalVotesbyHashTagUsageAndDateRangeListGraph(tagName, searchPeriods, request);
                }
                jsonResponse.put("statsByRange", tagStats);
                setItemResponse(jsonResponse);
            }
View Full Code Here

Examples of org.encuestame.utils.enums.TypeSearchResult

            HttpServletRequest request,
            HttpServletResponse response) throws JsonGenerationException,
            JsonMappingException, IOException {
        try {
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
            final TypeSearchResult filter = TypeSearchResult
                    .getTypeSearchResult(type);
            final Map<String, String> stats = new HashMap<String, String>();
            if (filter.equals(TypeSearchResult.HASHTAG)) {
                stats.put("Created By", "admin");
                stats.put("Created", "4 years ago");
                stats.put("Hits", "1,500");
                stats.put("Likes / Dislike Rate", "34");
                stats.put("Average", "1.4");
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.