home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2011 May / ME_2011_05.iso / Galileo-Video-Tutorial / system / player.swf / scripts / data / parser / LessonParser.as < prev    next >
Encoding:
Text File  |  2010-11-30  |  1.6 KB  |  47 lines

  1. package data.parser
  2. {
  3.    import com.je.data.parser.IParser;
  4.    import com.je.model.IndexList;
  5.    import com.je.model.LessonList;
  6.    import com.je.model.StepList;
  7.    import com.je.model.vo.DataTypeFactory;
  8.    import com.je.model.vo.IData;
  9.    import com.je.model.vo.Lesson;
  10.    import com.je.model.vo.LessonInformation;
  11.    
  12.    public class LessonParser implements IParser
  13.    {
  14.       public function LessonParser()
  15.       {
  16.          super();
  17.       }
  18.       
  19.       public function parse(param1:XMLList) : IData
  20.       {
  21.          var _loc6_:XML = null;
  22.          var _loc7_:Lesson = null;
  23.          var _loc8_:int = 0;
  24.          var _loc2_:IParser = new IndicesParser();
  25.          var _loc3_:IParser = new StepsParser();
  26.          var _loc4_:IParser = new LessonInfoParser();
  27.          var _loc5_:IData = new LessonList();
  28.          for each(_loc6_ in param1)
  29.          {
  30.             _loc7_ = Lesson(DataTypeFactory.getDataType(DataTypeFactory.LESSON));
  31.             _loc7_.id = _loc6_.@id;
  32.             _loc8_ = int(String(_loc6_.label).indexOf(" "));
  33.             _loc7_.title = String(_loc6_.label).substr(_loc8_ + 1,String(_loc6_.label).length);
  34.             _loc7_.length = _loc6_.@time;
  35.             _loc7_.mediaPath = _loc6_.@key;
  36.             _loc7_.indexList = IndexList(_loc2_.parse(_loc6_..index));
  37.             _loc7_.stepList = StepList(_loc3_.parse(_loc6_..step));
  38.             _loc7_.info = LessonInformation(_loc4_.parse(_loc6_.info));
  39.             _loc7_.contentPath = _loc6_.exerciseLink.href;
  40.             LessonList(_loc5_).addLesson(_loc7_);
  41.          }
  42.          return _loc5_;
  43.       }
  44.    }
  45. }
  46.  
  47.