Interface ResourceViewProvider
-
- All Known Implementing Classes:
DocumentTemplateResourceViewProvider,SimpleDocumentEmbedMediaViewProvider
public interface ResourceViewProviderInterface that defines the signature anResourceViewprovider MUST implements to be handled by viewer APIs.The implementations MUST be registered into
ResourceViewProviderRegistryat server starting.For now, these provider implementations are exclusively used by
DocumentViewResource,PreviewResourceandEmbedMediaViewerResourceWEB services.- Author:
- silveryocha
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ResourceViewgetAuthorizedResourceView(String resourceId, String resourceType, String language)Gets against the current requester the authorizedResourceView.Optional<ResourceView>getByIdAndLanguage(String mediaId, String language)Gets by a resource identifier theResourceViewinstance if any.StringrelatedToService()Indicates the name of Silverpeas's service the provider is related to.
-
-
-
Method Detail
-
getAuthorizedResourceView
static ResourceView getAuthorizedResourceView(String resourceId, String resourceType, String language)
Gets against the current requester the authorizedResourceView.- Parameters:
resourceId- the identifier of the resource.resourceType- the resource type the given identifier is related to.language- the optional language into which the resource is attempted.- Returns:
- a
ResourceViewinstance. - Throws:
javax.ws.rs.WebApplicationException- with NOT FOUND code if resource has not been found.javax.ws.rs.WebApplicationException- with FORBIDDEN code if resource not authorized for current requester.
-
getByIdAndLanguage
Optional<ResourceView> getByIdAndLanguage(String mediaId, String language)
Gets by a resource identifier theResourceViewinstance if any.- Returns:
- optional
ResourceViewinstance.
-
relatedToService
String relatedToService()
Indicates the name of Silverpeas's service the provider is related to.- Returns:
- name of service.
-
-