### Handle Installation Redirect Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Handles the redirection to the installation page when an installation is initiated. It uses the 'form.install' variable to determine the package to install. ```XML ``` -------------------------------- ### Installation Confirmation Buttons Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/install.txt Presents the user with confirmation buttons ('Yes' and 'No') to proceed with or cancel the package installation. ```roxen Yes     No ``` -------------------------------- ### Package Update and Return Link Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/install.txt Updates the installed package and provides a link to return to the update page if the 'yes' form variable is set. ```roxen
[Return]
``` -------------------------------- ### Install Roxen MIB Data Queries for Cacti Source: https://github.com/pikelang/roxen/blob/devel/server/tools/cacti/README.txt This snippet details the installation of Roxen MIB data query files into the Cacti installation directory. The XML files 'roxen-mib_core.xml' and 'roxen-mib_feed.xml' need to be copied to the 'resource/snmp_queries' folder. ```bash Copy "roxen-mib_core.xml" and "roxen-mib_feed.xml" to the "resource/snmp_queries" directory in the cacti installation, this is typically the following directory: /usr/share/cacti/resource/snmp_queries ``` -------------------------------- ### Handle Package Installation/Uninstallation (Pikelang) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/details.txt Manages the package installation and uninstallation process using Pikelang's conditional logic based on download and installation status. It generates hidden input fields and submit buttons for user actions. ```Pikelang ``` -------------------------------- ### Handle Download Start and Redirect Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Initiates the download of a package and then redirects the user to a status page. It uses 'form.download' to trigger the download and 'form.details' to specify the package. ```XML ``` -------------------------------- ### Display Package Details Table Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/install.txt Displays detailed information about a package, including description, organization, author, license, and date, using the 'item' definition. ```roxen Description Organization Author License Date
``` -------------------------------- ### Define Package Item Structure Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/install.txt Defines a reusable structure for displaying package item details, conditionally formatting preformatted text. ```roxen &_.title;:
``` -------------------------------- ### Toggle Package Contents Visibility Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/install.txt Provides a submit button to toggle the visibility of package contents. If 'show' is true, it displays a 'Hide' button; otherwise, it shows an 'Show' button. ```roxen Hide package contents

