alfresco-js-api
Version:
JavaScript client library for the Alfresco REST API
228 lines (154 loc) • 7.54 kB
Markdown
//localhost/alfresco/api/-default-/public/alfresco/versions/1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getRating**](RatingsApi.md
[**getRatings**](RatingsApi.md
[**rate**](RatingsApi.md
[**removeRating**](RatingsApi.md
<a name="getRating"></a>
> RatingEntry getRating(nodeId, ratingId, opts)
Get a rating
Get the specific rating **ratingId** on node **nodeId**.
### Example
```javascript
var nodeId = "nodeId_example"; // {String} The identifier of a node.
var ratingId = "ratingId_example"; // {String} The identifier of a rating.
var opts = {
'fields': ["fields_example"] /* {[String]} A list of field names.
You can use this parameter to restrict the fields
returned within a response if, for example, you want to save on overall bandwidth.
The list applies to a returned individual
entity or entries within a collection.
If the API method also supports the **include**
parameter, then the fields specified in the **include**
parameter are returned in addition to those specified in the **fields** parameter. */
};
this.alfrescoJsApi.core.ratingsApi.getRating(nodeId, ratingId, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**nodeId** | **String**| The identifier of a node. |
**ratingId** | **String**| The identifier of a rating. |
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include* parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
[**RatingEntry**](RatingEntry.md)
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
<a name="getRatings"></a>
> RatingPaging getRatings(nodeId, opts)
Get ratings
Get the ratings for node **nodeId**.
### Example
```javascript
var nodeId = "nodeId_example"; // {String} The identifier of a node.
var opts = {
'skipCount': 56, // {Integer} The number of entities that exist in the collection before those included in this list.
'maxItems': 56, // {Integer} The maximum number of items to return in the list.
'fields': ["fields_example"] /* {[String]} A list of field names.
You can use this parameter to restrict the fields
returned within a response if, for example, you want to save on overall bandwidth.
The list applies to a returned individual
entity or entries within a collection.
If the API method also supports the **include**
parameter, then the fields specified in the **include**
parameter are returned in addition to those specified in the **fields** parameter. */
};
this.alfrescoJsApi.core.ratingsApi.getRatings(nodeId, opts).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**nodeId** | **String**| The identifier of a node. |
**skipCount** | **Integer**| The number of entities that exist in the collection before those included in this list. | [optional]
**maxItems** | **Integer**| The maximum number of items to return in the list. | [optional]
**fields** | [**[String]**](String.md)| A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter. | [optional]
[**RatingPaging**](RatingPaging.md)
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
<a name="rate"></a>
> RatingEntry rate(nodeId, ratingBody)
Rate
Rate the node with identifier **nodeId**
### Example
```javascript
var nodeId = "nodeId_example"; // {String} The identifier of a node.
var ratingBody = new this.alfrescoJsApi.core.RatingBody(); // {RatingBody} For "myRating" the type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar. For example, to "like" a file the following body would be used:
```JSON
{
"id": "likes",
"myRating": true
}
```
this.alfrescoJsApi.core.ratingsApi.rate(nodeId, ratingBody).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**nodeId** | **String**| The identifier of a node. |
**ratingBody** | [**RatingBody**](RatingBody.md)| For "myRating" the type is specific to the rating scheme, boolean for the likes and an integer for the fiveStar.
For example, to "like" a file the following body would be used:
```JSON
{
"id": "likes",
"myRating": true
}
```
|
[**RatingEntry**](RatingEntry.md)
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
<a name="removeRating"></a>
> removeRating(nodeId, ratingId)
Delete a rating
Removes rating **ratingId** from node **nodeId**.
```javascript
var nodeId = "nodeId_example"; // {String} The identifier of a node.
var ratingId = "ratingId_example"; // {String} The identifier of a rating.
this.alfrescoJsApi.core.ratingsApi.removeRating(nodeId, ratingId).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
```
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**nodeId** | **String**| The identifier of a node. |
**ratingId** | **String**| The identifier of a rating. |
null (empty response body)
[ ](../README.md
- **Content-Type**: application/json
- **Accept**: application/json
All URIs are relative to *https: