org.silverpeas.viewer.web
Class DocumentViewResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by org.silverpeas.viewer.web.DocumentViewResource

@Service
@RequestScoped
@Authorized
public class DocumentViewResource
extends RESTWebService

Author:
Yohann Chastagnier

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
DocumentViewResource()
           
 
Method Summary
protected  DocumentViewEntity asWebEntity(DocumentView documentView)
          Converts the document view into its corresponding web entity.
 DocumentViewEntity getAttachmentView(String id, String language)
          Gets the JSON representation of document view information.
 String getComponentId()
          Gets the identifier of the component instance to which the requested resource belongs to.
 
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
 

Constructor Detail

DocumentViewResource

public DocumentViewResource()
Method Detail

getAttachmentView

public DocumentViewEntity getAttachmentView(String id,
                                            String language)
Gets the JSON representation of document view information. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authentified, a 401 HTTP code is returned. If a problem occurs when processing the request, a 503 HTTP code is returned.

Parameters:
id - the identifier of the JCR master node under which the document is handled.
language - the language used to select the content to view.
Returns:
the response to the HTTP GET request with the JSON representation of preview information.

asWebEntity

protected DocumentViewEntity asWebEntity(DocumentView documentView)
Converts the document view into its corresponding web entity.

Parameters:
documentView - the view to convert.
Returns:
the corresponding view entity.

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.


Copyright © 2016 Silverpeas. All Rights Reserved.