Interface CTDisplayRenderer<T>

All Known Implementing Classes:
BaseCTDisplayRenderer

public interface CTDisplayRenderer<T>
Display renderer used to describe and render models of a given type. If an exception occurs during rendering, the default renderer is used instead.
See Also:
  • Method Details

    • fetchLatestVersionedModel

      default T fetchLatestVersionedModel(T model)
    • getAvailableLanguageIds

      default String[] getAvailableLanguageIds(T model)
    • getDefaultLanguageId

      default String getDefaultLanguageId(T model)
    • getDownloadInputStream

      default InputStream getDownloadInputStream(T model, String key) throws com.liferay.portal.kernel.exception.PortalException
      Returns the input stream for the model and key from when the URL was generated during rendering.
      Parameters:
      model - the model for the download
      key - the key used when creating the download URL
      Returns:
      the input stream
      Throws:
      com.liferay.portal.kernel.exception.PortalException
      See Also:
    • getEditURL

      String getEditURL(javax.servlet.http.HttpServletRequest httpServletRequest, T model) throws Exception
      Returns the edit URL for the model (optionally null).
      Parameters:
      httpServletRequest - the request
      model - the model to be edited
      Returns:
      the URL to use for editing the model
      Throws:
      Exception - if an exception occurred
    • getModelClass

      Class<T> getModelClass()
      Returns the model class for this display renderer.
      Returns:
      the model class for this display renderer
    • getTitle

      String getTitle(Locale locale, T model) throws com.liferay.portal.kernel.exception.PortalException
      Returns the title for the model.
      Parameters:
      locale - to use for translation
      model - the model for this display renderer
      Returns:
      the title for the model
      Throws:
      com.liferay.portal.kernel.exception.PortalException - if a portal exception occurred
    • getTypeName

      String getTypeName(Locale locale)
      Returns the translated type name for the model type.
      Parameters:
      locale - to use for translation
      Returns:
      the type name for the model type
    • getVersionName

      default String getVersionName(T model)
    • isHideable

      default boolean isHideable(T model)
      Returns whether the model may be hidden by default. Hidden models may be filtered out in some views.
      Parameters:
      model - the model to be shown or hidden by default
      Returns:
      whether the model may be hidden by default
    • render

      void render(DisplayContext<T> displayContext) throws Exception
      Renders the model with the display context.
      Parameters:
      displayContext - the context for rendering the model
      Throws:
      Exception - if an exception occurred
    • renderPreview

      default String renderPreview(DisplayContext<T> displayContext) throws Exception
      Throws:
      Exception
    • showPreviewDiff

      default boolean showPreviewDiff()