|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.cabo.servlet.event.BasePageFlowEngine | +--oracle.cabo.servlet.event.TrivialPageFlowEngine
Trivial (and default) implementation of PageFlowEngine used by AbstractPageBroker.
This page flow implementation requires EventHandler implementations to return the result page in the event result. If the "result" object in the EventResult isn't a Page object, DefaultPageFlowEngine will use it as a Page name.
You can set the login page using setLoginPage(), or by use of a Servlet configuration parameter (see below).
The default way this engine decides if a user is logged in is to look for in the HttpSession at a developer-specified key; if there's any non-null value stored there, the user is assumed to be logged in. You can choose the HttpSession key with setLoggedInKey() or a Servlet configuration parameter. You can also choose a custom different strategy for checking if the user is logged in by subclassing and overriding isLoggedIn().
It's also possible to mark that some pages don't need login by subclassing and overriding needsLogin(), or by explicitly calling addNoLoginPage().
oracle.cabo.servlet.loginPage
: The name of the
login page
oracle.cabo.servlet.loggedInKey
: A key to check
for being logged in
Field Summary | |
static java.lang.Object |
FORWARD_TO_LOGIN_RESULT
EventResult key indicating that the user should be redirected to the login page. |
Fields inherited from class oracle.cabo.servlet.event.BasePageFlowEngine |
FORWARD_EVENT_PROPERTY, FORWARD_PAGE_PROPERTY |
Constructor Summary | |
TrivialPageFlowEngine()
Creates a TrivialPageFlowEngine. |
Method Summary | |
void |
addNoLoginPage(java.lang.String name)
Marks that a page does not require login. |
protected EventResult |
checkPageAccess(BajaContext context,
Page page,
PageEvent event)
Verifies that the current page can be accessed. |
java.lang.String |
getLoggedInKey()
Returns the HttpSession key used to detect if the user has logged in. |
Page |
getLoginPage()
Returns the login page. |
protected Page |
getPage(BajaContext context,
Page sourcePage,
PageEvent event,
EventResult eventResult)
Given the result of an event, determine which Page should be rendered. |
void |
init(javax.servlet.Servlet servlet,
javax.servlet.ServletConfig config)
Initializes the page flow engine. |
protected boolean |
isLoggedIn(BajaContext context,
Page page)
Returns true if the user is already logged in (for the purposes of the provided page). |
protected boolean |
needsLogin(BajaContext context,
Page page)
Returns true if the specified page cannot be accessed without logging in first. |
void |
setLoggedInKey(java.lang.String key)
Sets the HttpSession key used to detect if the user has logged in. |
void |
setLoginPage(Page login)
Sets the login page. |
Methods inherited from class oracle.cabo.servlet.event.BasePageFlowEngine |
destroy, handleRequest, processForwardRequest, setForwardRequest |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Object FORWARD_TO_LOGIN_RESULT
Constructor Detail |
public TrivialPageFlowEngine()
Method Detail |
public void addNoLoginPage(java.lang.String name)
public void init(javax.servlet.Servlet servlet, javax.servlet.ServletConfig config)
init
in class BasePageFlowEngine
public Page getLoginPage()
needsLogin()
returns true, and isLoggedIn()
returns false.isLoggedIn(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
,
needsLogin(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
public void setLoginPage(Page login)
needsLogin()
returns true, and isLoggedIn()
returns false.isLoggedIn(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
,
needsLogin(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
public java.lang.String getLoggedInKey()
isLoggedIn(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
public void setLoggedInKey(java.lang.String key)
isLoggedIn(oracle.cabo.servlet.BajaContext, oracle.cabo.servlet.Page)
protected EventResult checkPageAccess(BajaContext context, Page page, PageEvent event)
checkPageAccess
in class BasePageFlowEngine
protected Page getPage(BajaContext context, Page sourcePage, PageEvent event, EventResult eventResult) throws PageEventException
BasePageFlowEngine
getPage
in class BasePageFlowEngine
oracle.cabo.servlet.event.BasePageFlowEngine
context
- the current BajaContextsourcePage
- the page on which the event was processedevent
- the event just processedresult
- the result of that eventprotected boolean isLoggedIn(BajaContext context, Page page)
protected boolean needsLogin(BajaContext context, Page page)
|
Oracle UIX API Reference Release 2.1.22.0.0 B12196-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |