public abstract class Page extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static String |
SESSION_MESSAGE |
Modifier | Constructor and Description |
---|---|
protected |
Page() |
Modifier and Type | Method and Description |
---|---|
void |
addJavascriptCall(String function) |
void |
addPageResource(String name,
Object resource)
Adds an object required for resource handling, to the page resource map.
|
protected void |
checkPageAccess() |
void |
doInit() |
protected void |
doInitElement(PageElement pe)
called by doInit() to initialize a particular page element
|
void |
doRefresh() |
protected void |
doRefreshElement(PageElement pe)
called by doRefresh() to refresh a particular page element
|
protected String |
extractErrorMessageDetail(String action,
Throwable e,
int stackTraceElements) |
String |
getAction() |
Connection |
getConnection(DBDatabase db)
return a connection for a particular database
|
protected String |
getErrorMessage(Throwable e) |
String |
getIdParamForKey(DBRowSet rowset,
Object[] key) |
Object[] |
getKeyFromParam(DBRowSet rowset,
String idParam) |
String |
getName() |
PageDefinition |
getPageDefinition() |
String |
getPageName() |
Object |
getPageResource(String name)
Returns the page resource object previously added by addPageResource(...)
|
protected PageOutcome |
getParentOutcome(boolean redirect) |
protected PageOutcome |
getParentOutcome(String action,
boolean redirect)
Helper methods for parent outcome
|
PageDefinition |
getParentPage() |
protected TextResolver |
getTextResolver() |
protected boolean |
handleActionError(String action,
Throwable e) |
boolean |
isInitialized() |
protected void |
navigateTo(PageOutcome outcome)
navigates to the desired page.
|
void |
preRenderPage(javax.faces.context.FacesContext context) |
protected void |
registerPageElement(PageElement element)
adds a page element to this page
DO NOT CALL yourself, this method is called from the PageElement constructor!
|
void |
setAction(String actionParam) |
protected void |
setErrorMessage(Throwable e) |
void |
setPageDefinition(PageDefinition pageDefinition) |
protected void |
setSessionMessage(javax.faces.application.FacesMessage facesMsg) |
public static final String SESSION_MESSAGE
public String getPageName()
public String getName()
public boolean isInitialized()
public String getAction()
public void setAction(String actionParam)
public PageDefinition getPageDefinition()
public void setPageDefinition(PageDefinition pageDefinition)
public PageDefinition getParentPage()
public void preRenderPage(javax.faces.context.FacesContext context)
protected void checkPageAccess()
protected void setSessionMessage(javax.faces.application.FacesMessage facesMsg)
protected void setErrorMessage(Throwable e)
protected String extractErrorMessageDetail(String action, Throwable e, int stackTraceElements)
protected void navigateTo(PageOutcome outcome)
outcome
- the destination page to navigate toprotected void registerPageElement(PageElement element)
element
- protected PageOutcome getParentOutcome(String action, boolean redirect)
action
- redirect
- protected PageOutcome getParentOutcome(boolean redirect)
public Connection getConnection(DBDatabase db)
db
- the database for which to obtain a connectionpublic void addJavascriptCall(String function)
public void addPageResource(String name, Object resource)
Since resource requests are not attached to a view, they cannot access page properties via expression language like this #{page.someProperty} Instead, the page should add properties that are required to the "pageResources"-map. This map is held on the session, and cleared when the page changes. In order to access such page resources via expression language use #{pageResources.someProperty}
name
- the name of the resourceresource
- the resourcepublic Object getPageResource(String name)
name
- the name of the resourcepublic void doInit()
public void doRefresh()
protected void doInitElement(PageElement pe)
pe
- the page element to initializeprotected void doRefreshElement(PageElement pe)
pe
- the page element to refreshprotected final TextResolver getTextResolver()
Copyright © 2008–2015 Apache Software Foundation. All rights reserved.