java.lang.Object
com.semanticcms.core.servlet.Theme
A theme is responsible for the overall view of the site.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigureResources(ServletContext servletContext, HttpServletRequest req, HttpServletResponse resp, View view, Page page, Registry requestRegistry) Configures the request-scope web resources that this theme uses.abstract voiddoTheme(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, View view, Page page) Renders the theme.booleanTwo themes with the same name are considered equal.abstract StringGets the display name for this theme.abstract StringgetName()Gets the unique name of this theme.static ThemegetTheme(ServletRequest request) Gets the current theme on the given request ornullwhen none active.inthashCode()Consistent with equals, hashCode based on name.final booleanChecks if this is the default theme.static voidsetTheme(ServletRequest request, Theme theme) Sets the current theme on the given request ornullfor none active.toString()
-
Constructor Details
-
Theme
public Theme()
-
-
Method Details
-
getTheme
Gets the current theme on the given request ornullwhen none active. -
setTheme
Sets the current theme on the given request ornullfor none active. -
equals
Two themes with the same name are considered equal. -
hashCode
public int hashCode()Consistent with equals, hashCode based on name. -
toString
-
getDisplay
Gets the display name for this theme. -
getName
Gets the unique name of this theme. -
isDefault
public final boolean isDefault()Checks if this is the default theme. -
configureResources
public void configureResources(ServletContext servletContext, HttpServletRequest req, HttpServletResponse resp, View view, Page page, Registry requestRegistry) Configures the request-scope web resources that this theme uses.Implementers should call
super.configureResources(…)as a matter of convention, despite this default implementation doing nothing. -
doTheme
public abstract void doTheme(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, View view, Page page) throws ServletException, IOException, SkipPageException Renders the theme.Both the
SerializationandDoctypemay have been set on the request, and these must be considered in the HTML generation.When
response is committed, this theme method is never called andSkipPageExceptionis thrown instead.- Throws:
ServletExceptionIOExceptionSkipPageException- See Also:
-
