1 PACKAGE BODY OE_INSTALL AS
2 /* $Header: OEXINSTB.pls 115.4 99/10/14 13:53:59 porting ship $ */
3
4 --
5 --
6 -- Public Functions
7 --
8
9 FUNCTION Get_Active_Product
10
11 RETURN VARCHAR2 IS
12
13
14 BEGIN
15
16
17 -- This procedure will always return ONT as the active product
18 -- irrespective of whether it is installed or not.
19 -- In Release 11.i, only the new Order management system is
20 -- installed.
21
22
23 if G_ACTIVE_PRODUCT = FND_API.G_MISS_CHAR THEN
24
25 G_ACTIVE_PRODUCT := 'ONT';
26 end if;
27
28 return(G_ACTIVE_PRODUCT);
29 EXCEPTION
30 -- This should only execute if an invalid dep_appl_id was passed
31 When Others then
32 G_ACTIVE_PRODUCT := 'N';
33 return(G_ACTIVE_PRODUCT);
34
35 END ;
36
37 FUNCTION Get_Status
38 RETURN VARCHAR2
39 IS
40 l_application_short_name VARCHAR2(30);
41 l_ret_val BOOLEAN;
42 l_status VARCHAR2(1);
43 l_industry VARCHAR2(1);
44 l_ont_application_id NUMBER := 660;
45
46 BEGIN
47 /* Check if the global variable is set */
48 if G_PRODUCT_STATUS = FND_API.G_MISS_CHAR THEN
49
50 -- Return the product status of Order Management
51 -- Make a call to fnd_installation.get function to check for the
52 -- installation status of Order Management and return the status.
53
54 l_ret_val := fnd_installation.get(l_ont_application_id,l_ont_application_id,l_status,l_industry);
55 if (l_status = 'I') then
56 G_PRODUCT_STATUS := 'I';
57 return(G_PRODUCT_STATUS);
58
59 elsif (l_status = 'S') then
60 G_PRODUCT_STATUS := 'S';
61 return(G_PRODUCT_STATUS);
62 elsif (l_status = 'N') then
63 G_PRODUCT_STATUS := 'N';
64 return(G_PRODUCT_STATUS);
65 end if;
66 else
67 return(G_PRODUCT_STATUS);
68 end if;
69
70 End Get_Status;
71
72 -- The purpose of this procedure is to create odd synonyms
73 -- on the interoperable objects based on the Order Entry
74 -- product which is ACTIVE. The procedure first checks
75 -- for which Order Entry is installed and then does the
76 -- the validation for whether the synonym already exists
77 -- on the required object. If a match does not exist,
78 -- then we recreate the synonym on the required object.
79
80 PROCEDURE Create_Interop_Synonym
81 ( p_schema_name in varchar2
82 , p_synonym_name in varchar2
83 , p_object_name in varchar2
84 )
85 IS
86
87 p_exact_match BOOLEAN;
88 p_found_object_with_same_name BOOLEAN;
89 p_type_for_object_found VARCHAR2(30);
90 statement VARCHAR2(150);
91
92 BEGIN
93
94 -- Check if the synonym already exists
95 system.ad_apps_private.exact_synonym_match(p_schema_name,p_synonym_name,
96 p_schema_name,p_object_name,p_exact_match,p_found_object_with_same_name,
97 p_type_for_object_found);
98 if NOT p_exact_match THEN
99 system.ad_apps_private.drop_object(p_schema_name,
100 p_synonym_name,'SYNONYM');
101
102 -- Recreate the synonym
103
104 statement := 'create synonym '|| p_synonym_name ||' for '
105 || p_object_name;
106 --dbms_output.put_line('Statement :'|| statement);
107
108 system.ad_apps_private.do_apps_ddl(p_schema_name,statement);
109 else
110 -- Synonym already exists. Do nothing.
111 -- dbms_output.put_line('Synonym already exists');
112 null;
113 end if;
114
115 EXCEPTION
116 When OTHERS then
117 OE_MSG.Internal_Exception('OE_INSTALL.Create_Interop_Synonym',
118 'Create_Interop_Synonym',NULL);
119
120 END Create_Interop_Synonym;
121
122 END OE_INSTALL;