Class CMSPageTemplate

java.lang.Object
io.goobi.viewer.model.cms.legacy.CMSPageTemplate
All Implemented Interfaces:
Serializable

public class CMSPageTemplate extends Object implements Serializable
Page templates are read from XML configuration files and are not stored in the DB.
See Also:
  • Constructor Details

    • CMSPageTemplate

      public CMSPageTemplate()
  • Method Details

    • loadFromXML

      public static CMSPageTemplate loadFromXML(Path file)
      Loads a page template from the given template file and returns the template object.
      Parameters:
      file - path to the XML template file to load
      Returns:
      the loaded CMSPageTemplate, or null if the file could not be read or parsed
      Throws:
      IllegalArgumentException - if file is null
    • validate

      public void validate()
      validate.
    • createCMSComponent

      public CMSComponent createCMSComponent()
    • getId

      public String getId()
      Getter for the field id.
      Returns:
      the unique identifier of this CMS page template
    • setId

      public void setId(String id)
      Setter for the field id.
      Parameters:
      id - the template identifier to set
    • getName

      public String getName()
      Getter for the field name.
      Returns:
      the display name of this CMS page template
    • setName

      public void setName(String name)
      Setter for the field name.
      Parameters:
      name - the display name of this page template
    • getVersion

      public String getVersion()
      Getter for the field version.
      Returns:
      the version string of this CMS page template
    • setVersion

      public void setVersion(String version)
      Setter for the field version.
      Parameters:
      version - the version string of this page template
    • getDescription

      public String getDescription()
      Getter for the field description.
      Returns:
      the human-readable description of this CMS page template
    • setDescription

      public void setDescription(String description)
      Setter for the field description.
      Parameters:
      description - the human-readable description of this page template
    • getHtmlFileName

      public String getHtmlFileName()
      Getter for the field htmlFileName.
      Returns:
      the name of the HTML file used to render pages of this template
    • setHtmlFileName

      public void setHtmlFileName(String htmlFileName)
      Setter for the field htmlFileName.
      Parameters:
      htmlFileName - the name of the HTML file used to render pages of this template
    • getTemplateFileName

      public String getTemplateFileName()
      Getter for the field templateFileName.
      Returns:
      the file name of the template descriptor (e.g. XML file)
    • setTemplateFileName

      public void setTemplateFileName(String templateFileName)
      Setter for the field templateFileName.
      Parameters:
      templateFileName - the file name of the template descriptor (e.g. XML file)
    • getIconFileName

      public String getIconFileName()
      Getter for the field iconFileName.
      Returns:
      the file name of the icon image representing this template
    • setIconFileName

      public void setIconFileName(String iconFileName)
      Setter for the field iconFileName.
      Parameters:
      iconFileName - the file name of the icon image representing this template
    • getContentItems

      public List<CMSContentItemTemplate> getContentItems()
      Getter for the field contentItems.
      Returns:
      the list of content item templates defined for this page template
    • getContentItem

      public CMSContentItemTemplate getContentItem(String itemId)
      getContentItem.
      Parameters:
      itemId - identifier of the content item to retrieve
      Returns:
      the content item template with the given ID, or null if not found
    • setContentItems

      public void setContentItems(List<CMSContentItemTemplate> contentItems)
      Setter for the field contentItems.
      Parameters:
      contentItems - the list of content item templates to assign to this page template
    • isDisplaySortingField

      public boolean isDisplaySortingField()
      isDisplaySortingField.
      Returns:
      true if the sorting field should be displayed in the template UI, false otherwise
    • setDisplaySortingField

      public void setDisplaySortingField(boolean displaySortingField)
      Setter for the field displaySortingField.
      Parameters:
      displaySortingField - true to show the sorting field in the template UI
    • isThemeTemplate

      public boolean isThemeTemplate()
      isThemeTemplate.
      Returns:
      true if this template originates from the theme, false otherwise
    • setThemeTemplate

      public void setThemeTemplate(boolean themeTemplate)
      Setter for the field themeTemplate.
      Parameters:
      themeTemplate - true if this template originates from the theme
    • setAppliesToExpandedUrl

      public void setAppliesToExpandedUrl(boolean appliesToExpandedUrl)
      Setter for the field appliesToExpandedUrl.
      Parameters:
      appliesToExpandedUrl - true if this template applies to expanded record URLs
    • isAppliesToExpandedUrl

      public boolean isAppliesToExpandedUrl()
      isAppliesToExpandedUrl.
      Returns:
      true if this template applies to expanded record URLs, false otherwise
    • setMayHaveTopBarSlider

      public void setMayHaveTopBarSlider(boolean mayHaveTopBarSlider)
    • isMayHaveTopBarSlider

      public boolean isMayHaveTopBarSlider()
    • parseBoolean

      public static boolean parseBoolean(String text, boolean defaultValue)
      parseBoolean.
      Parameters:
      text - string value to parse, expected "true" or "false" (case-insensitive)
      defaultValue - value to return when text is neither "true" nor "false"
      Returns:
      true if text equals "true" (case-insensitive), false if it equals "false", or defaultValue if it matches neither
    • parseBoolean

      public static boolean parseBoolean(String text)
      parseBoolean.
      Parameters:
      text - string value to parse, defaults to false if unrecognized
      Returns:
      true if text equals "true" (case-insensitive), false otherwise
    • getAttributes

      public Map<String,CMSComponentAttribute> getAttributes()