[Home] [Help]
PACKAGE BODY: APPS.QA_CHART_TREND_PKG
Source
1 PACKAGE BODY qa_chart_trend_pkg AS
2 /* $Header: qactrndb.pls 120.0 2006/02/07 16:03:37 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(p_code NUMBER) RETURN VARCHAR2 IS
11 BEGIN
12 --
13 -- x-axis label for Trend chart is the meaning of the
14 -- mfg_lookups QA_TIME_SERIES_AXIS. So the p_code
15 -- is actually the lookup_code.
16 --
17 RETURN qa_eres_util.get_mfg_lookups_meaning(
18 p_lookup_type => 'QA_TIME_SERIES_AXIS',
19 p_lookup_code => p_code);
20 END get_x_axis_label;
21
22
23 PROCEDURE create_chart(
24 p_criteria_id NUMBER,
25 p_x_element_id NUMBER,
26 p_y_element_id NUMBER,
27 p_function_code NUMBER,
28 p_title VARCHAR2,
29 p_description VARCHAR2,
30 p_sql VARCHAR2,
31 x_chart_id OUT NOCOPY NUMBER,
32 x_row_count OUT NOCOPY NUMBER) IS
33
34 BEGIN
35 --
36 -- Simple wrapper to qa_chart_generic_pkg since a Trend
37 -- Chart uses the generic charting architecture.
38 --
39
40 qa_chart_headers_pkg.create_chart(
41 p_criteria_id => p_criteria_id,
42 p_title => p_title,
43 p_description => p_description,
44 p_x_label => get_x_axis_label(p_x_element_id),
45 p_y_label =>
46 qa_chart_headers_pkg.get_function_axis_label(
47 p_element_id => p_y_element_id,
48 p_function_code => p_function_code),
49 x_chart_id => x_chart_id);
50
51 qa_chart_generic_pkg.populate_data(
52 p_chart_id => x_chart_id,
53 p_sql => p_sql,
54 x_row_count => x_row_count);
55
56 END create_chart;
57
58
59 PROCEDURE create_chart_autonomous(
60 p_criteria_id NUMBER,
61 p_x_element_id NUMBER,
62 p_y_element_id NUMBER,
63 p_function_code NUMBER,
64 p_title VARCHAR2,
65 p_description VARCHAR2,
66 p_sql VARCHAR2,
67 x_chart_id OUT NOCOPY NUMBER,
68 x_row_count OUT NOCOPY NUMBER) IS
69
70 --
71 -- This is a wrapper to create_chart and performs
72 -- autonomous commit.
73 --
74 PRAGMA autonomous_transaction;
75
76 BEGIN
77 create_chart(
78 p_criteria_id,
79 p_x_element_id,
80 p_y_element_id,
81 p_function_code,
82 p_title,
83 p_description,
84 p_sql,
85 x_chart_id,
86 x_row_count);
87 COMMIT;
88 END create_chart_autonomous;
89
90
91 PROCEDURE delete_data(p_chart_id NUMBER) IS
92 --
93 -- This is a simple wrapper to qa_chart_generic_pkg
94 -- since Trend Chart uses generic charting architecture.
95 --
96 BEGIN
97 qa_chart_generic_pkg.delete_data(p_chart_id);
98 END delete_data;
99
100
101 PROCEDURE delete_data_autonomous(p_chart_id NUMBER) IS
102 --
103 -- This is a wrapper to delete_data and performs
104 -- autonomous commit.
105 --
106 PRAGMA autonomous_transaction;
107 BEGIN
108 delete_data(p_chart_id);
109 COMMIT;
110 END delete_data_autonomous;
111
112
113 END qa_chart_trend_pkg;