Files
alfresco-ng2-components/docs/content-services/rating.service.md
Andy Stark 2c0e7aa035 [ADF-2847] Added Class members headings and rebuilt prop/method tables for docs (#3240)
* [ADF-2847] Added class members heading to content services docs

* [ADF-2847] Updated all prop/method tables in content services
2018-04-26 14:54:25 +01:00

1.7 KiB

Added, Status
Added Status
v2.0.0 Active

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 = null - Target node
    • ratingType: any = null - Type of rating to remove (can be "likes" or "fiveStar")
    • Returns any -
  • getRating(nodeId: string = null, ratingType: any = null): any
    Gets the current user's rating for a node.
    • nodeId: string = null - Node to get the rating from
    • ratingType: any = null - Type of rating (can be "likes" or "fiveStar")
    • Returns any -
  • postRating(nodeId: string = null, ratingType: any = null, vote: any = null): any
    Adds the current user's rating for a node.
    • nodeId: string = null - Target node for the rating
    • ratingType: any = null - Type of rating (can be "likes" or "fiveStar")
    • vote: any = null - Rating value (boolean for "likes", numeric 0..5 for "fiveStar")
    • Returns any -

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