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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE fsm SYSTEM "fsm.dtd">
  3. <!-- 
  4.     Shows the upgrade page and performs 5 tasks:
  5.     - Detect: configure the interface with a static IP and detect the device.
  6.     - Backup: backup configuration files.
  7.     - Start and transfer: sets the device in BOOTP and transfers the firmware image.
  8.     - Install: wait until the device has finished installing the firmware.
  9.     - Restore: restore the configuration files.
  10.  
  11.     Fatal errors are handled by showing an error page.
  12.     
  13.     Input properties:
  14.     - buildImage: Build image object. (required)
  15.     - originalUserid: Current username of the device. (required)
  16.     - originalPassword: Current password of the device. (required)
  17.     - factoryUsername: Username of the build.
  18.     - factoryPassword: Password of the build.
  19.     - languagePackPath: Path where the language packs for the new build are located. (required)
  20.  
  21.     Application properties:
  22.     - device: The device object that will be upgraded. After succesful upgrade, this is updated.
  23.   - upgrade.restore.languagePacks [disable|backup|*highest|exact]: backup .lng files:
  24.       - disable: don't backup
  25.       - backup: backup existing language packs to a temporary directory, and restore only these.
  26.       - highest: backup existing language packs to a temporary directory. Restore the highest 
  27.         version that's available in the languagepack directory, or if no compatible builds can 
  28.         be found there, from the temporary directory.
  29.       - exact: backup existing language packs to a temporary directory. Only restore the language
  30.         packs with the same version as the new build. Check the languagepack directory first, then
  31.         the temporary directory.
  32.   - upgrade.restore.templates [0|1]: backup .tpl files
  33.   - upgrade.restore.configuration [0|1]: backup .ini files
  34.   - upgrade.restore.softwareKeys [0|1]: backup .swk files. A reboot of the device will be required
  35.     after restoring them.
  36.  
  37.     Output properties:
  38.   - errorText: Userfriendly error string. Only set on exit failedRestore.
  39.  
  40.   Exit events:
  41.   - success: Upgrade succeeded.
  42.   - failedRestore: Upgrade succeeded but configuration restoration failed.
  43.  
  44.   Modules referred:
  45.   - mod_upgrade_configinterface.xml
  46.   - mod_upgrade_backupconfig.xml
  47.   - mod_upgrade_restoreconfig.xml
  48.   - mod_upgrade_restorelangpacks.xml
  49.  
  50. -->
  51.  
  52. <fsm>
  53.     <property key="buildImage" required="yes"/>
  54.     <property key="originalUserid" required="yes"/>
  55.     <property key="originalPassword" required="yes"/>
  56.     <property key="languagePackPath" required="yes"/>
  57.     <property key="oldInterface" value="dummy"/>
  58.     <states>
  59.         <!-- compare old and new TP versions -->
  60.         <state type="showHtmlPage" name="errorPage">
  61.             <property key="title" value="tr(An error occurred)"/>
  62.             <property key="nextEnabled" value="0"/>
  63.         </state>
  64.         <state type="taskPageFsm" name="upgradeFsm" weight="10">
  65.             <property key="errorInfoText" value="tr(The Wizard was unable to continue because the following error occurred:<ul><li>%1</li></ul>
  66.                 You can try to:<ul><li>click Back and retry the upgrade process</li><li>power cycle the device and restart the Wizard</li></ul>
  67.                 See the Thomson user documentation for more information.<br/>If the problem persists, contact your Service Provider.)"/>
  68.             <!-- required inputs -->
  69.             <property key="buildImage" required="yes"/>
  70.             <property key="originalUserid" required="yes"/>
  71.             <property key="originalPassword" required="yes"/>
  72.             <property key="languagePackPath" required="yes"/>
  73.             <!-- page configuration -->
  74.           <property key="task1" value="tr(Detecting your device)" />
  75.           <property key="task2" value="tr(Backing up your device's settings and configuration)" />
  76.           <property key="task3" value="tr(Starting the upgrade mode and transferring the firmware)" />
  77.           <property key="task4" value="tr(Installing the new firmware on your device)" />
  78.           <property key="task5" value="tr(Restoring your device's settings and configuration)" />
  79.           <property key="autoContinue" value="yes"/>
  80.           <property key="autoContinueTime" value="1"/>
  81.           <!-- states -->
  82.           <states>
  83.                 <state type="compare" name="compareTpVersion">
  84.                     <property key="type" value="number"/>
  85.                     <property key="comparisonType" value="equal"/>
  86.                 </state>
  87.             <state type="showTaskPage" name="showUpgradeTaskPage">
  88.               <property key="title" value="tr(Upgrading your device)" />
  89.               <property key="subTitle" value="tr(Please wait while the Wizard is upgrading your device.)" />
  90.               <property key="helpText" value="tr(The wizard is upgrading your device by completing the following tasks:)" />
  91.               <property key="registerPage" value="1"/>
  92.               <property key="showProgressDetail" value="1"/>
  93.             </state>
  94.             <!-- discover device -->
  95.             <state file="mod_upgrade_configinterface.xml" name="configInterface" weight="3">
  96.               <property key="taskId" value="1"/>
  97.             </state>        
  98.             <state type="isDeviceOperational" name="isDeviceOperational">
  99.               <property key="taskId" value="1"/>
  100.             </state>
  101.             <state file="mod_upgrade_backupconfig.xml" name="backupConfig" weight="5">
  102.                 <property key="taskId" value="2"/>
  103.                 </state>
  104.             <state type="initUpgrade" name="initUpgrade" weight="10">
  105.               <property key="taskId" value="3"/>
  106.             </state>
  107.             <state type="startUpgrade" name="startUpgrade" weight="50">
  108.               <property key="taskId" value="3"/>
  109.             </state>
  110.             <state type="finishUpgrade" name="finishUpgrade" weight="60">
  111.               <property key="taskId" value="4"/>
  112.             </state>
  113.                 <state type="actionAuthenticateDevice" name="authenticateDevice" weight="1">
  114.               <property key="taskId" value="4"/>
  115.             </state>    
  116.             <state type="deviceAuthHandler" name="askAuthenticateDevice" weight="1">
  117.               <property key="taskId" value="4"/>
  118.             </state>     
  119.             <state file="mod_upgrade_restoreconfig.xml" name="restoreConfig" weight="10">
  120.                 <property key="taskId" value="5"/>
  121.                 </state>
  122.                 <state type="compare" name="checkBackupFailed">
  123.                     <property key="type" value="number"/>
  124.                     <property key="comparisonType" value="greaterorequal"/>
  125.                     <property key="input2" value="1"/>
  126.                 </state>
  127.             <state type="ipConfig" name="restoreInterface" weight="3"/>
  128.                 <state type="switch" name="switchOutput">
  129.                     <property key="outputs" value="success;errorRestore;error"/>
  130.                 </state>
  131.           </states>
  132.           <events>
  133.           <event name="success"/><!-- upgrade and restore succeeded -->
  134.             <event name="errorRestore"/><!-- upgrade succeeded but restore failed -->
  135.             <event name="error"/><!-- upgrade failed -->
  136.             </events>
  137.             <transitions>
  138.                 <transition startstate="compareTpVersion">
  139.                     <propertymap target="input1" function="property($app.device,'tpVersionNumber')"/>
  140.                     <propertymap target="input2" function="property($fsm.buildImage,'tpVersionNumber')"/>
  141.                 </transition>
  142.                 <!-- show page -->    
  143.                 <transition fromstate="compareTpVersion" tostate="showUpgradeTaskPage" event="true">
  144.                     <propertymap target="fsm.restoreConfig" function="1"/>
  145.                 </transition>
  146.                 <transition fromstate="compareTpVersion" tostate="showUpgradeTaskPage" event="false">
  147.                     <propertymap target="fsm.restoreConfig" function="0"/>
  148.                 </transition>
  149.                 <!-- discover -->
  150.                 <transition fromstate="showUpgradeTaskPage" tostate="configInterface" event="continue">
  151.                     <propertymap target="fsm.oldTpVersion" function="property($app.device,'tpVersionNumber')"/>
  152.                     <propertymap target="fsm.backupFailed" function="0"/><!-- reset flag -->
  153.                     <propertymap target="fsm.errorText" function="list()"/>
  154.                 </transition>
  155.                 <transition fromstate="configInterface" tostate="isDeviceOperational" event="finished">
  156.                     <propertymap target="fsm.oldInterface" function="$oldInterface"/>
  157.                     <propertymap target="device" function="$app.device"/>
  158.                 </transition>    
  159.                 <!-- backup configuration -->            
  160.                 <transition fromstate="isDeviceOperational" tostate="backupConfig" event="operational">
  161.                     <propertymap target="backupLanguagePacks" function="$app.upgrade.restore.languagePacks"/>
  162.                     <propertymap target="backupTemplates" function="$app.upgrade.restore.templates"/>
  163.                     <propertymap target="backupConfiguration" function="$app.upgrade.restore.configuration"/>
  164.                     <propertymap target="backupSoftKeys" function="$app.upgrade.restore.softwareKeys"/>
  165.                 </transition>
  166.                 <!-- skip backup, start upgrade -->
  167.                 <transition fromstate="isDeviceOperational" tostate="initUpgrade" event="notOperational">
  168.                     <propertymap target="device" function="$app.device"/>
  169.                     <propertymap target="buildImage" function="property($fsm.buildImage,'buildName')"/>
  170.                 </transition>
  171.                 <!-- backup done, start upgrade -->
  172.                 <transition fromstate="backupConfig" tostate="initUpgrade" event="finished">
  173.                     <!-- output --><propertymap target="fsm.configNameList" function="$configNameList"/>
  174.                     <!-- output --><propertymap target="fsm.configList" function="$configList"/>
  175.                     <!-- output --><propertymap target="fsm.softKeyList" function="$softKeyList"/>
  176.                     <!-- output --><propertymap target="fsm.languageList" function="$languageList"/>
  177.                     <propertymap target="fsm.restoreConfig" function="count($configNameList)"/>
  178.                     <propertymap target="device" function="$app.device"/>
  179.                     <propertymap target="buildImage" function="property($fsm.buildImage,'buildName')"/>
  180.                     <propertymap target="fsm.backupFailed" function="$backupFailed"/>
  181.                 </transition>
  182.                 <transition fromstate="initUpgrade" tostate="startUpgrade" event="finished">
  183.                     <!-- output --><propertymap target="app.device" function="$device"/>
  184.                     <propertymap target="device" function="$device"/>
  185.                     <propertymap target="buildImage" function="property($fsm.buildImage,'buildName')"/>
  186.                 </transition>
  187.                 <transition fromstate="startUpgrade" tostate="finishUpgrade" event="finished">
  188.                     <!-- output --><propertymap target="app.device" function="$device"/>
  189.                     <propertymap target="device" function="$device"/>
  190.                 </transition>
  191.                 <!-- upgrade finished, authenticate device -->
  192.                 <transition fromstate="finishUpgrade" tostate="authenticateDevice" event="finished">
  193.                     <!-- output --><propertymap target="app.device" function="$device"/>
  194.                     <propertymap target="device" function="$device"/>
  195.                     <propertymap target="systemUserid" function="$fsm.factoryUsername"/>
  196.                     <propertymap target="systemPassword" function="$fsm.factoryPassword"/>
  197.                 </transition>
  198.                 <transition fromstate="authenticateDevice" tostate="askAuthenticateDevice" event="authenticationFailed">
  199.                     <propertymap target="device" function="$app.device"/>
  200.                     <propertymap target="systemUserid" function="$fsm.factoryUsername"/>
  201.                     <propertymap target="systemPassword" function="$fsm.factoryPassword"/>
  202.                     <propertymap target="authenticationMode" function="user"/>
  203.                 </transition>    
  204.                 <!-- restore configuration -->
  205.                 <transition fromstate="authenticateDevice" tostate="restoreConfig" event="finished">
  206.                     <propertymap target="app.device" function="$device"/>
  207.                     <propertymap target="configNameList" function="$fsm.configNameList"/>
  208.                     <propertymap target="configList" function="$fsm.configList"/>
  209.                     <propertymap target="softKeyList" function="$fsm.softKeyList"/>
  210.                     <propertymap target="languageList" function="$fsm.languageList"/>
  211.                     <propertymap target="originalUserid" function="$fsm.originalUserid"/>
  212.                     <propertymap target="originalPassword" function="$fsm.originalPassword"/>
  213.               <propertymap target="factoryUsername" function="$fsm.factoryUsername"/>
  214.               <propertymap target="factoryPassword" function="$fsm.factoryPassword"/>
  215.                     <propertymap target="restoreConfig" function="$fsm.restoreConfig"/>
  216.                     <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  217.                 </transition>
  218.                 <transition fromstate="askAuthenticateDevice" tostate="restoreConfig" event="authenticated">
  219.                     <propertymap target="app.device" function="$device"/>
  220.                     <propertymap target="configNameList" function="$fsm.configNameList"/>
  221.                     <propertymap target="configList" function="$fsm.configList"/>
  222.                     <propertymap target="languageList" function="$fsm.languageList"/>
  223.                     <propertymap target="originalUserid" function="$fsm.originalUserid"/>
  224.                     <propertymap target="originalPassword" function="$fsm.originalPassword"/>
  225.               <propertymap target="factoryUsername" function="$fsm.factoryUsername"/>
  226.               <propertymap target="factoryPassword" function="$fsm.factoryPassword"/>
  227.                     <propertymap target="restoreConfig" function="$fsm.restoreConfig"/>
  228.                     <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  229.                 </transition>    
  230.  
  231.                 <!-- done -->
  232.                 <transition fromstate="restoreConfig" tostate="checkBackupFailed" event="success">
  233.                     <propertymap target="input1" function="$fsm.backupFailed"/>
  234.                 </transition>
  235.                 <transition fromstate="checkBackupFailed" tostate="restoreInterface" event="false">
  236.                     <propertymap target="fsm.exit" function="success"/>    
  237.                     <propertymap target="taskId" function="$taskId"/>    
  238.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  239.                 </transition>
  240.                 <transition fromstate="checkBackupFailed" tostate="restoreInterface" event="true">
  241.                     <propertymap target="fsm.errorText" function="append($fsm.errorText, tr('One or more configuration files have not been restored. The device may remain in default configuration state.'))"/>
  242.                     <propertymap target="fsm.exit" function="errorRestore"/>    
  243.                     <propertymap target="taskId" function="$taskId"/>    
  244.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  245.                 </transition>
  246.  
  247.                 <!-- catch errors -->
  248.             <transition fromstate="configInterface" tostate="restoreInterface" event="notFound">
  249.                     <propertymap target="fsm.exit" function="error"/>    
  250.                     <propertymap target="fsm.errorText" function="append($fsm.errorText, tr('The device is not found anymore, upgrade not started.'))"/>
  251.                     <propertymap target="taskId" function="$taskId"/>    
  252.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  253.                 </transition>
  254.                 <transition fromstate="initUpgrade" tostate="restoreInterface" event="failed">
  255.                     <propertymap target="app.device" function="$device"/>
  256.                     <propertymap target="fsm.exit" function="error"/>    
  257.                     <propertymap target="fsm.errorText" function="append($fsm.errorText, tr('The device failed to startup in upgrade mode.'))"/>
  258.                     <propertymap target="taskId" function="$taskId"/>    
  259.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  260.                 </transition>
  261.                 <transition fromstate="startUpgrade" tostate="restoreInterface" event="failed">
  262.                     <propertymap target="app.device" function="$device"/>
  263.                     <propertymap target="fsm.exit" function="error"/>    
  264.                     <propertymap target="fsm.errorText" function="append($fsm.errorText, tr('The upgrade process failed.'))"/>
  265.                     <propertymap target="taskId" function="$taskId"/>    
  266.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  267.                 </transition>
  268.                 <transition fromstate="finishUpgrade" tostate="restoreInterface" event="failed">
  269.                     <propertymap target="app.device" function="$device"/>
  270.                     <propertymap target="fsm.exit" function="error"/>    
  271.                     <propertymap target="fsm.errorText" function="append($fsm.errorText, tr('The device did not respond anymore after upgrade.'))"/>
  272.                     <propertymap target="taskId" function="$taskId"/>    
  273.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  274.                 </transition>
  275.             <transition fromstate="authenticateDevice" tostate="restoreInterface" event="failed">
  276.                     <propertymap target="fsm.exit" function="errorRestore"/>    
  277.                     <propertymap target="fsm.errorText" function="append($fsm.errorText, tr('The device did not respond anymore after upgrade. Your configuration has not been restored.'))"/>
  278.                     <propertymap target="taskId" function="$taskId"/>    
  279.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  280.                 </transition>
  281.             <transition fromstate="askAuthenticateDevice" tostate="restoreInterface" event="authenticationFailed|canceled">  
  282.                     <propertymap target="fsm.exit" function="errorRestore"/>    
  283.                     <propertymap target="fsm.errorText" function="append($fsm.errorText, tr('Device authentication has failed after upgrade. Your configuration has not been restored.'))"/>
  284.                     <propertymap target="taskId" function="$taskId"/>    
  285.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  286.                 </transition>
  287.                 <transition fromstate="restoreConfig" tostate="restoreInterface" event="failed">
  288.                     <propertymap target="fsm.exit" function="errorRestore"/>    
  289.                     <propertymap target="fsm.errorText" function="merge($fsm.errorText, $errorText)"/>
  290.                     <propertymap target="taskId" function="$taskId"/>    
  291.                     <propertymap target="newInterface" function="$fsm.oldInterface"/>    
  292.                 </transition>
  293.  
  294.                 <!-- exit -->
  295.                 <transition fromstate="restoreInterface" tostate="switchOutput" event="interfaceUpdated|needReboot">
  296.                     <propertymap target="input" function="$fsm.exit"/>
  297.                 </transition>
  298.                 <transition fromstate="switchOutput" toexit="success" event="success"/>
  299.                 <transition fromstate="switchOutput" toexit="errorRestore" event="errorRestore"/>
  300.                 <transition fromstate="switchOutput" toexit="error" event="error|default"/>
  301.             </transitions>
  302.         </state>
  303.   </states>
  304.     <events>
  305.     <event name="success"/>
  306.     <event name="failedRestore"/>
  307.   </events>
  308.     
  309.   <transitions>
  310.         <transition startstate="upgradeFsm">
  311.           <propertymap target="buildImage" function="$fsm.buildImage"/>
  312.           <propertymap target="originalUserid" function="$fsm.originalUserid"/>
  313.           <propertymap target="originalPassword" function="$fsm.originalPassword"/>
  314.           <propertymap target="factoryPassword" function="$fsm.factoryPassword"/>
  315.           <propertymap target="factoryUsername" function="$fsm.factoryUsername"/>
  316.           <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  317.         </transition>
  318.         <!-- success -->
  319.         <transition fromstate="upgradeFsm" toexit="success" event="success">
  320.         </transition>
  321.         <transition fromstate="upgradeFsm" toexit="failedRestore" event="errorRestore">
  322.             <propertymap target="fsm.errorText" function="$errorText"/>
  323.         </transition>
  324.         <!-- failed -->
  325.     <transition fromstate="upgradeFsm" tostate="errorPage" event="error">
  326.       <propertymap target="text" function="replace($errorInfoText, '%1', join($errorText, ' '))"/>
  327.     </transition>
  328.     <transition fromstate="errorPage" tostate="errorPage" event="pageNext"/>
  329.     </transitions>
  330. </fsm>
  331.