Hi,
I believe I made the catalog resolving thing work.
After applying the attached patch file to cocoon_20_branch
I was able to build the documentation as well as run
the Cocoon webapp successfully under Unix (Solaris 8)
and WinNT 4.0.

Cheers,
Christian Schmitt


On Tue, Nov 27, 2001 at 03:00:31PM +0100, Carsten Ziegeler wrote:
> Hi,
> 
> perhaps changing the constructor:
> 
>     public CommandlineContext (String contextDir) {
>         this.contextDir = contextDir;
>         this.attributes = new HashMap();
>     }
> 
> to something like:
> 
>     public CommandlineContext (String contextDir) {
>         this.contextDir = new File(contextDir).getAbsolutePath();
>         this.attributes = new HashMap();
>     }
> 
> would help?
> 
> Carsten
> 
> > -----Original Message-----
> > From: David Crossley [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, November 27, 2001 2:57 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: found the cause of Bug #5060 build docs
> >
> >
> > Carsten Ziegeler wrote:
> > > John Morrison wrote:
> > > >
> > > > > -----Original Message-----
> > > > > From: David Crossley [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Tuesday, 27 November 2001 8:52 am
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: found the cause of Bug #5060 build docs
> > > > >
> > > > <snip/>
> > > > >
> > > > > So it seems that there is inconsistency when using getResource()
> > > > > ...
> > > > > String catalogFile = params.getParameter("catalog",
> > > > >           "/resources/entities/catalog");
> > > > > String catalogURL =
> > > > > this.context.getResource(catalogFile).toExternalForm();
> > > > >
> > > > > There must be a reliable way to get the full filesystem
> > > > > pathname in both situations, but i cannot see how.
> > > >
> > > > <snip/>
> > > >
> > > > Would an alteration of the code in
> > > > src/org/apache/cocoon/environment/commandline/CommandlineContext.j
> > > > ava do it:
> > > >
> > > > (lines 61-66)
> > > >
> > > >     public URL getResource(String path) throws MalformedURLException {
> > > >         getLogger().debug("CommandlineContext: getResource=" + path);
> > > >         //return servletContext.getResource(path);
> > > >         return new URL(new
> > > >
> > StringBuffer("file:").append(this.contextDir).append(path).toString());
> > > >     }
> > > >
> > > > If this.contextDir returned the fully qualified path rather
> > than '.' would
> > > > that work?
> > > >
> > > This should be the right place, exactly.
> > > Carsten
> >
> > OK. However, i cannot see how to determine that "fully qualified
> > path rather than '.' " from within CommandlineContext.java
> > Do you have any tips?
> > --David
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
Index: src/org/apache/cocoon/components/resolver/ResolverImpl.java
===================================================================
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/components/resolver/ResolverImpl.java,v
retrieving revision 1.2.2.6
diff -u -r1.2.2.6 ResolverImpl.java
--- src/org/apache/cocoon/components/resolver/ResolverImpl.java 2001/11/25 23:24:44    
 1.2.2.6
+++ src/org/apache/cocoon/components/resolver/ResolverImpl.java 2001/11/27 15:40:34
@@ -94,9 +94,9 @@
         String catalogFile = params.getParameter("catalog",
           "/resources/entities/catalog");
         try {
-            String catalogURL = 
this.context.getResource(catalogFile).toExternalForm();
-            getLogger().debug("System Catalog URL is " + catalogURL);
-            catalogResolver.getCatalog().parseCatalog(catalogURL);
+            String catalogFileName = this.context.getResource(catalogFile).getFile();
+            getLogger().debug("System Catalog file name is " + catalogFileName);
+            catalogResolver.getCatalog().parseCatalog(catalogFileName);
         } catch (Exception e) {
             getLogger().warn("Could not get Catalog URL", e);
         }
Index: src/org/apache/cocoon/environment/commandline/CommandlineContext.java
===================================================================
RCS file: 
/home/cvspublic/xml-cocoon2/src/org/apache/cocoon/environment/commandline/CommandlineContext.java,v
retrieving revision 1.1.2.6
diff -u -r1.1.2.6 CommandlineContext.java
--- src/org/apache/cocoon/environment/commandline/CommandlineContext.java       
2001/10/25 19:31:25     1.1.2.6
+++ src/org/apache/cocoon/environment/commandline/CommandlineContext.java       
+2001/11/27 15:40:34
@@ -34,7 +34,7 @@
      * Constructs a CommandlineContext object from a ServletContext object
      */
     public CommandlineContext (String contextDir) {
-        this.contextDir = contextDir;
+        this.contextDir = new java.io.File(contextDir).getAbsolutePath();
         this.attributes = new HashMap();
     }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to