How to Extend a View Object in OA Framework

22
How to Extend a View Object in OA Framework View Objects are the queries that provide the data seen on a Self Service web page. Oracle offers many attributes in each View Object, but often an additional attribute is needed. Oracle allows develope rs to extend the delivered View Objects to meet this need. The following iecruitment Vacancy Search !age will be used for demonstration, but any page developed using the O"# architecture is a candidate for this exercise. $n our example, the !osting%s &ob Title and Organi'ation (ame that were entered during step ) of the Vacancy *reate process are not offered in the delivered VO. These values are shown during data entry in the below screen print. +e will write !-S functions to retrieve them/ our extended VO will then call these functions to return the values so they can be rendered on the page0

Transcript of How to Extend a View Object in OA Framework

Page 1: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 1/22

How to Extend a View Object in OA FrameworkView Objects are the queries that provide the data seen on a Self Service webpage. Oracle offers many attributes in each View Object, but often anadditional attribute is needed. Oracle allows developers to extend thedelivered View Objects to meet this need. The following iecruitment Vacancy

Search !age will be used for demonstration, but any page developed using theO"# architecture is a candidate for this exercise.

$n our example, the !osting%s &ob Title and Organi'ation (ame that wereentered during step ) of the Vacancy *reate process are not offered in thedelivered VO. These values are shown during data entry in the below screenprint. +e will write !-S functions to retrieve them/ our extended VO willthen call these functions to return the values so they can be rendered on thepage0

Page 2: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 2/22

$n order to find which VO to extend, the page definition must be analy'ed.There is a distinct VO behind the fields shown in the results table. Only aportion of the available fields are shown by default. *lic1 the 2"bout this !age2lin1 in the lower left corner to see the page definition.

*lic1 3xpand "ll and find the esults Table0

*lic1 the $rcVacancyVO lin1 to see the View Object 4etails0

Page 3: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 3/22

"ny attribute listed on this page can be added 2declaratively2, or withoutprogramming required by personali'ing the results table. 5ou%re are not limitedto what Oracle provides in the delivered View Objects, however, as you willsoon come to 1now.

#or our example, we will be extending theoracle.apps.per.irc.vacancy.server.$rcVacancyVO View Object. 3xtending a ViewObject involves the following steps0

6. $mporting the delivered View Object into &4eveloper7. $mporting dependent classes into &4eveloper8. 3xtending the View Object). 4eploying the 3xtended VO to the application server9. "dd extended VO columns to the page using personali'ations

To find the version of &4eveloper that%s right for you, see (ote0)6:;<=.6 or

;=;7<>.6 ?newer@ on Aetalin1 titled 2Bow to find the correct version of&4eveloper to use with eCusiness Suite 66i or elease 672.

Open &4eveloper and *reate a new O" +or1space and project following thesesteps. (aturally, my wor1space and project is called %hac1%0

Page 4: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 4/22

$t is best practice to place extended objects in a custom pac1age. $f you areextending an object in the delivered pac1ageoracle.apps.per.irc.vacancy.server, the custom pac1age would behack.oracle.apps.per.irc.vacancy.server

Page 5: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 5/22

*ontinue to step 8 and specify a 4C* file. This file is found on the applicationtier at D#(4ETO!-secure. $t must be copied to*0F&43VO"#FjdevbinFjdevFmultiFsystemFoaFdbcEfilesFsecure on your localmachine, where 2&43VO"#2 is the directory where you installed &4eveloper.3nter an Oracle "pplications user and valid short name and responsibility 1ey

before finishing0

Page 6: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 6/22

+hen you have finished marveling over your newly created project, right clic1it and choose 2(ew Cusiness *omponents20

Page 7: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 7/22

$f you don%t have a connection to use already defined, follow these steps belowto create a new one. The connection name is arbitrary0

Page 8: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 8/22

3nter a Valid Oracle "pplications user name-password0

Test and #inish0

Page 9: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 9/22

*lic1 #inish and return to the (avigator. The custom pac1age where theextended VO will be created is complete, but we must import the delivered VObefore continuing. These files are stored in the D&"V"ETO! directory on theapplication ?middle@ tier and must be downloaded. Since we are extending theView Object ?VO@ oracle.apps.per.irc.vacancy.server.$rcVacancyVO, we mustimport the oracle.apps.per.irc.vacancy.server paca1ge and all dependent

pac1ages. $n order to do this efficiently, $ perform the following steps0

6. telnet to middle tier7. cd D&"V"ETO!-oracle-apps8. tar Gcvf otaEtop.tar ota). tar Gcvf perEtop.tar per9. tar Gcvf payEtop.tar pay:. tar Gcvf benEtop.tar ben ... repeat for as many modules as you might need;. #T! each .tar to *0F&43VO"#FjdevhomeFjdevFmyclasses=. extract each .tar in the *0F&43VO"#FjdevhomeFjdevFmyclasses directory

