42: l_deliverable_id NUMBER;
43:
44: BEGIN
45: SAVEPOINT copy_logical_content;
46: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
47: IBE_Util.Debug('Copy_lg_ctnt: p_from_product_id'
48: || p_from_product_id);
49:
50: END IF;
43:
44: BEGIN
45: SAVEPOINT copy_logical_content;
46: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
47: IBE_Util.Debug('Copy_lg_ctnt: p_from_product_id'
48: || p_from_product_id);
49:
50: END IF;
51:
50: END IF;
51:
52: IF (p_from_context_ids is not null) then
53: l_cntCount := p_from_context_ids.count;
54: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
55: IBE_Util.Debug('l_cntCount='
56: || l_cntCount);
57:
58: END IF;
51:
52: IF (p_from_context_ids is not null) then
53: l_cntCount := p_from_context_ids.count;
54: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
55: IBE_Util.Debug('l_cntCount='
56: || l_cntCount);
57:
58: END IF;
59: end if;
76: EXCEPTION
77: WHEN NO_DATA_FOUND then
78: l_from_deliverable_ids(i) := null;
79: END;
80: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
81: IBE_Util.Debug('i='||i||' l_deliverable_id='
82: || l_deliverable_id);
83:
84: END IF;
77: WHEN NO_DATA_FOUND then
78: l_from_deliverable_ids(i) := null;
79: END;
80: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
81: IBE_Util.Debug('i='||i||' l_deliverable_id='
82: || l_deliverable_id);
83:
84: END IF;
85:
160:
161: l_cntCount := p_from_context_ids.count;
162: l_to_count := p_to_product_ids.count;
163:
164: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
165: IBE_Util.Debug('from product context numbers:'||l_cntCount);
166: IBE_Util.Debug('to product numbers:'||l_to_Count);
167: END IF;
168:
161: l_cntCount := p_from_context_ids.count;
162: l_to_count := p_to_product_ids.count;
163:
164: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
165: IBE_Util.Debug('from product context numbers:'||l_cntCount);
166: IBE_Util.Debug('to product numbers:'||l_to_Count);
167: END IF;
168:
169: FOR i in 1..l_cntcount LOOP
162: l_to_count := p_to_product_ids.count;
163:
164: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
165: IBE_Util.Debug('from product context numbers:'||l_cntCount);
166: IBE_Util.Debug('to product numbers:'||l_to_Count);
167: END IF;
168:
169: FOR i in 1..l_cntcount LOOP
170:
175: x_copy_status := IDS_LIST();
176: END IF;
177: x_copy_status.extend();
178:
179: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
180: IBE_Util.Debug('Content Component loop i:'||i);
181: IBE_Util.Debug('context_id=:'||l_context_id);
182: IBE_Util.Debug('deliverableid=:'||l_deliverable_id);
183:
176: END IF;
177: x_copy_status.extend();
178:
179: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
180: IBE_Util.Debug('Content Component loop i:'||i);
181: IBE_Util.Debug('context_id=:'||l_context_id);
182: IBE_Util.Debug('deliverableid=:'||l_deliverable_id);
183:
184: END IF;
177: x_copy_status.extend();
178:
179: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
180: IBE_Util.Debug('Content Component loop i:'||i);
181: IBE_Util.Debug('context_id=:'||l_context_id);
182: IBE_Util.Debug('deliverableid=:'||l_deliverable_id);
183:
184: END IF;
185:
178:
179: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
180: IBE_Util.Debug('Content Component loop i:'||i);
181: IBE_Util.Debug('context_id=:'||l_context_id);
182: IBE_Util.Debug('deliverableid=:'||l_deliverable_id);
183:
184: END IF;
185:
186: SAVEPOINT copy_logical_content2;
188: for j in 1..l_to_count Loop
189:
190: l_to_product_id := p_to_product_ids(j);
191:
192: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
193: IBE_Util.Debug('Target Products loop j:'||j);
194: IBE_Util.Debug('toproductid=:'||l_to_product_id);
195: END IF;
196:
189:
190: l_to_product_id := p_to_product_ids(j);
191:
192: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
193: IBE_Util.Debug('Target Products loop j:'||j);
194: IBE_Util.Debug('toproductid=:'||l_to_product_id);
195: END IF;
196:
197: BEGIN
190: l_to_product_id := p_to_product_ids(j);
191:
192: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
193: IBE_Util.Debug('Target Products loop j:'||j);
194: IBE_Util.Debug('toproductid=:'||l_to_product_id);
195: END IF;
196:
197: BEGIN
198: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
194: IBE_Util.Debug('toproductid=:'||l_to_product_id);
195: END IF;
196:
197: BEGIN
198: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
199: IBE_Util.Debug('check if existing in the target product');
200: END IF;
201:
202: select obj_lgl_ctnt_id, object_version_number,item_id
195: END IF;
196:
197: BEGIN
198: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
199: IBE_Util.Debug('check if existing in the target product');
200: END IF;
201:
202: select obj_lgl_ctnt_id, object_version_number,item_id
203: into l_ctnt_id, l_version_number, l_item_id
204: from ibe_dsp_obj_lgl_ctnt
205: where context_id = l_context_id
206: and object_id = l_to_product_id;
207:
208: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
209: IBE_Util.Debug('target product Content rec exists l_ctnt_id='||l_ctnt_id || ' version='||l_version_number);
210: END IF;
211:
212: -- update the existing record
205: where context_id = l_context_id
206: and object_id = l_to_product_id;
207:
208: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
209: IBE_Util.Debug('target product Content rec exists l_ctnt_id='||l_ctnt_id || ' version='||l_version_number);
210: END IF;
211:
212: -- update the existing record
213: IF (l_deliverable_id is null) then
215: WHERE obj_lgl_ctnt_id = l_ctnt_id
216: AND object_version_number = l_version_number
217: AND object_type = l_object_type;
218:
219: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
220: IBE_Util.Debug('delete if l_deliverable_id is null');
221: END IF;
222:
223:
216: AND object_version_number = l_version_number
217: AND object_type = l_object_type;
218:
219: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
220: IBE_Util.Debug('delete if l_deliverable_id is null');
221: END IF;
222:
223:
224: ELSE
234: OBJECT_VERSION_NUMBER = l_version_number+1
235: WHERE OBJ_LGL_CTNT_id = l_ctnt_id
236: AND OBJECT_VERSION_NUMBER = l_version_number;
237:
238: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
239: IBE_Util.Debug('update with the new l_deliverable_id is null');
240: END IF;
241: END IF; --updating the target product record
242:
235: WHERE OBJ_LGL_CTNT_id = l_ctnt_id
236: AND OBJECT_VERSION_NUMBER = l_version_number;
237:
238: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
239: IBE_Util.Debug('update with the new l_deliverable_id is null');
240: END IF;
241: END IF; --updating the target product record
242:
243: END IF; -- end if updating the product record
242:
243: END IF; -- end if updating the product record
244: EXCEPTION
245: when no_data_found then
246: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
247: IBE_Util.Debug('target product content rec not exist, insert one if l_deliverable_id is null');
248: END IF;
249:
250: IF (l_deliverable_id is not null) then
243: END IF; -- end if updating the product record
244: EXCEPTION
245: when no_data_found then
246: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
247: IBE_Util.Debug('target product content rec not exist, insert one if l_deliverable_id is null');
248: END IF;
249:
250: IF (l_deliverable_id is not null) then
251: --insert new rec
252: OPEN obj_lgl_ctnt_id_seq;
253: FETCH obj_lgl_ctnt_id_seq INTO l_obj_lgl_ctnt_id;
254: CLOSE obj_lgl_ctnt_id_seq;
255:
256: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
257: IBE_Util.Debug('begin insert new rec for target product, seq id='||l_obj_lgl_ctnt_id);
258: END IF;
259:
260: INSERT INTO IBE_DSP_OBJ_LGL_CTNT (
253: FETCH obj_lgl_ctnt_id_seq INTO l_obj_lgl_ctnt_id;
254: CLOSE obj_lgl_ctnt_id_seq;
255:
256: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
257: IBE_Util.Debug('begin insert new rec for target product, seq id='||l_obj_lgl_ctnt_id);
258: END IF;
259:
260: INSERT INTO IBE_DSP_OBJ_LGL_CTNT (
261: OBJ_LGL_CTNT_ID,
281: l_object_type,
282: l_context_id,
283: l_deliverable_id);
284:
285: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
286: IBE_Util.Debug('done inserting, l_to_product_id'||l_to_product_id
287: ||' object_type='||l_object_type
288: ||' context_id='||l_context_id||' l_deveriableid='||l_deliverable_id);
289: END IF;
282: l_context_id,
283: l_deliverable_id);
284:
285: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
286: IBE_Util.Debug('done inserting, l_to_product_id'||l_to_product_id
287: ||' object_type='||l_object_type
288: ||' context_id='||l_context_id||' l_deveriableid='||l_deliverable_id);
289: END IF;
290: