Package io.goobi.viewer.model.cms.pages
Class CMSTemplateManager
java.lang.Object
io.goobi.viewer.model.cms.pages.CMSTemplateManager
- All Implemented Interfaces:
Serializable
@Singleton
@Startup
@Named("cmsTemplateManager")
public class CMSTemplateManager
extends Object
implements Serializable
Loads and provides access to available CMS page templates from the filesystem.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetComponent(String templateFilename) Getter for the fieldcoreFolderPath.getCoreIconFolderPath.getCoreTemplateFolderUrl(String filesystemPath, ServletContext servletContext, String templateFolderUrl) Getter for the fieldcoreTemplateFolderUrl.getCoreViewFolderPath.getLegacyComponent(String templateId) getTemplate.Getter for the fieldtemplates.Getter for the fieldthemeFolderPath.getThemeIconFolderPath.getThemeViewFolderPath.voidinit()loadLegacyTemplate(String filename) voidstatic PathtoURI.voidupdateTemplates(Optional<Path> corePath, Optional<Path> themePath) updateTemplates.
-
Constructor Details
-
CMSTemplateManager
public CMSTemplateManager() -
CMSTemplateManager
- Throws:
PresentationException
-
-
Method Details
-
init
- Throws:
PresentationException
-
loadLegacyTemplate
-
getContentManager
-
reloadContentManager
public void reloadContentManager() -
toURI
toURI.- Parameters:
url- URL to convert to a filesystem path- Returns:
- the filesystem path corresponding to the given URL, or null if conversion fails
-
getCoreTemplateFolderUrl
public static Optional<URL> getCoreTemplateFolderUrl(String filesystemPath, ServletContext servletContext, String templateFolderUrl) throws MalformedURLException, URISyntaxException Getter for the fieldcoreTemplateFolderUrl.- Parameters:
filesystemPath- base filesystem path used when servlet context is absentservletContext- servlet context for resolving web resource pathstemplateFolderUrl- relative URL path of the template folder- Returns:
- an Optional containing the URL to the core CMS template folder, or empty if not found
- Throws:
MalformedURLException- if any.UnsupportedEncodingException- if any.URISyntaxException- if any.
-
updateTemplates
updateTemplates.- Parameters:
corePath- optional path to the core legacy template folderthemePath- optional path to the theme legacy template folder
-
getLegacyComponents
Getter for the fieldtemplates.- Returns:
- the collection of all loaded legacy CMS template components
-
getLegacyComponentMap
-
getLegacyComponent
getTemplate.- Parameters:
templateId- unique identifier of the legacy template- Returns:
- the legacy CMS component matching the given template ID, or null if not found
-
getThemeFolderPath
Getter for the fieldthemeFolderPath.- Returns:
- an Optional containing the path to the theme's CMS template folder, or empty if no theme folder is configured
-
getCoreFolderPath
Getter for the fieldcoreFolderPath.- Returns:
- an Optional containing the path to the core CMS template folder, or empty if no core folder is configured
-
getCoreViewFolderPath
getCoreViewFolderPath.- Returns:
- an Optional containing the path to the core CMS template views folder, or empty if no core folder is configured
-
getThemeViewFolderPath
getThemeViewFolderPath.- Returns:
- an Optional containing the path to the theme CMS template views folder, or empty if no theme folder is configured
-
getCoreIconFolderPath
getCoreIconFolderPath.- Returns:
- an Optional containing the path to the core CMS template icons folder, or empty if no core folder is configured
-
getThemeIconFolderPath
getThemeIconFolderPath.- Returns:
- an Optional containing the path to the theme CMS template icons folder, or empty if no theme folder is configured
-
getComponent
-