$templates.shared.doctype
{=
include "templates.shared.util.encode_html";
string profile_name = internal.profile_name;
=}
{=
node log_source_node = "profiles." . profile_name . ".log.source";
node log_source;
string log_source_name;
string log_source_type;
string log_source_label;
string local_pathname;
bool local_process_subdir = false;
bool local_pattern_is_reg_expr = false;
string ftp_username;
string ftp_password;
string ftp_hostname;
string ftp_pathname;
bool ftp_pattern_is_reg_expr = false;
bool ftp_use_passive = false;
string http_hostname;
string http_pathname;
string command;
int local_number = 0;
int ftp_number = 0;
int http_number = 0;
int command_number = 0;
# debug_message("log source:\n" . node_as_string(log_source_node) . "\n");
# sort the log source node by type
sort(log_source_node, "field:type,alphabetical,ascending");
# ----------------------------------------------
# Display log sources (temporary sorted by type)
# ----------------------------------------------
foreach log_source log_source_node (
log_source_name = node_name(log_source);
log_source_type = node_value(subnode_by_name(log_source, "type"));
# -----------------
# log source header
# -----------------
'\n';
# ---------------
# log source data
# ---------------
'
\n';
if (log_source_type eq "local") then (
local_pathname = node_value(subnode_by_name(log_source, "pathname"));
local_pathname = convert_local_code_page_to_utf8(local_pathname);
if (subnode_exists(log_source, "process_subdirectories")) then (
local_process_subdir = node_value(subnode_by_name(log_source, "process_subdirectories"));
);
if (subnode_exists(log_source, "pattern_is_regular_expression")) then (
local_pattern_is_reg_expr = node_value(subnode_by_name(log_source, "pattern_is_regular_expression"));
);
'\n';
'' . lang_options.profile.log.source.type.local.pathname.label . ': | \n';
'' . encode_html(local_pathname) . ' | \n';
'
\n';
'\n';
'\n';
' ';
lang_options.profile.log.source.process_log_source_subdirectories.label;
' | \n';
'
\n';
'\n';
'\n';
' ';
lang_options.profile.log.source.use_regular_expressions_for_log_source.label;
' | \n';
'
\n';
); # local
if (log_source_type eq "ftp") then (
ftp_username = node_value(subnode_by_name(log_source, "username"));
ftp_password = node_value(subnode_by_name(log_source, "password"));
ftp_hostname = node_value(subnode_by_name(log_source, "hostname"));
ftp_pathname = node_value(subnode_by_name(log_source, "pathname"));
int password_char_length = length(ftp_password);
int count = 0;
ftp_password = "";
while (count < password_char_length) (
ftp_password .= "*";
count++;
);
if (subnode_exists(log_source, "pattern_is_regular_expression")) then (
ftp_pattern_is_reg_expr = node_value(subnode_by_name(log_source, "pattern_is_regular_expression"));
);
if (subnode_exists(log_source, "use_passive")) then (
ftp_use_passive = node_value(subnode_by_name(log_source, "use_passive"));
);
'\n';
'' . lang_options.profile.log.source.type.ftp.hostname.label . ': | \n';
'' . encode_html(ftp_hostname) . ' | \n';
'
\n';
'\n';
'' . lang_options.profile.log.source.type.ftp.username.label . ': | \n';
'' . encode_html(ftp_username) . ' | \n';
'
\n';
'\n';
'' . lang_options.profile.log.source.type.ftp.password.label . ': | \n';
'' . ftp_password . ' | \n';
'
\n';
'\n';
'' . lang_options.profile.log.source.type.ftp.pathname.label . ': | \n';
'' . encode_html(ftp_pathname) . ' | \n';
'
\n';
'\n';
'';
' ';
lang_options.profile.log.source.use_regular_expressions_for_log_source.label;
' | \n';
'
\n';
'\n';
'';
' ';
lang_options.profile.log.source.type.ftp.use_passive.label;
'\n';
' |
\n';
); # ftp
if (log_source_type eq "http") then (
http_hostname = node_value(subnode_by_name(log_source, "hostname"));
http_pathname = node_value(subnode_by_name(log_source, "pathname"));
'\n';
'' . lang_options.profile.log.source.type.http.hostname.label . ': | \n';
'' . encode_html(http_hostname) . ' | \n';
'
\n';
'\n';
'' . lang_options.profile.log.source.type.http.pathname.label . ': | \n';
'' . encode_html(http_pathname) . ' | \n';
'
\n';
); # http
if (log_source_type eq "command") then (
command = node_value(subnode_by_name(log_source, "command"));
'\n';
'' . lang_options.profile.log.source.type.command.command.label . ': | \n';
'' . encode_html(command) . ' | \n';
'
\n';
); # command
'
\n';
); # foreach log source
expand(templates.shared.copyright);
=}