Class GalleryResource
- java.lang.Object
-
- org.silverpeas.core.web.rs.RESTWebService
-
- org.silverpeas.components.gallery.web.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.RESTWebServiceA REST Web resource giving gallery data.- Author:
- Yohann Chastagnier
-
-
Constructor Summary
Constructors Constructor Description GalleryResource()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AlbumEntitygetAlbum(String albumId, MediaSort sort)Gets the JSON representation of an album.StringgetComponentId()AbstractMediaEntitygetPhoto(String albumId, String photoId)Gets the JSON representation of a photo.javax.ws.rs.core.ResponsegetPhotoContent(String photoId, String size, MediaResolution mediaResolution)Gets the content of a photo.protected StringgetResourceBasePath()AbstractMediaEntitygetSound(String albumId, String soundId)Gets the JSON representation of a sound.javax.ws.rs.core.ResponsegetSoundContent(String soundId)Gets the content of a sound.org.jboss.resteasy.plugins.providers.html.ViewgetSoundEmbed(String soundId)Gets the embed content of a sound.AbstractMediaEntitygetStreaming(String albumId, String streamingId)Gets the JSON representation of a streaming.javax.ws.rs.core.ResponsegetStreamingProviderDataFromStreamingId(String streamingId)Gets the provider data of a streaming from its url.AbstractMediaEntitygetVideo(String albumId, String videoId)Gets the JSON representation of a video.javax.ws.rs.core.ResponsegetVideoContent(String videoId)Gets the content of a video.org.jboss.resteasy.plugins.providers.html.ViewgetVideoEmbed(String videoId)Gets the embed centent of a video.javax.ws.rs.core.ResponsegetVideoThumbnail(String videoId, String size, String thumbnailId)Get the video thumbnail.-
Methods inherited from class org.silverpeas.core.web.rs.RESTWebService
createWebResourceUri, fromPage, getBundle, getBundleLocation, getHighestUserRole, getHttpRequest, getHttpServletRequest, getHttpServletResponse, getOrganisationController, getSilverpeasContext, getUri, getUser, getUserPreferences, getUserRoles, identifiedBy, identifiedBy, initContext, initWebResourceUri, isUserDefined, process
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
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 photosize- 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 videosize- 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:
getResourceBasePathin classorg.silverpeas.core.web.rs.RESTWebService
-
-