cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@media.demon.co.uk>
Subject Re: fp taglib feedback
Date Tue, 25 Jul 2000 19:46:18 GMT
At 18:05 +0200 25/07/00, Ulrich Mayring wrote:
>Hi all,
>
>I just converted one of my apps over from using the XMLForm servlet to
>using the fp taglib. I must say I'm impressed with fp, it is pretty
>elegant to use (once you get behind its logic, which took at least me a
>couple of hours :). I have one thing, however, where I don't know how to
>proceed. Consider this command:
>
><fp:write to="My Resource" select="sometag">
>
>This means I have to specify all the nodes I want to save as a literal
>string. Now I have complex forms with millions (well, maybe thousands
>;-) of fields that need to be saved. What's more the number of fields
>may change dynamically - because the XML file that holds the definition
>of the fields is also editable via fp :)
>
>So I need a way to tell fp to "write out anything you find in the
>request parameters". I tried:
>
><fp:write to="My Resource>
>	<select><xsp:expr>getNextParameter()</xsp:expr></select>
>	<!-- where getNextParameter() is a custom method I wrote -->
>	...
></fp:write>

You are right, this will not currently work. The logicsheet does not pick
up these configurations if they are not attributes.

This should go in my list .... it was not something I expected to do
straight away :)

If you fix this before me, please pass on the patch.

I assume you want each of these arbitrary fields to be edited as text, not XML.
If XML editing would do, you can read and write a whole doc fragment in one
go using as="node".

>So, is there another way to generate a dynamic value for the select
>attribute?(*)

Not right now, that I can think of, sorry.

>Another thing about fp: am I right in assuming that the correct way to
>delete an item is to <fp:read> all items except the one to delete and
>then <fp:write> to a new file and then rename the new file to the old
>file?

Deleting is completely untested.
There is provision for <fp:default-mode>remove</fp:default-mode> in a
<fp:resource>, and I plan to implement an override, so that an individual
<fp:write> can act differently from the <fp:resource> it uses.

>The <fp:if-get> and <fp:if-post> things are great, but I think they
>should be seperated into another taglib for forms handling.

My feelings too, Stefano asked me to wait on stuff like this till we all
have had a bit more of a chance to play with it.

>The <fp:redirect> also works fine, but I wonder why
><response:send-redirect> wasn't used in its place? Actually, I don't
>wonder so much, because I tried using <response:send-redirect> and it
>didn't work :)

I had to write a new Tag because I wanted it to work only under certain
conditions. <1> it is a POST request <2> there were no internal errors.


>Anyway, I already love the fp taglib and will probably use it a lot.
>Thanks Jeremy.

Thank you for your feedback.

I hope this is not going to be too frustrating for you, but I don't have
much spare time right now ...... it will take a while to implement this
stuff.


regards Jeremy
-- 
   ___________________________________________________________________

   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
    <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>

Mime
View raw message