You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tim Williams <wi...@gmail.com> on 2005/06/28 15:01:51 UTC
File generator resolves to root context with empty src attribute
When passing an empty string/null value to a file generator's "src"
attribute, it seems to resolve to the root context (sitemap
directory).
For example,
<map:match pattern="**tab-*.html">
<map:select type="exists">
<map:when test="{project:content.xdocs}tabs.xml">
<map:generate src="{project:content.xdocs}tabs.xml"/>
</map:when>
<map:otherwise>
<map:generate src="{lm:tabs.xml}"/>
</map:otherwise>
</map:select>
...
In the above snippet, {lm:tabs.xml} returns null but the generator
resolves to (on my box) "C:\src\apache-forrest-lm\main\webapp" which
throws an Access Denied exception. What I would have expected is a
SourceNotFoundException because, after all, an empty source couldn't
be found. Is this behavior intentional? a bug?
Thanks,
--tim
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: File generator resolves to root context with empty src attribute
Posted by Geert Josten <Ge...@daidalos.nl>.
As I meant, I considered it a bug, though a minor one. If you want it fixed, put it on bugzilla or
submit a patch yourself.. ;-)
Cheers
Tim Williams wrote:
> I guess my contention was that the empty string shouldn't have
> resolved to the sitemap directory in the first place, thus there would
> not be a valid file object. I would suggest that it's not very
> intuitive as it's currently implemented as it assumes some detailed
> cocoon knowledge. Is this behavior (""==sitemapdir)
> expected/depended upon in cocoon? In other words, is it a bug or
> behavior that should be worked around?
> --tim
>
> On 6/28/05, Geert Josten <Ge...@daidalos.nl> wrote:
>
>>The problem is that the source does exist (the sitemap directory is a valid File object). But I
>>agree that a test for an empty src attribute is easy enough...
>>
>>Cheers,
>>Geert
>>
>>Tim Williams wrote:
>>
>>
>>>When passing an empty string/null value to a file generator's "src"
>>>attribute, it seems to resolve to the root context (sitemap
>>>directory).
>>>
>>>For example,
>>><map:match pattern="**tab-*.html">
>>> <map:select type="exists">
>>> <map:when test="{project:content.xdocs}tabs.xml">
>>> <map:generate src="{project:content.xdocs}tabs.xml"/>
>>> </map:when>
>>> <map:otherwise>
>>> <map:generate src="{lm:tabs.xml}"/>
>>> </map:otherwise>
>>> </map:select>
>>>...
>>>
>>>In the above snippet, {lm:tabs.xml} returns null but the generator
>>>resolves to (on my box) "C:\src\apache-forrest-lm\main\webapp" which
>>>throws an Access Denied exception. What I would have expected is a
>>>SourceNotFoundException because, after all, an empty source couldn't
>>>be found. Is this behavior intentional? a bug?
>>>
>>>Thanks,
>>>--tim
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>>For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>
>>--
>>Geert.Josten@Daidalos.nl
>>IT-consultant at Daidalos BV, Bleiswijk (NL)
>>
>>http://www.daidalos.nl/
>>tel:+31-(0)10-850 12 00
>>fax:+31-(0)10-850 11 99
>>
>>GPG: 1024D/12DEBB50
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
Geert.Josten@Daidalos.nl
IT-consultant at Daidalos BV, Bleiswijk (NL)
http://www.daidalos.nl/
tel:+31-(0)10-850 12 00
fax:+31-(0)10-850 11 99
GPG: 1024D/12DEBB50
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: File generator resolves to root context with empty src attribute
Posted by Tim Williams <wi...@gmail.com>.
I guess my contention was that the empty string shouldn't have
resolved to the sitemap directory in the first place, thus there would
not be a valid file object. I would suggest that it's not very
intuitive as it's currently implemented as it assumes some detailed
cocoon knowledge. Is this behavior (""==sitemapdir)
expected/depended upon in cocoon? In other words, is it a bug or
behavior that should be worked around?
--tim
On 6/28/05, Geert Josten <Ge...@daidalos.nl> wrote:
> The problem is that the source does exist (the sitemap directory is a valid File object). But I
> agree that a test for an empty src attribute is easy enough...
>
> Cheers,
> Geert
>
> Tim Williams wrote:
>
> > When passing an empty string/null value to a file generator's "src"
> > attribute, it seems to resolve to the root context (sitemap
> > directory).
> >
> > For example,
> > <map:match pattern="**tab-*.html">
> > <map:select type="exists">
> > <map:when test="{project:content.xdocs}tabs.xml">
> > <map:generate src="{project:content.xdocs}tabs.xml"/>
> > </map:when>
> > <map:otherwise>
> > <map:generate src="{lm:tabs.xml}"/>
> > </map:otherwise>
> > </map:select>
> > ...
> >
> > In the above snippet, {lm:tabs.xml} returns null but the generator
> > resolves to (on my box) "C:\src\apache-forrest-lm\main\webapp" which
> > throws an Access Denied exception. What I would have expected is a
> > SourceNotFoundException because, after all, an empty source couldn't
> > be found. Is this behavior intentional? a bug?
> >
> > Thanks,
> > --tim
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
> --
> Geert.Josten@Daidalos.nl
> IT-consultant at Daidalos BV, Bleiswijk (NL)
>
> http://www.daidalos.nl/
> tel:+31-(0)10-850 12 00
> fax:+31-(0)10-850 11 99
>
> GPG: 1024D/12DEBB50
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: File generator resolves to root context with empty src attribute
Posted by Geert Josten <Ge...@daidalos.nl>.
The problem is that the source does exist (the sitemap directory is a valid File object). But I
agree that a test for an empty src attribute is easy enough...
Cheers,
Geert
Tim Williams wrote:
> When passing an empty string/null value to a file generator's "src"
> attribute, it seems to resolve to the root context (sitemap
> directory).
>
> For example,
> <map:match pattern="**tab-*.html">
> <map:select type="exists">
> <map:when test="{project:content.xdocs}tabs.xml">
> <map:generate src="{project:content.xdocs}tabs.xml"/>
> </map:when>
> <map:otherwise>
> <map:generate src="{lm:tabs.xml}"/>
> </map:otherwise>
> </map:select>
> ...
>
> In the above snippet, {lm:tabs.xml} returns null but the generator
> resolves to (on my box) "C:\src\apache-forrest-lm\main\webapp" which
> throws an Access Denied exception. What I would have expected is a
> SourceNotFoundException because, after all, an empty source couldn't
> be found. Is this behavior intentional? a bug?
>
> Thanks,
> --tim
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
Geert.Josten@Daidalos.nl
IT-consultant at Daidalos BV, Bleiswijk (NL)
http://www.daidalos.nl/
tel:+31-(0)10-850 12 00
fax:+31-(0)10-850 11 99
GPG: 1024D/12DEBB50
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org