On Mon, Jun 23, 2003 at 11:08:25AM +0200, Michael Wechner wrote:
<snip />
Would Cocoon be interested in a patch like this?
If you're using 2.1 and doing if-then-else logic, it might be better to modify the ResourceExistsSelector.
right I saw that within the Javadoc after I already started on the patch. Well, the patch of the ResourceExistsAction is ready (I tested it
on Cocoon-2.1-M1 together with Lenya). Jeff, shall I send the patch to you?
Thanks
Michael
Eg, comparing:
<map:act type="resource-exists"> <map:parameter name="url" value="content/xdocs/{1}{2}" /> <map:generate src="content/xdocs/{../1}{../2}" /> ... <map:serialize type="xml"/> </map:act> <!-- stuff to do if resource doesn't exist -->
with:
<map:select type="exists"> <map:when test="content/xdocs/{1}{2}"> <map:generate src="content/xdocs/{1}{2}" /> ... <map:serialize type="xml"/> </map:when> <map:otherwise> <!-- stuff to do if resource doesn't exist --> </map:otherwise> </map:select>
Making a FileExistsSelector and DirectoryExistsSelector from this wouldn't be hard.
--Jeff
Thanks
Michael
Ciao,
-- Michael Wechner Wyona Ltd. - Open Source Content Management - Apache Lenya http://www.wyona.com http://cocoon.apache.org/lenya/ [EMAIL PROTECTED] [EMAIL PROTECTED]