return statsAggregator.getAllWidgetStatistics(userId);
}
@Override
public Map<String, WidgetRating> getUsersWidgetRatings(String userId) {
Query q = query(where("ratings").elemMatch(where("userId").is(userId)));
List<Widget> widgets = template.find(q);
Map<String, WidgetRating> ratings = Maps.newHashMap();
for (Widget widget : widgets) {
for (WidgetRating rating : widget.getRatings()) {
if (rating.getUserId().equals(userId)) {