DBA Data[Home] [Help]

PACKAGE BODY: APPS.FND_MO_PRODUCT_INIT_PKG

Source


1 package body fnd_mo_product_init_pkg as
2 /* $Header: AFMOPINB.pls 115.6 2003/09/26 15:11:21 kmaheswa noship $ */
3 
4 --
5 -- REGISTER_APPLICATION (PUBLIC)
6 --   Called by product teams to register their application as
7 --   access enabled
8 -- Input
9 --   p_appl_short_name: application short name
10 --   p_owner: for seed or custom data
11 procedure register_application(p_appl_short_name    in varchar2,
12                                p_owner              in varchar2 ) is
13 begin
14   register_application(p_appl_short_name,
15                        p_owner,
16                        'N',
17                        NULL,
18                        NULL);
19 end register_application;
20 
21 --
22 -- REMOVE_APPLICATION (PUBLIC)
23 --   Called by product teams to delete their application registered
24 --   as access enabled
25 -- Input
26 --   p_appl_short_name: application short name
27 procedure remove_application(p_appl_short_name in varchar2) is
28 begin
29   begin
30     delete from FND_MO_PRODUCT_INIT
31     where APPLICATION_SHORT_NAME = upper(p_appl_short_name);
32 
33   exception
34     when others then
35       fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
36       fnd_message.set_token('ROUTINE', 'REMOVE_APPLICATION');
37       fnd_message.set_token('ERRNO', to_char(sqlcode));
38       fnd_message.set_token('REASON', sqlerrm);
39       app_exception.raise_exception;
40   end;
41 
42 end remove_application;
43 
44 --
45 -- REGISTER_APPLICATION (PUBLIC)
46 --   Called by product teams to register their application as
47 --   access enabled
48 -- Input
49 --   p_appl_short_name: application short name
50 --   p_owner: for seed or custom data
51 --   p_enabled_flag: flag to indicate if access control is enabled
52 procedure register_application(p_appl_short_name    in varchar2,
53                                p_owner              in varchar2,
54                                p_status             in varchar2 ) is
55 begin
56   register_application(p_appl_short_name,
57                        p_owner,
58                        p_status,
59                        NULL,
60                        NULL);
61 end register_application;
62 
63 --
64 -- REGISTER_APPLICATION (PUBLIC)
65 --   Called by product teams to register their application as
66 --   access enabled
67 -- Input
68 --   p_appl_short_name: application short name
69 --   p_owner: for seed or custom data
70 --   p_enabled_flag: flag to indicate if access control is enabled
71 --   p_last_update_date:  last updated date for the row
72 procedure register_application(p_appl_short_name    in varchar2,
73                                p_owner              in varchar2,
74                                p_status             in varchar2,
75                                p_last_update_date   in varchar2,
76 			       p_custom_mode        in varchar2) is
77   f_luby    number;  -- entity owner in file
78   f_ludate  date;    -- entity update date in file
79   db_luby   number;  -- entity owner in db
80   db_ludate date;    -- entity update date in db
81 begin
82   f_luby := fnd_load_util.owner_id(p_owner);
83   f_ludate := nvl(to_date(p_last_update_date, 'YYYY/MM/DD'),
84 			sysdate);
85   begin
86          select LAST_UPDATED_BY, LAST_UPDATE_DATE
87            into db_luby, db_ludate
88            from FND_MO_PRODUCT_INIT
89           where application_short_name = upper(p_appl_short_name);
90     -- Test for customization and version
91     if (fnd_load_util.upload_test(f_luby, f_ludate, db_luby,
92                                         db_ludate, p_custom_mode)) then
93       update FND_MO_PRODUCT_INIT
94       set LAST_UPDATED_BY = f_luby,
95           LAST_UPDATE_DATE = f_ludate,
96           LAST_UPDATE_LOGIN = 0,
97           STATUS = nvl(p_status,'N')
98       where APPLICATION_SHORT_NAME = upper(p_appl_short_name);
99     end if;
100 
101 
102   exception
103     when no_data_found then
104       insert into FND_MO_PRODUCT_INIT(
105             APPLICATION_SHORT_NAME,
106             LAST_UPDATE_DATE,
107             LAST_UPDATED_BY,
108             CREATION_DATE,
109             CREATED_BY,
110             LAST_UPDATE_LOGIN,
111             STATUS)
112       values(
113             upper(p_appl_short_name),
114             f_ludate,
115             f_luby,
116             f_ludate,
117             f_luby,
118             0,
119             nvl(upper(p_status),'N'));
120 
121     when others then
122       fnd_message.set_name('FND', 'SQL_PLSQL_ERROR');
123       fnd_message.set_token('ROUTINE', 'REGISTER_APPLICATION');
124       fnd_message.set_token('ERRNO', to_char(sqlcode));
125       fnd_message.set_token('REASON', sqlerrm);
126       app_exception.raise_exception;
127     end;
128 
129 end register_application;
130 
131 end fnd_mo_product_init_pkg;