home *** CD-ROM | disk | FTP | other *** search
- package data.parser
- {
- import com.je.data.parser.IParser;
- import com.je.model.IndexList;
- import com.je.model.LessonList;
- import com.je.model.StepList;
- import com.je.model.vo.DataTypeFactory;
- import com.je.model.vo.IData;
- import com.je.model.vo.Lesson;
- import com.je.model.vo.LessonInformation;
-
- public class LessonParser implements IParser
- {
- public function LessonParser()
- {
- super();
- }
-
- public function parse(param1:XMLList) : IData
- {
- var _loc6_:XML = null;
- var _loc7_:Lesson = null;
- var _loc8_:int = 0;
- var _loc2_:IParser = new IndicesParser();
- var _loc3_:IParser = new StepsParser();
- var _loc4_:IParser = new LessonInfoParser();
- var _loc5_:IData = new LessonList();
- for each(_loc6_ in param1)
- {
- _loc7_ = Lesson(DataTypeFactory.getDataType(DataTypeFactory.LESSON));
- _loc7_.id = _loc6_.@id;
- _loc8_ = int(String(_loc6_.label).indexOf(" "));
- _loc7_.title = String(_loc6_.label).substr(_loc8_ + 1,String(_loc6_.label).length);
- _loc7_.length = _loc6_.@time;
- _loc7_.mediaPath = _loc6_.@key;
- _loc7_.indexList = IndexList(_loc2_.parse(_loc6_..index));
- _loc7_.stepList = StepList(_loc3_.parse(_loc6_..step));
- _loc7_.info = LessonInformation(_loc4_.parse(_loc6_.info));
- _loc7_.contentPath = _loc6_.exerciseLink.href;
- LessonList(_loc5_).addLesson(_loc7_);
- }
- return _loc5_;
- }
- }
- }
-
-