Class DefaultRatingService

    • Constructor Detail

      • DefaultRatingService

        public DefaultRatingService()
    • Method Detail

      • delete

        public void delete​(String componentInstanceId)
        Description copied from interface: ComponentInstanceDeletion
        Deletes the resources belonging to the specified component instance. This method is invoked by Silverpeas when a component instance is being deleted.
        Specified by:
        delete in interface ComponentInstanceDeletion
        Parameters:
        componentInstanceId - the unique identifier of a component instance.
      • updateRating

        public void updateRating​(RaterRatingPK pk,
                                 int note)
        Description copied from interface: RatingService
        Save user notation. Create it or update it if it already exists.
        Specified by:
        updateRating in interface RatingService
        Parameters:
        pk - identifying the rated resource and the rater
        note - the rate given to this resource by the user
      • moveRating

        public void moveRating​(ContributionRatingPK pk,
                               String componentInstanceId)
        Description copied from interface: RatingService
        Remove all notations of identified resource to the specified component instance identifier.
        Specified by:
        moveRating in interface RatingService
        Parameters:
        pk - identifying the resource
        componentInstanceId - the target component identified by its instance id.
      • deleteRaterRating

        public void deleteRaterRating​(RaterRatingPK pk)
        Description copied from interface: RatingService
        Remove rater rating of identified resource
        Specified by:
        deleteRaterRating in interface RatingService
        Parameters:
        pk - identifying the resource and the rater
      • deleteComponentRatings

        public void deleteComponentRatings​(String componentInstanceId)
        Description copied from interface: RatingService
        Remove all resources notations of given app
        Specified by:
        deleteComponentRatings in interface RatingService
        Parameters:
        componentInstanceId - identitier of the component instance.
      • getRating

        public ContributionRating getRating​(ContributionRatingPK pk)
        Description copied from interface: RatingService
        Getting notation about once given resource identified by its PK. If the resource has no notation, a NotationDetail is returned anyway.
        Specified by:
        getRating in interface RatingService
        Parameters:
        pk - identity of resource
        Returns:
        Notation of identified resource
      • hasUserRating

        public boolean hasUserRating​(RaterRatingPK pk)
        Description copied from interface: RatingService
        Checking if user has given a rating on this resource
        Specified by:
        hasUserRating in interface RatingService
        Parameters:
        pk - identity of resource and rater
        Returns:
        true if user has already given a rate