home *** CD-ROM | disk | FTP | other *** search
- package com.althea.client.shufflr.controller
- {
- import com.althea.client.shufflr.*;
- import com.althea.client.shufflr.controller.errors.ApplicationError;
- import com.althea.client.shufflr.model.*;
- import flash.utils.*;
- import mx.collections.ArrayCollection;
- import mx.logging.ILogger;
- import mx.logging.Log;
- import mx.logging.LogEventLevel;
- import mx.utils.ObjectProxy;
- import org.puremvc.as3.multicore.interfaces.*;
- import org.puremvc.as3.multicore.patterns.command.*;
- import org.puremvc.as3.multicore.patterns.observer.*;
-
- public class LoadNextViewCommand extends SimpleCommand
- {
- private var writeLog:ILogger;
-
- public function LoadNextViewCommand()
- {
- super();
- var _loc1_:String = getQualifiedClassName(this).replace("::",".");
- this.writeLog = Log.getLogger(_loc1_);
- }
-
- override public function execute(param1:INotification) : void
- {
- var notifyStr:String = null;
- var noteBody:Object = null;
- var result:Object = null;
- var link:String = null;
- var viewData:ArrayCollection = null;
- var errObj:ApplicationError = null;
- var note:INotification = param1;
- try
- {
- notifyStr = note.getType();
- noteBody = Object(note.getBody());
- result = noteBody.dataObj;
- link = noteBody.link;
- viewData = new ArrayCollection();
- if(result.rss.channel.item == null)
- {
- viewData = null;
- }
- else if(result.rss.channel.item is ArrayCollection)
- {
- viewData = result.rss.channel.item as ArrayCollection;
- }
- else if(result.rss.channel.item is ObjectProxy)
- {
- viewData.addItem(result.rss.channel.item);
- }
- if(notifyStr == "userTags" || notifyStr == "currUserstags")
- {
- sendNotification(notifyStr,result,link);
- }
- else if(result.rss.channel.item)
- {
- sendNotification(notifyStr,result.rss.channel.item,link);
- }
- else
- {
- sendNotification(notifyStr,null,link);
- }
- }
- catch(err:Error)
- {
- writeLog.fatal("XML data error : " + err.getStackTrace());
- errObj = new ApplicationError(LogEventLevel.FATAL,7500,"XML Data");
- sendNotification(ApplicationFacade.ERROR,errObj);
- }
- }
- }
- }
-
-