java.lang.Object
com.semanticcms.core.servlet.Theme
A theme is responsible for the overall view of the site.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
configureResources
(ServletContext servletContext, HttpServletRequest req, HttpServletResponse resp, View view, Page page, Registry requestRegistry) Configures the request-scope web resources that this theme uses.abstract void
doTheme
(ServletContext servletContext, HttpServletRequest request, HttpServletResponse response, View view, Page page) Renders the theme.boolean
Two themes with the same name are considered equal.abstract String
Gets the display name for this theme.abstract String
getName()
Gets the unique name of this theme.static Theme
getTheme
(ServletRequest request) Gets the current theme on the given request ornull
when none active.int
hashCode()
Consistent with equals, hashCode based on name.final boolean
Checks if this is the default theme.static void
setTheme
(ServletRequest request, Theme theme) Sets the current theme on the given request ornull
for none active.toString()
-
Constructor Details
-
Theme
public Theme()
-
-
Method Details
-
getTheme
Gets the current theme on the given request ornull
when none active. -
setTheme
Sets the current theme on the given request ornull
for 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
Serialization
andDoctype
may 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 andSkipPageException
is thrown instead.- Throws:
ServletException
IOException
SkipPageException
- See Also:
-