Files
alfresco-ng2-components/docs/content-services/rating.service.md
Andy Stark c8f04193c7 [ADF-2764] Updated doc files with latest script features (#3368)
* [ADF-2764] Updated doc files with latest script features

* [ADF-2764] Rebuilt full index instead of just content services index
2018-05-23 00:40:02 +01:00

1.9 KiB

Added, Status, Last reviewed
Added Status Last reviewed
v2.0.0 Active 2018-05-04

Rating service

Manages ratings for items in Content Services.

Class members

Methods

  • deleteRating(nodeId: string = null, ratingType: any = null): 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 any - Null response indicating that the operation is complete
  • getRating(nodeId: string = null, ratingType: any = null): any
    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 any - The rating value
  • postRating(nodeId: string = null, ratingType: any = null, vote: any = null): any
    Adds the current user's rating for a node.
    • nodeId: string - Target node for the rating
    • ratingType: any - Type of rating (can be "likes" or "fiveStar")
    • vote: any - Rating value (boolean for "likes", numeric 0..5 for "fiveStar")
    • Returns any - Details about the rating, including the new value

Details

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.

See also