/** * Gets the maximum allowed rating for the specified rating scheme. * * @param ratingSchemeName String * @return float */ public float getMax(String ratingSchemeName) { return ratingService.getRatingScheme(ratingSchemeName).getMaxRating(); }
/** * This method checks whether self-rating is allowed for the specified rating scheme. * If self-rating is allowed in the specified scheme, then the cm:creator of a node can apply a rating, * otherwise they cannot. * * @param ratingSchemeName the rating scheme bean name. * @return <code>true</code> if users can rate their own content, else <code>false</code>. */ public boolean isSelfRatingAllowed(String ratingSchemeName) { return ratingService.getRatingScheme(ratingSchemeName).isSelfRatingAllowed(); }
/** * Gets the maximum allowed rating for the specified rating scheme. * * @param ratingSchemeName String * @return float */ public float getMax(String ratingSchemeName) { return ratingService.getRatingScheme(ratingSchemeName).getMaxRating(); }
/** * Gets the minimum allowed rating for the specified rating scheme. * * @param ratingSchemeName String * @return float */ public float getMin(String ratingSchemeName) { return ratingService.getRatingScheme(ratingSchemeName).getMinRating(); }
/** * This method checks whether self-rating is allowed for the specified rating scheme. * If self-rating is allowed in the specified scheme, then the cm:creator of a node can apply a rating, * otherwise they cannot. * * @param ratingSchemeName the rating scheme bean name. * @return <code>true</code> if users can rate their own content, else <code>false</code>. */ public boolean isSelfRatingAllowed(String ratingSchemeName) { return ratingService.getRatingScheme(ratingSchemeName).isSelfRatingAllowed(); }
/** * Gets the minimum allowed rating for the specified rating scheme. * * @param ratingSchemeName String * @return float */ public float getMin(String ratingSchemeName) { return ratingService.getRatingScheme(ratingSchemeName).getMinRating(); }
fiveStarRatingScheme = ratingService.getRatingScheme("fiveStarRatingScheme"); assertNotNull(fiveStarRatingScheme); likesRatingScheme = ratingService.getRatingScheme("likesRatingScheme"); assertNotNull(likesRatingScheme);
final QName totalProp = QName.createQName("http://www.alfresco.org/model/testratings/1.0", "spinalTapRatingSchemeTotal"); RatingScheme spinalTap = RATING_SERVICE.getRatingScheme(spinalTapScheme); assertEquals(11.0f, spinalTap.getMaxRating(), 0.0001f);