Class PreviewResource

    • Constructor Detail

      • PreviewResource

        public PreviewResource()
    • Method Detail

      • getPreview

        @GET
        @Path("{type}/{id}")
        @Produces("application/json")
        public PreviewEntity getPreview​(@PathParam("id")
                                        String id,
                                        @PathParam("type")
                                        String type,
                                        @QueryParam("lang")
                                        String language)
        Gets the JSON representation of preview information. If it doesn't exist, a 404 HTTP code is returned. If the user isn't authenticated, 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 a resource handled into Silverpeas's context.
        type - the type of the resource.
        language - the language used to select the content to preview.
        Returns:
        the response to the HTTP GET request with the JSON representation of preview information.
      • asWebEntity

        protected PreviewEntity asWebEntity​(Preview preview)
        Converts the preview into its corresponding web entity.
        Parameters:
        preview - the view to convert.
        Returns:
        the corresponding view entity.