Package org.encuestame.utils.web.stats

Examples of org.encuestame.utils.web.stats.GenericStatsBean


            throws JsonGenerationException, JsonMappingException, IOException {
        try {
            final Map<String, Object> jsonResponse = new HashMap<String, Object>();
             final TypeSearchResult filterType = TypeSearchResult
                        .getTypeSearchResult(filter);
            final GenericStatsBean genericStatsBean =  getFrontService().retrieveGenericStats(
                    itemId, filterType, request);
            jsonResponse.put("generic", genericStatsBean);
            setItemResponse(jsonResponse);
        } catch (Exception e) {
            // TODO: handle exception
View Full Code Here


        // Poll
        final Poll poll = createPoll(new Date(), question, "JCPM", getSpringSecurityLoggedUserAccount(), Boolean.TRUE, Boolean.TRUE);
        // Survey
        //final Survey survey = createDefaultSurvey(getSpringSecurityLoggedUserAccount().getAccount(), "Technology survey", new Date());

    final GenericStatsBean genericTweetPollStats = getFrontEndService()
        .retrieveGenericStats(tpoll.getTweetPollId().toString(),
            TypeSearchResult.TWEETPOLL, this.request);
        Assert.assertNotNull(genericTweetPollStats);

    final GenericStatsBean genericPollStats = getFrontEndService()
        .retrieveGenericStats(poll.getPollId().toString(),
            TypeSearchResult.POLL, this.request);
        Assert.assertNotNull(genericPollStats);

       
        final HashTag hashtag = createHashTag("continents", 350L);
      System.out.println(hashtag.getHashTag());       
    Assert.assertNotNull(hashtag);
    Assert.assertNotNull(hashtag.getHashTagId());
    Assert.assertNotNull(hashtag.getHashTag());
    @SuppressWarnings("unused")
    final GenericStatsBean genericHashTagStats = getFrontEndService().retrieveGenericStats(
        hashtag.getHashTag(), TypeSearchResult.HASHTAG, this.request);
     
        //final GenericStatsBean genericSurveyStats = getFrontEndService().retrieveGenericStats(survey.getSid(), TypeSearchResult.SURVEY);
        //Assert.assertNotNull(genericSurveyStats);
View Full Code Here

     * (java.lang.String, org.encuestame.utils.enums.TypeSearchResult)
     */
    public GenericStatsBean retrieveGenericStats(final String itemId,
            final TypeSearchResult itemType, HttpServletRequest request)
            throws EnMeNoResultsFoundException {
        GenericStatsBean genericBean = new GenericStatsBean();
        long totalHits = 0L;
        String createdBy = " ";
        String createdAt = null;
        double average = 0;
        long likeDislikeRate = 0L;
View Full Code Here

     * @return
     */
    public static GenericStatsBean createGenericStatsBean(
            final Long likeDislikeRate, final Long totalHits,
            final String createdBy, Double average, final String createdAt) {
        final GenericStatsBean genericBean = new GenericStatsBean();
        genericBean.setLikeDislikeRate(likeDislikeRate);
        genericBean.setHits(totalHits);
        genericBean.setCreatedBy(createdBy);
        genericBean.setAverage(average);
        genericBean.setCreatedAt(createdAt);
        return genericBean;
    }
View Full Code Here

TOP

Related Classes of org.encuestame.utils.web.stats.GenericStatsBean

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.