# # # build_html_standard() # # # This builds the a standard html table element from the raw report element # # # include "templates.util.get_web_server_root_path"; include "templates.util.encoding"; include "templates.util.date_time.date_time_formatting"; include "templates.statistics.html_report_element.build_html_graphs"; include "templates.statistics.html_report_element.build_html_standard_util"; subroutine(build_html_standard( string session_id, bool is_root_admin, string profile_name, node raw_report_element, node html_formatting, string html_report_element_id, bool is_export_button, node collected_whitelist_objects), ( debug_message("\n\n#### build_html_standard() START \n\n"); string web_server_root_path = get_web_server_root_path(); node query_fields = get_query_fields(session_id, is_root_admin, profile_name); string report_element_id = node_name(raw_report_element); string short_report_element_id = @raw_report_element{"short_report_element_id"}; string report_element_type = @raw_report_element{"report_element_type"}; string output_format = @html_formatting{"output_format"}; bool is_pivot_table = @raw_report_element{"is_pivot_table"}; bool is_hierarchical_table = @raw_report_element{"is_hierarchical_table"}; bool is_dynamic_report = (output_format eq "dynamic"); bool add_zoom_icon = (is_dynamic_report and report_element_type ne "log_detail"); bool show_http_link = @html_formatting{"show_http_link"}; string server_root = @html_formatting{"server_root"}; # Modify show_http_link if ouput_format is not appropriate, # we disable show_http_link in printer friendly and PDF files if (show_http_link and (output_format eq "static_print" or output_format eq "static_pdf")) then ( show_http_link = false; ); bool show_graphs = @raw_report_element{"show_graphs"}; bool is_graphs = (raw_report_element?{"graphs"}); bool is_table = (raw_report_element?{"rows"}); # bool display_graphs_table_side_by_side = @raw_report_element{"display_graphs_table_side_by_side"}; node text_sizes = html_formatting . ".sizes.table_cell"; v.text_info = ""; v.text_info.maximum_text_length = @text_sizes{"maximum_text_length"}; v.text_info.maximum_continuous_text_length = @text_sizes{"maximum_continuous_text_length"}; v.text_info.maximum_continuous_text_length_offset = @text_sizes{"maximum_continuous_text_length_offset"}; v.text_info.dash_breaks = @html_formatting{"dash_breaks"}; v.text_info.break_entity = @html_formatting{"break_entity"}; node text_info = "v.text_info"; string table_bar_graph_color_scheme = @html_formatting{"graph_color_scheme_types"}{"table_bar_graph"}; node permissions; if (is_dynamic_report) then ( permissions = html_formatting{"permissions"}; ); # # # # # Graphs # # # # if (is_graphs) then ( node raw_report_element_graphs = raw_report_element{"graphs"}; # # Verify that all raw graphs exist # bool raw_graph_exists; bool all_raw_graphs_exist = true; node raw_report_element_graph_item; string graph_id; foreach raw_report_element_graph_item raw_report_element_graphs ( graph_id = @raw_report_element_graph_item; raw_graph_exists = get_raw_graph_exists(profile_name, graph_id, collected_whitelist_objects); if (!raw_graph_exists) then ( all_raw_graphs_exist = false; last; ); ); debug_message("#### build_html_standard() - all_raw_graphs_exist: " . all_raw_graphs_exist . "\n"); if (all_raw_graphs_exist) then ( # Add a customize link (Opens Customize Window with graphs tab active as default) # if (is_dynamic_report and @permissions{"customize_report_element"}) then ( # # '
'; # ''; # ''; # '' . lang_stats.btn.customize . ''; # ''; # '
'; # ); build_html_graphs(query_fields, profile_name, raw_report_element, raw_report_element_graphs, html_formatting, html_report_element_id); ); # Add clearence for the table '
 
'; # Add clearence for the table, unless the table is displayed side by side with graphs # if (is_table and !display_graphs_table_side_by_side) then ( # '
 
