Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Show Posts

* | |

  Show Posts
Pages: [1]
1  Announcements and General Discussion / Fabrication / routeNotifications and self? on: September 14, 2011, 10:01:20
Hey - I seem to be the only one here ... echo echo...

But I'm curious if a mediator that sends out a routeNotification to "*" ALSO receives it?
2  Announcements and General Discussion / Fabrication / Re: Fabrication, Modules and Popups oh my... on: March 10, 2011, 11:32:33
Ok #1 is easier than I thought.

In my constants file I just have a new message of ALERT_SIMPLE (thinking I couldn't do the  closehandler at first).

The main app mediator responds as such:

public function respondToAlertSimple(note:INotification):void{
         var n:Object = note.getBody();
         mx.controls.Alert.show(n.text, n.title, n.flags, this.application, n.closeHandler, n.iconClass, n.defaultButtonFlag);
      }


That way any module can just send the notification


   public function reactToButtonCancelDay$Click(ev:Event):void{
         //routeNotification(MixConstants.ORDER_CANCEL_DAY, null, null, "*");
         routeNotification(MixConstants.ALERT_SIMPLE, {text: "test", title:"first", closeHandler: this.returnAlert});
      }
      
      public function returnAlert(ev:Event):void{
         routeNotification(MixConstants.ALERT_SIMPLE, {text: "YEH got it", title:"response" });
      }




But more importantly I need to know how to pop open a module....
3  Announcements and General Discussion / Fabrication / Fabrication, Modules and Popups oh my... on: March 10, 2011, 11:11:36
I've got an app that uses Fabrication and loads in a few modules using the FlexModuleLoader...

I've a two part question:

1) how best to control regular alerts / popups from one of the modules so that it displays at the top most level (ie through notification to the main application via message body)

2) how to take a module that is loaded in and display that as a popup  -- again probably partially through #1 but unsure how to make a module display as part of PopupManager?

I've read Simon's  / newtriks posts both here and on his own site and I don't think it's going to work the same way I need to work...

Greatly appreciate any assistance as I'm not sure how best to deal with multi modules as popups...
4  Announcements and General Discussion / Fabrication / Re: Fabrication module view mediators receiving puremvc multicore notifications... on: February 22, 2011, 02:28:30
I'm confused as the docs themselves seem to state that this is the case:

http://code.google.com/p/fabrication/wiki/GettingStarted


5. Send a now notification
Next we send a now notification using the PureMVC sendNotification method. We can do this from either the mediator or command. For this example we will use the startup command itself.

In controller/HelloFabricationStartupCommand.as

override public function execute(note:INotification):void {
        registerMediator(new HelloFabricationMediator(note.getBody()));
       
        sendNotification("now", new Date());
}
6. Respond to the now notification
In order to respond to the now notification we will use the respondTo syntax instead. By adding a respondToNow handler in the main mediator we indicate our interest in the now notification. The notification name must use lower camel case and the time of sending the notification, and is converted to upper camel case when handling the notification in the respondTo method.

In view/HelloFabricationMediator

public function respondToNow(note:INotification):void {
        trace("respondToNow time=" + note.getBody());
}



But I've got Modules that are using fabrication that are waiting to respondToOrderNew and don't seem to be getting the message. On top of which these notifications DO NOT seem to be the same:

routeNotification(MixConstants.ORDER_NEW, null, null, "*")
routeNotification(MixConstants.ORDER_NEW);

Two modules, each within the shell - when one sends the first message ("*") the sibling receives the message in it's respondToOrderNew. 
When the second one is sent, the other widget ignores it.

Worse still - when the first widget sends

sendNotification(MixConstants.ORDER_NEW);

the second widget ignores it as well.   I even tested with sendNotification(CRUD) and a 'respondToCrud' handler from one widget to another -- no go -- as well as putting a respondToCrud in the shell -- and THAT didn't get it either.

So do respondTo work with sendNotifications?


