use of org.alfresco.rest.api.model.DocumentRatingSummary in project alfresco-remote-api by Alfresco.
the class AbstractRatingScheme method getNodeRating.
public NodeRating getNodeRating(NodeRef nodeRef) {
Rating ratingByCurrentUser = ratingService.getRatingByCurrentUser(nodeRef, ratingSchemeName);
Float rating = null;
Date appliedAt = null;
if (ratingByCurrentUser != null) {
rating = ratingByCurrentUser.getScore();
appliedAt = ratingByCurrentUser.getAppliedAt();
}
Object myRating = null;
if (rating != null) {
validateRating(rating);
myRating = getApiRating(rating);
}
DocumentRatingSummary documentRatingSummary = getDocumentRatingSummary(nodeRef);
NodeRating nodeRating = new NodeRating(ratingSchemeId, myRating, appliedAt, documentRatingSummary);
return nodeRating;
}
Aggregations