The following files will be installed:
Size   Path
&_.size;   &_.path;
Show package contents ``` -------------------------------- ### Conditional Redirection Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/install.txt Redirects the user to 'update.html' if the 'no' form variable is set, indicating a cancellation or negative response. ```roxen ``` -------------------------------- ### Define Downloaded Packages Display Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Defines the structure for displaying a list of already downloaded packages. It includes the package title, size, and an option to install the package. ```XML &_.title; [Details...] &_.size; [Install...] ``` -------------------------------- ### Roxen Configuration Interface Boxes Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Information on creating custom 'content boxes' for the Roxen configuration interface. Users can find examples and instructions in the _config_interface/boxes_ directory. ```Roxen &_.name; &_.contents:none; ``` -------------------------------- ### Locate File in Virtual Filesystem (RXML) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Illustrates the use of the 'locate' argument within the '' or '' tags. This feature searches for a specified file starting from the current directory and moving upwards in the virtual filesystem hierarchy. ```RXML ``` ```RXML ``` -------------------------------- ### Pike Thread Creation Example Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Demonstrates how to create a new thread in Pike. The function provided as an argument to thread_create is executed in a separate thread, allowing for concurrent operations. This example shows a simple thread that continuously writes a message and sleeps. ```Pike thread_create() { while( 1 ) { write("I am a thread\n"); sleep( 1 ); } }; ``` -------------------------------- ### Send Game State Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/mastermind.html This function constructs a string representing the current game state, including turn number and color selections, and then redirects the user to a masterminds HTML page with these parameters. It also handles optional parameters. ```javascript function send() { var ret=""; turn++; for(var i = 1; i < 7; i++) ret+=arrej[i]; top.location="mastermind.html?turn="+turn+"&or"+turn+"="+ret+old+"&q="+quest+"&&usr.set-wiz-id;"; } ``` -------------------------------- ### Update Package List and Scan Local Packages Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Triggers an update of the package list from the main server and then scans for locally installed packages. This ensures the system has the latest package information. ```XML Launched a package list update request.
``` -------------------------------- ### Shift Image Color Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/mastermind.html This function shifts the color of an image based on its index. It handles a bug in Internet Explorer and cycles through a predefined array of colors. The image source is updated dynamically. ```javascript function tomArrej() { for(var i = 0; i < 7; i++) this[i] = 0; } arrej = new tomArrej(); colors = new tomArrej(); colors[0] = "white"; colors[1] = "blue"; colors[2] = "green"; colors[3] = "yellow"; colors[4] = "purple"; colors[5] = "red"; function shiftColor(imgName) { if(buggy_image_counter) imgName--; arrej[imgName] = (arrej[imgName]+1)%6; document [imgName].src = "/internal-roxen-pixel-" + colors[arrej[imgName]]; } ``` -------------------------------- ### Populate Package Information Fields (Pikelang) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/details.txt Populates various package information fields such as description, size, author, and license using the 'item' definition and Pikelang's translate and update-package directives. ```Pikelang Description Size Organization Author License Date
``` -------------------------------- ### Pike Class Definition Comparison Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Compares two equivalent ways to define a class in Pike. The first shows a traditional definition with explicit member declarations and a create method. The second demonstrates a more concise syntax using constructor arguments with access specifiers. ```Pike class Foo { int a; protected string b; protected void create(int _a, string _b) { a = _a; b = _b; } } ``` ```Pike class Foo(int a, protected string b) { } ``` -------------------------------- ### Configure Roxen Device in Cacti Source: https://github.com/pikelang/roxen/blob/devel/server/tools/cacti/README.txt This snippet outlines the configuration steps for adding a Roxen device to Cacti for monitoring. It specifies the necessary parameters such as Description, Hostname, Host Template, SNMP Community, and SNMP Port. ```bash Description: "PRINT example.roxen.com" Hostname: "example.roxen.com" Host Template: "Roxen MIB - Editorial Portal" SNMP Community: "public" SNMP Port: "16180" ``` -------------------------------- ### Roxen Image Cropping and Padding Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Details on image manipulation parameters in Roxen, specifically 'span-width' and 'span-height' for padding smaller images, and 'crop=guides-cross' with 'guides-index' for cropping around specific points or regions. These are useful for thumbnail generation. ```Roxen span-width=200 span-height=150 ``` ```Roxen crop=guides-cross guides-index=100,100 ``` ```Roxen crop=guides-region guides-index=50,50-150,150 ``` -------------------------------- ### Define Download Progress Display Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Defines the structure for displaying the progress of ongoing package downloads. It shows the package title, a link to details, size, and download progress percentage. ```XML &_.title; [Details...] &_.size; &_.progress;% ``` -------------------------------- ### Calculate Page Download Time (Roxen Module) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Provides a tag, '', that estimates the download time for a web page, considering factors like inline images and HTTP headers, across different connection speeds. ```Roxen ``` -------------------------------- ### Display Download Progress and Downloaded Packages Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Combines and displays information about packages currently downloading and those already downloaded. It conditionally shows these sections if there are more than 4 items in each list, and a horizontal rule if the combined list exceeds 8 items. ```XML
Downloads in progress &var.dip:none;
Description Size Downloaded
Downloaded packages &var.dp:none;
Description Size
``` -------------------------------- ### Automatically Use Package (Roxen Module) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html This module automatically includes a specified package before any RXML parsing occurs. It's useful for template files where common tags and variables need to be available globally. ```Roxen Automatically a package before parsing files. ``` -------------------------------- ### Define Package Item Structure (Pikelang) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/details.txt Defines the structure for displaying package item details, including conditional formatting for 'pre' type items. It uses Pikelang's templating and variable insertion. ```Pikelang &_.title;:
``` -------------------------------- ### Toggle Table and Image Borders (Roxen Module) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html A utility module for HTML authors that allows toggling the visibility of table borders and image borders using a prestate, aiding in layout design and debugging. ```Roxen toggle the viewing of table and image borders using a prestate ``` -------------------------------- ### ROXEN-MIB Definitions Source: https://github.com/pikelang/roxen/blob/devel/server/etc/ROXEN-MIB.txt This snippet contains the complete definitions for the ROXEN-MIB, including imports from SNMPv2-SMI and definitions for object identifiers, object types, and sequences related to the Roxen web server's management information. ```ASN.1 ROXEN-MIB DEFINITIONS ::= BEGIN IMPORTS enterprises, Integer32, IpAddress, Counter32, Gauge32, Unsigned32, TimeTicks, Opaque, Counter64 FROM SNMPv2-SMI ; roxenis OBJECT IDENTIFIER ::= { enterprises 8614 } app OBJECT IDENTIFIER ::= { roxenis 1 } webserver OBJECT IDENTIFIER ::= { app 1 } sites OBJECT-TYPE SYNTAX SEQUENCE OF Site ACCESS not-accessible STATUS current DESCRIPTION "The table of sites in the server." INDEX { siteNumber } ::= { webserver 2 } Site ::= SEQUENCE { siteNumber INTEGER, siteName OCTET STRING, comment OCTET STRING, sentBytes Counter64, receivedBytes Counter64, sentHeaders Counter64, numRequests Counter64, moduleTable SEQUENCE OF moduledata ModuleData } siteNumber OBJECT-TYPE SYNTAX INTEGER ACCESS read-only STATUS current DESCRIPTION "The number identifying the site in the server." ::= { sites 1 } siteName OBJECT-TYPE SYNTAX OCTET STRING ACCESS read-only STATUS current DESCRIPTION "The display name of the site." ::= { sites 2 } comment OBJECT-TYPE SYNTAX OCTET STRING ACCESS read-only STATUS current DESCRIPTION "The comment for the site." ::= { sites 3 } sentBytes OBJECT-TYPE SYNTAX Counter64 ACCESS read-only STATUS current DESCRIPTION "The number of bytes sent." ::= { sites 4 } receivedBytes OBJECT-TYPE SYNTAX Counter64 ACCESS read-only STATUS current DESCRIPTION "The number of bytes received." ::= { sites 5 } sentHeaders OBJECT-TYPE SYNTAX Counter64 ACCESS read-only STATUS current DESCRIPTION "The number of bytes of received headers." ::= { sites 6 } numRequests OBJECT-TYPE SYNTAX Counter64 ACCESS read-only STATUS current DESCRIPTION "The number of requests handled." ::= { sites 7 } modules OBJECT-TYPE SYNTAX SEQUENCE OF Module ACCESS not-accessible STATUS current DESCRIPTION "The table of modules in the server." INDEX { siteNumber moduleIdentifier moduleCopy } ::= { sites 8 } Module ::= SEQUENCE { stdModuleInfo SEQUENCE OF StdModuleInfo, customModuleInfo OBJECT } stdModuleInfo OBJECT IDENTIFIER ::= { modules 1 } customModuleInfo OBJECT-TYPE SYNTAX SEQUENCE OF OBJECT ACCESS not-accessible STATUS current DESCRIPTION "Custom module-specific data." INDEX { moduleIdentifier siteNumber moduleCopy } ::= { modules 2 } StdModuleInfo ::= SEQUENCE { moduleCopy INTEGER, moduleIdentifier OCTET STRING, moduleType INTEGER, moduleVersion OCTET STRING } moduleCopy OBJECT-TYPE SYNTAX INTEGER ACCESS read-only STATUS current DESCRIPTION "The module copy number in this site." ::= { stdModuleInfo 1 } moduleIdentifier OBJECT-TYPE SYNTAX OCTET STRING ACCESS read-only STATUS current DESCRIPTION "The module identifier." ::= { stdModuleInfo 2 } moduleType OBJECT-TYPE SYNTAX INTEGER ACCESS read-only STATUS current DESCRIPTION "The module type." ::= { stdModuleInfo 3 } moduleVersion OBJECT-TYPE SYNTAX OCTET STRING ACCESS read-only STATUS current DESCRIPTION "The module version." ::= { stdModuleInfo 4 } END ``` -------------------------------- ### Pike: Regular Expression Matching Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Illustrates the use of regular expressions for pattern matching in Pike. It shows how to find all occurrences of a pattern within a list of strings. ```Pike Regexp("[0-9]+")->match( ({ "hello", "12", "foo17" }) ); ``` -------------------------------- ### Create RXML Tag Set (Old Method) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html This snippet demonstrates the previous method for creating RXML tag sets in Roxen modules using Pike. It highlights the use of a potentially non-unique string identifier. ```Pike RXML.TagSet internal = RXML.TagSet("TagFoldlist.internal", ({ TagFT(), TagFD() }) ); ``` -------------------------------- ### Pike: Type Checking and Conditional Logic Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Demonstrates how to check the type of a variable and use conditional logic based on its value. It also shows how to cast values and print output. ```Pike constant boolean = typeof(0)|typeof(1); boolean flag = 1; int main( int argc, array(string) argv ) { flag = (argc>1)?(int)argv[1]:flag; write( "Type of flag is %O\n", typeof(flag) ); write( "Value of flag is %O\n", flag ); return 0; } ``` ```Pike typedef int(0..1) boolean; boolean flag = 1; int main( int argc, array(string) argv ) { flag = (argc>1)?(int)argv[1]:flag; write( "Type of flag is %O\n", typeof(flag) ); write( "Value of flag is %O\n", flag ); return 0; } ``` ```Pike enum boolean { false,true } boolean flag = true; ``` -------------------------------- ### Display Package Categories Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Displays different categories of packages available for update, including general products, security fixes, bug fixes, and third-party modules. It uses the 'cat-list' component for each category. ```XML Products Security fixes Bug fixes Third party modules ``` -------------------------------- ### Create RXML Tag Set (New Method) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html This snippet illustrates the updated method for creating RXML tag sets in Roxen modules with Pike. It shows the use of the module itself and a module-specific identifier, addressing previous uniqueness and encoding concerns. ```Pike RXML.TagSet internal = RXML.TagSet(this_module(), "foldlist", ({ TagFT(), TagFD() }) ); ``` -------------------------------- ### Import Roxen MIB Host Template for Cacti Source: https://github.com/pikelang/roxen/blob/devel/server/tools/cacti/README.txt This snippet describes the process of importing the Roxen MIB host template into Cacti. It involves using Cacti's 'Import Templates' function with the provided XML file. ```bash Import the "cacti_host_template_roxen_mib_editorial_portal.xml" file into cacti via the "Import Templates" function. ``` -------------------------------- ### New Entities in RXML (RXML) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Introduces new entities like '&unique-id;' and '&client.session;' to facilitate the creation of session-driven applications with minimal effort. ```RXML &unique-id; ``` ```RXML &client.session; ``` -------------------------------- ### Generate Robots.txt On Demand (Roxen Module) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html A Roxen module that dynamically generates a robots.txt file based on various available information, likely including server configuration and site content. ```Roxen Generates a robots.txt on demand ``` -------------------------------- ### Pike SQL Query with Parameterization Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Demonstrates how to perform SQL queries in Pike using sprintf-style formatting for automatic, database-specific quoting of parameters. This prevents SQL injection vulnerabilities and simplifies query construction. ```Pike db->query("SELECT * FROM things WHERE id > %d AND name LIKE %s", lowest, pattern); ``` -------------------------------- ### Handle Package Uninstallation Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Handles the uninstallation of a specified package. It uses the 'form.uninstall_package' variable to identify the package to be removed. ```XML ``` -------------------------------- ### Set Variable with Container Tag (RXML) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Demonstrates how to set a variable using RXML's container tag syntax. The value assigned to the variable is the content enclosed within the opening and closing tags. ```RXML bar ``` -------------------------------- ### Define Package Category List Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Defines a reusable component to display a list of packages within a specific category. It includes functionality to update packages, display details, and manage package lists. ```XML
&_.title;
&_.title; [Details...]   Currently no packages in this category.
[More..]
 
