DBA Data[Home] [Help]

PACKAGE: APPS.FND_PROFILE

Source


1 package FND_PROFILE as
2 /* $Header: AFPFPROS.pls 120.5.12010000.2 2009/01/28 16:36:55 pdeluna 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 database
8  * session (which holds the profile cache) is terminated.
9  * @rep:scope public
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 help
16  */
17     /*
18     ** PUT - sets a profile option to a value for this session,
19     **       but doesn't save to the database
20     */
21    /*#
22     * Puts a value to the specified user profile option. If the option
23     * does not exist, you can also create it with PUT. A PUT on the server
24     * affects only the server-side profile cache, and a PUT on the client
25     * affects only the client-side cache. By using PUT, you destroy the
26     * synchrony between server-side and client-side profile caches. As a
27     * result, we do not recommend widespread use of PUT.
28     * @param name Profile name
29     * @param val Profile value
30     * @rep:scope public
31     * @rep:displayname Put Profile
32     * @rep:compatibility S
33     * @rep:lifecycle active
34     * @rep:ihelp FND/@prof_plsql See related online help.
35     */
36 
37 
38     procedure PUT(NAME in varchar2, VAL in varchar2);
39     pragma restrict_references(PUT, WNDS, RNDS,TRUST);
40 
41     /*
42     ** DEFINED - returns TRUE if a profile option has been stored
43     */
44     function  DEFINED(NAME in varchar2) return boolean;
45     pragma restrict_references(DEFINED, WNDS, TRUST);
46 
47     /*
48     ** GET - gets the value of a profile option
49     */
50     /*#
51      * Gets the current value of the specified user profile option, or
52      * NULL if the profile does not exist. All GET operations are
53      * satisfied locally. In other words, a GET on the server is satisfied
54      * from the server-side cache, and a GET on the client is satisfied from
55      * the client-side cache.
56      * @param name Profile name
57      * @param val  Profile value as set by PUT
58      * @rep:scope public
59      * @rep:displayname Get Profile
60      * @rep:compatibility S
61      * @rep:lifecycle active
62      * @rep:ihelp FND/@prof_plsql See related online help.
63      */
64 
65     procedure GET(NAME in varchar2, VAL out NOCOPY varchar2);
66     pragma restrict_references(GET, WNDS, TRUST);
67 
68     /*
69     ** VALUE - returns the value of a profile options
70     */
71    /*#
72     * Works exactly like GET, except it returns the value of the
73     * specified profile option as a function result.
74     * @param name Profile name
75     * @return specified profile option value
76     * @rep:scope public
77     * @rep:displayname Get Profile Value
78     * @rep:compatibility S
79     * @rep:lifecycle active
80     * @rep:ihelp FND/@prof_plsql See related online help.
81     */
82     function  VALUE(NAME in varchar2) return varchar2;
83     pragma restrict_references(VALUE, WNDS, TRUST);
84 
85     /*
86     ** VALUE_WNPS - returns the value of a profile option without caching it.
87     **
88     **            The main usage for this routine would be in a SELECT
89     **            statement where VALUE() is not allowed since it
90     **            writes package state.
91     **
92     **            This routine does the same thing as VALUE(); it returns
93     **            a profile value from the profile cache, or from the database
94     **            if it isn't already in the profile cache already.  The only
95     **            difference between this and VALUE() is that this will not
96     **            put the value into the cache if it is not already there, so
97     **            repeated calls to this can be slower because it will have
98     **            to hit the database each time for the profile value.
99     **
100     **            In most cases, however, you can and should use VALUE()
101     **            instead of VALUE_WNPS(), because VALUE() will give
102     **            better performance.
103     */
104     function  VALUE_WNPS(NAME in varchar2) return varchar2;
105     pragma restrict_references(VALUE_WNPS, WNDS,WNPS, TRUST);
106 
107     /*
108     ** SAVE_USER - Sets the value of a profile option permanently
109     **             to the database, at the user level for the current user.
110     **             Also saves in the profile cache for this database session.
111     **             Note that this will not save in the profile caches
112     **             for any other database sessions that may be up, so those
113     **             could potentially be out of sync. This routine will not
114     **             actually commit the changes; the caller must commit.
115     **
116     **  returns: TRUE if successful, FALSE if failure.
117     **
118     */
119     function SAVE_USER(
120          X_NAME in varchar2,  /* Profile name you are setting */
121          X_VALUE in varchar2 /* Profile value you are setting */
122     ) return boolean;
123 
124     /*
125     ** SAVE - sets the value of a profile option permanently
126     **        to the database, at any level.  This routine can be used
127     **        at runtime or during patching.  This routine will not
128     **        actually commit the changes; the caller must commit.
129     **
130     **        ('SITE', 'APPL', 'RESP', 'USER', 'SERVER', 'ORG', or 'SERVRESP').
131     **
132     **        Examples of use:
133     **        FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'SITE');
134     **        FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'APPL', 321532);
135     **        FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'RESP', 321532, 345234);
136     **        FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'USER', 123321);
137     **        FND_PROFILE.SAVE('P_NAME', 'SERVER', 25);
138     **        FND_PROFILE.SAVE('P_NAME', 'ORG', 204);
139     **        FND_PROFILE.SAVE('P_NAME', 'SERVRESP', 321532, 345234, 25);
140     **        FND_PROFILE.SAVE('P_NAME', 'SERVRESP', 321532, 345234, -1);
141     **        FND_PROFILE.SAVE('P_NAME', 'SERVRESP', -1, -1, 25);
142     **
143     **  returns: TRUE if successful, FALSE if failure.
144     **
145     */
146     function SAVE(
147       X_NAME in varchar2,
148         /* Profile name you are setting */
149       X_VALUE in varchar2,
150         /* Profile value you are setting */
151       X_LEVEL_NAME in varchar2,
152         /* Level that you're setting at: 'SITE','APPL','RESP','USER', etc. */
153       X_LEVEL_VALUE in varchar2 default NULL,
154         /* Level value that you are setting at, e.g. user id for 'USER' level.
155            X_LEVEL_VALUE is not used at site level. */
156       X_LEVEL_VALUE_APP_ID in varchar2 default NULL,
157         /* Used for 'RESP' and 'SERVRESP' level; Resp Application_Id. */
158       X_LEVEL_VALUE2 in varchar2 default NULL
159         /* 2nd Level value that you are setting at.  This is for the 'SERVRESP'
160            hierarchy. */
161     ) return boolean;
162 
163     /*
164     ** GET_SPECIFIC - Get profile value for a specific user/resp/appl combo
165     **   Default is user/resp/appl is current login.
166     */
167     procedure GET_SPECIFIC(NAME_Z              in varchar2,
168                            USER_ID_Z           in number default null,
169                            RESPONSIBILITY_ID_Z in number default null,
170                            APPLICATION_ID_Z    in number default null,
171                            VAL_Z               out NOCOPY varchar2,
172                            DEFINED_Z           out NOCOPY boolean,
173                            ORG_ID_Z            in number default null,
174                            SERVER_ID_Z         in number default null);
175 
176     pragma restrict_references(GET_SPECIFIC, WNDS, WNPS, TRUST);
177 
178     /*
179     ** VALUE_SPECIFIC - Get profile value for a specific user/resp/appl combo
180     **   Default is user/resp/appl is current login.
181     */
182     function VALUE_SPECIFIC(NAME              in varchar2,
183                             USER_ID           in number default null,
184                             RESPONSIBILITY_ID in number default null,
185                             APPLICATION_ID    in number default null,
186                             ORG_ID            in number default null,
187                             SERVER_ID         in number default null)
188     return varchar2;
189     pragma restrict_references(VALUE_SPECIFIC, WNDS, WNPS, TRUST);
190 
191     /*
192     ** FOR AOL INTERNAL USE ONLY
193     **
194     ** initialize_org_context - Initializes the org context used by profiles.
195     */
196     procedure INITIALIZE_ORG_CONTEXT;
197 
198     /*
199     ** AOL INTERNAL USE ONLY
200     */
201     procedure INITIALIZE(USER_ID_Z           in number default NULL,
202                          RESPONSIBILITY_ID_Z in number default NULL,
203                          APPLICATION_ID_Z    in number default NULL,
204                          SITE_ID_Z           in number default NULL);
205 --    pragma restrict_references(INITIALIZE, WNDS);
206 
207     procedure PUTMULTIPLE(NAMES in varchar2, VALS in varchar2, NUM in number);
208     pragma restrict_references(PUTMULTIPLE, WNDS, RNDS, TRUST);
209 
210     /*
211     ** GET_TABLE_VALUE - get the value of a profile option from the table
212     **
213     ** [NOTE: THIS FUNCTION IS FOR AOL INTERNAL USE ONLY.]
214     */
215     function GET_TABLE_VALUE(NAME in varchar2) return varchar2;
216     pragma restrict_references(GET_TABLE_VALUE, WNDS, WNPS, RNDS, TRUST);
217 
218     /*
219     ** GET_ALL_TABLE_VALUES - get all the values from the table
220     **   The varchar2 returned can be up to 32767 characters long.
221     **
222     ** [NOTE: THIS FUNCTION IS FOR AOL INTERNAL USE ONLY.]
223     */
224     function GET_ALL_TABLE_VALUES(DELIM in varchar2) return varchar2;
225     pragma restrict_references(GET_ALL_TABLE_VALUES, WNDS, WNPS, RNDS, TRUST);
226 
227     /*
228      * bumpCacheVersion_RF
229      *      The rule function for FND's subscription on the
230      *      oracle.apps.fnd.profile.value.update event.  This function calls
231      *      FND_CACHE_VERSION_PKG.bump_version to increase the version of the
232      *      appropriate profile level cache.
233      */
234     function bumpCacheVersion_RF (p_subscription_guid in raw,
235                                   p_event in out NOCOPY WF_EVENT_T)
236     return varchar2;
237 
238      /*
239      ** DELETE - deletes the value of a profile option permanently from the
240      **          database, at any level.  This routine serves as a wrapper to
241      **          the SAVE routine which means that this routine can be used at
242      **          runtime or during patching.  Like the SAVE routine, this
243      **          routine will not actually commit the changes; the caller must
244      **          commit.
245      **
246      **        ('SITE', 'APPL', 'RESP', 'USER', 'SERVER', 'ORG', or 'SERVRESP').
247      **
248      **        Examples of use:
249      **        FND_PROFILE.DELETE('P_NAME', 'SITE');
250      **        FND_PROFILE.DELETE('P_NAME', 'APPL', 321532);
251      **        FND_PROFILE.DELETE('P_NAME', 'RESP', 321532, 345234);
252      **        FND_PROFILE.DELETE('P_NAME', 'USER', 123321);
253      **        FND_PROFILE.DELETE('P_NAME', 'SERVER', 25);
254      **        FND_PROFILE.DELETE('P_NAME', 'ORG', 204);
255      **        FND_PROFILE.DELETE('P_NAME', 'SERVRESP', 321532, 345234, 25);
256      **        FND_PROFILE.DELETE('P_NAME', 'SERVRESP', 321532, 345234, -1);
257      **        FND_PROFILE.DELETE('P_NAME', 'SERVRESP', -1, -1, 25);
258      **
259      **  returns: TRUE if successful, FALSE if failure.
260      **
261      */
262      function DELETE(
263           X_NAME in varchar2,
264                /* Profile name you are setting */
265           X_LEVEL_NAME in varchar2,
266                /* Level that you're setting at: 'SITE','APPL','RESP','USER', etc. */
267           X_LEVEL_VALUE in varchar2 default NULL,
268                /* Level value that you are setting at, e.g. user id for 'USER' level.
269                   X_LEVEL_VALUE is not used at site level. */
270           X_LEVEL_VALUE_APP_ID in varchar2 default NULL,
271                /* Used for 'RESP' and 'SERVRESP' level; Resp Application_Id. */
272           X_LEVEL_VALUE2 in varchar2 default NULL
273                /* 2nd Level value that you are setting at.  This is for the 'SERVRESP'
274                   hierarchy only. */
275           ) return boolean;
276 
277 end FND_PROFILE;