Class RaterRatingEntity

    • Constructor Detail

      • RaterRatingEntity

        protected RaterRatingEntity()
    • Method Detail

      • fromRateable

        public static RaterRatingEntity fromRateable​(Rateable rateableContribution)
        Creates a new rater rating entity from the specified parameter. The rater of the returned entity is the user that requests the current treatment.
        Parameters:
        rateableContribution - a contribution that implements the Rateable behaviour.
        Returns:
        the entity representing the rater rating from the specified parameter.
        See Also:
        UserDetail.getCurrentRequester()
      • fromRaterRating

        protected static RaterRatingEntity fromRaterRating​(RaterRating raterRating)
        Creates a new rater rating entity from the specified parameter.
        Parameters:
        raterRating - the rater rating to entitify.
        Returns:
        the entity representing the specified rater rating.
      • getURI

        public URI getURI()
        Description copied from interface: WebEntity
        Gets the URI at which this web entity is published and can be accessed.
        Specified by:
        getURI in interface WebEntity
        Returns:
        the web entity URI.
      • getComponentId

        public String getComponentId()
        Gets the identifier of the Silverpeas component instance to which the rated content belongs.
        Returns:
        the silverpeas component instance identifier.
      • getContributionType

        public String getContributionType()
        Gets the type of the resource that is rated by this.
        Returns:
        the rated resource type.
      • getContributionId

        public String getContributionId()
        Gets the identifier of the resource that is rated by this.
        Returns:
        the rated resource identifier.
      • getNumberOfRaterRatings

        public int getNumberOfRaterRatings()
        Gets the number of rater ratings on the contribution.
        Returns:
        a positive integer between 0 and 5 (included).
      • getRatingAverage

        public float getRatingAverage()
        Gets the average rating on the contribution.
        Returns:
        a float value between 0 and 5 (included)
      • getRaterRatingValue

        public int getRaterRatingValue()
        Gets the rating of the current user.
        Returns:
        a positive integer between 0 and 5 (included)
      • isRatingDone

        public boolean isRatingDone()
        Indicates if the current user made a rating on the contribution.
        Returns:
        true if the user made a rating, false otherwise.
      • toJSonScript

        public String toJSonScript​(String jsVariableName)
      • getAsJSonString

        public String getAsJSonString()
      • setUri

        protected void setUri​(URI uri)
      • setComponentId

        protected void setComponentId​(String componentId)
      • setContributionType

        protected void setContributionType​(String contributionType)
      • setContributionId

        protected void setContributionId​(String contributionId)
      • setNumberOfRaterRatings

        protected void setNumberOfRaterRatings​(int numberOfRaterRatings)
      • setRatingAverage

        protected void setRatingAverage​(float ratingAverage)
      • setRaterRatingValue

        protected void setRaterRatingValue​(int raterRatingValue)
      • setRatingDone

        protected void setRatingDone​(boolean isRatingDone)