DBA Data[Home] [Help]

PACKAGE: APPS.JTF_AMV_ITEM_PUB

Source


1 PACKAGE jtf_amv_item_pub AUTHID CURRENT_USER AS
2 /* $Header: jtfpitms.pls 115.3 2002/11/26 19:14:33 stopiwal ship $ */
3 -- Start of Comments
4 --
5 -- NAME
6 --   JTF_AMV_ITEM_PUB
7 --
8 -- PURPOSE
9 --   This package is a public API managing items (contents) and their related
10 --   attributes in JTF.  It also defines global variables.
11 --
12 --   PROCEDURES:
13 --            Create_Item;
14 --            Delete_Item;
15 --            Update_Item;
16 --            Get_Item;
17 --
18 --     Handle file:    --This have been moved to a separated package.
19 --            --Add_ItemFile
20 --            --Delete_ItemFile
21 --            --Update_ItemFile
22 --            --Get_ItemFile
23 --     Handle keywords:
24 --            Add_ItemKeyword
25 --            Delete_ItemKeyword
26 --            Replace_ItemKeyword
27 --            Get_ItemKeyword
28 --     Handle authors:
29 --            Add_ItemAuthor
30 --            Delete_ItemAuthor
31 --            Update_ItemAuthor
32 --            Get_ItemAuthor
33 -- NOTES
34 --
35 --     The API to handle item's perspective and content type are in separated
36 --     MES package (amv_perspective_pvt and amv_contenttype_pvt). These are more
37 --     MES specific.
38 --
39 -- HISTORY
40 --   11/30/1999        PWU            created
41 -- End of Comments
42 --
43 --
44 -- The following constants are to be finalized.
45 --
46 G_VERSION               CONSTANT    NUMBER    :=  1.0;
47 --
48 TYPE number_tab_type    IS table of NUMBER;
49 TYPE char_tab_type      IS table of VARCHAR2(120);
50 --
51 TYPE item_rec_type IS RECORD
52 (
53   item_id                   NUMBER,
54   creation_date             DATE,
55   created_by                NUMBER,
56   last_update_date          DATE,
57   last_updated_by           NUMBER,
58   last_update_login         NUMBER,
59   object_version_number     NUMBER,
60   application_id            NUMBER,
61   external_access_flag      VARCHAR2(1),
62   item_name                 VARCHAR2(240),
63   description               VARCHAR2(2000),
64   text_string               VARCHAR2(2000),
65   language_code             VARCHAR2(4),
66   status_code               VARCHAR2(30),
67   effective_start_date      DATE,
68   expiration_date           DATE,
69   item_type                 VARCHAR2(240),
70   url_string                VARCHAR2(2000),
71   publication_date          DATE,
72   priority                  VARCHAR2(30),
73   content_type_id           NUMBER,
74   owner_id                  NUMBER,
75   default_approver_id       NUMBER,
76   item_destination_type     VARCHAR2(240),
77   access_name               VARCHAR2(40),
78   deliverable_type_code     VARCHAR2(40),
79   applicable_to_code        VARCHAR2(40)
80 );
81 --
82 -- This package contains the following procedure
83 --
84 --------------------------------------------------------------------------------
85 -- Start of comments
86 --    API name   : Create_Item
87 --    Type       : Public
88 --    Pre-reqs   : None
89 --    Function   : Create a new item given the item information.
90 --    Parameters :
91 --    IN           p_api_version                      NUMBER    Required
92 --                 p_init_msg_list                    VARCHAR2  Optional
93 --                        Default = FND_API.G_FALSE
94 --                 p_commit                           VARCHAR2  Optional
95 --                        Default = FND_API.G_FALSE
96 --                 p_item_rec                         ITEM_REC_TYPE,
97 --                                                              Required
98 --    OUT        : x_return_status                    VARCHAR2
99 --                 x_msg_count                        NUMBER
100 --                 x_msg_data                         VARCHAR2
101 --                 x_item_id                          NUMBER
102 --                 Item id will be generated from sequence number.
103 --    Notes      :
104 --
105 -- End of comments
106 --
107 PROCEDURE Create_Item
108 (
109     p_api_version       IN  NUMBER,
110     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
111     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
112     x_return_status     OUT NOCOPY VARCHAR2,
113     x_msg_count         OUT NOCOPY NUMBER,
114     x_msg_data          OUT NOCOPY VARCHAR2,
115     p_item_rec          IN  ITEM_REC_TYPE,
116     x_item_id           OUT NOCOPY NUMBER
117 );
118 --
119 -- Algorithm:
120 --   BEGIN
121 --     Verify API version compatibility
122 --     Set rollback SAVEPOINT
123 --     Ensure that the passed item object has basic right information.
124 --     insert a new item with row = p_obj_rec to
125 --     item table(jtf_amv_items_b and jtf_amv_items_tl).
126 --     Commit transaction if requested
127 --   END
128 --
129 --------------------------------------------------------------------------------
130 -- Start of comments
131 --    API name   : Delete_Item
132 --    Type       : Public
133 --    Pre-reqs   : None
134 --    Function   : Delete the item given the item id from database.
135 --    Parameters :
136 --    IN           p_api_version                      NUMBER    Required
137 --                 p_init_msg_list                    VARCHAR2  Optional
138 --                        Default = FND_API.G_FALSE
139 --                 p_commit                           VARCHAR2  Optional
140 --                        Default = FND_API.G_FALSE
141 --                 p_item_id                          NUMBER    Required
142 --    OUT        : x_return_status                    VARCHAR2
143 --                 x_msg_count                        NUMBER
144 --                 x_msg_data                         VARCHAR2
145 --    Notes      :
146 --
147 -- End of comments
148 --
149 PROCEDURE Delete_Item
150 (
151     p_api_version       IN  NUMBER,
152     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
153     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
154     x_return_status     OUT NOCOPY VARCHAR2,
155     x_msg_count         OUT NOCOPY NUMBER,
156     x_msg_data          OUT NOCOPY VARCHAR2,
157     p_item_id           IN  NUMBER
158 );
159 --
160 -- Algorithm:
161 --   BEGIN
162 --     Verify API version compatibility
163 --       Set rollback SAVEPOINT
164 --       Get the item with item_id = p_item_id
165 --       Delete the item's attributes (attachment, keywords, authors)
166 --       Delete the item itself
167 --       Commit transaction if requested
168 --   END
169 --------------------------------------------------------------------------------
170 -- Start of comments
171 --    API name   : Update_Item
172 --    Type       : Public
173 --    Pre-reqs   : None
174 --    Function   : Update the item based on the passed item record information.
175 --    Parameters :
176 --    IN           p_api_version                      NUMBER    Required
177 --                 p_init_msg_list                    VARCHAR2  Optional
178 --                        Default = FND_API.G_FALSE
179 --                 p_commit                           VARCHAR2  Optional
180 --                        Default = FND_API.G_FALSE
181 --                 p_item_rec                         ITEM_REC_TYPE
182 --                 The record for the new data of the item.     Required
183 --    OUT        : x_return_status                    VARCHAR2
184 --                 x_msg_count                        NUMBER
185 --                 x_msg_data                         VARCHAR2
186 --    Notes      :
187 --
188 -- End of comments
189 --
190 PROCEDURE Update_Item
191 (
192     p_api_version       IN  NUMBER,
193     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
194     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
195     x_return_status     OUT NOCOPY VARCHAR2,
196     x_msg_count         OUT NOCOPY NUMBER,
197     x_msg_data          OUT NOCOPY VARCHAR2,
198     p_item_rec          IN  ITEM_REC_TYPE
199 );
200 --
201 -- Algorithm:
202 --   BEGIN
203 --     Verify API version compatibility
204 --     Set rollback SAVEPOINT
205 --     Ensure that the passed item record has basic right information.
206 --     update the item with row = p_item_rec to
207 --     item table(jtf_amv_items_b and jtf_items_tl, ...).
208 --     Commit transaction if requested
209 --   END
210 --
211 --------------------------------------------------------------------------------
212 -- Start of comments
213 --    API name   : Get_Item
214 --    Type       : Public
215 --    Pre-reqs   : None
216 --    Function   : Get an item information given the item id.
217 --    Parameters :
218 --    IN           p_api_version                      NUMBER    Required
219 --                 p_init_msg_list                    VARCHAR2  Optional
220 --                        Default = FND_API.G_FALSE
221 --                 p_item_id                          NUMBER    Required
222 --    OUT        : x_return_status                    VARCHAR2
223 --                 x_msg_count                        NUMBER
224 --                 x_msg_data                         VARCHAR2
225 --                 x_item_rec                         ITEM_REC_TYPE
226 --    Notes      :
227 --
228 -- End of comments
229 --
230 PROCEDURE Get_Item
231 (
232     p_api_version       IN  NUMBER,
233     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
234     x_return_status     OUT NOCOPY VARCHAR2,
235     x_msg_count         OUT NOCOPY NUMBER,
236     x_msg_data          OUT NOCOPY VARCHAR2,
237     p_item_id           IN  NUMBER,
238     x_item_rec          OUT NOCOPY ITEM_REC_TYPE
239 );
240 --
241 -- Algorithm:
242 --   BEGIN
243 --     Verify API version compatibility
244 --     Base on the given item id, query and get the item.
245 --   END
246 --------------------------------------------------------------------------------
247 ------------------------------ ITEM_KEYWORD ------------------------------------
248 -- Start of comments
249 --    API name   : Add_ItemKeyword
250 --    Type       : Public
251 --    Pre-reqs   : None
252 --    Function   : Add the keywords passed in the table to the specified item.
253 --    Parameters :
254 --    IN           p_api_version                      NUMBER    Required
255 --                 p_init_msg_list                    VARCHAR2  Optional
256 --                        Default = FND_API.G_FALSE
257 --                 p_commit                           VARCHAR2  Optional
258 --                        Default = FND_API.G_FALSE
259 --                 p_item_id                          NUMBER    Required
260 --                    The item id to be add the keywords.
261 --                 p_keyword_tab                      CHAR_TAB_TYPE
262 --                    The keywords table                        Required
263 --    OUT        : x_return_status                    VARCHAR2
264 --                 x_msg_count                        NUMBER
265 --                 x_msg_data                         VARCHAR2
266 --    Notes      :
267 --
268 -- End of comments
269 --
270 PROCEDURE Add_ItemKeyword
271 (
272     p_api_version       IN  NUMBER,
273     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
274     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
275     x_return_status     OUT NOCOPY VARCHAR2,
276     x_msg_count         OUT NOCOPY NUMBER,
277     x_msg_data          OUT NOCOPY VARCHAR2,
278     p_item_id           IN  NUMBER,
279     p_keyword_tab       IN  CHAR_TAB_TYPE
280 );
281 -- Algorithm:
282 --   BEGIN
283 --     Verify API version compatibility
284 --     Set rollback SAVEPOINT
285 --       Loop for each keyword in the passed table
286 --           check if the keyword is already in the item.
287 --           If so, don't add it.
288 --           add the keyword to the item.
289 --     Commit transaction if requested
290 --
291 --------------------------------------------------------------------------------
292 -- Start of comments
293 --    API name   : Add_ItemKeyword
294 --    Type       : Public
295 --    Pre-reqs   : None
296 --    Function   : Add the keyword to the specified item.
297 --    Parameters :
298 --    IN           p_api_version                      NUMBER    Required
299 --                 p_init_msg_list                    VARCHAR2  Optional
300 --                        Default = FND_API.G_FALSE
301 --                 p_commit                           VARCHAR2  Optional
302 --                        Default = FND_API.G_FALSE
303 --                 p_item_id                          NUMBER    Required
304 --                    The item id to be add the keyword.
305 --                 p_keyword                          VARCHAR2  Required
306 --                    The keyword to be added to the item.
307 --    OUT        : x_return_status                    VARCHAR2
308 --                 x_msg_count                        NUMBER
309 --                 x_msg_data                         VARCHAR2
310 --    Notes      :
311 --
312 -- End of comments
313 --
314 PROCEDURE Add_ItemKeyword
315 (
316     p_api_version       IN  NUMBER,
317     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
318     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
319     x_return_status     OUT NOCOPY VARCHAR2,
320     x_msg_count         OUT NOCOPY NUMBER,
321     x_msg_data          OUT NOCOPY VARCHAR2,
322     p_item_id           IN  NUMBER,
323     p_keyword           IN  VARCHAR2
324 );
325 -- Algorithm:
326 --   BEGIN
327 --     Verify API version compatibility
328 --     Set rollback SAVEPOINT
329 --     check if the keyword is in the item.
330 --     If so, don't add it.
331 --     otherwise, add the keyword to the item.
332 --     Commit transaction if requested
333 --
334 --------------------------------------------------------------------------------
335 -- Start of comments
336 --    API name   : Delete_ItemKeyword
337 --    Type       : Public
338 --    Pre-reqs   : None
339 --    Function   : Remove the keywords passed in the table
340 --                 from the specified item.
341 --    Parameters :
342 --    IN           p_api_version                      NUMBER    Required
343 --                 p_init_msg_list                    VARCHAR2  Optional
344 --                        Default = FND_API.G_FALSE
345 --                 p_commit                           VARCHAR2  Optional
346 --                        Default = FND_API.G_FALSE
347 --                 p_item_id                          NUMBER    Required
348 --                    The item id to be add the keywords.
349 --                 p_keyword_tab                      CHAR_TAB_TYPE
350 --                    The keywords table                        Required
351 --    OUT        : x_return_status                    VARCHAR2
352 --                 x_msg_count                        NUMBER
353 --                 x_msg_data                         VARCHAR2
354 --    Notes      :
355 --
356 -- End of comments
357 --
358 PROCEDURE Delete_ItemKeyword
359 (
360     p_api_version       IN  NUMBER,
361     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
362     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
363     x_return_status     OUT NOCOPY VARCHAR2,
364     x_msg_count         OUT NOCOPY NUMBER,
365     x_msg_data          OUT NOCOPY VARCHAR2,
366     p_item_id           IN  NUMBER,
367     p_keyword_tab       IN  CHAR_TAB_TYPE
368 );
369 -- Algorithm:
370 --   BEGIN
371 --     Verify API version compatibility
372 --     Set rollback SAVEPOINT
373 --       Loop for each keyword in the passed array
374 --           remove the keyword from the item.
375 --     Commit transaction if requested
376 --
380 --    Type       : Public
377 --------------------------------------------------------------------------------
378 -- Start of comments
379 --    API name   : Delete_ItemKeyword
381 --    Pre-reqs   : None
382 --    Function   : Remove the passed keyword from the specified item.
383 --    Parameters :
384 --    IN           p_api_version                      NUMBER    Required
385 --                 p_init_msg_list                    VARCHAR2  Optional
386 --                        Default = FND_API.G_FALSE
387 --                 p_commit                           VARCHAR2  Optional
388 --                        Default = FND_API.G_FALSE
389 --                 p_item_id                          NUMBER    Required
390 --                    The id of the item to remove the keyword from.
391 --                 p_keyword                          VARCHAR2  Required
392 --                    The keyword to be removed.
393 --    OUT        : x_return_status                    VARCHAR2
394 --                 x_msg_count                        NUMBER
395 --                 x_msg_data                         VARCHAR2
396 --    Notes      :
397 --
398 -- End of comments
399 --
400 PROCEDURE Delete_ItemKeyword
401 (
402     p_api_version       IN  NUMBER,
403     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
404     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
405     x_return_status     OUT NOCOPY VARCHAR2,
406     x_msg_count         OUT NOCOPY NUMBER,
407     x_msg_data          OUT NOCOPY VARCHAR2,
408     p_item_id           IN  NUMBER,
409     p_keyword           IN  VARCHAR2
410 );
411 -- Algorithm:
412 --   BEGIN
413 --     Verify API version compatibility
414 --     check if this item id is valid
415 --     IF not THEN
416 --         return error 'invalid item id';
417 --     END IF
418 --     Set rollback SAVEPOINT
419 --     remove the keyword from the item.
420 --     Commit transaction if requested
421 --
422 --------------------------------------------------------------------------------
423 -- Start of comments
424 --    API name   : Replace_ItemKeyword
425 --    Type       : Public
426 --    Pre-reqs   : None
427 --    Function   : Set the keywords of the specified item
428 --                 to the keywords passed in the array
429 --                 Effectively, this delete all the orignal keywords
430 --                 and add the passed keywords to the item.
431 --    Parameters :
432 --    IN           p_api_version                      NUMBER    Required
433 --                 p_init_msg_list                    VARCHAR2  Optional
434 --                        Default = FND_API.G_FALSE
435 --                 p_commit                           VARCHAR2  Optional
436 --                        Default = FND_API.G_FALSE
437 --                 p_item_id                          NUMBER    Required
438 --                    The item id to be added the keywords.
439 --                 p_keyword_tab                      CHAR_TAB_TYPE
440 --                    The keywords table                        Required
441 --    OUT        : x_return_status                    VARCHAR2
442 --                 x_msg_count                        NUMBER
443 --                 x_msg_data                         VARCHAR2
444 --    Notes      :
445 --
446 -- End of comments
447 --
448 PROCEDURE Replace_ItemKeyword
449 (
450     p_api_version       IN  NUMBER,
451     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
452     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
453     x_return_status     OUT NOCOPY VARCHAR2,
454     x_msg_count         OUT NOCOPY NUMBER,
455     x_msg_data          OUT NOCOPY VARCHAR2,
456     p_item_id           IN  NUMBER,
457     p_keyword_tab       IN  CHAR_TAB_TYPE
458 );
459 -- Algorithm:
460 --   BEGIN
461 --     Call delete_ItemKeyword to delete all the original keywords
462 --     Then call Add_ItemKeyword to add the keywords to the item.
463 --   END
464 --
465 --------------------------------------------------------------------------------
466 -- Start of comments
467 --    API name   : Get_ItemKeyword
468 --    Type       : Public
469 --    Pre-reqs   : None
470 --    Function   : Query and return all the keywords of the specified item
471 --    Parameters :
472 --    IN           p_api_version                      NUMBER    Required
473 --                 p_init_msg_list                    VARCHAR2  Optional
474 --                        Default = FND_API.G_FALSE
475 --                 p_item_id                          NUMBER    Required
476 --    OUT        : x_return_status                    VARCHAR2
477 --                 x_msg_count                        NUMBER
478 --                 x_msg_data                         VARCHAR2
479 --                 x_keyword_tab                      CHAR_TAB_TYPE
480 --                    The retrieved keywords table
481 --    Notes      :
482 --
483 -- End of comments
484 --
485 PROCEDURE Get_ItemKeyword
486 (
487     p_api_version       IN  NUMBER,
488     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
489     x_return_status     OUT NOCOPY VARCHAR2,
490     x_msg_count         OUT NOCOPY NUMBER,
491     x_msg_data          OUT NOCOPY VARCHAR2,
492     p_item_id           IN  NUMBER,
493     x_keyword_tab       OUT NOCOPY CHAR_TAB_TYPE
494 );
495 --
496 -- Algorithm:
497 --   BEGIN
498 --     Verify API version compatibility
502 --     END IF
499 --     check if this item id is valid
500 --     IF not THEN
501 --         return error 'invalid item id';
503 --     Query all the keywords belonged to the specified item
504 --     And return the results in the output table.
505 --
506 --------------------------------------------------------------------------------
507 ------------------------------ ITEM_AUTHOR -------------------------------------
508 -- Start of comments
509 --    API name   : Add_ItemAuthor
510 --    Type       : Public
511 --    Pre-reqs   : None
512 --    Function   : Add the authors passed in the table to the specified item.
513 --    Parameters :
514 --    IN           p_api_version                      NUMBER    Required
515 --                 p_init_msg_list                    VARCHAR2  Optional
516 --                        Default = FND_API.G_FALSE
517 --                 p_commit                           VARCHAR2  Optional
518 --                        Default = FND_API.G_FALSE
519 --                 p_item_id                          NUMBER    Required
520 --                    The item id to be add the authors.
521 --                 p_author_tab                      CHAR_TAB_TYPE
522 --                    The authors table                        Required
523 --    OUT        : x_return_status                    VARCHAR2
524 --                 x_msg_count                        NUMBER
525 --                 x_msg_data                         VARCHAR2
526 --    Notes      :
527 --
528 -- End of comments
529 --
530 PROCEDURE Add_ItemAuthor
531 (
532     p_api_version       IN  NUMBER,
533     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
534     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
535     x_return_status     OUT NOCOPY VARCHAR2,
536     x_msg_count         OUT NOCOPY NUMBER,
537     x_msg_data          OUT NOCOPY VARCHAR2,
538     p_item_id           IN  NUMBER,
539     p_author_tab        IN  CHAR_TAB_TYPE
540 );
541 -- Algorithm:
542 --   BEGIN
543 --     Verify API version compatibility
544 --     Set rollback SAVEPOINT
545 --       Loop for each author in the passed table
546 --           check if the author is already in the item.
547 --           If so, don't add it.
548 --           add the author to the item.
549 --     Commit transaction if requested
550 --
551 --------------------------------------------------------------------------------
552 -- Start of comments
553 --    API name   : Add_ItemAuthor
554 --    Type       : Public
555 --    Pre-reqs   : None
556 --    Function   : Add the author to the specified item.
557 --    Parameters :
558 --    IN           p_api_version                      NUMBER    Required
559 --                 p_init_msg_list                    VARCHAR2  Optional
560 --                        Default = FND_API.G_FALSE
561 --                 p_commit                           VARCHAR2  Optional
562 --                        Default = FND_API.G_FALSE
563 --                 p_item_id                          NUMBER    Required
564 --                    The item id to be add the author.
565 --                 p_author                           VARCHAR2  Required
566 --                    The author to be added to the item.
567 --    OUT        : x_return_status                    VARCHAR2
568 --                 x_msg_count                        NUMBER
569 --                 x_msg_data                         VARCHAR2
570 --    Notes      :
571 --
572 -- End of comments
573 --
574 PROCEDURE Add_ItemAuthor
575 (
576     p_api_version       IN  NUMBER,
577     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
578     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
579     x_return_status     OUT NOCOPY VARCHAR2,
580     x_msg_count         OUT NOCOPY NUMBER,
581     x_msg_data          OUT NOCOPY VARCHAR2,
582     p_item_id           IN  NUMBER,
583     p_author            IN  VARCHAR2
584 );
585 -- Algorithm:
586 --   BEGIN
587 --     Verify API version compatibility
588 --     Set rollback SAVEPOINT
589 --     check if the author is in the item.
590 --     If so, don't add it.
591 --     otherwise, add the author to the item.
592 --     Commit transaction if requested
593 --
594 --------------------------------------------------------------------------------
595 -- Start of comments
596 --    API name   : Delete_ItemAuthor
597 --    Type       : Public
598 --    Pre-reqs   : None
599 --    Function   : Remove the authors passed in the table
600 --                 from the specified item.
601 --    Parameters :
602 --    IN           p_api_version                      NUMBER    Required
603 --                 p_init_msg_list                    VARCHAR2  Optional
604 --                        Default = FND_API.G_FALSE
605 --                 p_commit                           VARCHAR2  Optional
606 --                        Default = FND_API.G_FALSE
607 --                 p_item_id                          NUMBER    Required
608 --                    The item id to be add the authors.
609 --                 p_author_tab                       CHAR_TAB_TYPE
610 --                    The authors table                        Required
611 --    OUT        : x_return_status                    VARCHAR2
612 --                 x_msg_count                        NUMBER
613 --                 x_msg_data                         VARCHAR2
614 --    Notes      :
615 --
616 -- End of comments
617 --
621     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
618 PROCEDURE Delete_ItemAuthor
619 (
620     p_api_version       IN  NUMBER,
622     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
623     x_return_status     OUT NOCOPY VARCHAR2,
624     x_msg_count         OUT NOCOPY NUMBER,
625     x_msg_data          OUT NOCOPY VARCHAR2,
626     p_item_id           IN  NUMBER,
627     p_author_tab        IN  CHAR_TAB_TYPE
628 );
629 -- Algorithm:
630 --   BEGIN
631 --     Verify API version compatibility
632 --     Set rollback SAVEPOINT
633 --       Loop for each author in the passed array
634 --           remove the author from the item.
635 --     Commit transaction if requested
636 --
637 --------------------------------------------------------------------------------
638 -- Start of comments
639 --    API name   : Delete_ItemAuthor
640 --    Type       : Public
641 --    Pre-reqs   : None
642 --    Function   : Remove the passed author from the specified item.
643 --    Parameters :
644 --    IN           p_api_version                      NUMBER    Required
645 --                 p_init_msg_list                    VARCHAR2  Optional
646 --                        Default = FND_API.G_FALSE
647 --                 p_commit                           VARCHAR2  Optional
648 --                        Default = FND_API.G_FALSE
649 --                 p_item_id                          NUMBER    Required
650 --                    The id of the item to remove the author from.
651 --                 p_author                           VARCHAR2  Required
652 --                    The author to be removed.
653 --    OUT        : x_return_status                    VARCHAR2
654 --                 x_msg_count                        NUMBER
655 --                 x_msg_data                         VARCHAR2
656 --    Notes      :
657 --
658 -- End of comments
659 --
660 PROCEDURE Delete_ItemAuthor
661 (
662     p_api_version       IN  NUMBER,
663     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
664     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
665     x_return_status     OUT NOCOPY VARCHAR2,
666     x_msg_count         OUT NOCOPY NUMBER,
667     x_msg_data          OUT NOCOPY VARCHAR2,
668     p_item_id           IN  NUMBER,
669     p_author            IN  VARCHAR2
670 );
671 -- Algorithm:
672 --   BEGIN
673 --     Verify API version compatibility
674 --     check if this item id is valid
675 --     IF not THEN
676 --         return error 'invalid item id';
677 --     END IF
678 --     Set rollback SAVEPOINT
679 --     remove the author from the item.
680 --     Commit transaction if requested
681 --
682 --------------------------------------------------------------------------------
683 -- Start of comments
684 --    API name   : Replace_ItemAuthor
685 --    Type       : Public
686 --    Pre-reqs   : None
687 --    Function   : Set the authors of the specified item
688 --                 to the authors passed in the table
689 --                 Effectively, this delete all the orignal authors
690 --                 and add the passed authors to the item.
691 --    Parameters :
692 --    IN           p_api_version                      NUMBER    Required
693 --                 p_init_msg_list                    VARCHAR2  Optional
694 --                        Default = FND_API.G_FALSE
695 --                 p_commit                           VARCHAR2  Optional
696 --                        Default = FND_API.G_FALSE
697 --                 p_item_id                          NUMBER    Required
698 --                    The item id to be added the authors.
699 --                 p_author_tab                       CHAR_TAB_TYPE
700 --                    The authors table                        Required
701 --    OUT        : x_return_status                    VARCHAR2
702 --                 x_msg_count                        NUMBER
703 --                 x_msg_data                         VARCHAR2
704 --    Notes      :
705 --
706 -- End of comments
707 --
708 PROCEDURE Replace_ItemAuthor
709 (
710     p_api_version       IN  NUMBER,
711     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
712     p_commit            IN  VARCHAR2 := FND_API.G_FALSE,
713     x_return_status     OUT NOCOPY VARCHAR2,
714     x_msg_count         OUT NOCOPY NUMBER,
715     x_msg_data          OUT NOCOPY VARCHAR2,
716     p_item_id           IN  NUMBER,
717     p_author_tab        IN  CHAR_TAB_TYPE
718 );
719 -- Algorithm:
720 --   BEGIN
721 --     Call delete_ItemAuthor to delete all the original authors
722 --     Then call Add_ItemAuthor to add the authors to the item.
723 --   END
724 --
725 --------------------------------------------------------------------------------
726 -- Start of comments
727 --    API name   : Get_ItemAuthor
728 --    Type       : Public
729 --    Pre-reqs   : None
730 --    Function   : Query and return all the authors of the specified item
731 --    Parameters :
732 --    IN           p_api_version                      NUMBER    Required
733 --                 p_init_msg_list                    VARCHAR2  Optional
734 --                        Default = FND_API.G_FALSE
735 --                 p_item_id                          NUMBER    Required
736 --    OUT        : x_return_status                    VARCHAR2
737 --                 x_msg_count                        NUMBER
741 --    Notes      :
738 --                 x_msg_data                         VARCHAR2
739 --                 x_author_tab                       CHAR_TAB_TYPE
740 --                    The retrieved authors table
742 --
743 -- End of comments
744 --
745 PROCEDURE Get_ItemAuthor
746 (
747     p_api_version       IN  NUMBER,
748     p_init_msg_list     IN  VARCHAR2 := FND_API.G_FALSE,
749     x_return_status     OUT NOCOPY VARCHAR2,
750     x_msg_count         OUT NOCOPY NUMBER,
751     x_msg_data          OUT NOCOPY VARCHAR2,
752     p_item_id           IN  NUMBER,
753     x_author_tab        OUT NOCOPY CHAR_TAB_TYPE
754 );
755 --
756 -- Algorithm:
757 --   BEGIN
758 --     Verify API version compatibility
759 --     check if this item id is valid
760 --     IF not THEN
761 --         return error 'invalid item id';
762 --     END IF
763 --     Query all the authors belonged to the specified item
764 --     And return the results in the output table.
765 --
766 --------------------------------------------------------------------------------
767 --
768 END jtf_amv_item_pub;