I don't think it is possible to accomplish this by extending
WebMacroSiteScreen for 2 reasons.
1) It doesn't seem possible to set the layout to anything other than the
default because it seems like the layout that is used to make the page is
the private body property and the layout that is used with setLayout (in the
Document object) is Html.addElement("body", body) so, you are setting a
different body than one that is used to make the page.
2) It also seems like the Body is set in the constructor of the Document
object so the only way I know to change this is to override the Document
object.
-- to test this... use a template layout with no <body></body> tags... and
they will still be there in the html output.

Here is a diff for the WebMacroSiteLayout issue:
RCS file:
/products/cvs/turbine/turbine/src/java/org/apache/turbine/modules/layo
uts/WebMacroSiteLayout.java,v retrieving revision 1.3 diff -u -r1.3
WebMacroSiteLayout.java ---
org/apache/turbine/modules/layouts/WebMacroSiteLayout.java  2000/09/03 00:17
:26     1.3 +++ org/apache/turbine/modules/layouts/WebMacroSiteLayout.java
2000/09/12 16:28
:12 @@ -102,8 +102,10 @@           * First, generate the screen and put it
in
the context so we           * can grab it the layout template.           */
+
String layoutTemplate = data.getTemplateInfo().getLayoutTemplate();
ConcreteElement results = ScreenLoader.getInstance()
.eval(data,
data.getScreen());

As for the properties file, I'm not using TomCat, I'm using JServ but this
is how my file looks and it is configured correctly because ...it works (the
WebMacro.properties file location is relative but the templates location is
not relative for me... probably a messup on my part somewhere):
# The location of WebMacro configuration file, relative to webapp root
services.TurbineWebMacroService.properties=/WEB-INF/conf/WebMacro.properties

# The path where WebMacro will look for templates, relative to webapp root
# use your system's path separator to specify multiple paths
services.TurbineWebMacroService.templates=/home/cbuy/WEB-INF/templates
#services.TurbineWebMacroService.templates=/WEB-INF/templates - this doesn't
work

As for the diff on the last point about ECS Document's getBody & setBody...
There is no diff... I was just making a suggestion.  Please look at those
two methods in the Document object and you will see that they are pulling
and putting a different object.  It just didn't make sense to me.
public Body getBody()
{
 return(body);
}
public Document setBody(Body set_body)
{
 html.addElement("body",set_body);
 return(this);
}


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Jon Stevens
Sent: Tuesday, September 12, 2000 12:07 PM
To: Turbine
Subject: Re: contributions (<body> tag & WebMacro Layout)


on 9/12/2000 5:14 AM, "Joe Hudson" <[EMAIL PROTECTED]> wrote:

> I appoligize if this has been mentioned before or if there is a better way
> to fix these issues but I know some people have asked about so I just
wanted
> to contribute what I have done...
>
> To fix the page to not automatically add the <body></body>:

-1. This is an ugly hack. Instead you should extend WebMacroSiteScreen and
override the getLayout() method with your own Layout that will not include
the <body> tag.

> Also, it looks like the WebMacroSiteLayout is "forgetting" what the layout
> is if it is not the defaut... to fix this change this method in
> WebMacroSiteLayout:

Ok, this looks like a bug, could you please send a diff?

> I also want to mention a couple of possible fixes...
> The WebMacro Template directory in TurbineResources.properties seems to
need
> the full path instead of the relative path which the comments say.

No true. Relative path is working just fine for me. It all depends on where
you start tomcat.

> The ECS Document object has inconsistent getBody & setBody methods.
> The getBody returns the private property of the Document object
> public Body getBody()
> {
> return(body);
> }
> The setBody sets the Body object in the private Html object.
> public Document setBody(Body set_body)
> {
> html.addElement("body",set_body);
> return(this);
> }
> When the page is created, if I remember correctly, the private Body object
> is used, but there is no way to set that body since the Body object in the
> Html object is used for setting the Body.

Send a diff please.

thanks,

-jon

--
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/




------------------------------------------------------------
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