maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james_strac...@yahoo.co.uk>
Subject Re: [jelly] maven CVS HEAD broken site:generate fix
Date Tue, 31 Dec 2002 11:23:33 GMT
I've just modified the <x:parse> tag so that it accepts File objects. So if
you're iterating over files you can just pass in the file object directly.

e.g.

    <fileScanner var="myFiles">
        <fileset dir="${foo}">
            <patternset>
                <include name="**/*.xml" />
            </patternset>
        </fileset>
    </fileScanner>

    <j:forEach var="myFile" items="${myFiles.iterator()}">
        <x:parse var="doc" xml="${myFile}"/>

        <!-- now process the file with XPath... -->
        <x:forEach select="$doc//foo">
            <x:if test="bar[@x='1']">
                ...
            </x:if>
        </x:forEach>
    </j:forEach>

So possibly a neater fix to the original problem raised below would be to
leave the URI handling as it was and just to pass in the File object in the
plugin when an absolute file name is required?

The only problem could be is if you have a String which you know its a File,
in which case you need to either use a helper method or some Jelly script to
turn the String into a File. e.g.

<j:new var="myFile" className="java.io.File">
    <j:arg value="${someFileName}"/>
</j:new>

James
-------
http://radio.weblogs.com/0112098/
----- Original Message -----
From: <dion@multitask.com.au>
To: "Turbine Maven Developers List" <turbine-maven-dev@jakarta.apache.org>
Cc: <commons-dev@jakarta.apache.org>
Sent: Tuesday, December 31, 2002 3:48 AM
Subject: [jelly] maven CVS HEAD broken site:generate fix


> I think I've fixed this bug for Windows, but not for Unix/Mac (or any os
> with / starting paths).
>
> I didn't want to break the existing behaviour which treats any 'uri'
> starting with '/' as a resource, rather than as a file.
>
> I can always put the file check before the resource if this wont break
> anything else in jelly.
> --
> dIon Gillard, Multitask Consulting
> Blog:      http://www.freeroller.net/page/dion/Weblog
> Work:      http://www.multitask.com.au
>
>
> robert burrell donkin <robertburrelldonkin@blueyonder.co.uk> wrote on
> 25/12/2002 12:48:07 AM:
>
> > when i rebuilt maven from CVS HEAD, i found that the betwixt
> site:generate
> > was broken. i run macOSX and java 1.3.
> >
> > i found that the same problem occurred when i tried to execute
> > site:generate for maven and so i debugged it there. here's the messages
> > containing the exception:
> >
> > xdoc:jelly-transform:
> >      [echo] Generating
> > /Volumes/gSpecials/library/jakarta/jakarta-turbine-
> > maven/target/docs/changelog.html from
> > /Volumes/gSpecials/library/jakarta/jakarta-turbine-
> > maven/target/generated-xdocs/changelog.xml
> >
> > [ERROR] BUILD FAILED
> > [ERROR] /Volumes/gSpecials/library/jakarta/jakarta-turbine-
> > maven/Volumes/gSpecials/library/jakarta/jakarta-turbine-
> > maven/xdocs/navigation.xml (No such file or directory) Nested exception:
>
> >
>
/Volumes/gSpecials/library/jakarta/jakarta-turbine-maven/Volumes/gSpecials/
> > library/jakarta/jakarta-turbine-maven/xdocs/navigation.xml (No such file
>
> > or directory)
> >
> > i tracked the problem down to the plugin.jelly for the xdocs plug in.
> the
> > navigation file is searched for in various locations and ends up with an
>
> > absolute path. it's then passed into a parse tag from the jelly xml
> > library. this assumes that all paths starting with a '/' are relative to
>
> > the jelly context base directory. that would seem to explain the
> exception
> > above.
> >
> > the attached patch create the path into a proper file URL. it fixed the
> > problem for me. i can't think of a good way to test this so i haven't
> > created a test case.
> >
> > - robert
> >
> > [attachment "plugin.patch" deleted by dIon Gillard/Multitask
> Consulting/AU] --
> > To unsubscribe, e-mail:   <mailto:turbine-maven-dev-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:turbine-maven-dev-
> > help@jakarta.apache.org>
> > ForwardSourceID:NT0009C016
>
> --
> To unsubscribe, e-mail:
<mailto:turbine-maven-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:turbine-maven-dev-help@jakarta.apache.org>
>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

Mime
View raw message