DBA Data[Home] [Help]

PACKAGE BODY: APPS.IRC_WEB

Source


1 package body irc_web as
2 /* $Header: ircweb.pkb 120.0 2005/07/26 15:02:28 mbocutt noship $ */
3 
4 procedure show_vacancy (M in VARCHAR2) is
5 
6     l_text                  varchar2(2000);
7     l_parameters            icx_on_utilities.v80_table;
8     l_url                   varchar2(2000);
9     l_vacancy_id varchar2(30);
10     l_posting_id varchar2(30);
11     l_function_name fnd_form_functions.function_name%type;
12     --
13     l_b boolean;
14     --
15     cursor csr_posting(p_vac_id number) is
16       select to_char(pra.posting_content_id)
17       from per_recruitment_activities pra
18       ,per_recruitment_activity_for prf
19       where prf.vacancy_id=p_vac_id
20       and pra.recruitment_activity_id=prf.recruitment_activity_id
21       and pra.posting_content_id is not null
22       order by pra.date_start;
23 begin
24 --
25   l_b:= icx_sec.validateSession(c_validate_only=>'Y');
26 --
27   l_function_name:=fnd_profile.value('IRC_JOB_NOTIFICATION_URL');
28 --
29   l_text := icx_call.decrypt(M);
30   icx_on_utilities.unpack_parameters(l_text,l_parameters);
31   l_vacancy_id:=l_parameters(1);
32 --
33   open csr_posting(to_number(l_vacancy_id));
34   fetch csr_posting into l_posting_id;
35   close csr_posting;
36 --
37   if (fnd_function.test(l_function_name)) then
38 -- for createExecLink, p_url_only must be N to not get the link html
39     l_url:=icx_portlet.createExecLink
40     (p_function_id=>fnd_function.get_function_id(l_function_name)
41     ,p_application_id=>fnd_global.resp_appl_id
42     ,p_responsibility_id=>fnd_global.resp_id
43     ,p_security_group_id=>fnd_global.security_group_id
44     ,p_parameters=>'p_svid='||l_vacancy_id||'&'||'p_spid='||l_posting_id
45     ,p_url_only=>'Y'
46     ,p_link_name=>'Not needed'
47     );
48   else
49 -- for createExecLink2, p_url_only must be Y to not get the link html
50     l_url:=icx_portlet.createExecLink2
51     (p_function_name=>l_function_name
52     ,p_application_short_name=>'PER'
53     ,p_responsibility_key=>'IRC_EXT_SITE_VISITOR'
54     ,p_security_group_key=>'STANDARD'
55     ,p_parameters=>'p_svid='||l_vacancy_id||'&'||'p_spid='||l_posting_id
56     ,p_url_only=>'Y'
57     ,p_link_name=>'Not needed'
58     );
59   end if;
60   htp.p('<META HTTP-EQUIV=Refresh CONTENT="1; URL='||l_url||'">');
61 
62 END show_vacancy;
63 
64 --
65 -- this procedure is only included for backwards compatibility with the party links.
66 --
67 
68 procedure show_candidate (M in VARCHAR2) is
69 
70     l_text                  varchar2(2000);
71     l_parameters            icx_on_utilities.v80_table;
72     l_url                   varchar2(2000);
73     l_party_id varchar2(30);
74     l_function_name fnd_form_functions.function_name%type;
75     l_session_id number;
76     --
77     l_b boolean;
78     cursor c1 is
79     select person_id
80     from per_all_people_f
81     where party_id=l_party_id
82     and business_group_id=fnd_profile.value('IRC_REGISTRATION_BG_ID');
83     --
84     cursor c2 is
85     select person_id
86     from per_all_people_f
87     where party_id=l_party_id
88     order by effective_start_date;
89     --
90     l_person_id number;
91 begin
92 --
93   l_b:= icx_sec.validateSession(c_validate_only=>'Y');
94 --
95   l_function_name:=fnd_profile.value('IRC_SUITABLE_SEEKERS_URL');
96 --
97   l_text := icx_call.decrypt(M);
98   icx_on_utilities.unpack_parameters(l_text,l_parameters);
99   l_party_id:=l_parameters(1);
100   open c1;
101   fetch c1 into l_person_id;
102   if c1%notfound then
103     close c1;
104     open c2;
105     fetch c2 into l_person_id;
106     close c2;
107   else
108     close c1;
109   end if;
110 
111   l_session_id:=icx_sec.getSessionCookie;
112 
113 OracleApps.runFunction(c_function_id=>fnd_function.get_function_id(l_function_name)
114                       ,n_session_id=>l_session_id
115                       ,c_parameters=>'addBreadCrumb=RP&retainAM=Yp_sprsn='||l_person_id);
116 END show_candidate;
117 
118 procedure show_approval (M in VARCHAR2) is
119 
120     l_text                  varchar2(2000);
121     l_parameters            icx_on_utilities.v80_table;
122     l_url                   varchar2(2000);
123     itemkey varchar2(30);
124     l_function_name fnd_form_functions.function_name%type;
125     itemtype varchar2(30);
126     l_transaction_id varchar2(80);
127     apr_object_type  varchar2(240);
128     approval_process varchar2(4000);
129     l_session_id number;
130   --
131     l_b boolean;
132 begin
133 --
134 -- validate the session (without getting a login prompt
135 -- so that the profile options and so on are available
136 -- in this session
137 --
138   l_b:= icx_sec.validateSession(c_validate_only=>'Y');
139   l_session_id:=icx_sec.getSessionCookie;
140 --
141   l_text := icx_call.decrypt(M);
142   icx_on_utilities.unpack_parameters(l_text,l_parameters);
143   itemkey:=l_parameters(1);
144   --
145   itemtype:=fnd_profile.value('IRC_WORKFLOW_ITEM_TYPE');
146   --
147  l_transaction_id := wf_engine.getItemAttrText
148                  (itemtype => itemtype,
149                   itemkey  => itemkey,
150                   aname    => 'IRC_APPROVE_TRANS_ID');
151   --
152   apr_object_type := wf_engine.getItemAttrText
153                  (itemtype => itemtype,
154                   itemkey  => itemkey,
155                   aname    => 'IRCAPPROVALITEM');
156   --
157   approval_process := wf_engine.getItemAttrText
158                  (itemtype => itemtype,
159                   itemkey  => itemkey,
160                   aname    => 'IRCAPPROVALPROCESS');
161   --
162   l_function_name:=fnd_profile.value('IRC_'||apr_object_type||'_APPROVAL_URL');
163   --
164   -- test to see if the responsibility that we are running in has access to the
165   -- standard function
166   --
167   if not (fnd_function.test(l_function_name)) then
168     -- if we do not have access to the standard function, access one which
169     -- does not have the menus on it.
170     l_function_name:=l_function_name||'_EXT';
171     -- redirect to the function, passing the approval transaction id
172     OracleApps.runFunction(c_function_id=>fnd_function.get_function_id(l_function_name)
173                         ,n_session_id=>l_session_id
174                         ,c_parameters=>'ext=Y&approvalTransactionId=' || l_transaction_id);
175   else
176     -- redirect to the function with menus, passing the approval transaction id
177     OracleApps.runFunction(c_function_id=>fnd_function.get_function_id(l_function_name)
178                         ,n_session_id=>l_session_id
179                         ,c_parameters=>'ext=N&approvalTransactionId=' || l_transaction_id);
180   end if;
181 END show_approval;
182 --
183 procedure correct_approval (M in VARCHAR2) is
184 
185     l_text                  varchar2(2000);
186     l_parameters            icx_on_utilities.v80_table;
187     l_url                   varchar2(2000);
188     itemkey varchar2(30);
189     l_function_name fnd_form_functions.function_name%type;
190     itemtype varchar2(30);
191     l_transaction_id varchar2(80);
192     apr_object_type  varchar2(240);
193     approval_process varchar2(4000);
194     l_session_id number;
195   --
196     l_b boolean;
197 begin
198 --
199 -- validate the session (without getting a login prompt
200 -- so that the profile options and so on are available
201 -- in this session
202 --
203   l_b:= icx_sec.validateSession(c_validate_only=>'Y');
204   l_session_id:=icx_sec.getSessionCookie;
205 --
206   l_text := icx_call.decrypt(M);
207   icx_on_utilities.unpack_parameters(l_text,l_parameters);
208   itemkey:=l_parameters(1);
209   l_function_name:=l_parameters(2);
210   --
211   itemtype:=fnd_profile.value('IRC_WORKFLOW_ITEM_TYPE');
212   --
213   l_transaction_id := wf_engine.getItemAttrText
214                  (itemtype => itemtype,
215                   itemkey  => itemkey,
216                   aname    => 'IRC_APPROVE_TRANS_ID');
217   --
218   apr_object_type := wf_engine.getItemAttrText
219                  (itemtype => itemtype,
220                   itemkey  => itemkey,
221                   aname    => 'IRCAPPROVALITEM');
222   --
223   approval_process := wf_engine.getItemAttrText
224                  (itemtype => itemtype,
225                   itemkey  => itemkey,
226                   aname    => 'IRCAPPROVALPROCESS');
227   --
228   OracleApps.runFunction(c_function_id=>fnd_function.get_function_id(l_function_name)
229                       ,n_session_id=>l_session_id
230                       ,c_parameters=>'correctionTransactionId=' || l_transaction_id);
231 
232 END correct_approval;
233 --
234 end irc_web;