DBA Data[Home] [Help]

PACKAGE BODY: APPS.JTF_LOGICALCONTENT_GRP

Source


1 PACKAGE BODY JTF_LogicalContent_GRP AS
2 /* $Header: JTFGLCTB.pls 115.10 2004/07/09 18:49:55 applrt ship $ */
3 
4 
5 --- Generate primary key for the table
6  CURSOR obj_lgl_ctnt_id_seq IS
7    SELECT jtf_dsp_obj_lgl_ctnt_s1.NEXTVAL
8      FROM DUAL;
9 
10 
11 PROCEDURE delete_logical_content(
12    p_api_version         IN  NUMBER,
13    p_init_msg_list       IN  VARCHAR2 := FND_API.g_false,
14    p_commit              IN  VARCHAR2 := FND_API.g_false,
15    x_return_status       OUT VARCHAR2,
16    x_msg_count           OUT  NUMBER,
17    x_msg_data            OUT  VARCHAR2,
18   p_object_type		IN  VARCHAR2,
19   p_lgl_ctnt_rec	IN OBJ_LGL_CTNT_REC_TYPE
20  )
21 IS
22    l_api_name    CONSTANT VARCHAR2(30) := 'delete_logical_content';
23    l_full_name   CONSTANT VARCHAR2(60) := g_pkg_name ||'.'|| l_api_name;
24    l_return_status  VARCHAR2(1);
25    l_index       NUMBER;
26    l_context_id  NUMBER;
27    l_exists 	 NUMBER;
28 BEGIN
29 
30    --------------------- initialize -----------------------
31    SAVEPOINT delete_logical_content;
32 
33 --dbms_output.put_line('delete_logical_content: checking the object existence');
34 
35    IF NOT FND_API.compatible_api_call(
36          g_api_version,
37          p_api_version,
38          l_api_name,
39          g_pkg_name
40    ) THEN
41       RAISE FND_API.g_exc_unexpected_error;
42    END IF;
43 
44    IF FND_API.to_boolean(p_init_msg_list) THEN
45       FND_MSG_PUB.initialize;
46    END IF;
47 
48   x_return_status := FND_API.G_RET_STS_SUCCESS;
49 
50   if p_lgl_ctnt_rec.obj_lgl_ctnt_id is not null
51   then
52    --- Check if the object logical content exists
53 
54  if jtf_dspmgrvalidation_grp.check_lgl_ctnt_id_exists(p_lgl_ctnt_rec.obj_lgl_ctnt_id,
55 						      p_lgl_ctnt_rec.object_version_number) = false then
56        raise FND_API.g_exc_error;
57  end if;
58 
59 --dbms_output.put_line('delete_logical_content: passed the object existence');
60 
61   delete from jtf_dsp_obj_lgl_ctnt where
62 	 obj_lgl_ctnt_id = p_lgl_ctnt_rec.obj_lgl_ctnt_id and
63 	 object_version_number = p_lgl_ctnt_rec.object_version_number;
64   else
65  	raise jtf_dspmgrvalidation_grp.lglctnt_id_req_exception;
66   end if;
67 
68 --- Check if the caller requested to commit ,
69 --- If p_commit set to true, commit the transaction
70 
71 IF  FND_API.to_boolean(p_commit) THEN
72   COMMIT;
73 END IF;
74 
75   x_return_status := FND_API.G_RET_STS_SUCCESS;
76 
77       FND_MSG_PUB.count_and_get(
78             p_encoded => FND_API.g_false,
79             p_count   => x_msg_count,
80             p_data    => x_msg_data
81       );
82 
83 EXCEPTION
84 
85    WHEN FND_API.g_exc_error THEN
86       ROLLBACK TO delete_logical_content;
87       x_return_status := FND_API.g_ret_sts_error;
88       FND_MSG_PUB.count_and_get(
89             p_encoded => FND_API.g_false,
90             p_count   => x_msg_count,
91             p_data    => x_msg_data
92       );
93 
94    WHEN FND_API.g_exc_unexpected_error THEN
95       ROLLBACK TO delete_logical_content;
96       x_return_status := FND_API.g_ret_sts_error ;
97       FND_MSG_PUB.count_and_get(
98             p_encoded => FND_API.g_false,
99             p_count   => x_msg_count,
100             p_data    => x_msg_data
101       );
102 
103 
104 WHEN jtf_dspmgrvalidation_grp.lglctnt_id_req_exception THEN
105    ROLLBACK TO delete_logical_content;
106    x_return_status := FND_API.g_ret_sts_error;
107    FND_MESSAGE.set_name('JTF','JTF_DSP_LGLCTNT_ID_REQ');
108    FND_MSG_PUB.ADD;
109    FND_MSG_PUB.count_and_get(
110             p_encoded => FND_API.g_false,
111             p_count   => x_msg_count,
112             p_data    => x_msg_data
113       );
114 
115  WHEN OTHERS THEN
116       ROLLBACK TO delete_logical_content;
117       x_return_status := FND_API.g_ret_sts_unexp_error ;
118       IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error)
119       THEN
120          FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
121       END IF;
122       FND_MSG_PUB.count_and_get(
123             p_encoded => FND_API.g_false,
124             p_count   => x_msg_count,
125             p_data    => x_msg_data
126       );
127 
128 END delete_logical_content;
129 
130 
131 PROCEDURE save_logical_content(
132    p_api_version         IN  NUMBER,
133    p_init_msg_list       IN  VARCHAR2 := FND_API.g_false,
134    p_commit              IN  VARCHAR2 := FND_API.g_false,
135    x_return_status       OUT VARCHAR2,
136    x_msg_count           OUT  NUMBER,
137    x_msg_data            OUT  VARCHAR2,
138   p_object_type		IN  VARCHAR2,
139   p_lgl_ctnt_rec	IN OBJ_LGL_CTNT_REC_TYPE
140  )
141 IS
142    l_api_name    CONSTANT VARCHAR2(30) := 'save_logical_content';
143    l_full_name   CONSTANT VARCHAR2(60) := g_pkg_name ||'.'|| l_api_name;
144    l_return_status  VARCHAR2(1);
145    l_index		NUMBER ;
146    l_context_id         NUMBER;
147    l_deliverable_id      NUMBER := null;
148    l_exists			NUMBER := null;
149    l_context_type		varchar2(100);
150    l_obj_lgl_ctnt_id   NUMBER;
151    l_object_type       VARCHAR2(40);
152    l_applicable_to     VARCHAR2(40);
153 
154 BEGIN
155 
156    --------------------- initialize -----------------------
157    SAVEPOINT save_logical_content;
158 
159    IF NOT FND_API.compatible_api_call(
160          g_api_version,
161          p_api_version,
162          l_api_name,
163          g_pkg_name
164    ) THEN
165       RAISE FND_API.g_exc_unexpected_error;
166    END IF;
167 
168 
169   --dbms_output.put_line('save_logical_content: checking the object existence');
170 
171    IF FND_API.to_boolean(p_init_msg_list) THEN
172       FND_MSG_PUB.initialize;
173    END IF;
174 
175 
176 --- Initialize API return status to success
177 x_return_status := FND_API.g_ret_sts_success;
178 
179 --- check for existence of the object id
180 
181 l_object_type := trim(p_object_type);
182 
183 --dbms_output.put_line('type passed is ' || l_object_type );
184 --dbms_output.put_line('lgltype passed is ' || p_lgl_ctnt_rec.obj_lgl_ctnt_id );
185 --dbms_output.put_line('dtype passed is ' || p_lgl_ctnt_rec.deliverable_id );
186 if l_object_type = 'I' and
187    p_lgl_ctnt_rec.obj_lgl_ctnt_id is null and
188    p_lgl_ctnt_rec.deliverable_id is null
189 then
190 	IF  FND_API.to_boolean(p_commit) THEN
191   		COMMIT;
192 	END IF;
193 
194   	x_return_status := FND_API.G_RET_STS_SUCCESS;
195 
196       FND_MSG_PUB.count_and_get(
197             p_encoded => FND_API.g_false,
198             p_count   => x_msg_count,
199             p_data    => x_msg_data
200       );
201 
202 --dbms_output.put_line('type passed is item');
203       return;
204 end if;
205 
206 
207 --dbms_output.put_line('save_logical_content: checking the object existence and id ');
208 
209 if jtf_dspmgrvalidation_grp.check_lgl_object_exists(p_object_type,p_lgl_ctnt_rec.object_id) = false  then
210     raise FND_API.g_exc_error;
211  end if;
212 
213 --dbms_output.put_line('save_logical_content: passed the object existence');
214 --- check if the context exists
215 
216 if p_lgl_ctnt_rec.context_id is not null or p_lgl_ctnt_rec.context_id <> FND_API.g_miss_num
217 then
218 
219 l_context_type := jtf_dspmgrvalidation_grp.check_context_type_code(p_lgl_ctnt_rec.context_id);
220 
221 --dbms_output.put_line('save_logical_content: passed the context_type validation');
222 
223 if l_context_type is NULL then
224        raise FND_API.g_exc_error;
225  end if;
226 
227 else
228 	raise jtf_dspmgrvalidation_grp.context_req_exception;
229 end if;
230 
231 --- check if the deliverable exists
232 --- if the deliverable is passed, make sure the type is the same as
233 --- context type
234 
235 if l_context_type = 'TEMPLATE' and p_object_type = 'S' then
236 
237    FND_MESSAGE.set_name('JTF','JTF_DSP_LGLCTNT_SCT_INVLD');
238    FND_MSG_PUB.ADD;
239 end if;
240 
241 if p_lgl_ctnt_rec.deliverable_id is not null
242 then
243 
244     if(l_object_type = 'I') then
245 	 l_applicable_to := 'CATEGORY';
246     elsif (l_object_type = 'C') then
247 	 l_applicable_to := 'CATEGORY';
248     elsif (l_object_type = 'S') then
249  	 l_applicable_to := 'SECTION';
250     end if;
251 
252      --dbms_output.put_line('save_logical_content: checking for deliverable type_exists ');
253 
254     if jtf_dspmgrvalidation_grp.check_deliverable_type_exists(p_lgl_ctnt_rec.deliverable_id, l_context_type,
255   	   								         l_applicable_to) = false
256     then
257             raise FND_API.g_exc_error;
258     end if;
259      --dbms_output.put_line('save_logical_content: passed checking for deliverable type_exists ');
260 
261   if l_context_type = 'TEMPLATE'
262   then
263 
264     if(l_object_type ='I' ) then
265 --- Make sure that the deliverable id is associated to atleast one of the categories the item
266 --- belongs to , otherwise raise an exception
267 
268   if jtf_dspmgrvalidation_grp.check_item_deliverable(p_lgl_ctnt_rec.object_id,p_lgl_ctnt_rec.deliverable_id) = false
269   then
270        raise FND_API.g_exc_error;
271    end if;
272 elsif(l_object_type = 'C') then
273 --- Make sure that the deliverable id is associated to  the category
274 --- , otherwise raise an exception
275 
276   if jtf_dspmgrvalidation_grp.check_category_deliverable(p_lgl_ctnt_rec.object_id,p_lgl_ctnt_rec.deliverable_id) = false
277   then
278        raise FND_API.g_exc_error;
279   end if;
280 
281  end if;
282 end if;
283 -----dbms_output.put_line('save_logical_content: passed the deliverable existence');
284 end if;
285 
286 
287 if l_object_type = 'I' and p_lgl_ctnt_rec.obj_lgl_ctnt_id is not null and
288   p_lgl_ctnt_rec.deliverable_id = null
289  then
290 --- Check if the object logical content id exists
291 
292  if jtf_dspmgrvalidation_grp.check_lgl_ctnt_id_exists(p_lgl_ctnt_rec.obj_lgl_ctnt_id,
293 						      p_lgl_ctnt_rec.object_version_number) = false then
294        raise FND_API.g_exc_error;
295  end if;
296 	delete from JTF_DSP_OBJ_LGL_CTNT where
297 		obj_lgl_ctnt_id = p_lgl_ctnt_rec.obj_lgl_ctnt_id and
298                 object_version_number = p_lgl_ctnt_rec.object_version_number and
299 		object_type = l_object_type;
300 else
301 
302 IF  p_lgl_ctnt_rec.obj_lgl_ctnt_id is null
303 THEN
304         OPEN obj_lgl_ctnt_id_seq;
305         FETCH obj_lgl_ctnt_id_seq INTO l_obj_lgl_ctnt_id;
306         CLOSE obj_lgl_ctnt_id_seq;
307 
308 INSERT INTO JTF_DSP_OBJ_LGL_CTNT (
309 OBJ_LGL_CTNT_ID,
310 OBJECT_VERSION_NUMBER,
311 LAST_UPDATE_DATE,
312 LAST_UPDATED_BY,
313 CREATION_DATE,
314 CREATED_BY,
315 LAST_UPDATE_LOGIN,
316 OBJECT_ID,
317 OBJECT_TYPE,
318 CONTEXT_ID,
319 ITEM_ID
320 )
321  VALUES (
322 l_obj_lgl_ctnt_id,
323 1,
324 SYSDATE,
325 FND_GLOBAL.user_id,
326 SYSDATE,
327 FND_GLOBAL.user_id,
328 FND_GLOBAL.user_id,
329 p_lgl_ctnt_rec.object_id,
330 l_object_type,
331 p_lgl_ctnt_rec.context_id,
332 p_lgl_ctnt_rec.deliverable_id);
333 
334 ELSE
335 
336 --- Check if the object logical content id exists
337 
338  if jtf_dspmgrvalidation_grp.check_lgl_ctnt_id_exists(p_lgl_ctnt_rec.obj_lgl_ctnt_id,
339 						      p_lgl_ctnt_rec.object_version_number) = false then
340        raise FND_API.g_exc_error;
341  end if;
342 
343 UPDATE  JTF_DSP_OBJ_LGL_CTNT  SET
344 LAST_UPDATE_DATE = SYSDATE,
345 LAST_UPDATED_BY = FND_GLOBAL.user_id,
346 LAST_UPDATE_LOGIN= FND_GLOBAL.user_id,
347 OBJECT_ID = p_lgl_ctnt_rec.object_id,
348 OBJECT_TYPE = l_object_type,
349 CONTEXT_ID = p_lgl_ctnt_rec.context_id,
350 ITEM_ID = p_lgl_ctnt_rec.deliverable_id ,
351 OBJECT_VERSION_NUMBER = p_lgl_ctnt_rec.object_version_number + 1
352 WHERE
353 OBJ_LGL_CTNT_ID = p_lgl_ctnt_rec.obj_lgl_ctnt_id and
354 OBJECT_VERSION_NUMBER  = p_lgl_ctnt_rec.object_version_number;
355 END IF;
356 
357 END IF;
358 --- Check if the caller requested to commit ,
359 --- If p_commit set to true, commit the transaction
360 
361 IF  FND_API.to_boolean(p_commit) THEN
362   COMMIT;
363 END IF;
364 
365   x_return_status := FND_API.G_RET_STS_SUCCESS;
366 
367       FND_MSG_PUB.count_and_get(
368             p_encoded => FND_API.g_false,
369             p_count   => x_msg_count,
370             p_data    => x_msg_data
371       );
372 
373 EXCEPTION
374 
375    WHEN FND_API.g_exc_error THEN
376       ROLLBACK TO save_logical_content;
377       x_return_status := FND_API.g_ret_sts_error;
378       FND_MSG_PUB.count_and_get(
379             p_encoded => FND_API.g_false,
380             p_count   => x_msg_count,
381             p_data    => x_msg_data
382       );
383 
384    WHEN DUP_VAL_ON_INDEX THEN
385       ROLLBACK TO save_logical_content;
386       x_return_status := FND_API.g_ret_sts_error ;
387       FND_MESSAGE.set_name('JTF','JTF_DSP_LGLCTNT_ROW_EXISTS');
388       FND_MESSAGE.set_token('ID', p_lgl_ctnt_rec.object_id);
389       FND_MESSAGE.set_token('TYPE', p_object_type);
390       FND_MESSAGE.set_token('CTX_ID', p_lgl_ctnt_rec.context_id);
391       FND_MSG_PUB.ADD;
392       FND_MSG_PUB.count_and_get(
393             p_encoded => FND_API.g_false,
394             p_count   => x_msg_count,
395             p_data    => x_msg_data
396       );
397    WHEN FND_API.g_exc_unexpected_error THEN
398       ROLLBACK TO save_logical_content;
399       x_return_status := FND_API.g_ret_sts_error ;
400       FND_MSG_PUB.count_and_get(
401             p_encoded => FND_API.g_false,
402             p_count   => x_msg_count,
403             p_data    => x_msg_data
404       );
405 WHEN jtf_dspmgrvalidation_grp.context_req_exception THEN
406      ROLLBACK TO save_logical_content;
407       x_return_status := FND_API.g_ret_sts_unexp_error ;
408       IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error)
409       THEN
410 	  FND_MESSAGE.set_name('JTF','JTF_DSP_CONTEXT_REQ');
411           FND_MSG_PUB.ADD;
412         END IF;
413       FND_MSG_PUB.count_and_get(
414             p_encoded => FND_API.g_false,
415             p_count   => x_msg_count,
416             p_data    => x_msg_data
417       );
418 
419  WHEN OTHERS THEN
420       ROLLBACK TO save_logical_content;
421       x_return_status := FND_API.g_ret_sts_unexp_error ;
422       IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error)
423       THEN
424          FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
425       END IF;
426       FND_MSG_PUB.count_and_get(
427             p_encoded => FND_API.g_false,
428             p_count   => x_msg_count,
429             p_data    => x_msg_data
430       );
431 
432 END save_logical_content;
433 
434 
435 PROCEDURE save_delete_lgl_ctnt(
436    p_api_version         IN  NUMBER,
437    p_init_msg_list       IN  VARCHAR2 := FND_API.g_false,
438    p_commit              IN  VARCHAR2 := FND_API.g_false,
439    x_return_status       OUT VARCHAR2,
440    x_msg_count           OUT  NUMBER,
441    x_msg_data            OUT  VARCHAR2,
442    p_object_type_code	 IN   VARCHAR2,
443   p_lgl_ctnt_tbl	      IN OBJ_LGL_CTNT_TBL_TYPE
444  )
445 IS
446 
447    l_api_name    CONSTANT VARCHAR2(30) := 'save_delete_itm_lgl_ctnt';
448    l_full_name   CONSTANT VARCHAR2(60) := g_pkg_name ||'.'|| l_api_name;
449    l_return_status  VARCHAR2(1);
450    l_index		NUMBER ;
451    l_context_id         NUMBER;
452    l_deliverable_id      NUMBER := null;
453    l_msg_count NUMBER;
454    l_msg_data VARCHAR2(80);
455    l_object_type_code  VARCHAR2(1) := null;
456 BEGIN
457 
458    --------------------- initialize -----------------------
459    SAVEPOINT save_delete_itm_lgl_ctnt;
460 
461    IF NOT FND_API.compatible_api_call(
462          g_api_version,
463          p_api_version,
464          l_api_name,
465          g_pkg_name
466    ) THEN
467       RAISE FND_API.g_exc_unexpected_error;
468    END IF;
469 
470 
471    IF FND_API.to_boolean(p_init_msg_list) THEN
472       FND_MSG_PUB.initialize;
473    END IF;
474 
475 
476 --- Initialize API return status to success
477 x_return_status := FND_API.g_ret_sts_success;
478 
479 
480 --dbms_output.put_line('PASSED THE VERSION NUMBER TEST:' || p_object_type_code || ':' || length(p_object_type_code));
481 
482 if jtf_dspmgrvalidation_grp.check_valid_object_type(p_object_type_code) = false then
483        raise FND_API.g_exc_error;
484 end if;
485 
486 
487 --dbms_output.put_line('PASSED THE TYPE  TEST');
488 
489 
490 FOR l_index  IN 1..p_lgl_ctnt_tbl.COUNT
491 LOOP
492 ---
493    IF p_lgl_ctnt_tbl(l_index).obj_lgl_ctnt_delete = FND_API.g_true
494    then
495 
496 --dbms_output.put_line('CALLING DELETE_LOGICAL_CONTENT');
497 	delete_logical_content(
498            p_api_version,
499 	     FND_API.g_false,
500 	     FND_API.g_false,
501            l_return_status,
502            l_msg_count,
503 	     l_msg_data,
504 	    p_object_type_code,
505            p_lgl_ctnt_tbl(l_index));
506 
507    ELSIF p_lgl_ctnt_tbl(l_index).obj_lgl_ctnt_delete = FND_API.g_false
508 	then
509 
510 --dbms_output.put_line('CALLING SAVE_LOGICAL_CONTENT');
511 	  save_logical_content(
512            p_api_version,
513 	     FND_API.g_false,
514            FND_API.g_false,
515            l_return_status,
516            l_msg_count,
517  	     l_msg_data,
518 	    p_object_type_code,
519            p_lgl_ctnt_tbl(l_index));
520    END IF;
521 
522 --dbms_output.put_line('CALLED LOGICAL_CONTENT' || l_return_status );
523 
524   if l_return_status <> FND_API.G_RET_STS_SUCCESS
525   then
526 		--dbms_output.put_line('retirn status from save' || l_return_status);
527 		x_return_status := l_return_status;
528   end if;
529 
530 --dbms_output.put_line('processing ' || p_lgl_ctnt_tbl(l_index).deliverable_id);
531 END LOOP;
532 
533 
534       FND_MSG_PUB.count_and_get(
535             p_encoded => FND_API.g_false,
536             p_count   => x_msg_count,
537             p_data    => x_msg_data
538       );
539 
540 EXCEPTION
541 
542    WHEN FND_API.g_exc_error THEN
543       ROLLBACK TO save_delete_itm_lgl_ctnt;
544       x_return_status := FND_API.g_ret_sts_error;
545       FND_MSG_PUB.count_and_get(
546             p_encoded => FND_API.g_false,
547             p_count   => x_msg_count,
548             p_data    => x_msg_data
549       );
550 
551 WHEN FND_API.g_exc_unexpected_error THEN
552       ROLLBACK TO save_delete_itm_lgl_ctnt;
553       x_return_status := FND_API.g_ret_sts_error ;
554       FND_MSG_PUB.count_and_get(
555             p_encoded => FND_API.g_false,
556             p_count   => x_msg_count,
557             p_data    => x_msg_data
558       );
559 
560 
561    WHEN OTHERS THEN
562       ROLLBACK TO save_delete_itm_lgl_ctnt;
563       x_return_status := FND_API.g_ret_sts_unexp_error ;
564       IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error)
565       THEN
566          FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name);
567       END IF;
568       FND_MSG_PUB.count_and_get(
569             p_encoded => FND_API.g_false,
570             p_count   => x_msg_count,
571             p_data    => x_msg_data
572       );
573 
574 END save_delete_lgl_ctnt;
575 
576 PROCEDURE delete_section(
577    p_section_id          IN   NUMBER
578  )
579 IS
580    l_api_name    CONSTANT VARCHAR2(30) := 'delete_section';
581 begin
582 
583 SAVEPOINT delete_section;
584 
585 if jtf_dspmgrvalidation_grp.check_section_exists(p_section_id) = false then
586        raise FND_API.g_exc_error;
587 end if;
588 
589  DELETE FROM JTF_DSP_OBJ_LGL_CTNT where
590  OBJECT_TYPE = 'S' and
591  OBJECT_ID = p_section_id;
592 
593 EXCEPTION
594    WHEN OTHERS THEN
595       ROLLBACK TO delete_section;
596 
597 END delete_section;
598 
599 PROCEDURE delete_deliverable(
600    p_deliverable_id          IN   NUMBER
601  )
602 IS
603    l_api_name    CONSTANT VARCHAR2(30) := 'delete_deliverable';
604 BEGIN
605 SAVEPOINT delete_deliverable;
606 
607 if p_deliverable_id is not null
608 then
609 
610  UPDATE  JTF_DSP_OBJ_LGL_CTNT SET
611  ITEM_ID = null where
612  ITEM_ID = p_deliverable_id ;
613 
614 end if;
615 
616 EXCEPTION
617    WHEN OTHERS THEN
618       ROLLBACK TO delete_deliverable;
619 END delete_deliverable;
620 
621 
622 PROCEDURE delete_category(
623    p_category_id          IN   NUMBER
624  )
625 IS
626    l_api_name    CONSTANT VARCHAR2(30) := 'delete_category';
627 BEGIN
628 -- SAVEPOINT delete_category;
629 
630 if p_category_id is not null
631 then
632  DELETE FROM JTF_DSP_OBJ_LGL_CTNT where
633  OBJECT_TYPE = 'C' and
634  OBJECT_ID = p_category_id;
635 end if;
636 
637 -- EXCEPTION
638 --    WHEN OTHERS THEN
639 --       ROLLBACK TO delete_category;
640 END delete_category;
641 
642 PROCEDURE delete_item(
643    p_item_id          IN   NUMBER
644  )
645 IS
646    l_api_name    CONSTANT VARCHAR2(30) := 'delete_item';
647 BEGIN
648 -- SAVEPOINT delete_item;
649 
650 if p_item_id is not null
651 then
652  DELETE FROM JTF_DSP_OBJ_LGL_CTNT where
653  OBJECT_TYPE = 'I' and
654  OBJECT_ID = p_item_id;
655 end if;
656 
657 -- EXCEPTION
658 --    WHEN OTHERS THEN
659 --       ROLLBACK TO delete_item;
660 END delete_item;
661 
662 
663 PROCEDURE delete_context(
664    p_context_id          IN   NUMBER
665  )
666 IS
667    l_api_name    CONSTANT VARCHAR2(30) := 'delete_context';
668 BEGIN
669 SAVEPOINT delete_context;
670 
671 if p_context_id is not null
672 then
673 
674 delete JTF_DSP_OBJ_LGL_CTNT
675 where context_id = p_context_id;
676 end if;
677 
678 EXCEPTION
679    WHEN OTHERS THEN
680       ROLLBACK TO delete_context;
681 END delete_context;
682 
683 PROCEDURE delete_category_dlv(
684    p_category_id          IN   NUMBER,
685    p_deliverable_id	    IN   NUMBER
686  )
687 IS
688    l_api_name    CONSTANT VARCHAR2(30) := 'delete_category_dlv';
689 BEGIN
690 SAVEPOINT delete_category_dlv;
691 
692 if p_category_id  is not null  and
693    p_deliverable_id is not null
694 then
695 
696 UPDATE  JTF_DSP_OBJ_LGL_CTNT
697 set item_id = null
698 where object_type  = 'C' and
699 	    object_id = p_category_id and
700 	    ITEM_ID   = p_deliverable_id;
701 end if;
702 
703 EXCEPTION
704 
705    WHEN OTHERS THEN
706       ROLLBACK TO delete_category_dlv;
707 
708 END delete_category_dlv;
709 
710 END JTF_LogicalContent_GRP;
711