# snapon.attach_operations{name} --- structure: label: string comment: string config_snapon_category: string parameters: # Defined in separate file parameters_form: # Defined in separate file attach_operations: infos: - name: label - name: comment comment: This describes the purpose of the snapon. The comment is displayed in the Config/Snapons GUI. - name: config_snapon_category values: [hidden] comment: Defines which snapons are hidden in Config/Snapons by the hidden value. Other values are planned in future. - name: attach_operations comment: This node is the top level of the snapon node. Its subnodes are operations which are run, in the order they appear in the node, when the snapon is attached to a profile. Each subnode of attach_operations has a "type" subnode which specifies the type of the operation. h2. attach_operations | Type: | node | This node is the in the top level of the snapon node. Its subnodes are operations which are run, in the order they appear in the node, when the snapon is attached to a profile. Each subnode of attach_operations has a "type" subnode which specifies the type of the operation. Possible types are: || Type || Meaning \\ || Supports add_condition? \\ || Supports add_in_snapon? \\ || | add_database_fields | This adds one or more database fields to a profile \\ | | yes \\ | | add_log_fields \\ | This adds one or more log fields to a profile | | yes \\ | | add_database_filters | This adds one or more database filters to a profile | | yes \\ | | add_report_fields | This adds one or more report fields to a profile | | yes \\ | | add_xref_fields \\ | This adds one or more fields to some or all xrefs in a profile \\ | | | | add_xref_groups | This adds one or more xref groups to a profile \\ | | | | add_reports \\ | This adds one or more reports to a profile | | yes \\ | | add_report_element_columns \\ | This adds one or more columns to some or all report elements in a profile \\ | yes \\ | \\ | | add_snapons \\ | This adds one or more snapons to a profile | | yes \\ | | execute_expression \\ | This executes a Salang expression \\ | | | | add_log_filters \\ | This adds one or more log filters \\ | | yes \\ | | add_log_filter_initializations \\ | This adds one or more log filter initialization expressions \\ | | | | add_log_filter_finalizations \\ | This adds one or more log filter finalization expressions \\ | | | | edit_profile_node \\ | This changes the value of a single profile node \\ | | | If "supports add_condition" is true above, that operation's node may contain an add_condition subnode, which is compiled and executed as Salang each time an addition is considered, and the operation does not occur for that iteration if the expression evaluates to false. If "Supports add_in_snapon" is true above, that operation's node may contain an add_in_snapon subnode, which is expanded/executed as the snapon is expanded, evaluating to true or false at that initial expansion; if it is false, the operation will not add that item. The details of these operations are below: h3. The add_database_fields Operation This operation adds one or more database fields to a profile. It contains a subnode "fields", each of whose subnodes is a database field to add to the profile. The database fields are added to the database.fields section of the profile. If some subnodes of the field node are not specified, standard defaults are used. If a main_table exists in the profile database, the database fields are added to that table. h3. The add_database_filters Operation This operation adds one or more database filters to a profile. It contains a subnode "filters", each of whose subnodes is a database filter to add to the profile. The database filter node layout is described [here|Database Table Filters Node Layout]. After adding the filters, if there is a main_table in the profile database, it runs the filters against all rows of the main_table. h3. The add_log_fields Operation This operation adds one or more log fields to a profile. It contains a subnode "fields", each of whose subnodes is a log field to add to the profile. The database fields are added to the database.fields section of the profile. If some subnodes of the field node are not specified, standard defaults are used. h3. The add_log_filters Operation This operation adds one or more log filters to a profile. It contains a subnode "filters", each of whose subnodes is a log filter to add to the profile. The log filter node layout is described here. If the subnode for a filter contains an add_position subnode, the filter is added at the integer position specified; otherwise it it added to the end of the log filters list. \\ h3. The add_log_filter_initializations Operation This operation adds one or more log filter initializations to a profile. It contains a subnode "log_filter_initializations", each of whose subnodes is a log filter initialization to add to the profile. h3. The add_log_filter_finalizations Operation This operation adds one or more log filter finalizations to a profile. It contains a subnode "log_filter_finalizations", each of whose subnodes is a log filter finalization to add to the profile. \\ h3. The add_report_fields Operation This operation adds one or more report fields to a profile. It contains a subnode "fields", each of whose subnodes is a report field to add to the profile. The report fields are added to the statistics.report_fields section of the profile. h3. The add_xref_fields Operation This operation adds one or more fields to the xref tables of a profile. It contains a subnode "xref_group" whose value is a wildcard pattern which is matched against the node names of xref groups to determine which will be affected--those that match will have the specified fields added. It contains a subnode "fields", each of whose subnodes specifies the name of a field to add to the xrefs groups (the name of the subnode is the name of the field to add). If an affected xref table exists in the database, it is dropped and marked as needing to be rebuilt. h3. The add_xref_groups Operation This operation adds one or more xref groups to a profile. It contains a subnode "xref_groups" which contains xref group nodes as they would appear in the profile, and which are copied directly to the profile. In addition, each xref group node may contain a subnode add_all_aggregating_fields, which if true or absent, causes all aggregating database fields corresponding to report fields where include_field_in_reports_by_default=true, to be added to the xref group. h3. The add_report_element_columns Operation This operation adds one or more fields to the report elements of a profile. It contains a subnode "report" and a subnode "report_element" whose values are wildcard patterns which are matched against the node names of reports and report elements to determine which will be affected--report element will have the specified fields added if the report element node name matches the specified report_element pattern, and the report node name matches the specified report_element pattern. It contains a subnode "columns", each of whose subnodes is a column node to be added to the report element. h3. The add_reports Operation This operation adds one or more reports and report elements a profile. It contains a "reports" subnode, whose values are report nodes as in a profile. However, nearly any option can be omitted, and will be given a default value when copying the option into the report. The required parameters are sort_by for report elements, and report_field for report element columns. If a value is of the format "variable:_fieldname_", it will be converted to the value of the database filter variable _fieldname_ when it is written to the profile. The top-level add_reports node also contains a "reports_menu" subnode, which has one item for each top-level report or group in the reports menu. Each of the group items must have an "items" subnode, and within it, items for second-level reports. I.e., this node layout is identical to reports_menu in a profile. A special value of "top_level" for a report group, causes the reports in that group to be put in the top level of the menu (not in any group). The following values, if present, will be copied from a report element in the snapon, to a report element in the profile: label, show_header_bar, header, footer, date_filter.df, filter.expression, table_filter_expression. If a "columns" node is present (i.e., if it's a table reports), the following values, if present, will be copied from a report element in the snapon, to a report element in the profile:omit_parenthesized_items, use_overview_for_totals, report_field, show_graphs, show_table, sort_by, sort_direction, show_remainder_row, show_averages_row, show_min_row, show_max_row, show_totals_row. If the report element type is of type sessions_overview, the following values must be present, and will be copied from a report element in the snapon, to a report element in the profile: session_user_field, session_date_time_field, session_id_field, session_duration_field, session_events_field, session_entrances_field, session_exits_field. If the report element type is of type session_paths, the following values must be present, and will be copied from a report element in the snapon, to a report element in the profile: session_user_field, session_sequence_number_field, session_id_field, session_page_field. If the report element type is of type session_page_paths, the following values must be present, and will be copied from a report element in the snapon, to a report element in the profile: session_page_field, session_date_time_field, session_id_field, session_entrances_field, session_exits_field. h3. The add_snapons Operation This operation adds one or more snapons to a profile. It contains a subnode "snapons", each of whose subnodes is a snapon information node, intended to be overlaid over the target snapon, and passed to attach_snapon() to attach the snapon with the specified parameters. \\ h3. The edit_profile_node Operation This operation changes the value of a single node in the profile. It contains a subnode "node" which is the relative nodepath in the profile of the node to edit, and a subnode "new_value" which is the new value of the node; it sets the specified node to the specified value. \\ h3. The execute_expression Operation This operation executes a Salang expression. It contains a subnode "expression" which is a string containing the Salang expression to execute. This is not reversible. \\ \\ ...