DBA Data[Home] [Help]

APPS.AMS_ATTACHMENT_PVT dependencies on FND_DOCUMENTS

Line 104: AMS_UTILITY_PVT.debug_message( 'Private API: Calling table handler fnd_documents_pkg.insert_row');

100: END IF;
101:
102: -- Debug Message
103: IF (AMS_DEBUG_HIGH_ON) THEN
104: AMS_UTILITY_PVT.debug_message( 'Private API: Calling table handler fnd_documents_pkg.insert_row');
105: END IF;
106:
107: l_media_id := p_Fnd_Attachment_rec.media_id;
108:

Line 110: fnd_documents_pkg.insert_row(

106:
107: l_media_id := p_Fnd_Attachment_rec.media_id;
108:
109: -- Invoke table handler
110: fnd_documents_pkg.insert_row(
111: X_rowid => l_row_id,
112: X_document_id => x_document_id,
113: X_creation_date => sysdate,
114: X_created_by => FND_GLOBAL.USER_ID,

Line 135: fnd_documents_short_text

131: if (p_Fnd_Attachment_rec.media_id is null) then
132: /* It means that a new text needs to be created, otherwise not */
133: /* Populate Short Text */
134: insert into
135: fnd_documents_short_text
136: (media_id,
137: short_text
138: )
139: values

Line 145: Update fnd_documents_tl because FND_API inserts newly generated

141: p_Fnd_Attachment_rec.short_text
142: );
143: else
144: /*
145: Update fnd_documents_tl because FND_API inserts newly generated
146: media_id into that table.
147: */
148: update fnd_documents_tl
149: set media_id = p_Fnd_Attachment_rec.media_id

Line 148: update fnd_documents_tl

144: /*
145: Update fnd_documents_tl because FND_API inserts newly generated
146: media_id into that table.
147: */
148: update fnd_documents_tl
149: set media_id = p_Fnd_Attachment_rec.media_id
150: where document_id = x_document_id;
151:
152: end if;

Line 155: /* For File we have already generated a file id - the fnd_documents_pkg.insert_row

151:
152: end if;
153:
154: elsif (p_Fnd_Attachment_rec.datatype_id = 6) then /* File */
155: /* For File we have already generated a file id - the fnd_documents_pkg.insert_row
156: table handler has generated a fnd_lobs_s.nextval but that's not what shoule be the
157: reference to the FND_LOBS table - because the upload program has already generated a
158: sequence */
159: /**

Line 160: update fnd_documents_tl

156: table handler has generated a fnd_lobs_s.nextval but that's not what shoule be the
157: reference to the FND_LOBS table - because the upload program has already generated a
158: sequence */
159: /**
160: update fnd_documents_tl
161: set media_id = p_Fnd_Attachment_rec.media_id
162: where document_id = l_document_id;
163: **/
164: null;

Line 306: This procedure updates FND_DOCUMENTS,FND_DOCUMENTS_TL and FND_DOCUMENTS_SHORT_TEX T. FND_ATTACHED_DOCUMENTS is not updated because it maintains the link between

302: );
303: End Create_Fnd_Attachment;
304:
305: /**
306: This procedure updates FND_DOCUMENTS,FND_DOCUMENTS_TL and FND_DOCUMENTS_SHORT_TEX T. FND_ATTACHED_DOCUMENTS is not updated because it maintains the link between
307: FND_DOCUMENTS and FND_DOCUMENT_ENTITIES. In Sales and Marketing the association cannot be updated.
308:
309: **/
310:

Line 307: FND_DOCUMENTS and FND_DOCUMENT_ENTITIES. In Sales and Marketing the association cannot be updated.

303: End Create_Fnd_Attachment;
304:
305: /**
306: This procedure updates FND_DOCUMENTS,FND_DOCUMENTS_TL and FND_DOCUMENTS_SHORT_TEX T. FND_ATTACHED_DOCUMENTS is not updated because it maintains the link between
307: FND_DOCUMENTS and FND_DOCUMENT_ENTITIES. In Sales and Marketing the association cannot be updated.
308:
309: **/
310:
311: PROCEDURE Update_Fnd_Attachment(

Line 325: CURSOR c_get_Fnd_Documents(l_document_id NUMBER) IS

321: p_Fnd_Attachment_rec IN fnd_attachment_rec_type
322: )
323:
324: IS
325: CURSOR c_get_Fnd_Documents(l_document_id NUMBER) IS
326: SELECT *
327: FROM fnd_documents
328: where document_id = l_document_id;
329:

Line 327: FROM fnd_documents

