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.3.00.03'
,p_default_workspace_id=>1720605219287947
,p_default_application_id=>101
,p_default_owner=>'DEV15_APX'
);
end;
/
prompt --application/ui_types
begin
null;
end;
/
prompt --application/shared_components/plugins/dynamic_action/ext_ir_to_msexcel
declare
  --
  vpluginid number := wwv_flow_id.next_val ;
  vplugin_attrb_id1 number := wwv_flow_id.next_val ;
  vplugin_attrb_id2 number := wwv_flow_id.next_val ;
  vplugin_attrb_id3 number := wwv_flow_id.next_val ;
  --
begin
	wwv_flow_api.create_plugin(
	 p_id=> vpluginid
	,p_plugin_type=>'DYNAMIC ACTION'
	,p_name=>'EXT_IR_TO_MSEXCEL_DATA'
	,p_display_name=>'Extend Report to MSExcel Data Only'
	,p_category=>'MISC'
	,p_supported_ui_types=>'DESKTOP'
	,p_javascript_file_urls=>'/st/EXTENDIR2MSEXCEL.js'
	,p_render_function=>'PKG_APX_EXTEND_RENDER.render'
	,p_ajax_function=>'PKG_APX_EXTEND_RENDER.ajax'
	,p_standard_attributes=>'REGION'
	,p_substitute_attributes=>true
	,p_subscribe_plugin_settings=>true
	,p_help_text=>wwv_flow_utilities.join(wwv_flow_t_varchar2(
	'	The Extend Interactive Report to MSExcel Data Only APEX plugin lets you get results of your Interactive Report data in Excel-format , with  correct display of Strings, Number and Dates.',
	'	Supported IR features:',
	'	* Filtering and Sorting',
	'	* Control Break',
	'	* Computations',
	'	* Aggregations'))
	,p_version_identifier=>'1.0'
	,p_about_url=>'http://ascenderhcm.com'
	,p_plugin_comment=>wwv_flow_utilities.join(wwv_flow_t_varchar2(
	'Do not move ExcelTemplate.zip to the WEB-Server !!!',
	'Package PKG_APX_EXTEND_RENDER need to be installed on each oracle-scheme where the plugin is used.'))
	,p_files_version=>13
	);
		wwv_flow_api.create_plugin_attribute(
		 p_id=> vplugin_attrb_id1
		,p_plugin_id=> vpluginid
		,p_attribute_scope=>'COMPONENT'
		,p_attribute_sequence=>1
		,p_display_sequence=>10
		,p_prompt=>'Maximum Rows'
		,p_attribute_type=>'INTEGER'
		,p_is_required=>false
		,p_default_value=>'1000000'
		,p_is_translatable=>false
		,p_help_text=>wwv_flow_utilities.join(wwv_flow_t_varchar2(
		'Rows greater than this value will not be exported. ',
		'To export all the rows set the value to 1000000.',
		'When empty - value from Interactive Report Attributes-> Maximum Row Count will be used.'))
		);
		wwv_flow_api.create_plugin_attribute(
		 p_id=> vplugin_attrb_id2
		,p_plugin_id=>vpluginid
		,p_attribute_scope=>'COMPONENT'
		,p_attribute_sequence=>2
		,p_display_sequence=>20
		,p_prompt=>'Download Type'
		,p_attribute_type=>'TEXT'
		,p_is_required=>true
		,p_default_value=>'E'
		,p_supported_ui_types=>'DESKTOP'
		,p_is_translatable=>false
		);
			wwv_flow_api.create_plugin_attr_value(
			 p_id=> wwv_flow_id.next_val
			,p_plugin_attribute_id=>vplugin_attrb_id2
			,p_display_sequence=>10
			,p_display_value=>'Excel XLSX (Data only)'
			,p_return_value=>'E'
			);
		wwv_flow_api.create_plugin_attribute(
		 p_id=> vplugin_attrb_id3
		,p_plugin_id=> vpluginid
		,p_attribute_scope=>'COMPONENT'
		,p_attribute_sequence=>3
		,p_display_sequence=>30
		,p_prompt=>'Add Download XLSX Icon to "Download" Dialog'
		,p_attribute_type=>'CHECKBOX'
		,p_is_required=>false
		,p_default_value=>'Y'
		,p_is_translatable=>false
		,p_help_text=>'Add "Download XLSX" Icon to the standard download menu of Affected IR Region. When empty, this icon will be added to any IR of the current page.'
		);
		wwv_flow_api.create_plugin_event(
		 p_id=> wwv_flow_id.next_val
		,p_plugin_id=> vpluginid
		,p_name=>'ondownloadxlsx'
		,p_display_name=>'On Download XLSX Data only'
		);
		--create zipped template of xlsx
		wwv_flow_api.g_varchar2_table := wwv_flow_api.empty_varchar2_table;
		wwv_flow_api.g_varchar2_table(1) := '504B03041400060008000000210062EE9D686101000090040000130008025B436F6E74656E745F54797065735D2E786D6C20A2040228A0000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(2) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(3) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(4) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(5) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(6) := '000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000AC944D4FC3300C86EF48FC872A57D466E380105AB7031F4798C4F801A171D7';
		wwv_flow_api.g_varchar2_table(7) := '686912C5DED8FE3D6EF62184CAA6895D1AB5B1DFF7896B673459B7365B4144E35D2986C54064E02AAF8D9B97E263F692DF8B0C4939ADAC77508A0DA0988CAFAF46B34D00CC38DB61291AA2F02025560DB40A0B1FC0F14EED63AB885FE35C06552DD41CE4';
		wwv_flow_api.g_varchar2_table(8) := 'ED6070272BEF081CE5D46988F1E8096AB5B4943DAFF9F396248245913D6E033BAF52A810ACA91431A95C39FDCB25DF39149C9962B031016F1843C85E876EE76F835DDE1B97261A0DD954457A552D63C8B5955F3E2E3EBD5F14C7457A287D5D9B0AB4AF96';
		wwv_flow_api.g_varchar2_table(9) := '2D57A0C01041696C00A8B5455A8B5619B7E73EE29F8251A665786190EE7C49F80407F1FF06999EFF474832270C913616F0C2A7DD8A9E726E5404FD4E9127E3E2003FB58F7170DF4CA30FC81314E1FC2AEC47A4CBCE030B4124038721E96BB683234FDFF9';
		wwv_flow_api.g_varchar2_table(10) := '86BFBA1DBAF9D6A07BBC65BA4FC6DF000000FFFF0300504B030414000600080000002100B5553023F50000004C0200000B0008025F72656C732F2E72656C7320A2040228A000020000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(11) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(12) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(13) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(14) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(15) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008C92CF4EC3300CC6EF48BC43E4FBEA6E48';
		wwv_flow_api.g_varchar2_table(16) := '08A1A5BB4C48BB21541EC024EE1FB58DA32440F7F68403824A63DBD1F6E7CF3F5BDEEEE669541F1C622F4EC3BA2841B133627BD76A78AD9F560FA06222676914C71A8E1C6157DDDE6C5F78A4949B62D7FBA8B28B8B1ABA94FC2362341D4F140BF1EC72A5';
		wwv_flow_api.g_varchar2_table(17) := '913051CA6168D19319A865DC94E53D86BF1E502D3CD5C16A08077B07AA3EFA3CF9B2B7344D6F782FE67D62974E8C409E133BCB76E543660BA9CFDBA89A42CB498315F39CD311C9FB2263039E26DA5C4FF4FFB63871224B89D048E0F33CDF8A7340EBEB81';
		wwv_flow_api.g_varchar2_table(18) := '2E9F68A9F8BDCE3CE2A784E14D64F861C1C50F545F000000FFFF0300504B030414000600080000002100F04C147DD30000004A01000023000000786C2F776F726B7368656574732F5F72656C732F7368656574312E786D6C2E72656C7384D0C14A04310C';
		wwv_flow_api.g_varchar2_table(19) := '06E0BBE03B94DC9DCE7A109199D98B0A7BF022EB03C436D3966D93D256D9797B7B515C103CFE24F91232EDCF29AA4F2A3508CFB01B4650C4466C6037C3DBF1F9E61E546DC816A330CDB05185FD727D35BD52C4D687AA0FB9AAAE709DC1B7961FB4AEC653';
		wwv_flow_api.g_varchar2_table(20) := 'C23A4826EE95554AC2D663713AA339A1237D3B8E77BAFC3660B930D5C1CE500E7607EAB8E5BEF97F5BD635187A14F39188DB1F2BB4EF5289814F1DC5E2A8FDB08D8C6789E2B60153A80347FDDE93FE6E7C11DB6F783A372A8C11F432E98B0F2C5F000000';
		wwv_flow_api.g_varchar2_table(21) := 'FFFF0300504B03041400000008001578084583AFEAE3B5050000E31B000013000000786C2F7468656D652F7468656D65312E786D6CED59C9CBD34014BF0BFE0F43EE9A74C96715ABD8DABA2F68553CBEA6D36674920933D34F7B133D0A82B8E045F0E641';
		wwv_flow_api.g_varchar2_table(22) := '5C40C18BFE356EB880FF822F49DB24CD54EB2EEAF7413BCBEFEDF3DE2CDDBEF37CC0C93A958A89B06955363B16A1A127062C1C35AD13BDEEA68645948670005C84B4694DA8B276EED8B8613B6CD33E0D2841FA506D83A6E56B1D6DB36DE5E130A8CD22A2';
		wwv_flow_api.g_varchar2_table(23) := '21CE0D850C4063578EEC818473C837E076D571D6EC005868911002647B6438641E25BD98A5B563C6BCC3F123D42A1EF0B83CEEC583798A143B385B89BFD444B5B924EBC09B16CA1988733D7A5E5B8483D238D1B49CE4CFB2776CB7E7445C2FA1CDD17593';
		wwv_flow_api.g_varchar2_table(24) := 'BF846E4A109357133A39EACF092BDDFAD62DBBE7FCAB29FF32AED3E9B43B9504370780E7A1A59512B6DE6D545A539E1968D62CF36E3BAE532FE0F3FC6B25FCD656ABE56E2DE06B19BE5EC2379CB5FAAE6A015FCFF06E59FFD6AE767BAD807733FC5A09DF';
		wwv_flow_api.g_varchar2_table(25) := 'DDB275AD3EC767209FB3F0EC023A8DE82C32196428F85E23BC81F0C66C0164283BB7BA52FA502F5B6B019C11B28B8024B8A05948F424A243F010D786A02F1958248250281C70AA4ED7A9E167FC5F4F5A75148FA4147274E990A70A43334D88F2248B74D3';
		wwv_flow_api.g_varchar2_table(26) := 'DA8F5CAD1CE4E3B3FB1F9F3D261F9F3D7A71F1C98B8B4F5F5CBAF4E2E24303E15E084779C2F777AF7EB87D81BC7B7CE7FDF51B66BCCAE35F3DB8FCF2F9353350E781AF6F3E7AF3E4D1EB5B57DEDEBB6E80EF92D0CFC37B2CA08A1CA6E7C8311140681240';
		wwv_flow_api.g_varchar2_table(27) := 'FBF2EB287A3EB00205F88834003BDA2F000F4F809B702D5A74DE4989E5C104DC333E53D0F5B82FC79A198007FCA0003C24046F096934E700CA2A98330E4766E1729CC71D035837C96E2F84B6338E709D3330417D5A50F328C768C388865493784E9CA5D4';
		wwv_flow_api.g_varchar2_table(28) := '40769A3156B08E79522831D4E434232D604697F4585F9B89F6B200E3320173A8A1407492B40437B1DF4DD78B48402F72134BCA0B6EDC03630D81516308781E7910B46F52F2F8447A05872B2D513AE5827406542913CD113929A87B00383387FD109F0445';
		wwv_flow_api.g_varchar2_table(29) := 'A4D4EC6C1919EB27441EB95B9C6DFB1044469D59E8E7B1FBD4595CA2408E0A6D5442E43324ED631C205C1AEE938CEAAF4BEB136CE49B17483C3396A694A0A2988F133E049A30B717EA78C0C2CF1575CEB0AA2F1475F77F513717F55DB801F2CF97F20CF7';
		wwv_flow_api.g_varchar2_table(30) := '7714F0DD300E8FD2D0FF5FBFFFD7EF7FB27E27B9FC4BAA7656A8ED9430776A0F961EDA878CF3E37AC2E94195947885E60DBA38987412A2F91D21F2B199885BC08D24246D22853EC5B47FDC8708C554AC645221EBB44122A17093B096F14E26708BD1E998';
		wwv_flow_api.g_varchar2_table(31) := '9BDE491334E84362900ED7B2BB6A8E0DF6621179413564B0B2B0DA96EF135641D8EAD22AAE599AFB596976CE9B983704B30D59AD5553D1B85080D3018E240C92B0FC9C10291F06741AA38AD1904A6D25B7A5F7CED5A56DAD2D91F603839417575F22CEFD';
		wwv_flow_api.g_varchar2_table(32) := '0151724A51B2CBE9C8C3628F9C43ADDCAA6B110FA2A635C41319368308F9A9B854011FE15B95A71353B2245DD960D76CB0B3C4E0051191547A37283FA54AA6664F3961A67FD545B7FE2803EC6FD5A2D6A8FC462DECC5D0D2E1907A7AC948D69DCE89B1A6';
		wwv_flow_api.g_varchar2_table(33) := 'F2B83F3847FA7C2C8F01EA5D4F57D780298D2E9E75F0890EBD9DF41632DFB1CA4F465976008F7C98D6A4C62CF67378DCCE74C05E413DBBA0FB779B52FB81A6B8FFAE29F1CAC5036E6D905CBDF01820814432564B48ED0BAC4291CFBCAEC48343220BF5C2';
		wwv_flow_api.g_varchar2_table(34) := '675E9C461DF17D3BF996747D56B7663CD22237F2F53136229261A5D3BEA4F4A89EDAF90566956AB6BF668CB053505745E9779FAE53DE8BB3770DED471E7E524DA6F429AE1C34DB945DFD51F70F3EF9D49DAF3F1E648252FAD585A54B69712BD8BA44859F';
		wwv_flow_api.g_varchar2_table(35) := 'B3D556CD1657DD95B7DA08AF2924FEC0C2CDA4C7B3F36D4F1CC3E893F98992E042DCD498A6DF7CB08F3A37E6C6A5FC7EEE312A0B41C3F9F987CF9CB36B8BE2E631F839CE760DBE763FEF6ABB9CA276EE2213F7CA3F8489FE1994BD1BEF4763AE55FAEE74';
		wwv_flow_api.g_varchar2_table(36) := '1E2FA5EDE94F18311F3B23DDF109504B030414000600080000002100A69888AE7E010000FD02000010000801646F6350726F70732F6170702E786D6C20A2040128A000010000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(37) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(38) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(39) := '0000000000000000000000000000000000000000000000009C92414FE3301085EF48FB1F22DFA9D32E5AA1CA314285158745546ACB9E8D33692C5C3BF20C51BBBF9E49A2D214F6C46D66DED3F3E7B1D5CD7EE7B31612BA180A319DE422836063E9C2B610';
		wwv_flow_api.g_varchar2_table(40) := '9BF5EFCB6B912199501A1F0314E200286EF48F0BB54CB181440E30E3888085A8899AB994686BD8199CB01C58A962DA19E2366D65AC2A67E12EDAB71D0492B33CFF25614F104A282F9B8F403124CE5BFA6E68196DC787CFEB43C3C05ADD368D77D610DF52';
		wwv_flow_api.g_varchar2_table(41) := '3F3A9B22C68AB2FBBD05AFE458544CB702FB961C1D74AEE4B8552B6B3C2C385857C62328791AA80730DDD296C625D4AAA5790B9662CAD0FDE3B5CD44F662103A9C42B426391388B13ADBD0F4B56F9092FE1BD32BD600844AB26118F6E5D83BAEDD959EF6';
		wwv_flow_api.g_varchar2_table(42) := '062ECE8D5DC000C2C239E2DA91077CAA9626D17F88A763E29E61E01D70183F862F78FD8DF9A04FD17F5C78C54DB38E7786E0B8BAF3A15AD52641C9DB3EEAA7817AE0AD25DF852C6A13B6501E3D5F85EEA19F87DFACA75793FC67CE6F389A2979FAB7FA1D';
		wwv_flow_api.g_varchar2_table(43) := '0000FFFF0300504B0304140006000800000021007D21B1C23C0100005102000011000801646F6350726F70732F636F72652E786D6C20A2040128A00001000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(44) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(45) := '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000';
		wwv_flow_api.g_varchar2_table(46) := '00000000000000000000000000000000008C925F4BC33014C5DF05BF43C97B9B3F8529A1ED40654F0E04278A6F21B9DB8A4D1A9268B76F6FDA6EB5833DF878EF39F9DD732F299607DD243FE07CDD9A12D18CA0048C6C556D76257ADBACD27B94F8208C12';
		wwv_flow_api.g_varchar2_table(47) := '4D6BA04447F06859DDDE14D272D93A7871AD05176AF0492419CFA52DD13E04CB31F6720F5AF82C3A4C14B7ADD322C4D2EDB015F24BEC003342165843104A04817B606A27223A21959C90F6DB350340490C0D6830C1639A51FCE70DE0B4BFFA6050664E5D';
		wwv_flow_api.g_varchar2_table(48) := '87A38D3B9DE2CED94A8EE2E43EF87A32765D9775F91023E6A7F863FDFC3AAC9AD6A6BF950454154A72E94084D655059E17F1708DF0611D6FBCAD413D1CA37EA5A7E4107784804A62003EC63D2BEFF9E3D366852A462849294B49BE618CB33B4E169FFDC8';
		wwv_flow_api.g_varchar2_table(49) := '8BF77DA0B1A14F83FF41A4AC27E639276C463C03C6DC979FA0FA050000FFFF0300504B01022D001400060008000000210062EE9D6861010000900400001300000000000000000000000000000000005B436F6E74656E745F54797065735D2E786D6C504B';
		wwv_flow_api.g_varchar2_table(50) := '01022D0014000600080000002100B5553023F50000004C0200000B000000000000000000000000009A0300005F72656C732F2E72656C73504B01022D0014000600080000002100F04C147DD30000004A0100002300000000000000000000000000C00600';
		wwv_flow_api.g_varchar2_table(51) := '00786C2F776F726B7368656574732F5F72656C732F7368656574312E786D6C2E72656C73504B01023F001400000008001578084583AFEAE3B5050000E31B00001300240000000000000020000000D4070000786C2F7468656D652F7468656D65312E786D';
		wwv_flow_api.g_varchar2_table(52) := '6C0A0020000000000001001800FFC87F6000B3CF01E8A17F6000B3CF015F235B6000B3CF01504B01022D0014000600080000002100A69888AE7E010000FD0200001000000000000000000000000000BA0D0000646F6350726F70732F6170702E786D6C50';
		wwv_flow_api.g_varchar2_table(53) := '4B01022D00140006000800000021007D21B1C23C0100005102000011000000000000000000000000006E100000646F6350726F70732F636F72652E786D6C504B05060000000006000600AD010000E11200000000';
		--
		--save template file to database 
		--
		wwv_flow_api.create_plugin_file(
		 p_id=> wwv_flow_id.next_val
		,p_plugin_id=> vpluginid
		,p_file_name=>'ExcelTemplate.zip'
		,p_mime_type=>'application/zip'
		,p_file_charset=>'utf-8'
		,p_file_content=>wwv_flow_api.varchar2_to_blob(wwv_flow_api.g_varchar2_table)
		);
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
