You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by "Matthew S. Woodworth" <ms...@unity.ncsu.edu> on 2002/08/03 20:55:58 UTC

Embedded pages (2nd plea for help)

Friends,

I'm developing a web app that will have expanding rows (sort of like 
windows explorer). Data will be presented in a grid format.  With the 
expansion of a row we'll make a a round trip to the web server/db/etc 
and get the information required for the next row.

Both the parent and child level rows require sorting and filtering on 
the columns.  We have the parent page built without the child level 
rows.  We have the child page built too (mostly) but now we need to 
integrate them.

Right now, each page is invoked through it's action.  The action also 
has the code for sorting, pagination, filtering, etc.  I'm not sure how 
I can put the child page inside of the parent.  I can't simply call the 
action, it's not as if it returns a string.  I'm sure that somebody has 
solved this before.  parse() seems like it takes me halfway there but it 
doesn't provide a nice controller layer for different actions and it 
doesn't take any parameters other than the vm name.

I guess I could hack something up with macros but I want to draw on the 
wisdom of the list before I get too far into it.

How do you have complex pages inside of other complex pages?

Matt W.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Embedded pages (2nd plea for help)

Posted by "Chris K. Chew" <ch...@fenetics.com>.
Hi Matt.

I am not very experienced as a Turbine user, but I wanted to share an idea
that I had while reading your message.  If I were you, I would try and make
all the logic for generating the content of the expanding-explorer piece a
TurbineService instance.  Say you call it Expander, then you could
have methods like:

Expander.getNodes(nodeid)
Expander.sort(sortkey, boolsortorder)
Expander.filter(filterkey)
Expander.bound(start, stop)

This would make templating tremendously easy because you don't need to carry
expander info from
URLs to Actions to Screens and finally to templates.  Instead, store all
that logic in
testable Services and have one action or screen (ExpanderScreen &
ExpanderAction) that interacts with the service.

As for the presentation of the expander, expanded trees notoriously fit well
with XML.  Maybe your
service returns an XML string or w3 XML node that can be repurposed using
the XSLTService that
comes with Turbine.  Using XSL could save a lot of if's and foreach's in a
Velocity Macro.  It will
also make it easier to repurpose the information in case you decide to make
a pdf or serve to pda's or
need a word document or...

Hope this helps,

Chris


-----Original Message-----
From: Matthew S. Woodworth [mailto:mswoodwo@unity.ncsu.edu]
Sent: Saturday, August 03, 2002 12:56 PM
To: turbine-user@jakarta.apache.org
Subject: Embedded pages (2nd plea for help)


Friends,

I'm developing a web app that will have expanding rows (sort of like
windows explorer). Data will be presented in a grid format.  With the
expansion of a row we'll make a a round trip to the web server/db/etc
and get the information required for the next row.

Both the parent and child level rows require sorting and filtering on
the columns.  We have the parent page built without the child level
rows.  We have the child page built too (mostly) but now we need to
integrate them.

Right now, each page is invoked through it's action.  The action also
has the code for sorting, pagination, filtering, etc.  I'm not sure how
I can put the child page inside of the parent.  I can't simply call the
action, it's not as if it returns a string.  I'm sure that somebody has
solved this before.  parse() seems like it takes me halfway there but it
doesn't provide a nice controller layer for different actions and it
doesn't take any parameters other than the vm name.

I guess I could hack something up with macros but I want to draw on the
wisdom of the list before I get too far into it.

How do you have complex pages inside of other complex pages?

Matt W.


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>