# # # # alert_util.cfv # # # alert_util_convert_node_to_string() # alert_util_get_bug_report_as_node() # # # # # # # # # alert_util_convert_node_to_string() # # # subroutine(alert_util_convert_node_to_string( node the_node), ( # Converts the given node to a string node item; foreach item the_node ( if (num_subnodes(item) == 0) then ( node_name(item) . ': ' . @item . '\n'; ) else ( alert_util_convert_node_to_string(item); ); ); )); # # # # alert_util_get_bug_report_as_node() # # # subroutine(alert_util_get_bug_report_as_node( string alert_id), ( # Returns a node with all relevant bug report data, this replaces compose_bug_report_text() string message_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_message.txt"; string traceback_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_traceback.txt"; string info_file = LOGANALYSISINFO_DIRECTORY . "TemporaryFiles/" . alert_id . "_error_info.txt"; string error_message = read_file(message_file); string error_traceback = read_file(traceback_file); string error_info_text = read_file(info_file); string licensing_features_text = alert_util_convert_node_to_string("volatile.licensing.features"); # debug_message("\n\n" . node_as_string("volatile.licensing.features") . "\n\n"); bool is_webserver_mode = !CGI_MODE; string operation_mode; if (is_webserver_mode) then ( operation_mode = "Webserver Mode"; ) else ( operation_mode = "CGI Mode"; ); #* string bug_report = "MESSAGE
" . error_message . "

"; bug_report .= "TRACEBACK
" . error_traceback . "

"; # 2008-12-28 - GMF - Added expand(); otherwise we get Salang code in the emails we receive (because PRODUCT_NAME has embedded Salang). bug_report .= expand("SYSTEM
" . PRODUCT_NAME . " " . VERSION . " (" . ARCH . ", " . operation_mode . ")

"); bug_report .= "LICENSING
" . licensing_features_text . "

"; bug_report .= "INFO
" . error_info_text . "


"; *# # Create a bug report node from which the bug report is then assembled # for HTML output or HTP POST. Escaping is done in the callee, not here. node bug_report = new_node(); bug_report{"message"}{"label"} = "MESSAGE"; bug_report{"message"}{"item_value"} = error_message; bug_report{"traceback"}{"label"} = "TRACEBACK"; bug_report{"traceback"}{"item_value"} = if (error_traceback ne "") then (error_traceback) else ("-"); bug_report{"system"}{"label"} = "SYSTEM"; bug_report{"system"}{"item_value"} = expand(PRODUCT_NAME . " " . VERSION . " (" . ARCH . ", " . operation_mode . ")"); bug_report{"licensing"}{"label"} = "LICENSING"; bug_report{"licensing"}{"item_value"} = if (licensing_features_text ne "") then (licensing_features_text) else ("-"); bug_report{"info"}{"label"} = "INFO"; bug_report{"info"}{"item_value"} = if (error_info_text ne "") then (error_info_text) else ("-"); debug_message("\n\n#### bug_report 1:\n" . node_as_string(bug_report) . "\n\n"); # Return bug_report; ));