DBA Data[Home] [Help]

PACKAGE: APPS.JTF_PERZ_DDF_PUB

Source


1 PACKAGE JTF_PERZ_DDF_PUB AUTHID CURRENT_USER as
2 /* $Header: jtfzpdds.pls 120.2 2005/11/02 03:23:06 skothe ship $ */
3 --
4 --
5 -- Start of Comments
6 --
7 -- NAME
8 --   jtf_perz_ddf_pub
9 --
10 -- PURPOSE
11 --   Public API for creating, getting, updating and deleteing data defaults
12 -- 	 in the Personalization Framework.
13 --
14 -- NOTES
15 --   This is a pulicly accessible pacakge.  It should be used by all
16 --   sources for creating, getting, updating and deleting personalized data defaults
17 -- 	 in the Personalization Framework.
18 --
19 -- HISTORY
20 --	09/10/99	SMATTEGU	Created and documented the following
21 --					save_data_default()
22 --					create_data_default()
23 --					get_data_default()
24 --					update_data_default()
25 --					delete_data_default()
26 --
27 -- End of Comments
28 --
29 --
30 -- Start of Comments
31 --
32 --	ddf_out_rec_type Rec
33 --
34 --	This record is used to set the data attributes associated with a personalized
35 --	data object.
36 --
37 -- End of Comments
38 
39 TYPE ddf_out_rec_type		IS RECORD
40 (
41  	perz_ddf_id		NUMBER  	:= NULL,
42 	perz_ddf_context	VARCHAR2(60)	:= NULL,
43  	profile_id		NUMBER        	:= NULL,
44  	application_id		NUMBER        	:= NULL,
45 	gui_object_name		VARCHAR2(60)	:= NULL,
46  	gui_object_id		NUMBER        	:= NULL,
47 	ddf_value		VARCHAR2(60)	:= NULL,
48 	ddf_value_type 		VARCHAR2(30)	:= NULL
49 );
50 
51 -- Start of Comments
52 --
53 --      ddf_out_rec_type Table: ddf_out_tbl_type
54 --
55 --
56 -- End of Comments
57 
58 TYPE ddf_out_tbl_type	IS TABLE OF ddf_out_rec_type
59 			INDEX BY BINARY_INTEGER;
60 
61 -- G_MISS definition for table
62 G_MISS_DDF_TBL		ddf_out_tbl_type;
63 
64 -- *****************************************************************************
65 
66 -- Start of Comments
67 --
68 --	API name 	: save_data_default
69 --	Type		: Public
70 --	Function	: Create or update if exists, a personalized data default
71 --
72 --	Parameters	:
73 --	IN		:
74 --			p_api_version_number	IN NUMBER	Required
75 --   			p_init_msg_list		IN VARCHAR2	Optional
76 -- 			p_commit		IN VARCHAR	Optional
77 --
78 -- 			p_application_id	IN NUMBER	Required
79 
80 -- 			p_profile_id		IN NUMBER	Required
81 -- 			p_profile_name		IN VARCHAR2	Optional
82 -- 			p_profile_type		IN VARCHAR2	Optional
83 -- 			p_profile_attrib	IN JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE Optional
84 --
85 -- 			p_perz_ddf_id		IN NUMBER	Optional
86 -- 			p_perz_ddf_context	IN VARCHAR2	Required
87 -- 			p_gui_object_name	IN VARCHAR2	Required
88 -- 			p_gui_object_id		IN NUMBER	Optional
89 -- 			p_ddf_value		IN VARCHAR2	Required
90 -- 			p_ddf_value_type	IN VARCHAR2	Required
91 --
92 -- OUT 	:
93 --			x_perz_ddf_id	  OUT NUMBER
94 -- 			x_return_status	 OUT VARCHAR2
95 -- 			x_msg_count	 OUT NUMBER
96 -- 			x_msg_data	 OUT VARCHAR2
97 --
98 --
99 --	Version	:	Current version	1.0
100 --			Initial version 1.0
101 --
102 --	Notes:
103 --		Data Default is used a single value tied to any given GUI object
104 --		This Association can be identified by ddf_name. The same GUI object
105 --		can have different values in different (profile_id, application_id)
106 --		combination.
107 --		The perz_ddf_context is used to store under what context the GUI
108 --		object will have the assigned value for any given profile_id
109 --		application id combination
110 --
111 --
112 -- *****************************************************************************
113 --
114 -- USAGE NOTES :
115 --
116 --	1. This API creates or updates if it already exists, a Personalized data
117 --		default in the personalization framework.
118 --	2. Of the input parameters p_profile_id (or the name of the profile
119 --		p_profile_name p_profile_type and its attributes p_Profile_Attrib)
120 --		is a required field.
121 --	3. The other required fields are :
122 --	  3.1	p_application_id (the application id of the caller)
123 --	  3.2	p_perz_ddf_context
124 --		This field has to be unique for that profile id and application id, or
125 --		the API will return an error. This field also has to be made of
126 --		characters with no spaces (underscores allowed).
127 --	  3.3	p_gui_object_name (Gui object to which the value is associated with)
128 --	4. Rest of the parameters are optional. p_perz_ddf_id, p_gui_object_id
129 --		if available, may be provided.
130 --	5. p_ddf_value will hold the personalized value for that ddf_name.
131 --	   p_ddf_value_type will hold the data type that of the value.
132 --
133 --
134 --	6. The main out parameter for this API is x_perz_ddf_id.
135 --	   This returns the data default id for the saved data default.
136 --	   Another important out parameter is x_return_status which returns
137 --		FND_API.G_RETURN_SUCCESS when the API completes successfully
138 --		FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
139 --		FND_API.G_RETURN_ERROR when the API hits an error
140 --
141 -- *****************************************************************************
142 --
143 PROCEDURE save_data_default
144 ( 	p_api_version_number	IN	NUMBER,
145   	p_init_msg_list		IN	VARCHAR2 	:= FND_API.G_FALSE,
146 	p_commit		IN 	VARCHAR		:= FND_API.G_FALSE,
147 
148 	p_application_id	IN 	NUMBER,
149 
150 	p_profile_id        	IN 	NUMBER,
151 	p_profile_name      	IN 	VARCHAR2,
152 	p_profile_type      	IN 	VARCHAR2,
153 	p_profile_attrib    	IN JTF_PERZ_PROFILE_PUB.PROFILE_ATTRIB_TBL_TYPE
154 				:= JTF_PERZ_PROFILE_PUB.G_MISS_PROFILE_ATTRIB_TBL,
155 
156 	p_perz_ddf_id		IN NUMBER	,
157 	p_perz_ddf_context	IN VARCHAR2	,
158 
159 	p_gui_object_name	IN VARCHAR2	,
160 	p_gui_object_id		IN NUMBER	,
161 	p_ddf_value		IN VARCHAR2	,
162 	p_ddf_value_type	IN VARCHAR2	,
163 
164 	x_perz_ddf_id	    OUT NOCOPY /* file.sql.39 change */ NUMBER,
165 
166 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
167 	x_msg_count	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
168 	x_msg_data	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
169 );
170 
171 -- *****************************************************************************
172 
173 -- Start of Comments
174 --
175 --	API name 	: create_data_default
176 --	Type		: Public
177 --	Function	: Create a data default for a given profile and application id.
178 --
179 --	Parameters	:
180 --	IN		:
181 --			p_api_version_number	IN NUMBER	Required
182 --   			p_init_msg_list		IN VARCHAR2	Optional
183 -- 			p_commit		IN VARCHAR	Optional
184 --
185 -- 			p_application_id	IN NUMBER	Required
186 
187 -- 			p_profile_id		IN NUMBER	Required
188 -- 			p_profile_name		IN VARCHAR2	Optional
189 --
190 -- 			p_perz_ddf_id		IN NUMBER	Optional
191 -- 			p_perz_ddf_context	IN VARCHAR2	Required
192 -- 			p_gui_object_name	IN VARCHAR2	Required
193 -- 			p_gui_object_id		IN NUMBER	Optional
194 -- 			p_ddf_value		IN VARCHAR2	Required
195 -- 			p_ddf_value_type	IN VARCHAR2	Required
196 --
197 -- OUT 	:
198 --			x_perz_ddf_id	    OUT NUMBER
199 -- 			x_return_status	 OUT VARCHAR2
200 -- 			x_msg_count	 OUT NUMBER
201 -- 			x_msg_data	 OUT VARCHAR2
202 --
203 --
204 --	Version	:	Current version	1.0
205 --			Initial version 1.0
206 --
207 --	Notes:
208 --		This API is used to create a Data Default. A data default is
209 --		associated with a GUI object, default value and type.
210 --		The same GUI object can have different values in different
211 --		(profile_id, application_id, ddf_context) combination.
212 --
213 --
214 -- *****************************************************************************
215 --
216 -- USAGE NOTES :
217 --
218 --	1. This API creates a Personalized data default in the personalization
219 --		framework.
220 --	2. Of the input parameters p_profile_id (or the name) is a required field.
221 --	3. The other required fields are :
222 --	  3.1	p_application_id (the application id of the caller)
223 --	  3.2	p_perz_ddf_context
224 --		This field has to be unique for that profile id and application id,
225 --		or the API will return an error. This field also has to be made of
226 --		characters with no spaces (underscores allowed).
227 --	  3.3	p_gui_object_name (to which the value is associated with)
228 --	4. Rest of the parameters are optional. p_perz_ddf_id, p_gui_object_id
229 --		if available, may be provided.
230 --	5. p_ddf_value will hold the personalized value for that ddf_name.
231 --	   p_ddf_value_type will hold the data type that of the value.
232 --
233 --
234 --	6. The main out parameter for this API is x_perz_ddf_id.
235 --	   This returns the data default id for the created data default object.
236 --	   Another important out parameter is x_return_status which returns
237 --		FND_API.G_RETURN_SUCCESS when the API completes successfully
238 --		FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
239 --		FND_API.G_RETURN_ERROR when the API hits an error
240 --
241 -- *****************************************************************************
242 
243 PROCEDURE create_data_default
244 (
245 	p_api_version_number	IN NUMBER,
246 	p_init_msg_list		IN VARCHAR2,
247 	p_commit		IN VARCHAR,
248 
249 	p_application_id	IN NUMBER,
250 
251 	p_profile_id		IN NUMBER,
252 	p_profile_name		IN VARCHAR2,
253 
254 	p_perz_ddf_id		IN NUMBER,
255 	p_perz_ddf_context	IN VARCHAR2,
256 
257 	p_gui_object_name	IN VARCHAR2,
258 	p_gui_object_id		IN NUMBER,
259 	p_ddf_value		IN VARCHAR2,
260 	p_ddf_value_type	IN VARCHAR2,
261 
262 	x_perz_ddf_id	    OUT NOCOPY /* file.sql.39 change */ NUMBER,
263 
264 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
265 	x_msg_count	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
266 	x_msg_data	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
267 );
268 
269 -- *****************************************************************************
270 -- Start of Comments
271 --
272 --	API name 	: get_data_default
273 --	Type		: Public
274 --	Function	: Get personalized data default object, and associated
275 --				values for a given personalized data object and
276 --				profile and app id.
277 --
278 --	Parameters	:
279 --	IN		:
280 --			p_api_version_number	IN NUMBER	Required
281 --   			p_init_msg_list		IN VARCHAR2	Optional
282 --
283 -- 			p_application_id	IN NUMBER	Required
284 
285 -- 			p_profile_id		IN NUMBER	Required
286 -- 			p_profile_name		IN VARCHAR2	Optional
287 --
288 -- 			p_perz_ddf_id		IN NUMBER	Optional
289 -- 			p_perz_ddf_context	IN VARCHAR2	Required
290 -- 			p_gui_object_name	IN VARCHAR2	Required
291 -- 			p_gui_object_id		IN NUMBER	Optional
292 -- 			p_ddf_value		IN VARCHAR2	Required
293 -- 			p_ddf_value_type	IN VARCHAR2	Required
294 --
295 -- OUT 	:
296 --			x_ddf_out_tbl	    OUT JTF_PERZ_DDF_PUB.DDF_OUT_TBL_TYPE
297 -- 			x_return_status	 OUT VARCHAR2
298 -- 			x_msg_count	 OUT NUMBER
299 -- 			x_msg_data	 OUT VARCHAR2
300 --
301 --
302 --	Version	:	Current version	1.0
303 --			Initial version 1.0
304 --
305 --	Notes:
306 --
307 -- *****************************************************************************
308 --
309 -- USAGE NOTES :
310 --
311 --	1. This API gets a Personalized data default from the personalization
312 --		framework.
313 --	2. Of the input parameters p_profile_id (or the name) is a required field.
314 --	3. The other required fields are :
315 --	  3.1	p_application_id (the application id of the caller)
316 --	  3.2	p_perz_ddf_context
317 --	4. Rest of the parameters are optional. p_perz_ddf_id, p_gui_object_id
318 --		if available, may be provided.
319 --
320 --	5. The main out parameter is p_ddf_out_tbl which holds all the details
321 --		of the data default object(s)
322 --
323 --	6. Another important out parameter is x_return_status which returns
324 --		FND_API.G_RETURN_SUCCESS when the API completes successfully
325 --		FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
326 --		FND_API.G_RETURN_ERROR when the API hits an error
327 --
328 --	This API can be used in two ways,
329 --	1. To get the table of DDF by supplying profile id/name, application_id,
330 --		gui_object_id/name and dddf_context
331 --		(In this case out put table will have only one row) OR
332 --	2. To get the table of DDF by supplying profile id/name, application_id,
333 --		gui_object_id/name .
334 -- *****************************************************************************
335 
336 PROCEDURE get_data_default
337 ( 	p_api_version_number	IN	NUMBER,
338 	p_init_msg_list		IN VARCHAR2,
339 
340 	p_application_id	IN NUMBER,
341 
342 	p_profile_id		IN NUMBER,
343 	p_profile_name		IN VARCHAR2,
344 
345 	p_perz_ddf_id		IN NUMBER,
346 	p_perz_ddf_context	IN VARCHAR2,
347 
348 	p_gui_object_name	IN VARCHAR2,
349 	p_gui_object_id		IN NUMBER,
350 
351 	p_ddf_value		IN VARCHAR2,
352 	p_ddf_value_type	IN VARCHAR2,
353 
354 	x_ddf_out_tbl	    OUT NOCOPY /* file.sql.39 change */ jtf_perz_ddf_pub.DDF_OUT_TBL_TYPE,
355 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
356 	x_msg_count	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
357 	x_msg_data	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
358 );
359 
360 -- *****************************************************************************
361 
362 
363 -- Start of Comments
364 --
365 --	API name 	: update_data_default
366 --	Type		: Public
367 --	Function	: Update data default object in the Framework.
368 --
369 --	Parameters	:
370 --	IN		:
371 --			p_api_version_number	IN NUMBER	Required
372 --   			p_init_msg_list		IN VARCHAR2	Optional
373 -- 			p_commit		IN VARCHAR	Optional
374 --
375 -- 			p_application_id	IN NUMBER	Optional
376 
377 -- 			p_profile_id		IN NUMBER	Optional
378 -- 			p_profile_name		IN VARCHAR2	Optional
379 --
380 -- 			p_perz_ddf_id		IN NUMBER	Optional
381 -- 			p_perz_ddf_context	IN VARCHAR2	Required
382 -- 			p_gui_object_name	IN VARCHAR2	Required
383 -- 			p_gui_object_id		IN NUMBER	Optional
384 -- 			p_ddf_value		IN VARCHAR2	Required
385 -- 			p_ddf_value_type	IN VARCHAR2	Required
386 --
387 -- OUT 	:
388 --			x_perz_ddf_id	    OUT NUMBER
389 -- 			x_return_status	 OUT VARCHAR2
390 -- 			x_msg_count	 OUT NUMBER
391 -- 			x_msg_data	 OUT VARCHAR2
392 --
393 --
394 --	Version	:	Current version	1.0
395 --			Initial version 1.0
396 --
397 --	Notes:
398 --		For a given data default object, this API only updates
399 --		associated value and type fields only.
400 --
401 --
402 -- *****************************************************************************
403 --
404 -- USAGE NOTES :
405 --
406 --	1. This API updates a Personalized data default in the personalization
407 --		framework.
408 --	2. The required fields are :
409 --	  3.1	p_perz_ddf_context
410 --	  3.2	p_gui_object_name (to which the value is associated with)
411 --	4. Rest of the parameters are optional. Wherever available ids may be
412 --		provided.
413 --	5. p_ddf_value will hold the personalized value for that ddf_name.
414 --	   p_ddf_value_type will hold the data type that of the value.
415 --
416 --	6. The main out parameter for this API is x_perz_ddf_id.
417 --	   This returns the data default id for the created data default object.
418 --	   Another important out parameter is x_return_status which returns
419 --		FND_API.G_RETURN_SUCCESS when the API completes successfully
420 --		FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
421 --		FND_API.G_RETURN_ERROR when the API hits an error
422 --
423 -- *****************************************************************************
424 
425 PROCEDURE update_data_default
426 (
427 	p_api_version_number	IN NUMBER,
428 	p_init_msg_list		IN VARCHAR2,
429 	p_commit		IN VARCHAR,
430 
431 	p_application_id	IN NUMBER,
432 
433 	p_profile_id		IN NUMBER,
437 	p_perz_ddf_context	IN VARCHAR2,
434 	p_profile_name		IN VARCHAR2,
435 
436 	p_perz_ddf_id		IN NUMBER,
438 
439 	p_gui_object_name	IN VARCHAR2,
440 	p_gui_object_id		IN NUMBER,
441 	p_ddf_value		IN VARCHAR2,
442 	p_ddf_value_type	IN VARCHAR2,
443 
444 	x_perz_ddf_id	    OUT NOCOPY /* file.sql.39 change */ NUMBER,
445 
446 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
447 	x_msg_count	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
448 	x_msg_data	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
449 );
450 -- *****************************************************************************
451 
452 -- Start of Comments
453 --
454 --	API name 	: delete_data_default
455 --	Type		: Public
456 --	Function	: Deletes a data dafault object in the framework.
457 --
458 --	Paramaeters	:
459 --	IN		:
460 -- 			p_api_version_number	IN NUMBER	Required
461 --   			p_init_msg_list		IN VARCHAR2	Optional
462 -- 			p_commit		IN VARCHAR	Optional
463 --
464 -- 			p_application_id	IN NUMBER	Required
465 -- 			p_profile_id        	IN NUMBER	Required
466 -- 			p_perz_ddf_id           IN NUMBER	Required
467 --
468 -- OUT 	:
469 -- 			x_return_status	 OUT VARCHAR2
470 -- 			x_msg_count	 OUT NUMBER
471 -- 			x_msg_data	 OUT VARCHAR2
472 --
473 --
474 --
475 --	Version	:	Current version	1.0
476 --			Initial version 1.0
477 --
478 --	Notes:
479 --		This API accepts only the ids - profile id, application id
480 --		and perz_ddf_id to delete the data default object.
481 --
482 -- *****************************************************************************
483 --
484 -- USAGE NOTES :
485 --
486 --	1. This API deletes the data default object from the framework.
487 --	2. The required fields are:
488 --		application_id
489 --		profile_id
490 --		perz_ddf_id
491 --	3. The out parameter for this API is x_return_status which returns
492 --	FND_API.G_RETURN_SUCCESS when the API completes successfully
493 --	FND_API.G_RETURN_UNEXPECTED when the API reaches a unxpected state
494 --	FND_API.G_RETURN_ERROR when the API hits an error
495 --
496 -- *****************************************************************************
497 
498 PROCEDURE delete_data_default
499 (	p_api_version_number	IN	NUMBER,
500   	p_init_msg_list		IN	VARCHAR2 	:= FND_API.G_FALSE,
501 	p_commit		IN 	VARCHAR		:= FND_API.G_FALSE,
502 
503 	p_application_id	IN NUMBER,
504 	p_profile_id        	IN NUMBER,
505 	p_perz_ddf_id           IN NUMBER,
506 
507 	x_return_status	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2,
508 	x_msg_count	 OUT NOCOPY /* file.sql.39 change */ NUMBER,
509 	x_msg_data	 OUT NOCOPY /* file.sql.39 change */ VARCHAR2
510 );
511 
512 END  jtf_perz_ddf_pub;