home *** CD-ROM | disk | FTP | other *** search
/ Thomson (Residential) / TGSTPv7203.iso / mac / HIW / xml / mod_profilecheck.xml < prev    next >
Extensible Markup Language  |  2008-02-11  |  9KB  |  178 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE fsm SYSTEM "fsm.dtd">
  3. <!-- Checks for profiles and whether or not to reconfigure the device. -->
  4. <!-- 
  5.     Checks for profiles and whether or not to reconfigure the device.
  6.     First, this module looks for template files. If none are found, we finish
  7.     with event 'noSetup'.
  8.     If template files are found, the device will be checked.
  9.     Depending on the value of the device state (already configured or not) and 
  10.     the reconfigure property, the reconfigure page is shown or not.
  11.     If the device will be reconfigured, the template files are validated. If no
  12.     valid/compatible templates are found, we finish    with event 'noSetup'. If one 
  13.     is found, we finish with event 'setup'. If multiple valid templates are
  14.     found, the user will be able to select one. On the select page, there's also
  15.     the possibility to select a template on another location.
  16.  
  17.     Input properties:
  18.     - reconfigure: What to to when the device is already configured:
  19.         - never: don't reconfigure
  20.         - user: let the user choose to reconfigure or not
  21.         - always: reconfigure without question.
  22.     - templatePath: Absolute path where the templates reside. (required)
  23.  
  24.     Output properties:
  25.   - selectedProfile: The found/selected profile object.
  26.  
  27.   Exit events:
  28.   - setup: Program can proceed with device setup.
  29.   - noSetup: Device setup is not desired.
  30. -->
  31.  
  32. <fsm>
  33.     <property key="reconfigure" required="yes"/>
  34.     <property key="templatePath" required="yes"/>
  35.     <states>
  36.         <state type="profileCheck_deviceConfigured" name="checkDeviceConfigured"/>
  37.         <state type="showButtonPage" name="pageReconfig">
  38.             <property key="backEnabled" value="1"/>
  39.             <property key="nextEnabled" value="1"/>
  40.             <property key="registerPage" value="1"/>
  41.             <property key="title" value="tr(Configuration of your Thomson Gateway)"/>
  42.             <property key="subTitle" value=""/>
  43.             <property key="info" value="tr(Your Thomson Gateway has been configured before. If you want to reconfigure it, choose Yes, otherwise No.)"/>
  44.             <property key="button1Text" value="tr(Yes)"/>
  45.             <property key="button1Info" value="tr(Any existing configuration will be removed and a new configuration will be applied to your Thomson Gateway.)"/>
  46.             <property key="button2Text" value="tr(No)"/>
  47.             <property key="button2Info" value="tr(The existing configuration will NOT be changed.)"/>
  48.         </state>
  49.         <state type="compare" name="checkReconfig"/>
  50.         <state type="countFiles" name="searchProfilesBasic">
  51.             <property key="fileFilter" value="SW_BAS*.tpl"/>
  52.         </state>
  53.     <state type="countFiles" name="searchProfiles">
  54.       <property key="fileFilter" value="*.tpl"/>
  55.     </state>
  56.     <state type="profileCheck_readProfiles" name="readProfilesBasic"/>
  57.     <state type="compare" name="checkFoundProfilesBasic">
  58.       <property key="input1" value="2"/>
  59.       <property key="type" value="number"/>
  60.       <property key="operator" value="equal"/>
  61.     </state>
  62.     <state type="showUiPage" name="showBasic">
  63.       <property key="fileName" value="ui/profileselection.ui"/>
  64.       <property key="registerPage" value="1"/>
  65.      </state>
  66.     <state type="switch" name="checkSelection">
  67.       <property key="outputs" value="ppp;bridging;advanced"/>
  68.     </state>
  69.     <state type="profileCheck_readProfiles" name="readProfiles"/>
  70.     <state file="mod_selectprofile.xml" name="pageSelectProfile"/>
  71.     </states>
  72.     <events>
  73.         <event name="setup"/>
  74.         <event name="noSetup"/>
  75.     </events>
  76.     <transitions>
  77.         <transition startstate="checkDeviceConfigured">
  78.             <propertymap target="device" function="$app.device"/>
  79.             <propertymap target="reconfigure" function="$fsm.reconfigure"/>
  80.         </transition>
  81.         <!-- don't reconfigure device -->
  82.         <transition fromstate="checkDeviceConfigured" toexit="noSetup" event="noReconfigure"/>
  83.         <!--  ask user to reconfigure device -->
  84.             <!-- show reconfig page -->
  85.             <transition fromstate="checkDeviceConfigured" tostate="pageReconfig" event="askReconfigure">
  86.                 <propertymap target="default" function="$app.pageReconfig.defaultSelection"/>
  87.             </transition>
  88.             <!-- check $selection == 2 (= no reconfigure) -->
  89.             <transition fromstate="pageReconfig" tostate="checkReconfig" event="pageNext">
  90.                 <propertymap target="comparisonType" function="equal"/>
  91.                 <propertymap target="input1" function="$selection"/>
  92.                 <propertymap target="input2" function="2"/>
  93.             </transition>
  94.             <!-- No selected -->
  95.             <transition fromstate="checkReconfig" toexit="noSetup" event="true"/>
  96.             <!-- Yes selected -->
  97.             <transition fromstate="checkReconfig" tostate="searchProfilesBasic" event="false">
  98.                 <propertymap target="path" function="$fsm.templatePath"/>
  99.             </transition>
  100.         <!-- reconfigure device without asking -->
  101.         <transition fromstate="checkDeviceConfigured" tostate="searchProfilesBasic" event="reconfigure">
  102.             <propertymap target="path" function="$fsm.templatePath"/>
  103.         </transition>
  104.  
  105.     <transition fromstate="searchProfilesBasic" tostate="searchProfiles" event="noFilesFound|singleFileFound">
  106.       <propertymap target="path" function="$fsm.templatePath"/>
  107.     </transition>
  108.  
  109.     <transition fromstate="searchProfiles"  tostate="readProfiles" event="noFilesFound|singleFileFound|multipleFilesFound">
  110.       <propertymap target="device" function="$app.device"/>
  111.       <propertymap target="profileNameList" function="$fileList"/>
  112.       <propertymap target="fsm.profileNameList" function="$fileList"/>
  113.       <propertymap target="confProvider" function="'*'"/>
  114.       <propertymap target="confService" function="'*'"/>
  115.     </transition>
  116.  
  117.     <transition fromstate="searchProfilesBasic" tostate="readProfilesBasic" event="multipleFilesFound">
  118.       <propertymap target="device" function="$app.device"/>
  119.       <propertymap target="profileNameList" function="$fileList"/>
  120.       <propertymap target="fsm.profileNameList" function="$fileList"/>
  121.       <propertymap target="confProvider" function="'Basic'"/>
  122.     </transition>
  123.  
  124.     <transition fromstate="readProfilesBasic" tostate="checkFoundProfilesBasic" event="multipleProfiles">
  125.       <propertymap target="input2" function="$profileCount"/>
  126.     </transition>
  127.  
  128.     <transition fromstate="readProfilesBasic" tostate="searchProfiles" event="noProfiles|singleProfile">
  129.       <propertymap target="path" function="$fsm.templatePath"/>
  130.     </transition>
  131.  
  132.     <transition fromstate="checkFoundProfilesBasic" tostate="showBasic" event="true">
  133.       <propertymap target="connectionType" function="ppp"/>
  134.     </transition>
  135.     
  136.     <transition fromstate="checkFoundProfilesBasic" tostate="searchProfiles" event="false">
  137.       <propertymap target="path" function="$fsm.templatePath"/>
  138.     </transition>
  139.  
  140.     <transition fromstate="showBasic" tostate="checkSelection" event="pageNext">
  141.       <propertymap target="input" function="$connectionType"/>
  142.     </transition>
  143.  
  144.     <transition fromstate="checkSelection" tostate="readProfiles" event="ppp">
  145.       <propertymap target="device" function="$app.device"/>
  146.       <propertymap target="profileNameList" function="$fsm.profileNameList"/>
  147.       <propertymap target="confProvider" function="'Basic'"/>
  148.       <propertymap target="confService" function="'Routed PPP'"/>
  149.     </transition>
  150.  
  151.     <transition fromstate="checkSelection" tostate="readProfiles" event="bridging">
  152.       <propertymap target="device" function="$app.device"/>
  153.       <propertymap target="profileNameList" function="$fsm.profileNameList"/>
  154.       <propertymap target="confProvider" function="'Basic'"/>
  155.       <propertymap target="confService" function="'Bridge'"/>
  156.     </transition>
  157.  
  158.     <transition fromstate="checkSelection" tostate="searchProfiles" event="advanced|default">
  159.       <propertymap target="path" function="$fsm.templatePath"/>
  160.     </transition>
  161.  
  162.     <!-- one valid profile -->
  163.     <transition fromstate="readProfiles" toexit="setup" event="singleProfile">
  164.       <!-- output --><propertymap target="fsm.profile" function="$profile"/>
  165.         </transition>
  166.         <!-- more valid profiles, show select profile page -->
  167.         <transition fromstate="readProfiles" tostate="pageSelectProfile" event="noProfiles|multipleProfiles">
  168.             <propertymap target="templatePath" function="$fsm.templatePath"/>
  169.             <propertymap target="defaultService" function="$fsm.defaultService"/>
  170.             <propertymap target="profileList" function="$profileList"/>
  171.         </transition>
  172.         <!--profile selected -->
  173.         <transition fromstate="pageSelectProfile" toexit="setup" event="finished">
  174.             <!-- output --><propertymap target="fsm.profile" function="$selectedProfile"/>
  175.         </transition>
  176.     </transitions>
  177. </fsm>
  178.