Interface ElementTemplate

  • All Superinterfaces:
    Adaptable

    public interface ElementTemplate
    extends Adaptable

    Implementations of this interface allow to access an element template through a well-defined API, without needing to care about the underlying content structure.

    • Method Detail

      • getName

        String getName()
        Gets the (technical) name of the represented content element.
        Returns:
        The name
      • getTitle

        String getTitle()
        Gets the (human-readable) title of the represented content element.
        Returns:
        The title
      • getDataType

        @NotNull
        @NotNull DataType getDataType()
        Gets the data type of the element.
        Returns:
        the data type of the element
        Since:
        1.1
      • getInitialContentType

        @Nullable
        @Nullable String getInitialContentType()
        Gets the initial MIME type of the variation.

        This method must return a MIME type that is actually supported by the implementation.

        Returns:
        The initial MIME type
      • getDefaultContent

        @Nullable
        @Nullable String getDefaultContent()

        Gets the content type of the default content.

        If this method returns null, the implementation should consider this as "undefined" rather than "empty". In such cases, it's the implementation's duty to provide a sensible default content. Could (for example) be an empty string for plain text content or <p>&nbsp;</p> for HTML content.

        Returns:
        The default content; if null, a sensible default content has to be provided by the implementation
      • getMetaData

        Map<String,​Object> getMetaData()

        Returns a Map with metadata of an Element.

        The method is used to return metadata information associated with Data Types from a Content Fragment Model.

        Example: used to return the Fragment Template referenced by a Fragment Reference data type.

        Returns:
        A Map with metadata information of an Element Template, or an empty Map in case the Element Template has no extra information.