ratingsService

Method Description
addRating Add a rating to the JiveContentObject .
createRating Create a new rating with the specified attributes.
getAvailableRatingCount Returns the count of currently available ratings.
getAvailableRatings Returns an iterable of Rating objects that list all the available ratings.
getMeanRating A convenience method which returns a geometric mean average of all the ratings given to the JiveContentObject .
getRating Returns the rating associated with the user, or null if this user hasn't rated the JiveContentObject .
getRatingCount Returns the total number of ratings given to the JiveContentObject .
getRatingFromScore Retrieve the rating with the specified score.
getRatings Returns an Iterable of all the ratings given to the JiveContentObject .
hasRated Returns whether the user has rated the JiveContentObject or not.
isRatingsEnabled Returns true if the rating feature is turned on.
removeRating Remove the specified rating from the list of currently available ratings.
setRatingsEnabled Enables or disables the ratings feature.

addRating

Add a rating to the JiveContentObject . If the user has already rated, this rating will replace the previous rating. If the user is null (anonymous) this rating will be added to the ratings for the JiveContentObject . The author of the JiveContentObject cannot rate their own content.

http://domain:port/application_context/rpc/rest/ratingsService/objectRatings/user

Arguments

Name Type Description
userID xs:long the user rating the JiveContentObject
objectType xs:int the ()} to return ratings for
objectID xs:long the ()} to return ratings for
ratingScore xs:int the rating the user wants to give to the JiveContentObject

Arguments Template

<addRating> 
    <userID>xs:long</userID>
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
    <ratingScore>xs:int</ratingScore>
</addRating>

Errors

Error When Returned
NotFound if content object or user not found
Unauthorized if user does not have permissions

createRating

Create a new rating with the specified attributes. Only positive integers are allowed for the score, 0 or negative integers will cause an IllegalArgumentException to be thrown. If the score is already taken an IllegalArgumentException will be thrown.

POST http://domain:port/application_context/rpc/rest/ratingsService/ratings

Arguments

Name Type Description
score xs:int the score or rating level for the new rating
description xs:string the description of the new rating

Arguments Template

<createRating> 
    <score>xs:int</score>
    <description>xs:string</description>
</createRating>

Response

Type Description
Rating a new Rating object

Response Template

<createRatingResponse> 
    <return>
        <!-- Contents of Rating -->
    <return>
</createRatingResponse>

Errors

Error When Returned
Unauthorized if not a system administrator

getAvailableRatingCount

Returns the count of currently available ratings.

GET http://domain:port/application_context/rpc/rest/ratingsService/ratings/count

Response

Type Description
xs:int a count of currently available ratings

Response Template

<getAvailableRatingCountResponse> 
    <return>xs:int</return>
</getAvailableRatingCountResponse>

getAvailableRatings

Returns an iterable of Rating objects that list all the available ratings. The returned list will be sorted from lowest rating to high rating.

GET http://domain:port/application_context/rpc/rest/ratingsService/ratings

Response

Type Description
List of Rating an iterable of all available ratings

Response Template

<getAvailableRatingsResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Rating -->
    <return>
</getAvailableRatingsResponse>

getMeanRating

A convenience method which returns a geometric mean average of all the ratings given to the JiveContentObject .

GET http://domain:port/application_context/rpc/rest/ratingsService/objectRatings/mean/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int the ()} to return ratings for
objectID xs:long the ()} to return ratings for

Arguments Template

<getMeanRating> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getMeanRating>

Response

Type Description
double a geometric mean average of all the ratings given to the JiveContentObject .

Response Template

<getMeanRatingResponse> 
    <return>double</return>
</getMeanRatingResponse>

Errors

Error When Returned
NotFound if object not found

getRating

Returns the rating associated with the user, or null if this user hasn't rated the JiveContentObject . If the user is null (anonymous) this method will return null.

GET http://domain:port/application_context/rpc/rest/ratingsService/objectRatings/user/{objectType}/{objectID}

Arguments

