DBA Data[Home] [Help]

PACKAGE: APPS.CZ_PB_MGR

Source


1 PACKAGE cz_pb_mgr AUTHID CURRENT_USER AS
5    from insert_jrad_doc.
2 /*  $Header: czpbmgrs.pls 120.68 2012/01/25 23:38:14 smanna ship $  */
3 /*
4    Introducing custom error message to handle remote exception
6 
7    Copying this help message to describe the use of
8    custom error message.
9 
10    'Package DBMS_STANDARD, which is supplied with Oracle,
11    provides language facilities that help your application interact with Oracle.
12    For example, the procedure raise_application_error lets you
13    issue user-defined error messages from stored subprograms.
14    That way, you can report errors to your application
15    and avoid returning unhandled exceptions.
16    To call raise_application_error, use the syntax
17    raise_application_error(error_number, message[, {TRUE | FALSE}]);
18    where error_number is a negative integer in the range -20000 .. -20999
19    and message is a character string up to 2048 bytes long.
20    If the optional third parameter is TRUE, the error is placed
21    on the stack of previous errors. If the parameter is FALSE (the default),
22    the error replaces all previous errors.
23    Package DBMS_STANDARD is an extension of package STANDARD,
24    so you need not qualify references to its contents.'
25 
26 */
27 
28    EXPLORETREE_ERROR EXCEPTION;
29    PRAGMA EXCEPTION_INIT(EXPLORETREE_ERROR, -20001);
30    v_server_id cz_model_publications.server_id%TYPE;
31    v_ui_def_id cz_model_publications.ui_def_id%TYPE;
32    v_export_id cz_pb_model_exports.export_id%TYPE;
33    v_publication_id cz_model_publications.publication_id%TYPE;
34    v_root_model_id cz_model_publications.model_id%TYPE;
35    v_root_ui_def_id cz_model_publications.ui_def_id%TYPE;
36    target_root_model_id cz_model_publications.model_id%TYPE;
37    v_status_code cz_model_publications.export_status%TYPE;
38    v_remote_comp_id cz_model_ref_expls.component_id%TYPE;
39    v_child_expl_id cz_model_ref_expls.child_model_expl_id%TYPE;
40    v_server_local_name cz_servers.local_name%TYPE;
41    v_target_ui_def_id cz_ui_defs.ui_def_id%TYPE;
42    v_ui_name cz_ui_defs.NAME%TYPE;
43    v_pb_run_id cz_xfr_run_infos.run_id%TYPE;
44    loguser cz_db_logs.loguser%TYPE;
45    v_deep_project_name cz_devl_projects.NAME%TYPE;
46    v_err_message cz_db_logs.MESSAGE%TYPE;
47    v_rp_folder_id cz_rp_entries.enclosing_folder%TYPE;
48    v_rp_name cz_rp_entries.NAME%TYPE;
49    v_rp_desc cz_rp_entries.description%TYPE;
50    v_sql_err_msg cz_db_logs.MESSAGE%TYPE;
51    v_db_link cz_servers.fndnam_link_name%TYPE;
52    v_prev_remote_publication_id cz_model_publications.publication_id%TYPE;
53    v_new_devl_id cz_devl_projects.devl_project_id%TYPE;
54    new_ui_def_id cz_ui_defs.ui_def_id%TYPE;
55    sequence_no NUMBER := 0;
56    v_oraclesequenceincr PLS_INTEGER := 0.0;
57    msg_count PLS_INTEGER := 0.0;
58    v_expr_count PLS_INTEGER := 0.0;
59    v_pb_log_flag VARCHAR2(5);
60    v_insert_string VARCHAR2(2000) := '';
61    sequence_const NUMBER := 0.0;
62    index_variable NUMBER := 0.0;
63 -----table_name variable used in insert_into_table procedure
64    v_insert_table_name VARCHAR2(128);
65    v_insert_error VARCHAR2(2000);
66    remote_publication_id cz_model_publications.remote_publication_id%TYPE;
67    v_ui_str VARCHAR2(6) := 'x';
68 ------------parameters of delete publication
69    d_pbid NUMBER;
70    vPubSingleLang cz_db_settings.value%TYPE := NULL;
71 --Added for Multi-Server Publication . SUN ER bug #10417318
72    vMultiServerPub cz_db_settings.value%TYPE := NULL;
73  ---SK----------
74    vBulkSelectInsert cz_db_settings.value%TYPE:=NULL;
75 
76 ------------msg record
77    TYPE t_messagerecord IS RECORD(
78       msg_text cz_db_logs.MESSAGE%TYPE
79      ,called_proc cz_db_logs.caller%TYPE
80      ,sql_code cz_db_logs.statuscode%TYPE
81    );
82 
83    TYPE t_columnrecord IS RECORD(
84       col_name VARCHAR2(100)
85      ,table_name VARCHAR2(100)
86    );
87 
88    TYPE t_collisionrecord IS RECORD(
89       old_value NUMBER
90      ,new_value NUMBER
91    );
92 
93    TYPE t_jradchunk IS RECORD(
94       jrad_doc VARCHAR2(2000)
95      ,seq_nbr NUMBER
96      ,CHUNK VARCHAR2(32767)
97    );
98 
99    TYPE jrad_chunks_tbl IS TABLE OF t_jradchunk
100       INDEX BY BINARY_INTEGER;
101 
102    cz_jrad_tbl jrad_chunks_tbl;
103 
104    TYPE collision_tbl IS TABLE OF t_collisionrecord
105       INDEX BY BINARY_INTEGER;
106 
107    TYPE col_plsql_table_list IS TABLE OF t_columnrecord
108       INDEX BY BINARY_INTEGER;
109 
110    TYPE propertytype IS TABLE OF cz_item_property_values.property_value%TYPE
111       INDEX BY BINARY_INTEGER;
112 
113    TYPE exprstrtype IS TABLE OF cz_expressions.expr_str%TYPE
114       INDEX BY BINARY_INTEGER;
115 
116    TYPE exprflgtype IS TABLE OF cz_expressions.parsed_flag%TYPE
117       INDEX BY BINARY_INTEGER;
118 
119    TYPE rulesusagetype IS TABLE OF cz_rules.effective_usage_mask%TYPE
120       INDEX BY BINARY_INTEGER;
121 
122    TYPE rulesefftype IS TABLE OF cz_rules.effective_from%TYPE
123       INDEX BY BINARY_INTEGER;
124 
125    TYPE propdatatype IS TABLE OF cz_ps_prop_vals.data_value%TYPE
126       INDEX BY BINARY_INTEGER;
127 
128    TYPE lcetexttype IS TABLE OF cz_lce_texts.lce_text%TYPE
129       INDEX BY BINARY_INTEGER;
130 
131    TYPE orig_sys_ref_type IS TABLE OF VARCHAR2(255)
132       INDEX BY BINARY_INTEGER;
133 
134    TYPE orig_sys_ref_type_vc2 IS TABLE OF VARCHAR2(255)
135       INDEX BY VARCHAR2(255);
136 
137    TYPE t_lang_code IS TABLE OF fnd_languages.language_code%TYPE
138       INDEX BY BINARY_INTEGER;
139 
140    TYPE ref_cursor IS REF CURSOR;
141 
142    TYPE model_id_table IS TABLE OF cz_model_publications.model_id%TYPE
143       INDEX BY BINARY_INTEGER;
144 
145    TYPE t_ref IS TABLE OF NUMBER
146       INDEX BY BINARY_INTEGER;
147 
148    TYPE t_ref_idx_vc2 IS TABLE OF NUMBER
149       INDEX BY VARCHAR2(15);
150 
151    TYPE usage_name_list IS TABLE OF cz_model_usages.NAME%TYPE
152       INDEX BY BINARY_INTEGER;
153 
154    TYPE msg_text_list IS TABLE OF t_messagerecord
155       INDEX BY BINARY_INTEGER;
156 
157    TYPE t_alias_name IS TABLE OF VARCHAR2(255)
158       INDEX BY BINARY_INTEGER;
159 
160    TYPE keystrtype IS TABLE OF cz_ui_node_props.key_str%TYPE
161       INDEX BY BINARY_INTEGER;
162 
163    TYPE number_type_tbl IS TABLE OF NUMBER
164       INDEX BY BINARY_INTEGER;
165 
166    TYPE varchar_type_tbl IS TABLE OF VARCHAR2(2000)
167       INDEX BY BINARY_INTEGER;
168 
169    TYPE jraddoc_type_tbl IS TABLE OF cz_ui_pages.jrad_doc%TYPE
170       INDEX BY BINARY_INTEGER;
171 
172    TYPE objtype IS TABLE OF cz_rule_folders.object_type%TYPE
173       INDEX BY BINARY_INTEGER;
174 
175    TYPE varchar_type_1_tbl IS TABLE OF VARCHAR2(1)
176       INDEX BY BINARY_INTEGER;
177 
178    TYPE varchar_type_8_tbl IS TABLE OF VARCHAR2(8)
179       INDEX BY BINARY_INTEGER;
180 
181    TYPE varchar_type_1000_tbl IS TABLE OF VARCHAR2(1000)
182       INDEX BY BINARY_INTEGER;
183 
184    TYPE varchar_type_4000_tbl IS TABLE OF VARCHAR2(4000)
185       INDEX BY BINARY_INTEGER;
186 
187    TYPE t_propertyrecord IS RECORD(
188       NAME cz_properties.NAME%TYPE
189      ,data_type cz_properties.data_type%TYPE
190      ,src_application_id cz_properties.src_application_id%TYPE
191    );
192 
193    TYPE t_typerecord IS RECORD(
194       NAME cz_item_types.NAME%TYPE
195      ,src_application_id cz_item_types.src_application_id%TYPE
196    );
197 
198    TYPE t_propertytable IS TABLE OF t_propertyrecord
199       INDEX BY BINARY_INTEGER;
200 
201    TYPE t_typetable IS TABLE OF t_typerecord
202       INDEX BY BINARY_INTEGER;
203 
204    TYPE table_of_propertytables IS TABLE OF t_propertytable
205       INDEX BY BINARY_INTEGER;
206 
207    TYPE date_tbl_type IS TABLE OF DATE
208       INDEX BY PLS_INTEGER;
209 
210 --Bug11685105
211    TYPE t_psnode_propval_rec IS RECORD(
212       ps_node_id cz_psnode_propval_v.PS_NODE_ID%TYPE,
213       new_ps_node_id cz_psnode_propval_v.PS_NODE_ID%TYPE,
214       data_type cz_psnode_propval_v.DATA_TYPE%TYPE,
215       property_num_value cz_psnode_propval_v.PROPERTY_NUM_VALUE%TYPE,
216       new_property_num_value cz_psnode_propval_v.PROPERTY_NUM_VALUE%TYPE,
217       property_value cz_psnode_propval_v.PROPERTY_VALUE%TYPE,
218       item_type_id cz_psnode_propval_v.ITEM_TYPE_ID%TYPE,
219       valuesource cz_psnode_propval_v.VALUESOURCE%TYPE,
220       devl_project_id cz_devl_projects.DEVL_PROJECT_ID%TYPE,
221       def_num_value cz_psnode_propval_v.def_num_value%TYPE
222    );
223 
224    TYPE t_psnode_propval_table IS TABLE OF t_psnode_propval_rec
225       INDEX BY BINARY_INTEGER;
226 
227    v_psnode_propval_tbl t_psnode_propval_table;
228 --Bug11685105
229 
230 
231    g_ps_uits_add_tbl date_tbl_type;         -- cz_ps_nodes.UI_TIMESTAMP_ADD
232    v_specs_alias_name_ref t_alias_name;
233 ---------------------------------------
234    v_cz_ps_nodes_new_tbl t_ref;
235    v_cz_ps_nodes_old_tbl t_ref;
236    v_cz_ps_nodes_idx_tbl t_ref_idx_vc2;
237    v_ps_parent_id_tbl t_ref;
238    v_ps_refid_old_tbl t_ref;
239    v_devl_project_tbl t_ref;
240    v_ref_model_id_tbl t_ref;
241    v_cz_ps_nodes_comp_tbl t_ref;
242    v_ps_item_id_tbl t_ref;
243    v_ps_item_id_ref t_ref;
244    v_cz_ps_nodes_new_ref t_ref;
245    v_cz_ps_nodes_old_ref t_ref;
246    v_ps_parent_id_ref t_ref;
247    v_ps_ref_id_ref t_ref;
248    v_ref_model_id_ref t_ref;
249    v_cz_ps_nodes_comp_ref t_ref;
250    v_ps_eff_set_id_ref t_ref;
251    v_ps_eff_set_id_tbl t_ref;
252    v_ps_intl_old_tbl t_ref;
253    v_ps_intl_old_ref t_ref;
254    v_ps_viol_old_tbl t_ref;
255    v_ps_viol_old_ref t_ref;
256    v_ps_capt_rule_ref t_ref;
257    v_ps_capt_rule_tbl t_ref;
258    v_ps_type_old_tbl t_ref;
259    v_ps_type_old_ref t_ref;
260    v_ps_src_appl_id_old_tbl t_ref; -- Bug9619157 Two new arrays to resolve item for reference BOM Node.
261    v_ps_src_appl_id_old_ref t_ref;
262    v_cz_model_ref_expls_new_ref t_ref;
263    v_cz_model_ref_expls_old_ref t_ref;
264    v_component_id_old_ref t_ref;
265    v_parent_expl_id_ref t_ref;
266    v_child_expl_id_ref t_ref;
267    v_referring_node_id_ref t_ref;
268    v_component_id_old_tbl t_ref;
272    v_cz_model_ref_expls_idx_ref t_ref_idx_vc2;
269    v_parent_expl_id_tbl t_ref;
270    v_child_expl_id_tbl t_ref;
271    v_referring_node_id_tbl t_ref;
273    v_cz_ui_defs_new_ref t_ref;
274    v_cz_ui_defs_old_ref t_ref;
275    v_cz_ui_defs_old_oa_ref t_ref;
276    v_cz_ui_defs_old_tbl t_ref;
277    v_ui_devl_id_ref t_ref;
278    v_ui_comp_id_ref t_ref;
279    v_ui_devl_id_tbl t_ref;
280    v_ui_comp_id_tbl t_ref;
281    v_ui_defs_mcpt_rule_ref t_ref;
282    v_ui_defs_pcpt_rule_ref t_ref;
283    v_cz_ui_nodes_new_ref t_ref;
284    v_cz_ui_nodes_old_ref t_ref;
285    v_cz_ui_nodes_ui_def_id_ref t_ref;
286    v_cz_ui_nodes_parent_id_ref t_ref;
287    v_cz_ui_nodes_ui_ref_id_ref t_ref;
288    v_cz_ui_nodes_ps_node_id_ref t_ref;
289    v_cz_ui_nodes_component_id_ref t_ref;
290    v_cz_ui_nodes_ui_dref_id_ref t_ref;
291    v_cz_ui_nodes_expl_id_ref t_ref;
292    v_cz_ui_nodes_fcomp_id_ref t_ref;
293    v_cz_ui_nodes_capt_id_ref t_ref;
294    v_cz_ui_nodes_tool_id_ref t_ref;
295    g_ui_node_prop_new_node_tbl t_ref;
296    g_ui_node_prop_old_node_tbl t_ref;
297    g_ui_node_prop_new_uidf_tbl t_ref;
298    g_ui_node_prop_old_uidf_tbl t_ref;
299    v_cz_intl_text_new_ref t_ref;
300    v_cz_intl_text_old_ref t_ref;
301    v_cz_folders_id_old_ref t_ref;
302    v_cz_folders_id_idx_ref t_ref_idx_vc2;
303    v_cz_folders_id_new_ref t_ref;
304    v_cz_folders_pf_id_ref t_ref;
305    v_cz_folders_pj_id_ref t_ref;
306    v_cz_folders_id_old_tbl t_ref;
307    v_cz_folders_id_new_tbl t_ref;
308    v_cz_folders_eff_ref t_ref;
309    v_cz_folders_orig_ref orig_sys_ref_type;
310    v_cz_folders_obj_ref objtype;
311    v_cz_rules_obj_ref objtype;
312    v_cz_rules_ui_ref t_ref;
313    v_cz_enodes_enode_id_idx_ref t_ref_idx_vc2;
314    v_cz_enodes_enode_id_old_ref t_ref;
315    v_cz_enodes_enode_id_new_ref t_ref;
316    v_cz_enodes_expr_id_ref t_ref;
317    v_cz_enodes_psnode_id_ref t_ref;
318    v_cz_enodes_gcol_id_ref t_ref;
319    v_cz_enodes_pexpr_id_ref t_ref;
320    v_cz_enodes_mrefl_id_ref t_ref;
321    v_cz_enodes_rule_id_tbl t_ref;
322    v_cz_enodes_rule_id_ref t_ref;
323    v_cz_enodes_arg_sig_id_tbl t_ref;
324    v_cz_enodes_par_sig_id_tbl t_ref;
325    v_cz_enodes_prop_id_tbl t_ref;
326    v_cz_enodes_arg_sig_id_ref t_ref;
327    v_cz_enodes_par_sig_id_ref t_ref;
328    v_cz_enodes_prop_id_ref t_ref;
329    v_cz_expr_sig_ref t_ref;
330    v_cz_expr_sig_idx_ref t_ref_idx_vc2;
331    v_cz_enodes_expr_id_tbl t_ref;
332    v_cz_enodes_psnode_id_tbl t_ref;
333    v_cz_enodes_gcol_id_tbl t_ref;
334    v_cz_enodes_pexpr_id_tbl t_ref;
335    v_cz_enodes_mrefl_id_tbl t_ref;
336    v_cz_enodes_enode_id_new_tbl t_ref;
337    v_cz_enodes_enode_id_old_tbl t_ref;
338    v_cz_rules_persistent_id_ref t_ref;
339    v_cz_rules_rule_id_old_ref t_ref;
340    v_cz_rules_rule_id_new_ref t_ref;
341    v_cz_rules_rule_id_idx_ref t_ref_idx_vc2;
342    v_cz_rules_grid_id_ref t_ref;
343    v_cz_rules_rf_id_ref t_ref;
344    v_cz_rules_proj_id_ref t_ref;
345    v_cz_rules_comp_id_ref t_ref;
346    v_cz_rules_ant_id_ref t_ref;
347    v_cz_rules_con_id_ref t_ref;
348    v_cz_rules_rea_id_ref t_ref;
349    v_cz_rules_unmsg_id_ref t_ref;
350    v_cz_intl_unmsg_idx_ref t_ref;
351    v_cz_rules_eff_id_ref t_ref;
352    v_cz_rules_expl_ref t_ref;
353    v_cz_rules_sig_ref t_ref;
354    v_cz_rules_sig_idx_ref t_ref;
355    v_sig_new_ref t_ref;
356    v_sig_old_ref t_ref;
357    v_sig_idx_ref t_ref_idx_vc2;
358    v_arg_sig_tbl t_ref;
359    v_data_sig_tbl t_ref;
360    v_arg_sig_old_tbl t_ref;
361    v_arg_ind_old_tbl t_ref;
362    v_cz_des_feature_id_old_ref t_ref;
363    v_cz_des_feature_id_new_ref t_ref;
364    v_cz_des_feature_rid_new_ref t_ref;
365    v_cz_des_feature_rule_id_ref t_ref;
366    v_cz_des_feature_mrefl_id_ref t_ref;
367    v_cz_des_feature_ft_typ_ref t_ref;
368    v_cz_des_cells_rule_id_new_ref t_ref;
369    v_cz_des_cells_rule_id_old_ref t_ref;
370    v_cz_des_cells_sf_id_ref t_ref;
371    v_cz_des_cells_sopt_id_ref t_ref;
372    v_cz_des_cells_popt_id_ref t_ref;
373    v_cz_des_cells_sexpl_id_ref t_ref;
374    v_cz_des_cells_mark_char_ref exprflgtype;
375    v_cz_eff_sets_old_tbl t_ref;
376    v_cz_eff_sets_new_tbl t_ref;
377    v_ref_child_remote_model t_ref;
378    v_ref_child_remote_ref t_ref;
379    v_remote_ref_expl_ref t_ref;
380    v_ref_child_source_model t_ref;
381    v_ref_child_source_ref t_ref;
382    v_source_ref_expl_ref t_ref;
383    v_prop_vals_node_tbl t_ref;
384    v_prop_vals_prop_tbl t_ref;
385    v_prop_vals_data_tbl propdatatype;
386    v_prop_vals_num_tbl t_ref;
387    v_prop_vals_origsys_tbl propdatatype;
388    v_prop_vals_datanum_tbl t_ref;
389    v_prop_vals_num_ref t_ref;
390    v_prop_vals_origsys_ref propdatatype;
391    v_prop_vals_datanum_ref t_ref;
392    v_prop_vals_node_ref t_ref;
393    v_prop_vals_prop_ref t_ref;
394    v_prop_vals_data_ref propdatatype;
395    v_prop_vals_data_typ_ref t_ref;
396    v_prop_vals_data_num_ref t_ref;
397    v_prop_vals_intl_text_ref t_ref;
398    v_propval_node_id cz_ps_prop_vals.ps_node_id%TYPE;
399    v_propval_prop_id cz_ps_prop_vals.property_id%TYPE;
400    v_propval_data_value cz_ps_prop_vals.data_value%TYPE;
401    v_propval_data_num_value cz_ps_prop_vals.data_num_value%TYPE;
402    v_model_usages_tbl t_ref;
403    v_cz_ui_nodes_idx_ref t_ref_idx_vc2;
404    v_cz_ui_defs_idx_ref t_ref_idx_vc2;
405    v_intl_text_model_tbl t_ref;
406    v_intl_text_ui_tbl t_ref;
407 -------mls implementation
408    v_src_lang_code_tbl propertytype;
409    v_tgt_lang_code_tbl propertytype;
410    v_pb_lang_ref propertytype;
411    v_src_lang_ref propertytype;
412    v_remote_prop_ref t_ref;
413    v_property_record_ref t_propertytable;
417    v_cz_model_pub_old_id cz_model_publications.publication_id%TYPE;
414    v_type_property_record_ref table_of_propertytables;
415    v_type_record_ref t_typetable;
416    v_cz_model_pub_new_id cz_model_publications.publication_id%TYPE;
418    v_models_to_be_exported t_ref;
419    v_models_not_to_be_exported t_ref;
420    v_models_to_be_exported_new t_ref;
421    v_cz_express_expr_id_new_ref1 t_ref;
422    array_uis t_ref;
423    v_cz_func_comp_new_tbl t_ref;
424    v_cz_func_comp_old_tbl t_ref;
425    v_cz_func_devl_old_tbl t_ref;
426    v_cz_func_rule_old_tbl t_ref;
427    v_cz_func_expl_old_tbl t_ref;
428    v_cz_func_comp_idx_ref t_ref_idx_vc2;
429    v_cz_func_comp_new_ref t_ref;
430    v_cz_func_comp_old_ref t_ref;
431    v_cz_func_devl_old_ref t_ref;
432    v_cz_func_cid_old_ref t_ref;
433    v_cz_func_expl_old_ref t_ref;
434    v_cz_func_fld_old_ref t_ref;
435    v_cz_func_obj_ref objtype;
436    v_cz_enodes_seq_nbr_ref t_ref;
437    v_cz_enodes_item_type_id_ref t_ref;
438    v_cz_enodes_item_id_ref t_ref;
439    v_cz_enodes_filter_set_id_ref t_ref;
440    v_cz_enodes_property_id_ref t_ref;
441    v_cz_enodes_compile_advice_ref t_ref;
442    v_cz_enodes_expr_type_ref t_ref;
443    v_cz_enodes_expr_subtype_ref t_ref;
444    v_cz_enodes_token_list_seq_ref t_ref;
445    v_cz_enodes_col_ref t_ref;
446    v_cz_enodes_seq_nbr_tbl t_ref;
447    v_cz_enodes_item_type_id_tbl t_ref;
448    v_cz_enodes_item_id_tbl t_ref;
449    v_cz_enodes_filter_set_id_tbl t_ref;
450    v_cz_enodes_property_id_tbl t_ref;
451    v_cz_enodes_compile_advice_tbl t_ref;
452    v_cz_enodes_col_tbl t_ref;
453    v_cz_enodes_expr_type_tbl t_ref;
454    v_cz_enodes_expr_subtype_tbl t_ref;
455    v_cz_enodes_token_list_seq_tbl t_ref;
456    v_item_masters_tbl t_ref;
457    v_item_masters_ref t_ref;
458    v_item_prop_data_typ_ref t_ref;
459    v_item_types_tbl t_ref;
460    v_item_types_new_ref t_ref;
461    v_item_types_ref t_ref;
462    v_item_prop_id_tbl t_ref;
463    v_item_prop_type_tbl t_ref;
464    v_item_prop_num_val_tbl t_ref;
465    v_item_prop_id_ref t_ref;
466    v_item_prop_type_ref t_ref;
467    v_item_prop_num_val_ref t_ref;
468    v_item_prop_data_typ_tbl t_ref;
469    v_it_prop_vals_id_tbl t_ref;
470    v_it_prop_vals_id_ref t_ref;
471    v_it_prop_vals_item_tbl t_ref;
472    v_it_prop_vals_item_ref t_ref;
473    v_it_prop_value_tbl propertytype;
474    v_it_prop_value_ref propertytype;
475    v_item_types_orig_ref orig_sys_ref_type;
476    v_items_orig_ref orig_sys_ref_type;
477    v_enodes_values_tbl propertytype;
478    v_enodes_values_ref propertytype;
479    v_enodes_fldname_tbl propertytype;
480    v_enodes_fldname_ref propertytype;
481    v_cz_express_name_ref propertytype;
482    v_cz_express_expr_str_ref exprstrtype;
483    v_cz_express_desc_text_ref propertytype;
484    v_cz_express_present_typ_ref t_ref;
485    v_cz_express_parsed_flg_ref exprflgtype;
486    v_cz_express_pers_id_ref t_ref;
487    v_cz_lce_headers_old_tbl t_ref;
488    v_cz_lce_headers_new_tbl t_ref;
489    v_cz_lce_headers_new_ref t_ref;
490    v_cz_lce_headers_old_ref t_ref;
491    v_cz_lce_headers_idx_ref t_ref_idx_vc2;
492    v_cz_lce_comp_id_ref t_ref;
493    v_cz_lce_expl_id_ref t_ref;
494    v_cz_lce_devl_id_ref t_ref;
495    v_specs_attach_expl_id_ref t_ref;
496    v_specs_lce_header_id_ref t_ref;
497    v_specs_required_expl_id_ref t_ref;
498    v_specs_attach_comp_id_ref t_ref;
499    v_specs_model_id_ref t_ref;
500    v_specs_net_type_ref t_ref;
501    v_cz_eff_sets_idx_tbl t_ref_idx_vc2;
502    v_cz_intl_text_idx_ref t_ref_idx_vc2;
503    v_imported_ps_ref t_ref;
504    v_imported_ps_node NUMBER := 0.0;
505 -----bomsynch
506    v_cz_intl_orig_sys_ref orig_sys_ref_type;
507    v_ps_orig_sys_ref orig_sys_ref_type;
508    v_ps_comp_seq_path_ref orig_sys_ref_type;
509    v_ps_comp_seq_id_ref t_ref;
510    v_ps_orig_sys_tbl orig_sys_ref_type;
511    v_ps_comp_seq_path_tbl orig_sys_ref_type;
512    v_ps_comp_seq_id_tbl t_ref;
513    bomsynch_flag VARCHAR2(1) := 'N';
514    l_intl_text_id NUMBER := 0;
515    l_bom_caption_rule NUMBER := 0;
516    l_nonbom_capt_rule_id NUMBER := 0;
517    l_devl_proj_inv_id NUMBER := 0;
518    l_devl_proj_org_id NUMBER := 0;
519    l_devl_proj_product_key cz_devl_projects.product_key%TYPE;
520    l_bom_caption_text_id cz_devl_projects.bom_caption_text_id%TYPE;
521    l_nonbom_caption_text_id cz_devl_projects.nonbom_caption_text_id%TYPE;
522 -----new tech stack arrays
523    v_templates_tobe_exported t_ref;
524    v_templates_not_exported t_ref;
525    v_global_templs_ref t_ref;
526    v_global_templs_exported t_ref;
527    l_template_id_ref t_ref;
528    l_ui_def_id_ref t_ref;
529    l_element_type_ref t_ref;
530    l_element_id_ref t_ref;
531    l_pers_elem_ref t_ref;
532    v_usages_lang_tbl t_lang_code;
533 --------------------commit size variables
534    end_count NUMBER := 0;
535    start_count NUMBER := 0;
536    last_set BOOLEAN;
537 ----------constants for sequences
538    CZ_PS_NODES_SEQ CONSTANT PLS_INTEGER := 1;
539    CZ_MODEL_REF_EXPLS_SEQ CONSTANT PLS_INTEGER := 2;
540    CZ_FUNC_COMP_SPECS_SEQ CONSTANT PLS_INTEGER := 3;
541    CZ_UI_DEFS_SEQ CONSTANT PLS_INTEGER := 4;
542    CZ_UI_NODES_SEQ CONSTANT PLS_INTEGER := 5;
543    CZ_INTL_TEXTS_SEQ CONSTANT PLS_INTEGER := 6;
544    CZ_RULE_FOLDERS_SEQ CONSTANT PLS_INTEGER := 7;
545    CZ_GRID_DEFS_SEQ CONSTANT PLS_INTEGER := 8;
546    CZ_GRID_COLS_SEQ CONSTANT PLS_INTEGER := 9;
547    CZ_EXPRESSIONS_SEQ CONSTANT PLS_INTEGER := 10;
548    CZ_EXPRESSION_NODES_SEQ CONSTANT PLS_INTEGER := 11;
549    CZ_RULES_SEQ CONSTANT PLS_INTEGER := 12;
550    CZ_GRID_CELLS_SEQ CONSTANT PLS_INTEGER := 13;
551    CZ_LCE_HEADERS_SEQ CONSTANT PLS_INTEGER := 14;
555    CZ_UI_TEMPLATES_SEQ CONSTANT PLS_INTEGER := 18;
552    CZ_MODEL_PUBLICATIONS_SEQ CONSTANT PLS_INTEGER := 15;
553    CZ_EFFECTIVITY_SETS_SEQ CONSTANT PLS_INTEGER := 16;
554    CZ_CONFIG_MESSAGES_SEQ CONSTANT PLS_INTEGER := 17;
556    CZ_SIGNATURES_SEQ CONSTANT PLS_INTEGER := 19;
557    CZ_ARCHIVES_SEQ CONSTANT PLS_INTEGER := 20;
558    CZ_FILTER_SETS_SEQ CONSTANT PLS_INTEGER := 21;
559    CZ_POPULATORS_SEQ CONSTANT PLS_INTEGER := 22;
560    CZ_UI_ACTIONS_SEQ CONSTANT PLS_INTEGER := 23;
561    CZ_PROPERTIES_SEQ CONSTANT PLS_INTEGER := 24;
562    CZ_ITEM_MASTERS_SEQ CONSTANT PLS_INTEGER := 25;
563    CZ_ITEM_TYPES_SEQ CONSTANT PLS_INTEGER := 26;
564    CZ_FCE_FILES_SEQ CONSTANT PLS_INTEGER := 27;
565 
566    v_msg_tbl msg_text_list;
567 ----variables used for orig_sys_ref returned by bomsynch
568    v_devl_orig_sys_ref cz_devl_projects.orig_sys_ref%TYPE;
569    v_it_masters_sys_ref VARCHAR2(255);
570    v_it_types_sys_ref VARCHAR2(255);
571    v_bomsynch_product_key cz_model_publications.product_key%TYPE;
572    v_bomsynch_org_id cz_model_publications.organization_id%TYPE;
573    v_bomsynch_item_id cz_model_publications.top_item_id%TYPE;
574 ---variables used by republish model
575    v_orig_start_date DATE;
576    v_orig_end_date DATE;
577    v_repub_appl_from DATE;
578    v_repub_appl_until DATE;
579    v_republish_model NUMBER := -1;
580    v_repub_remote_pb_id cz_model_publications.remote_publication_id%TYPE;
581 ------------variables used in publication functions
582    model_ref_expl_id_table t_ref;
583    v_last_struct_update DATE;
584 ----global declarations for item schema bug# 2463594
585 ----avoid using literals
586    g_item_type_id cz_item_types.item_type_id%TYPE;
587    g_item_id cz_item_masters.item_id%TYPE;
588 -- Array define to hold sequence count for each sequencer
589    v_sequence_count t_ref;
590    v_next_sequence_gen t_ref;
591 ------exceptions
592    pb_upload_ps_schema EXCEPTION;
593    pb_upload_ui_schema EXCEPTION;
594    pb_upload_rule_schema EXCEPTION;
595    pb_upload_item_schema EXCEPTION;
596    no_load_specs_data EXCEPTION;
597    insert_table_error EXCEPTION;
598    run_id_error EXCEPTION;
599    verify_model_error EXCEPTION;
600    proc_export_error EXCEPTION;
601    cz_pb_global_synch EXCEPTION;
602 ------------------------------------
603    PUBLICATION_ERROR CONSTANT VARCHAR2(3) := 'ERR';
604    PUBLICATION_OK CONSTANT VARCHAR2(3) := 'OK';
605    PUBLICATION_PROCESSING CONSTANT VARCHAR2(3) := 'PRC';
606    PUBLICATION_PENDING CONSTANT VARCHAR2(3) := 'PEN';
607    PUBLICATION_PEN_UPDATE CONSTANT VARCHAR2(3) := 'PUP';
608    PUB_SOURCE_TARGET_FLAG CONSTANT VARCHAR2(1) := 'T';
609    PS_NODE_REF_TYPE CONSTANT NUMBER := 263;
610    SEQUENCE_INCR_STR CONSTANT VARCHAR2(20) := 'OracleSequenceIncr';
611    record_commit_str CONSTANT VARCHAR2(20) := 'CommitSize';
612    publication_log CONSTANT VARCHAR2(20) := 'PublicationLogging';
613    pb_timing_log CONSTANT VARCHAR2(20) := 'PublicationTiming';
614    rule_copy CONSTANT VARCHAR2(20) := 'PublishingCopyRules';
615    empty_string CONSTANT VARCHAR2(5) := '  ';
616    null_string CONSTANT VARCHAR2(4) := 'NULL';
617    reasonid CONSTANT VARCHAR2(4) := '... ';
618    unmsgid CONSTANT VARCHAR2(3) := 'GS ';
619    pbnewline CONSTANT VARCHAR2(25) := fnd_global.NEWLINE;
620    non_virtual_component CONSTANT NUMBER := 259;
621    model_connector CONSTANT NUMBER := 264;
622    record_not_deleted CONSTANT VARCHAR2(1) := '0';
623    record_commit_size PLS_INTEGER := 500;
624    global_export_retcode PLS_INTEGER := 0;
625    global_process_retcode PLS_INTEGER := 0;
626    publication_timing CONSTANT NUMBER := 0;
627    v_new_object_id cz_rp_entries.object_id%TYPE;
628    model_copy CONSTANT VARCHAR2(20) := 'DEEP_MODEL_COPY';
629    pub_model CONSTANT VARCHAR2(20) := 'PUBLISHMODEL';
630    cz_publish CONSTANT VARCHAR2(30) := 'PUBLISH_NEW_MODEL';
631    cz_republish CONSTANT VARCHAR2(30) := 'REPUBLISH_EXISTING_MODEL';
632    copy_rules VARCHAR2(3) := 'YES';
633    copy_uis VARCHAR2(3) := 'YES';
634    copy_root_only VARCHAR2(3) := 'YES';
635    bom_synch_flag VARCHAR2(3) := 'NO';
636    v_session_parameter VARCHAR2(20) := empty_string;
637    new_copy_mode CONSTANT NUMBER := 0;
638    rebublish_mode CONSTANT NUMBER := 1;
639    repub_new_copy CONSTANT NUMBER := 2;
640    no_mode CONSTANT NUMBER := -1;
641    new_copy_str CONSTANT VARCHAR2(20) := 'new copy';
642    repub_str CONSTANT VARCHAR2(20) := 'republish model';
643    v_repub_parameter VARCHAR2(20) := empty_string;
644    refresh_rules_count CONSTANT NUMBER := -666;
645    v_refresh_rules VARCHAR2(3) := 'NO';
646    g_log_timing NUMBER := 1;
647    bom_item CONSTANT NUMBER := 0;
648    nonbom_item CONSTANT NUMBER := 1;
649    PUB_LANGUAGE CONSTANT VARCHAR2(50) := 'APPS_PREFER_LANG';
650 --Added to allow multi server publications. SUN ER. bug #10417318
651    MULTI_SERVER_PUB CONSTANT VARCHAR2(50) := 'MultiServerPublication';
652    --------------9812709---------------------------
653    BULK_SELECT_INSERT CONSTANT VARCHAR2(50) := 'UseBulkSelectInsert';
654    remote_bulk_size CONSTANT PLS_INTEGER := 1000000;
655 
656 ------->>>>>>rewrite variables
657    template_publication CONSTANT VARCHAR2(3) := 'UIT';
658    model_publication CONSTANT VARCHAR2(3) := 'PRJ';
659    seed_data CONSTANT VARCHAR2(1) := '1';
660    oa_ui_style CONSTANT VARCHAR2(3) := '7';
661    locks_in_prod_mode CONSTANT VARCHAR2(200) := 'CZ_ALLOW_PUBLISH_TO_PRODUCTION_WHEN_LOCKED';
662    locks_in_test_mode CONSTANT VARCHAR2(200) := 'CZ_ALLOW_PUBLISH_TO_TEST_WHEN_LOCKED';
663 -----priv constants
664    publish_model_function CONSTANT VARCHAR2(100) := 'CZDEVPUBLISHFUNC';
665    has_no_privilege CONSTANT VARCHAR2(1) := 'F';
666    has_privilege CONSTANT VARCHAR2(1) := 'T';
667    use_entity_access_control CONSTANT VARCHAR2(100) := 'CZ_USE_ENTITY_ACCESS_CONTROL';
668 
669    TYPE varchar_tbl_type IS TABLE OF VARCHAR2(255)
670       INDEX BY BINARY_INTEGER;
671 
675    g_source_flag cz_model_publications.source_target_flag%TYPE;
672    TYPE varchar_tbl_type_3 IS TABLE OF cz_rp_entries.object_type%TYPE
673       INDEX BY BINARY_INTEGER;
674 
676    g_target_flag cz_model_publications.source_target_flag%TYPE;
677    g_migration_group_id cz_model_publications.migration_group_id%TYPE;
678    g_object_type cz_model_publications.object_type%TYPE;
679    g_template_id cz_ui_templates.template_id%TYPE;
680    g_jrad_doc cz_ui_templates.jrad_doc%TYPE;
681    g_button_tmpl_id cz_ui_templates.template_id%TYPE;
682    g_main_msg_id cz_ui_templates.main_message_id%TYPE;
683    g_title_id cz_ui_templates.title_id%TYPE;
684    pbdebug NUMBER := 0;
685    g_button_tbl t_ref;
686    g_message_tbl t_ref;
687    g_title_tbl t_ref;
688    g_jrad_doc_tbl varchar_tbl_type;
689    g_cz_ui_pages_ui_def_ref t_ref;
690    g_pages_ui_def_old_ref t_ref;
691    g_cz_ui_pages_jrad_doc_ref varchar_tbl_type;
692    g_cz_ui_old_jrad_doc_ref varchar_tbl_type;
693    g_cz_ui_pages_capt_id_ref t_ref;
694    g_cz_ui_pages_stat_templ t_ref;
695    g_cz_ui_pages_stat_ui t_ref;
696    g_cz_uipg_tmplid_tbl t_ref;
697    g_cz_uipg_tmplui_tbl t_ref;
698    g_intl_text_id_ref t_ref;
699    g_cz_ui_pages_ui_def_tbl t_ref;
700    g_cz_ui_pages_jrad_doc_tbl varchar_tbl_type;
701    g_cz_ui_pages_capt_id_tbl t_ref;
702    g_cz_ui_pages_dis_cond_tbl t_ref;
703    g_cz_ui_pages_enb_cond_tbl t_ref;
704    g_cz_ui_pages_expl_tbl t_ref;
705    g_page_sets_ui_old_ref t_ref;
706    g_page_sets_ui_ref t_ref;
707    g_page_sets_pg_tbl t_ref;
708    g_page_sets_jrad_doc_ref varchar_type_tbl;
709    g_page_sets_expl_tbl t_ref;
710    g_page_refs_ui_def_old_ref t_ref;
711    g_page_refs_ui_def_new_ref t_ref;
712    g_page_refs_pg_set_ref t_ref;
713    g_page_refs_pg_ref_ref t_ref;
714    g_page_refs_tgt_expl_tbl t_ref;
715    g_page_refs_cond_id_ref t_ref;
716    g_page_refs_capt_id_ref t_ref;
717    g_page_refs_tgt_ui_ref t_ref;
718    g_page_refs_cpt_rule_tbl t_ref;
719    g_ui_refs_old_ui_def_ref t_ref;
720    g_ui_refs_new_ui_def_ref t_ref;
721    g_ui_refs_ref_ui_def_ref t_ref;
722    g_ui_refs_expl_id_ref t_ref;
723    g_ui_refs_ref_ui_def_old_ref t_ref;
724    g_ui_refs_expl_id_old_ref t_ref;
725    g_ui_ps_maps_old_ui_def_ref t_ref;
726    g_ui_ps_maps_new_ui_def_ref t_ref;
727    g_ui_ps_maps_ctrl_tmp_ref t_ref;
728    g_ui_ps_maps_elem_sig_tbl t_ref;
729    g_ui_ps_maps_tgt_pg_ui_def_tbl t_ref;
730    g_ui_ps_maps_page_id_tbl t_ref;
731    g_ui_ps_maps_expl_id_tbl t_ref;
732    g_ui_ps_maps_templ_ui_tbl t_ref;
733    g_ui_ps_maps_element_tbl varchar_type_tbl;
734 
735    -- g_ui_templates_jrad_new_ref/g_ui_templates_jrad_old_ref: not published before, or exported
736    --      before but changed since, used for isnertion or updates, and for replace_enxtends
737    -- g_tmpl_jrad_old_tbl/g_tmpl_jrad_new_tbl, exported and no change since, used in replace_extends
738    g_tmpl_jrad_old_tbl varchar_type_tbl;
739    g_tmpl_jrad_new_tbl varchar_type_tbl;
740    g_ui_templates_old_temp_id_ref t_ref;
741    g_ui_templates_new_temp_id_ref t_ref;
742    g_ui_templates_idx_temp_ref t_ref_idx_vc2;
743    g_ui_templates_ui_def_old_ref t_ref;
744    mm_ui_tmpls_ui_def_old_ref t_ref;
745    g_ui_templates_ui_def_new_ref t_ref;
746    g_template_id_ref t_ref;
747    g_ref_template_id_ref t_ref;
748    g_ref_template_id_old_ref t_ref;
749    g_template_ui_ref t_ref;
750    g_ref_templ_ui_ref t_ref;
751    g_template_id_old_ref t_ref;
752    g_ui_templates_msg_id_ref t_ref;
753    g_ui_templates_title_ref t_ref;
754    g_ui_templates_jrad_new_ref varchar_type_tbl;
755    g_ui_templates_jrad_old_ref varchar_type_tbl;
756    g_ui_templates_button_tbl t_ref;
757    g_ui_templates_but_uidef_id t_ref;
758    g_cnt_typ_tmpls_old_uidef_ref t_ref;
759    g_cnt_typ_tmpls_new_uidef_ref t_ref;
760    g_cnt_typ_tmpls_tmpid_ref t_ref;
761    g_cnt_typ_tmpls_tgtuidef_ref t_ref;
762    g_cnt_typ_tmpls_cont_ref t_ref;
763    g_ui_actns_ui_act_id_ref t_ref;
764    g_ui_actns_ui_act_id_old_ref t_ref;
765    g_ui_actions_id_idx_ref t_ref_idx_vc2;
766    g_ui_actns_ui_uidef_ref t_ref;
767    g_ui_actns_ui_tgtui_ref t_ref;
768    g_ui_actns_ui_uidef_old_ref t_ref;
769    g_ui_actns_tgtexpl_ref t_ref;
770    g_ui_actns_ctx_comp_tbl t_ref;
771    g_ui_actns_ren_cond_tbl t_ref;
772    g_intl_text_model_tbl t_ref;
773    g_intl_text_ui_tbl t_ref;
774    g_archive_id_ref t_ref;
775    g_devl_proj_ref t_ref;
776    g_archives_new_ref t_ref;
777    g_archives_old_ref t_ref;
778    g_archives_old_tbl t_ref;
779    g_archives_idx_ref t_ref_idx_vc2;
780    g_archive_id_old_ref t_ref;
781    g_devl_proj_old_ref t_ref;
782    g_archives_obj_type varchar_tbl_type_3;
783    g_archives_mig_idx_ref t_ref_idx_vc2;
784    -- Bug 5514199; 12-Sep-2006; kdande; Moved the following plsql table declarations from package body
785    -- in order to use these plsql tables in dynamic sqls of package body
786    l_cnt_typ_tmpls_cont_ref cz_pb_mgr.t_ref;
787    l_cnt_typ_tmpls_new_uidef_ref cz_pb_mgr.t_ref;
788    l_ui_images_ui_ref cz_pb_mgr.t_ref;
789    l_ui_images_enty_tbl cz_pb_mgr.t_ref;
790    l_ui_images_usg_tbl cz_pb_mgr.t_ref;
791    h_devl_prj_by_intl_text t_ref_idx_vc2;
792    l_intl_text_id_tbl t_ref;
793    l_bom_caption_rule_tbl t_ref;
794    l_nonbom_caption_rule_tbl t_ref;
795    v_ui_images_ui_ref t_ref;
796    v_ui_images_ui_tbl t_ref;
797    v_ui_images_usg_tbl t_ref;
798    v_ui_images_enty_tbl t_ref;
799    v_filter_sets_new_id_ref t_ref;
800    v_filter_sets_id_ref t_ref;
801    v_filter_sets_devl_ref t_ref;
802    v_filter_sets_rule_ref t_ref;
803    v_filter_sets_idx_ref t_ref_idx_vc2;
804    v_populators_new_id_ref t_ref;
805    v_populators_id_ref t_ref;
806    v_populators_node_ref t_ref;
807    v_populators_set_id_ref t_ref;
808    g_jrad_trans_list jdr_utils.translationlist := jdr_utils.translationlist();
809    g_migration_tgt_folder_id cz_model_publications.migration_tgt_folder%TYPE;
810    g_mt_obj_type varchar_tbl_type_3;
811    g_mt_enclosing_fld_rp_entry t_ref;
812    g_ui_templates_obj_type varchar_tbl_type_3;
813    g_enclosing_fld_rp_entry t_ref;
814    g_eff_set_obj_type varchar_tbl_type_3;
815 
816    mm_intl_text_model_id_ref t_ref;
817 
818    -- 28b change
819    g_ps_reverse_connector_tbl t_ref;
820    g_uiact_prcpg_templ_tbl    t_ref;
821    g_uiact_prcpg_tmpui_tbl    t_ref;
822    g_uiact_prc_caption_tbl    t_ref;
823    g_uiact_pg_title_tbl       t_ref;
824    g_uiact_main_msg_tbl       t_ref;
825    g_fcefile_old_id_tbl       t_ref;
826    g_fcefile_new_id_tbl       t_ref;
827    g_fcefile_compid_tbl       t_ref;
828 
829 --Arrays for handling usage synch and re-keying during migration
830    TYPE t_eff_usage_mask IS TABLE OF cz_ps_nodes.effective_usage_mask%TYPE
831       INDEX BY BINARY_INTEGER;
832 
833    v_cz_effective_usage_mask_ref t_eff_usage_mask;
834    v_cz_effective_usage_mask_tbl t_eff_usage_mask;
835    v_cz_rule_usage_mask_tbl t_eff_usage_mask;
836    v_cz_ps_to_eff_usg_mask t_eff_usage_mask;
837    v_new_eff_usg_msk_tbl t_eff_usage_mask;
838    v_new_rul_usg_msk_tbl t_eff_usage_mask;
839 
840    TYPE t_usage_name IS TABLE OF cz_model_usages.NAME%TYPE
841       INDEX BY BINARY_INTEGER;
842 
843    v_old_usage_name_to_id_map t_usage_name;
844 
845    TYPE t_usage_name_1 IS TABLE OF cz_model_usages.model_usage_id%TYPE
846       INDEX BY VARCHAR2(2000);
847 
848    v_new_usage_name_to_id_map t_usage_name_1;
849    g_usg_name_processed t_usage_name_1;
850 
851    --Arrays for Mater template synch.
852    v_master_template_id_ref t_ref;
853 
854    TYPE t_mt_name IS TABLE OF cz_ui_defs.NAME%TYPE
855       INDEX BY BINARY_INTEGER;
856 
857    v_mt_name t_mt_name;
858    v_mt_old_id_tbl t_ref;
859    v_mt_old_id_ref t_ref;
860    v_mt_gen_id t_ref;
861    v_mt_old_only t_ref;
862 
863    TYPE t_mt_name_ref IS TABLE OF NUMBER
864       INDEX BY cz_ui_defs.NAME%TYPE;
865 
866    v_mt_name_ref t_mt_name_ref;
867 
868    TYPE t_mt_name_to_id_map IS TABLE OF cz_ui_defs.ui_def_id%TYPE
869       INDEX BY VARCHAR2(2000);
870 
871    v_new_mt_name_to_id_map t_mt_name_to_id_map;
872    v_mt_id_ref t_ref;
873    v_new_mt_id_ref t_ref;
874    v_new_mt_id_tbl t_ref;
875    v_mt_old_to_new_id t_ref_idx_vc2;
876 
877 --->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
878 --------sequence generator
879    FUNCTION sequence_generate(seq_const PLS_INTEGER, seq_name VARCHAR2, p_oraclesequenceincr NUMBER)
880       RETURN NUMBER;
881 
882 ----->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
883 ------------- procedure to publish a single model
884    PROCEDURE publish_model(publicationid IN NUMBER, x_run_id IN OUT NOCOPY NUMBER, x_pb_status IN OUT NOCOPY VARCHAR2);
885 
886 --------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
887 ---------procedure to publish all models
888    PROCEDURE publish_all_models;
889 
890 ------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
891 -------procedure to check if model is upto date
892    PROCEDURE model_upto_date(modelid IN NUMBER, uidefid IN NUMBER, status IN OUT NOCOPY VARCHAR2);
893 
894 -------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
895 ---------deep model copy
896    PROCEDURE deep_model_copy(
897       p_model_id IN NUMBER
898      ,p_server_id IN NUMBER
899      ,p_folder IN NUMBER
900      ,p_copy_rules IN NUMBER
901      ,p_copy_uis IN NUMBER
902      ,p_copy_root IN NUMBER
903      ,x_model_id OUT NOCOPY NUMBER
904      ,x_run_id OUT NOCOPY NUMBER
905      ,x_status OUT NOCOPY VARCHAR2
906    );
907 
908 --------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
909    PROCEDURE deep_model_copy(
910       p_model_id IN NUMBER
911      ,p_server_id IN NUMBER
912      ,p_folder IN NUMBER
913      ,p_copy_rules IN NUMBER
914      ,p_copy_uis IN NUMBER
915      ,p_copy_root IN NUMBER
916      ,x_return_status OUT NOCOPY VARCHAR2
917      ,x_msg_count OUT NOCOPY NUMBER
918      ,x_msg_data OUT NOCOPY VARCHAR2
919      ,p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_TRUE
920 );
921 
922 -------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
923 --------check overlap publications
924    PROCEDURE check_publication_overlap(
925       productkey IN VARCHAR2
926      ,publicationmode IN VARCHAR2
927      ,applicationid IN VARCHAR2
928      ,languageid IN VARCHAR2
929      ,usageid IN VARCHAR2
930      ,serverid IN NUMBER
931      ,startdate IN DATE
932      ,disabledate IN DATE
933      ,sourcetargetflag IN VARCHAR2
934      ,pubrecid IN NUMBER
935      ,publicationidstring OUT NOCOPY VARCHAR2
936    );
937 
938 ---------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
939 -----------------edit publication
940    PROCEDURE edit_publication(
941       publicationid IN NUMBER
942      ,applicationid IN OUT NOCOPY VARCHAR2
943      ,languageid IN OUT NOCOPY VARCHAR2
944      ,usageid IN OUT NOCOPY VARCHAR2
945      ,startdate IN DATE
946      ,disabledate IN DATE
947      ,publicationmode IN VARCHAR2
948      ,x_return_status OUT NOCOPY VARCHAR2
949      ,x_msg_count OUT NOCOPY NUMBER
950      ,x_msg_data OUT NOCOPY VARCHAR2
951    );
952 
953 ---------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
954 --------------
955    PROCEDURE edit_tgt_pub(
956       publicationid IN NUMBER
957      ,applicationid IN OUT NOCOPY VARCHAR2
958      ,languageid IN OUT NOCOPY VARCHAR2
959      ,usageid IN OUT NOCOPY VARCHAR2
960      ,startdate IN DATE
961      ,disabledate IN DATE
962      ,publicationmode IN VARCHAR2
963      ,x_return_status OUT NOCOPY VARCHAR2
964      ,x_msg_count OUT NOCOPY NUMBER
965      ,x_msg_data OUT NOCOPY VARCHAR2
966    );
967 
968 -------------------------------
969 ---------------enable publication
970    PROCEDURE enable_publication(
971       publicationid IN NUMBER
972      ,x_return_status OUT NOCOPY VARCHAR2
973      ,x_msg_count OUT NOCOPY NUMBER
974      ,x_msg_data OUT NOCOPY VARCHAR2
975    );
976 
977 ---------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
978 --------------disable publication
979    PROCEDURE disable_publication(
980       publicationid IN NUMBER
981      ,x_return_status OUT NOCOPY VARCHAR2
982      ,x_msg_count OUT NOCOPY NUMBER
983      ,x_msg_data OUT NOCOPY VARCHAR2
984    );
985 
986 ---------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
987 ----------delete publication
988    PROCEDURE delete_publication(
989       publicationid IN NUMBER
990      ,x_return_status OUT NOCOPY VARCHAR2
991      ,x_msg_count OUT NOCOPY NUMBER
992      ,x_msg_data OUT NOCOPY VARCHAR2
993    );
994 
995 --------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
996 ---------wrapper called by concurrent manager to publish models
997 ---------
998    PROCEDURE publish_single_model_cp(errbuf IN OUT NOCOPY VARCHAR2, retcode IN OUT NOCOPY PLS_INTEGER, p_publication_id NUMBER);
999 
1000    PROCEDURE publish_models_cp(errbuf IN OUT NOCOPY VARCHAR2, retcode IN OUT NOCOPY PLS_INTEGER);
1001 
1002 --------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1003 ----------------log errors
1004 ---------------
1005    PROCEDURE log_pb_errors(p_message IN VARCHAR2, p_urgency IN VARCHAR2, p_caller IN VARCHAR2, p_statuscode IN PLS_INTEGER);
1006 
1007 --------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1011       RETURN VARCHAR2;
1008    PROCEDURE reset_processing_pubs;
1009 
1010    FUNCTION retrieve_db_link(p_server_id PLS_INTEGER)
1012 
1013    FUNCTION is_val_number (p_str IN VARCHAR2) RETURN VARCHAR2;
1014 
1015    PROCEDURE republish_model(
1016       p_publication_id IN OUT NOCOPY NUMBER
1017      ,p_start_date IN OUT NOCOPY DATE
1018      ,p_end_date IN OUT NOCOPY DATE
1019      ,x_run_id OUT NOCOPY NUMBER
1020      ,x_status OUT NOCOPY cz_model_publications.export_status%TYPE
1021    );
1022 
1023    PROCEDURE create_republish_publication(
1024       p_publication_id IN NUMBER
1025      ,x_new_publication_id OUT NOCOPY NUMBER
1026      ,x_return_status OUT NOCOPY VARCHAR2
1027      ,x_msg_count OUT NOCOPY NUMBER
1028      ,x_msg_data OUT NOCOPY VARCHAR2
1029    );
1030 
1031 ------------>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1032 -----procedure to copy single UI
1033    PROCEDURE export_single_oa_ui(
1034       p_ui_def_id IN NUMBER
1035      ,x_ui_def_id OUT NOCOPY NUMBER
1036      ,x_return_status OUT NOCOPY VARCHAR2
1037      ,x_msg_count OUT NOCOPY NUMBER
1038      ,x_msg_data OUT NOCOPY VARCHAR2
1039    );
1040 
1041    PROCEDURE is_ui_upto_date(p_ui_def_id IN NUMBER, x_return_status OUT NOCOPY NUMBER, x_msg_data OUT NOCOPY VARCHAR2);
1042 
1043    FUNCTION is_ui_upto_date(p_ui_def_id IN NUMBER)
1044       RETURN VARCHAR2;
1045 
1046    PROCEDURE is_model_upto_date(p_model_id IN NUMBER, x_return_status IN OUT NOCOPY NUMBER, x_msg_data IN OUT NOCOPY VARCHAR2);
1047 
1048    PROCEDURE export_jrad_docs(
1049       p_document_name IN VARCHAR2
1050      ,p_link_name IN VARCHAR2
1051      ,x_return_status OUT NOCOPY VARCHAR2
1052      ,x_msg_count OUT NOCOPY NUMBER
1053      ,x_msg_data OUT NOCOPY VARCHAR2
1054    );
1055 
1056    PROCEDURE insert_jrad_docs (p_publication_id IN NUMBER);
1057 
1058    PROCEDURE export_jrad_docs(
1059       p_ui_def_id IN NUMBER
1060      ,p_link_name IN VARCHAR2
1061      ,x_return_status OUT NOCOPY VARCHAR2
1062      ,x_msg_count OUT NOCOPY NUMBER
1063      ,x_msg_data OUT NOCOPY VARCHAR2
1064    );
1065 
1066    PROCEDURE export_template_jrad_docs(
1067       p_link_name IN VARCHAR2
1068      ,x_return_status OUT NOCOPY VARCHAR2
1069      ,x_msg_count OUT NOCOPY NUMBER
1070      ,x_msg_data OUT NOCOPY VARCHAR2
1071    );
1072 
1073    PROCEDURE exploretree(
1074       p_jrad_parent_element IN jdr_docbuilder.ELEMENT
1075      ,p_dom_parent_element IN xmldom.domnode
1076      ,p_grouping_tag IN VARCHAR2
1077      ,p_link_name IN VARCHAR2
1078    );
1079 
1080    FUNCTION copy_name(p_devl_project_id IN NUMBER)
1081       RETURN VARCHAR2;
1082 
1083    PROCEDURE create_publication_request(
1084       p_model_id IN NUMBER
1085      ,p_ui_def_id IN NUMBER
1086      ,p_publication_mode IN VARCHAR2
1087      ,p_server_id IN NUMBER
1088      ,p_appl_id_tbl IN cz_pb_mgr.t_ref
1089      ,p_usg_id_tbl IN cz_pb_mgr.t_ref
1090      ,p_lang_tbl IN cz_pb_mgr.t_lang_code
1091      ,p_start_date IN DATE
1092      ,p_end_date IN DATE
1093      ,x_publication_id OUT NOCOPY NUMBER
1094      ,x_return_status OUT NOCOPY VARCHAR2
1095      ,x_msg_count OUT NOCOPY NUMBER
1096      ,x_msg_data OUT NOCOPY VARCHAR2
1097    );
1098 
1099    PROCEDURE edit_publication(
1100       publicationid IN NUMBER
1101      ,applicationid IN OUT NOCOPY cz_pb_mgr.t_ref
1102      ,languageid IN OUT NOCOPY cz_pb_mgr.t_lang_code
1103      ,usageid IN OUT NOCOPY cz_pb_mgr.t_ref
1104      ,startdate IN DATE
1105      ,disabledate IN DATE
1106      ,publicationmode IN VARCHAR2
1107      ,x_return_status OUT NOCOPY VARCHAR2
1108      ,x_msg_count OUT NOCOPY NUMBER
1109      ,x_msg_data OUT NOCOPY VARCHAR2
1110    );
1111 
1112    PROCEDURE seed_fnd_application_cp(errbuf IN OUT NOCOPY VARCHAR2, retcode IN OUT NOCOPY PLS_INTEGER, p_application_name VARCHAR2);
1113 
1114 --model migration
1115 --more columns required for property resolution
1116    v_prop_vals_item_type_id_ref t_ref;
1117    v_prop_vals_item_id_ref t_ref;
1118    v_prop_vals_valuesource_ref varchar_type_8_tbl;
1119    v_prop_vals_inherited_flag_ref varchar_type_1_tbl;
1120    model_publication_obselete CONSTANT VARCHAR2(3) := 'OBS';
1121    pub_maybe_obsoleted EXCEPTION;
1122    prop_valuesource_itemdefault CONSTANT VARCHAR2(7) := 'ItmDflt';
1123    prop_valuesource_item CONSTANT VARCHAR2(4) := 'Item';
1124    prop_valuesource_itemtype CONSTANT VARCHAR2(6) := 'ItmTyp';
1125    prop_valuesource_psdefault CONSTANT VARCHAR2(6) := 'PsDflt';
1126    prop_valuesource_psvalue CONSTANT VARCHAR2(7) := 'PsValue';
1127    mm_v_tbl_sync_prop_type varchar_tbl_type_3;
1128    mm_v_tbl_sync_prop_folder t_ref;
1129    mm_v_ui_from_msttmp_id_tbl t_ref;
1130    mm_v_tbl_sync_prop t_ref_idx_vc2;
1131    mm_v_tbl_sync_prop_vals_num t_ref_idx_vc2;
1132    mm_v_tbl_prop_vals_trans_old t_ref;
1133    mm_v_tbl_prop_vals_trans_new t_ref;
1134    mm_v_ht_sync_all_prop t_ref_idx_vc2;
1135    mm_v_ht_sync_all_prop_val_num t_ref;
1136    mm_v_ht_sync_item_type t_ref_idx_vc2;
1137    mm_v_ht_sync_item_type_items t_ref_idx_vc2;
1138    mm_v_ht_sync_items t_ref_idx_vc2;
1139    mm_v_ht_sync_it_propval_itm t_ref_idx_vc2;
1140    mm_v_ht_sync_exist_items t_ref;
1141    mm_v_ht_sync_exist_item_types t_ref;  --Bug9180063
1142    mm_v_ps_item_id_tbl t_ref;
1143    mm_v_ps_item_type_id_tbl t_ref; --Bug9180063
1144    mm_v_ht_sync_item_prop t_ref;
1145    mm_v_ht_sync_item_type_prop t_ref_idx_vc2;
1146    mm_v_ht_sync_itmtype_for_prop t_ref_idx_vc2;
1147    mm_v_ht_sync_ps_propval t_ref;
1148    mm_v_ht_sync_it_propval t_ref_idx_vc2;
1149    mm_v_ht_sync_archives t_ref;
1150    mm_v_ht_sync_archive_refs t_ref;
1151    mm_v_itmst_ref_part_nbr_ref varchar_type_1000_tbl;
1152    mm_v_itmst_ref_part_nbr_tbl varchar_type_1000_tbl;
1153    mm_v_itmst_src_app_id_ref t_ref;
1157    mm_v_tbl_rule_seq t_ref;
1154    mm_v_itmst_src_app_id_tbl t_ref;
1155    mm_v_ht_eff_set_tbl_t t_ref;
1156    mm_v_ht_eff_set_tbl_s t_ref;
1158    mm_v_ht_rule_rule_seq t_ref;
1159    mm_v_ht_item_types_orig_ref orig_sys_ref_type;
1160    mm_v_ht_items_orig_ref orig_sys_ref_type;
1161    mm_v_ht_item_typ_prop_orig_ref orig_sys_ref_type_vc2; --Bug9031588
1162    mm_v_ht_item_prop_val_orig_ref orig_sys_ref_type_vc2; --Bug9031588
1163    v_src_type_prop_orig_tbl cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1164    v_tgt_type_prop_orig_tbl cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1165    v_src_item_type_prop_orig_ref cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1166    v_tgt_item_type_prop_orig_ref cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1167    v_src_prop_val_orig_tbl cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1168    v_tgt_prop_val_orig_tbl cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1169    v_src_item_prop_val_orig_ref cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1170    v_tgt_item_prop_val_orig_ref cz_pb_mgr.orig_sys_ref_type;  --Bug9031588
1171    mm_insert_array1 t_ref;
1172    mm_insert_array2 t_ref;
1173    mm_insert_array3 orig_sys_ref_type;
1174    mm_source_array1 t_ref;
1175    mm_source_array2 t_ref;
1176    mm_source_array3 orig_sys_ref_type;
1177    mm_objtype_array varchar_tbl_type_3;
1178    mm_tgtfldr_array t_ref;
1179 
1180    PROCEDURE mm_loadoldpsnodesforitems;
1181 
1182    PROCEDURE mm_raiseallpossiblesyncerrors;
1183 
1184    PROCEDURE get_all_properties;
1185 
1186    -----9812709------------------------------------
1187 
1188    PROCEDURE remote_bulk_get_all_properties;
1189 
1190    PROCEDURE rm_insert_into_ps_prop_vals;
1191 
1192    PROCEDURE remote_insert_ps_prop_vals( InsPsNodeId IN CZ_PB_MGR.t_ref,
1193                                       InsPropId   IN CZ_PB_MGR.t_ref,
1194                                       InsCharData IN CZ_PB_MGR.propDataType,
1195                                       InsNumData  IN CZ_PB_MGR.t_ref);
1196 
1197    PROCEDURE mm_sync_properties;
1198 
1199    PROCEDURE mm_migrate_into_ps_prop_vals;
1200 
1201    PROCEDURE mm_sync_itemschema;
1202 
1203    PROCEDURE mm_insert_archives;
1204 
1205    PROCEDURE mm_sync_archives;
1206 
1207 
1208    PROCEDURE mm_insert_archives_for_pb;
1209 
1210    PROCEDURE mm_get_ifexists_on_target(source_id IN NUMBER, target_id IN OUT NOCOPY NUMBER, what_exists IN VARCHAR2);
1211 
1212    FUNCTION mm_sync_eff_sets(old_eff_set_id NUMBER, new_eff_set_id NUMBER)
1213       RETURN NUMBER;
1214 
1215    FUNCTION mm_get_ifexists_on_source(source_id IN NUMBER, what_exists VARCHAR2)
1216       RETURN VARCHAR2;
1217 
1218    FUNCTION mm_get_newid(what_id IN VARCHAR2)
1219       RETURN NUMBER;
1220 
1221    mm_v_rootmodels_tobe_exported t_ref;
1222    mm_v_rootmodels_notbe_exported t_ref;
1223 
1224    PROCEDURE mm_get_models_tobe_exported(rootmodelid_tbl IN cz_pb_mgr.t_ref);
1225 
1226    FUNCTION mm_chkifmodelselectedforexport(input_model NUMBER)
1227       RETURN NUMBER;
1228 
1229    FUNCTION get_rootmodel_and_mig_tgt_fldr(p_publication_id NUMBER)
1230       RETURN t_ref;
1231 
1232    PROCEDURE mm_break_long_str(v_inp_str IN VARCHAR2);
1233 
1234    PROCEDURE mm_resolve_ids(
1235       array_to_resolve IN cz_pb_mgr.t_ref
1236      ,array_of_new_keys IN cz_pb_mgr.t_ref_idx_vc2
1237      ,resolving_id IN VARCHAR2
1238      ,resolved_array IN OUT NOCOPY cz_pb_mgr.t_ref
1239      ,source_array IN OUT NOCOPY cz_pb_mgr.t_ref
1240    );
1241 
1242    PROCEDURE mm_resolve_ids_w_rp_entries(
1243       array_to_resolve IN cz_pb_mgr.t_ref
1244      ,array_of_new_keys IN cz_pb_mgr.t_ref_idx_vc2
1245      ,object_type IN VARCHAR2
1246      ,target_folder IN NUMBER
1247      ,resolving_id IN VARCHAR2
1248      ,resolved_array IN OUT NOCOPY cz_pb_mgr.t_ref
1249      ,object_type_array IN OUT NOCOPY cz_pb_mgr.varchar_tbl_type_3
1250      ,tgt_folder_array IN OUT NOCOPY cz_pb_mgr.t_ref
1251      ,source_array IN OUT NOCOPY cz_pb_mgr.t_ref
1252    );
1253 
1254    PROCEDURE mm_resolve_orig_refs(
1255       array_to_resolve IN cz_pb_mgr.t_ref
1256      ,array_of_new_keys IN cz_pb_mgr.orig_sys_ref_type
1257      ,resolving_id IN VARCHAR2
1258      ,resolved_array IN OUT NOCOPY cz_pb_mgr.orig_sys_ref_type
1259      ,source_array IN OUT NOCOPY cz_pb_mgr.orig_sys_ref_type
1260    );
1261 --Bug9031588
1262    PROCEDURE mm_resolve_orig_refs(
1263       array_to_resolve IN cz_pb_mgr.orig_sys_ref_type
1264      ,array_of_new_keys IN cz_pb_mgr.orig_sys_ref_type_vc2
1265      ,resolving_id IN VARCHAR2
1266      ,resolved_array IN OUT NOCOPY cz_pb_mgr.orig_sys_ref_type
1267      ,source_array IN OUT NOCOPY cz_pb_mgr.orig_sys_ref_type
1268    );
1269 
1270    PROCEDURE mm_resync_ps_items;
1271 
1272    PROCEDURE mm_resync_ps_item_types; --Bug9180063
1273 
1274 
1275    PROCEDURE insert_into_rp_entries(
1276       table_name IN VARCHAR2
1277      ,primary_key1 IN VARCHAR2
1278      ,primary_key2 IN VARCHAR2
1279      ,db_link IN VARCHAR2
1280      ,plsql_table_list IN cz_pb_mgr.col_plsql_table_list
1281      ,plsql_table_name1 IN VARCHAR2
1282      ,plsql_table_name2 IN VARCHAR2
1283      ,primary_key_plsql_table1 IN OUT NOCOPY cz_pb_mgr.t_ref
1284      ,primary_key_plsql_table2 IN OUT NOCOPY cz_pb_mgr.varchar_tbl_type_3
1285    );
1286 
1287    PROCEDURE mm_resolve_rule_seq_effsetid;
1288    FUNCTION getRemoteImportServer(x_import_server_on_local IN OUT NOCOPY cz_servers.server_local_id%TYPE) RETURN NUMBER;
1289    FUNCTION has_ui_inany_chld_mdl_changed(rootmodelid IN NUMBER)RETURN boolean;
1290    FUNCTION get_mdl_last_xfr_activity(
1291       p_model_id IN cz_model_publications.model_id%TYPE
1292      ,p_server_id IN cz_model_publications.server_id%TYPE
1293 
1294    ) RETURN DATE;
1295 END cz_pb_mgr;