``` -------------------------------- ### RXML Caching with Nested Tags (RXML) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Demonstrates how the RXML '' tag handles nested '' and '' tags. It allows for caching parts of RXML code while keeping other sections dynamic. ```RXML ... RXML code ... ... dynamic content ... ... more RXML code ... ``` -------------------------------- ### Roxen RXML User Authentication Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Demonstrates how to use user and group authentication from the htaccess module within RXML pages using the '' directive. This allows for conditional content display based on authenticated users. ```RXML ``` -------------------------------- ### RXML Cache with Variable Assignment (RXML) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Illustrates using the '' tag in RXML to assign the result of a costly operation (like an SQL query) to a variable, which can then be used outside the cache block for dynamic formatting. ```RXML sql_query_result

Data: &cached_data;

``` -------------------------------- ### Highlight Words in HTML Pages (Roxen Module) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html A module designed to highlight specific words within HTML pages. It typically uses a form variable named 'highlight' to determine which words to emphasize, often for search engine result presentation. ```Roxen Highlights the words stored in the form variable highlight ``` -------------------------------- ### Update Package Details Table (Pikelang) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/details.txt Updates the package details table with a title row, using Pikelang's update-package directive and user-defined color variables. ```Pikelang
&_.title;
``` -------------------------------- ### Operating System Calls Module in Pike Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html A new module provides access to various operating system calls previously available as efuns. These include functions like hardlink, symlink, resolvepath, umask, chmod, chown, and chroot. These efuns will be moved to compat mode in the future but remain accessible via the system module. ```Pike system->hardlink("old_path", "new_path"); system->chmod("file.txt", 0777); ``` -------------------------------- ### Roxen Caching with RXML Context Set Misc Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Illustrates using RXML_CONTEXT->set_misc within a cache tag to manage state changes that the cache system can track. This method keeps variables internal and not user-accessible. ```RXML ... ``` ```Pike RXML_CONTEXT->set_misc("my_value", "foo") ``` -------------------------------- ### Pike Version Compatibility Directive Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Illustrates the use of the #pike preprocessor directive to specify the Pike version a script is intended for. This allows the interpreter to apply appropriate compatibility features, ensuring older scripts run correctly on newer versions and vice-versa. ```Pike #pike 7.0 ``` -------------------------------- ### Roxen Caching with RXML Set Variable Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Demonstrates how to use RXML.set_var within a cache tag to ensure variable assignments are reapplied when cached content is reused. This method makes variables user-accessible. ```RXML ... ``` ```Pike RXML.set_var("my_value", "foo", "var") ``` -------------------------------- ### Access Form Variables by Index (RXML) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Shows how to access multiple form variables with the same name by using an index. This allows for iterating through or selecting specific instances of repeated form fields. ```RXML &form.file.1; ``` ```RXML &form.file.2; ``` -------------------------------- ### Display Last Updated Information Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/update/index.txt Displays the time elapsed since the last synchronization with the main server. This provides users with information about the freshness of the package data. ```XML This information was last synchronized with the main server &var.last_updated; ago. ``` -------------------------------- ### Pike: Class Inheritance and Method Overriding Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Demonstrates class inheritance and method overriding in Pike. It shows how a derived class can inherit and modify behavior from a base class. ```Pike class A { int foo() { return 1; } int bar() { return foo(); } int baz() { return local::foo(); } } class B : A { int foo() { return 2; } } B()->bar(); B()->baz(); ``` -------------------------------- ### RXML Expression Evaluation (RXML) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html The 'expr' argument in RXML now supports more complex expressions, including type conversions and the use of complex data types, enhancing the flexibility of expression evaluation. ```RXML expr argument (expression evaluation) ``` -------------------------------- ### URL Backslash Stripping (Roxen) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html The '--strip-backslash' option transforms all backslashes ('\') in a URL to forward slashes ('/'). This is primarily for NT compatibility on Unix systems. ```Roxen --strip-backslash ``` -------------------------------- ### Pike Labeled Loops with Break and Continue Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew-pike.html Shows how to use labeled loops in Pike, allowing 'break' and 'continue' statements to reference specific loops by name. This enhances control flow within nested loops, enabling more precise exit or iteration skipping. ```Pike int a, b; foo: for (int i = 1; i <= 4; i++) { a = i; switch (1) { case 1: if (i >= 3) break foo; if (i >= 2) continue foo; } b = i; } return ({a, b}); // Returns ({3, 1}) ``` -------------------------------- ### Generate Pixel with Color Name (Roxen) Source: https://github.com/pikelang/roxen/blob/devel/server/config_interface/whatsnew.html Generates a 1x1 pixel image with a specified color. The color can be defined by a symbolic name (e.g., 'darkgreen') or an RGB value (e.g., '0000ff'). This functionality is part of the internal Roxen server processing. ```Roxen /internal-roxen-pixel-colorname ``` ```Roxen /internal-roxen-pixel-red ``` ```Roxen /internal-roxen-pixel-ff0000 ```