cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Umur Ozkul at Writeme" <u...@writeme.com>
Subject Util.java - app server compatibility
Date Mon, 12 Feb 2001 17:37:55 GMT
We are using Cocoon 1.8.1 on Enhydra 3.1 and Dynamo 5.0. However, we had to
path Utils.java to make it run. As we could not have time to check properly
for Dynamo 5.0, this version of is only compatible with Enhydra and
Dynamo...

First, is there a way of making Cocoon without those changes? How?

Second, if not, can these changes be enhanced and integrated to Cocoon
properly?

The difference to the Util.java is as follows...
====================== CUT HERE ==============================
273,275c273,286
<
<             if (resource != null) {
<                 return resource.replace('\\','/');
---
>             if (resource != null)
>             {
>                 boolean enhydra = isEnhydra( resource );
>                 if (enhydra) {
>                   resource = fixBasename( path, resource ); // FIX Enhydra
compatibility...
>                   return resource.replace('\\', '/');
>                 }
> 		String s = resource.replace('\\', '/');
>                 // FIX for Dynamo Compatibility... Dirty Hack...
>                 // Should add a check for dynamo here...
>                 // This is not compatible for other app servers...
> 		s = s + request.getPathInfo().substring(1);
>                 return s;
>                 //return resource.replace('\\','/');
284c295
<             return request.getPathTranslated().replace('\\','/');
---
>               return request.getPathTranslated().replace('\\','/');
287a299,317
>     private static boolean isEnhydra(String basename) {
>     // FIX Enhydra compatiblity without disturbing the functionality
>     // Added. umur@writeme.com. 25.08.2000
>         if ((basename.indexOf("org.apache.cocoon.Cocoon")) < 0)
>           return false;
>         return true;
>     }
>
>     private static String fixBasename(String path, String basename) {
>     // FIX Enhydra compatiblity without disturbing the functionality
>     // Added. umur@writeme.com. 25.08.2000
>         int i = 0;
>         if ((i = basename.indexOf("org.apache.cocoon.Cocoon")) < 0)
>           return basename;
>         String file = basename.substring(0, i-1) + path;
>         return file;
>     }
>
>


Mime
View raw message