323:
324: IS
325: CURSOR c_get_Fnd_Documents(l_document_id NUMBER) IS
326: SELECT *
327: FROM fnd_documents
328: where document_id = l_document_id;
329:
330: -- Hint: Developer need to provide Where clause
331: L_API_NAME CONSTANT VARCHAR2(30) := 'Update_Fnd_Attachment';

Line 336: l_ref_Fnd_Attachment_rec c_get_fnd_Documents%ROWTYPE ;

332: L_API_VERSION_NUMBER CONSTANT NUMBER := 1.0;
333: -- Local Variables
334: l_document_id number;
335: l_attached_document_ID NUMBER;
336: l_ref_Fnd_Attachment_rec c_get_fnd_Documents%ROWTYPE ;
337: l_tar_Fnd_Attachment_rec AMS_attachment_PVT.fnd_attachment_rec_type := P_fnd_attachment_rec;
338: l_rowid ROWID;
339: l_media_id Number;
340:

Line 374: OPEN c_get_Fnd_Documents( l_tar_fnd_attachment_rec.document_id);

370: IF (AMS_DEBUG_HIGH_ON) THEN
371: AMS_UTILITY_PVT.debug_message('Private API: - Open Cursor to Select');
372: END IF;
373:
374: OPEN c_get_Fnd_Documents( l_tar_fnd_attachment_rec.document_id);
375:
376: FETCH c_get_Fnd_Documents INTO l_ref_fnd_attachment_rec ;
377:
378: If ( c_get_Fnd_Documents%NOTFOUND) THEN

Line 376: FETCH c_get_Fnd_Documents INTO l_ref_fnd_attachment_rec ;

372: END IF;
373:
374: OPEN c_get_Fnd_Documents( l_tar_fnd_attachment_rec.document_id);
375:
376: FETCH c_get_Fnd_Documents INTO l_ref_fnd_attachment_rec ;
377:
378: If ( c_get_Fnd_Documents%NOTFOUND) THEN
379: AMS_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET',
380: p_token_name => 'INFO',

Line 378: If ( c_get_Fnd_Documents%NOTFOUND) THEN

374: OPEN c_get_Fnd_Documents( l_tar_fnd_attachment_rec.document_id);
375:
376: FETCH c_get_Fnd_Documents INTO l_ref_fnd_attachment_rec ;
377:
378: If ( c_get_Fnd_Documents%NOTFOUND) THEN
379: AMS_Utility_PVT.Error_Message(p_message_name => 'API_MISSING_UPDATE_TARGET',
380: p_token_name => 'INFO',
381: p_token_value => 'Fnd_Attachment') ;
382: RAISE FND_API.G_EXC_ERROR;

Line 395: CLOSE c_get_Fnd_documents;

391: -- Debug Message
392: IF (AMS_DEBUG_HIGH_ON) THEN
393: AMS_UTILITY_PVT.debug_message('Private API: - Close Cursor');
394: END IF;
395: CLOSE c_get_Fnd_documents;
396:
397: -- Debug Message
398: --IF (AMS_DEBUG_HIGH_ON) THEN AMS_UTILITY_PVT.debug_message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'Private API: Calling update table handler');END IF;
399:

Line 402: SELECT fnd_documents_short_text_s.nextval

398: --IF (AMS_DEBUG_HIGH_ON) THEN AMS_UTILITY_PVT.debug_message(FND_MSG_PUB.G_MSG_LVL_DEBUG_LOW, 'Private API: Calling update table handler');END IF;
399:
400: if (p_Fnd_Attachment_rec.datatype_id = 1) then
401: if (p_Fnd_Attachment_rec.media_id is null) then
402: SELECT fnd_documents_short_text_s.nextval
403: INTO l_media_id
404: from dual;
405: end if;
406: end if;

Line 408: -- Invoke table handler(fnd_documents_pkg.update_row)

