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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE fsm SYSTEM "fsm.dtd">
  3. <!-- 
  4.     Restores config files, templates, software keys and language packs.
  5.  
  6.     Input properties:
  7.   - languageList: list of language ISO codes (required)
  8.   - configNameList: list of names of the config files that were backed up (required)
  9.   - configList: list of backed up config files (required)
  10.   - softKeyList: list of backed up software keys (required)
  11.   - originalUserid: username to authenticate after restore (required)
  12.   - originalPassword: password to authenticate after restore (required)
  13.   - restoreConfig: activate the new configuration after restoring it if 1, skip if 0. (required)
  14.  
  15.     Output properties:
  16.     - errorText: User friendly error string. Only set on exit failed.
  17.  
  18.     Application properties:
  19.     - device: The device that will be upgraded.
  20.   - upgrade.restore.languagePacks [disable|backup|*highest|exact]: how to restore .lng files:
  21.       - disable: do nothing
  22.       - backup: Restore the highest version that's available in the temporary directory.
  23.       - highest: Restore the highest version that's available in the languagepack directory, 
  24.         or if no compatible builds can be found there, from the temporary directory.
  25.       - exact:Only restore the language packs with the same version as the new build. 
  26.         Check the languagepack directory first, then the temporary directory.
  27.   
  28.   Exit events:
  29.   - success
  30.   - failed
  31.   
  32.   Modules referred:
  33.   - mod_upgrade_restorelangpacks.xml
  34.  
  35. -->
  36.  
  37. <fsm>
  38.     <property key="languageList" required="yes"/>
  39.     <property key="configNameList" required="yes"/>
  40.     <property key="configList" required="yes"/>
  41.     <property key="softKeyList" required="yes"/>
  42.     <property key="originalUserid" required="yes"/>
  43.     <property key="originalPassword" required="yes"/>
  44.     <property key="restoreConfig" required="yes"/>
  45.     <property key="languagePackPath" required="yes"/>
  46.     
  47.     <property key="errorNoresponse" value="tr(The device did not respond anymore after restoring the configuration. The device may remain in default configuration state.)"/>
  48.     <property key="errorNoresponseAfterReboot" value="tr(The installer was unable to detect the device after restoring the software keys. Please check whether the configuration is intact.)"/>
  49.     <property key="errorAuthentication" value="tr(Device authentication failed after restoring the configuration. The configuration may not have been restored correctly.)"/>
  50.     <property key="errorUploadFile" value="tr(One or more configuration files have not been restored. The device may remain in default configuration state.)"/>
  51.     <states>
  52.         <state type="compare" name="configRestored">
  53.             <property key="type" value="number"/>
  54.             <property key="comparisonType" value="greaterorequal"/>
  55.             <property key="input2" value="1"/>
  56.         </state>
  57.         <state type="compare" name="doReboot">
  58.             <property key="type" value="number"/>
  59.             <property key="comparisonType" value="greaterorequal"/>
  60.             <property key="input2" value="1"/>
  61.         </state>
  62.         <state type="actionRebootDevice" name="rebootModem" weight="20"/>
  63.         <!-- upload language packs -->
  64.         <state file="mod_upgrade_restorelangpacks.xml" name="uploadLanguagePacks" weight="5"/>
  65.         <!-- upload software keys -->
  66.         <state type="upgradeDevice_putSoftKeys" name="putSoftKeys" weight="5"/>
  67.         <!-- activate new config -->
  68.         <state type="actionActivateConfig" name="activateConfig" weight="10"/>
  69.     <state type="actionDiscoverDevice" name="rediscover" weight="10">
  70.       <property key="timeout" value="30000"/>
  71.     </state>
  72.         <state type="actionAuthenticateDevice" name="authenticate" weight="2"/>
  73.         <!-- iterator fsm for uploading config files -->
  74.         <state type="listIteratorFsm" name="putConfigFiles" weight="10">
  75.             <property key="fileList" required="yes"/>
  76.             <property key="configList" required="yes"/>
  77.             <property key="restoreFailed" value="0"/>
  78.             <states>
  79.                 <!-- iteration state -->
  80.                 <state type="listIterator" name="fileIterator"/>
  81.                 <!-- put one config file -->
  82.                 <state type="actionUploadFile" name="putFile" weight="2"/>
  83.                 <!-- compare failed flag -->
  84.                 <state type="compare" name="checkFailed">
  85.                     <property key="type" value="number"/>
  86.                     <property key="comparisonType" value="greater"/>
  87.                     <property key="input2" value="0"/>
  88.                 </state>
  89.             </states>
  90.             <events>
  91.                 <event name="finished"/>
  92.                 <event name="failed"/>
  93.             </events>
  94.             <transitions>
  95.                 <!-- iterate -->
  96.                 <transition startstate="fileIterator">
  97.                     <propertymap target="list" function="$fsm.fileList"/>
  98.                     <propertymap target="currentItem" function=""/>
  99.                     <propertymap target="fsm.restoreFailed" function="0"/><!-- reset failed flag -->
  100.                 </transition>
  101.                 <!-- next file, upload -->
  102.                 <transition fromstate="fileIterator" tostate="putFile" event="nextItem">
  103.                     <propertymap target="fsm.currentFile" function="$currentItem"/>
  104.                     <propertymap target="fileName" function="$currentItem"/>
  105.                     <propertymap target="content" function="property($fsm.configList,$currentItem)"/>
  106.                     <propertymap target="device" function="$app.device"/>
  107.                 </transition>
  108.                 <!-- next iteration -->
  109.                 <transition fromstate="putFile" tostate="fileIterator" event="finished">
  110.                     <propertymap target="list" function="$fsm.fileList"/>
  111.                     <propertymap target="currentItem" function="$fsm.currentFile"/>
  112.                 </transition>
  113.                 <transition fromstate="putFile" tostate="fileIterator" event="failed">
  114.                     <propertymap target="list" function="$fsm.fileList"/>
  115.                     <propertymap target="currentItem" function="$fsm.currentFile"/>
  116.                     <propertymap target="fsm.restoreFailed" function="add($fsm.restoreFailed, 1)"/><!-- set failed flag -->
  117.                 </transition>
  118.                 <!-- no more files, finish -->
  119.                 <transition fromstate="fileIterator" tostate="checkFailed" event="lastItem">
  120.                     <propertymap target="input1" function="$fsm.restoreFailed"/>
  121.                 </transition>
  122.                 <transition fromstate="checkFailed" toexit="finished" event="false"/>
  123.                 <transition fromstate="checkFailed" toexit="failed" event="true"/>
  124.             </transitions>
  125.         </state> <!-- putConfigFiles -->
  126.     </states>
  127.     <events>
  128.         <event name="success"/>
  129.         <event name="failed"/>
  130.     </events>
  131.     <transitions>
  132.         <!-- restore -->
  133.         <transition startstate="putConfigFiles">
  134.             <propertymap target="fileList" function="$fsm.configNameList"/>
  135.             <propertymap target="configList" function="$fsm.configList"/>
  136.             <propertymap target="fsm.errorText" function="list()"/>
  137.         </transition>
  138.         <!-- language packs -->
  139.         <transition fromstate="putConfigFiles" tostate="uploadLanguagePacks" event="finished">
  140.             <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  141.             <propertymap target="languageList" function="$fsm.languageList"/>
  142.           <propertymap target="restore" function="$app.upgrade.restore.languagePacks"/>
  143.         </transition>
  144.         <transition fromstate="putConfigFiles" tostate="uploadLanguagePacks" event="failed">
  145.             <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  146.             <propertymap target="languageList" function="$fsm.languageList"/>
  147.           <propertymap target="restore" function="$app.upgrade.restore.languagePacks"/>
  148.             <propertymap target="fsm.errorText" function="append($fsm.errorText, $fsm.errorUploadFile)"/>
  149.         </transition>
  150.  
  151.         <!-- software keys -->
  152.         <transition fromstate="uploadLanguagePacks" tostate="putSoftKeys" event="finished">
  153.             <propertymap target="device" function="$app.device"/>
  154.             <propertymap target="softKeyList" function="$fsm.softKeyList"/>
  155.         </transition>
  156.         <!-- need reboot? -->
  157.         <transition fromstate="putSoftKeys" tostate="doReboot" event="finished">
  158.           <propertymap target="input1" function="count($fsm.softKeyList)"/>
  159.         </transition>
  160.         <!-- reboot -->
  161.         <transition fromstate="doReboot" tostate="rebootModem" event="true">
  162.             <propertymap target="device" function="$app.device"/>
  163.             <propertymap target="timeout" function="property($app.device, 'maxRebootTime')"/>
  164.       </transition>
  165.  
  166.         <!-- need activate config? -->
  167.         <transition fromstate="putSoftKeys" tostate="configRestored" event="failed">
  168.           <propertymap target="input1" function="$fsm.restoreConfig"/>
  169.         </transition>
  170.         <transition fromstate="doReboot" tostate="configRestored" event="false">
  171.           <propertymap target="input1" function="$fsm.restoreConfig"/>
  172.         </transition>
  173.  
  174.         <!-- activate config -->
  175.         <transition fromstate="configRestored" tostate="activateConfig" event="true">
  176.             <propertymap target="device" function="$app.device"/>
  177.         </transition>
  178.         <transition fromstate="activateConfig" tostate="rediscover" event="failed">
  179.             <propertymap target="device" function="$app.device"/>
  180.         </transition>
  181.  
  182.         <!-- authenticate -->
  183.         <transition fromstate="rebootModem" tostate="authenticate" event="finished">
  184.             <propertymap target="device" function="$app.device"/>
  185.             <propertymap target="systemUserid" function="$fsm.originalUserid"/>
  186.             <propertymap target="systemPassword" function="$fsm.originalPassword"/>
  187.         </transition>
  188.         <transition fromstate="activateConfig" tostate="authenticate" event="finished">
  189.             <propertymap target="device" function="$app.device"/>
  190.             <propertymap target="systemUserid" function="$fsm.originalUserid"/>
  191.             <propertymap target="systemPassword" function="$fsm.originalPassword"/>
  192.         </transition>
  193.         <transition fromstate="rediscover" tostate="authenticate" event="finished">
  194.             <propertymap target="device" function="$app.device"/>
  195.             <propertymap target="systemUserid" function="$fsm.originalUserid"/>
  196.             <propertymap target="systemPassword" function="$fsm.originalPassword"/>
  197.         </transition>
  198.       <!-- finished -->
  199.         <transition fromstate="authenticate" toexit="success" event="finished"/>
  200.         <transition fromstate="configRestored" toexit="success" event="false"/>
  201.  
  202.         <transition fromstate="authenticate" toexit="failed" event="authenticationFailed">    
  203.             <propertymap target="fsm.errorText" function="append($fsm.errorText, $fsm.errorAuthentication)"/>
  204.     </transition>
  205.         <transition fromstate="authenticate" toexit="failed" event="failed">    
  206.             <propertymap target="fsm.errorText" function="append($fsm.errorText, $fsm.errorNoresponse)"/>
  207.     </transition>
  208.         <transition fromstate="rediscover" toexit="failed" event="failed">
  209.             <propertymap target="fsm.errorText" function="append($fsm.errorText, $fsm.errorNoresponse)"/>
  210.     </transition>
  211.         <transition fromstate="rebootModem" toexit="failed" event="failed">
  212.             <propertymap target="fsm.errorText" function="append($fsm.errorText, $fsm.errorNoresponseAfterReboot)"/>
  213.     </transition>
  214.     </transitions>
  215. </fsm>
  216.