org.silverpeas.rating.web
Class RatingResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by org.silverpeas.rating.web.RatingResource

@Service
@RequestScoped
@Authorized
public class RatingResource
extends RESTWebService

A REST Web resource representing a given rating. It is a web service that provides an access to a rating referenced by its URL.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.silverpeas.web.RESTWebService
RESTWebService.WebProcess<RETURN_VALUE>, RESTWebService.WebTreatment<RETURN_VALUE>
 
Field Summary
 
Fields inherited from class com.silverpeas.web.RESTWebService
RESPONSE_HEADER_ARRAYSIZE, REST_WEB_SERVICES_URI_BASE
 
Constructor Summary
RatingResource()
           
 
Method Summary
protected  RaterRatingEntity asWebEntity(RaterRating raterRating)
          Converts the rating into its corresponding web entity.
protected  String getBundleLocation()
          Gets the location of the bundle to use.
 String getComponentId()
          Gets the identifier of the component instance to which the requested resource belongs to.
 RaterRatingEntity getRaterRating()
          Gets the JSON representation of the rating associated to defined content.
 javax.ws.rs.core.Response saveRating(String note)
           
 
Methods inherited from class com.silverpeas.web.RESTWebService
getBundle, getGreaterUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getUriInfo, getUserDetail, getUserPreferences, getUserRoles, process, validateUserAuthentication, validateUserAuthorization
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RatingResource

public RatingResource()
Method Detail

getBundleLocation

protected String getBundleLocation()
Description copied from class: RESTWebService
Gets the location of the bundle to use.

Overrides:
getBundleLocation in class RESTWebService
Returns:

getComponentId

public String getComponentId()
Description copied from class: RESTWebService
Gets the identifier of the component instance to which the requested resource belongs to.

Specified by:
getComponentId in class RESTWebService
Returns:
the identifier of the Silverpeas component instance.

getRaterRating

public RaterRatingEntity getRaterRating()
Gets the JSON representation of the rating associated to defined content.

Returns:
the response to the HTTP GET request with the JSON representation of the rating.

saveRating

public javax.ws.rs.core.Response saveRating(String note)

asWebEntity

protected RaterRatingEntity asWebEntity(RaterRating raterRating)
Converts the rating into its corresponding web entity.

Parameters:
raterRating - the rater rating to convert.
Returns:
the corresponding rating entity.


Copyright © 2016 Silverpeas. All Rights Reserved.