DBA Data[Home] [Help]

PACKAGE BODY: APPS.QA_CHART_PARETO_PKG

Source


1 PACKAGE BODY qa_chart_pareto_pkg AS
2 /* $Header: qacprtob.pls 120.1 2006/03/20 12:06:58 bso noship $ */
3 
4     --
5     -- Tracking Bug 4939897
6     -- R12 Forms Tech Stack Upgrade - Obsolete Oracle Graphics
7     --
8 
9 
10     FUNCTION get_x_axis_label(
11         p_element_id NUMBER,
12         p_count NUMBER) RETURN VARCHAR2 IS
13     BEGIN
14         --
15         -- x-axis label is constructed from the message
16         -- QA_CHART_PARETO_X_LABEL
17         --
18         fnd_message.set_name('QA', 'QA_CHART_PARETO_X_LABEL');
19         fnd_message.set_token('ELEMENT_NAME',
20             qa_chars_api.get_element_name(p_element_id));
21         fnd_message.set_token('COUNT', p_count);
22 
23         RETURN fnd_message.get;
24     END get_x_axis_label;
25 
26 
27     --
28     -- Bug 5044017.  Added p_top_n_groups bso Mon Mar 20 11:33:24 PST 2006
29     --
30     PROCEDURE create_chart(
31         p_criteria_id                   NUMBER,
32         p_x_element_id                  NUMBER,
33         p_y_element_id                  NUMBER,
34         p_function_code                 NUMBER,
35         p_title                         VARCHAR2,
36         p_description                   VARCHAR2,
37         p_sql                           VARCHAR2,
38         p_top_n_groups                  NUMBER DEFAULT NULL,
39         x_chart_id           OUT NOCOPY NUMBER,
40         x_row_count          OUT NOCOPY NUMBER) IS
41 
42     BEGIN
43         --
44         -- Simple wrapper to qa_chart_generic_pkg since a Pareto
45         -- Chart uses the generic charting architecture.
46         --
47 
48         qa_chart_headers_pkg.create_chart(
49             p_criteria_id => p_criteria_id,
50             p_title => p_title,
51             p_description => p_description,
52             p_x_label => 'DUMMY',
53             p_y_label =>
54                 qa_chart_headers_pkg.get_function_axis_label(
55                     p_element_id => p_y_element_id,
56                     p_function_code => p_function_code),
57             x_chart_id => x_chart_id);
58 
59         --
60         -- Bug 5044017.  Need to limit the SQL to select top_n_groups
61         --
62         qa_chart_generic_pkg.populate_data(
63             p_chart_id => x_chart_id,
64             p_sql => p_sql,
65             p_row_limit => p_top_n_groups,
66             x_row_count => x_row_count);
67 
68         --
69         -- x-axis label is a bit tricky, it needs to know the
70         -- row_count, therefore we created the header with a
71         -- 'DUMMY' x-axis label and now update it.
72         --
73         qa_chart_headers_pkg.set_x_label(
74             p_chart_id => x_chart_id,
75             p_label => get_x_axis_label(p_x_element_id, x_row_count));
76 
77     END create_chart;
78 
79 
80     --
81     -- Bug 5044017.  Added p_top_n_groups bso Mon Mar 20 11:33:24 PST 2006
82     --
83     PROCEDURE create_chart_autonomous(
84         p_criteria_id                   NUMBER,
85         p_x_element_id                  NUMBER,
86         p_y_element_id                  NUMBER,
87         p_function_code                 NUMBER,
88         p_title                         VARCHAR2,
89         p_description                   VARCHAR2,
90         p_sql                           VARCHAR2,
91         p_top_n_groups                  NUMBER DEFAULT NULL,
92         x_chart_id           OUT NOCOPY NUMBER,
93         x_row_count          OUT NOCOPY NUMBER) IS
94 
95     --
96     -- This is a wrapper to create_chart and performs
97     -- autonomous commit.
98     --
99     PRAGMA autonomous_transaction;
100 
101     BEGIN
102         create_chart(
103             p_criteria_id,
104             p_x_element_id,
105             p_y_element_id,
106             p_function_code,
107             p_title,
108             p_description,
109             p_sql,
110             p_top_n_groups,
111             x_chart_id,
112             x_row_count);
113         COMMIT;
114     END create_chart_autonomous;
115 
116 
117     PROCEDURE delete_data(p_chart_id NUMBER) IS
118     --
119     -- This is a simple wrapper to qa_chart_generic_pkg
120     -- since Pareto Chart uses generic charting architecture.
121     --
122     BEGIN
123         qa_chart_generic_pkg.delete_data(p_chart_id);
124     END delete_data;
125 
126 
127     PROCEDURE delete_data_autonomous(p_chart_id NUMBER) IS
128     --
129     -- This is a wrapper to delete_data and performs
130     -- autonomous commit.
131     --
132     PRAGMA autonomous_transaction;
133     BEGIN
134         delete_data(p_chart_id);
135         COMMIT;
136     END delete_data_autonomous;
137 
138 
139 END qa_chart_pareto_pkg;