Oracle e-Business Suite may require to integrate with third party/custom tool/software to augments the investment in Oracle e-Business Suite and to meet the business requirements.There are large number of third party tool/software available in the market that can be integrate with e-business Suite (for example Org-Plus).
Here we will discuss about how can we provide a hyper-link to oracle application web page through which we can navigate to third party web-page/or any custom created jsp page.
Basic Requirement
We need to provide a hyper-link to "My Employee Information" page so that we can directly access the third party web page via the hyper-link.
The third party sample URL is :-
https://cust-devenv.Client.local/OPE/Access.aspx?user=<Username>&cid=<EmployeeNumber>&rid=<RoleName>&status=valid
Here <Username>,<EmployeeNumber> => needs to be taken from the person who has logged into the system.
<RoleName> => Role Name will be based on the responsibility through which Third Party page will be accessed.
For Manager Self Service Role Name is "XX_Manager".
Pre-Requisite
Following are the pre-requisites for our solution approach
1) The third party web page or Custom page(whichever applicable) already is in place and working properly.
2) Manager Self Service is implemented and working properly
3) Developer has access to personalize the manager self service page.
Solution Approach
To implement the above mentioned business need we will perform the following steps
A) First create a custom jsp page that will read the username and employeenumber from the session and help us to construct the url and redirect to it.
B) Put the jsp file in OA_MEDIA folder and create a form function that will that will open the custom jsp.
C) Personalize the Manager Self Service page to create a hyper-link at a desired place.
Step A
1) Import necessary class files
1A) Now create a javascript function,under the header section of the html, that will redirect the page to the url that we are going to contruct
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<title>Third Party URL Redirect</title>
<script type="text/javascript">
//<![CDATA[
function Redirect(strUrl)
{
//use this code to open popup with default size/diffrent tab in case of IE/Firefox
//window.open(strUrl, '_blank');
//use this code to open window with particular size
window.open(strUrl);
window.history.back();
}
//]]>
</script>
</head>
2) first establish a jdbc connection and fetch userid of the person logged in. The code snippet is given below.
try
{
jspApplContext = WebRequestUtil.validateContext(request,response);
if (jspApplContext == null)
{
out.println("Failed to authenticate session");
return;
}
WebRequestUtil.setClientEncoding(response,jspApplContext);
conOracle = jspApplContext.getJDBCConnection();
if ( conOracle == null )
{
out.println("Failed to get JDBC connection");
return;
}
userId = jspApplContext.getUserId();
}
catch(Exception exception)
{
out.println("<BR> General Error while connecting to database<BR>" + exception);
}
3) Once the connection is successful, we need to fetch the employeenumber and the username from the session.
/* Fetching Username
*/
selectQuery2 =" SELECT user_name from fnd_user ";
selectQuery2 = selectQuery2 + " where user_id = "+userId+" ";
sqlStmt = "stmtQuery2";
if(conOracle != null)
{
try
{
stmtQuery2 = conOracle.createStatement();
fetchRS2 = stmtQuery2.executeQuery(selectQuery2);
while(fetchRS2.next())
{
userName = fetchRS2.getString("user_name");
}
stmtQuery2.close();
}
catch(Exception exception)
{
out.println("Error at SQL Statement2:" + sqlStmt);
out.println("Error:" + exception);
stmtQuery2.close();
}
}
similarly we can find the personid and employeenumber respectively.
4) Once our all the variables are populated, we need to construct the url (as mentioned in the Basic Requirement section).
Note:-Here we have use the RoleName as a parameter since it is depend on the responsibility through which it is accessed.Hence it will be passed from the form function from where our custom jsp page will be called.
ThirdPartyUrl ="https://cust-devenv.Client.local/OPE/Access.aspx?user="+userName;
ThirdPartyUrl =ThirdPartyUrl + "&cid=" + emp_number;
ThirdPartyUrl =ThirdPartyUrl + "&rid="+request.getParameter("RoleName");
ThirdPartyUrl =ThirdPartyUrl + "&status=valid";
5) Now call the javascript function that we created under step 2A to redirect the page to the newly constructed url
<script type="text/javascript">
Redirect( "<%= ThirdPartyUrl %>" );
</script>
</body>
</html>
Step B
1) Save the jsp file(File name:-XXCUSTOMLINK.jsp) and put it under OA_MEDIA. and provide the necessary access grant (chmod 775).
2) Now create a form function,the function details is mentioned below
Note:-Since here we are considering only Manager Self Service hence we need to create only one form function. In real life we may need to give the access to the link to different responsibilities, in that case we will require to create different form function for each of the responsibility.
This is because the RoleName is different for different responsibility.(as per requirement)
The Responsibility and RoleName mapping matrix needs to be provided by the business team.
3) Now add the custom form function to "Global Self Service Functions Customs" and save it.
4) Now add the custom function to the Manager Self Service responsibility Menu.
Step C
1) Now our jsp is ready and also form function is created. Now go to the Manager Self Service >> My Employee Information and click on
Personalize "Manager Views" hyperlink (as shown below)
2) Create an item of "Static Style Text" Type.The details are mentioned below
ID:- TEST_URL_FUNC
Destination Function:- XX_THIRD_PARTY_URL_FUNC
Prompt:- Test URL Function
Keep the other field as it.Click on Apply and save the changes.
3) Bounce apache Server.
Our solution is now ready to test.
Note:- 1) If we don't attach the form function to the "Manager Self Service" menu we will receive the following error message.This is because when we click on the hyperlink it will try to access the form function from the responsibility through which the link was clicked. Now since that responsibility-menu doesn't have that form function attached to it, hence it will throw the error message shown in the picture below
References
Disclaimer:- This is a knowledge sharing site. This topic talks about a custom solution. Oracle may not provide you a support for any data corruption or any other problem in your custom code/problem arises because of the custom code. The author is not responsible for any kind of system/data problem appears because of usages of this code.Reader/implementer must do it on his/her own risk/responsibility.