Class GalleryResource

  • All Implemented Interfaces:
    org.silverpeas.core.web.rs.ProtectedWebResource, org.silverpeas.core.web.rs.WebAuthenticationValidation, org.silverpeas.core.web.rs.WebAuthorizationValidation, org.silverpeas.core.web.SilverpeasWebResource

    @WebService
    @Path("gallery/{componentInstanceId}")
    @Authorized
    public class GalleryResource
    extends org.silverpeas.core.web.rs.RESTWebService
    A REST Web resource giving gallery data.
    Author:
    Yohann Chastagnier
    • Constructor Detail

      • GalleryResource

        public GalleryResource()
    • Method Detail

      • getAlbum

        @GET
        @Path("albums/{albumId}")
        @Produces("application/json")
        public AlbumEntity getAlbum​(@PathParam("albumId")
                                    String albumId,
                                    @QueryParam("sort")
                                    MediaSort sort)
        Gets the JSON representation of an album. 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:
        albumId - the identifier of the photo
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked photo.
      • getPhoto

        @GET
        @Path("albums/{albumId}/photos/{photoId}")
        @Produces("application/json")
        public AbstractMediaEntity getPhoto​(@PathParam("albumId")
                                            String albumId,
                                            @PathParam("photoId")
                                            String photoId)
        Gets the JSON representation of a photo. 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:
        photoId - the identifier of the photo
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked photo.
      • getVideo

        @GET
        @Path("albums/{albumId}/videos/{videoId}")
        @Produces("application/json")
        public AbstractMediaEntity getVideo​(@PathParam("albumId")
                                            String albumId,
                                            @PathParam("videoId")
                                            String videoId)
        Gets the JSON representation of a video. 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:
        videoId - the identifier of the video
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked video.
      • getSound

        @GET
        @Path("albums/{albumId}/sounds/{soundId}")
        @Produces("application/json")
        public AbstractMediaEntity getSound​(@PathParam("albumId")
                                            String albumId,
                                            @PathParam("soundId")
                                            String soundId)
        Gets the JSON representation of a sound. 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:
        soundId - the identifier of the sound
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked sound.
      • getStreaming

        @GET
        @Path("albums/{albumId}/streamings/{streamingId}")
        @Produces("application/json")
        public AbstractMediaEntity getStreaming​(@PathParam("albumId")
                                                String albumId,
                                                @PathParam("streamingId")
                                                String streamingId)
        Gets the JSON representation of a streaming. 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:
        streamingId - the identifier of the streaming
        Returns:
        the response to the HTTP GET request with the JSON representation of the asked streaming.
      • getPhotoContent

        @GET
        @Path("photos/{photoId}/{size:([0-9]*x[0-9]*/)?}content")
        @Produces("image/*")
        public javax.ws.rs.core.Response getPhotoContent​(@PathParam("photoId")
                                                         String photoId,
                                                         @PathParam("size")
                                                         String size,
                                                         @QueryParam("resolution")
                                                         MediaResolution mediaResolution)
        Gets the content of a photo. 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:
        photoId - the identifier of the photo
        size - not used for the moment
        Returns:
        the response to the HTTP GET request content of the asked photo.
      • getVideoContent

        @GET
        @Path("videos/{videoId}/content")
        @Produces("application/octet-stream")
        public javax.ws.rs.core.Response getVideoContent​(@PathParam("videoId")
                                                         String videoId)
        Gets the content of a video. 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:
        videoId - the identifier of the video
        Returns:
        the response to the HTTP GET request content of the asked video.
      • getVideoThumbnail

        @GET
        @Path("videos/{videoId}/thumbnail/{size:([0-9]*x[0-9]*/)?}{thumbnailId}")
        @Produces("application/octet-stream")
        public javax.ws.rs.core.Response getVideoThumbnail​(@PathParam("videoId")
                                                           String videoId,
                                                           @PathParam("size")
                                                           String size,
                                                           @PathParam("thumbnailId")
                                                           String thumbnailId)
        Get the video thumbnail. 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:
        videoId - the identifier of the video
        size - not used for the moment
        Returns:
        the response to the HTTP GET request content of the asked video.
      • getSoundContent

        @GET
        @Path("sounds/{soundId}/content")
        @Produces("application/octet-stream")
        public javax.ws.rs.core.Response getSoundContent​(@PathParam("soundId")
                                                         String soundId)
        Gets the content of a sound. 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:
        soundId - the identifier of the sound
        Returns:
        the response to the HTTP GET request content of the asked sound.
      • getStreamingProviderDataFromStreamingId

        @GET
        @Path("streamings/{streamingId}/providerData")
        @Produces("application/json")
        public javax.ws.rs.core.Response getStreamingProviderDataFromStreamingId​(@PathParam("streamingId")
                                                                                 String streamingId)
        Gets the provider data of a streaming from its url. 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:
        streamingId - the identifier of the streaming
        Returns:
        the response to the HTTP GET request content of the asked streaming.
      • getVideoEmbed

        @GET
        @Path("videos/{videoId}/embed")
        public org.jboss.resteasy.plugins.providers.html.View getVideoEmbed​(@PathParam("videoId")
                                                                            String videoId)
        Gets the embed centent of a video. 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:
        videoId - the identifier of the video
        Returns:
        the response to the HTTP GET request embed centent of the asked video.
      • getSoundEmbed

        @GET
        @Path("sounds/{soundId}/embed")
        public org.jboss.resteasy.plugins.providers.html.View getSoundEmbed​(@PathParam("soundId")
                                                                            String soundId)
        Gets the embed content of a sound. 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:
        soundId - the identifier of the sound
        Returns:
        the response to the HTTP GET request embed content of the asked sound.
      • getComponentId

        public String getComponentId()
      • getResourceBasePath

        protected String getResourceBasePath()
        Specified by:
        getResourceBasePath in class org.silverpeas.core.web.rs.RESTWebService