Once this tas1 is complete, right clic1 your project and 2$mport Cusiness*omponents...2

Page 10: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 10/22

and answer 25es2 when presented with the dialog 2The following HA file is onthe classpath.+ould you li1e to add these objects to your projectI2

Page 11: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 11/22

Jpon importing the first pac1age, you may see an information message tellingyou that additional pac1ages are needed. $n this example, import theoracle.apps.per.schema.server ?server.xml@ pac1age next. epeat this processuntil no additional messages appear.

$f you see an $nformation message li1e the following, it means that theserver.xml has defined a file not contained in the classpath directory. $t can beignored/ if it really bothers you, open an S and request that Oracle fix theserver.xml file.

Page 12: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 12/22

Ce sure to close &4eveloper and reGopen after importing all pac1ages. 5ou maysee an additional warning to import more. 5our project will loo1 li1e thefollowing0

+e must now create a new View Object in our custom pac1age that extendsthe delivered VO. " common practice is to use a !-S function for the newcolumn so that any custom logic can be maintained easily. ather than reGimplementing the VO extension, the !-S can be updated anytime thebusiness rules change.

Cefore proceeding in &4eveloper, lettuce first create the !-S function0

!ac1age spec0

create or replace package hack_jdev_pkg as--

function get_vac_posting_org (p_vacancy_id in number) return varchar2;

--

function get_vac_posting_job (p_vacancy_id in number) return varchar2;--

end hack_jdev_pkg;/show errors;

!ac1age body0

create or replace package body hack_jdev_pkg as

--

Page 13: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 13/22

cursor c_vacancy_posting_data (cp_posting_id number) is

  select org_name

  job_title  from irc_posting_contents_vl ipcv

  per_vacancies pv

  where pv!primary_posting_id " cp_posting_id  and pv!primary_posting_id " ipcv!posting_content_id;

--

cursor c_posting_id (cp_vacancy_id number) is  select primary_posting_id

  from per_all_vacancies

  where vacancy_id " cp_vacancy_id;

--function get_vac_posting_org (p_vacancy_id in number) return varchar2 is

--

ln_posting_id number;

rec_vac_posting_data c_vacancy_posting_data#rowtype;--

 begin  --

  open c_posting_id (p_vacancy_id);

  fetch c_posting_id into ln_posting_id;  close c_posting_id;

  --

  open c_vacancy_posting_data (ln_posting_id);

  fetch c_vacancy_posting_data into rec_vac_posting_data;  if c_vacancy_posting_data#notfound then

  rec_vac_posting_data $" null;

  end if;  close c_vacancy_posting_data;

  --

  return rec_vac_posting_data!org_name;  --

end get_vac_posting_org;

--

function get_vac_posting_job (p_vacancy_id in number) return varchar2 is--

ln_posting_id number;

rec_vac_posting_data c_vacancy_posting_data#rowtype;--

 begin

  --  open c_posting_id (p_vacancy_id);

  fetch c_posting_id into ln_posting_id;

  close c_posting_id;

  --

Page 14: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 14/22

  open c_vacancy_posting_data (ln_posting_id);

  fetch c_vacancy_posting_data into rec_vac_posting_data;

  if c_vacancy_posting_data#notfound then  rec_vac_posting_data $" null;

  end if;

  close c_vacancy_posting_data;  --

  return rec_vac_posting_data!job_title;

  --end get_vac_posting_job;

--

end hack_jdev_pkg;

/show errors;

ight clic1 the project and create a new View Object0

(ame your new VO/ the best practice is to give it a prefix before the deliveredname. Ce sure to enter oracle.apps.per.irc.vacancy.server.$rcVacancyVO in the23xtends2 field.

Page 15: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 15/22

*ontinue to step 8 and clic1 (ew and configure as shown in the following twoscreen prints. This is the actual extension to the VO where the values fromStep ) of the Vacancy *reate process are added to the VO0

Page 16: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 16/22

Page 17: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 17/22

Aa1e and ebuild your project0

The remaining steps are0

6. upload substitution to database7. deploy &ava and .xml files to middle tier8. bounce "pache). !ersonali'e page to display new items

Page 18: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 18/22

Page 19: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 19/22

Page 20: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 20/22

Page 21: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 21/22

Page 22: How to Extend a View Object in OA Framework

8/9/2019 How to Extend a View Object in OA Framework

http://slidepdf.com/reader/full/how-to-extend-a-view-object-in-oa-framework 22/22

5ayGyeah...you are now an Oracle Bac10

(ow challenge yourself by repeating the personali'ations for the !ostingOrgani'ation without the assistance of screen prints. 4uplicate this effort onanother Self Service page to practice your newly minted VO substitutionhac1ing capabilities.