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

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE fsm SYSTEM "fsm.dtd">
  3. <!-- 
  4.  
  5.     Input properties:
  6.     - profile: (required)
  7.  
  8.   Exit events:
  9.   - finished: Files are uploaded.
  10.   - failed: An error occured while uploading the files.
  11. -->
  12.  
  13. <fsm type="listIteratorFsm">
  14.     <property key="profile" required="yes"/>
  15.     <states>
  16.         <!-- iteration state -->
  17.         <state type="listIterator" name="fileIterator"/>
  18.         
  19.         <!-- read  the file -->
  20.         <state type="readFile" name="read" weight="1">
  21.             <property key="type" value="text"/>
  22.         </state>
  23.         <!-- upload the file -->
  24.         <state type="actionUploadFile" name="upload" weight="3">
  25.             <property key="" value=""/>
  26.         </state>
  27.  
  28.     </states>
  29.     <events>
  30.         <event name="finished"/>
  31.         <event name="failed"/>
  32.     </events>
  33.     <transitions>
  34.         <!-- iterate -->
  35.         <transition startstate="fileIterator">
  36.             <!-- take the includefilelist from the profile, put the templatepath before each item, append isp.def (in the app dir) to this list -->
  37.             <propertymap target="fsm.fileList" function="append(gres(property($fsm.profile, 'hostwizardIncludefileList'), '^(.*)$', concat($app.applicationPath, '/', $app.templatePath, '/\1')), concat($app.applicationPath, '/isp.def'))"/>
  38.             <propertymap target="list" function="$fsm.fileList"/>
  39.             <propertymap target="currentItem" function=""/>
  40.         </transition>
  41.         
  42.         <!-- read and upload the next file -->
  43.         <transition fromstate="fileIterator" tostate="read" event="nextItem">
  44.             <propertymap target="fsm.currentPath" function="$currentItem"/>
  45.             <propertymap target="path" function="$currentItem"/>
  46.         </transition>
  47.         <transition fromstate="read" tostate="upload" event="finished">
  48.             <propertymap target="device" function="$app.device"/>
  49.             <propertymap target="content" function="$content"/>
  50.             <!-- get filename without path -->
  51.             <propertymap target="fileName" function="substr($fsm.currentPath, add(pos($fsm.currentPath, '/', -1), 1))"/>
  52.         </transition>
  53.         
  54.         <!-- next iteration -->
  55.         <transition fromstate="read" tostate="fileIterator" event="fileNotFound|failed">
  56.             <propertymap target="list" function="$fsm.fileList"/>
  57.             <propertymap target="currentItem" function="$fsm.currentPath"/>
  58.         </transition>
  59.         <transition fromstate="upload" tostate="fileIterator" event="finished">
  60.             <propertymap target="list" function="$fsm.fileList"/>
  61.             <propertymap target="currentItem" function="$fsm.currentPath"/>
  62.         </transition>
  63.         
  64.         <!-- no more managers, finish -->
  65.         <transition fromstate="fileIterator" toexit="finished" event="lastItem"/>
  66.         <!-- catch errors -->
  67.         <transition fromstate="upload" toexit="failed" event="failed"/>
  68.     </transitions>
  69. </fsm>