com.silverpeas.questionReply.web
Class ReplyResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by com.silverpeas.questionReply.web.QuestionRelyBaseWebService
          extended by com.silverpeas.questionReply.web.ReplyResource

@Service
@RequestScoped
@Authorized
public class ReplyResource
extends QuestionRelyBaseWebService

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


Nested Class Summary
 
Nested classes/interfaces inherited from class com.silverpeas.web.RESTWebService
com.silverpeas.web.RESTWebService.WebProcess<RETURN_VALUE>, com.silverpeas.web.RESTWebService.WebTreatment<RETURN_VALUE>
 
Field Summary
protected  String componentId
           
 
Fields inherited from class com.silverpeas.web.RESTWebService
RESPONSE_HEADER_ARRAYSIZE, REST_WEB_SERVICES_URI_BASE
 
Constructor Summary
ReplyResource()
           
 
Method Summary
protected  ReplyEntity[] asWebEntities(List<Reply> replies, com.stratelia.webactiv.SilverpeasRole profile)
          Converts the specified list of replies into their corresponding web entities.
protected  ReplyEntity asWebEntity(Reply reply, URI replyURI, com.stratelia.webactiv.SilverpeasRole profile)
          Converts the reply into its corresponding web entity.
 ReplyEntity[] getAllRepliesForQuestion(String onQuestionId)
          Gets the JSON representation of the specified existing question.
 String getComponentId()
           
 ReplyEntity[] getPublicRepliesForQuestion(String onQuestionId)
           
protected  URI identifiedBy(URI uri)
           
 
Methods inherited from class com.silverpeas.web.RESTWebService
getBundle, getBundleLocation, 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
 

Field Detail

componentId

protected String componentId
Constructor Detail

ReplyResource

public ReplyResource()
Method Detail

getComponentId

public String getComponentId()
Specified by:
getComponentId in class com.silverpeas.web.RESTWebService

getAllRepliesForQuestion

public ReplyEntity[] getAllRepliesForQuestion(String onQuestionId)
Gets the JSON representation of the specified existing question. If the reply doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If the user isn't authorized to access the question, a 403 is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.

Parameters:
onQuestionId - the unique identifier of the question.
Returns:
the response to the HTTP GET request with the JSON representation of the asked question replies.

getPublicRepliesForQuestion

public ReplyEntity[] getPublicRepliesForQuestion(String onQuestionId)

identifiedBy

protected URI identifiedBy(URI uri)

asWebEntities

protected ReplyEntity[] asWebEntities(List<Reply> replies,
                                      com.stratelia.webactiv.SilverpeasRole profile)
Converts the specified list of replies into their corresponding web entities.

Parameters:
replies - the replies to convert.
profile - the profile of the user.
Returns:
an array with the corresponding reply entities.

asWebEntity

protected ReplyEntity asWebEntity(Reply reply,
                                  URI replyURI,
                                  com.stratelia.webactiv.SilverpeasRole profile)
Converts the reply into its corresponding web entity.

Parameters:
reply - the reply to convert.
replyURI - the URI of the reply.
profile - the profile of the user.
Returns:
the corresponding reply entity.


Copyright © 2016 Silverpeas. All Rights Reserved.