ingo schuster wrote:
> 
> At 16:09 02/20/01, Sean Legassick wrote:
> >On Fri, Feb 16, 2001 at 05:57:24PM +0100, ingo schuster wrote:
> > > There are two bugs in TurbineTemplateService:
> > > 1. The default layout template is not extended by the default extension.
> >
> >That should happen, but your patch assumes that template names given
> >without the default extension will be of the form 'default.' rather than
> >'default', whereas the equivalent code for screen/nav templates assumes
> >they will be given without the trailing '.'. I think if you give a name
> >with a trailing '.' you are saying "don't use an extension" so your
> >patch should be changed.
> >
> > > 2. The default.layout.template in TR.p is not used at all - it is
> > hardwired
> > > to "default."
> > >
> > > The patch below fixes it. I'm not sure about the line
> > >    pkgs[arrayIndex] = pkg.append("Default").toString();
> > > It seems to hardwire the default layout module to "Default", however I'm
> > > not sure if it is used with templating at all?
> >
> >No, it's not - you are right that's not needed.
> 
> Ok, below is a modified version of the patch.
> 
> ingo
> 
> Index: TurbineTemplateService.java
> ===================================================================
> RCS file:
> 
>/products/cvs/turbine/turbine/src/java/org/apache/turbine/services/template/TurbineTemplateService.java,v
> retrieving revision 1.16
> diff -u -r1.16 TurbineTemplateService.java
> --- TurbineTemplateService.java 2001/02/08 23:55:43     1.16
> +++ TurbineTemplateService.java 2001/02/21 17:19:02
> @@ -196,6 +196,10 @@
>           // the default layout template
>           defaultLayoutTemplate = props
>               .getProperty("default.layout.template", "/default." +
> extension);
> +        if (defaultLayoutTemplate.indexOf('.') == -1)
> +        {
> +            defaultLayoutTemplate = defaultLayoutTemplate + "." + extension;
> +        }

I am not sure why one would specify the default layout template without
giving the extension explicitely, but I guess someone could, so +0.

>       }
> 
>       /**
> @@ -468,8 +472,7 @@
>                   pkgs[arrayIndex] = distinctPkg.append(className).toString();
>                   arrayIndex++;
>               }
> -            paths[arrayIndex] = path.append("/default." +
> extension).toString();
> -            pkgs[arrayIndex] = pkg.append("Default").toString();


Why are you removing the pkgs Default?

John McNally







> +            paths[arrayIndex] = path.append(defaultLayoutTemplate).toString();
>               arrayIndex++;
>           }
> 
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]


------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to