Interface IContentProvider
- All Known Subinterfaces:
IContentRenderer
,IPortletBean
,IPortletTitleBar
public interface IContentProvider
The main interface for getting content of a given mime type. This interface must be
implemented by all content providers like widgets and renderers.
-
Method Summary
Modifier and TypeMethodDescriptionReturns content for the previously set content type.Returns currently set content type or default one ifsetContentType(java.lang.String)
has not been called.Returns all supported content types by this provider (widget).boolean
isContentTypeSupported
(String mimeType) Checks if the given content type is supported by this content providervoid
setContentType
(String mimeType) Sets the current content type for the provider (widget).
-
Method Details
-
getContentTypes
Returns all supported content types by this provider (widget). The content types are actually mime types.- Returns:
- Set of supported mime types
- See Also:
-
isContentTypeSupported
Checks if the given content type is supported by this content provider- Parameters:
mimeType
- the content type you'd like to check is it supported or not- Returns:
- true if the content type is supported
-
setContentType
Sets the current content type for the provider (widget). The next call togetContent()
will return the content of this content type. If the content type is not supported the exception will not be thrown and the content will benull
.- Parameters:
mimeType
- the content type you are going to get via next call togetContent()
-
getContentType
String getContentType()Returns currently set content type or default one ifsetContentType(java.lang.String)
has not been called.- Returns:
- mime type currently set for this provider
-
getContent
Returns content for the previously set content type. IfsetContentType(java.lang.String)
has not been set before, the default content type is be used.- Returns:
- Reader for the content
- Throws:
IOException
PortalException
- See Also:
-