PureMVC Architects Lounge

Announcements and General Discussion => Public Demos, Tools and Applications => Topic started by: sectore on August 10, 2007, 12:02:31



Title: Login Sample using Flex, WebORB and PureMVC
Post by: sectore on August 10, 2007, 12:02:31
Do you know the Cairngorm LoginSample (http://www.alex-uhlmann.de/flash/adobe/blog/cairngormlogin/CairngormLogin.html) from Alex Uhlmann's blog (http://weblogs.macromedia.com/auhlmann/)?

On my blog (http://www.websector.de/blog/) you will find a Login Sample (http://www.websector.de/blog/2007/08/10/another-weborb-for-php-login-sample-using-flex-and-puremvc/) (incl. full source) based on it using WebORB for PHP (http://www.themidnightcoders.com/weborb/php/) and PureMVC instead of Cairngorm.

P.S. Any feedback or suggestion are welcome ;)

-sectore


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: puremvc on August 10, 2007, 02:19:49
Beautiful demo!   The link says CairngormLoginExampleWebORB.zip instead of PureMVCLoginExampleWebORB.zip but the contehts are correct.

-=Cliff>


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: sectore on August 10, 2007, 11:04:42
@Cliff: Thanks for your feedback. The name of the link has been fixed ;)

-sectore


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: Gradiation on January 05, 2008, 08:11:29
Hi Sectore,

I am currently in the process of porting this demo over to silverlight, along with the C# PureMVC port i'm working on. But i'm having a problem which i'm not sure weather it is the demo, or my port.

My question is this.

From what i can tell, the ApplicationMediator is registered with the Facade via the ViewPrepCommand which is triggered by the application startup code telling the facade to notify observers of an APP_STARTUP notification.

In the ApplicationMediators listNotificationInterests method, it says that it is interested in the APP_STARTUP, which i beleive it uses to setup its sub views.

Now the thing that i am having dificuilty with is that the ApplicationMediator is registered by the APP_STARTUP command, and is interested in the APP_STARTUP but my ApplicationMediator doesn't currently receive notification (i'm guessing because it's not in the list when the APP_STATUP notification was broadcast)

So should the ApplicationMediator be subscribing to the APP_STARTUP notification? or is there something wrong with my port that i can't add mediators during the handling of a notification which should then receive the notification themselves?

I hope this makes sence.

Many thanks

Matt


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: puremvc on January 05, 2008, 08:21:16
ApplicationMediator should not be interested in APP_STARTUP if that is the note that triggers the command that creates and registers ApplicationMediator.

Is it this way in the repository? Or just with the app currently zipped and posted in the forum?
-=Cliff>


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: Gradiation on January 05, 2008, 08:29:41
This was from the zip file, i'll have a look in the repository too.

Matt


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: Gradiation on January 05, 2008, 08:33:56
This demo isn't in the repo is it? The only one i can find is the book store.


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: sectore on January 05, 2008, 09:17:48
Hey guys,

thanks for your feeback, you're absolutely right. As mentioned above, none of the Mediators should be interested in the Notification called "APP_STARTUP", because it's for registering Proxies and Mediators using the "ApplicationStartUpCommand". My reason for this was changing the workflowState within the "ApplicationProxy" at the start of the App (and my beginning with PureMVC in Juli / August last year ;) ).

I think changing the state of the "ApplicationProxy" will be a better job for a Command than for a Mediator. I'll refactor the source and update the repository as well as the *.zip on my blog.

-sectore


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: sectore on January 05, 2008, 10:06:02
It's done ;)

-sectore


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: Gradiation on January 05, 2008, 01:31:05
One final thing, where does the new command get triggered to set the initial state?


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: sectore on January 06, 2008, 08:47:34
Gradiaton,

the "workflowState" is initialized executing the "ViewPrepCommand" after registering the Mediators. Please grab the latest source for this update.

-sectore


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: Gradiation on January 06, 2008, 09:04:15
Cool,

Just one more final thing =)

Wouldn't it be better off being:

:
sendNotification(ApplicationFacade.APP_STATE, ApplicationProxy.VIEWING_LOGIN_SCREEN);


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: sectore on January 06, 2008, 09:22:18
Gradiaton,

that's a good idea - I've updated the source.
Thanks again for your feedback ;)

-sectore


Title: Re: Login Sample using Flex, WebORB and PureMVC
Post by: Gradiation on January 06, 2008, 09:54:35
No problem, it's a great demo.

Keep an eye out for the silverlight port coming VERY soon ;)