Interface I_CmsFormatterBean

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> getAliasKeys()
      Gets the set of alias keys for the formatter.
      java.util.Set<java.lang.String> getAllKeys()
      Gets the complete set of keys for the formatter, i.e.
      java.util.Map<java.lang.String,​java.lang.String> getAttributes()
      Gets the map of attributes.
      java.util.Set<java.lang.String> getContainerTypes()
      Returns the formatter container type.
      java.util.Set<java.lang.String> getCssHeadIncludes()
      Gets the CSS head includes.
      java.lang.String getDescription​(java.util.Locale locale)
      Gets the formatter description.
      java.lang.String getDisplayType()
      The display type of this formatter or null in case this is not a display formatter.
      java.lang.String getId()
      Returns the id of this formatter.
      java.lang.String getInlineCss()
      Gets the inline CSS snippets.
      java.lang.String getInlineJavascript()
      Gets the inline JS snippets.
      java.util.List<java.lang.String> getJavascriptHeadIncludes()
      Gets the Javascript head includes.
      java.lang.String getJspRootPath()
      Returns the root path of the formatter JSP in the OpenCms VFS.
      CmsUUID getJspStructureId()
      Returns the structure id of the JSP resource for this formatter.
      java.lang.String getKey()
      Gets the formatter key, or null if no formatter key is set.
      default java.lang.String getKeyOrId()
      Helper method for getting either the key, if it exists, or the ID (as a string) if it does not.
      java.lang.String getLocation()
      Returns the location this formatter was defined in.
      int getMaxWidth()
      Returns the maximum formatter width.
      java.util.List<CmsMetaMapping> getMetaMappings()
      Returns the meta mappings.
      int getMinWidth()
      Returns the minimum formatter width.
      java.lang.String getNiceName​(java.util.Locale locale)
      Gets the nice name for this formatter.
      int getRank()
      Gets the rank.
      java.util.Collection<java.lang.String> getResourceTypeNames()
      Gets the resource type names.
      java.util.Map<java.lang.String,​CmsXmlContentProperty> getSettings​(CmsADEConfigData sitemapConfig)
      Gets the defined settings.
      java.util.List<CmsTemplatePlugin> getTemplatePlugins()
      Gets the template plugins.
      boolean hasNestedFormatterSettings()
      Returns if nested formatter settings should be displayed.
      boolean isAllowsSettingsInEditor()
      Returns whether this formatter allows settings to be edited in the content editor.
      boolean isAutoEnabled()
      Returns true if the formatter is automatically enabled.
      boolean isDetailFormatter()
      Returns true if the formatter can be used for detail views.
      boolean isDisplayFormatter()
      Returns whether this formatter should be used by the 'display' tag.
      boolean isFromFormatterConfigFile()
      Returns true if the formatter is from a formatter configuration file.
      boolean isMatchAll()
      Returns true if this formatter should match all type/width combinations.
      boolean isPreviewFormatter()
      Indicates if this formatter is to be used as preview in the ADE gallery GUI.
      boolean isSearchContent()
      Returns true in case an XML content formatted with this formatter should be included in the online full text search.
      boolean isTypeFormatter()
      Returns true in case this formatter is based on type information.
      void setJspStructureId​(CmsUUID structureId)
      Sets the JSP structure id.
      boolean useMetaMappingsForNormalElements()
      Returns true if meta mappings should be evaluated for normal container elements using this formatter, not just detail elements.
      java.util.Optional<I_CmsFormatterBean> withKeys​(java.util.Collection<java.lang.String> keys)
      If possible, returns a formatter bean that is basically a copy of this one, but has the keys supplied as a parameter.
    • Method Detail

      • getAliasKeys

        java.util.Set<java.lang.String> getAliasKeys()
        Gets the set of alias keys for the formatter.
        Returns:
        the set of alias keys
      • getAllKeys

        java.util.Set<java.lang.String> getAllKeys()
        Gets the complete set of keys for the formatter, i.e. its main key and all alias keys.
        Returns:
        the complete set of keys
      • getAttributes

        java.util.Map<java.lang.String,​java.lang.String> getAttributes()
        Gets the map of attributes.

        Returns:
        the attribute map
      • getContainerTypes

        java.util.Set<java.lang.String> getContainerTypes()
        Returns the formatter container type.

        If this is "*", then the formatter is a width based formatter.

        Returns:
        the formatter container type
      • getCssHeadIncludes

        java.util.Set<java.lang.String> getCssHeadIncludes()
        Gets the CSS head includes.

        Returns:
        the CSS head includes
      • getDescription

        java.lang.String getDescription​(java.util.Locale locale)
        Gets the formatter description.

        If a locale is passed in, macros in the configured description will be resolved with a macro resolver set to that locale. If null is passed in as a locale, the raw configured description will be returned.

        Parameters:
        locale - the locale (may be null)
        Returns:
        the formatter description
      • getDisplayType

        java.lang.String getDisplayType()
        The display type of this formatter or null in case this is not a display formatter.

        Returns:
        the display type
      • getId

        java.lang.String getId()
        Returns the id of this formatter.

        This method may return null because the id is not always defined for formatters, e.g. for those formatters declared in a schema.

        Returns:
        the formatter id
      • getInlineCss

        java.lang.String getInlineCss()
        Gets the inline CSS snippets.

        Returns:
        the inline CSS snippets
      • getInlineJavascript

        java.lang.String getInlineJavascript()
        Gets the inline JS snippets.

        Returns:
        the inline JS snippets
      • getJavascriptHeadIncludes

        java.util.List<java.lang.String> getJavascriptHeadIncludes()
        Gets the Javascript head includes.

        Returns:
        the head includes
      • getJspRootPath

        java.lang.String getJspRootPath()
        Returns the root path of the formatter JSP in the OpenCms VFS.

        Returns:
        the root path of the formatter JSP in the OpenCms VFS.

      • getJspStructureId

        CmsUUID getJspStructureId()
        Returns the structure id of the JSP resource for this formatter.

        Returns:
        the structure id of the JSP resource for this formatter
      • getKey

        java.lang.String getKey()
        Gets the formatter key, or null if no formatter key is set.

        A formatter key is used to allow dynamic switching between formatters with the same key by enabling/disabling the formatters in the sitemap configuration. I.e. if a formatter referenced in a container page has been disabled in the sitemap configuration, but a different formatter with the same key is enabled, the second formatter will be used instead when rendering the page .

        Returns:
        the formatter key, or null
      • getKeyOrId

        default java.lang.String getKeyOrId()
        Helper method for getting either the key, if it exists, or the ID (as a string) if it does not.
        Returns:
        the formatter key or id
      • getLocation

        java.lang.String getLocation()
        Returns the location this formatter was defined in.

        This will be an OpenCms VFS root path, either to the XML schema XSD, or the configuration file this formatter was defined in, or to the JSP that makes up this formatter.

        Returns:
        the location this formatter was defined in
      • getMaxWidth

        int getMaxWidth()
        Returns the maximum formatter width.

        If this is not set, then Integer.MAX_VALUE is returned.

        Returns:
        the maximum formatter width
      • getMinWidth

        int getMinWidth()
        Returns the minimum formatter width.

        If this is not set, then -1 is returned.

        Returns:
        the minimum formatter width
      • getNiceName

        java.lang.String getNiceName​(java.util.Locale locale)
        Gets the nice name for this formatter.

        Parameters:
        locale - the locale
        Returns:
        the nice name for this formatter
      • getRank

        int getRank()
        Gets the rank.

        Returns:
        the rank
      • getResourceTypeNames

        java.util.Collection<java.lang.String> getResourceTypeNames()
        Gets the resource type names.

        Returns:
        the resource type names
      • getSettings

        java.util.Map<java.lang.String,​CmsXmlContentPropertygetSettings​(CmsADEConfigData sitemapConfig)
        Gets the defined settings.

        Parameters:
        sitemapConfig - the sitemap configuration for which the settings should be retrieved
        Returns:
        the defined settings
      • hasNestedFormatterSettings

        boolean hasNestedFormatterSettings()
        Returns if nested formatter settings should be displayed.

        Returns:
        true if nested formatter settings should be displayed
      • isAllowsSettingsInEditor

        boolean isAllowsSettingsInEditor()
        Returns whether this formatter allows settings to be edited in the content editor.

        Returns:
        true in case editing the settings is allowed in the content editor
      • isAutoEnabled

        boolean isAutoEnabled()
        Returns true if the formatter is automatically enabled.

        Returns:
        true if the formatter is automatically enabled
      • isDetailFormatter

        boolean isDetailFormatter()
        Returns true if the formatter can be used for detail views.

        Returns:
        true if the formatter can be used for detail views
      • isDisplayFormatter

        boolean isDisplayFormatter()
        Returns whether this formatter should be used by the 'display' tag.

        Returns:
        true if this formatter should be used by the 'display' tag
      • isFromFormatterConfigFile

        boolean isFromFormatterConfigFile()
        Returns true if the formatter is from a formatter configuration file.

        Returns:
        formatter f
      • isMatchAll

        boolean isMatchAll()
        Returns true if this formatter should match all type/width combinations.

        Returns:
        true if this formatter should match all type/width combinations
      • isPreviewFormatter

        boolean isPreviewFormatter()
        Indicates if this formatter is to be used as preview in the ADE gallery GUI.
        Returns:
        true if this formatter is to be used as preview in the ADE gallery GUI
      • isSearchContent

        boolean isSearchContent()
        Returns true in case an XML content formatted with this formatter should be included in the online full text search.

        Returns:
        true in case an XML content formatted with this formatter should be included in the online full text search
      • isTypeFormatter

        boolean isTypeFormatter()
        Returns true in case this formatter is based on type information.

        Returns:
        true in case this formatter is based on type information
      • setJspStructureId

        void setJspStructureId​(CmsUUID structureId)
        Sets the JSP structure id.

        Parameters:
        structureId - the jsp structure id
      • useMetaMappingsForNormalElements

        boolean useMetaMappingsForNormalElements()
        Returns true if meta mappings should be evaluated for normal container elements using this formatter, not just detail elements.

        Returns:
        true if meta mappings should be evaluated for normal container elements
      • withKeys

        java.util.Optional<I_CmsFormatterBeanwithKeys​(java.util.Collection<java.lang.String> keys)
        If possible, returns a formatter bean that is basically a copy of this one, but has the keys supplied as a parameter.

        Note that this only works for formatters which already have a key, and can not replace the main key. If the keys already match, the current instance may be returned rather than a copy.

        If the formatter bean implementation does not support key replacement, or an error occurs, an empty Optional is returned

        Parameters:
        keys - the keys to use (should include the current key of the formatter
        Returns:
        the copy with the replaced keys