Package io.goobi.viewer.model.cms.legacy
Class CMSPageTemplate
java.lang.Object
io.goobi.viewer.model.cms.legacy.CMSPageTemplate
- All Implemented Interfaces:
Serializable
Page templates are read from XML configuration files and are not stored in the DB.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetContentItem(String itemId) getContentItem.Getter for the fieldcontentItems.Getter for the fielddescription.Getter for the fieldhtmlFileName.Getter for the fieldiconFileName.getId()Getter for the fieldid.getName()Getter for the fieldname.Getter for the fieldtemplateFileName.Getter for the fieldversion.booleanisAppliesToExpandedUrl.booleanisDisplaySortingField.booleanbooleanisThemeTemplate.static CMSPageTemplateloadFromXML(Path file) Loads a page template from the given template file and returns the template object.static booleanparseBoolean(String text) parseBoolean.static booleanparseBoolean(String text, boolean defaultValue) parseBoolean.voidsetAppliesToExpandedUrl(boolean appliesToExpandedUrl) Setter for the fieldappliesToExpandedUrl.voidsetContentItems(List<CMSContentItemTemplate> contentItems) Setter for the fieldcontentItems.voidsetDescription(String description) Setter for the fielddescription.voidsetDisplaySortingField(boolean displaySortingField) Setter for the fielddisplaySortingField.voidsetHtmlFileName(String htmlFileName) Setter for the fieldhtmlFileName.voidsetIconFileName(String iconFileName) Setter for the fieldiconFileName.voidSetter for the fieldid.voidsetMayHaveTopBarSlider(boolean mayHaveTopBarSlider) voidSetter for the fieldname.voidsetTemplateFileName(String templateFileName) Setter for the fieldtemplateFileName.voidsetThemeTemplate(boolean themeTemplate) Setter for the fieldthemeTemplate.voidsetVersion(String version) Setter for the fieldversion.voidvalidate()validate.
-
Constructor Details
-
CMSPageTemplate
public CMSPageTemplate()
-
-
Method Details
-
loadFromXML
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
-
getId
Getter for the fieldid.- Returns:
- the unique identifier of this CMS page template
-
setId
Setter for the fieldid.- Parameters:
id- the template identifier to set
-
getName
Getter for the fieldname.- Returns:
- the display name of this CMS page template
-
setName
Setter for the fieldname.- Parameters:
name- the display name of this page template
-
getVersion
Getter for the fieldversion.- Returns:
- the version string of this CMS page template
-
setVersion
Setter for the fieldversion.- Parameters:
version- the version string of this page template
-
getDescription
Getter for the fielddescription.- Returns:
- the human-readable description of this CMS page template
-
setDescription
Setter for the fielddescription.- Parameters:
description- the human-readable description of this page template
-
getHtmlFileName
Getter for the fieldhtmlFileName.- Returns:
- the name of the HTML file used to render pages of this template
-
setHtmlFileName
Setter for the fieldhtmlFileName.- Parameters:
htmlFileName- the name of the HTML file used to render pages of this template
-
getTemplateFileName
Getter for the fieldtemplateFileName.- Returns:
- the file name of the template descriptor (e.g. XML file)
-
setTemplateFileName
Setter for the fieldtemplateFileName.- Parameters:
templateFileName- the file name of the template descriptor (e.g. XML file)
-
getIconFileName
Getter for the fieldiconFileName.- Returns:
- the file name of the icon image representing this template
-
setIconFileName
Setter for the fieldiconFileName.- Parameters:
iconFileName- the file name of the icon image representing this template
-
getContentItems
Getter for the fieldcontentItems.- Returns:
- the list of content item templates defined for this page template
-
getContentItem
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
Setter for the fieldcontentItems.- 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 fielddisplaySortingField.- 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 fieldthemeTemplate.- Parameters:
themeTemplate- true if this template originates from the theme
-
setAppliesToExpandedUrl
public void setAppliesToExpandedUrl(boolean appliesToExpandedUrl) Setter for the fieldappliesToExpandedUrl.- 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
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
parseBoolean.- Parameters:
text- string value to parse, defaults to false if unrecognized- Returns:
- true if text equals "true" (case-insensitive), false otherwise
-
getAttributes
-