Example of a Rollout Wizard:

This section presents an example of a Rollout Wizard. The wizard is used for setting up an Internet connection.

In the first section, the wizard defines the text that the device provides for display on the various HTML pages.

stringtable "German"
 string title_MyCompany, "MyCompany Rollout"
 string txt_Welcome, "Welcome to the MyCompany Rollout Wizard"
 string dev_serial_number, "Serial number"
 string dev_type, "Device type"
 ;---Page: What type of connection string inet_Selection, "Internet connection type" string inet_PPPoE, "PPPoE" string inet_IPoE, "IPoE" ;---Page: IPoE
 string inet_ipoe, "Please enter the details for the connection."
 string con_ipaddress,     "IP address"
 string con_subnet,        "Net mask"
 string con_gateway,       "Gateway"
 string con_dns,           "DNS"
 ;---Page: PPPoE
 string inet_pppoe, "Please enter your username and password."
 con_username string,      "username"
 string con_password,      "password"
 --- Page: End
 string end,              "The configuration is now complete."

The wizard starts the first line of the next section with the name 'MyCompany Rollout'. The device displays the text string str.title_MyCompany as the title of the HTML page.

The wizard then defines the sections, which correspond to the required HTML pages.

The 'Start' section first shows a static greeting text. Below that, the Wizard has two read-only fields that display the device type and serial number. The wizard reads out these two values from the device using the field on_show when it opens the page. The wizard offers the user a selection of options for the Internet connection, either 'PPPoE' or 'IPoE'. Since no values are defined for the option fields, the wizard sets the variable select_inet according to the user's selection, e.g. PPPoE to '0' and IPoE to '1'.

wizard "MyCompany Rollout", str.title_MyCompany

section ;---Start---
 static_text    str.txt_Welcome

 readonly_text device_string
  description   str.dev_type
 readonly_text device_serial_number
  description   str.dev_serial_number
  
 selection_buttons select_inet
  description   str.inet_Selection
  button_text   str.inet_PPPoE, str.inet_IPoE

 on_show
  set wizard.device_string, device.DeviceString
  set wizard.device_serial_number, device.SerialNumber
 
 on_next 

The wizard only displays the IPoE section if the variable select_inet is set to the value '1'.

On this page, the wizard asks the user to provide values for the IP address, netmask, gateway and DNS server. All fields are required to run the wizard.

section ;---IPoE---
 only_if wizard.select_inet, "1", equal
 
 static_text   str.inet_ipoe
 
 entryfield_ipaddress inet_ipaddress
  description  str.con_ipaddress
  never_empty  1
 entryfield_ipaddress inet_subnet
  description  str.con_subnet
  never_empty  1  
 entryfield_ipaddress inet_gateway
  description  str.con_gateway   
  never_empty  1
 entryfield_ipaddress inet_dns
  description  str.con_dns  
  never_empty  1 

The wizard only displays the PPPoE section if the variable select_inet is set to the value '0'.

On this page of the wizard prompts the user for the user name and password, each with a maximum length of 30 characters.

section ;---PPPoE---
 only_if wizard.select_inet, "0", equal  

 static_text   str.inet_pppoe
 
 entryfield_text inet_username
  description  str.con_username
  max_len   30
 entryfield_text inet_password
  description  str.con_password
  max_len   30 
The last page of the wizard initially displays a summary in static text. Follow-up actions are carried out when the wizard is finished:
section ;---ende---
 static_text   str.ende
     
on_init  ;---Befehle, die bei der Initialisierung des Wizards durchgeführt werden.---

on_apply ;---Befehle, die bei der Fertigstellung des Wizards durchgeführt werden.---

 ;---Wenn IPoE ausgewählt wurde, werden die entsprechenden Daten nun eingetragen.
 ;---Remote site
 set config.1.2.2.19, "INTERNET", "9999", "", "", "IPOE", "0", "000000000000"
 only_if wizard.select_inet, "1", equal
 ;---IP-Parameter
 set config.1.2.2.20, "INTERNET", wizard.inet_ipaddress, wizard.inet_subnet, "0.0.0.0", wizard.inet_gateway, wizard.inet_dns, "0.0.0.0", "0.0.0.0", "0.0.0.0"
 only_if wizard.select_inet, "1", equal

 ;---If PPPoE was selected, the corresponding data is entered.
 ;---Remote site
 set config.1.2.2.19, "INTERNET", "9999", "", "", "PPPOE", "0", "000000000000"
 only_if wizard.select_inet, "0", equal
 ;---PPP list
 set config.1.2.2.5, "INTERNET", "none", "60", wizard.inet_password, "5", "5", "10", "5", "2", wizard.inet_username, "1"
  only_if wizard.select_inet, "0", equal

 ;---Set the default route. 
 set config.1.2.8.2, "255.255.255.255", "0.0.0.0", "0", "INTERNET", "0", "on", "Yes", "" 

www.lancom-systems.com

LANCOM Systems GmbH | A Rohde & Schwarz Company | Adenauerstr. 20/B2 | 52146 Wuerselen | Germany | E‑Mail info@lancom.de

LANCOM Logo