1 package FND_GLOBAL AUTHID CURRENT_USER as
2 /* $Header: AFSCGBLS.pls 120.10.12020000.1 2012/06/30 13:19:45 appldev ship $ */
3 /*#
4 * Application context related APIs.
5 * The server-side package FND_GLOBAL returns the values of system
6 * globals, such as the login/signon or "session" type of values.
7 * You should not use FND_GLOBAL routines in your forms (that is on
8 * the client side). On the client side, most of the procedures in the
9 * FND_GLOBAL package are replaced by a user profile option with the
10 * same (or a similar) name. You should use FND_PROFILE routines in
11 * your forms instead.
12 * @rep:scope public
13 * @rep:product FND
14 * @rep:displayname Application Context APIs
15 * @rep:compatibility S
16 * @rep:lifecycle active
17 * @rep:ihelp FND/@e_global#e_global See related online help
18 */
19
20 --
21 -- *** Special Char functions ***
22 --
23
24 --
25 -- Local_Chr
26 -- Return specified character in current codeset
27 -- IN
28 -- ascii_chr - chr number in US7ASCII
29 --
30 function Local_Chr(
31 ascii_chr in number)
32 return varchar2;
33 pragma
34 restrict_references
35 (LOCAL_CHR, WNDS, WNPS, RNPS);
36
37
38 --
39 -- Newline
40 -- Return newline character in current codeset
41 --
42 function Newline
43 return varchar2;
44 pragma restrict_references (NEWLINE, WNDS, WNPS, RNPS);
45
46 --
47 -- Tab
48 -- Return tab character in current codeset
49 --
50 function Tab
51 return varchar2;
52 pragma restrict_references (TAB, WNDS, WNPS, RNPS);
53
54 --
55 -- *** Session Globals ***
56 --
57
58 --
59 -- USER_ID - Return user id
60 --
61
62 /*#
63 * Returns user id.
64 * @return user ID
65 * @rep:scope public
66 * @rep:displayname Get User_ID
67 * @rep:compatibility S
68 * @rep:category BUSINESS_ENTITY FND_USER
69 * @rep:lifecycle active
70 * @rep:ihelp FND/@e_global See related online help.
71 */
72 function USER_ID return number;
73 pragma restrict_references (USER_ID, WNDS, WNPS, RNDS);
74
75 --
76 -- RESP_ID - Return responsibility id
77 --
78 function RESP_ID return number;
79 pragma restrict_references (RESP_ID, WNDS, WNPS, RNDS);
80
81 --
82 -- RESP_APPL_ID - Return responsibility application id
83 --
84 function RESP_APPL_ID return number;
85 pragma restrict_references (RESP_APPL_ID, WNDS, WNPS, RNDS);
86
87 --
88 -- SECURITY_GROUP_ID - Return security group id
89 --
90 function SECURITY_GROUP_ID return number;
91 pragma restrict_references (SECURITY_GROUP_ID, WNDS, WNPS, RNDS);
92
93 --
94 -- USER_NAME - Return user name
95 --
96 function USER_NAME return varchar2;
97 pragma restrict_references (USER_NAME, WNDS, WNPS, RNDS);
98
99 --
100 -- RESP_NAME - Return responsibility name
101 --
102 function RESP_NAME return varchar2;
103 pragma restrict_references (RESP_NAME, WNDS, WNPS);
104
105 --
106 -- APPLICATION_NAME - Return responsibility application name
107 --
108 function APPLICATION_NAME return varchar2;
109 pragma restrict_references (APPLICATION_NAME, WNDS, WNPS);
110
111 --
112 -- APPLICATION_SHORT_NAME - Return responsibility application short name
113 --
114 function APPLICATION_SHORT_NAME return varchar2;
115 pragma restrict_references (APPLICATION_SHORT_NAME, WNDS, WNPS, RNDS);
116
117 --
118 -- LOGIN_ID - Return login id (unique per signon)
119 --
120
121
122
123 /*#
124 * Returns login ID(unique per signon).
125 * @return login ID
126 * @rep:scope public
127 * @rep:displayname Get Login ID
128 * @rep:compatibility S
129 * @rep:category BUSINESS_ENTITY FND_USER
130 * @rep:lifecycle active
131 * @rep:ihelp FND/@e_global See related online help.
132 */
133 function LOGIN_ID return number;
134 pragma restrict_references (LOGIN_ID, WNDS, WNPS, RNDS);
135
136 --
137 -- CONC_LOGIN_ID - Return conc. program login id
138 --
139
140
141 /*#
142 * Returns concurrent program login ID.
143 * @return concurrent program login ID
144 * @rep:scope public
145 * @rep:displayname Get Conc_Login ID
146 * @rep:category BUSINESS_ENTITY FND_APPS_CTX
147 * @rep:compatibility S
148 * @rep:lifecycle active
149 * @rep:ihelp FND/@e_global See related online help.
150 */
151
152 function CONC_LOGIN_ID return number;
153 pragma restrict_references (CONC_LOGIN_ID, WNDS, WNPS, RNDS);
154
155 --
156 -- PROG_APPL_ID - Return conc. program application id
157 --
158
159
160 /*#
161 * Returns concurrent program Application ID.
162 * @return concurrent program Aplication ID
163 * @rep:scope public
164 * @rep:displayname Get Conc_Appl_ID
165 * @rep:category BUSINESS_ENTITY FND_APPS_CTX
166 * @rep:compatibility S
167 * @rep:lifecycle active
168 * @rep:ihelp FND/@e_global See related online help.
169 */
170 function PROG_APPL_ID return number;
171 pragma restrict_references (PROG_APPL_ID, WNDS, WNPS, RNDS);
172
173 --
174 -- CONC_PROGRAM_ID - Return conc. program id
175 --
176 /*#
177 * Returns concurrent program ID.
178 * @return concurrent Program ID
179 * @rep:scope public
180 * @rep:displayname Get Conc_Program_ID
181 * @rep:compatibility S
182 * @rep:category BUSINESS_ENTITY FND_APPS_CTX
183 * @rep:lifecycle active
184 * @rep:ihelp FND/@e_global See related online help.
185 */
186 function CONC_PROGRAM_ID return number;
187 pragma restrict_references (CONC_PROGRAM_ID, WNDS, WNPS, RNDS);
188
189 --
190 -- CONC_REQUEST_ID - Return conc. request id
191 --
192 /*#
193 * Returns concurrent Request ID.
194 * @return concurrent request ID
195 * @rep:scope public
196 * @rep:displayname Get Conc_Request_ID
197 * @rep:compatibility S
198 * @rep:category BUSINESS_ENTITY FND_APPS_CTX
199 * @rep:lifecycle active
200 * @rep:ihelp FND/@e_global See related online help.
201 */
202 function CONC_REQUEST_ID return number;
203 pragma restrict_references (CONC_REQUEST_ID, WNDS, WNPS, RNDS);
204
205 --
206 -- CONC_PRIORITY_REQUEST - Return conc. priority request id
207 --
208 function CONC_PRIORITY_REQUEST return number;
209 pragma restrict_references (CONC_PRIORITY_REQUEST, WNDS, WNPS, RNDS);
210
211 --
212 -- PER_BUSINESS_GROUP_ID - Return HR business group id
213 --
214 function PER_BUSINESS_GROUP_ID return number;
215 pragma restrict_references (PER_BUSINESS_GROUP_ID, WNDS, WNPS, RNDS);
216
217 --
218 -- PER_SECURITY_PROFILE_ID - Return HR security profile id
219 --
220 function PER_SECURITY_PROFILE_ID return number;
221 pragma restrict_references (PER_SECURITY_PROFILE_ID, WNDS, WNPS, RNDS);
222
223 --
224 -- LANGUAGE_COUNT - Return number of installed languages
225 --
226 function LANGUAGE_COUNT return number;
227 pragma restrict_references (LANGUAGE_COUNT, WNDS);
228
229 --
230 -- CURRENT_LANGUAGE - Return current language (language code)
231 --
232 function CURRENT_LANGUAGE return varchar2;
233 pragma restrict_references (CURRENT_LANGUAGE, WNDS, WNPS, RNPS);
234
235 --
236 -- BASE_LANGUAGE - Return base language (language code)
237 --
238 function BASE_LANGUAGE return varchar2;
239 pragma restrict_references (BASE_LANGUAGE, WNDS);
240
241 --
242 -- RT_TEST_ID - Return rt test id
243 --
244 function RT_TEST_ID return number;
245 pragma restrict_references (RT_TEST_ID, WNDS, WNPS, RNDS);
246
247
248 --
249 -- RT INITIALIZE
250 -- Set RT test id
251 -- INTERNAL AOL USE ONLY
252 --
253 procedure RT_INITIALIZE(rt_test_id in number);
254
255 --
256 -- SET_SECURITY_GROUP_ID_CONTEXT
257 -- Set the FND.SECURITY_GROUP_ID for SYS_CONTEXT as used by SECURITY_GROUP_ID_POLICY
258 -- INTERNAL AOL USE ONLY
259 --
260 procedure SET_SECURITY_GROUP_ID_CONTEXT(security_group_id in number);
261
262 --
263 -- SECURITY_GROUP_ID_POLICY
264 -- Return the security_group_id where clause for the SECURITY_GROUP_ID policy
265 -- INTERNAL AOL USE ONLY
266 --
267 function SECURITY_GROUP_ID_POLICY(d1 varchar2, d2 varchar2) return varchar2;
268 pragma restrict_references (SECURITY_GROUP_ID_POLICY, WNDS);
269
270 --
271 -- APPS_INITIALIZE - Setup PL/SQL security context
272 --
273 -- This procedure may be called to initialize the global security
274 -- context for a database session. This should only be done when
275 -- the session is established outside of a normal forms or
276 -- concurrent program connection.
277 --
278 -- IN
279 -- FND User ID
280 -- FND Responsibility ID (two part key, resp_id / resp_appl_id)
281 -- FND Security Group ID
282 --
283
284
285 /*#
286 * Sets up global variables and profile values in a database
287 * session. Call this procedure to initialize the global security context
288 * for a database session.This routine should only be used when a
289 * session must be established outside of a normal form or concurrent
290 * program connection.
291 * @param user_id User ID
292 * @param resp_id Responsibility ID
293 * @param resp_appl_id Application ID to which responsibility belongs
294 * @param security_group_id Security group ID
295 * @param server_id Server ID
296 * @rep:scope public
297 * @rep:displayname Initialize Globals
298 * @rep:compatibility S
299 * @rep:category BUSINESS_ENTITY FND_APPS_CTX
300 * @rep:lifecycle active
301 * @rep:ihelp FND/@e_global See related online help.
302 */
303
304
305
306 procedure APPS_INITIALIZE(
307 user_id in number,
308 resp_id in number,
309 resp_appl_id in number,
310 security_group_id in number default 0,
311 server_id in number default -1);
312
313 --
314 -- INITIALIZE
315 -- Set new values for security globals when new login or responsibility
316 -- INTERNAL AOL USE ONLY
317 --
318 procedure INITIALIZE(session_id in out nocopy number,
319 user_id in number,
320 resp_id in number,
321 resp_appl_id in number,
322 security_group_id in number,
323 site_id in number,
324 login_id in number,
325 conc_login_id in number,
326 prog_appl_id in number,
327 conc_program_id in number,
328 conc_request_id in number,
329 conc_priority_request in number,
330 form_id in number default null,
331 form_appl_id in number default null,
332 conc_process_id in number default null,
333 conc_queue_id in number default null,
334 queue_appl_id in number default null,
335 server_id in number default -1);
336
337
338 --
339 -- AUDIT_ACTIVE
340 --
341 -- Description: Returns TRUE if the audittrail profile option is on,
342 -- or FALSE otherwise. When this function is invoked for
343 -- the first time, the profile value will be cached in a
344 -- global variable to avoid the performande hit of having
345 -- to fetch it each time.
346 -- Added by Jan Smith. June, 1999 bug number 879630.
347 function AUDIT_ACTIVE return BOOLEAN;
348 pragma restrict_references (AUDIT_ACTIVE, WNDS);
349
350 -- SET_NLS_CONTEXT
351 --
352 -- Description: Calls alter session to set the following values in DB.
353 -- NLS_LANGUAGE, NLS_DATE_FORMAT,NLS_DATE_LANGUAGE,
354 -- NLS_NUMERIC_CHARACTERS.
355
356 procedure set_nls_context(
357 p_nls_language in varchar2 default null,
358 p_nls_date_format in varchar2 default null,
359 p_nls_date_language in varchar2 default null,
360 p_nls_numeric_characters in varchar2 default null,
361 p_nls_sort in varchar2 default null,
362 p_nls_territory in varchar2 default null
363 );
364
365 procedure set_nls(
366 p_nls_language in varchar2 default null,
367 p_nls_date_format in varchar2 default null,
368 p_nls_date_language in varchar2 default null,
369 p_nls_numeric_characters in varchar2 default null,
370 p_nls_sort in varchar2 default null,
371 p_nls_territory in varchar2 default null,
372 p_db_nls_language out nocopy varchar2,
373 p_db_nls_date_format out nocopy varchar2,
374 p_db_nls_date_language out nocopy varchar2,
375 p_db_nls_numeric_characters out nocopy varchar2,
376 p_db_nls_sort out nocopy varchar2,
377 p_db_nls_territory out nocopy varchar2,
378 p_db_nls_charset out nocopy varchar2
379 );
380
381 --
382 -- Lookup_Security_Group
383 -- Get Security Group Id from which to retrieve lookup type.
384 -- This will either be the current security group, or default to the
385 -- STANDARD security group (id=0) if lookup type not defined
386 -- in current security group.
387 -- IN
388 -- lookup_type
389 -- view_application_id
390 -- RETURNS
391 -- Security_group_id of lookup type to use (current or STANDARD).
392 -- NOTE
393 -- This function is used by FND_LOOKUPS and related views to
394 -- improve performance.
395 --
396 function Lookup_Security_Group(
397 lookup_type in varchar2,
398 view_application_id in number)
399 return number;
400 pragma restrict_references(Lookup_Security_Group, WNDS, WNPS);
401
402 function Get_Session_Context
403 return number;
404 pragma restrict_references(Get_Session_Context, WNDS, WNPS, RNDS);
405
406 function Compare_Session_Context(context_id in number)
407 return boolean;
408 pragma restrict_references(Compare_Session_Context, WNDS, WNPS, RNDS);
409
410 function Assert_No_Pool return boolean;
411
412
413 appl_context_change boolean := FALSE;
414 resp_context_change boolean := FALSE;
415 user_context_change boolean := FALSE;
416 nls_context_change boolean := FALSE;
417 sec_context_change boolean := FALSE;
418 session_context number := 0;
419 no_pool number := null;
420
421 --
422 -- EMPLOYEE_ID - Return employee id of current user
423 -- * NOTE: Employee_id is a foreign key to PER_PEOPLE_F.PERSON_ID
424 --
425 function EMPLOYEE_ID return number;
426 pragma restrict_references (EMPLOYEE_ID, WNDS, WNPS, RNDS);
427
428 --
429 -- CUSTOMER_ID - Return customer id of current user
430 -- * NOTE: Customer_id is a foreign key to HZ_PARTIES.PARTY_ID.
431 --
432 function CUSTOMER_ID return number;
433
434 --
435 -- SUPPLIER_ID - Return supplier id of current user
436 -- * NOTE: Supplier_id is a foreign key to
437 -- PO_VENDOR_CONTACTS.VENDOR_CONTACT_ID
438 --
439 function SUPPLIER_ID return number;
440
441
442 --
446 pragma restrict_references (FORM_ID, WNDS, WNPS, RNDS);
443 -- FORM_ID - Return form id
444 --
445 function FORM_ID return number;
447
448 --
449 -- FORM_APPL_ID - Return form application id
450 --
451 function FORM_APPL_ID return number;
452 pragma restrict_references (FORM_APPL_ID, WNDS, WNPS, RNDS);
453
454 --
455 -- CONC_PROCESS_ID - Return conc process id
456 --
457 function CONC_PROCESS_ID return number;
458 pragma restrict_references (CONC_PROCESS_ID, WNDS, WNPS, RNDS);
459
460 --
461 -- CONC_QUEUE_ID - Return conc queue id
462 --
463 function CONC_QUEUE_ID return number;
464 pragma restrict_references (CONC_QUEUE_ID, WNDS, WNPS, RNDS);
465
466 --
467 -- QUEUE_APPL_ID - Return conc queue appl id
468 --
469 function QUEUE_APPL_ID return number;
470 pragma restrict_references (QUEUE_APPL_ID, WNDS, WNPS, RNDS);
471
472 --
473 -- SESSION_ID - Return session id
474 --
475 function SESSION_ID return number;
476 pragma restrict_references (SESSION_ID, WNDS, WNPS, RNDS);
477
478 server_context_change boolean := FALSE;
479 org_context_change boolean := FALSE;
480
481 --
482 --SERVER_ID - Return user id
483 --
484 function SERVER_ID return number;
485
486 --
487 --ORG_ID - Return user id
488 --
489 function ORG_ID return number;
490
491 --
492 -- ORG_NAME - Return organization name
493 --
494 function ORG_NAME return varchar2;
495
496 --
497 -- PARTY_ID - Return person_party_id of current user
498 -- * NOTE: person_party_id is a foreign key to
499 -- HZ_PARTIES.PARTY_ID
500 --
501 function PARTY_ID return number;
502
503 --
504 -- Function that are getter methods for NLS settings in DB
505 --
506 function NLS_LANGUAGE return varchar2;
507
508 function NLS_NUMERIC_CHARACTERS return varchar2;
509
510 function NLS_DATE_FORMAT return varchar2;
511
512 function NLS_DATE_LANGUAGE return varchar2;
513
514 function NLS_TERRITORY return varchar2;
515
516 function NLS_SORT return varchar2;
517
518 --
519 -- bless_next_init-
520 --
521 -- Only a few Oracle FND developers will ever call this routine.
522 -- Because it is so rare that anyone would ever call this
523 -- routine, we aren't going to document it so as not to
524 -- confuse people. All you need to know is that calling this
525 -- routine incorrectly can easily cause showstopper problems
526 -- even for code outside your product. So just don't call it
527 -- unless you have been told to do so by an Oracle FND
528 -- development manager.
529 --
530 -- in argument:
531 -- permission_code- if you have permission to call this
532 -- you will have been given a unique code
533 -- that only you are allowed to pass to
534 -- confirm that your call is permitted.
535 --
536 -- see the internal oracle document for more details:
537 -- http://www-apps.us.oracle.com/atg/plans/r115x/contextintegrity.txt
538 --
539 procedure bless_next_init(permission_code in varchar2);
540
541 --
542 -- Restores the context to the last "approved" value saved away.
543 --
544 procedure restore;
545
546 --
547 -- INITIALIZE
548 -- Set an "array" of security globals,
549 -- optionally returning all the values initialized this call.
550 --
551 procedure initialize(p_mode in varchar2,
552 p_nv in out nocopy fnd_const.t_hashtable);
553
554 --
555 -- INITIALIZE
556 -- Set an "array" of security globals
557 -- returning all the values initialized this call.
558 --
559 procedure initialize(p_nv in out nocopy fnd_const.t_hashtable);
560
561 --
562 -- INITIALIZE
563 -- Set a single security global
564 -- For example, ORG_ID
565 --
566
567 procedure INITIALIZE(name varchar2, value varchar2);
568
569 /* Sets the module and action field of v$session
570 * module_type : type of program/function/action being called (always in lowercase)
571 * module_name : The module or code class name that performs the action.
572 */
573 procedure tag_db_session(module_type varchar2, module_name in varchar2);
574
575 /* Overloaded function for tag_db_session.
576 * This api sets client_identifier and action to SYSADMIN.
577 * module_type : type of program/function/action being called (always in lowercase)
578 * module_name : The module or code class name that performs the action.
579 * application_name : application short name to which the program_name belongs to.
580 */
581
582 procedure tag_db_session(module_type in varchar2,module_name in varchar2,application_name in varchar2);
583
584
585 end FND_GLOBAL;