Name Type Description
userID xs:long of the user to check
objectType xs:int the ()} to return ratings for
objectID xs:long the ()} to return ratings for

Arguments Template

<getRating> 
    <userID>xs:long</userID>
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getRating>

Response

Type Description
Rating the rating the user has given the JiveContentObject , or null if the user has not rated the JiveContentObject or the user is anonymous.

Response Template

<getRatingResponse> 
    <return>
        <!-- Contents of Rating -->
    <return>
</getRatingResponse>

Errors

Error When Returned
NotFound if content object or user not found

getRatingCount

Returns the total number of ratings given to the JiveContentObject .

GET http://domain:port/application_context/rpc/rest/ratingsService/objectRatings/count/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int the ()} to return ratings for
objectID xs:long the ()} to return ratings for

Arguments Template

<getRatingCount> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getRatingCount>

Response

Type Description
xs:int the total number of ratings given to the JiveContentObject .

Response Template

<getRatingCountResponse> 
    <return>xs:int</return>
</getRatingCountResponse>

Errors

Error When Returned
NotFound if object not found

getRatingFromScore

Retrieve the rating with the specified score.

POST http://domain:port/application_context/rpc/rest/ratingsService/ratingFromScore/{score}

Arguments

Name Type Description
score xs:int the score of the rating to retrieve

Arguments Template

<getRatingFromScore> 
    <score>xs:int</score>
</getRatingFromScore>

Response

Type Description
Rating the corresponding rating, or null if no rating matches

Response Template

<getRatingFromScoreResponse> 
    <return>
        <!-- Contents of Rating -->
    <return>
</getRatingFromScoreResponse>

getRatings

Returns an Iterable of all the ratings given to the JiveContentObject .

GET http://domain:port/application_context/rpc/rest/ratingsService/objectRatings/{objectType}/{objectID}

Arguments

Name Type Description
objectType xs:int the ()} to return ratings for
objectID xs:long the ()} to return ratings for

Arguments Template

<getRatings> 
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</getRatings>

Response

Type Description
List of Rating an Iterable of all the ratings given to the JiveContentObject

Response Template

<getRatingsResponse> 
    <!-- List of ... -->
    <return>
        <!-- Contents of Rating -->
    <return>
</getRatingsResponse>

Errors

Error When Returned
NotFound if object not found

hasRated

Returns whether the user has rated the JiveContentObject or not. This method will always return false if the user is anonymous.

GET http://domain:port/application_context/rpc/rest/ratingsService/objectRatings/userHasRated/{objectType}/{objectID}

Arguments

Name Type Description
userID xs:long of the user to check
objectType xs:int the ()} to return ratings for
objectID xs:long the ()} to return ratings for

Arguments Template

<hasRated> 
    <userID>xs:long</userID>
    <objectType>xs:int</objectType>
    <objectID>xs:long</objectID>
</hasRated>

Response

Type Description
xs:boolean true is the user associated with the user has rated the JiveContentObject , false otherwise. If the user is anonymous (null) this method will always return false.

Response Template

<hasRatedResponse> 
    <return>xs:boolean</return>
</hasRatedResponse>

Errors

Error When Returned
NotFound if object not found

isRatingsEnabled

Returns true if the rating feature is turned on. When ratings are disabled, other methods serve as no-ops.

GET http://domain:port/application_context/rpc/rest/ratingsService/ratingsEnabled

Response

Type Description
xs:boolean true if the ratings are enabled

Response Template

<isRatingsEnabledResponse> 
    <return>xs:boolean</return>
</isRatingsEnabledResponse>

removeRating

Remove the specified rating from the list of currently available ratings.

DELETE http://domain:port/application_context/rpc/rest/ratingsService/ratings/{score}

Errors

Error When Returned
Unauthorized if not a system administrator

setRatingsEnabled

Enables or disables the ratings feature. When ratings are disabled, other methods serve as no-ops.

POST http://domain:port/application_context/rpc/rest/ratingsService/ratingsEnabled

Errors

Error When Returned
Unauthorized if not a system administrator