com.silverpeas.notation.ejb
Class RatingBmEJB

java.lang.Object
  extended by com.silverpeas.notation.ejb.RatingBmEJB
All Implemented Interfaces:
RatingBm

public class RatingBmEJB
extends Object
implements RatingBm


Constructor Summary
RatingBmEJB()
           
 
Method Summary
 void deleteComponentRatings(String componentInstanceId)
          Remove all resources notations of given app
 void deleteRaterRating(RaterRatingPK pk)
          Remove rater rating of identified resource
 void deleteRating(ContributionRatingPK pk)
          Remove all notations of identified resource
 ContributionRating getRating(ContributionRatingPK pk)
          Getting notation about once given resource identified by its PK.
 ContributionRating getRating(SilverpeasContent contribution)
          Getting notation about the given contribution.
 Map<String,ContributionRating> getRatings(SilverpeasContent... contributions)
          Getting notation about the given contributions.
 boolean hasUserRating(RaterRatingPK pk)
          Checking if user has given a rating on this resource
 void moveRating(ContributionRatingPK pk, String componentInstanceId)
          Remove all notations of identified resource to the specified component instance identifier.
 void updateRating(RaterRatingPK pk, int note)
          Save user notation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatingBmEJB

public RatingBmEJB()
Method Detail

updateRating

public void updateRating(RaterRatingPK pk,
                         int note)
Description copied from interface: RatingBm
Save user notation. Create it or update it if it already exists.

Specified by:
updateRating in interface RatingBm
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: RatingBm
Remove all notations of identified resource to the specified component instance identifier.

Specified by:
moveRating in interface RatingBm
Parameters:
pk - identifying the resource
componentInstanceId - the target component identified by its instance id.

deleteRating

public void deleteRating(ContributionRatingPK pk)
Description copied from interface: RatingBm
Remove all notations of identified resource

Specified by:
deleteRating in interface RatingBm
Parameters:
pk - identifying the resource

deleteRaterRating

public void deleteRaterRating(RaterRatingPK pk)
Description copied from interface: RatingBm
Remove rater rating of identified resource

Specified by:
deleteRaterRating in interface RatingBm
Parameters:
pk - identifying the resource and the rater

deleteComponentRatings

public void deleteComponentRatings(String componentInstanceId)
Description copied from interface: RatingBm
Remove all resources notations of given app

Specified by:
deleteComponentRatings in interface RatingBm
Parameters:
componentInstanceId - identitier of the component instance.

getRatings

public Map<String,ContributionRating> getRatings(SilverpeasContent... contributions)
Description copied from interface: RatingBm
Getting notation about the given contributions. If a contribution has no notation, a ContributionRating instance is returned anyway.

Specified by:
getRatings in interface RatingBm
Parameters:
contributions - the contributions which returned ratings must be attached.
Returns:
ContributionRating instances ralated to the given contributions indexed by contribution identifier.

getRating

public ContributionRating getRating(SilverpeasContent contribution)
Description copied from interface: RatingBm
Getting notation about the given contribution. If the contribution has no notation, a ContributionRating instance is returned anyway.

Specified by:
getRating in interface RatingBm
Parameters:
contribution - the contribution which returned ratings must be attached.
Returns:
ContributionRating instance ralated to the given contribution.

getRating

public ContributionRating getRating(ContributionRatingPK pk)
Description copied from interface: RatingBm
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 RatingBm
Parameters:
pk - identity of resource
Returns:
Notation of identified resource

hasUserRating

public boolean hasUserRating(RaterRatingPK pk)
Description copied from interface: RatingBm
Checking if user has given a rating on this resource

Specified by:
hasUserRating in interface RatingBm
Parameters:
pk - identity of resource and rater
Returns:
true if user has already given a rate


Copyright © 2016 Silverpeas. All Rights Reserved.