So is routeNotification(x, y, z, "*") necessary for sending info from





         //sendNotification(MixConstants.ORDER_NEW, null);
         routeNotification(MixConstants.ORDER_NEW);
5  Announcements and General Discussion / Fabrication / Fabrication module view mediators receiving puremvc multicore notifications... on: February 22, 2011, 01:35:20
Hey all

As outlined in another message - I've got an app where I'm using a puremvc / multicore / pipes library for connecting to a socket server; but my shell application and widgets are all fabrication. 

The gist is this:  does fabrication route 'respondTo' for sendNotification? Does it process sendNotification as if it were 'routeNotification('', null, null, "*")' ?  There's no way for me to use routeNotification from where I need to sendNotifications as the messager is puremvc, not fab.
6  Announcements and General Discussion / Architecture / puremvc base with fab shell / widgets... on: February 18, 2011, 01:17:03
OK touched on this before and spent some time changing the way I loaded the proxies as well as sending notifications - but here's the deal...

I've got models and proxies that I have in a base app -- there is NO appicationFacade for this 'app' -- as there is no app. It's really just a base directory of things as you said, that should be a library.  This is PureMVC / multicore.   There is a delegate for communication that the proxies talk to (or should).  Thing is  I'm not sure if this delegate shoudld be a 'proxy' per se or just a class. The one thing that is important is that once some socket setup (using json and stomp) is prepared, I tell the delegate to set it's svc as a static var -- doing this thinking that yes I might have to call the class from whereever (more on this in a bit).

