cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timm, Sean" <ST...@mailgo.com>
Subject C2 - Sitemap & Paths?
Date Tue, 11 Apr 2000 18:01:10 GMT
I've been working on getting Cocoon2 working in the VisualCafe IDE with
Tomcat 3.1.  I'm just about there, but I've run into an issue that seems
like it would be a bug in Cocoon.  In the sitemap file, the process source
is resolved based on the location of the sitemap file.  Shouldn't this be
based on the context path of the servlet?

Currently, we use the "root" variable to resolve the URI.  It is assigned as
follows:

    this.root=this.configurationFile.getParentFile().toURL();

This "root" is then used in resolveEntity as follows:

    public InputSource resolveEntity(String publicId, String systemId)
    throws SAXException, IOException {
        if (systemId==null) throw new SAXException("Invalid System ID");

        if (systemId.length()==0)
            return new InputSource(this.root.toExternalForm());
        if (systemId.indexOf(":/")>0)
            return new InputSource(systemId);
        if (systemId.charAt(0)=='/')
            return new InputSource(this.root.getProtocol()+":"+systemId);
        return(new InputSource(new
URL(this.root,systemId).toExternalForm()));
    }

Of course, there also seems to be a problem loading the configuration file
itself.  I had specified the path for the file as conf/cocoon.xconf, which
should have worked if the relative path was based off of the servlet's
context path, but it was looking in my tomcat.home directory instead.

- Sean T.

Mime
View raw message