1 PACKAGE EGO_METADATA_BULKLOAD_PVT AUTHID CURRENT_USER AS
2 /* $Header: EGOVMDBS.pls 120.1.12010000.4 2010/06/11 13:51:40 kjonnala noship $ */
3
4 ------------------------------------------------------------------------------
5 -- Global variables and constants declarations
6 ------------------------------------------------------------------------------
7
8 -------------------------------------------------------------------------
9 -- Debug Profile option used to write Error_Handler.Write_Debug --
10 -- Profile option name = INV_DEBUG_TRACE ; --
11 -- User Profile Option Name = INV: Debug Trace --
12 -- Values: 1 (True) ; 0 (False) --
13 -- NOTE: This better than MRP_DEBUG which is used at many places. --
14 -------------------------------------------------------------------------
15 G_DEBUG VARCHAR2(10);
16
17
18
19 ------------------------------------------------------------------------------
20 -- WHO columns
21 ------------------------------------------------------------------------------
22
23 G_REQUEST_ID NUMBER;
24 G_PROGRAM_APPLICATION_ID NUMBER;
25 G_PROGRAM_ID NUMBER;
26 G_USER_NAME FND_USER.USER_NAME%TYPE;
27 G_USER_ID NUMBER;
28 G_LOGIN_ID NUMBER;
29
30 ------------------------------------------------------------------------------
31 -- CONSTANTS required by the Lock related procedures
32 ------------------------------------------------------------------------------
33
34 G_VALUE_SET CONSTANT VARCHAR2(30) := 'EGO_VALUE_SET';
35 G_ITEM_CATALOG_CATEGORY CONSTANT VARCHAR2(30) := 'EGO_ITEM_CATALOG_CATEGORY';
36
37
38 G_ENTITY_VS_VER CONSTANT VARCHAR2(30) := 'VS_VERSION';
39 G_ENTITY_VS_HEADER_TAB CONSTANT VARCHAR2(240) := 'EGO_FLEX_VALUE_SET_INTF';
40 G_ENTITY_ICC_VER CONSTANT VARCHAR2(30) := 'ICC_VERSIONS';
41 G_ENTITY_ICC_HEADER_TAB CONSTANT VARCHAR2(240) := 'EGO_ICC_VERS_INTERFACE';
42
43
44 ---------------------------------------------------------------------------
45 -- API return status
46 --
47 -- G_RET_STS_SUCCESS means that the API was successful in performing
48 -- all the operation requested by its caller.
49 --
50 -- G_RET_STS_ERROR means that the API failed to perform one or more
51 -- of the operations requested by its caller.
52 --
53 -- G_RET_STS_UNEXP_ERROR means that the API was not able to perform
54 -- any of the operations requested by its callers because of an
55 -- unexpected error.
56 -----------------------------------------------------------------------------
57
58 G_RET_STS_SUCCESS CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
59 G_RET_STS_ERROR CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_ERROR;
60 G_RET_STS_UNEXP_ERROR CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_UNEXP_ERROR;
61
62 -------------------------------------------------------------------------------
63 -- Concurrent Program Return Codes
64 -------------------------------------------------------------------------------
65 G_CONC_RETCODE_SUCCESS CONSTANT NUMBER := 0;
66 G_CONC_RETCODE_WARNING CONSTANT NUMBER := 1;
67 G_CONC_RETCODE_ERROR CONSTANT NUMBER := 2;
68
69
70 -------------------------------------------------------------------------------
71 -- Package Name, used while logging debug messages
72 -------------------------------------------------------------------------------
73 G_PKG_NAME CONSTANT VARCHAR2(30) := 'EGO_METADATA_BULKLOAD_PVT';
74
75
76 ------------------------------------------------------------------------------
77 -- Procedure Declarations
78 ------------------------------------------------------------------------------
79
80 /********************************************************************************
81 -- Procedure : write_debug
82 -- Purpose : Writes the debug messages into concurrent program log
83 -- IN Parameters :
84 -- p_msg - string to be written onto concurrent program log
85 -- OUT Parameters:
86 -- None
87 ********************************************************************************/
88
89 PROCEDURE Write_Debug (p_msg IN VARCHAR2);
90
91
92 /*************************************************************************************************
93 -- Procedure : import_metadata
94 -- Purpose : Main method called by the concurrent program EGOIMDCP executable
95 -- Co-ordinates the import of all metadata entities.
96 -- IN Parameters :
97 -- p_import_vs - indicates whether valuesets should be imported or not
98 -- p_import_ag - indicates whether attribute groups should be imported or not
99 -- p_import_icc - indicates whether Item Catalog Categories should be imported
100 -- or not
101 -- p_set_process_id - batch_id/set_processed_id for grouping the records to be
102 -- processed together in a batch.
103 -- p_del_proc_recs - indicates whether successfully imported records
104 -- (process_status=7) should be deleted or not
105 -- from the interface tables.
106 --
107 -- OUT Parameters:
108 -- errbuf - error msg to be returned back to concurrent program
109 -- incase of any failure.
110 -- retcode - return code to be passed to concurrent program
111 -- 0 - SUCCESS, 1- WARNING , 2- ERROR
112 **************************************************************************************************/
113
114 PROCEDURE import_metadata( errbuf OUT NOCOPY VARCHAR2,
115 retcode OUT NOCOPY NUMBER,
116 p_import_vs IN VARCHAR2,
117 p_import_ag IN VARCHAR2,
118 p_import_icc IN VARCHAR2,
119 p_set_process_id IN NUMBER,
120 p_del_proc_recs IN VARCHAR2
121 );
122
123
124 /*************************************************************************************************
125 -- Procedure : Get_Lock_Info
126 -- Purpose : Procedure which gets the lock attibutes for an entity
127 -- IN Parameters :
128 -- p_object_name - Object name to lock , EGO_ITEM_CATALOG_CATEGORY , EGO_VALUE_SET
129 -- p_pk1_value..p_pk5_value - Primary key attributes used for identifying the object
130 -- in the ego_object_lcks table
131 --
132 --
133 -- OUT Parameters:
134 -- x_locking_party_id - if locked, party id who has locked the object
135 -- x_lock_flag - lock flag value L (locked), U ( unlocked)
136 -- x_return_msg - Return error message if any
137 -- x_return_status - Returns S (Success), E ( Error) , U ( unexpected error)
138 **************************************************************************************************/
139
140
141 PROCEDURE Get_Lock_Info ( p_object_name IN VARCHAR2
142 ,p_pk1_value IN VARCHAR2 DEFAULT NULL
143 ,p_pk2_value IN VARCHAR2 DEFAULT NULL
144 ,p_pk3_value IN VARCHAR2 DEFAULT NULL
145 ,p_pk4_value IN VARCHAR2 DEFAULT NULL
146 ,p_pk5_value IN VARCHAR2 DEFAULT NULL
147 ,x_locking_party_id OUT NOCOPY NUMBER
148 ,x_lock_flag OUT NOCOPY VARCHAR2
149 ,x_return_msg OUT NOCOPY VARCHAR2
150 ,x_return_status OUT NOCOPY VARCHAR2
151 );
152
153
154 /*************************************************************************************************
155 -- Procedure : Lock_Unlock_Object
156 -- Purpose : Procedure which gets the lock attibutes for an entity
157 -- IN Parameters :
158 -- p_object_name - Object name to lock , EGO_ITEM_CATALOG_CATEGORY , EGO_VALUE_SET
159 -- p_pk1_value..p_pk5_value - Primary key attributes used for identifying the object
160 -- in the ego_object_lcks table
161 -- p_party_id - Party id who wants to lock the object,
162 -- p_lock_flag - Boolean to indictae - true ( lock object), false ( unlock object)
163 --
164 --
165 -- OUT Parameters:
166 -- x_return_msg - Return error message if any
167 -- x_return_status - Returns S (Success), E ( Error) , U ( unexpected error)
168 **************************************************************************************************/
169
170
171 PROCEDURE Lock_Unlock_Object ( p_object_name IN VARCHAR2
172 ,p_pk1_value IN VARCHAR2 DEFAULT NULL
173 ,p_pk2_value IN VARCHAR2 DEFAULT NULL
174 ,p_pk3_value IN VARCHAR2 DEFAULT NULL
175 ,p_pk4_value IN VARCHAR2 DEFAULT NULL
176 ,p_pk5_value IN VARCHAR2 DEFAULT NULL
177 ,p_party_id IN NUMBER DEFAULT NULL
178 ,p_lock_flag IN BOOLEAN
179 ,x_return_msg OUT NOCOPY VARCHAR2
180 ,x_return_status OUT NOCOPY VARCHAR2
181 );
182
183
184 /*************************************************************************************************
185 -- Procedure : Get_Party_Name
186 -- Purpose : Procedure which gets the party name given the party_id
187 -- IN Parameters :
188 -- p_party_id - id of the party
189
190 -- OUT Parameters:
191 -- p_party_name - name of the party
192 **************************************************************************************************/
193
194 PROCEDURE Get_Party_Name ( p_party_id IN NUMBER,
195 x_party_name OUT NOCOPY VARCHAR2 );
196
197
198
199 END EGO_METADATA_BULKLOAD_PVT;