The Intranet example is a full application created to show several Mate features and to provide a "best practices" example. It uses modules to show how you can separate your application into independent parts with Mate and the use of LocalEventMaps.

To compile it, you must add the folders "mock" and "test" to your build path. You must also compile the modules Admin and Contact.

There are two different users that can login in the example. admin/mate will give you administrative rights, guest/mate will give you read only rights.

You can also run a simple sample unit test on the Presentation Model for login.

This is an advanced example. If you'd like to look at something simpler, see the Stock Quotes example.

Run Example

View Source

Download Source

28 responses

  1. Wow , this is very similar to one of the problems that I was asking about in the forums. Not to mention the appearance looks great !
  2. Many thanks for this. Awesome!
  3. This really pulls it together for me and how to use mate. Great presentation and nice example.
  4. Looks great, and it's a really a good way to see how Mate works in the big picture. I'm eager to see more progress on this sample application. I'm particularly interested how navigation would work in this approach.
  5. Hello,

    I have attempted to compile/run the example but the modules are not loading into the main view at runtime. All I get is the loading icon. What am I missing?
  6. Jake,
    Make sure you add the modules in the Flex Modules sections of the preferences.
  7. I had to create a project from scratch to get around the module not loading. Works now, if anyone has the same issue delete .project and just File>New>Flex Project (point to source), and then set the path and modules as described.
  8. What is the loginid and password for login form?
  9. He says in the post
  10. Login: admin
    Password: mate
  11. The demo is great, but the source does not compile (pity) would like to study and modify it.
  12. After log-in, I just see the "Loading" icon. But the contacts never load. I see this error. [RPC Fault faultString="SecurityError" faultCode="SecurityError" faultDetail="Error #2148: SWF file file:///C:/dev/Intranet/bin-debug/Intranet_Runner.swf cannot access local resource assets/xml/contacts.xml. Only local-with-filesystem and trusted local SWF files may access local resources."]. Should I do something more?
  13. I have difficulty to understand the "dispatchEvent" method. In the "LoginPresentationModel" class inside "login" function, there are statements:
    - dispatcher.dispatchEvent( event );
    and statement:
    - dispatchEvent( new Event( "xxxx" ) );

    I wonder why sometimes it needs "dispatcher.dispatchEvent()", and sometimes it is ok to just use "dispatchEvent()".

    Can anyone give me some light? Where can I find more information to explain this?

    Thanks in advance.
  14. Vichet,
    dispatchEvent( new Event( "xxxx" ) ); only exists to support the Bindable tag. See:
    The other one is to be able to dispatch a global event that can be heard by the event map.
    Here is some more info about it too:
  15. Many thanks Laura for the hint and the useful links. They are really really helpful.
  16. Seems like there is so much code and classes to have such a simple application. Why are there events classes for each component?
  17. Think this example would be much easier to understand if it was written for flex 4 and the states stuff is much better than way.
  18. Thanks for the good example. There is one remark I want to say : very pedantic code according to package naming and model separations. Too many packages, maps and model classes for such simple application. Boiling code is evil :)
  19. Once again thanks for the example, I think this is a good example for understand mate and the nature asynchronous of flex when you have to comunicate with a back end (Remote Object).

    However, I lost some topics of the design, I can't understand why you use classes for presentation model and clases for managers, with Presentation Model pattern you only need PresentationModel classes isn´t it?
  20. Hmmmm... Trying to understand why we need both the presenters and the managers files. Seems like this could be combined. I realized a lot of this app doesn't make sense for the small sample but wondering if using both of these would be more useful in a larger project? Would love feedback if Laura is still monitoring this thread.

    Also greatly agree that the conversion to Flex 4 would help readability quite a bit since the states code becomes much simpler and less verbose.
  21. I would say they have the managers and presenters to show best practices. I generally have both of them regardless if the project is large or small
  22. Thanks JD. But, why? After looking at it more I am guessing that the manager does the real work while the presenters just send events that work needs to be done. In this way regardless of how the data it s being presented, there is just one object doing the work. Is that the reasoning?
  23. Perhaps I just needed to know more about the Presentation Model pattern. That seems to explain my questions. This is an easy to read description/diagram:
  24. Here is a website Amanda. This guy is the bees-knees when it comes to explaining various patterns. You should take a look around.
  25. Hi J.D. nice example! Thanks!
    I´m try to do a card based game following this example. The backend is a PHP system (with ZendAMF). How I can do if I want to put a new button (after dispatch a event) to a module that has been created? The module is working, but I want that it appears only after the user do some action. I´m trying this:
    I´ve create a new function in PermissionManager called addModule(name:String, url:String) than I´ve push the new module to _modulesAllowed array: _modulesAllowed.push( new ModuleDescriptor( name, url )); .But doesn´t work. Has someone an idea to how I can do this?
  26. is module unloading works with this example??

    any one tried???
  27. Code is out of date
  28. Thanks for the good example

Comments now closed