1 PACKAGE OE_Profile AS
2 /* $Header: OEXPROFS.pls 120.0 2005/06/01 01:12:29 appldev noship $ */
3 /*#
4 * This API contains utilities used to retrieve Order Management profile options
5 * @rep:scope private
6 * @rep:product ONT
7 * @rep:lifecycle active
8 * @rep:displayname Order Management Profile Option Retrieval API
9 * @rep:category BUSINESS_ENTITY ONT_SALES_ORDER
10 */
11
12
13 -----------------------------------------------------------------
14 -- PROCEDURE GET
15 -- Use this instead of FND_PROFILE.GET to retrieve the value of
16 -- a profile option
17 -----------------------------------------------------------------
18 PROCEDURE GET
19 (NAME IN VARCHAR2
20 ,VAL OUT NOCOPY /* file.sql.39 change */ VARCHAR2
21 );
22
23
24 -----------------------------------------------------------------
25 -- FUNCTION VALUE
26 -- Use this function instead of FND_PROFILE.VALUE to retrieve the value of
27 -- a profile option
28 -----------------------------------------------------------------
29 FUNCTION VALUE
30 (NAME IN VARCHAR2,
31 ORG_ID IN NUMBER DEFAULT NULL
32 )
33 RETURN VARCHAR2;
34
35
36 -----------------------------------------------------------------
37 -- FUNCTION VALUE_WNPS
38 -- Use this function instead of FND_PROFILE.VALUE to retrieve the value of
39 -- a profile option
40 -- Since this function has pragma WNPS associated with it, it can be
41 -- used in where clauses of SQL statements.
42 -----------------------------------------------------------------
43 FUNCTION VALUE_WNPS
44 (NAME IN VARCHAR2,
45 ORG_ID IN NUMBER DEFAULT NULL
46 )
47 RETURN VARCHAR2;
48
49
50 -----------------------------------------------------------------
51 -- FUNCTION VALUE_SPECIFIC
52 -- Use this function instead of FND_PROFILE.VALUE_SPECIFIC to retrieve
53 -- the value of a profile option based on a user, responsiblity and application.
54 -- Since this function has pragma WNPS associated with it, it can also be
55 -- used in where clauses of SQL statements
56 -----------------------------------------------------------------
57 FUNCTION VALUE_SPECIFIC
58 (NAME IN VARCHAR2
59 ,USER_ID IN NUMBER DEFAULT NULL
60 ,RESPONSIBILITY_ID IN NUMBER DEFAULT NULL
61 ,APPLICATION_ID IN NUMBER DEFAULT NULL
62 )
63 RETURN VARCHAR2;
64
65
66 /*#
67 * This function returns the value of a profile option in the context of the user who created the line or order being processed.
68 * @param p_header_id Input parameter containing the header id of the header being processed
69 * @param p_line_id Input parameter containing the line id of the line being processed
70 * @param p_profile_option_name Input parameter containing the name of the profile option being retrieved
71 * @rep:scope private
72 * @rep:lifecycle active
73 * @rep:category BUSINESS_ENTITY ONT_SALES_ORDER
74 * @rep:displayname Value
75 */
76 FUNCTION VALUE (p_header_id IN NUMBER DEFAULT NULL,
77 p_line_id IN NUMBER DEFAULT NULL,
78 p_profile_option_name IN VARCHAR2)
79
80 RETURN VARCHAR2;
81
82 Type WF_Context_Rec_Type is Record
83 (
84 user_id Number := null
85 ,resp_appl_id Number := null
86 ,resp_id Number := null
87 ,org_id Number := null
88 ,position Number := null
89 );
90
91
92 TYPE WF_Context_Tbl_Type IS TABLE OF WF_Context_Rec_Type
93 INDEX BY VARCHAR2(30);
94
95 Line_Context_Tbl WF_Context_Tbl_Type;
96 Header_Context_Tbl WF_Context_Tbl_Type;
97 MAX_CONTEXT_CACHE_SIZE NUMBER := 15;
98
99
100 /*#
101 * This procedure tries to get the context values for a particular header or line from the cache
102 * @param p_entity Input parameter that specifies whether a header or line is being processed
103 * @param p_entity_id Input parameter that specifies the header id or line id
104 * @param x_application_id Output parameter containing the application id associated with the user who created the input header or line
105 * @param x_user_id Output parameter containing the user id associated with the user who created the input header or line
106 * @param x_responsibility_id Output parameter containing the responsibility id associated with the user who created the input header or line
107 * @param x_org_id Output parameter containing the org id associated with the user who created the input header or line
108 * @param x_result Output parameter containing the result of the cache query
109 * @rep:scope private
110 * @rep:lifecycle active
111 * @rep:category BUSINESS_ENTITY ONT_SALES_ORDER
112 * @rep:displayname Get Cached Context
113 */
114 PROCEDURE GET_CACHED_CONTEXT( p_entity IN VARCHAR2,
115 p_entity_id IN NUMBER,
116 x_application_id OUT NOCOPY NUMBER,
117 x_user_id OUT NOCOPY NUMBER,
118 x_responsibility_id OUT NOCOPY NUMBER,
119 x_org_id OUT NOCOPY NUMBER,
120 x_result OUT NOCOPY VARCHAR2);
121
122 /*#
123 * This procedure caches the context values for a particular header or line
124 * @param p_entity Input parameter that specifies whether a header or line is being processed
125 * @param p_entity_id Input parameter that specifies the header id or line id
126 * @param p_application_id Input parameter containing the application id associated with the user who created the input header or line
127 * @param p_user_id Input parameter containing the user id associated with the user who created the input header or line
128 * @param p_responsibility_id Input parameter containing the responsibility id associated with the user who created the input header or line
129 * @param p_org_id Input parameter containing the org id associated with the user who created the input header or line
130 * @rep:scope private
131 * @rep:lifecycle active
132 * @rep:category BUSINESS_ENTITY ONT_SALES_ORDER
133 * @rep:displayname Put Cached Context
134 */
135 PROCEDURE PUT_CACHED_CONTEXT( p_entity IN VARCHAR2,
136 p_entity_id IN NUMBER,
137 p_application_id IN NUMBER,
138 p_user_id IN NUMBER,
139 p_responsibility_id IN NUMBER,
140 p_org_id IN NUMBER);
141
142 TYPE Prf_Rec_Type IS RECORD
143 ( prf_value varchar2(240) := NULL
144 , position NUMBER := NULL
145 );
146
147 TYPE Prf_Tbl_Type IS TABLE OF Prf_Rec_Type
148 INDEX BY VARCHAR2(100);
149
150 Prf_Tbl Prf_Tbl_Type;
151
152
153 max_profile_cache_size NUMBER := max_context_cache_size * 15;
154
155
156 /*#
157 * This procedure tries to retrieve a cached profile option value for a particular context
158 * @param p_profile_option_name Input parameter that specifies the profile option being queried
159 * @param p_application_id Input parameter containing the application id for the desired context
160 * @param p_user_id Input parameter containing the user id for the desired context
161 * @param p_responsibility_id Input parameter containing the responsibility id for the desired context
162 * @param p_org_id Input parameter containing the org id for the desired context
163 * @param x_profile_option_value Output parameter containing the value of the profile option being queried
164 * @param x_result Output parameter containing the result of the cache query
165 * @rep:scope private
166 * @rep:lifecycle active
167 * @rep:category BUSINESS_ENTITY ONT_SALES_ORDER
168 * @rep:displayname Get Cached Profile For Context
169 */
170 PROCEDURE GET_CACHED_PROFILE_FOR_CONTEXT( p_profile_option_name IN VARCHAR2,
171 p_application_id IN NUMBER,
172 p_user_id IN NUMBER,
173 p_responsibility_id IN NUMBER,
174 p_org_id IN NUMBER,
175 x_profile_option_value OUT NOCOPY VARCHAR2,
176 x_result OUT NOCOPY VARCHAR2);
177
178 /*#
179 * This procedure tries to cache a profile option value for a particular context
180 * @param p_profile_option_name Input parameter that specifies the profile option
181 * @param p_application_id Input parameter containing the application id
182 * @param p_user_id Input parameter containing the user id
183 * @param p_responsibility_id Input parameter containing the responsibility id
184 * @param p_org_id Input parameter containing the org id
185 * @param p_profile_option_value Input parameter containing the profile option value being cached
186 * @rep:scope private
187 * @rep:lifecycle active
188 * @rep:category BUSINESS_ENTITY ONT_SALES_ORDER
189 * @rep:displayname Put Cached Profile For Context
190 */
191 PROCEDURE PUT_CACHED_PROFILE_FOR_CONTEXT ( p_profile_option_name IN VARCHAR2,
192 p_application_id IN NUMBER,
193 p_user_id IN NUMBER,
194 p_responsibility_id IN NUMBER,
195 p_org_id IN NUMBER,
196 p_profile_option_value IN VARCHAR2);
197
198
199 END OE_PROFILE;