Hi Chris,

    I guess the main advantage of doing something like this is that each
component would first go through a controller, as opposed to somethink like
Tiles or JSP includes where this is not the case.  Is that the only
functionality that it would provide?  Because it would seem easier to just
do composites purely on the view side of things.  I've never really had a
need for my sidebar, header, etc. to have to go through a controller, but
that doesn't mean that other people haven't.

-Roy

----- Original Message -----
From: "Christoph Sturm" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 29, 2002 5:01 PM
Subject: [Mav-user] Assembling views


> Hey all!
>
> I'd like to implement some kind of component architecture on top of
> maverick. All components are declared as normal maverick commands:
> <commands>
>        <command name="topnavi">
>             <controller class="com.schaumwelt.controller.Navigation"/>
>             <view path="topnavi.vm"/>
>         </command>
>         <command name="subnavi">
>             <controller class="com.schaumwelt.controller.Navigation"/>
>             <view path="subnavi.vm">
>             </view>
>         </command>
>         <command name="content">
>             <controller class="com.schaumwelt.controller.ContentViewer"/>
>             <view path="content.vm">
>             </view>
>         </command>
> </commands>
>
> One screen would then be configured like this:
>
> <pages>
> <page name="mainBrowser">
>  <component command="topnavi" name="topnavi">
>     <!-- call the "topnavi" command, and store the result of the
> viewpipeline in "topnavi"
>      Assign the request parameter called category to the bean property
> category -->
>     <parameter name="category" value="category" source="request">
> </component>
>  <component command="subnavi" name="subnavi">
>     <!-- call the "subnavi" command, and store the result of the
> viewpipeline in "subnavi"
>      Assign the bean output parameter "category" of the topnavi command
> to the the category property of this bean -->
>     <parameter name="category" value="category" source="topnavi">
> </component>
>  <component command="content" name="content">
>     <!-- call the "content" command, and store the result of the
> viewpipeline in "content"
>      Assign the bean output parameter "article" of the subnavi command
> to the the article property of this bean -->
>     <parameter name="article" value="article" source="subnavi">
> </component>
> <view path="pagelayout.vm"/>
> <!-- pagelayout.vm composes the resulting page -->
> </page>
> </pages>
>
> page.vm would then look like this:
> <html>
> <head>
> </head>
> <body>
> <table>
> <tr><td colspan="2">$model.topnavi</td></tr>
> <tr><td>$model.subnavi</td><td>$model.content</td></tr>
> </table>
>
> This would make it really easy to create portal applications. It would
> also have the advantage that one command only has to take care of one
> thing, and it would be easier to reuse commands on different pages.
>
> This could also be implemented without really changing Maverick
> One easy way would be to create a CompositeController, that gets the
> page definition passed as child nodes in maverick.xml, or just the name
> of the page definition as attribute.
>
>        <command name="mainBrowser" definition="mainBrowser">
>             <controller
> class="com.schaumwelt.controller.CompositeController"/>
>             <view path="pagelayout.vm"/>
>         </command>
>
> (in this case it would look up the page named "mainBrowser" in a
> different config file, call all the commands defined in it, and store
> their result into a resulting model, which is then rendered through a
> maverick pipeline.
>
>
> What do you guys think?
>
> regards
>  chris
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: Dice - The leading online job board
> for high-tech professionals. Search and apply for tech jobs today!
> http://seeker.dice.com/seeker.epl?rel_code=31
> _______________________________________________
> Mav-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/mav-user
> Archives are available at http://www.mail-archive.com/



-------------------------------------------------------
This sf.net email is sponsored by: Dice - The leading online job board
for high-tech professionals. Search and apply for tech jobs today!
http://seeker.dice.com/seeker.epl?rel_code=31
_______________________________________________
Mav-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mav-user
Archives are available at http://www.mail-archive.com/

Reply via email to