{= # # # build_report_elements_init.cfv # This template is invoked from request_report.cfv because building the report elements # is done by a new thread, so this template actually acts as a glue between # request_report.cfv and the subroutine build_report_elements(); # # # include "templates.util.base_util"; include "templates.statistics.build_report_elements"; include "templates.statistics.raw_report_element.build_raw_report_element"; # include "templates.statistics.html_report_element.build_html_report_element"; debug_message("\n\n#### #### build_report_elements_init.cfv START \n"); string session_id = volatile.session_id; string profile_name = internal.profile_name; bool is_root_admin = get_is_root_admin(); bool is_access_reports = (is_root_admin or get_access_reports_permission(session_id, profile_name)); string page_token = volatile.page_token; if (is_access_reports and get_is_valid_page_token(session_id, "statistics", page_token)) then ( debug_message("\n\n" . node_as_string("command_line") . "\n"); string report_job_id = volatile.report_job_id; bool is_real_time_processing = volatile.is_real_time_processing; string profile_name = command_line.profile; # debug_message("\n\n#### report_job_id: " . report_job_id . "\n"); # # Continue to pause the database while this task is active if this is realtime processing # if (is_real_time_processing) then ( # This keeps the database paused while the current task is active. debug_message("#### build_report_elements_init.cfv get_database_access() START \n"); get_database_access(); debug_message("#### build_report_elements_init.cfv get_database_access() END \n"); ); string session_profile_path = "sessions_cache." . session_id . ".profiles." . profile_name; node report_job = session_profile_path . ".report_jobs." . report_job_id; # debug_message("build_report_elements_init 1\n"); build_report_elements(session_id, profile_name, report_job); ) else ( # No permission to view this resource (URL) display_no_permission_html(); ); =}