DBA Data[Home] [Help]

PACKAGE BODY: APPS.CSK_SETUP_UTILITY_PKG_W

Source


1 package body csk_setup_utility_pkg_w as
2   /* $Header: csktsuwb.pls 120.0 2005/06/01 11:49:35 appldev noship $ */
3   procedure rosetta_table_copy_in_p12(t out nocopy csk_setup_utility_pkg.stmt_tbl_type, a0 JTF_NUMBER_TABLE
4     , a1 JTF_VARCHAR2_TABLE_100
5     , a2 JTF_NUMBER_TABLE
6     , a3 JTF_NUMBER_TABLE
7     , a4 JTF_VARCHAR2_TABLE_2000
8     , a5 JTF_VARCHAR2_TABLE_100
9     ) as
10     ddindx binary_integer; indx binary_integer;
11   begin
12   if a0 is not null and a0.count=0 then
13     t := csk_setup_utility_pkg.stmt_tbl_type();
14   elsif a0 is not null and a0.count > 0 then
15       if a0.count > 0 then
16       t := csk_setup_utility_pkg.stmt_tbl_type();
17       t.extend(a0.count);
18         indx := a0.first;
19         ddindx := 1;
20         while true loop
21           t(ddindx).element_id := a0(indx);
22           t(ddindx).element_number := a1(indx);
23           t(ddindx).element_type_id := a2(indx);
24           t(ddindx).access_level := a3(indx);
25           t(ddindx).name := a4(indx);
26           t(ddindx).content_type := a5(indx);
27           ddindx := ddindx+1;
28           if a0.last =indx
29             then exit;
30           end if;
31           indx := a0.next(indx);
32         end loop;
33       end if;
34    end if;
35   end rosetta_table_copy_in_p12;
36   procedure rosetta_table_copy_out_p12(t csk_setup_utility_pkg.stmt_tbl_type, a0 out nocopy JTF_NUMBER_TABLE
37     , a1 out nocopy JTF_VARCHAR2_TABLE_100
38     , a2 out nocopy JTF_NUMBER_TABLE
39     , a3 out nocopy JTF_NUMBER_TABLE
40     , a4 out nocopy JTF_VARCHAR2_TABLE_2000
41     , a5 out nocopy JTF_VARCHAR2_TABLE_100
42     ) as
43     ddindx binary_integer; indx binary_integer;
44   begin
45   if t is null then
46     a0 := null;
47     a1 := null;
48     a2 := null;
49     a3 := null;
50     a4 := null;
51     a5 := null;
52   elsif t.count = 0 then
53     a0 := JTF_NUMBER_TABLE();
54     a1 := JTF_VARCHAR2_TABLE_100();
55     a2 := JTF_NUMBER_TABLE();
56     a3 := JTF_NUMBER_TABLE();
57     a4 := JTF_VARCHAR2_TABLE_2000();
58     a5 := JTF_VARCHAR2_TABLE_100();
59   else
60       a0 := JTF_NUMBER_TABLE();
61       a1 := JTF_VARCHAR2_TABLE_100();
62       a2 := JTF_NUMBER_TABLE();
63       a3 := JTF_NUMBER_TABLE();
64       a4 := JTF_VARCHAR2_TABLE_2000();
65       a5 := JTF_VARCHAR2_TABLE_100();
66       if t.count > 0 then
67         a0.extend(t.count);
68         a1.extend(t.count);
69         a2.extend(t.count);
70         a3.extend(t.count);
71         a4.extend(t.count);
72         a5.extend(t.count);
73         ddindx := t.first;
74         indx := 1;
75         while true loop
76           a0(indx) := t(ddindx).element_id;
77           a1(indx) := t(ddindx).element_number;
78           a2(indx) := t(ddindx).element_type_id;
79           a3(indx) := t(ddindx).access_level;
80           a4(indx) := t(ddindx).name;
81           a5(indx) := t(ddindx).content_type;
82           indx := indx+1;
83           if t.last =ddindx
84             then exit;
85           end if;
86           ddindx := t.next(ddindx);
87         end loop;
88       end if;
89    end if;
90   end rosetta_table_copy_out_p12;
91 
92   procedure rosetta_table_copy_in_p13(t out nocopy csk_setup_utility_pkg.cat_tbl_type, a0 JTF_NUMBER_TABLE) as
93     ddindx binary_integer; indx binary_integer;
94   begin
95   if a0 is null then
96     t := null;
97   elsif a0.count = 0 then
98     t := csk_setup_utility_pkg.cat_tbl_type();
99   else
100       if a0.count > 0 then
101       t := csk_setup_utility_pkg.cat_tbl_type();
102       t.extend(a0.count);
103         indx := a0.first;
104         ddindx := 1;
105         while true loop
106           t(ddindx) := a0(indx);
107           ddindx := ddindx+1;
108           if a0.last =indx
109             then exit;
110           end if;
111           indx := a0.next(indx);
112         end loop;
113       end if;
114    end if;
115   end rosetta_table_copy_in_p13;
116   procedure rosetta_table_copy_out_p13(t csk_setup_utility_pkg.cat_tbl_type, a0 out nocopy JTF_NUMBER_TABLE) as
117     ddindx binary_integer; indx binary_integer;
118   begin
119   if t is null then
120     a0 := null;
121   elsif t.count = 0 then
122     a0 := JTF_NUMBER_TABLE();
123   else
124       a0 := JTF_NUMBER_TABLE();
125       if t.count > 0 then
126         a0.extend(t.count);
127         ddindx := t.first;
128         indx := 1;
129         while true loop
130           a0(indx) := t(ddindx);
131           indx := indx+1;
132           if t.last =ddindx
133             then exit;
134           end if;
135           ddindx := t.next(ddindx);
136         end loop;
137       end if;
138    end if;
139   end rosetta_table_copy_out_p13;
140 
141   procedure create_solution(p_api_version  NUMBER
142     , p_init_msg_list  VARCHAR2
143     , p_commit  VARCHAR2
144     , p_validation_level  NUMBER
145     , x_return_status out nocopy  VARCHAR2
146     , x_msg_count out nocopy  NUMBER
147     , x_msg_data out nocopy  VARCHAR2
148     , p7_a0  NUMBER
149     , p7_a1  VARCHAR2
150     , p7_a2  NUMBER
151     , p7_a3  VARCHAR2
152     , p7_a4  VARCHAR2
153     , p8_a0 JTF_NUMBER_TABLE
154     , p8_a1 JTF_VARCHAR2_TABLE_100
155     , p8_a2 JTF_NUMBER_TABLE
156     , p8_a3 JTF_NUMBER_TABLE
157     , p8_a4 JTF_VARCHAR2_TABLE_2000
158     , p8_a5 JTF_VARCHAR2_TABLE_100
159     , p_cat_tbl JTF_NUMBER_TABLE
160     , p_publish  number
161   )
162 
163   as
164     ddp_soln_rec csk_setup_utility_pkg.soln_rec_type;
165     ddp_stmt_tbl csk_setup_utility_pkg.stmt_tbl_type;
166     ddp_cat_tbl csk_setup_utility_pkg.cat_tbl_type;
167     ddp_publish boolean;
168     ddindx binary_integer; indx binary_integer;
169   begin
170 
171     -- copy data to the local IN or IN-OUT args, if any
172 
173 
174 
175 
176 
177 
178 
179     ddp_soln_rec.set_id := p7_a0;
180     ddp_soln_rec.set_number := p7_a1;
181     ddp_soln_rec.set_type_id := p7_a2;
182     ddp_soln_rec.name := p7_a3;
183     ddp_soln_rec.visibility_id := p7_a4;
184 
185     csk_setup_utility_pkg_w.rosetta_table_copy_in_p12(ddp_stmt_tbl, p8_a0
186       , p8_a1
187       , p8_a2
188       , p8_a3
189       , p8_a4
190       , p8_a5
191       );
192 
193     csk_setup_utility_pkg_w.rosetta_table_copy_in_p13(ddp_cat_tbl, p_cat_tbl);
194 
195     if p_publish is null
196       then ddp_publish := null;
197     elsif p_publish = 0
198       then ddp_publish := false;
199     else ddp_publish := true;
200     end if;
201 
202     -- here's the delegated call to the old PL/SQL routine
203     csk_setup_utility_pkg.create_solution(p_api_version,
204       p_init_msg_list,
205       p_commit,
206       p_validation_level,
207       x_return_status,
208       x_msg_count,
209       x_msg_data,
210       ddp_soln_rec,
211       ddp_stmt_tbl,
212       ddp_cat_tbl,
213       ddp_publish);
214 
215     -- copy data back from the local variables to OUT or IN-OUT args, if any
216 
217 
218 
219 
220 
221 
222 
223 
224 
225 
226   end;
227 
228 end csk_setup_utility_pkg_w;