# # GeoIP Snapon # # This snapon adds GeoIP fields, reports, etc. # geoip = { label = "$lang_admin.snapons.geoip.label" comment = "$lang_admin.snapons.geoip.comment" config_snapon_category = "" version = "1.0" # 2012-04-24 - GMF - 1.0 - Initial creation parameters = { ip_address_field = { parameter_value = "ip_address_unspecified" validation_type = "string" form_element_label = "$lang_admin.snapons.geoip.parameters.ip_address_field.form_element_label" form_element_type = "select" select_options_source = "database_fields" description = "" } # ip_address_field # 2012-04-24 - GMF - Commented out for now, because for the moment, the fields *must* be called location, country, region, and city. Eventually, and extension of Salang to support GeoIP lookup of country, region, and city will allow these fields to be specified (and will allow multiple GeoIP lookups in a single profile). # location_field_name = { # # parameter_value = "{=capitalize(expand(lang_stats.field_labels.location))=}" # final_node_name = "location" # # validation_type = "field_label" # validate_field_label_for = { # database_fields = true # report_fields = true # } # # form_element_label = "{=capitalize(expand(lang_stats.field_labels.location_field_name))=}" # form_element_type = "text" # form_element_width = "380" # # description = "" # # } # location_field_name # # country_field_name = { # # parameter_value = "{=capitalize(expand(lang_stats.field_labels.country))=}" # final_node_name = "country" # # validation_type = "field_label" # validate_field_label_for = { # database_fields = true # report_fields = true # } # # form_element_label = "{=capitalize(expand(lang_stats.field_labels.country_field_name))=}" # form_element_type = "text" # form_element_width = "380" # # description = "" # # } # country_field_name # # region_field_name = { # # parameter_value = "{=capitalize(expand(lang_stats.field_labels.region))=}" # final_node_name = "region" # # validation_type = "field_label" # validate_field_label_for = { # database_fields = true # report_fields = true # } # # form_element_label = "{=capitalize(expand(lang_stats.field_labels.region_field_name))=}" # form_element_type = "text" # form_element_width = "380" # # description = "" # # } # region_field_name # # city_field_name = { # # parameter_value = "{=capitalize(expand(lang_stats.field_labels.city))=}" # final_node_name = "city" # # validation_type = "field_label" # validate_field_label_for = { # database_fields = true # report_fields = true # } # # form_element_label = "{=capitalize(expand(lang_stats.field_labels.city_field_name))=}" # form_element_type = "text" # form_element_width = "380" # # description = "" # # } # city_field_name } # parameters parameters_form = { group_1 = { description = "$lang_admin.snapons.geoip.parameters_form.group_1.description" parameters = { ip_address_field = true # location_field_name = true # country_field_name = true # region_field_name = true # city_field_name = true } # parameters } # group 1 } # parameters_form attach_operations = { # Make the IP Address field a "host" field edit_ip_address_field_type = { type = "edit_profile_node" node = "log.fields.{= @parameters{'ip_address_field'}{'parameter_value'} =}.type" new_value = "host" } # edit_ip_address_field # Add database field add_database_fields = { type = "add_database_fields" fields = { location = { suppress_top = 0 suppress_bottom = 3 } # location # country = "" # region = "" # city = "" } # fields } # add_database_fields # Add xref group add_xref_groups = { type = "add_xref_groups" xref_groups = { location = { use_flat_table = false fields = { location = "" } # fields add_all_aggregating_fields = true } # location } # xref_groups } # add_xref_groups # Add report fields add_report_fields = { type = "add_report_fields" fields = { # location = "" country = { database_field = "location" subitems_level = 1 } # country region = { database_field = "location" subitems_level = 2 } # region city = { database_field = "location" subitems_level = 3 } # city location = { database_field = "location" subitems_level = -1 } # location } # fields } # add_report_fields # When attaching: Add the reports. # Disabled because this is done automatically by Create Profile Wizard. add_reports = { type = "add_reports" reports = { geoip_snapon_countries_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.country)))=}" report_elements = { geoip_snapon_countries_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.country)))=}" type = "table" sort_by = "MAIN_SORT_FIELD" # Sort this report by the main sort field, whatever that may be columns = { country.report_field = "country" } # columns add_all_aggregating_columns = true } # geoip_snapon_countries_report } # report_elements } # geoip_snapon_countries_report geoip_snapon_regions_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.region)))=}" report_elements = { geoip_snapon_regions_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.region)))=}" type = "table" sort_by = "MAIN_SORT_FIELD" # Sort this report by the main sort field, whatever that may be columns = { region.report_field = "region" } # columns add_all_aggregating_columns = true } # geoip_snapon_regions_report } # report_elements } # geoip_snapon_regions_report geoip_snapon_cities_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.city)))=}" report_elements = { geoip_snapon_cities_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.city)))=}" type = "table" sort_by = "MAIN_SORT_FIELD" # Sort this report by the main sort field, whatever that may be columns = { city.report_field = "city" } # columns add_all_aggregating_columns = true } # geoip_snapon_cities_report } # report_elements } # geoip_snapon_cities_report } # reports reports_menu = { visitor_demographics_group = { label = "{=expand(lang_stats.menu.groups.visitor_demographics_group)=}" items = { geoip_snapon_countries_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.country)))=}" report = "geoip_snapon_countries_report" } # geoip_snapon_countries_report geoip_snapon_regions_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.region)))=}" report = "geoip_snapon_regions_report" } # geoip_snapon_regions_report geoip_snapon_cities_report = { label = "{=capitalize(pluralize(expand(lang_stats.field_labels.city)))=}" report = "geoip_snapon_cities_report" } # geoip_snapon_cities_report } # items } # geoip_snapon_visitor_demographics_group } # reports_menu } # add_reports } # attach_operations } # geoip