1 PACKAGE EGO_USER_ATTRS_DATA_PUB AUTHID DEFINER AS
2 /* $Header: EGOPEFBS.pls 120.7.12020000.2 2012/07/13 01:32:52 mshirkol ship $ */
3 /*#
4 * This package provides User-Defined Attributes functionality for
5 * various objects--most notably Items, but also any other objects
6 * that have enabled the User-Defined Attributes framework (e.g.,
7 * Projects, Structures, etc.).
8 * This includes DML (insertion, update, and deletion) on User-Defined
9 * Attribute data), retrieval of such data, and copying of data from
10 * one object to another. It also includes Change control on data for
11 * objects that have enabled Change functionality for the User-Defined
12 * Attributes framework (for information about Change functionality,
13 * refer to the Change Management documentation).
14 *
15 * ------------------
16 * -- Object Types --
17 * ------------------
18 *
19 * Each of the following data types is defined as an Oracle object type
20 * that exists independently in the database. They are discussed here
21 * because all of these types were created for use by this package.
22 *
23 * ==========================
24 * = EGO_USER_ATTR_DATA_OBJ =
25 * ==========================
26 *
27 *<code><pre>
28 CREATE EGO_USER_ATTR_DATA_OBJ AS OBJECT
29 (
30 ROW_IDENTIFIER NUMBER
31 ,ATTR_NAME VARCHAR2(30)
32 ,ATTR_VALUE_STR VARCHAR2(1000)
33 ,ATTR_VALUE_NUM NUMBER
34 ,ATTR_VALUE_DATE DATE
35 ,ATTR_DISP_VALUE VARCHAR2(1000)
36 ,ATTR_UNIT_OF_MEASURE VARCHAR2(3)
37 ,USER_ROW_IDENTIFIER NUMBER
38 );
39 *</pre></code>
40 *
41 * EGO_USER_ATTR_DATA_OBJ is an object type that contains data for one
42 * attribute in an attribute group row. ROW_IDENTIFIER is a foreign key
43 * that associates each EGO_USER_ATTR_DATA_OBJ to one EGO_USER_ATTR_ROW_OBJ
44 * (discussed below). ATTR_NAME holds the internal name of the attribute.
45 * The value being passed for the attribute is stored in ATTR_VALUE_STR if
46 * the attribute is a string (translatable or not), in ATTR_VALUE_NUM
47 * if the attribute is a number, in ATTR_VALUE_DATE if the attribute is
48 * a date or datetime, or in ATTR_DISP_VALUE if the attribute has a value
49 * set with distinct internal and display values. NOTE: the attribute
50 * value must be passed in exactly ~one~ of these four fields.
51 * If the attribute is a number that has a Unit of Measure class associated
52 * with it, ATTR_UNIT_OF_MEASURE stores the UOM Code for the Unit of Measure
53 * in which the attribute's value will be displayed; however, the value
54 * itself will always be passed in ATTR_VALUE_NUM in the base units for
55 * the Unit of Measure class, not in the display units (unless they happen
56 * to be the same). For example, consider an attribute whose Unit of
57 * Measure class is Length (a UOM Class whose base unit we will assume for
58 * this example to be Centimeters). If the caller wants data for this
59 * attribute to be displayed in Feet (assuming its UOM_CODE is 'FT'),
60 * then ATTR_UNIT_OF_MEASURE should be passed with 'FT'; however, no
61 * matter in what unit the caller wants to display this attribute, the
62 * value in ATTR_VALUE_NUM will always be the attribute's value as
63 * expressed in Centimeters.
64 * The final field in the object type, USER_ROW_IDENTIFIER, is a numeric
65 * value used when reporting errors for this EGO_USER_ATTR_DATA_OBJ. When
66 * the errors are written to the MTL_INTERFACE_ERRORS table, the TRANSACTION_ID
67 * column stores the value passed in USER_ROW_IDENTIFIER; thus, to find
68 * errors logged for this EGO_USER_ATTR_DATA_OBJ, search for rows in
69 * MTL_INTERFACE_ERRORS whose TRANSACTION_ID column values match the
70 * passed-in USER_ROW_IDENTIFIER.
71 *
72 * ============================
73 * = EGO_USER_ATTR_DATA_TABLE =
74 * ============================
75 *
76 *<code><pre>
77 CREATE EGO_USER_ATTR_DATA_TABLE AS TABLE OF EGO_USER_ATTR_DATA_OBJ;
78 *</pre></code>
79 *
80 * =========================
81 * = EGO_USER_ATTR_ROW_OBJ =
82 * =========================
83 *
84 *<code><pre>
85 CREATE EGO_USER_ATTR_ROW_OBJ AS OBJECT
86 (
87 ROW_IDENTIFIER NUMBER
88 ,ATTR_GROUP_ID NUMBER
89 ,ATTR_GROUP_APP_ID NUMBER
90 ,ATTR_GROUP_TYPE VARCHAR2(40)
91 ,ATTR_GROUP_NAME VARCHAR2(30)
92 ,DATA_LEVEL VARCHAR2(30)
93 ,DATA_LEVEL_1 VARCHAR2(150)
94 ,DATA_LEVEL_2 VARCHAR2(150)
95 ,DATA_LEVEL_3 VARCHAR2(150)
96 ,DATA_LEVEL_4 VARCHAR2(150)
97 ,DATA_LEVEL_5 VARCHAR2(150)
98 ,TRANSACTION_TYPE VARCHAR2(10)
99 );
100 *</pre></code>
101 *
102 * EGO_USER_ATTR_ROW_OBJ contains row-level data about one attribute group
103 * row. ROW_IDENTIFIER is the unique numeric identifier for this attribute
104 * group row within a set of rows to be processed; no two EGO_USER_ATTR_ROW_OBJ
105 * elements in any single API call can share the same ROW_IDENTIFIER value.
106 * The attribute group whose row-level data this EGO_USER_ATTR_ROW_OBJ
107 * contains is identified either by ATTR_GROUP_ID or by the combination
108 * of ATTR_GROUP_APP_ID, ATTR_GROUP_TYPE, and ATTR_GROUP_NAME. (The first
109 * field is the numeric key for an attribute group, and the latter three
110 * fields form the composite key for an attribute group.)
111 * DATA_LEVEL: The datalevel name at which you want to update this attribute group.
112 * Example: If you want to update the value of an attribute at the
113 * Item lavel, give ITEM_LEVEL for this.
114 * If the attribute group type has data levels defined and the attribute
115 * group is associated at a data level other than the highest data level
116 * defined for the attribute group type, the data level values are passed
117 * in DATA_LEVEL_1, DATA_LEVEL_2, DATA_LEVEL_3,
118 * DATA_LEVEL_4 and DATA_LEVEL_5 (as necessary).
119 * TRANSACTION_TYPE indicates the mode of DML operation to be performed
120 * on this attribute group row; valid values are
121 * EGO_USER_ATTRS_DATA_PVT.G_CREATE_MODE, EGO_USER_ATTRS_DATA_PVT.G_UPDATE_MODE,
122 * EGO_USER_ATTRS_DATA_PVT.G_DELETE_MODE, or, if the caller is uncertain
123 * whether this row exists in the database, EGO_USER_ATTRS_DATA_PVT.G_SYNC_MODE,
124 * which indicates that the API should determine whether to CREATE or
125 * UPDATE this attribute group row.
126 *
127 * ===========================
128 * = EGO_USER_ATTR_ROW_TABLE =
129 * ===========================
130 *
131 *<code><pre>
132 CREATE EGO_USER_ATTR_ROW_TABLE AS TABLE OF EGO_USER_ATTR_ROW_OBJ;
133 *</pre></code>
134 *
135 * ===============================
136 * = EGO_COL_NAME_VALUE_PAIR_OBJ =
137 * ===============================
138 *
139 *<code><pre>
140 CREATE EGO_COL_NAME_VALUE_PAIR_OBJ AS OBJECT
141 (
142 NAME VARCHAR2(30)
143 ,VALUE VARCHAR2(150)
144 );
145 *</pre></code>
146 *
147 * EGO_COL_NAME_VALUE_PAIR_OBJ contains the column name and corresponding
148 * value for one Primary Key, Classification Code, or other column relevant
149 * to the API.
150 *
151 * =================================
152 * = EGO_COL_NAME_VALUE_PAIR_ARRAY =
153 * =================================
154 *
155 *<code><pre>
156 CREATE EGO_COL_NAME_VALUE_PAIR_ARRAY AS VARRAY(6) OF EGO_COL_NAME_VALUE_PAIR_OBJ;
157 *</pre></code>
158 *
159 * ============================
160 * = EGO_USER_ATTR_CHANGE_OBJ =
161 * ============================
162 *
163 *<code><pre>
164 CREATE EGO_USER_ATTR_CHANGE_OBJ AS OBJECT
165 (
166 ROW_IDENTIFIER NUMBER
167 ,CHANGE_ID NUMBER
168 ,CHANGE_LINE_ID NUMBER
169 ,ACD_TYPE VARCHAR2(40))
170 );
171 *</pre></code>
172 *
173 * EGO_USER_ATTR_CHANGE_OBJ contains Change data for one attribute group
174 * row. ROW_IDENTIFIER is a foreign key that associates each
175 * EGO_USER_ATTR_CHANGE_OBJ to one EGO_USER_ATTR_ROW_OBJ (discussed above).
176 * CHANGE_ID and CHANGE_LINE_ID identify the Change Header and Line,
177 * respectively, that are applicable to the specified attribute group row.
178 * ACD_TYPE indicates whether the Change is of type Add, Change, or Delete
179 * (for details, refer to the Change Management documentation).
180 *
181 * ==============================
182 * = EGO_USER_ATTR_CHANGE_TABLE =
183 * ==============================
184 *
185 *<code><pre>
186 CREATE EGO_USER_ATTR_CHANGE_TABLE AS TABLE OF EGO_USER_ATTR_CHANGE_OBJ;
187 *</pre></code>
188 *
189 * ==============================
190 * = EGO_ATTR_GROUP_REQUEST_OBJ =
191 * ==============================
192 *
193 *<code><pre>
194 CREATE EGO_ATTR_GROUP_REQUEST_OBJ AS OBJECT
195 (
196 ATTR_GROUP_ID NUMBER
197 ,APPLICATION_ID NUMBER
198 ,ATTR_GROUP_TYPE VARCHAR2(40)
199 ,ATTR_GROUP_NAME VARCHAR2(30)
200 ,DATA_LEVEL_1 VARCHAR2(150)
201 ,DATA_LEVEL_2 VARCHAR2(150)
202 ,DATA_LEVEL_3 VARCHAR2(150)
203 ,ATTR_NAME_LIST VARCHAR2(3000)
204 );
205 *</pre></code>
206 *
207 * EGO_ATTR_GROUP_REQUEST_OBJ represents a request to retrieve data for
208 * one attribute group row from the database. It is very similar in
209 * structure to EGO_USER_ATTR_ROW_OBJ (discussed above); the notable
210 * difference is the field ATTR_NAME_LIST, which contains a comma-delimited
211 * list of attribute internal names specifying the attributes for which to
212 * retrieve data. If the field is empty, data will be fetched for all
213 * attributes in the attribute group row.
214 *
215 * ================================
216 * = EGO_ATTR_GROUP_REQUEST_TABLE =
217 * ================================
218 *
219 *<code><pre>
220 CREATE EGO_ATTR_GROUP_REQUEST_TABLE AS TABLE OF EGO_ATTR_GROUP_REQUEST_OBJ;
221 *</pre></code>
222 *
223 * ========================
224 * = EGO_VARCHAR_TBL_TYPE =
225 * ========================
226 *
227 *<code><pre>
228 CREATE EGO_VARCHAR_TBL_TYPE AS TABLE OF VARCHAR2(500);
229 *</pre></code>
230 *
231 * @rep:scope public
232 * @rep:product EGO
233 * @rep:displayname User-Defined Attributes
234 * @rep:lifecycle active
235 * @rep:category BUSINESS_ENTITY EGO_USER_DEFINED_ATTR_GROUP
236 */
237
238
239
240 ----------------
241 -- Procedures --
242 ----------------
243
244 /*#
245 * Processes User-Defined Attribute data for one object instance.
246 * Parameters provide identifying data and metadata for an object
247 * instance, along with an EGO_USER_ATTR_ROW_TABLE and an accompanying
248 * EGO_USER_ATTR_DATA_TABLE (described above). The procedure organizes
249 * the data from the two tables and calls Process_Row for each distinct
250 * attribute group row passing all the attribute data for that row.
251 * Current version: 1.0
252 *
253 * @param p_api_version Pass the value listed as 'Current version' above.
254 * @param p_object_name The name of the object to which this data applies
255 * (e.g., 'EGO_ITEM', 'PA_PROJECTS', etc.)
256 * @param p_attributes_row_table Contains row-level data and metadata
257 * about each attribute group being processed. See above for details
258 * about this data type.
259 * @param p_attributes_data_table Contains data and metadata about each
260 * attribute being processed. See above for details about this data type.
261 * @param p_pk_column_name_value_pairs Contains the Primary Key column
262 * names and values that identify the specific object instance to which
263 * this data applies. See above for details about this data type.
264 * @param p_class_code_name_value_pairs Contains the Classification Code(s)
265 * for the specific object instance to which this data applies. See
266 * above for details about this data type, and see User-Defined Attributes
267 * documentation for details about Classification Codes.
268 * 'RELATED_CLASS_CODE_LIST' has to be passed as name/value pair of
269 * p_pk_column_name_value_pairs, if parent-child hierarchy is involved
270 * @param p_user_privileges_on_object Contains the list of privileges
271 * granted to the current user on the specific object instance identified
272 * by p_pk_column_name_value_pairs. See above for details about this data
273 * type.
274 * @param p_entity_id Used in error reporting. See ERROR_HANDLER package
275 * for details.
276 * @param p_entity_index Used in error reporting. See ERROR_HANDLER package
277 * for details.
278 * @param p_entity_code Used in error reporting. See ERROR_HANDLER package
279 * for details.
280 * @param p_debug_level Used in debugging. Valid values range from 0 (no
281 * debugging) to 3 (full debugging). The debug file is created in the
282 * first directory in the list returned by the following query:
283 * SELECT VALUE FROM V$PARAMETER WHERE NAME = 'utl_file_dir';
284 * @param p_init_error_handler Indicates whether to initialize ERROR_HANDLER
285 * message stack (and open debug session, if applicable)
286 * @param p_write_to_concurrent_log Indicates whether to log ERROR_HANDLER
287 * messages to concurrent log (only applicable when called from concurrent
288 * program and when p_log_errors is passed as FND_API.G_TRUE).
289 * @param p_init_fnd_msg_list Indicates whether to initialize FND_MSG_PUB
290 * message stack.
291 * @param p_log_errors Indicates whether to write ERROR_HANDLER message
292 * stack to MTL_INTERFACE_ERRORS, the concurrent log (if applicable),
293 * and the debug file (if applicable); if FND_API.G_FALSE is passed,
294 * messages will still be added to ERROR_HANDLER's message stack, but
295 * the message stack will not be written to any destination.
296 * @param p_add_errors_to_fnd_stack Indicates whether messages written
297 * to ERROR_HANDLER message stack will also be written to FND_MSG_PUB
298 * message stack.
299 * @param p_commit Indicates whether to commit work for all attribute
300 * group rows that are processed successfully; if FND_API.G_FALSE is
301 * passed, the API will not commit any work.
302 * @param x_failed_row_id_list Returns a comma-delimited list of
303 * ROW_IDENTIFIERs (the field in EGO_USER_ATTR_ROW_OBJ, which is
304 * discussed above) indicating attribute group rows that failed
305 * in processing. An error will be logged for each failed row.
306 * @param x_return_status Returns one of three values indicating the
307 * most serious error encountered during processing:
308 * FND_API.G_RET_STS_SUCCESS if no errors occurred,
309 * FND_API.G_RET_STS_ERROR if at least one row encountered an error, and
310 * FND_API.G_RET_STS_UNEXP_ERROR if at least one row encountered an
311 * unexpected error.
312 * @param x_errorcode Reserved for future use.
313 * @param x_msg_count Indicates how many messages exist on ERROR_HANDLER
314 * message stack upon completion of processing.
315 * @param x_msg_data If exactly one message exists on ERROR_HANDLER
316 * message stack upon completion of processing, this parameter contains
317 * that message.
318 *
319 * @rep:scope public
320 * @rep:lifecycle active
321 * @rep:displayname Process User-Defined Attributes Data
322 */
323 PROCEDURE Process_User_Attrs_Data (
324 p_api_version IN NUMBER
325 ,p_object_name IN VARCHAR2
326 ,p_attributes_row_table IN EGO_USER_ATTR_ROW_TABLE
327 ,p_attributes_data_table IN EGO_USER_ATTR_DATA_TABLE
328 ,p_pk_column_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
329 ,p_class_code_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
330 ,p_user_privileges_on_object IN EGO_VARCHAR_TBL_TYPE DEFAULT NULL
331 ,p_entity_id IN NUMBER DEFAULT NULL
332 ,p_entity_index IN NUMBER DEFAULT NULL
333 ,p_entity_code IN VARCHAR2 DEFAULT NULL
334 ,p_debug_level IN NUMBER DEFAULT 0
335 ,p_init_error_handler IN VARCHAR2 DEFAULT FND_API.G_FALSE
336 ,p_write_to_concurrent_log IN VARCHAR2 DEFAULT FND_API.G_FALSE
337 ,p_init_fnd_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE
338 ,p_log_errors IN VARCHAR2 DEFAULT FND_API.G_FALSE
339 ,p_add_errors_to_fnd_stack IN VARCHAR2 DEFAULT FND_API.G_FALSE
340 ,p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE
341 ,x_failed_row_id_list OUT NOCOPY VARCHAR2
342 ,x_return_status OUT NOCOPY VARCHAR2
343 ,x_errorcode OUT NOCOPY NUMBER
344 ,x_msg_count OUT NOCOPY NUMBER
345 ,x_msg_data OUT NOCOPY VARCHAR2
346 );
347
348 /* Overload method with additional parameters x_extension_id, x_mode */
349
350 PROCEDURE Process_User_Attrs_Data (
351 p_api_version IN NUMBER
352 ,p_object_name IN VARCHAR2
353 ,p_attributes_row_table IN EGO_USER_ATTR_ROW_TABLE
354 ,p_attributes_data_table IN EGO_USER_ATTR_DATA_TABLE
355 ,p_pk_column_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
356 ,p_class_code_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
360 ,p_entity_code IN VARCHAR2 DEFAULT NULL
357 ,p_user_privileges_on_object IN EGO_VARCHAR_TBL_TYPE DEFAULT NULL
358 ,p_entity_id IN NUMBER DEFAULT NULL
359 ,p_entity_index IN NUMBER DEFAULT NULL
361 ,p_debug_level IN NUMBER DEFAULT 0
362 ,p_init_error_handler IN VARCHAR2 DEFAULT FND_API.G_FALSE
363 ,p_write_to_concurrent_log IN VARCHAR2 DEFAULT FND_API.G_FALSE
364 ,p_init_fnd_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE
365 ,p_log_errors IN VARCHAR2 DEFAULT FND_API.G_FALSE
366 ,p_add_errors_to_fnd_stack IN VARCHAR2 DEFAULT FND_API.G_FALSE
367 ,p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE
368 ,x_extension_id OUT NOCOPY NUMBER
369 ,x_mode OUT NOCOPY VARCHAR2
370 ,x_failed_row_id_list OUT NOCOPY VARCHAR2
371 ,x_return_status OUT NOCOPY VARCHAR2
372 ,x_errorcode OUT NOCOPY NUMBER
373 ,x_msg_count OUT NOCOPY NUMBER
374 ,x_msg_data OUT NOCOPY VARCHAR2
375 );
376
377
378 /*#
379 * Retrieves requested User-Defined Attribute data for one object instance.
380 * Parameters provide identifying data and metadata for an object instance,
381 * as well as an EGO_ATTR_GROUP_REQUEST_TABLE (described above) specifying
382 * the data to fetch. The procedure fetches the requested data from the
383 * database (transforming internal values to display values as necessary)
384 * and returns it in the form of two tables: an EGO_USER_ATTR_ROW_TABLE and
385 * a corresponding EGO_USER_ATTR_DATA_TABLE (both of which are described
386 * above).
387 * Current version: 1.0
388 *
389 * @param p_api_version Pass the value listed as 'Current version' above.
390 * @param p_object_name The name of the object to which this data applies
391 * (e.g., 'EGO_ITEM', 'PA_PROJECTS', etc.)
392 * @param p_pk_column_name_value_pairs Contains the Primary Key column
393 * names and values that identify the specific object instance to which
394 * this data applies. See above for details about this data type.
395 * @param p_attr_group_request_table Contains a list of elements, each
396 * of which identifies an attribute group whose data to retrieve. See
397 * above for details about this data type.
398 * @param p_user_privileges_on_object Contains the list of privileges
399 * granted to the current user on the specific object instance identified
400 * by p_pk_column_name_value_pairs. See above for details about this data
401 * type.
402 * @param p_entity_id Used in error reporting. See ERROR_HANDLER package
403 * for details.
404 * @param p_entity_index Used in error reporting. See ERROR_HANDLER package
405 * for details.
406 * @param p_entity_code Used in error reporting. See ERROR_HANDLER package
407 * for details.
408 * @param p_debug_level Used in debugging. Valid values range from 0 (no
409 * debugging) to 3 (full debugging). The debug file is created in the
410 * first directory in the list returned by the following query:
411 * SELECT VALUE FROM V$PARAMETER WHERE NAME = 'utl_file_dir';
412 * @param p_init_error_handler Indicates whether to initialize ERROR_HANDLER
413 * message stack (and open debug session, if applicable)
414 * @param p_init_fnd_msg_list Indicates whether to initialize FND_MSG_PUB
415 * message stack.
416 * @param p_add_errors_to_fnd_stack Indicates whether messages written
417 * to ERROR_HANDLER message stack will also be written to FND_MSG_PUB
418 * message stack.
419 * @param p_commit Indicates whether to commit work for all processing
420 * done by the API (which is currently none, as this API does not alter
421 * any database values); if FND_API.G_FALSE is passed, the API will not
422 * commit any work.
423 * @param x_attributes_row_table Contains row-level data and metadata
424 * about each attribute group whose data is being returned. See above
425 * for details about this data type.
426 * @param x_attributes_data_table Contains data and metadata about each
427 * attribute whose data is being returned. See above for details about
428 * this data type.
429 * @param x_return_status Returns one of three values indicating the
430 * most serious error encountered during processing:
431 * FND_API.G_RET_STS_SUCCESS if no errors occurred,
432 * FND_API.G_RET_STS_ERROR if at least one error occurred, and
433 * FND_API.G_RET_STS_UNEXP_ERROR if at least one unexpected error occurred.
434 * @param x_errorcode Reserved for future use.
435 * @param x_msg_count Indicates how many messages exist on ERROR_HANDLER
436 * message stack upon completion of processing.
437 * @param x_msg_data If exactly one message exists on ERROR_HANDLER
438 * message stack upon completion of processing, this parameter contains
439 * that message.
440 *
441 * @rep:scope public
442 * @rep:lifecycle active
443 * @rep:displayname Get User-Defined Attributes Data
444 */
445 PROCEDURE Get_User_Attrs_Data (
446 p_api_version IN NUMBER
447 ,p_object_name IN VARCHAR2
448 ,p_pk_column_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
449 ,p_attr_group_request_table IN EGO_ATTR_GROUP_REQUEST_TABLE
450 ,p_user_privileges_on_object IN EGO_VARCHAR_TBL_TYPE DEFAULT NULL
451 ,p_entity_id IN VARCHAR2 DEFAULT NULL
452 ,p_entity_index IN NUMBER DEFAULT NULL
453 ,p_entity_code IN VARCHAR2 DEFAULT NULL
454 ,p_debug_level IN NUMBER DEFAULT 0
455 ,p_init_error_handler IN VARCHAR2 DEFAULT FND_API.G_FALSE
456 ,p_init_fnd_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE
457 ,p_add_errors_to_fnd_stack IN VARCHAR2 DEFAULT FND_API.G_FALSE
461 ,x_return_status OUT NOCOPY VARCHAR2
458 ,p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE
459 ,x_attributes_row_table OUT NOCOPY EGO_USER_ATTR_ROW_TABLE
460 ,x_attributes_data_table OUT NOCOPY EGO_USER_ATTR_DATA_TABLE
462 ,x_errorcode OUT NOCOPY NUMBER
463 ,x_msg_count OUT NOCOPY NUMBER
464 ,x_msg_data OUT NOCOPY VARCHAR2
465 );
466
467
468
469 /*#
470 * Copies all User-Defined Attribute data from one object instance to
471 * another object instance of the same type (e.g., from one EGO_ITEM to
472 * another or one PA_PROJECTS to another). Parameters provide
473 * identifying data and metadata for a source object instance and
474 * a destination object instance (referred to as "old" and "new",
475 * respectively); the procedure then copies all attribute group rows
476 * from the "old" instance (across all attribute group types) to
477 * the "new" instance.
478 * Current version: 1.0
479 *
480 * @param p_api_version Pass the value listed as 'Current version' above.
481 * @param p_application_id The application ID of the attribute groups that
482 * are to be copied (in other words, the first part of their composite key)
483 * @param p_object_id The numeric identifier of the object of which the
484 * source and destination object instances are examples (e.g., the numeric
485 * ID for EGO_ITEM, PA_PROJECTS, etc.)
486 * @param p_object_name The name of the object of which the source and
487 * destination object instances are examples (e.g., 'EGO_ITEM',
488 * 'PA_PROJECTS', etc.)
489 * @param p_old_pk_col_value_pairs Contains the Primary Key column
490 * names and values that identify the specific source object instance
491 * whose data is to be copied. See above for details about this data type.
492 * @param p_old_data_level_id If the attribute group type supports multiple
493 * data levels, pass the id of the data level from which you want to
494 * copy information (eg.: If attribute group type is 'EGO_ITEMMGMT_GROUP'
495 * and you want to copy values from a item level attribute group, pass 43101.
496 * @param p_old_dtlevel_col_value_pairs If the attribute group type has data
497 * levels defined and the source object instance contains any attribute
498 * groups that are associated at a data level other than the highest level
499 * defined for the attribute group type (e.g., if the attribute group type
500 * is 'EGO_ITEMMGMT_GROUP' and the EGO_ITEM has at least one attribute
501 * group associated at the ITEM_REVISION_LEVEL), then this will contain
502 * data level column names and values up to and including those for the
503 * lowest data level at which any attribute group is associated. See above
504 * for details about this data type.
505 * @param p_new_pk_col_value_pairs As p_old_pk_col_value_pairs, except that
506 * these values identify the destination object instance instead of the
507 * source object instance. See above for details about this data type.
508 * @param p_new_data_level_id If the attribute group type supports multiple
509 * data levels, pass the id of the data level to which you want to
510 * copy information (eg.: If attribute group type is 'EGO_ITEMMGMT_GROUP'
511 * and you want to copy values to a item revision level attribute group,
512 * pass 43106.
513 * @param p_new_dtlevel_col_value_pairs As p_old_dtlevel_col_value_pairs,
514 * except that these values are for the destination object instance
515 * instead of the source object instance. See above for details about
516 * this data type.
517 * @p_new_cc_col_value_pairs Contains the Classification Code(s) for the
518 * destination object instance. See above for details about this data
519 * type, and see User-Defined Attributes documentation for details about
520 * Classification Codes.
521 * @param p_init_error_handler Indicates whether to initialize ERROR_HANDLER
522 * message stack.
523 * @param p_init_fnd_msg_list Indicates whether to initialize FND_MSG_PUB
524 * message stack.
525 * @param p_add_errors_to_fnd_stack Indicates whether messages written
526 * to ERROR_HANDLER message stack will also be written to FND_MSG_PUB
527 * message stack.
528 * @param p_commit Indicates whether to commit work if all attribute
529 * group rows are copied successfully; if FND_API.G_FALSE is passed,
530 * the API will not commit any work.
531 * @param x_return_status Returns one of three values indicating the
532 * most serious error encountered during processing:
533 * FND_API.G_RET_STS_SUCCESS if no errors occurred,
534 * FND_API.G_RET_STS_ERROR if at least one error occurred, and
535 * FND_API.G_RET_STS_UNEXP_ERROR if at least one unexpected error occurred.
536 * @param x_errorcode Reserved for future use.
537 * @param x_msg_count Indicates how many messages exist on ERROR_HANDLER
538 * message stack upon completion of processing.
539 * @param x_msg_data If exactly one message exists on ERROR_HANDLER
540 * message stack upon completion of processing, then this parameter
541 * contains that message.
542 *
543 * @rep:scope public
544 * @rep:lifecycle active
545 * @rep:displayname Copy User-Defined Attributes Data
546 */
547 PROCEDURE Copy_User_Attrs_Data (
548 p_api_version IN NUMBER
549 ,p_application_id IN NUMBER
550 ,p_object_id IN NUMBER DEFAULT NULL
551 ,p_object_name IN VARCHAR2 DEFAULT NULL
552 ,p_old_pk_col_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
553 ,p_old_data_level_id IN NUMBER DEFAULT NULL --bug 8941665
554 ,p_old_dtlevel_col_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY DEFAULT NULL
555 ,p_new_pk_col_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
556 ,p_new_data_level_id IN NUMBER DEFAULT NULL --bug 8941665
557 ,p_new_dtlevel_col_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY DEFAULT NULL
561 ,p_add_errors_to_fnd_stack IN VARCHAR2 DEFAULT FND_API.G_FALSE
558 ,p_new_cc_col_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY DEFAULT NULL
559 ,p_init_error_handler IN VARCHAR2 DEFAULT FND_API.G_FALSE
560 ,p_init_fnd_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE
562 ,p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE
563 ,x_return_status OUT NOCOPY VARCHAR2
564 ,x_errorcode OUT NOCOPY NUMBER
565 ,x_msg_count OUT NOCOPY NUMBER
566 ,x_msg_data OUT NOCOPY VARCHAR2
567 );
568
569 /*#
570 * Validate_Required_Attrs validates data for one object instance by
571 * checking which fields required fields does not have a value.
572 * The procedure takes in a primary key object, the object name,
573 * class code and data level information, as well as a list of
574 * attribute group types on which object data should be
575 * validated.
576 * The procedure returns a table of user attribute object listing
577 * required attributes for which the object does not have a value.
578 * Current version: 1.0
579 *
580 * @param p_api_version Pass the value listed as 'Current version' above.
581 * @param p_object_name The name of the object to which this data applies
582 * (e.g., 'EGO_ITEM', 'PA_PROJECTS', etc.)
583 * @param p_pk_column_name_value_pairs Contains the Primary Key column
584 * names and values that identify the specific object instance to which
585 * this data applies. See above for details about this data type.
586 * @param p_class_code_name_value_pairs Contains the Classification Code(s)
587 * for the specific object instance to which this data applies. See
588 * above for details about this data type, and see User-Defined Attributes
589 * documentation for details about Classification Codes.
590 * @param p_data_level_name_value_pairs Contains data level information
591 * for the specific object instance to which this data applies. See
592 * above for details about this data type.
593 * @param p_attr_group_type_table Contains a list of elements, each
594 * of which identifies an attribute group type whose data to retrieve.
595 * @param p_entity_id Used in error reporting. See ERROR_HANDLER package
596 * for details.
597 * @param p_entity_index Used in error reporting. See ERROR_HANDLER package
598 * for details.
599 * @param p_entity_code Used in error reporting. See ERROR_HANDLER package
600 * for details.
601 * @param p_debug_level Used in debugging. Valid values range from 0 (no
602 * debugging) to 3 (full debugging). The debug file is created in the
603 * first directory in the list returned by the following query:
604 * SELECT VALUE FROM V$PARAMETER WHERE NAME = 'utl_file_dir';
605 * @param p_init_error_handler Indicates whether to initialize ERROR_HANDLER
606 * message stack (and open debug session, if applicable)
607 * @param p_write_to_concurrent_log Indicates whether to log ERROR_HANDLER
608 * messages to concurrent log (only applicable when called from concurrent
609 * program and when p_log_errors is passed as FND_API.G_TRUE).
610 * @param p_init_fnd_msg_list Indicates whether to initialize FND_MSG_PUB
611 * message stack.
612 * @param p_log_errors Indicates whether to write ERROR_HANDLER message
613 * stack to MTL_INTERFACE_ERRORS, the concurrent log (if applicable),
614 * and the debug file (if applicable); if FND_API.G_FALSE is passed,
615 * messages will still be added to ERROR_HANDLER's message stack, but
616 * the message stack will not be written to any destination.
617 * @param p_add_errors_to_fnd_stack Indicates whether messages written
618 * to ERROR_HANDLER message stack will also be written to FND_MSG_PUB
619 * message stack.
620 * @param x_attributes_req_table Returns a table of user attribute
621 * object listing required attributes for which the object does not
622 * have a value.
623 * @param x_return_status Returns one of three values indicating the
624 * most serious error encountered during processing:
625 * FND_API.G_RET_STS_SUCCESS if no errors occurred
626 * FND_API.G_RET_STS_ERROR if at least one error occurred
627 * FND_API.G_RET_STS_UNEXP_ERROR if at least one unexpected error occurred
628 * @param x_errorcode Reserved for future use.
629 * @param x_msg_count Indicates how many messages exist on ERROR_HANDLER
630 * message stack upon completion of processing.
631 * @param x_msg_data If exactly one message exists on ERROR_HANDLER
632 * message stack upon completion of processing, this parameter contains
633 * that message.
634 *
635 * @rep:scope public
636 * @rep:lifecycle active
637 * @rep:displayname Validate Required Attributes
638 */
639
640 PROCEDURE Validate_Required_Attrs (
641 p_api_version IN NUMBER
642 ,p_object_name IN VARCHAR2
643 -- FND_OBJECTS.OBJECT_NAME
644 ,p_pk_column_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
645 -- Attr values to be validated
646 ,p_class_code_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
647 ,p_data_level_name IN EGO_DATA_LEVEL_B.DATA_LEVEL_NAME%TYPE := NULL
648 ,p_data_level_name_value_pairs IN EGO_COL_NAME_VALUE_PAIR_ARRAY
649 ,p_attr_group_type_table IN EGO_VARCHAR_TBL_TYPE
650 -- FND_DESCRIPTIVE_FLEXS.APPLICATION_TABLE_NAME
651 ,p_entity_id IN NUMBER
652 ,p_entity_index IN NUMBER
653 ,p_entity_code IN VARCHAR2
654 ,p_debug_level IN NUMBER
655 ,p_init_error_handler IN VARCHAR2
656 ,p_write_to_concurrent_log IN VARCHAR2
657 ,p_init_fnd_msg_list IN VARCHAR2
658 ,p_log_errors IN VARCHAR2
659 ,p_add_errors_to_fnd_stack IN VARCHAR2
663 ,x_msg_count OUT NOCOPY NUMBER
660 ,x_attributes_req_table OUT NOCOPY EGO_USER_ATTR_TABLE
661 ,x_return_status OUT NOCOPY VARCHAR2
662 ,x_errorcode OUT NOCOPY NUMBER
664 ,x_msg_data OUT NOCOPY VARCHAR2
665 );
666
667
668
669
670
671 /*#
672 * Build_Attr_Group_Row_Table builds up the EGO_USER_ATTR_ROW_TABLE.
673 * an instance of EGO_USER_ATTR_ROW_OBJ is built using the passed in
674 * infomation and appended to the table here.
675 * @param p_attr_group_row_table This is the table to which the row
676 * object is added.
677 * @param p_row_identifier Row identifier of the logical attribute
678 * group row.
679 * @param p_attr_group_id Attribute group id of the passed in attr group
680 * row.
681 * @param p_attr_group_app_id Application Id.
682 * @param p_attr_group_type Attribute group type of the attr group row
683 * being created.
684 * @param p_attr_group_name Attribute group internal name.
685 * @param p_data_level The data level internal name for which the attribute
686 * group data is being processed.
687 * @param p_data_level_1 The pk1 column value for the data level.
688 * @param p_data_level_2 The pk2 column value for the data level.
689 * @param p_data_level_3 The pk3 column value for the data level.
690 * @param p_data_level_4 The pk4 column value for the data level.
691 * @param p_data_level_5 The pk5 column value for the data level.
692 * @param p_transaction_type Transaction type, i.e. 'SYNC'/'CREATE'/'UPDATE'/'DELETE'
693 *
694 * @rep:scope public
695 * @rep:lifecycle active
696 * @rep:displayname Build attribute group row table.
697 */
698 FUNCTION Build_Attr_Group_Row_Table( p_attr_group_row_table IN EGO_USER_ATTR_ROW_TABLE
699 ,p_row_identifier IN NUMBER
700 ,p_attr_group_id IN NUMBER DEFAULT NULL
701 ,p_attr_group_app_id IN NUMBER
702 ,p_attr_group_type IN VARCHAR2
703 ,p_attr_group_name IN VARCHAR2
704 ,p_data_level IN VARCHAR2 DEFAULT NULL
705 ,p_data_level_1 IN VARCHAR2 DEFAULT NULL
706 ,p_data_level_2 IN VARCHAR2 DEFAULT NULL
707 ,p_data_level_3 IN VARCHAR2 DEFAULT NULL
708 ,p_data_level_4 IN VARCHAR2 DEFAULT NULL
709 ,p_data_level_5 IN VARCHAR2 DEFAULT NULL
710 ,p_transaction_type IN VARCHAR2
711 )
712 RETURN EGO_USER_ATTR_ROW_TABLE;
713
714 /*#
715 * Build_Attr_Group_Row_Object builds and trturns an instance of
716 * EGO_USER_ATTR_ROW_OBJ using the passed in infomation.
717 * @param p_row_identifier Row identifier of the logical attribute
718 * group row.
719 * @param p_attr_group_id Attribute group id of the passed in attr group
720 * row.
721 * @param p_attr_group_app_id Application Id.
722 * @param p_attr_group_type Attribute group type of the attr group row
723 * being created.
724 * @param p_attr_group_name Attribute group internal name.
725 * @param p_data_level The data level internal name for which the attribute
726 * group data is being processed.
727 * @param p_data_level_1 The pk1 column value for the data level.
728 * @param p_data_level_2 The pk2 column value for the data level.
729 * @param p_data_level_3 The pk3 column value for the data level.
730 * @param p_data_level_4 The pk4 column value for the data level.
731 * @param p_data_level_5 The pk5 column value for the data level.
732 * @param p_transaction_type Transaction type, i.e. 'SYNC'/'CREATE'/'UPDATE'/'DELETE'
733 *
734 * @rep:scope public
735 * @rep:lifecycle active
736 * @rep:displayname build attr group row object.
737 */
738
739 FUNCTION Build_Attr_Group_Row_Object( p_row_identifier IN NUMBER
740 ,p_attr_group_id IN NUMBER DEFAULT NULL
741 ,p_attr_group_app_id IN NUMBER
742 ,p_attr_group_type IN VARCHAR2
743 ,p_attr_group_name IN VARCHAR2
744 ,p_data_level IN VARCHAR2 DEFAULT NULL
745 ,p_data_level_1 IN VARCHAR2 DEFAULT NULL
746 ,p_data_level_2 IN VARCHAR2 DEFAULT NULL
747 ,p_data_level_3 IN VARCHAR2 DEFAULT NULL
748 ,p_data_level_4 IN VARCHAR2 DEFAULT NULL
749 ,p_data_level_5 IN VARCHAR2 DEFAULT NULL
750 ,p_transaction_type IN VARCHAR2
751 )
752 RETURN EGO_USER_ATTR_ROW_OBJ;
753
754
755 /*#
756 * Build_Attr_Group_Request_Table builds up the EGO_ATTR_GROUP_REQUEST_TABLE.
757 * An instance of EGO_ATTR_GROUP_REQUEST_OBJ is built using the passed in
758 * infomation and appended to the table here.
759 * @param p_ag_req_table This is the table to which the row object is added.
760 * @param p_attr_group_id Attribute group id for which the request object
761 * is to be built.
762 * @param p_application_id Application Id.
763 * @param p_attr_group_type Attribute group type of the attribute group.
764 * @param p_attr_group_name Attribute group internal name.
765 * @param p_data_level The data level internal name for which the attribute
766 * group request object is being built.
767 * @param p_data_level_1 The pk1 column value for the data level.
768 * @param p_data_level_2 The pk2 column value for the data level.
769 * @param p_data_level_3 The pk3 column value for the data level.
770 * @param p_data_level_4 The pk4 column value for the data level.
771 * @param p_data_level_5 The pk5 column value for the data level.
772 * @param p_attr_name_list Attribute name list.
773 *
774 * @rep:scope public
775 * @rep:lifecycle active
776 * @rep:displayname build attribute group request table.
777 */
778
779 FUNCTION Build_Attr_Group_Request_Table( p_ag_req_table IN EGO_ATTR_GROUP_REQUEST_TABLE
780 ,p_attr_group_id IN NUMBER DEFAULT NULL
781 ,p_application_id IN NUMBER
782 ,p_attr_group_type IN VARCHAR2
783 ,p_attr_group_name IN VARCHAR2
784 ,p_data_level IN VARCHAR2 DEFAULT NULL
785 ,p_data_level_1 IN VARCHAR2 DEFAULT NULL
786 ,p_data_level_2 IN VARCHAR2 DEFAULT NULL
787 ,p_data_level_3 IN VARCHAR2 DEFAULT NULL
788 ,p_data_level_4 IN VARCHAR2 DEFAULT NULL
789 ,p_data_level_5 IN VARCHAR2 DEFAULT NULL
790 ,p_attr_name_list IN VARCHAR2 DEFAULT NULL
791 )
792 RETURN EGO_ATTR_GROUP_REQUEST_TABLE;
793
794 /*#
795 * Build_Attr_Group_Request_Obj creates and returns an instance of
796 * EGO_ATTR_GROUP_REQUEST_OBJ using the passed in infomation.
797 * @param p_attr_group_id Attribute group id for which the request object
798 * is to be built.
799 * @param p_application_id Application Id.
800 * @param p_attr_group_type Attribute group type of the attribute group.
801 * @param p_attr_group_name Attribute group internal name.
802 * @param p_data_level The data level internal name for which the attribute
803 * group request object is being built.
804 * @param p_data_level_1 The pk1 column value for the data level.
805 * @param p_data_level_2 The pk2 column value for the data level.
806 * @param p_data_level_3 The pk3 column value for the data level.
807 * @param p_data_level_4 The pk4 column value for the data level.
808 * @param p_data_level_5 The pk5 column value for the data level.
809 * @param p_attr_name_list Attribute name list.
810 *
811 * @rep:scope public
812 * @rep:lifecycle active
813 * @rep:displayname build attribute group request table.
814 */
815 FUNCTION Build_Attr_Group_Request_Obj (p_attr_group_id IN NUMBER DEFAULT NULL
816 ,p_application_id IN NUMBER
817 ,p_attr_group_type IN VARCHAR2
818 ,p_attr_group_name IN VARCHAR2
819 ,p_data_level IN VARCHAR2 DEFAULT NULL
820 ,p_data_level_1 IN VARCHAR2 DEFAULT NULL
821 ,p_data_level_2 IN VARCHAR2 DEFAULT NULL
822 ,p_data_level_3 IN VARCHAR2 DEFAULT NULL
823 ,p_data_level_4 IN VARCHAR2 DEFAULT NULL
824 ,p_data_level_5 IN VARCHAR2 DEFAULT NULL
825 ,p_attr_name_list IN VARCHAR2 DEFAULT NULL
826 )
827 RETURN EGO_ATTR_GROUP_REQUEST_OBJ;
828
829
830
831 END EGO_USER_ATTRS_DATA_PUB;
832