-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdynamic_action_plugin_de_it-twins_irhdrbr.sql
149 lines (149 loc) · 4.98 KB
/
dynamic_action_plugin_de_it-twins_irhdrbr.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Oracle user
-- APEX_050000 or as the owner (parsing schema) of the application.
--
-- NOTE: Calls to apex_application_install override the defaults below.
--
--------------------------------------------------------------------------------
begin
wwv_flow_api.import_begin (
p_version_yyyy_mm_dd=>'2013.01.01'
,p_release=>'5.0.2.00.06'
,p_default_workspace_id=>26036287808504013104
,p_default_application_id=>79731
,p_default_owner=>'MK_TEST'
);
end;
/
prompt --application/ui_types
begin
null;
end;
/
prompt --application/shared_components/plugins/dynamic_action/de_it_twins_irhdrbr
begin
wwv_flow_api.create_plugin(
p_id=>wwv_flow_api.id(15118483690763480972)
,p_plugin_type=>'DYNAMIC ACTION'
,p_name=>'DE.IT-TWINS.IRHDRBR'
,p_display_name=>'IR Header Linebreaks'
,p_category=>'STYLE'
,p_supported_ui_types=>'DESKTOP'
,p_plsql_code=>wwv_flow_utilities.join(wwv_flow_t_varchar2(
' c_js_function constant varchar2(4000) := ',
'q''[function de_itt_apexir_hdr_break()',
'{ apex.server.plugin',
' (',
' ''#AJAX_IDENT#''',
' , { x01: this.affectedElements[0].id }',
' , { success: function( pData ) ',
' { apex.jQuery.each( pData, function(index, value)',
' { apex.jQuery("#" + index + " > a").html(value); }',
' ); ',
' }',
' }',
' );',
'};]'';',
' ',
' cursor cur_ir_cols is',
' select coalesce( aapic.static_id, ''C'' || aapic.column_id ) column_id',
' , aapic.form_label',
' from apex_application_page_ir_col aapic',
' , apex_application_page_regions aapr',
' where aapic.region_id = aapr.region_id',
' and aapr.application_id = apex_application.g_flow_id',
' and ( aapr.region_id = to_number( regexp_substr( apex_application.g_x01, ''\d+'') )',
' or aapr.static_id = apex_application.g_x01',
' )',
' and aapic.report_label != aapic.form_label',
' ;',
'',
'function render',
' (',
' p_dynamic_action in apex_plugin.t_dynamic_action,',
' p_plugin in apex_plugin.t_plugin',
' )',
' return apex_plugin.t_dynamic_action_render_result',
' as',
' l_affected_elements apex_application_page_da_acts.affected_elements%type;',
' ',
' ',
' l_result apex_plugin.t_dynamic_action_render_result;',
' begin',
' l_result.javascript_function := ''de_itt_apexir_hdr_break'';',
' l_result.ajax_identifier := apex_plugin.get_ajax_identifier;',
'',
' apex_plugin_util.debug_dynamic_action',
' (',
' p_plugin => p_plugin,',
' p_dynamic_action => p_dynamic_action',
' );',
' ',
' apex_javascript.add_inline_code',
' (',
' p_code => replace(c_js_function, ''#AJAX_IDENT#'', l_result.ajax_identifier),',
' p_key => ''de_itt_apexir_hdr_pkg''',
' );',
' ',
' return l_result;',
' end render;',
'',
' function callback',
' (',
' p_dynamic_action in apex_plugin.t_dynamic_action,',
' p_plugin in apex_plugin.t_plugin',
' )',
' return apex_plugin.t_dynamic_action_ajax_result',
' as',
' l_result apex_plugin.t_dynamic_action_ajax_result;',
' begin',
' apex_plugin_util.debug_dynamic_action',
' (',
' p_plugin => p_plugin,',
' p_dynamic_action => p_dynamic_action',
' );',
' apex_debug.message',
' (',
' p_message => ''Value of x01: %s'',',
' p0 => apex_application.g_x01',
' );',
'',
' apex_json.open_object;',
' for rec in cur_ir_cols',
' loop',
' apex_json.write( p_name => rec.column_id, p_value => rec.form_label);',
' end loop;',
' apex_json.close_all;',
' ',
' return l_result;',
' end callback;'))
,p_render_function=>'render'
,p_ajax_function=>'callback'
,p_standard_attributes=>'TRIGGERING_ELEMENT:REQUIRED:ONLOAD'
,p_substitute_attributes=>true
,p_subscribe_plugin_settings=>true
,p_help_text=>wwv_flow_utilities.join(wwv_flow_t_varchar2(
'This plugin allows you to utilize the "Single Row View Labels" as column headings for the report view.<br />',
'To use the plugin follow the steps below:',
'<ul>',
'<li>Create a dynamic action targeting one or multiple interactive reports.</li>',
'<li>As action choose "IR Header Linebreaks".</li>',
'<li>Set "Affected Elements" to "Triggering Element" and leave "Fire on Page Load" set to "Yes".</li>',
'</ul>',
'You can also put the dynamic action on the global page and use ".a-IRR" as jQuery selector to enable the plugin for all interactive reports in the application.'))
,p_version_identifier=>'0.5'
);
end;
/
begin
wwv_flow_api.import_end(p_auto_install_sup_obj => nvl(wwv_flow_application_install.get_auto_install_sup_obj, false), p_is_component_import => true);
commit;
end;
/
set verify on feedback on define on
prompt ...done