Class Page

java.lang.Object
org.apache.empire.jsf2.pages.Page

public abstract class Page extends Object
  • Field Details

  • Constructor Details

    • Page

      protected Page()
  • Method Details

    • 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)
    • executeAction

      protected void executeAction(String action, javax.faces.context.FacesContext context)
    • isHasMessages

      public boolean isHasMessages()
    • checkPageAccess

      protected void checkPageAccess()
    • restoreSessionMessage

      protected void restoreSessionMessage(javax.faces.context.FacesContext fc)
    • logAndHandleActionException

      protected void logAndHandleActionException(String action, Throwable e)
    • setSessionMessage

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

      protected void setSessionError(Throwable t)
    • handleActionError

      protected boolean handleActionError(String action, Throwable t)
    • addFacesMessage

      protected void addFacesMessage(javax.faces.application.FacesMessage.Severity severity, String msg, Object... params)
    • addInfoMessage

      public final void addInfoMessage(String msg, Object... params)
    • addWarnMessage

      public final void addWarnMessage(String msg, Object... params)
    • addErrorMessage

      public final void addErrorMessage(String msg, Object... params)
    • setErrorMessage

      public void setErrorMessage(Throwable t)
    • 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 - the page element
    • getParentOutcome

      protected PageOutcome getParentOutcome(String action, boolean redirect)
      Helper methods for parent outcome
      Parameters:
      action - the action
      redirect - flag whether to redirect
      Returns:
      the parent outcome string
    • getParentOutcome

      protected PageOutcome getParentOutcome(boolean redirect)
    • getObjectFromParam

      public <T extends ParameterObject> T getObjectFromParam(Class<T> paramType, String idParam)
    • getKeyFromParam

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

      public Object[] getKeyFromParam(PageDefinition page, DBRowSet rowset, String idParam)
    • getIdParamForKey

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

      public String getIdParamForKey(PageDefinition page, DBRowSet rowset, Object[] key)
    • addJavascriptCall

      public void addJavascriptCall(String function)
      Adds a Javascript call to the current request
      Parameters:
      function - the javascript function to be called
    • addJavascriptCall

      public void addJavascriptCall(String function, Object... args)
      Adds a Javascript call to the current request
      Parameters:
      function - the function call template
      args - the call arguments to be replaced in the function template
    • 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()