1. Right click on Applications and select New OA Workspace.
2. Set the below values for the Workspace.
Workspace Properties:
Name – Apps88Search.jws
New OA Project – Checked
3. The workspace is created under the default location which is <JDEV_USER_HOME>/myprojects.
4. A new OA Project is created automatically. Set the below values:
Project Properties:
Name – Apps88SearchProject
Default Package – apps88.oracle.apps.fnd.search
5. Click Next and select the database connection and test.
11. Click Next and then set the below properties for the Run time connection.
Run Time Connection Details:
DBC File Name - <JDEV_USER_HOME>\dbc_files\secure\<DBSC File Name>.dbc
UserName – Operations
Password – welcome
Application Short Name – FND
Responsibility Key - APPLICATION_DEVELOPER
12. Click Finish. Save your work and in the Application Navigator you will be
seeing a workspace and a project inside that.
13. The structure should look like below:
14. Right click on the project and select New.
15. Select Business Tier → ADF Business Components → Application Module.
16. Set the below values for the AM:
AM Properties:
Name – Apps88SearchAM
Package – apps88.oracle.apps.fnd.search.server
17. Click Next and Finish.
18. Save your work and right click on Project and select → Add to Project Content.
19. Click Add and select only the apps88 folder and click Ok. This step will make sure that only the apps88 package will be available in the project
20. In the Application Navigator you will notice only the apps88 package.
21. Right click on the project and select New. Select Business Tier → ADF
Business Components → Entity Object.
22. Set the below values for the EO:
EO Properties:
Name – EmployeeEO
Package – apps88.oracle.apps.fnd.search.server
Schema Object – EMP
23. Click Next.
24. All the attributes from the EMP table will be displayed. The EO should
always contain the entire attributes from the table. Set the primary key for at least one column.
25. Click Next.
26. In the Java methods check the Create, Delete and Validation methods
27. Click Next and Finish.
28. Right click on apps88.oracle.apps.fnd.search.server and select → New Entity Object.
29. Set the below values:
EO Properties:
Name – DepartmentEO
Package – apps88.oracle.apps.fnd.search.server
Schema Object – DEPT
30. All attributes in the Dept table will be displayed.
31. Click Next.
33. Click Next and Finish.
34. Right click on apps88.oracle.apps.schema.server and select New →
Association.
35. An Association Object is created here in order to join the Emp and Dept table so that we get the Department Name as well in the details.
36. Set the below values:
AO Properties:
Name – EmpToDeptAO
Package – apps88.oracle.apps.fnd.search.server
37. Click Next and select the below values:
Cardinality - * to 0..1
Source Attribute – Deptno(EmployeeEO)
Destination Attribute – Deptno ( DepartmentEO)
38. Click Add and then Next and Finish
40. Right click on apps88.oracle.apps.search.server and select new → View Object.
41. Set the below values:
VO Properties:
Name – EmpDetailsVO
Package – apps88.oracle.apps.search.server
42. Click Next. Select the EmployeeEO and DepartmentEO and shuttle it to the
right side. Set the Association for DepartmentEO as EmpToDeptAO.DepartmemtEO1. Check the Updatable.
43. Click Next.
44. From the EmployeeEO select Empno, Ename,Sal,Job, Hiredate,Comm and from DepartmentEO select Dname,Loc and Deptno.
45. Click Next. In the SQL statement click on Expert Mode and use the below
query:
SQL Query:
SELECT EmployeeEO.EMPNO,
EmployeeEO.ENAME,
DepartmentEO.DEPTNO,
DepartmentEO.DNAME,
DepartmentEO.LOC,
EmployeeEO.JOB,
EmployeeEO.MGR,
EmployeeEO.HIREDATE,
EmployeeEO.SAL,
EmployeeEO.COMM
FROM DEPT DepartmentEO, EMP EmployeeEO
WHERE DepartmentEO.DEPTNO = EmployeeEO.DEPTNO
46. Click Next and in the Java methods check EmpDetailsRowImpl.java and click Finish. Oracle standard is to always create the rowImpl.java file for the VO's which will improve the performance.
47. Right click on Apps88SearchAM and click Edit Apps88SearchAM. Whenever a VO is created it needs to be associated with the AM before use.
48. Shuttle the EmpDetailsVO to the right side and click Ok.
49. Right click on the project and select New.
50. In Web Tier → OA Components select Page.
51. Set the below values:
Page Properties:
Name – EmployeeManagerPG
Package – apps88.oracle.apps.fnd.search.webui
52. In the structure pane of EmployeeManagerPG, set the below properties for region1.
Region1 properties:
Id – PageLayoutRN
AM Definition – apps88.oracle.apps.fnd.search.server.apps88searchAM
Window Title – Oracle Application Search Page
Page Title – Search Employee
53. Right click PageLayoutRN and select New → Region.
54. Set the below properties
QueryRN properties:
Id – QueryRN
Region Style – query
Construction Mode – autoCustomizationCriteria
55. Right click on QueryRN and select New → Region using wizard.
56. Select the Apps88SearchAM and then select EmpDetailsVO1 and click Next.
57. Set the Region Id as ResultsTable and Region Style as table. Click Next.
58. Shuttle all the attributes to the right side.
59. Change the item style of all the attributes to messageStyledText and set the Prompt as per the screen shot. Click Next and finish.
60. Set the Width of ResultsTable to 100%.
61. Right click on QueryRN and select new → simpleSearchPanel.
62. Set the header Id to SimpleSearchHeader.
63. Right click Region1 and select new → messageTextInput.
64. Set the below properties
MessageTextInput Properties:
Id – SearchEmpName
Prompt – Name
65. Right click Region1 and select new → messageTextInput.
66. Set the below properties
MessageTextInput Properties:
Id – SearchEmpNo
Prompt – Number
67. Right click on QueryRN and select new → simpleSearchMappings.
68. Set the below properties for the default criteriaMap1.
CriteriaMap1 Properties:
Id – NameMap
Search Item – SearchEmpName
Results Item – Ename
69. Right click simpleSearchMappings and click new → queryCriteriaMap.Set the below properties
CriteriaMap2 Properties:
Id – NoMap
Search Item – SearchEmpNo
Results Item – Empno
70. Save your work and run the EmployeeManagerPG
71. When you are running the page sometimes you will get below errors. Basically OAF assumes, when building Entities against tables, that you have added the standard WHO columns to your table.
In order to fix this problem, add:
LAST_UPDATE_DATE date
LAST_UPDATE_LOGIN integer
LAST_UPDATED_BY integer
CREATION_DATE date
CREATED_BY integer
to your table, and import them into the EO you have created.
72. Click on apps88.oracle.apps.fnd.search.server.DepartmentEO then you will see the DepartmentEO structure.
73. Double click on DepartmentEOImpl.java then implement the methods.
75. Save your work and run the EmployeeManagerPG
Adding Attachments to the Results Table
Attachments can be added in a table or an advanced table where we can attach a file or text or URL. Let us see the steps involved in implementing the attachments.
1. Go to the EmployeeManagerPG and in the Structure pane right click on the
ResultsTable and select New → Item.
2. Set the below properties for the new Item.
ID – Attachment
Item Style – attachmentImage
View Instance – EmployeeVO1
Automatic Save – True
Prompt – Attach
3. A entityMap1 gets created automatically and set its Entity property to apps88.
4. Right click on entityMap1 and select new → primary Keys.
5. Set the below values for the PrimaryKey1.
View Attribute – Empno
6. Save your work and Run the EmployeeManagerPG.
7. You can notice a new column in the ResultsTable .
9. Select a file and click on Apply.
10. A confirmation message is displayed. You can notice a new icon in the Attach column.
1 comment:
Very good document
Post a Comment