DBA Data[Home] [Help]

PACKAGE: APPS.XLA_CMP_SOURCE_PKG

Source


1 PACKAGE xla_cmp_source_pkg AUTHID CURRENT_USER AS
2 /* $Header: xlacpscs.pkh 120.16.12010000.2 2010/01/31 14:51:47 vkasina ship $   */
3 /*===========================================================================+
4 |             Copyright (c) 2001-2002 Oracle Corporation                     |
5 |                       Redwood Shores, CA, USA                              |
6 |                         All rights reserved.                               |
7 +============================================================================+
8 | PACKAGE NAME                                                               |
9 |     xla_cmp_source_pkg                                                     |
10 |                                                                            |
11 | DESCRIPTION                                                                |
12 |     This is a XLA private package, which contains all the logic required   |
13 |     to cache the sources and entities/objects defined in the AMB           |
14 |                                                                            |
15 |                                                                            |
16 | HISTORY                                                                    |
17 |     25-JUN-2002 K.Boussema    Created                                      |
18 |     13-JAN-2003 K.Boussema    Added the structure t_array_VL240            |
19 |     14-JAN-2003 K.Boussema    Added 'dbdrv' command                        |
20 |     13-MAR-2003 K.Boussema    Made changes for the new bulk approach of the|
21 |                               accounting engine                            |
22 |     19-APR-2003 K.Boussema    Included Error messages                      |
23 |     17-JUL-2003 K.Boussema    Reviewd the code                             |
24 |     18-DEC-2003 K.Boussema    Changed to fix bug 3042840,3307761,3268940   |
25 |                               3310291 and 3320689                          |
26 |     12-MAR-2004 K.Boussema    Changed to incorporate the select of lookups |
27 |                               from the extract objects                     |
28 |     02-JUN-2004 A.Quaglia     Added get_obj_parm_for_tab                   |
29 |     07-Mar-2005 K.Boussema    Changed for ADR-enhancements.                |
30 |     11-Jul-2005 A.Wan         Changed for MPA.  4262811                    |
31 +===========================================================================*/
32 --
33 --+==========================================================================+
34 --|                                                                          |
35 --| Global constants: AMB object type                                        |
36 --|                                                                          |
37 --+==========================================================================+
38 
39 C_DESC                             CONSTANT    VARCHAR2(1)  :='D';  -- description
40 C_ADR                              CONSTANT    VARCHAR2(1)  :='A';  -- account derivation rule
41 C_ANC                              CONSTANT    VARCHAR2(1)  :='R';  -- analytical criteria
42 C_ALT                              CONSTANT    VARCHAR2(1)  :='L';  -- journal entry line
43 C_EVT                              CONSTANT    VARCHAR2(1)  :='E';  -- event type
44 C_CLASS                            CONSTANT    VARCHAR2(1)  :='C';  -- event class
45 
46 C_RECOG_JLT                        CONSTANT    VARCHAR2(1)  :='G';  -- 4262811 recongnition JLT
47 --
48 --+==========================================================================+
49 --|                                                                          |
50 --| Public structures/types                                                  |
51 --|                                                                          |
52 --+==========================================================================+
53 --
54 --
55 TYPE t_array_VL1          IS TABLE OF VARCHAR2(1)       INDEX BY BINARY_INTEGER;
56 TYPE t_array_VL30         IS TABLE OF VARCHAR2(30)      INDEX BY BINARY_INTEGER;
57 TYPE t_array_VL50         IS TABLE OF VARCHAR2(50)      INDEX BY BINARY_INTEGER;
58 TYPE t_array_VL80         IS TABLE OF VARCHAR2(160)      INDEX BY BINARY_INTEGER;
59 TYPE t_array_VL240        IS TABLE OF VARCHAR2(240)     INDEX BY BINARY_INTEGER;
60 TYPE t_array_VL2000       IS TABLE OF VARCHAR2(2000)    INDEX BY BINARY_INTEGER;
61 TYPE t_array_Num          IS TABLE OF NUMBER            INDEX BY BINARY_INTEGER;
62 TYPE t_array_Int          IS TABLE OF INTEGER           INDEX BY BINARY_INTEGER;
63 TYPE t_array_Date         IS TABLE OF DATE              INDEX BY BINARY_INTEGER;
64 
65 TYPE t_array_ByInt        IS TABLE OF BINARY_INTEGER    INDEX BY BINARY_INTEGER;
66 TYPE t_array_array_ByInt  IS TABLE OF t_array_ByInt     INDEX BY BINARY_INTEGER;
67 TYPE t_array_array_VL1    IS TABLE OF t_array_VL1       INDEX BY BINARY_INTEGER;
68 --
69 -- structure of source cache
70 --
71 TYPE t_rec_sources IS RECORD (
72  array_application_id              t_array_Num ,
73  array_source_code                 t_array_VL30,
74  array_source_type_code            t_array_VL1 ,
75  array_source_name                 t_array_VL80,
76  array_datatype_code               t_array_VL1 ,
77  array_plsql_function              t_array_VL80,
78  array_flex_value_set_id           t_array_Num ,
79  array_translated_flag             t_array_VL1 ,
80  array_lookup_type                 t_array_VL30,
81  array_view_application_id         t_array_Num ,
82  array_key_flexfield_flag          t_array_VL1 ,
83  array_flexfield_appl_id           t_array_Num ,
84  array_appl_short_name             t_array_VL80,
85  array_id_flex_code                t_array_VL30,
86  array_segment_code                t_array_VL30
87 );
88 --
89 -- structure of AMB object cache
90 --
91 TYPE t_rec_aad_objects IS RECORD (
92   array_object                     t_array_VL1,
93   array_object_code                t_array_VL30,
94   array_object_type_code           t_array_VL1,
95   array_object_appl_id             t_array_Num,
96   array_object_class               t_array_VL30,
97   array_object_event               t_array_VL30,
98   array_object_jld_code            t_array_VL30,
99   array_object_jld_type_code       t_array_VL1,
100   array_array_object               t_array_array_ByInt
101 );
102 
103 /*----------------------------------------------------------+
104 | Public function                                           |
105 |                                                           |
106 |   GenerateSource                                          |
107 |                                                           |
108 |  It drives the generation of the sources in the AAD       |
109 |  packages.                                                |
110 |                                                           |
111 +----------------------------------------------------------*/
112 
113 FUNCTION GenerateSource(
114        p_Index                        IN BINARY_INTEGER
115      , p_rec_sources                  IN OUT NOCOPY t_rec_sources
116      , p_variable                     IN VARCHAR2 DEFAULT NULL
117      , p_translated_flag              IN VARCHAR2 DEFAULT NULL
118 )
119 RETURN VARCHAR2
120 ;
121 
122 
123 /*----------------------------------------------------------+
124 | Public function                                           |
125 |                                                           |
126 |   GenerateParameters                                      |
127 |                                                           |
128 |  It generates the AAD procedures/functions parameters:    |
129 |  p_sourc_1 IN VARCHAR2, p_source_2 IN NUMBER, .....       |
130 |                                                           |
131 +----------------------------------------------------------*/
132 
133 FUNCTION GenerateParameters   (
134     p_array_source_index  IN t_array_ByInt
135   , p_rec_sources         IN t_rec_sources
136  )
137 RETURN VARCHAR2
138 ;
139 
140 -----------------------------------------------
141 --  Added for the Transaction Account Builder
142 -----------------------------------------------
143 FUNCTION get_obj_parm_for_tab   (
144    p_array_source_index           IN t_array_ByInt
145  , p_rec_sources                  IN t_rec_sources
146  )
147 RETURN VARCHAR2
148 ;
149 
150 --
151 /*----------------------------------------------------------------------------+
152 |                                                                             |
153 |                        AMB source Dico/cache                                |
154 |                                                                             |
155 +-----------------------------------------------------------------------------*/
156 
157 /*======================================================================+
158 |                                                                       |
159 | Public Function                                                       |
160 |                                                                       |
161 | CacheSource                                                           |
162 |                                                                       |
163 |    It caches the source in the global source cache p_rec_sources.     |
164 |    It returns the position/index of the source in the cache           |
165 |                                                                       |
166 +======================================================================*/
167 
168 FUNCTION CacheSource (
169     p_source_code                  IN VARCHAR2
170   , p_source_type_code             IN VARCHAR2
171   , p_source_application_id        IN NUMBER
172   , p_rec_sources                  IN OUT NOCOPY t_rec_sources
173   )
174 RETURN BINARY_INTEGER
175 ;
176 
177 
178 /*======================================================================+
179 |                                                                       |
180 | Public Function                                                       |
181 |                                                                       |
182 | StackSource                                                           |
183 |                                                                       |
184 |    It caches the source in the list of sources defined in the AMB     |
185 |    object. It stack up the source in the p_array_source_index.        |
186 |    It returns the position/index of the source in the cache           |
187 |                                                                       |
188 +======================================================================*/
189 
190 FUNCTION StackSource(
191     p_source_code                  IN VARCHAR2
192   , p_source_type_code             IN VARCHAR2
193   , p_source_application_id        IN NUMBER
194   , p_array_source_index           IN OUT NOCOPY t_array_ByInt
195   , p_rec_sources                  IN OUT NOCOPY t_rec_sources
196   )
197 RETURN BINARY_INTEGER
198 ;
199 
200 --
201 /*----------------------------------------------------------------------------+
202 |                                                                             |
203 |                    AMB Object/Entity Dico/cache                             |
204 |                                                                             |
205 +-----------------------------------------------------------------------------*/
206 --
207 
208 /*======================================================================+
209 |                                                                       |
210 | Public Function                                                       |
211 |                                                                       |
212 | CacheAADObject                                                        |
213 |                                                                       |
214 |  It caches the AMB object in the global source cache p_rec_aad_objects|
215 |  It returns the position/index of the AMB object in the cache         |
216 |                                                                       |
217 +======================================================================*/
218 FUNCTION CacheAADObject (
219     p_object                       IN VARCHAR2
220   , p_object_code                  IN VARCHAR2
221   , p_object_type_code             IN VARCHAR2
222   , p_application_id               IN NUMBER
223   , p_event_class_code             IN VARCHAR2        DEFAULT NULL
224   , p_event_type_code              IN VARCHAR2        DEFAULT NULL
225   , p_line_definition_code         IN VARCHAR2        DEFAULT NULL
226   , p_line_definition_owner_code   IN VARCHAR2        DEFAULT NULL
227   , p_array_source_index           IN t_array_ByInt
228   , p_rec_aad_objects              IN OUT NOCOPY t_rec_aad_objects
229 )
230 RETURN BINARY_INTEGER
231 ;
232 
233 /*======================================================================+
234 |                                                                       |
235 | Public Function                                                       |
236 |                                                                       |
237 | GetAADObjectPosition                                                  |
238 |                                                                       |
239 |  It returns the position/index of the AMB object in the cache         |
240 |                                                                       |
241 +======================================================================*/
242 
243 FUNCTION GetAADObjectPosition (
244     p_object                       IN VARCHAR2
245   , p_object_code                  IN VARCHAR2
246   , p_object_type_code             IN VARCHAR2
247   , p_application_id               IN NUMBER
248   , p_event_class_code             IN VARCHAR2        DEFAULT NULL
249   , p_event_type_code              IN VARCHAR2        DEFAULT NULL
250   , p_line_definition_code         IN VARCHAR2        DEFAULT NULL
251   , p_line_definition_owner_code   IN VARCHAR2        DEFAULT NULL
252   , p_rec_aad_objects              IN t_rec_aad_objects
253 )
254 RETURN BINARY_INTEGER
255 ;
256 
257 /*======================================================================+
258 |                                                                       |
259 | Public Function                                                       |
260 |                                                                       |
261 | GetAADObjectPosition                                                  |
262 |                                                                       |
263 |  It returns the list of sources defined in  the AMB object.           |
264 |  It retrieves the list from the objects cache p_rec_aad_objects       |
265 |                                                                       |
266 +======================================================================*/
267 
268 PROCEDURE GetSourcesInAADObject (
269   p_object                       IN VARCHAR2
270 , p_object_code                  IN VARCHAR2
271 , p_object_type_code             IN VARCHAR2
272 , p_application_id               IN NUMBER
273 , p_event_class_code             IN VARCHAR2        DEFAULT NULL
274 , p_event_type_code              IN VARCHAR2        DEFAULT NULL
275 , p_line_definition_code         IN VARCHAR2        DEFAULT NULL
276 , p_line_definition_owner_code   IN VARCHAR2        DEFAULT NULL
277 , p_array_source_Index           IN OUT NOCOPY t_array_ByInt
278 , p_rec_aad_objects              IN t_rec_aad_objects
279 )
280 ;
281 --
282 --+==========================================================================+
283 --|                                                                          |
284 --|                                                                          |
285 --|                                                                          |
286 --|    Generate GetMeaning API for the source associated to value set        |
287 --|                                                                          |
288 --|                                                                          |
289 --|                                                                          |
290 --|                                                                          |
291 --|                                                                          |
292 --|                                                                          |
293 --|                                                                          |
294 --|                                                                          |
295 --|                                                                          |
296 --|                                                                          |
297 --|                                                                          |
298 --+==========================================================================+
299 --
300 --
304 |                                                                       |
301 /*======================================================================+
302 |                                                                       |
303 | Public Function                                                       |
305 |   flex_values_exist                                                   |
306 |                                                                       |
307 | Returns true if source associated to flex value set exist             |
308 |                                                                       |
309 +======================================================================*/
310 FUNCTION  flex_values_exist
311   (p_array_flex_value_set_id      IN xla_cmp_source_pkg.t_array_Num)
312 RETURN BOOLEAN
313 ;
314 --+==========================================================================+
315 --|                                                                          |
316 --| Public Function                                                          |
320 FUNCTION GenerateGetMeaningAPI(
317 --|                                                                          |
318 --+==========================================================================+
319 --
321   p_package_name                 IN VARCHAR2
322 , p_array_flex_value_set_id      IN xla_cmp_source_pkg.t_array_Num
323 , p_package_body                 OUT NOCOPY DBMS_SQL.VARCHAR2S
324 )
325 RETURN BOOLEAN
326 ;
327 --
328 END xla_cmp_source_pkg; -- end of package spec