You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Colin Paul Adams <co...@colina.demon.co.uk> on 2004/07/18 16:12:37 UTC

How do I determine the current sitemap's directory?

How can I determine the directory of the current sitemap, from within
a Source?
-- 
Colin Paul Adams
Preston Lancashire

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How do I determine the current sitemap's directory?

Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Colin" == Colin Paul Adams <co...@colina.demon.co.uk> writes:

>>>>> "Joerg" == Joerg Heinicke <jo...@gmx.de> writes:
    Joerg> On 18.07.2004 16:12, Colin Paul Adams wrote:
    >>> How can I determine the directory of the current sitemap, from
    >>> within a Source?

    Joerg> Resolving "cocoon:/" should work in every case but is
    Joerg> probably not the best way. IIRC there is a
    Joerg> request.getSitemapURI() method.

    Colin> Well, that doesn't give the correct information.

    Colin> Looking at the source code for Request, there is also
    Colin> getRequestURI, which returns the information, plus some
    Colin> more (I guess I could parse this).  There is also
    Colin> getSitemapPath(), but when I tried it, it didn't work.  The
    Colin> comments show why - it says since 2.2, and I am trying to
    Colin> test under 2.1.5, due to a bug in CVS. But I was told to
    Colin> report it against 2.1, not 2.2. Oh well.  I'll use
    Colin> getRequestURI.

No. That's no good to me. It doesn't contain the physical path to the
sitemap on disk.
I guess I'll have to wait for a fix to #30172 so I can test getSitemapPath().
-- 
Colin Paul Adams
Preston Lancashire

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How do I determine the current sitemap's directory?

Posted by Colin Paul Adams <co...@colina.demon.co.uk>.
>>>>> "Joerg" == Joerg Heinicke <jo...@gmx.de> writes:

    Joerg> On 18.07.2004 16:12, Colin Paul Adams wrote:
    >> How can I determine the directory of the current sitemap, from
    >> within a Source?

    Joerg> Resolving "cocoon:/" should work in every case but is
    Joerg> probably not the best way. IIRC there is a
    Joerg> request.getSitemapURI() method.

Well, that doesn't give the correct information.

Looking at the source code for Request, there is also getRequestURI,
which returns the information, plus some more (I guess I could parse
this).
There is also getSitemapPath(), but when I tried it, it didn't work. 
The comments show why - it says since 2.2, and I am trying to test
under 2.1.5, due to a bug in CVS. But I was told to report it against
2.1, not 2.2. Oh well.
I'll use getRequestURI.
-- 
Colin Paul Adams
Preston Lancashire

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: How do I determine the current sitemap's directory?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 18.07.2004 16:12, Colin Paul Adams wrote:

> How can I determine the directory of the current sitemap, from within
> a Source?

Resolving "cocoon:/" should work in every case but is probably not the 
best way. IIRC there is a request.getSitemapURI() method.

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org