home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Thomson (Residential)
/
TGSTPv7203.iso
/
mac
/
HIW
/
xml
/
mod_setup_langpack.xml
< prev
next >
Wrap
Extensible Markup Language
|
2008-02-11
|
4KB
|
86 lines
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fsm SYSTEM "fsm.dtd">
<!--
Handles language pack upload to the device.
Checks the program language, the list of languages in the device, and the
available language packs. A language pack is uploaded if:
- the program language is not English AND
- an appropriate language pack is available AND
- the language is not yet on the device.
Input properties:
- (app) device: Device object. (required)
- (app) programLanguage: Language code in which the program is running. (required)
- languagePackPath: Absolute path where the language packs reside.
Output properties:
- deviceLanguage: The language code in which the device must be configured.
- langPackName: The filename of the language pack that is uploaded.
Exit events:
- finished: The language pack was uploaded or no appropriate language pack was found.
- cliFailed: An error occured while communicating with the device.
- uploadFailed: An error occured while uploading the language pack.
-->
<fsm>
<property key="languagePackPath" required="yes"/>
<states>
<state type="actionGetLanguageList" name ="getLangList" weight="5"/>
<state type="setupDevice_checkLangPack" name ="checkLangPack"/>
<state type="actionInvokeCli" name="removeLanguages" weight="5">
<property key="command" value="language delete all yes"/>
</state>
<state type="readFile" name="readFileLangPack" weight="3">
<property key="type" value="bin"/>
</state>
<state type="actionUploadFile" name="uploadFileLangPack" weight="10"/>
</states>
<events>
<event name="finished"/>
<event name="cliFailed"/>
<event name="uploadFailed"/>
</events>
<transitions>
<!-- get the language list -->
<transition startstate="getLangList">
<propertymap target="device" function="$app.device"/>
</transition>
<!-- check whether a language pack must be uploaded -->
<transition fromstate="getLangList" tostate="checkLangPack" event="finished">
<propertymap target="device" function="$app.device"/>
<propertymap target="languageList" function="$languageList"/>
<propertymap target="programLanguage" function="$app.programLanguage"/>
<propertymap target="languagePackPath" function="$fsm.languagePackPath"/>
<propertymap target="allowCompatible" function="1"/>
</transition>
<!-- don't upload, finish -->
<transition fromstate="checkLangPack" toexit="finished" event="doNothing">
<!-- output --><propertymap target="fsm.deviceLanguage" function="$deviceLanguage"/>
</transition>
<!-- upload, but first remove existing language packs -->
<transition fromstate="checkLangPack" tostate="removeLanguages" event="upload">
<!-- output --><propertymap target="fsm.deviceLanguage" function="$deviceLanguage"/>
<!-- output --><propertymap target="fsm.langPackName" function="$langPackName"/>
<propertymap target="device" function="$app.device"/>
</transition>
<!-- upload the language pack -->
<transition fromstate="removeLanguages" tostate="readFileLangPack" event="finished">
<propertymap target="path" function="concat($fsm.languagePackPath,'/',$fsm.langPackName)"/>
</transition>
<transition fromstate="readFileLangPack" tostate="uploadFileLangPack" event="finished">
<propertymap target="device" function="$app.device"/>
<propertymap target="fileName" function="$fsm.langPackName"/>
<propertymap target="content" function="$content"/>
</transition>
<!-- upload done -->
<transition fromstate="readFileLangPack" toexit="finished" event="fileNotFound"/>
<transition fromstate="uploadFileLangPack" toexit="finished" event="finished"/>
<!-- catch errors -->
<transition fromstate="getLangList" toexit="cliFailed" event="failed"/>
<transition fromstate="removeLanguages" toexit="cliFailed" event="failed"/>
<transition fromstate="readFileLangPack" toexit="uploadFailed" event="failed"/>
<transition fromstate="uploadFileLangPack" toexit="uploadFailed" event="failed"/>
</transitions>
</fsm>