org.silverpeas.rating.web
Class RaterRatingEntity

java.lang.Object
  extended by org.silverpeas.rating.web.RaterRatingEntity
All Implemented Interfaces:
Exposable, Serializable

public class RaterRatingEntity
extends Object
implements Exposable

See Also:
Serialized Form

Constructor Summary
protected RaterRatingEntity()
           
 
Method Summary
static RaterRatingEntity fromRateable(Rateable rateableContribution)
          Creates a new rater rating entity from the specified parameter.
protected static RaterRatingEntity fromRaterRating(RaterRating raterRating)
          Creates a new rater rating entity from the specified parameter.
 String getAsJSonString()
           
 String getComponentId()
          Gets the identifier of the Silverpeas component instance to which the rated content belongs.
 String getContributionId()
          Gets the identifier of the resource that is rated by this.
 String getContributionType()
          Gets the type of the resource that is rated by this.
 int getNumberOfRaterRatings()
          Gets the number of rater ratings on the contribution.
 int getRaterRatingValue()
          Gets the rating of the current user.
 float getRatingAverage()
          Gets the average rating on the contribution.
 URI getURI()
          Gets the URI at which this resource is published and can be accessed.
 boolean isRatingDone()
          Indicates if the current user made a rating on the contribution.
protected  void setComponentId(String componentId)
           
protected  void setContributionId(String contributionId)
           
protected  void setContributionType(String contributionType)
           
protected  void setNumberOfRaterRatings(int numberOfRaterRatings)
           
protected  void setRaterRatingValue(int raterRatingValue)
           
protected  void setRatingAverage(float ratingAverage)
           
protected  void setRatingDone(boolean isRatingDone)
           
protected  void setUri(URI uri)
           
 String toJSonScript(String jsVariableName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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: Exposable
Gets the URI at which this resource is published and can be accessed.

Specified by:
getURI in interface Exposable
Returns:
the web resource 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)


Copyright © 2016 Silverpeas. All Rights Reserved.