Carsten Ziegeler wrote:
Leszek Gawron wrote:

don't we have a pluggable object model ? :))

function doIt() {
  var objectModel = {};

  objectModel.pluggedIn1 = entityFromDatabase();
  objectModel.pluggedIn2 = request.getParameter( "skin" );

  cocoon.sendPage( "view/myview.jx", objectModel );
}

Other data that is not directly available from flow (like authentication context can be accessed with input modules that are already available).

And this is exactly my problem :)
With this approach you have to get all the data for each cocoon.sendPage() and store it somewhere. If you use a lot of flow this creates a maintenance nightmare. Of course you could provide your own sendPage() function that does all the work, but it's not a nice way of doing it.


So why not defining plugins for the object model somewhere and as soon as you use them in your template they are queried to provide information.

Carsten

If so I would go even further:
I had a publishing project where EVERY bizData had to have a lot of entities and configuration variables stored. So each time you prepared data for the view you had to do:


var bizData = prepareBizData();
bizData.additional = "sth";
cocoon.sendPage( "view.jx", bizData );

prepareBizData() mostly fetched data via hibernate and performed very easy condition checking.

It would be nice if we could introduce some kind of data "aspects" so every objectModel gets appropriate entries without explicitly creating them every time. My usecase was simple but we can dig more ie. every user management page has to have acces to user roles list while every other page needs the currently logged in user.

--
Leszek Gawron                                      [EMAIL PROTECTED]
Project Manager                                    MobileBox sp. z o.o.
+48 (61) 855 06 67                              http://www.mobilebox.pl
mobile: +48 (501) 720 812                       fax: +48 (61) 853 29 65

Reply via email to