org.apache.empire.jsf2.pages
Class Page

java.lang.Object
  extended by org.apache.empire.jsf2.pages.Page
All Implemented Interfaces:
Serializable

public abstract class Page
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static String SESSION_MESSAGE
           
 
Constructor Summary
protected Page()
           
 
Method Summary
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESSION_MESSAGE

public static final String SESSION_MESSAGE
See Also:
Constant Field Values
Constructor Detail

Page

protected Page()
Method Detail

getPageName

public String getPageName()

getName

public String getName()

isInitialized

public boolean isInitialized()

getAction

public String getAction()

setAction

public void setAction(String actionParam)

getPageDefinition

public PageDefinition getPageDefinition()

setPageDefinition

public void setPageDefinition(PageDefinition pageDefinition)

getParentPage

public PageDefinition getParentPage()

preRenderPage

public void preRenderPage(javax.faces.context.FacesContext context)

checkPageAccess

protected void checkPageAccess()

setSessionMessage

protected void setSessionMessage(javax.faces.application.FacesMessage facesMsg)

handleActionError

protected boolean handleActionError(String action,
                                    Throwable e)

setErrorMessage

protected void setErrorMessage(Throwable e)

getErrorMessage

protected String getErrorMessage(Throwable e)

extractErrorMessageDetail

protected String extractErrorMessageDetail(String action,
                                           Throwable e,
                                           int stackTraceElements)

navigateTo

protected void navigateTo(PageOutcome outcome)
navigates to the desired page. Depending on the page outcome provided this is either a forward or a redirect.

Parameters:
outcome - the destination page to navigate to

registerPageElement

protected void registerPageElement(PageElement element)
adds a page element to this page DO NOT CALL yourself, this method is called from the PageElement constructor!

Parameters:
element -

getParentOutcome

protected PageOutcome getParentOutcome(String action,
                                       boolean redirect)
Helper methods for parent outcome

Parameters:
action -
redirect -
Returns:
the parent outcome string

getParentOutcome

protected PageOutcome getParentOutcome(boolean redirect)

getConnection

public Connection getConnection(DBDatabase db)
return a connection for a particular database

Parameters:
db - the database for which to obtain a connection
Returns:
the connection for the given database

getKeyFromParam

public Object[] getKeyFromParam(DBRowSet rowset,
                                String idParam)

getIdParamForKey

public String getIdParamForKey(DBRowSet rowset,
                               Object[] key)

addJavascriptCall

public void addJavascriptCall(String function)

addPageResource

public void addPageResource(String name,
                            Object resource)
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 resource
resource - the resource

getPageResource

public Object getPageResource(String name)
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

protected void doInitElement(PageElement pe)
called by doInit() to initialize a particular page element

Parameters:
pe - the page element to initialize

doRefreshElement

protected void doRefreshElement(PageElement pe)
called by doRefresh() to refresh a particular page element

Parameters:
pe - the page element to refresh

getTextResolver

protected final TextResolver getTextResolver()


Copyright © 2008–2014 Apache Software Foundation. All rights reserved.