404: from dual;
405: end if;
406: end if;
407:
408: -- Invoke table handler(fnd_documents_pkg.update_row)
409: fnd_documents_pkg.update_row(
410: X_document_id => p_Fnd_Attachment_rec.document_id,
411: X_last_update_date => sysdate,
412: X_last_updated_by => FND_GLOBAL.USER_ID,

Line 409: fnd_documents_pkg.update_row(

405: end if;
406: end if;
407:
408: -- Invoke table handler(fnd_documents_pkg.update_row)
409: fnd_documents_pkg.update_row(
410: X_document_id => p_Fnd_Attachment_rec.document_id,
411: X_last_update_date => sysdate,
412: X_last_updated_by => FND_GLOBAL.USER_ID,
413: X_last_update_login => FND_GLOBAL.CONC_LOGIN_ID,

Line 432: FND_DOCUMENTS_SHORT_TEXT in case of text - otherwise

428: );
429:
430: /* Bug# 2072584 */
431: /* Need to call the previous method call before actually updating
432: FND_DOCUMENTS_SHORT_TEXT in case of text - otherwise
433: the trigger was failing */
434:
435: -- Update fnd_documents_short_text based on the datatype_id
436: if (p_Fnd_Attachment_rec.datatype_id = 1) then

Line 435: -- Update fnd_documents_short_text based on the datatype_id

431: /* Need to call the previous method call before actually updating
432: FND_DOCUMENTS_SHORT_TEXT in case of text - otherwise
433: the trigger was failing */
434:
435: -- Update fnd_documents_short_text based on the datatype_id
436: if (p_Fnd_Attachment_rec.datatype_id = 1) then
437:
438: if (p_Fnd_Attachment_rec.media_id is null) then
439: -- Create a record

Line 443: fnd_documents_short_text

439: -- Create a record
440:
441: /* Populate Short Text */
442: insert into
443: fnd_documents_short_text
444: (media_id,
445: short_text
446: )
447: values

Line 453: update fnd_documents_short_text

449: p_Fnd_Attachment_rec.short_text
450: );
451:
452: else
453: update fnd_documents_short_text
454: set short_text = p_Fnd_Attachment_rec.short_text
455: where media_id = p_Fnd_Attachment_rec.media_id;
456:
457: if SQL%NOTFOUND then

Line 462: p_token_value => 'Fnd_Documents_Short_Text') ;

458:
459: AMS_Utility_PVT.Error_Message(
460: p_message_name => 'API_MISSING_UPDATE_TARGET',
461: p_token_name => 'INFO',
462: p_token_value => 'Fnd_Documents_Short_Text') ;
463: RAISE FND_API.G_EXC_ERROR;
464:
465: end if;
466:

Line 560: from fnd_documents_tl

556:
557: cursor c_get_media_id(p_document_id number)
558: is
559: select media_id
560: from fnd_documents_tl
561: where document_id= p_document_id
562: and language = userenv('LANG');
563:
564: /* Need to check if the file/text is referenced by any other document */

Line 571: from fnd_documents_tl tl

567: select 1
568: from dual
569: where exists
570: (select 1
571: from fnd_documents_tl tl
572: ,fnd_documents b
573: where b.document_id=tl.document_id
574: and tl.media_id = p_media_id
575: and b.datatype_id = p_datatype_id

Line 572: ,fnd_documents b

568: from dual
569: where exists
570: (select 1
571: from fnd_documents_tl tl
572: ,fnd_documents b
573: where b.document_id=tl.document_id
574: and tl.media_id = p_media_id
575: and b.datatype_id = p_datatype_id
576: and b.document_id <> p_document_id

Line 628: For FILE/TEXT, checking if file_id/text_id exists in fnd_documents_tl,

624: fetch c_check_media_id_reference into l_media_exists;
625: close c_check_media_id_reference;
626:
627: /*
628: For FILE/TEXT, checking if file_id/text_id exists in fnd_documents_tl,
629: if so not deleting the lob/text but otherwise delete the content as well
630: */
631:
632: if (l_media_exists is null) then

Line 639: FND_DOCUMENTS_PKG.Delete_Row(

635: end if;
636:
637: if (l_use_fnd_api) then
638:
639: FND_DOCUMENTS_PKG.Delete_Row(
640: X_document_id => p_document_id,
641: X_datatype_id => p_datatype_id,
642: delete_ref_Flag => p_delete_attachment_ref_flag
643: );

Line 646: delete from fnd_documents

642: delete_ref_Flag => p_delete_attachment_ref_flag
643: );
644: else
645:
646: delete from fnd_documents
647: where document_id=p_document_id;
648:
649: delete from fnd_documents_tl
650: where document_id=p_document_id;

Line 649: delete from fnd_documents_tl

645:
646: delete from fnd_documents
647: where document_id=p_document_id;
648:
649: delete from fnd_documents_tl
650: where document_id=p_document_id;
651:
652: delete from fnd_attached_documents
653: where document_id=p_document_id;

Line 660: FND_DOCUMENTS_PKG.Delete_Row(

656:
657:
658: ELSE
659: /* For URL calling the FND API */
660: FND_DOCUMENTS_PKG.Delete_Row(
661: X_document_id => p_document_id,
662: X_datatype_id => p_datatype_id,
663: delete_ref_Flag => p_delete_attachment_ref_flag
664: );