'; # ); ); # # # # # Table # # # # if (is_table) then ( # if (is_pivot_table) then ( # Set "v.add_standard_html_rows_inner_raw_header" so that we have # access to the inner_raw_header in add_standard_html_rows() # delete_node("v.add_standard_html_rows_inner_raw_header"); # v.add_standard_html_rows_inner_raw_header; # ); # # # Check for active breakdown # # # table-container-div, this includes breakdown info '
'; # if (is_graphs and display_graphs_table_side_by_side) then ( # ' style="float:left"'; # ); # '>'; # NOTE, BREAKDOWN INFO MUST BE DISPLAYED ABOVE THE REPORT ELEMENT GRAPHS if (@raw_report_element{"is_hierarchical_table"}) then ( if (?(raw_report_element . ".breakdown.item_value")) then ( string main_report_field_name = @raw_report_element{"report_field"}; string breakdown_display_format_type = @query_fields{main_report_field_name}{"display_format_type"}; node breakdown = raw_report_element{"breakdown"}; # string breakdown_item_value = string_to_html(@breakdown{"item_value"}); string breakdown_item_value; if (breakdown_display_format_type ne "date_time") then ( breakdown_item_value = format(@breakdown{"item_value"}, breakdown_display_format_type); ) else ( breakdown_item_value = format_date_time(@breakdown{"item_value"}); ); breakdown_item_value = string_to_html(breakdown_item_value); string breakdown_additional_filter_item_values = string_to_html(@breakdown{"additional_filter_item_values"}); string breakdown_field_label = string_to_html(get_expanded_label(@breakdown{"field_label"})); string breakdown_anchor_id = short_report_element_id . ":clear_breakdown"; '
'; '' . breakdown_field_label . ' > '; '' . breakdown_item_value . ''; if (breakdown_additional_filter_item_values ne "") then ( ' (' . breakdown_additional_filter_item_values . ')'; ); '
'; ); ); # # # Table header # # int starting_row = @raw_report_element{"starting_row"}; int ending_row = @raw_report_element{"ending_row"}; int total_rows = @raw_report_element{"total_rows"}; bool is_unknown_total_rows = if (raw_report_element?{"is_unknown_total_rows"}) then (@raw_report_element{"is_unknown_total_rows"}) else (false); # number_of_rows_in_table is only relevant for log_detail if is_unknown_total_rows is true. int number_of_rows_in_table = if (raw_report_element?{"number_of_rows_in_table"}) then (@raw_report_element{"number_of_rows_in_table"}) else (0); if (!is_unknown_total_rows and total_rows == 0) then ( starting_row = 0; ); # # # Row number control # # add_standard_html_table_control( is_dynamic_report, short_report_element_id, starting_row, ending_row, total_rows, is_unknown_total_rows, number_of_rows_in_table, is_export_button ); # # # Table # # # '
\n'; '\n'; ''; add_standard_html_display_header( raw_report_element, report_element_id, report_element_type, is_pivot_table, add_zoom_icon, is_dynamic_report ); ''; '\n'; add_standard_html_rows( web_server_root_path, profile_name, output_format, query_fields, short_report_element_id, raw_report_element, is_pivot_table, add_zoom_icon, is_dynamic_report, is_hierarchical_table, show_http_link, server_root, text_info, table_bar_graph_color_scheme ); ''; # # Add no data returned info # if ((!is_unknown_total_rows and total_rows == 0) or (is_unknown_total_rows and number_of_rows_in_table == 0)) then ( node raw_header = raw_report_element{"header"}; int number_of_columns = num_subnodes(raw_header); if (add_zoom_icon) then ( number_of_columns = number_of_columns + 1; ); ''; ''; ''; ); '
'; if (!is_unknown_total_rows) then ( '
'. lang_stats.general.no_data . '
'; ) else ( expand(lang_stats.general.no_data_for_row_n_to_m); ); '
\n'; '
'; # table-container-div # '
\n'; # standard-re # # # Add javascript info for columns # # if (is_dynamic_report and num_subnodes("v.temp_js_columns_info") > 0) then ( node column_info = "v.temp_js_columns_info"; node item; string dat = "{"; '\n'; ); ) else if (show_graphs and !is_graphs) then ( # There is no table and no graphs data. This must be a query which did # not return any data. Show no_data info. '
' . lang_stats.general.no_data . '
'; ); ));