214: -- Initialize API return status to SUCCESS
215: x_return_status := FND_API.G_RET_STS_SUCCESS;
216:
217: IF (l_debug = 'Y') THEN
218: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Upsert_Cv_Labels starts');
219: IBE_UTIL.debug('p_label_code = '||l_label_code);
220: IBE_UTIL.debug('p_content_item_id_tbl.COUNT = '||p_content_item_id_tbl.COUNT);
221: IF (p_content_item_id_tbl.COUNT > 0) THEN
222: FOR i IN p_content_item_id_tbl.FIRST..p_content_item_id_tbl.LAST LOOP
229: IBE_UTIL.debug('p_version_number_tbl '||i||' = '||p_version_number_tbl(i));
230: END LOOP;
231: END IF;
232: END IF;
233: Ibc_Cv_Label_Grp.Upsert_Cv_Labels(
234: p_label_code => l_label_code,
235: p_content_item_ids => p_content_item_id_tbl,
236: p_version_number => p_version_number_tbl,
237: p_commit => FND_API.G_FALSE,
239: x_return_status => x_return_status,
240: x_msg_count => x_msg_count,
241: x_msg_data => x_msg_data);
242: IF (l_debug = 'Y') THEN
243: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Upsert_Cv_Labels:'||x_return_status);
244: END IF;
245: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
246: IF (l_debug = 'Y') THEN
247: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Upsert_Cv_Labels');
243: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Upsert_Cv_Labels:'||x_return_status);
244: END IF;
245: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
246: IF (l_debug = 'Y') THEN
247: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Upsert_Cv_Labels');
248: for i in 1..x_msg_count loop
249: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
250: IBE_UTIL.debug(l_msg_data);
251: end loop;
252: END IF;
253: RAISE FND_API.G_EXC_ERROR;
254: ELSIF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
255: IF (l_debug = 'Y') THEN
256: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Upsert_Cv_Labels');
257: for i in 1..x_msg_count loop
258: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
259: IBE_UTIL.debug(l_msg_data);
260: end loop;
341: l_item_version_id NUMBER;
342: l_version_number NUMBER;
343: l_association_type_code VARCHAR2(30);
344: l_label_code VARCHAR2(30) := g_label_code;
345: l_cv_label_rec Ibc_Cv_Label_Grp.CV_Label_Rec_Type;
346: r_cv_label_rec Ibc_Cv_Label_Grp.CV_Label_Rec_Type;
347: CURSOR c_get_version_id(c_content_item_id NUMBER,
348: c_version_number NUMBER) IS
349: SELECT citem_version_id
342: l_version_number NUMBER;
343: l_association_type_code VARCHAR2(30);
344: l_label_code VARCHAR2(30) := g_label_code;
345: l_cv_label_rec Ibc_Cv_Label_Grp.CV_Label_Rec_Type;
346: r_cv_label_rec Ibc_Cv_Label_Grp.CV_Label_Rec_Type;
347: CURSOR c_get_version_id(c_content_item_id NUMBER,
348: c_version_number NUMBER) IS
349: SELECT citem_version_id
350: FROM ibc_citem_versions_b
592: l_cv_label_rec.last_update_date := SYSDATE;
593: l_cv_label_rec.object_version_number := l_temp;
594: l_cv_label_rec.last_update_login := FND_GLOBAL.login_id;
595: IF (l_debug = 'Y') THEN
596: IBE_UTIL.debug('Before calling Ibc_Cv_Label_Grp.Update_CV_Label');
597: IBE_UTIL.debug('l_cv_label_rec.content_item_id = '||l_cv_label_rec.content_item_id);
598: IBE_UTIL.debug('l_cv_label_rec.citem_version_id = '||l_cv_label_rec.citem_version_id);
599: IBE_UTIL.debug('l_cv_label_rec.label_code = '||l_cv_label_rec.label_code);
600: IBE_UTIL.debug('l_cv_label_rec.last_updated_by = '||l_cv_label_rec.last_updated_by);
600: IBE_UTIL.debug('l_cv_label_rec.last_updated_by = '||l_cv_label_rec.last_updated_by);
601: IBE_UTIL.debug('l_cv_label_rec.object_version_number = '
602: ||l_cv_label_rec.object_version_number);
603: END IF;
604: Ibc_Cv_Label_Grp.Update_CV_Label(
605: p_api_version_number => 1.0,
606: P_Init_Msg_List => FND_API.G_FALSE,
607: P_Commit => FND_API.G_FALSE,
608: P_CV_Label_Rec => l_cv_label_rec,
610: x_return_status => x_return_status,
611: x_msg_count => x_msg_count,
612: x_msg_data => x_msg_data);
613: IF (l_debug = 'Y') THEN
614: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Update_CV_Label:'||x_return_status);
615: END IF;
616: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
617: IF (l_debug = 'Y') THEN
618: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Update_CV_Label');
614: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Update_CV_Label:'||x_return_status);
615: END IF;
616: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
617: IF (l_debug = 'Y') THEN
618: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Update_CV_Label');
619: for i in 1..x_msg_count loop
620: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
621: IBE_UTIL.debug(l_msg_data);
622: end loop;
623: END IF;
624: RAISE FND_API.G_EXC_ERROR;
625: ELSIF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
626: IF (l_debug = 'Y') THEN
627: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Update_CV_Label');
628: for i in 1..x_msg_count loop
629: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
630: IBE_UTIL.debug(l_msg_data);
631: end loop;
657: IBE_UTIL.debug('After checking old association:'||l_temp);
658: END IF;
659: IF (l_temp <> 1) THEN
660: IF (l_debug = 'Y') THEN
661: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Delete_CV_Label');
662: IBE_UTIL.debug('p_label_code = '||l_label_code);
663: IBE_UTIL.debug('p_content_item_id = '||l_old_item_id);
664: END IF;
665: Ibc_Cv_Label_Grp.Delete_CV_Label(
661: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Delete_CV_Label');
662: IBE_UTIL.debug('p_label_code = '||l_label_code);
663: IBE_UTIL.debug('p_content_item_id = '||l_old_item_id);
664: END IF;
665: Ibc_Cv_Label_Grp.Delete_CV_Label(
666: P_Api_Version_Number => 1.0,
667: P_Init_Msg_List => FND_API.G_FALSE,
668: P_Commit => FND_API.G_FALSE,
669: p_label_code => l_label_code,
671: x_return_status => x_return_status,
672: x_msg_count => x_msg_count,
673: x_msg_data => x_msg_data);
674: IF (l_debug = 'Y') THEN
675: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Delete_CV_Label:'||x_return_status);
676: END IF;
677: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
678: IF (l_debug = 'Y') THEN
679: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Delete_CV_Label');
675: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Delete_CV_Label:'||x_return_status);
676: END IF;
677: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
678: IF (l_debug = 'Y') THEN
679: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Delete_CV_Label');
680: for i in 1..x_msg_count loop
681: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
682: IBE_UTIL.debug(l_msg_data);
683: end loop;
684: END IF;
685: RAISE FND_API.G_EXC_ERROR;
686: ELSIF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
687: IF (l_debug = 'Y') THEN
688: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Delete_CV_Label');
689: for i in 1..x_msg_count loop
690: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
691: IBE_UTIL.debug(l_msg_data);
692: end loop;
718: l_cv_label_rec.object_version_number := l_temp;
719: l_cv_label_rec.last_update_login := FND_GLOBAL.login_id;
720: IF (l_temp >= 0) THEN
721: IF (l_debug = 'Y') THEN
722: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Update_CV_Label');
723: IBE_UTIL.debug('P_CV_Label_Rec.content_item_id = '||l_cv_label_rec.content_item_id);
724: IBE_UTIL.debug('P_CV_Label_Rec.citem_version_id = '||l_cv_label_rec.citem_version_id);
725: IBE_UTIL.debug('P_CV_Label_Rec.label_code = '||l_cv_label_rec.label_code);
726: IBE_UTIL.debug('P_CV_Label_Rec.last_updated_by = '
731: ||l_cv_label_rec.object_version_number);
732: IBE_UTIL.debug('P_CV_Label_Rec.last_update_login = '
733: ||l_cv_label_rec.last_update_login);
734: END IF;
735: Ibc_Cv_Label_Grp.Update_CV_Label(
736: p_api_version_number => 1.0,
737: P_Init_Msg_List => FND_API.G_FALSE,
738: P_Commit => FND_API.G_FALSE,
739: P_CV_Label_Rec => l_cv_label_rec,
741: x_return_status => x_return_status,
742: x_msg_count => x_msg_count,
743: x_msg_data => x_msg_data);
744: IF (l_debug = 'Y') THEN
745: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Update_CV_Label:'||x_return_status);
746: END IF;
747: ELSE
748: l_cv_label_rec.object_version_number := 1;
749: l_cv_label_rec.created_by := FND_GLOBAL.user_id;
748: l_cv_label_rec.object_version_number := 1;
749: l_cv_label_rec.created_by := FND_GLOBAL.user_id;
750: l_cv_label_rec.creation_date := SYSDATE;
751: IF (l_debug = 'Y') THEN
752: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Update_CV_Label');
753: IBE_UTIL.debug('P_CV_Label_Rec.content_item_id = '||l_cv_label_rec.content_item_id);
754: IBE_UTIL.debug('P_CV_Label_Rec.citem_version_id = '||l_cv_label_rec.citem_version_id);
755: IBE_UTIL.debug('P_CV_Label_Rec.label_code = '||l_cv_label_rec.label_code);
756: IBE_UTIL.debug('P_CV_Label_Rec.last_updated_by = '
763: ||l_cv_label_rec.last_update_login);
764: IBE_UTIL.debug('P_CV_Label_Rec.creation_date = '
765: ||to_char(l_cv_label_rec.creation_date,'MM-DD-RRRR HH24:MI:SS'));
766: IBE_UTIL.debug('P_CV_Label_Rec.created_by = '||l_cv_label_rec.created_by);
767: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Create_CV_Label');
768: END IF;
769: Ibc_Cv_Label_Grp.Create_CV_Label(
770: p_api_version_number => 1.0,
771: P_Init_Msg_List => FND_API.G_FALSE,
765: ||to_char(l_cv_label_rec.creation_date,'MM-DD-RRRR HH24:MI:SS'));
766: IBE_UTIL.debug('P_CV_Label_Rec.created_by = '||l_cv_label_rec.created_by);
767: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Create_CV_Label');
768: END IF;
769: Ibc_Cv_Label_Grp.Create_CV_Label(
770: p_api_version_number => 1.0,
771: P_Init_Msg_List => FND_API.G_FALSE,
772: P_Commit => FND_API.G_FALSE,
773: P_CV_Label_Rec => l_cv_label_rec,
775: x_return_status => x_return_status,
776: x_msg_count => x_msg_count,
777: x_msg_data => x_msg_data);
778: IF (l_debug = 'Y') THEN
779: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Create_CV_Label:'||x_return_status);
780: END IF;
781: END IF;
782: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
783: IF (l_debug = 'Y') THEN
780: END IF;
781: END IF;
782: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
783: IF (l_debug = 'Y') THEN
784: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Update_CV_Label/Create_CV_Label');
785: for i in 1..x_msg_count loop
786: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
787: IBE_UTIL.debug(l_msg_data);
788: end loop;
789: END IF;
790: RAISE FND_API.G_EXC_ERROR;
791: ELSIF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
792: IF (l_debug = 'Y') THEN
793: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Update_CV_Label/Create_CV_Label');
794: for i in 1..x_msg_count loop
795: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
796: IBE_UTIL.debug(l_msg_data);
797: end loop;
957: IBE_UTIL.debug('After checking association for the content item:'||l_temp);
958: END IF;
959: IF (l_temp <> 1) THEN
960: IF (l_debug = 'Y') THEN
961: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Delete_CV_Label');
962: IBE_UTIL.debug('p_label_code = '||l_label_code);
963: IBE_UTIL.debug('p_content_item_id = '||l_content_item_id);
964: END IF;
965: Ibc_Cv_Label_Grp.Delete_CV_Label(
961: IBE_UTIL.debug('Calling Ibc_Cv_Label_Grp.Delete_CV_Label');
962: IBE_UTIL.debug('p_label_code = '||l_label_code);
963: IBE_UTIL.debug('p_content_item_id = '||l_content_item_id);
964: END IF;
965: Ibc_Cv_Label_Grp.Delete_CV_Label(
966: P_Api_Version_Number => 1.0,
967: P_Init_Msg_List => FND_API.G_FALSE,
968: P_Commit => FND_API.G_FALSE,
969: p_label_code => l_label_code,
971: x_return_status => x_return_status,
972: x_msg_count => x_msg_count,
973: x_msg_data => x_msg_data);
974: IF (l_debug = 'Y') THEN
975: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Delete_CV_Label:'||x_return_status);
976: END IF;
977: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
978: IF (l_debug = 'Y') THEN
979: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Delete_CV_Label');
975: IBE_UTIL.debug('After calling Ibc_Cv_Label_Grp.Delete_CV_Label:'||x_return_status);
976: END IF;
977: IF (x_return_status = FND_API.G_RET_STS_ERROR) THEN
978: IF (l_debug = 'Y') THEN
979: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Delete_CV_Label');
980: for i in 1..x_msg_count loop
981: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
982: IBE_UTIL.debug(l_msg_data);
983: end loop;
984: END IF;
985: RAISE FND_API.G_EXC_ERROR;
986: ELSIF (x_return_status = FND_API.G_RET_STS_UNEXP_ERROR) THEN
987: IF (l_debug = 'Y') THEN
988: IBE_UTIL.debug('Error in Ibc_Cv_Label_Grp.Delete_CV_Label');
989: for i in 1..x_msg_count loop
990: l_msg_data := FND_MSG_PUB.get(i,FND_API.G_FALSE);
991: IBE_UTIL.debug(l_msg_data);
992: end loop;