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 Details

    • getContentTypes

      Set<String> 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

      boolean isContentTypeSupported(String mimeType)
      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

      void setContentType(String mimeType)
      Sets the current content type for the provider (widget). The next call to getContent() 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 be null.
      Parameters:
      mimeType - the content type you are going to get via next call to getContent()
    • getContentType

      String getContentType()
      Returns currently set content type or default one if setContentType(java.lang.String) has not been called.
      Returns:
      mime type currently set for this provider
    • getContent

      Reader getContent() throws IOException, PortalException
      Returns content for the previously set content type. If setContentType(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: