Oracle® Fusion Middleware Developer's Guide for Oracle Adaptive Access Manager Release 11g (11.1.1) E15480-06 |
|
![]() Previous |
![]() Next |
OAAM supports the customization of user flow. The Struts/Tiles framework is used by OAAM to create a common look and feel for an application.
OAAM uses the Struts framework to define the user interface flow. The Struts configuration file (/WEB-INF/struts-config.xml
) defines all the navigation rules in the form of Struts action definitions. Action definitions typically contain path, type, and parameter attributes. Many definitions also contain one or more forward elements that indicate which page should be displayed next. Refer to Section 9.6, "Struts Configuration File" for an example of the struts-config.xml
file.
Interface pages are constructed using the Tiles component of the Struts Framework. The layout file (/WEB-INF/tiles-def.xml
) contains "definitions" for the various pages. Refer to Section 9.5, "Interface Page Configuration File" for an example of the tiles.def.xml
file. In order to deploy Java Server Pages (JSP) files, you must add them to the OAAM shared library. See Chapter 7, "Customizing Oracle Adaptive Access Manager" for more information about the Oracle Adaptive Access Manager Extensions Shared Library.
To customize the OAAM user interface flow and the layout of the Java Server Pages (JSPs), you must override the OAAM Server JSP and struts action targets using the OAAM Extensions Shared library. The Extensions Shared Library contains the following two files to be used for the customizations:
WEB-INF/struts-config-extension.xml
WEB-INF/tiles-def-extension.xml
Note: Customizations should only be done in the OAAM Extensions Shared Library. Do not modify thestruts-config.xml and tiles-def.xml files. |
To customize the look and feel presented in the graphical user interface (GUI), add the custom JSP files to the OAAM Extensions shared library and then add the definitions to the tiles-def-extension.xml
file.
The following example shows the definition for the password page, as defined in tiles-defs.xml
:
<definition name="password" extends="bharosa.uio.baseLayout"> <put name="body" value="/password.jsp"/> </definition>
At run time the password page dynamically displays all necessary GUI elements for the user to enter the required credential.
The following example shows the definition of a custom password page that can be added to tiles-def-extension.xml
:
<definition name="password" extends="bharosa.uio.baseLayout">
<put name="body" value="/customPassword.jsp"/>
</definition>
If the definition is added to the tiles-def-extension
file, the new customPassword.jsp
is used when the OAAM Server attempts to display the "password" page.
Similar to overriding JSP content files, the struts action classes and their mappings could be overridden.
The following example shows the definition for the login action, as defined in struts-config.xml
:
<action path="/login" type="com.bharosa.uio.actions.LoginAction"> <forward name="success" path="/updateLoginStatus.do" redirect="true"/> <forward name="loginJump" path="/loginJumpPage.jsp" redirect="true"/> <forward name="password" path="password"/> <forward name="challenge" path="/challengeUser.do" redirect="true"/> </action>
The following example shows the possible values you could override for the login action by using struts-config.xml
:
<action path="/login" type="com.bharosa.uio.actions.CustomLoginAction"> <forward name="success" path="/updateLoginStatus.do" redirect="true"/> <forward name="loginJump" path="/customLoginJumpPage.jsp" redirect="true"/> <forward name="password" path="password"/> <forward name="challenge" path="/customChallengeUser.do" redirect="true"/> </action>
The user interface pages are constructed using the Tiles component of the Struts Framework.
The following example extends the baseLayout definition and uses a JSP named registerQuestionsHTML.jsp
to render the content tile. It renders content appropriate for the JSP named registerQuestionsHTML.jsp
:
<definition name="registerQuestionsHTML" extends="bharosa.uio.baseLayout"> <put name="body" value="/registerQuestionsHTML.jsp"/ </definition>
The rendered page consists of content from the body tile. The body tile contains the output from registerQuestionsHTML.jsp
.
This section shows a tiles-def.xml file
.
<tiles-definitions> <!-- ========================================================== --> <!-- Master definition - Start --> <!-- ========================================================== --> <!-- Main page layout used as a root for other page definitions --> <definition name="bharosa.uio.baseLayout" path="/bharosaUIOBaseLayout.jsp"> <put name="header" value="/header.jsp"/> <put name="footer" value="/footer.jsp"/> <put name="body" value="${body}"/> </definition> <definition name="bharosa.uio.messageLayout" path="/bharosaUIOMessageLayout.jsp"> <put name="body" value="${body}"/> </definition> <!-- login success --> <definition name="loginSuccess" extends="bharosa.uio.baseLayout"> <put name="body" value="/loginSuccess.jsp"/> </definition> <!-- login fail --> <definition name="loginFail" extends="bharosa.uio.baseLayout"> <put name="body" value="/loginFail.jsp"/> </definition> <!-- password entry --> <definition name="password" extends="bharosa.uio.baseLayout"> <put name="body" value="/password.jsp"/> </definition> <!-- register questions --> <definition name="registerInfo" extends="bharosa.uio.baseLayout"> <put name="body" value="/registerInfo.jsp"/> </definition> <definition name="registerAuthenticator" extends="bharosa.uio.baseLayout"> <put name="body" value="/registerAuthenticator.jsp"/> </definition> <definition name="registerQuestions" extends="bharosa.uio.baseLayout"> <put name="body" value="/registerQuestions.jsp"/> </definition> <definition name="registerQuestionsHTML" extends="bharosa.uio.baseLayout"> <put name="body" value="/registerQuestionsHTML.jsp"/> </definition> <definition name="registerUserInfo" extends="bharosa.uio.baseLayout"> <put name="body" value="/registerUserInfo.jsp"/> </definition> <definition name="userPreferences" extends="bharosa.uio.baseLayout"> <put name="body" value="/userPreferences.jsp"/> </definition> <definition name="registrationRequired" extends="bharosa.uio.baseLayout"> <put name="body" value="/registrationRequired.jsp"/> </definition> <definition name="changePassword" extends="bharosa.uio.baseLayout"> <put name="body" value="/changePassword.jsp"/> </definition> <definition name="forgotPassword" extends="bharosa.uio.baseLayout"> <put name="body" value="/forgotPassword.jsp"/> </definition> <definition name="userInput" extends="bharosa.uio.baseLayout"> <put name="body" value="/userInput.jsp"/> </definition> <!-- challenge User --> <definition name="challengeUser" extends="bharosa.uio.baseLayout"> <put name="body" value="/challengeUser.jsp"/> </definition> <definition name="challengeUserForgotPassword" extends="bharosa.uio.baseLayout"> <put name="body" value="/challengeUser.jsp"/> </definition> <definition name="challengeWait" extends="bharosa.uio.baseLayout"> <put name="body" value="/challengeWait.jsp"/> </definition> <!-- qaExists --> <definition name="qaExists" extends="bharosa.uio.baseLayout"> <put name="body" value="/qaExists.jsp"/> </definition> <!-- register qa done --> <definition name="questRegistered" extends="bharosa.uio.baseLayout"> <put name="body" value="/registerQAdone.jsp"/> </definition> <!-- signon --> <definition name="signon" extends="bharosa.uio.baseLayout"> <put name="body" value="/securityProfile.jsp"/> </definition> <!-- messages --> <definition name="message" extends="bharosa.uio.messageLayout"> <put name="body" value="/message.jsp"/> </definition> </tiles-definitions>
The Struts framework drives the navigation between the user interface pages.
The action definition includes the path, which defines what the URL will be. The login page example is shown.
<action path="/login" type="com.bharosa.uio.actions.LoginAction"> <forward name="success" path="/updateLoginStatus.do" redirect="true"/> <forward name="loginJump" path="/loginJumpPage.jsp" redirect="true"/> <forward name="password" path="password"/> <forward name="challenge" path="/challengeUser.do" redirect="true"/> </action>
In login page example, the URL is http://<server name>/oaam_server/login.do
. The login.do
comes from the path definition of "/login
."The type parameter defines the class that performs the action.The following classes are provided with the sample user pages.
Table 9-1 Action Type Classes
Class Name | Description |
---|---|
com.bharosa.uio.actions.LoginAction |
|
com.bharosa.uio.actions.LoginFailAction |
Displays error message in OAAM Server page. For example, the page could display a login blocked message. |
com.bharosa.uio.actions.ActivityAction |
|
com.bharosa.uio.actions.PasswordAction |
|
com.bharosa.uio.actions.UpdateAuthStatusAction |
Updates the user authentication status and, if appropriate, it triggers pattern data processing. |
com.bharosa.uio.actions.ValidateTrxAction |
|
com.bharosa.uio.actions.FlashFingerprintAction |
|
com.bharosa.uio.actions.LogoutAction |
Logs out the user session and redirects to login page |
com.bharosa.uio.actions.SignOnAction |
|
com.bharosa.uio.actions.RegisterQuestionsAction |
Displays sets of questions which the user can choose and register the correct answer for each. |
com.bharosa.uio.actions.ChangePasswordAction |
|
com.bharosa.uio.actions.ForgotPasswordAction |
|
com.bharosa.uio.actions.UserInputAction |
|
com.bharosa.uio.actions.UserPreferencesDoneAction |
|
com.bharosa.uio.actions.ChallengeUserAction |
Challenges the user by displaying a question-pad with one of the questions already registered by the user |
com.bharosa.uio.actions.ChangeUserNameAction |
|
com.bharosa.uio.actions.MessageAction |
|
com.bharosa.uio.actions.ExitAction |
|
com.bharosa.uio.actions.ErrorAction |
This section shows a struts-config.xml
file.
<struts-config> <!-- ========== Global Forward Definitions ============================== --> <global-forwards> <forward name="session_expired" path="/error.do?action=session_expired" redirect="true"/> <forward name="emptyLoginId" path="/error.do?action=empty" redirect="true"/> <forward name="fail" path="/error.do?action=fail" redirect="true"/> <forward name="invalid_user" path="/error.do?action=invalid_user" redirect="true"/> <forward name="error" path="/error.do?action=error" redirect="true"/> <forward name="block" path="/error.do?action=block" redirect="true"/> <forward name="challenge_block" path="/error.do?action=block" redirect="true"/> <forward name="cookieDisabled" path="/error.do?action=cookieDisabled" redirect="true"/> <forward name="accessDenied" path="/error.do?action=accessDenied" redirect="true"/> <forward name="invalid_request" path="/error.do?action=accessDenied" redirect="true"/> <forward name="user_disabled" path="/error.do?action=disabled" redirect="true"/> <forward name="wrong_answer" path="/error.do?action=wrong_answer" redirect="true"/> <forward name="login" path="/error.do" redirect="true"/> </global-forwards> <!-- ========== Action Mapping Definitions ============================== --> <action-mappings> <!-- action mappings for login --> <action path="/login" type="com.bharosa.uio.actions.LoginAction"> <forward name="success" path="/updateLoginStatus.do" redirect="true"/> <forward name="loginJump" path="/loginJumpPage.jsp" redirect="true"/> <forward name="password" path="password"/> <forward name="passwordFT" path="password"/> <forward name="challenge" path="/challengeUser.do" redirect="true"/> </action> <action path="/loginFail" type="com.bharosa.uio.actions.LoginFailAction"> <forward name="success" path="loginFail"/> </action> <action path="/activity" type="com.bharosa.uio.actions.ActivityAction"> <forward name="success" path="loginSuccess" redirect="true"/> </action> <!-- validate password --> <action path="/password" type="com.bharosa.uio.actions.PasswordAction"> <forward name="success" path="/exit.do"/> <forward name="invalid_user" path="/updateLoginStatus.do" /> <forward name="noproxy" path="/updateLoginStatus.do"/> <forward name="resetPassword" path="/expiredPassword.do" redirect="true" /> </action> <action path="/updateLoginStatus" type="com.bharosa.uio.actions.UpdateAuthStatusAction"> <forward name="success" path="/exit.do"/> <forward name="challenge" path="/challengeUser.do" redirect="true"/> <forward name="registerUser" path="/registerQuestions.do" redirect="true"/> <forward name="registerAuthenticator" path="/registerImage.do" redirect="true"/> <forward name="registerQuestions" path="/registerQuestions.do" redirect="true"/> <forward name="registerQuestionsHTML" path="/registerQuestions.do" redirect="true"/> <forward name="registerUserInfo" path="/registerUserInfo.do" redirect="true"/> <forward name="signon" path="signon" redirect="true"/> </action> <action path="/updateForgotPasswordStatus" type="com.bharosa.uio.actions.UpdateAuthStatusAction" parameter="ForgotPassword"> <forward name="success" path="/resetPassword.do" redirect="true" /> <forward name="challenge" path="/challengeUserForgotPassword.do" redirect="true"/> <forward name="registerUser" path="/registerQuestions.do" redirect="true"/> <forward name="registerQuestions" path="/registerQuestions.do" redirect="true"/> <forward name="registerQuestionsHTML" path="/registerQuestions.do" redirect="true"/> <forward name="registerUserInfo" path="/registerUserInfo.do" redirect="true"/> <forward name="signon" path="signon" redirect="true"/> </action> <action path="/validateTrx" type="com.bharosa.uio.actions.ValidateTrxAction"> <forward name="success" path="/exit.do"/> <forward name="challenge" path="/challengeUserTrx.do" redirect="true"/> </action> <action path="/flashFingerprint" type="com.bharosa.uio.actions.FlashFingerprintAction"> <forward name="success" path="/flashFingerprint.jsp"/> </action> <!-- action mappings for logout --> <action path="/logout" type="com.bharosa.uio.actions.LogoutAction"> <forward name="success" path="/loginPage.jsp" /> </action> <!-- action mappings for signon --> <action path="/signon" type="com.bharosa.uio.actions.SignOnAction"> <forward name="securityProfile" path="/securityProfile.jsp" redirect="true"/> <forward name="securityDone" path="/activity.do" redirect="true"/> </action> <!-- action mappings for security QA --> <action path="/registerQuestions" type="com.bharosa.uio.actions.RegisterQuestionsAction"> <forward name="qaExists" path="qaExists" redirect="true"/> <forward name="registerAuthenticator" path="registerAuthenticator"/> <forward name="registerQuestions" path="registerQuestions"/> <forward name="registerQuestionsHTML" path="registerQuestionsHTML"/> <forward name="registerInfo" path="registerInfo"/> <forward name="registerUserInfo" path="registerUserInfo"/> <forward name="skip" path="/exit.do"/> <forward name="success" path="/exit.do"/> </action> <action path="/registerImage" type="com.bharosa.uio.actions.RegisterQuestionsAction" parameter="RegisterImage"> <forward name="registerAuthenticator" path="registerAuthenticator"/> <forward name="success" path="/exit.do"/> </action> <action path="/registerUserInfo" type="com.bharosa.uio.actions.RegisterQuestionsAction" parameter="RegisterUserInfo"> <forward name="registerUserInfo" path="registerUserInfo"/> <forward name="success" path="/exit.do"/> </action> <action path="/userPreferences" type="com.bharosa.uio.actions.RegisterQuestionsAction" parameter="UserPreferences"> <forward name="registerAuthenticator" path="userPreferences"/> <forward name="registerInfo" path="userPreferences"/> <forward name="registerQuestions" path="registerQuestions"/> <forward name="registerQuestionsHTML" path="registerQuestionsHTML"/> <forward name="registerUserInfo" path="registerUserInfo" /> <forward name="changePassword" path="/changePassword.do" /> <forward name="success" path="userPreferences"/> <forward name="registrationRequired" path="registrationRequired"/> <forward name="exit" path="/exit.do" /> </action> <action path="/changePassword" type="com.bharosa.uio.actions.ChangePasswordAction"> <forward name="changePassword" path="changePassword" /> <forward name="success" path="/userPreferences.do" redirect="true" /> <forward name="exit" path="/exit.do" /> </action> <action path="/resetPassword" type="com.bharosa.uio.actions.ChangePasswordAction" parameter="ResetPassword"> <forward name="changePassword" path="changePassword" /> <forward name="success" path="/exit.do" /> <forward name="updateStatus" path="/updateLoginStatus.do" redirect="true" /> </action> <action path="/expiredPassword" type="com.bharosa.uio.actions.ChangePasswordAction" parameter="ExpiredPassword"> <forward name="changePassword" path="changePassword" /> <forward name="success" path="/exit.do" /> <forward name="updateStatus" path="/updateLoginStatus.do" redirect="true" /> </action> <action path="/forgotPassword" type="com.bharosa.uio.actions.ForgotPasswordAction"> <forward name="forgotPassword" path="forgotPassword" /> <forward name="challenge" path="/challengeUserForgotPassword.do" /> <forward name="success" path="/exit.do" /> <forward name="noproxy" path="/updateForgotPasswordStatus.do" /> </action> <action path="/getUserInput" type="com.bharosa.uio.actions.UserInputAction"> <forward name="showAuthenticator" path="userInput" /> <forward name="success" path="/exit.do" /> </action> <action path="/userPreferencesDone" type="com.bharosa.uio.actions.UserPreferencesDoneAction"> <forward name="success" path="/exit.do"/> <forward name="exit" path="/exit.do" /> </action> <!-- action mappings for challenge user --> <action path="/challengeUser" type="com.bharosa.uio.actions.ChallengeUserAction"> <forward name="success" path="/exit.do" /> <forward name="challenge" path="challengeUser"/> <forward name="registerUser" path="/registerQuestions.do" redirect="true"/> <forward name="registerAuthenticator" path="/registerImage.do" redirect="true"/> <forward name="registerQuestions" path="/registerQuestions.do" redirect="true"/> <forward name="registerQuestionsHTML" path="/registerQuestions.do" redirect="true"/> <forward name="registerUserInfo" path="/registerUserInfo.do" redirect="true"/> <forward name="wait" path="challengeWait"/> </action> <action path="/challengeUserTrx" type="com.bharosa.uio.actions.ChallengeUserAction" parameter="transaction"> <forward name="success" path="/exit.do" /> <forward name="challenge" path="challengeUser"/> <forward name="registerUser" path="/registerQuestions.do" redirect="true"/> <forward name="registerAuthenticator" path="/registerImage.do" redirect="true"/> <forward name="registerQuestions" path="/registerQuestions.do" redirect="true"/> <forward name="registerQuestionsHTML" path="/registerQuestions.do" redirect="true"/> <forward name="registerUserInfo" path="/registerUserInfo.do" redirect="true"/> <forward name="wait" path="challengeWait"/> </action> <action path="/challengeUserForgotPassword" type="com.bharosa.uio.actions.ChallengeUserAction" parameter="ForgotPassword"> <forward name="success" path="/resetPassword.do" redirect="true"/> <forward name="forgotPassword" path="forgotPassword" /> <forward name="challenge" path="challengeUserForgotPassword"/> <forward name="wait" path="challengeWait"/> </action> <action path="/changeUserId" type="com.bharosa.uio.actions.ChangeUserNameAction"> <forward name="success" path="/exit.do" /> </action> <!-- action mappings for message --> <action path="/message" type="com.bharosa.uio.actions.MessageAction"> <forward name="success" path="message"/> </action> <action path="/exit" type="com.bharosa.uio.actions.ExitAction"> <forward name="success" path="/empty.jsp"/> </action> <action path="/error" type="com.bharosa.uio.actions.ErrorAction"> <forward name="login" path="/loginPage.jsp" redirect="true" /> </action> </action-mappings> <!--The Tiles Request Processor for processing all the Tile requests--> <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/> <!-- message resources --> <message-resources parameter="proxyweb" null="false"/> <!-- tiles plug-in --> <plug-in className="org.apache.struts.tiles.TilesPlugin"> <set-property property="definitions-config" value="/WEB-INF/tiles-def.xml,/WEB-INF/tiles-def-extension.xml"/> <set-property property="definitions-debug" value="0"/> <set-property property="definitions-parser-details" value="0"/> <set-property property="definitions-parser-validate" value="true"/> <set-property property="moduleAware" value="true"/> </plug-in> </struts-config>