Title | Added | Status | Last reviewed |
---|---|---|---|
Rating service |
v2.0.0 |
Active |
2018-05-04 |
Manages ratings for items in Content Services.
- deleteRating(nodeId:
string
, ratingType:any
):Observable
<any>
Removes the current user's rating for a node.- nodeId:
string
- Target node - ratingType:
any
- Type of rating to remove (can be "likes" or "fiveStar") - Returns
Observable
<any>
- Null response indicating that the operation is complete
- nodeId:
- getRating(nodeId:
string
, ratingType:any
):Observable
<
RatingEntry
|__type>
Gets the current user's rating for a node.- nodeId:
string
- Node to get the rating from - ratingType:
any
- Type of rating (can be "likes" or "fiveStar") - Returns
Observable
<
RatingEntry
|__type>
- The rating value
- nodeId:
- postRating(nodeId:
string
, ratingType:string
, vote:any
):Observable
<
RatingEntry
|__type>
Adds the current user's rating for a node.- nodeId:
string
- Target node for the rating - ratingType:
string
- Type of rating (can be "likes" or "fiveStar") - vote:
any
- Rating value (boolean for "likes", numeric 0..5 for "fiveStar") - Returns
Observable
<
RatingEntry
|__type>
- Details about the rating, including the new value
- nodeId:
The ratingType
string currently has two possible options, "likes"
and "fiveStar". When the "likes" scheme is used, the result of
getRating
and the vote
parameter of postRating
are boolean
values. When "fiveStar" is used, the value is an integer representing
the number of stars out of five.
See the Ratings API in the Alfresco JS API for more information about the returned data and the REST API that this service is based on.