Interface ResourceViewProvider
-
- All Known Implementing Classes:
DocumentTemplateResourceViewProvider
,SimpleDocumentEmbedMediaViewProvider
public interface ResourceViewProvider
Interface that defines the signature anResourceView
provider MUST implements to be handled by viewer APIs.The implementations MUST be registered into
ResourceViewProviderRegistry
at server starting.For now, these provider implementations are exclusively used by
DocumentViewResource
,PreviewResource
andEmbedMediaViewerResource
WEB services.- Author:
- silveryocha
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ResourceView
getAuthorizedResourceView(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 theResourceView
instance if any.String
relatedToService()
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
ResourceView
instance. - 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 theResourceView
instance if any.- Returns:
- optional
ResourceView
instance.
-
relatedToService
String relatedToService()
Indicates the name of Silverpeas's service the provider is related to.- Returns:
- name of service.
-
-