Package com.sun.identity.config.util
Class TemplatedPage
- java.lang.Object
-
- org.openidentityplatform.openam.click.Page
-
- com.sun.identity.config.util.AjaxPage
-
- com.sun.identity.config.util.TemplatedPage
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
Options
public abstract class TemplatedPage extends AjaxPage
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description intcurrentYearstatic StringSTATUS_MESSAGE_CODES_SESSION_KEYListstatusMessages-
Fields inherited from class com.sun.identity.config.util.AjaxPage
checkPasswordsLink, configLocale, debug, OLD_RESPONSE_TEMPLATE, rb, RB_NAME, resetSessionAttributesLink, RESPONSE_TEMPLATE, responseString, validateInputLink
-
-
Constructor Summary
Constructors Constructor Description TemplatedPage()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddStatusMessageCode(String statusMessageCode)protected voidclearStatusMessageCodes()protected voiddoInit()protected ListgetStatusMessageCodes()StringgetTemplate()Return the path of the page border template to render, by default this method returnsPage.getPath().protected abstract StringgetTitle()Return the i18n code of the page title.voidonInit()The on Initialization event handler.-
Methods inherited from class com.sun.identity.config.util.AjaxPage
checkPasswords, getAttribute, getAvailablePort, getBaseDir, getConnection, getCookieDomain, getHostName, getHostName, getLocalizedString, getQuoteEscapedLocalizedString, getServerPort, initializeResourceBundle, isRendering, resetSessionAttributes, toBoolean, toInt, toString, validateInput, writeErrorToResponse, writeInvalid, writeJsonResponse, writeJsonResponse, writeToResponse, writeValid, writeValid
-
Methods inherited from class org.openidentityplatform.openam.click.Page
addControl, addModel, getContentType, getContext, getControls, getFormat, getForward, getHeadElements, getHeaders, getHtmlImports, getMessage, getMessage, getMessages, getModel, getPageImports, getPath, getRedirect, hasControls, hasHeaders, isIncludeControlHeadElements, isStateful, onDestroy, onGet, onPost, onRender, onSecurityCheck, removeControl, setFormat, setForward, setForward, setForward, setHeader, setHeaders, setIncludeControlHeadElements, setPageImports, setPath, setRedirect, setRedirect, setRedirect, setRedirect, setStateful, setTemplate
-
-
-
-
Field Detail
-
STATUS_MESSAGE_CODES_SESSION_KEY
public static final String STATUS_MESSAGE_CODES_SESSION_KEY
- See Also:
- Constant Field Values
-
currentYear
public int currentYear
-
statusMessages
public List statusMessages
-
-
Method Detail
-
getTemplate
public String getTemplate()
Description copied from class:org.openidentityplatform.openam.click.PageReturn the path of the page border template to render, by default this method returnsPage.getPath(). Pages can override this method to return an alternative border page template. This is very useful when implementing an standardized look and feel for a web site. The example below provides a BorderedPage base Page which other site templated Pages should extend.public class BorderedPage extends Page { public String getTemplate() { return "border.htm"; } }
The BorderedPage returns the page border template "border.htm":<html> <head> <title> $title </title> <link rel="stylesheet" type="text/css" href="style.css" title="Style"/> </head> <body> <h1> $title </h1> <hr/> #parse( $path ) </body> </html>Other pages insert their content into this template, via theirPage.pathproperty using the Velocity #parse directive. Note the $path value is automatically added to the VelocityContext by the ClickServlet.- Overrides:
getTemplatein classorg.openidentityplatform.openam.click.Page- Returns:
- the path of the page template to render, by default returns
Page.getPath()
-
getTitle
protected abstract String getTitle()
Return the i18n code of the page title.- Returns:
- the i18n code of the page title;
-
getStatusMessageCodes
protected List getStatusMessageCodes()
-
addStatusMessageCode
protected void addStatusMessageCode(String statusMessageCode)
-
clearStatusMessageCodes
protected void clearStatusMessageCodes()
-
onInit
public void onInit()
Description copied from class:org.openidentityplatform.openam.click.PageThe on Initialization event handler. This event handler is invoked after thePage.onInit()method has been called. Subclasses should place any initialization code which has dependencies on the context or other properties in this method. Generally light weight initialization code should be placed in the Pages constructor. Time consuming operations such as fetching the results of a database query should not be placed in this method. These operations should be performed in thePage.onRender(),Page.onGet()orPage.onPost()methods so that other event handlers may take alternative execution paths without performing these expensive operations. Please Note however the qualifier for the previous statement is that all form and field controls must be fully initialized before they are processed, which is after the onInit() method has completed. After this point their onProcess() methods will be invoked by the ClickServlet. Select controls in particular must have their option list values populated before the form is processed otherwise field validations cannot be performed. For initializing page controls the best practice is to place all the control creation code in the pages constructor, and only place any initialization code in the onInit() method which has an external dependency to the context or some other object. By following this practice it is easy to see what code is "design time" initialization code and what is "runtime initialization code". When subclassing pages which also use the onInit() method is is critical you call the super.onInit() method first, for example:public void onInit() { super.onInit(); // Initialization code .. }
-
doInit
protected void doInit()
-
-