com.silverpeas.gallery.web
Class GalleryResource

java.lang.Object
  extended by com.silverpeas.web.RESTWebService
      extended by com.silverpeas.gallery.web.AbstractGalleryResource
          extended by com.silverpeas.gallery.web.GalleryResource

@Service
@RequestScoped
@Authorized
public class GalleryResource
extends AbstractGalleryResource

A REST Web resource giving gallery data.

Author:
Yohann Chastagnier

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
 
Fields inherited from class com.silverpeas.web.RESTWebService
RESPONSE_HEADER_ARRAYSIZE, REST_WEB_SERVICES_URI_BASE
 
Constructor Summary
GalleryResource()
           
 
Method Summary
 AlbumEntity getAlbum(String albumId, MediaSort sort)
          Gets the JSON representation of an album.
 AbstractMediaEntity getPhoto(String albumId, String photoId)
          Gets the JSON representation of a photo.
 javax.ws.rs.core.Response getPhotoContent(String photoId, String size, MediaResolution mediaResolution)
          Gets the content of a photo.
 AbstractMediaEntity getSound(String albumId, String soundId)
          Gets the JSON representation of a sound.
 javax.ws.rs.core.Response getSoundContent(String soundId)
          Gets the content of a sound.
 com.sun.jersey.api.view.Viewable getSoundEmbed(String soundId)
          Gets the embed content of a sound.
 AbstractMediaEntity getStreaming(String albumId, String streamingId)
          Gets the JSON representation of a streaming.
 StreamingProviderDataEntity getStreamingProviderDataFromStreamingId(String streamingId)
          Gets the provider data of a streamin from its url.
 StreamingProviderDataEntity getStreamingProviderDataFromUrl(String url)
          Gets the provider data of a streamin from its url.
 AbstractMediaEntity getVideo(String albumId, String videoId)
          Gets the JSON representation of a video.
 javax.ws.rs.core.Response getVideoContent(String videoId)
          Gets the content of a video.
 com.sun.jersey.api.view.Viewable getVideoEmbed(String videoId)
          Gets the embed centent of a video.
 javax.ws.rs.core.Response getVideoThumbnail(String videoId, String size, String thumbnailId)
          Get the video thumbnail.
 
Methods inherited from class com.silverpeas.gallery.web.AbstractGalleryResource
asWebEntity, checkNotFoundStatus, getComponentId, getMediaContent, getMediaEmbed, getMediaEntity, getMediaService, getMediaThumbnail, hasUserMediaAccess, isUserPrivileged, isViewAllPhotoAuthorized, verifyMediaIsInAlbum, verifyUserMediaAccess
 
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

GalleryResource

public GalleryResource()
Method Detail

getAlbum

public AlbumEntity getAlbum(String albumId,
                            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

public AbstractMediaEntity getPhoto(String albumId,
                                    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

public AbstractMediaEntity getVideo(String albumId,
                                    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

public AbstractMediaEntity getSound(String albumId,
                                    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

public AbstractMediaEntity getStreaming(String albumId,
                                        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

public javax.ws.rs.core.Response getPhotoContent(String photoId,
                                                 String size,
                                                 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

public javax.ws.rs.core.Response getVideoContent(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

public javax.ws.rs.core.Response getVideoThumbnail(String videoId,
                                                   String size,
                                                   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

public javax.ws.rs.core.Response getSoundContent(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

public StreamingProviderDataEntity getStreamingProviderDataFromStreamingId(String streamingId)
Gets the provider data of a streamin 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.

getStreamingProviderDataFromUrl

public StreamingProviderDataEntity getStreamingProviderDataFromUrl(String url)
Gets the provider data of a streamin 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:
url - the url of the streaming
Returns:
the response to the HTTP GET request content of the asked streaming.

getVideoEmbed

public com.sun.jersey.api.view.Viewable getVideoEmbed(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

public com.sun.jersey.api.view.Viewable getSoundEmbed(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.


Copyright © 2016 Silverpeas. All Rights Reserved.