DBA Data[Home] [Help]

PACKAGE: APPS.FND_PROFILE

Source


1 PACKAGE fnd_profile AUTHID DEFINER AS
2   /* $Header: AFPFPROS.pls 120.21 2012/02/22 15:44:59 rarmaly ship $ */
3   /*#
4   * APIs to manipulate values stored in client
5   * and server user profile caches.Any changes you make to profile option
6   * values using these routines affect only the run-time environment. The
7   * effect of these settings end when the program ends, because the
8   * database
9   * session (which holds the profile cache) is terminated.
10   * @rep:product FND
11   * @rep:displayname Profile Management APIs
12   * @rep:category BUSINESS_ENTITY FND_PROFILE
13   * @rep:compatibility S
14   * @rep:lifecycle active
15   * @rep:ihelp FND/@prof_plsql#prof_plsql See the related online
16   * help
17   */
18   /*
19   ** Constant value of default context
20   */
21   DEFAULT_CONTEXT NUMBER := -1;
22 
23   /*
24   ** FOR AOL INTERNAL USE ONLY - DO NOT CALL DIRECTLY,
25   ** CALL VIA FND_GLOBAL.INITIALIZE('ORG_ID',org_id)
26   ** FND_PROFILE.INITIALIZE also calls this API to initialize the org context.
27   **
28   ** initialize_org_context - Initializes the org context
29   */
30   PROCEDURE initialize_org_context;
31 
32   /*
33   ** FOR AOL INTERNAL USE ONLY - DO NOT CALL DIRECTLY, CALL VIA
34   ** FND_GLOBAL.APPS_INITIALIZE
35   ** initialize - Initialize the internal profile information
36   ** The cache is cleared of all database (non-put) options first.
37   ** Initializes the profiles for the level context information.
38   */
39   PROCEDURE initialize
40   (
41      user_id_z           IN NUMBER DEFAULT NULL,
42      responsibility_id_z IN NUMBER DEFAULT NULL,
43      application_id_z    IN NUMBER DEFAULT NULL,
44      site_id_z           IN NUMBER DEFAULT NULL
45   );
46 
47   /*
48   ** put
49   **    Set or insert a profile option value into the Public Put cache. This
50   **    does not place the profile option value in the database and is only
51   **    available during the session.
52   */
53   /*#
54   * Puts a value to the specified profile option. If the profile option does
55   * not exist, you can also create it, temporarily, with PUT. A PUT on the
56   * server affects only the server-side profile cache, and a PUT on the client
57   * affects only the client-side cache. By using PUT, you destroy the
58   * synchronicity between the server-side and client-side profile caches. As a
59   * result, widespread use of PUT is not recommended.
60   * @param name Profile name
61   * @param val Profile value
62   * @rep:displayname Put Profile
63   * @rep:compatibility S
64   * @rep:lifecycle active
65   * @rep:ihelp FND/@prof_plsql See related online help.
66   */
67   PROCEDURE put
68   (
69       name IN VARCHAR2,
70       val  IN VARCHAR2
71   );
72   PRAGMA RESTRICT_REFERENCES(put, WNDS, RNDS, TRUST);
73 
74   /*
75   ** get
76   **    fetches the value of a profile option. This is a wrapper to the
77   **    get_value() function.
78   */
79   /*#
80   * Gets the current value of the specified user profile option, or
81   * NULL if the profile does not exist. All GET operations are
82   * satisfied locally. In other words, a GET on the server is satisfied
83   * from the server-side cache, and a GET on the client is satisfied from
84   * the client-side cache.
85   * @param name Profile name
86   * @param val  Profile value as set by PUT
87   * @rep:displayname Get Profile
88   * @rep:compatibility S
89   * @rep:lifecycle active
90   * @rep:ihelp FND/@fnd_api See related online help.
91   */
92   PROCEDURE get
93   (
94       name IN VARCHAR2,
95       val  OUT NOCOPY VARCHAR2
96   );
97   PRAGMA RESTRICT_REFERENCES(get, WNDS, TRUST);
98 
99   /*
100   ** get_specific
101   **    fetches a profile option value for a specific context or a combination
102   **    of contexts. The context will default to current context, if no context
103   **    was provided.
104   */
105   PROCEDURE get_specific
106   (
107       name_z              IN VARCHAR2,
108       user_id_z           IN NUMBER DEFAULT NULL,
109       responsibility_id_z IN NUMBER DEFAULT NULL,
110       application_id_z    IN NUMBER DEFAULT NULL,
111       val_z               OUT NOCOPY VARCHAR2,
112       defined_z           OUT NOCOPY BOOLEAN,
113       org_id_z            IN NUMBER DEFAULT NULL,
114       server_id_z         IN NUMBER DEFAULT NULL
115   );
116   PRAGMA RESTRICT_REFERENCES(get_specific, WNDS, WNPS, TRUST);
117 
118   /*
119   ** value
120   **    returns the profile option value using the prevailing security
121   **    context. This is a wrapper function to get().
122   */
123   /*#
124   * Works exactly like GET, except it returns the value of the
125   * specified profile option as a function result.
126   * @param name Profile name
127   * @return specified profile option value
128   * @rep:displayname Get Profile Value
129   * @rep:compatibility S
130   * @rep:lifecycle active
131   * @rep:ihelp FND/@fnd_api See related online help.
132   */
133   FUNCTION value(name IN VARCHAR2) RETURN VARCHAR2;
134   PRAGMA RESTRICT_REFERENCES(value, WNDS, TRUST);
135 
136   /*
137   ** value_specific
138   **    return the profile value of a specific security context, i.e. user,
139   **    responsibility, application, server, organization. This is a wrapper
140   **    function to get_specific().
141   */
142   FUNCTION value_specific
143   (
144       name              IN VARCHAR2,
145       user_id           IN NUMBER DEFAULT NULL,
146       responsibility_id IN NUMBER DEFAULT NULL,
147       application_id    IN NUMBER DEFAULT NULL,
148       org_id            IN NUMBER DEFAULT NULL,
149       server_id         IN NUMBER DEFAULT NULL
150   ) RETURN VARCHAR2;
151   PRAGMA RESTRICT_REFERENCES(value_specific, WNDS, WNPS, TRUST);
152 
153   /*
154   ** defined
155   **    determines whether a profile option has a value using get().
156   **
157   **    RETURNS: TRUE, if the profile option has a value
158   **             FALSE, otherwise.
159   **
160   ** NOTE: A return of FALSE does not imply that the profile option is not
161   **       defined in FND_PROFILE_OPTIONS. It just means that no value was
162   **       found in Public Put cache or FND_PROFILE_OPTION_VALUES.
163   */
164   FUNCTION defined(name IN VARCHAR2) RETURN BOOLEAN;
165   PRAGMA RESTRICT_REFERENCES(defined, WNDS, TRUST);
166 
167   /*
168   ** save_user
169   **   Saves the value of a profile option, at the user level for the current
170   **   user, to the database permanently using save(). This routine will not
171   **   actually commit the changes; the caller must commit.
172   **
173   **  RETURNS: TRUE if successful, FALSE if failure.
174   */
175   FUNCTION save_user
176   (
177       x_name  IN VARCHAR2, /* Profile name you are setting */
178       x_value IN VARCHAR2 /* Profile value you are setting */
179   ) RETURN BOOLEAN;
180 
181   /*
182   ** save
183   **    Saves the value of a profile option permanently to the database, at any
184   **    level using the FND_PROFILE_OPTION_VALUES_PKG. This routine can be used
185   **    at runtime or during patching.  This routine will not actually commit
186   **    the changes; the caller must commit.
187   **
188   **    ('SITE', 'APPL', 'RESP', 'USER', 'SERVER', 'ORG', or 'SERVRESP').
189   **
190   **    Examples of use:
191   **       FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'SITE');
192   **       FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'APPL', 321532);
193   **       FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'RESP', 321532, 345234);
194   **       FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'USER', 123321);
195   **       FND_PROFILE.SAVE('P_NAME', 'SERVER', 25);
196   **       FND_PROFILE.SAVE('P_NAME', 'ORG', 204);
197   **       FND_PROFILE.SAVE('P_NAME', 'SERVRESP', 321532, 345234, 25);
198   **       FND_PROFILE.SAVE('P_NAME', 'SERVRESP', 321532, 345234, -1);
199   **       FND_PROFILE.SAVE('P_NAME', 'SERVRESP', -1, -1, 25);
200   **
201   **    Arguments/Parameters:
202   **       profileName       - Profile name you are setting
203   **       profileValue      - Profile value you are setting
204   **       levelName         - Level that you're setting at:
205   **                           'SITE','APPL','RESP','USER', etc.
206   **       levelValue        - context value used for setting profile option
207   **                           value, e.g. user_id for 'USER' level. This does
208   **                           not apply to 'SITE' level.
209   **       levelValueAppId   - applies to 'RESP' and 'SERVRESP' levels, i.e.
210   **                           the Resp Application_Id.
211   **       levelValue2       - 2nd context value used for setting profile
212   **                           option value.  This applies to the 'SERVRESP'
213   **                           hierarchy.
214   **
215   **  RETURNS: TRUE if successful, FALSE if failure.
216   */
217   FUNCTION save
218   (
219       x_name IN VARCHAR2,                /* Profile name you are setting */
220       x_value IN VARCHAR2,               /* Profile value you are setting */
221       x_level_name IN VARCHAR2,          /* Level that you're setting at:
222                                            'SITE','APPL','RESP','USER', etc. */
223       x_level_value IN VARCHAR2 DEFAULT NULL,  /* Level value that you are
224                                     setting at, e.g. user id for 'USER' level.
225                                     X_LEVEL_VALUE is not used at site level. */
226       x_level_value_app_id IN VARCHAR2 DEFAULT NULL, /* Used for 'RESP' and
227                                       'SERVRESP' level; Resp Application_Id. */
228       x_level_value2 IN VARCHAR2 DEFAULT NULL  /* 2nd Level value that you are
229                           setting at.  This is for the 'SERVRESP' hierarchy. */
230   ) RETURN BOOLEAN;
231 
232 
233   /*
234   ** delete
235   **    deletes the value of a profile option permanently from the database, at
236   **    any level.  This routine serves as a wrapper to the SAVE routine which
237   **    means that this routine can be used at runtime or during patching. Like
238   **    the SAVE routine, this routine will not actually commit the changes;
239   **    the caller must commit. This API was added for enhancement request
240   **    4430579.
241   **
242   **        ('SITE', 'APPL', 'RESP', 'USER', 'SERVER', 'ORG', or 'SERVRESP').
243   **
244   **        Examples of use:
245   **        FND_PROFILE.DELETE('P_NAME', 'SITE');
246   **        FND_PROFILE.DELETE('P_NAME', 'APPL', 321532);
247   **        FND_PROFILE.DELETE('P_NAME', 'RESP', 321532, 345234);
248   **        FND_PROFILE.DELETE('P_NAME', 'USER', 123321);
249   **        FND_PROFILE.DELETE('P_NAME', 'SERVER', 25);
250   **        FND_PROFILE.DELETE('P_NAME', 'ORG', 204);
251   **        FND_PROFILE.DELETE('P_NAME', 'SERVRESP', 321532, 345234, 25);
252   **        FND_PROFILE.DELETE('P_NAME', 'SERVRESP', 321532, 345234, -1);
253   **        FND_PROFILE.DELETE('P_NAME', 'SERVRESP', -1, -1, 25);
254   **
255   **    Arguments/Parameters:
256   **       profileName       - Profile name whose value is to be deleted
257   **       levelName         - Level deleting at:
258   **                           'SITE','APPL','RESP','USER', etc.
259   **       levelValue        - context value used for deleting profile option
260   **                           value, e.g. user_id for 'USER' level. This does
261   **                            not apply to 'SITE' level.
262   **       levelValueAppId   - applies to 'RESP' and 'SERVRESP' levels, i.e.
263   **                           the Resp Application_Id.
264   **       levelValue2       - 2nd context value used for deleting profile
265   **                           option value.  This applies to the 'SERVRESP'
266   **                           hierarchy.
267   **
268   **  RETURNS: TRUE if successful, FALSE if failure.
269   */
270   FUNCTION delete
271   (
272       x_name IN VARCHAR2,                   /* Profile name you are setting */
273       x_level_name IN VARCHAR2,             /* Level that you're setting at:
274                                           'SITE','APPL','RESP','USER', etc. */
275       x_level_value IN VARCHAR2 DEFAULT NULL,   /* Level value that you are
276                                   setting at, e.g. user id for 'USER' level.
277                                    X_LEVEL_VALUE is not used at site level. */
278       x_level_value_app_id IN VARCHAR2 DEFAULT NULL,  /* Used for 'RESP' and
282                                          for the 'SERVRESP' hierarchy only. */
279                                      'SERVRESP' level; Resp Application_Id. */
280       x_level_value2 IN VARCHAR2 DEFAULT NULL   /* 2nd Level value that you
281                                                    are setting at.  This is
283   ) RETURN BOOLEAN;
284 
285   /*
286   ** bumpCacheVersion_RF
287   **    The rule function for FND's subscription on the
288   **    oracle.apps.fnd.profile.value.update event.
289   **    Since level hash table caches are no longer used due to the PL/SQL
290   **    cross-session function result caching mechanism, this is really no
291   **    longer being used. It will return SUCCESS for backward compatibility.
292   */
293    FUNCTION bumpcacheversion_rf
294    (
295       p_subscription_guid IN RAW,
296       p_event             IN OUT NOCOPY wf_event_t
297    ) RETURN VARCHAR2;
298 
299   /*
300   ** putmultiple
301   **    puts multiple option pairs in the table
302   **
303   ** [NOTE: THIS API IS FOR AOL INTERNAL USE ONLY.]
304   */
305    PROCEDURE putmultiple
306    (
307       names IN VARCHAR2,
308       vals  IN VARCHAR2,
309       num   IN NUMBER
310    );
311    PRAGMA RESTRICT_REFERENCES(putmultiple, WNDS, RNDS, TRUST);
312 
313   /*
314   ** get_all_table_values
315   **    get all the values from the Public Put Cache. The varchar2 returned
316   **    can be up to 32767 characters long.
317   **
318   ** [NOTE: THIS FUNCTION IS FOR AOL INTERNAL USE ONLY.]
319   */
320    FUNCTION get_all_table_values(delim IN VARCHAR2) RETURN VARCHAR2;
321 
322   /*
323   ** get_table_value
324   **    get the value of a profile option from Public Put Cache
325   **
326   ** [NOTE: THIS API IS FOR AOL INTERNAL USE ONLY.]
327   */
328    FUNCTION get_table_value(name IN VARCHAR2) RETURN VARCHAR2;
329    PRAGMA RESTRICT_REFERENCES(get_table_value, WNDS, WNPS, RNDS, TRUST);
330 
331   /*
332   ** value_wnps
333   **    returns the profile option value using the prevailing security
334   **    context. This is a wrapper function to value().
335   **
336   ** NOTE: Prior to 11g Profile Options Caching, this routine did the
337   **       same thing as VALUE(); it returns a profile value from the profile
338   **       cache, or from the database if it isn't already in the profile
339   **       cache already.  The only difference between this and VALUE() is
340   **       that this will not put the value into the pl/sql hash table level
341   **       caches if it is not already there, so repeated calls to this can
342   **       be slower because it will have to hit the database each time for
343   **       the profile value.
344   **
345   **       With the obsoletion of pl/sql hash table level caches, this API is
346   **       obsolete and is being maintained for backwards compatibility.
347   */
348   FUNCTION value_wnps(name IN VARCHAR2) RETURN VARCHAR2;
349   PRAGMA RESTRICT_REFERENCES(value_wnps, WNDS, WNPS, TRUST);
350    /*
351    ** AOL INTERNAL USE ONLY
352    **
353    ** PUT_CACHE_CLEARED - returns true if the put cache was cleared.
354    **
355    ** Bug 12875860 - PER Rewrite - this function is ONLY for use by FND_GLOBAL
356    ** after a call to FND_PROFILE.INITIALIZE == ONLY FND_GLOBAL should call
357    ** INITIALIZE and this value ONLY has meaning between that call and the
358    ** subsequent call to PER Initialization code.
359    */
360   FUNCTION put_cache_cleared RETURN BOOLEAN;
361 
362 END fnd_profile;