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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE fsm SYSTEM "fsm.dtd">
  3. <!-- 
  4.     Handles language pack upload to the device.
  5.     Checks the program language, the list of languages in the device, and the
  6.     available language packs. A language pack is uploaded if:
  7.         - the program language is not English AND
  8.         - an appropriate language pack is available AND
  9.         - the language is not yet on the device.
  10.  
  11.     Input properties:
  12.   - (app) device: Device object. (required)
  13.   - (app) programLanguage: Language code in which the program is running. (required)
  14.   - languagePackPath: Absolute path where the language packs reside.
  15.  
  16.     Output properties:
  17.   - deviceLanguage: The language code in which the device must be configured.
  18.   - langPackName: The filename of the language pack that is uploaded.
  19.  
  20.   Exit events:
  21.   - finished: The language pack was uploaded or no appropriate language pack was found.
  22.   - cliFailed: An error occured while communicating with the device.
  23.   - uploadFailed: An error occured while uploading the language pack.
  24. -->
  25.  
  26. <fsm>
  27.     <property key="languagePackPath" required="yes"/>
  28.   <states>
  29.       <state type="actionGetLanguageList" name ="getLangList" weight="5"/>
  30.       <state type="setupDevice_checkLangPack" name ="checkLangPack"/>
  31.       <state type="actionInvokeCli" name="removeLanguages" weight="5">
  32.           <property key="command" value="language delete all yes"/>
  33.       </state>
  34.         <state type="readFile" name="readFileLangPack" weight="3">
  35.       <property key="type" value="bin"/>
  36.       </state>                  
  37.         <state type="actionUploadFile" name="uploadFileLangPack" weight="10"/>
  38.   </states>
  39.   <events>
  40.       <event name="finished"/>
  41.       <event name="cliFailed"/>
  42.       <event name="uploadFailed"/>
  43.     </events>
  44.     <transitions>
  45.         <!-- get the language list -->
  46.         <transition startstate="getLangList">
  47.             <propertymap target="device" function="$app.device"/>
  48.         </transition>
  49.         <!-- check whether a language pack must be uploaded -->
  50.         <transition fromstate="getLangList" tostate="checkLangPack" event="finished">
  51.             <propertymap target="device" function="$app.device"/>
  52.             <propertymap target="languageList" function="$languageList"/>
  53.             <propertymap target="programLanguage" function="$app.programLanguage"/>
  54.             <propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
  55.             <propertymap target="allowCompatible" function="1"/>
  56.         </transition>
  57.         <!-- don't upload, finish -->
  58.         <transition fromstate="checkLangPack" toexit="finished" event="doNothing">
  59.             <!-- output --><propertymap target="fsm.deviceLanguage" function="$deviceLanguage"/>
  60.         </transition>
  61.         <!-- upload, but first remove existing language packs -->
  62.         <transition fromstate="checkLangPack" tostate="removeLanguages" event="upload">
  63.             <!-- output --><propertymap target="fsm.deviceLanguage" function="$deviceLanguage"/>
  64.             <!-- output --><propertymap target="fsm.langPackName" function="$langPackName"/>
  65.             <propertymap target="device" function="$app.device"/>
  66.         </transition>
  67.         <!-- upload the language pack -->
  68.         <transition fromstate="removeLanguages" tostate="readFileLangPack" event="finished">
  69.             <propertymap target="path" function="concat($fsm.languagePackPath,'/',$fsm.langPackName)"/>
  70.         </transition>
  71.         <transition fromstate="readFileLangPack" tostate="uploadFileLangPack" event="finished">
  72.             <propertymap target="device" function="$app.device"/>
  73.             <propertymap target="fileName" function="$fsm.langPackName"/>
  74.             <propertymap target="content" function="$content"/>
  75.         </transition>
  76.         <!-- upload done -->
  77.         <transition fromstate="readFileLangPack" toexit="finished" event="fileNotFound"/>
  78.         <transition fromstate="uploadFileLangPack" toexit="finished" event="finished"/>
  79.         <!-- catch errors -->
  80.         <transition fromstate="getLangList" toexit="cliFailed" event="failed"/>
  81.         <transition fromstate="removeLanguages" toexit="cliFailed" event="failed"/>
  82.         <transition fromstate="readFileLangPack" toexit="uploadFailed" event="failed"/>
  83.         <transition fromstate="uploadFileLangPack" toexit="uploadFailed" event="failed"/>
  84.     </transitions>
  85. </fsm>
  86.