Package org.apache.empire.jsf2.pages
Class Page
java.lang.Object
org.apache.empire.jsf2.pages.Page
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddErrorMessage(String msg, Object... params) protected voidaddFacesMessage(javax.faces.application.FacesMessage.Severity severity, String msg, Object... params) final voidaddInfoMessage(String msg, Object... params) voidaddJavascriptCall(String function) Adds a Javascript call to the current requestvoidaddJavascriptCall(String function, Object... args) Adds a Javascript call to the current requestvoidaddPageResource(String name, Object resource) Adds an object required for resource handling, to the page resource map.final voidaddWarnMessage(String msg, Object... params) protected voidvoiddoInit()protected voiddoInitElement(PageElement<?> pe) called by doInit() to initialize a particular page elementvoidprotected voiddoRefreshElement(PageElement<?> pe) called by doRefresh() to refresh a particular page elementprotected voidexecuteAction(String action, javax.faces.context.FacesContext context) getIdParamForKey(DBRowSet rowset, Object[] key) getIdParamForKey(PageDefinition page, DBRowSet rowset, Object[] key) Object[]getKeyFromParam(DBRowSet rowset, String idParam) Object[]getKeyFromParam(PageDefinition page, DBRowSet rowset, String idParam) getName()<T extends ParameterObject>
TgetObjectFromParam(Class<T> paramType, String idParam) getPageResource(String name) Returns the page resource object previously added by addPageResource(...)protected PageOutcomegetParentOutcome(boolean redirect) protected PageOutcomegetParentOutcome(String action, boolean redirect) Helper methods for parent outcomeprotected final TextResolverprotected booleanhandleActionError(String action, Throwable t) booleanbooleanprotected voidlogAndHandleActionException(String action, Throwable e) protected voidnavigateTo(PageOutcome outcome) navigates to the desired page.voidpreRenderPage(javax.faces.context.FacesContext context) protected voidregisterPageElement(PageElement<?> element) adds a page element to this page DO NOT CALL yourself, this method is called from the PageElement constructor!protected voidrestoreSessionMessage(javax.faces.context.FacesContext fc) voidvoidvoidsetPageDefinition(PageDefinition pageDefinition) protected voidprotected voidsetSessionMessage(javax.faces.application.FacesMessage facesMsg)
-
Field Details
-
SESSION_MESSAGE
- See Also:
-
-
Constructor Details
-
Page
protected Page()
-
-
Method Details
-
getPageName
-
getName
-
isInitialized
public boolean isInitialized() -
getAction
-
setAction
-
getPageDefinition
-
setPageDefinition
-
getParentPage
-
preRenderPage
public void preRenderPage(javax.faces.context.FacesContext context) -
executeAction
-
isHasMessages
public boolean isHasMessages() -
checkPageAccess
protected void checkPageAccess() -
restoreSessionMessage
protected void restoreSessionMessage(javax.faces.context.FacesContext fc) -
logAndHandleActionException
-
setSessionMessage
protected void setSessionMessage(javax.faces.application.FacesMessage facesMsg) -
setSessionError
-
handleActionError
-
addFacesMessage
-
addInfoMessage
-
addWarnMessage
-
addErrorMessage
-
setErrorMessage
-
registerPageElement
adds a page element to this page DO NOT CALL yourself, this method is called from the PageElement constructor!- Parameters:
element- the page element
-
getParentOutcome
Helper methods for parent outcome- Parameters:
action- the actionredirect- flag whether to redirect- Returns:
- the parent outcome string
-
getParentOutcome
-
getObjectFromParam
-
getKeyFromParam
-
getKeyFromParam
-
getIdParamForKey
-
getIdParamForKey
-
addJavascriptCall
Adds a Javascript call to the current request- Parameters:
function- the javascript function to be called
-
addJavascriptCall
Adds a Javascript call to the current request- Parameters:
function- the function call templateargs- the call arguments to be replaced in the function template
-
addPageResource
Adds an object required for resource handling, to the page resource map.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}- Parameters:
name- the name of the resourceresource- the resource
-
getPageResource
Returns the page resource object previously added by addPageResource(...)- Parameters:
name- the name of the resource- Returns:
- resource the resource
-
doInit
public void doInit() -
doRefresh
public void doRefresh() -
doInitElement
called by doInit() to initialize a particular page element- Parameters:
pe- the page element to initialize
-
doRefreshElement
called by doRefresh() to refresh a particular page element- Parameters:
pe- the page element to refresh
-
getTextResolver
-