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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE fsm SYSTEM "fsm.dtd">
  3. <!--
  4. /*!
  5.   Description
  6.     Shows the setup device page. Does all necessary steps for actually configuring the device
  7.     over a wireless link.
  8.      - Upload language pack: if the application runs in another language than English, the
  9.        according language pack isn't already on the device and the file is available.
  10.      - Create user.ini from profile and upload.
  11.      - Rebooting the device.
  12.      - Restoring the wireless radiolink.
  13.      - Authenticating the device again.
  14.      - Configuring the interface on the host computer.
  15.     Possible errors are caught within the module.
  16.  
  17.     Input properties:
  18.     - profile: The profile object which will be finalized for upload. (required)
  19.   - newInterface: Interface object to which the host will be configured. (required)
  20.     properties to restore the radiolink _after_ setup:
  21.     - ssid: network ssid
  22.     - networkKey: network encryptionkey
  23.     - securityMode: encryption type
  24.     - adaptorManager: wireless adaptor manager
  25.   - languagePackPath: Absolute path where the language packs reside.
  26.     
  27.     Output properties:
  28.   - profile: The final profile object.
  29.  
  30.   Exit events:
  31.   - finished: Device is set up successfully.
  32. -->
  33.  
  34. <fsm>
  35.     <property key="profile" required="yes"/>
  36.     <property key="adaptorManager" required="yes"/>
  37.   <property key="newInterface" required="yes"/>
  38.     <property key="languagePackPath" required="yes"/>
  39.   <property key="ssid" required="yes"/>
  40.   <property key="securityMode" required="yes"/>
  41.     <property key="networkKey" required="yes"/>
  42.     <states>
  43.         <state type="taskPageFsm" name="setupFsm" weight="10">
  44.             <!-- required inputs -->
  45.             <property key="profile" required="yes"/>
  46.             <property key="languagePackPath" required="yes"/>
  47.           <property key="newInterface" required="yes"/>
  48.             <property key="adaptorManager" required="yes"/>
  49.           <property key="ssid" required="yes"/>
  50.           <property key="securityMode" required="yes"/>
  51.             <property key="networkKey" required="yes"/>
  52.             <!-- page configuration -->
  53.           <property key="task1" value="tr(Identification of gateway)" />
  54.           <property key="task2" value="tr(Configuration of gateway)" />
  55.           <property key="task3" value="tr(Configuration of wireless connection)" />
  56.           <property key="task4" value="tr(Verification of gateway configuration)" />
  57.           <property key="task5" value="tr(Configuration of computer)" />
  58.           <property key="autoContinue" value="yes"/>
  59.           <property key="autoContinueTime" value="1"/>
  60.           <!-- states -->
  61.           <states>
  62.             <state type="showTaskPage" name="showSetupTaskPage">
  63.               <property key="title" value="tr(Configuration of gateway)" />
  64.               <property key="subTitle" value="tr(Please wait, the wizard is setting up your Thomson Gateway and local network.)" />
  65.               <property key="helpText" value="tr(The wizard will automatically set up your Thomson Gateway through following tasks:)" />
  66.               <property key="registerPage" value="1"/>
  67.             </state>
  68.             <!-- discover device -->
  69.             <state type="actionDiscoverDevice" name="discover" weight="3">
  70.               <property key="taskId" value="1"/>
  71.               <property key="timeout" value="10000"/>
  72.             </state>
  73.             <!-- check device languages and decide to upload language pack -->
  74.             <state file="mod_setup_includefiles.xml" name="uploadIncludeFiles" weight="5">
  75.               <property key="taskId" value="2"/>
  76.             </state>
  77.             <!-- check device languages and decide to upload language pack -->
  78.             <state file="mod_setup_langpack.xml" name="uploadLangPack" weight="7">
  79.               <property key="taskId" value="2"/>
  80.             </state>
  81.             <!-- create the template and upload it -->
  82.             <state file="mod_setup_userini.xml" name="uploadTpl" weight="3">
  83.               <property key="taskId" value="2"/>
  84.             </state>
  85.             <!-- reboot -->
  86.             <state type="actionActivateConfig" name="activateConfig" weight="15">
  87.               <property key="taskId" value="2"/>
  88.               <property key="timeout" value="20000"/>
  89.             </state>
  90.             <!-- restore wireless link -->
  91.             <state type="configRadioLink" name="configLink" weight="1">
  92.               <property key="taskId" value="3"/>
  93.             </state>
  94.             <state type="waitRadioLink" name="waitForLink" weight="5">
  95.               <property key="taskId" value="3"/>
  96.               <property key="timeout" value="180"/>
  97.             </state>
  98.             <!--  authenticate -->
  99.             <state type="actionDiscoverDevice" name="reDiscover" weight="10">
  100.               <property key="taskId" value="4"/>
  101.               <property key="timeout" value="60000"/>
  102.             </state>
  103.             <state type="actionAuthenticateDevice" name="authenticate" weight="2">
  104.               <property key="taskId" value="4"/>
  105.               <property key="timeout" value="15000"/>
  106.             </state>
  107.             <state type="actionInvokeCli" name="invokeFinalCli">
  108.               <property key="taskId" value="4"/>
  109.             </state>
  110.             <!-- host configuration -->
  111.             <state file="mod_setup_hostconfig.xml" name="hostConfig" weight="10">
  112.               <property key="taskId" value="5"/>
  113.             </state>
  114.             <!-- retry mechanism -->
  115.             <state type="compare" name="checkRetry">
  116.               <property key="type" value="number"/>
  117.               <property key="comparisonType" value="smallerorequal"/>
  118.               <property key="input1" value="0"/>
  119.             </state>
  120.             <state type="switch" name="returnToState">
  121.               <property key="outputs" value="configLink;authenticate;invokeFinalCli"/>
  122.             </state>
  123.           </states>
  124.  
  125.             <events>
  126.             <event name="finished"/>
  127.             <event name="errorIdentication"/>
  128.             <event name="errorVerification"/>
  129.             <event name="errorFileNotSent"/>
  130.             <event name="errorRadioLinkSetup"/>
  131.             <event name="errorAuthentication"/>
  132.           </events>
  133.  
  134.           <transitions>
  135.             <transition name="start" startstate="showSetupTaskPage">
  136.                 <propertymap target="fsm.nbRetries" function="3"/>
  137.             </transition>
  138.             <!-- discover -->
  139.             <transition fromstate="showSetupTaskPage" tostate="discover" event="continue">
  140.               <propertymap target="device" function="$app.device"/>
  141.             </transition>
  142.  
  143.             <!-- upload files -->
  144.             <transition fromstate="discover" tostate="uploadIncludeFiles" event="finished">
  145.               <propertymap target="profile" function="$fsm.profile"/>
  146.             </transition>
  147.             <transition fromstate="uploadIncludeFiles" tostate="uploadLangPack" event="finished">
  148.                     <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  149.                 </transition>
  150.             <transition fromstate="uploadLangPack" tostate="uploadTpl" event="finished">
  151.               <!-- output --><propertymap target="fsm.deviceLanguage" function="$deviceLanguage"/>
  152.               <propertymap target="profile" function="$fsm.profile"/>
  153.                     <propertymap target="newInterface" function="$fsm.newInterface"/>
  154.             </transition>
  155.  
  156.             <!-- activate new config -->
  157.             <transition fromstate="uploadTpl" tostate="activateConfig" event="finished">
  158.                 <!-- output --><propertymap target="fsm.profile" function="$profile"/>
  159.               <propertymap target="device" function="$app.device"/>
  160.             </transition>
  161.             <!-- restore wireless link -->
  162.             <transition fromstate="activateConfig" tostate="configLink" event="failed">
  163.               <propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
  164.               <propertymap target="ssid" function="$fsm.ssid"/>
  165.               <propertymap target="networkKey" function="$fsm.networkKey"/>
  166.               <propertymap target="encryptionType" function="$fsm.securityMode"/>
  167.             </transition>
  168.             <transition fromstate="configLink" tostate="waitForLink" event="success">
  169.               <propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
  170.               <propertymap target="fsm.nbRetries" function="3"/>
  171.             </transition>
  172.  
  173.             <!-- verify -->
  174.                 <!-- rediscover when activate config succeeded -->
  175.                 <transition fromstate="activateConfig" tostate="reDiscover" event="finished">
  176.                   <propertymap target="device" function="$app.device"/>
  177.                 </transition>
  178.                 <!-- rediscover when link is up -->
  179.                 <transition fromstate="waitForLink" tostate="reDiscover" event="radioLinkUp">
  180.                   <propertymap target="device" function="$app.device"/>
  181.                 </transition>
  182.                 <!-- authenticate when no profile found -->
  183.                 <transition fromstate="uploadTpl" tostate="authenticate" event="noProfile">
  184.                   <propertymap target="device" function="$app.device"/>
  185.                   <propertymap target="systemUserid" function="property($app.device,'user')"/>
  186.                   <propertymap target="systemPassword" function="property($app.device,'password')"/>
  187.                   <propertymap target="fsm.nbRetries" function="3"/>
  188.                 </transition>
  189.                 <!-- authenticate when device rediscovered -->
  190.                 <transition fromstate="reDiscover" tostate="authenticate" event="finished">
  191.                   <propertymap target="device" function="$app.device"/>
  192.                   <propertymap target="systemUserid" function="property($fsm.profile,'%ST_SYS_USERID')"/>
  193.                   <propertymap target="systemPassword" function="property($fsm.profile,'%ST_SYS_PASSWORD')"/>
  194.                   <propertymap target="fsm.nbRetries" function="3"/>
  195.                 </transition>
  196.                 <!-- invoke CLI's after authentication -->
  197.                 <transition fromstate="authenticate" tostate="invokeFinalCli" event="finished">
  198.                   <!-- output --><propertymap target="app.device" function="$device"/>
  199.                   <propertymap target="device" function="$device"/>
  200.                   <propertymap target="command" function="concat('language config language ', $fsm.deviceLanguage)"/>
  201.                   <propertymap target="fsm.nbRetries" function="3"/>
  202.                 </transition>
  203.  
  204.             <!-- host config -->
  205.             <transition fromstate="invokeFinalCli" tostate="hostConfig" event="finished">
  206.                 <propertymap target="currentInterface" function="property($app.device, 'lanInterface')"/>
  207.                 <propertymap target="newInterface" function="$fsm.newInterface"/>
  208.             </transition>
  209.             <transition fromstate="hostConfig" toexit="finished" event="finished|needReboot"/>
  210.  
  211.             <!-- retry mechanism -->
  212.             <transition fromstate="configLink" tostate="checkRetry" event="failed">
  213.                 <propertymap target="fsm.retryState" function="configLink"/>
  214.                 <propertymap target="fsm.nbRetries" function="add($fsm.nbRetries, -1)"/>
  215.                 <propertymap target="input2" function="$fsm.nbRetries"/>
  216.             </transition>
  217.             <transition fromstate="authenticate" tostate="checkRetry" event="failed">
  218.                 <propertymap target="fsm.retryState" function="authenticate"/>
  219.                 <propertymap target="fsm.nbRetries" function="add($fsm.nbRetries, -1)"/>
  220.                 <propertymap target="input2" function="$fsm.nbRetries"/>
  221.             </transition>
  222.             <transition fromstate="invokeFinalCli" tostate="checkRetry" event="failed">
  223.                 <propertymap target="fsm.retryState" function="invokeFinalCli"/>
  224.                 <propertymap target="fsm.nbRetries" function="add($fsm.nbRetries, -1)"/>
  225.                 <propertymap target="input2" function="$fsm.nbRetries"/>
  226.             </transition>
  227.                 <!-- 0 <= nbRetries; retry -->
  228.             <transition fromstate="checkRetry" tostate="returnToState" event="true">
  229.                 <propertymap target="input" function="$fsm.retryState"/>
  230.             </transition>
  231.                 <!-- 0 > nbRetries; fail -->
  232.             <transition fromstate="checkRetry" toexit="errorVerification" event="false"/>
  233.             <!-- catch default output -->
  234.             <transition fromstate="returnToState" toexit="errorVerification" event="default"/>
  235.             <!-- return to configLink -->
  236.                 <transition fromstate="returnToState" tostate="configLink" event="configLink">
  237.               <propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
  238.               <propertymap target="ssid" function="$fsm.ssid"/>
  239.               <propertymap target="networkKey" function="$fsm.networkKey"/>
  240.               <propertymap target="encryptionType" function="$fsm.securityMode"/>
  241.             </transition>
  242.             <!-- return to authenticate -->
  243.                 <transition fromstate="returnToState" tostate="authenticate" event="authenticate">
  244.                   <propertymap target="device" function="$app.device"/>
  245.                   <propertymap target="systemUserid" function="property($fsm.profile,'%ST_SYS_USERID')"/>
  246.                   <propertymap target="systemPassword" function="property($fsm.profile,'%ST_SYS_PASSWORD')"/>
  247.             </transition>
  248.             <!-- return to invokeFinalCli -->
  249.                 <transition fromstate="returnToState" tostate="invokeFinalCli" event="invokeFinalCli">
  250.                   <propertymap target="device" function="$device"/>
  251.                   <propertymap target="command" function="concat('language config language ', $fsm.deviceLanguage)"/>
  252.             </transition>
  253.  
  254.             <!-- catch errors -->
  255.             <transition fromstate="discover" toexit="errorIdentication" event="failed"/>
  256.             <transition fromstate="uploadLangPack" toexit="errorFileNotSent" event="uploadFailed"/>
  257.             <transition fromstate="uploadLangPack" toexit="errorIdentication" event="cliFailed"/>
  258.             <transition fromstate="uploadTpl" toexit="errorFileNotSent" event="uploadFailed"/>
  259.             <transition fromstate="uploadIncludeFiles" toexit="errorFileNotSent" event="failed"/>
  260.             <transition fromstate="configLink" toexit="errorVerification" event="notStarted"/>
  261.             <transition fromstate="waitForLink" toexit="errorRadioLinkSetup" event="timeout"/>
  262.             <transition fromstate="waitForLink" toexit="errorVerification" event="unknown"/>
  263.             <transition fromstate="reDiscover" toexit="errorVerification" event="failed"/>
  264.             <transition fromstate="authenticate" toexit="errorAuthentication" event="authenticationFailed"/>
  265.           </transitions>
  266.         </state>
  267.         <state type="showPageError" name="errorPage" />
  268.   </states>
  269.   
  270.     <events>
  271.         <event name="finished"/>
  272.     </events>
  273.     
  274.   <transitions>
  275.         <transition startstate="setupFsm">
  276.           <propertymap target="profile" function="$fsm.profile"/>
  277.           <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  278.           <propertymap target="newInterface" function="$fsm.newInterface"/>
  279.           <propertymap target="adaptorManager" function="$fsm.adaptorManager"/>
  280.       <propertymap target="ssid" function="$fsm.ssid"/>
  281.       <propertymap target="networkKey" function="$fsm.networkKey"/>
  282.       <propertymap target="securityMode" function="$fsm.securityMode"/>
  283.         </transition>
  284.         <!-- success -->
  285.         <transition fromstate="setupFsm" toexit="finished" event="finished">
  286.             <!-- output --><propertymap target="fsm.profile" function="$profile"/>
  287.         </transition>
  288.     <!-- catch errors -->
  289.     <transition fromstate="setupFsm" tostate="errorPage" event="errorIdentication">
  290.       <propertymap target="errorType" function="DevSetupIdentication"/>
  291.     </transition>
  292.     <transition fromstate="setupFsm" tostate="errorPage" event="errorFileNotSent">
  293.       <propertymap target="errorType" function="FileIsNotSent"/>
  294.     </transition>
  295.     <transition fromstate="setupFsm" tostate="errorPage" event="errorRadioLinkSetup">
  296.       <propertymap target="errorType" function="RadioLinkSetup"/>
  297.     </transition>
  298.     <transition fromstate="setupFsm" tostate="errorPage" event="errorVerification">
  299.       <propertymap target="errorType" function="DevSetupVerification"/>
  300.     </transition>
  301.     <transition fromstate="setupFsm" tostate="errorPage" event="errorAuthentication">
  302.       <propertymap target="errorType" function="AuthenticationFailure"/>
  303.     </transition>
  304.     </transitions>
  305. </fsm>
  306.