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