{= # # # get_file_name.cfv # This returns a default file name, it is invoked from the reports user interface # # include "templates.util.base_util"; include "templates.util.encoding"; include "templates.util.get_web_server_root_path"; include "templates.statistics.export.export_util"; debug_message("\n\n#### get_file_name.cfv \n"); string profile_name = internal.profile_name; string session_id = volatile.session_id; bool is_root_admin = get_is_root_admin(); bool is_export_permission = is_root_admin or get_report_feature_permission(session_id, profile_name, "csv_export"); string page_token = v.fp.page_token; if (is_export_permission and get_is_valid_page_token(session_id, "statistics", page_token)) then ( debug_message("\n" . node_as_string("v.fp") . "\n"); string user_node_name = node_name(volatile.authenticated_user_node_path); debug_message("\n\n#### user_node_name:" . user_node_name . "\n"); string report_name = v.fp.report_name; string report_element_name = v.fp.report_element_name; string web_server_root_path = get_web_server_root_path(); string export_path = get_export_path(user_node_name, profile_name); string file_name = get_export_file_name( web_server_root_path, export_path, report_name, report_element_name ); # # Send response data # string dat = "{"; dat .= add_json("fileName", file_name, "string"); dat = close_json(dat); "exportTable.getFileNameResponse(" . dat . ")\n"; ) else ( # No permission to view this resource (URL) display_no_permission_html(); ); =}