Package org.apache.rave.portal.model

Examples of org.apache.rave.portal.model.WidgetRatingsMapReduceResult$WidgetStatisticsMapReduceResult


    }

    @Override
    public WidgetStatistics getWidgetStatistics(String widget_id, String user_id) {
        WidgetUsersMapReduceResult userResult = mongoOperations.findById(widget_id, WidgetUsersMapReduceResult.class, WIDGET_USERS);
        WidgetRatingsMapReduceResult ratingResult = mongoOperations.findById(widget_id, WidgetRatingsMapReduceResult.class, WIDGET_RATINGS);

        int userCount = userResult == null ? 0 : userResult.getValue().size();
        WidgetStatistics stats;
        if(ratingResult == null) {
            stats = new WidgetStatistics();
View Full Code Here


        Map<String, Long> userRatings = getRatingsMap();
        Map<String, Long> users = getUsersMap();

        List<WidgetRatingsMapReduceResult> ratings = Arrays.asList(
                new WidgetRatingsMapReduceResult("24L", new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userRatings, 2L, 0L)),
                new WidgetRatingsMapReduceResult("25L", new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userRatings, 2L, 0L)),
                new WidgetRatingsMapReduceResult("26L", new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userRatings, 2L, 0L))
        );

        List<WidgetUsersMapReduceResult> usersMapReduceResults = Arrays.asList(
                new WidgetUsersMapReduceResult("24L", users),
                new WidgetUsersMapReduceResult("25L", users),
View Full Code Here

        Map<String, Long> userRatings = getRatingsMap();
        Map<String, Long> users = getUsersMap();

        List<WidgetRatingsMapReduceResult> ratings = Arrays.asList(
                new WidgetRatingsMapReduceResult("24L", new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userRatings, 2L, 0L)),
                new WidgetRatingsMapReduceResult("25L", new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userRatings, 2L, 0L)),
                new WidgetRatingsMapReduceResult("26L", new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userRatings, 2L, 0L))
        );

        List<WidgetUsersMapReduceResult> usersMapReduceResults = Arrays.asList(
                new WidgetUsersMapReduceResult("24L", users),
                new WidgetUsersMapReduceResult("25L", users),
View Full Code Here

        Map<String, Long> userRatings = getRatingsMap();
        Map<String, Long> users = getUsersMap();

        List<WidgetRatingsMapReduceResult> ratings = Arrays.asList(
                new WidgetRatingsMapReduceResult("24L", null),
                new WidgetRatingsMapReduceResult("25L", null),
                new WidgetRatingsMapReduceResult("26L", null)
        );

        List<WidgetUsersMapReduceResult> usersMapReduceResults = Arrays.asList(
                new WidgetUsersMapReduceResult("24L", users),
                new WidgetUsersMapReduceResult("25L", users),
View Full Code Here

        Map<String, Long> userMap = Maps.newHashMap();
        userMap.put("20L", 10L);
        userMap.put("21L", 10L);
        WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult stats = new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userMap, 20L, 0L);
        WidgetUsersMapReduceResult usersResult = new WidgetUsersMapReduceResult(widget_id, userMap);
        WidgetRatingsMapReduceResult ratingsResult = new WidgetRatingsMapReduceResult(widget_id, stats);

        expect(mongoOperations.findById(widget_id, WidgetRatingsMapReduceResult.class, WIDGET_RATINGS)).andReturn(ratingsResult);
        expect(mongoOperations.findById(widget_id, WidgetUsersMapReduceResult.class, WIDGET_USERS)).andReturn(usersResult);
        replay(mongoOperations);
View Full Code Here

        Map<String, Long> userMap = Maps.newHashMap();
        userMap.put("20L", 10L);
        userMap.put("21L", 10L);
        WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult stats = new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userMap, 20L, 0L);
        WidgetUsersMapReduceResult usersResult = new WidgetUsersMapReduceResult(widget_id, userMap);
        WidgetRatingsMapReduceResult ratingsResult = new WidgetRatingsMapReduceResult(widget_id, stats);

        expect(mongoOperations.findById(widget_id, WidgetRatingsMapReduceResult.class, WIDGET_RATINGS)).andReturn(ratingsResult);
        expect(mongoOperations.findById(widget_id, WidgetUsersMapReduceResult.class, WIDGET_USERS)).andReturn(usersResult);
        replay(mongoOperations);
View Full Code Here

        String widget_id = "1L";
        Map<String, Long> userMap = Maps.newHashMap();
        userMap.put("20L", 10L);
        userMap.put("21L", 10L);
        WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult stats = new WidgetRatingsMapReduceResult.WidgetStatisticsMapReduceResult(userMap, 20L, 0L);
        WidgetRatingsMapReduceResult ratingsResult = new WidgetRatingsMapReduceResult(widget_id, stats);

        expect(mongoOperations.findById(widget_id, WidgetRatingsMapReduceResult.class, WIDGET_RATINGS)).andReturn(ratingsResult);
        expect(mongoOperations.findById(widget_id, WidgetUsersMapReduceResult.class, WIDGET_USERS)).andReturn(null);
        replay(mongoOperations);
View Full Code Here

TOP

Related Classes of org.apache.rave.portal.model.WidgetRatingsMapReduceResult$WidgetStatisticsMapReduceResult

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.