I've got a shell app that is fabrication and does it's own startup, etc.  The startup command initiates  the core controllers to initiate the connection, and notify when connected; all this works great.   But the problem I'm starting to come do workarounds is this:  the core / base controllers can't work with the fabrication proxy = retrieveProxy(Proxy.NAME) -- instead these are expecting (since they're base) ApplicationFacade.retrieveProxy etc -- but the base doesn't HAVE an ApplicationFacade...

So I'm wondering how best to handle this -- anything in terms of FlexGlobals.topLevelApplication.facade?  Or somehow getting the fabfacade?

7  Announcements and General Discussion / Architecture / Re: multicore app arch: common logic, specific shell, and widgets... on: February 15, 2011, 02:35:45
Cliff - so sorry to bug you on this but am really having a time of this..

how would I best create a common library then? Just a Flex project as lib?
8  Announcements and General Discussion / Fabrication / Re: Fabrication AsyncCommand on: February 15, 2011, 02:33:04
I just attempted

package com.investlab.mix.mixclient.controller
{
   import com.investlab.mix.common.MixConstants;
   
   import org.flexunit.internals.namespaces.classInternal;
   import org.puremvc.as3.multicore.interfaces.INotification;
   import org.puremvc.as3.multicore.patterns.command.AsyncMacroCommand;
   
   import org.puremvc.as3.multicore.patterns.command.MacroCommand;
   
   public class InitJSONRoundTrip extends AsyncMacroCommand
   {
      public function InitJSONRoundTrip()
      {
         super();
      }
      
      override protected function initializeAsyncMacroCommand () : void
      {
         addSubCommand(InitJSONConverters);
         addSubCommand(InitInterbahnServiceProxyRepository);
         addSubCommand(InitInterbahnStompConnection) ;
         addSubCommand(InitInterbahnServiceFactory) ;
         addSubCommand(RunJSONRoundTrip);
      }
      
   }
}



all those subCommands being of the AsyncFabricationCommand class, but when this macroCommand was hit once again:
Error: multitonKey for this Notifier not yet initialized!

extremely frustrated... are there any examples of async commands in fabrication?
9  Announcements and General Discussion / Fabrication / Re: Fabrication AsyncCommand on: February 15, 2011, 02:09:35
But how is this best implemented?  Do you call a base AsyncMacro -- so it's multicore puremvc?
10  Announcements and General Discussion / Fabrication / Help with puremvc/mulitcore 'common' and fabrication shells / widgets... on: February 15, 2011, 01:56:33
I'm losing my mind and could *really* use some help here from the masters as to what I'm doing being feasible or the best way of handling this.... this is coming from http://forums.puremvc.org/index.php?topic=1872.0


I've got a project structure like this:


<--- this is a puremvc multicore app structure that holds commands that are async and need to be there for any shell startup, as well as common biz objects, etc.
mix/common/controller
---- InitCommunications <---- this is AsyncMacroCommand that calls a few others
---- (Other Commands here).

mix/common/model/vo  <-- biz objects, not needed to know


Then I've got

mix/app1    <--  all fabrication shell

mix/widget 1--x    <-- a number of widgets that are also fabrication. 

All the app/widgets work fine as well as pulling models in from the common 'app' structure.

The thing that's KILLING me is that I want to initiate the async command that is puremvc / sub commands so that the data communications are up and running for any of the shell apps we're going to build and child widgets.

Whenever I initiate the communications via a notification (ie CommonConstants.BEGIN_COMM)  I get an error of: multitonKey for this Notifier not yet initialized!

(You can see the full error in the thread above).


The thing that I get where the error *IS* but not how best to proceed -- is that since there's no true applicationFacade on the common structure that creates a multiton with a unique key/id that the request for the command blows up.

The problem I'm getting around in terms of solving it is that I don't know how best to implement this:  -- ie do I create a secondary fake facade that I somehow birth from a fabrication app?

Do I create a MacroCommand within my fab shell that pulls in the single async commands from the top level common app?

Do I look to the StateMachine?


Do I make the common structure a fabricated one?

Would REALLY appreciate some pointers as I'm quite frustrated.





11  Announcements and General Discussion / Architecture / Re: multicore app arch: common logic, specific shell, and widgets... on: February 15, 2011, 09:16:43
Thanks - will do -- but just curious - if I had a shell that was using controllers in the 'common' app mvc framework, it would be enough to initiate the async controllers directly from the shell application facade rather than the common facade...

strangely enough in testing with a simpleCommand in the common with the fabrication shell core and all's fine; it's just the async that seems to not know who it's facade is...
12  Announcements and General Discussion / Architecture / Re: multicore app arch: common logic, specific shell, and widgets... on: February 15, 2011, 08:16:14
Cliff -

If I've got app/shell1  and it wants to registerCommands of app/common/controller, can I register them directly from (since app/shell1 is fabrication) appShell1StartupCommand?


Or is there something I must do to init app/common/ApplicationFacade (thought there wouldn't be one) as I'm getting the following 'multitonKey not initalized' (note 'app' is 'mix' here).

I call the 'sendNotification' directly after loading the controllers from the 'common' area (and note, common is PureMVC multicore but the 'apps' -- MixClient in this case -- is fabrication).

It seems because it's an AsyncMacroCommand it's confused as to what the multiton key is?  Should I instead be initing the app/common/startupcommand which calls the controllers?


Error: multitonKey for this Notifier not yet initialized!
   at org.puremvc.as3.multicore.patterns.observer::Notifier/get facade()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:89]
   at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:59]
   at com.investlab.mix.common.controller::InitJSONRoundTrip/initializeAsyncMacroCommand()[/Users/grimm/Documents/Adobe Flash Builder 4/MIX-server-hugh/src/com/investlab/mix/common/controller/InitJSONRoundTrip.as:16]
   at org.puremvc.as3.multicore.patterns.command::AsyncMacroCommand()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\Utility_AS3_AsyncCommand\src-multicore\org\puremvc\as3\multicore\patterns\command\AsyncMacroCommand.as:61]
   at com.investlab.mix.common.controller::InitJSONRoundTrip()[/Users/grimm/Documents/Adobe Flash Builder 4/MIX-server-hugh/src/com/investlab/mix/common/controller/InitJSONRoundTrip.as:10]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationController/executeCommand()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationController.as:157]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
   at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationView/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationView.as:76]
   at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:329]
   at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/sendNotification()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:321]
   at org.puremvc.as3.multicore.patterns.observer::Notifier/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Notifier.as:60]
   at com.investlab.mix.mixclient.controller::MixClientStartupCommand/execute()[/Users/grimm/Documents/Adobe Flash Builder 4/MIX-server-hugh/src/com/investlab/mix/mixclient/controller/MixClientStartupCommand.as:25]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationController/executeCommand()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationController.as:166]
   at Function/http://adobe.com/AS3/2006/builtin::apply()
   at org.puremvc.as3.multicore.patterns.observer::Observer/notifyObserver()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\observer\Observer.as:100]
   at org.puremvc.as3.multicore.core::View/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\core\View.as:127]
   at org.puremvc.as3.multicore.utilities.fabrication.core::FabricationView/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/core/FabricationView.as:76]
   at org.puremvc.as3.multicore.patterns.facade::Facade/notifyObservers()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:294]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/notifyObservers()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:329]
   at org.puremvc.as3.multicore.patterns.facade::Facade/sendNotification()[C:\Documents and Settings\Owner.CapricornOne\My Documents\My Workspaces\PureMVC\PureMVC_AS3_MultiCore\src\org\puremvc\as3\multicore\patterns\facade\Facade.as:277]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/sendNotification()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:321]
   at org.puremvc.as3.multicore.utilities.fabrication.patterns.facade::FabricationFacade/startup()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/patterns/facade/FabricationFacade.as:228]
   at org.puremvc.as3.multicore.utilities.fabrication.components.fabricator::ApplicationFabricator/startApplication()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/components/fabricator/ApplicationFabricator.as:353]
   at org.puremvc.as3.multicore.utilities.fabrication.components.fabricator::ApplicationFabricator/initializeFabricator()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/components/fabricator/ApplicationFabricator.as:320]
   at org.puremvc.as3.multicore.utilities.fabrication.components.fabricator::ApplicationFabricator/readyEventListener()[/Users/sema/Work/projects/personal/fabrication/framework/src/org/puremvc/as3/multicore/utilities/fabrication/components/fabricator/ApplicationFabricator.as:362]
   at flash.events::EventDispatcher/dispatchEventFunction()
   at flash.events::EventDispatcher/dispatchEvent()
   at mx.core::UIComponent/dispatchEvent()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:12528]
   at mx.core::UIComponent/set initialized()[E:\dev\4.x\frameworks\projects\framework\src\mx\core\UIComponent.as:1627]
   at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:759]
   at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.x\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]
13  Announcements and General Discussion / Architecture / Re: multicore app arch: common logic, specific shell, and widgets... on: February 14, 2011, 04:58:32
Ah yes - I should've said that we're using Pipes.

I guess I was confused how best to load the controllers from the common project other than the startupCommand from the shell object.
14  Announcements and General Discussion / Architecture / multicore app arch: common logic, specific shell, and widgets... on: February 14, 2011, 01:24:25
OK - I'm not sure how best to convey the logic / structure that's being considered for implementation:

We've got

/app/common

-- this app really holds all the common info - ie the constants / notifications used etc
-- communication to the outside world through a socket -- common socket that would receive notifications and send the body or receive data and send notification of what was received.


/app/shell1

/app/shell2

-- these two would hold the basics of what widgets would be loaded in and how the widgets interact, some 'app level' notifications listen/send but on the whole just a shell

/app/widgets1--x
-- each widget would pull in VO from the /app/common/model section and listen to notifications from /app/shell/constants but past that they would respond to messages from the 'outside' (ie via the /app/common connection)


So - does this structure seem ok? Other than /app/common which is puremvc multicore the others are fabrication/multicore and seem fine; I'd assume that the app shell startup would launch the /app/common/controllers.....
Pages: [1]