Hi,
I think this is a much better approach. But, what I do not get is how
you specify the alignment.
Doru.
On Wednesday, Mar 12, 2003, at 17:41 Europe/Zurich, Lukas Renggli wrote:
Hi,
as we discovered some severe design issues in the coding session
yesterday, I am now rewriting the complete rendering and template
related classes.
The main idea is to use components and visitors, instead of the static
template rendering classes I used in my first approach. I think the
best is to give an example:
To define the components visible on a page you create simply a
composite of different template components. Please note, that this is
independent of the actual design of your site, you just specify the
basic layout, say:
I want the wiki title on top. On the next line the current path
should be displayed. Then we have two columns: on the
left there is an operation-menu and a list of references and
on the right there is the actual page content.
^TemplateRoot new
add: TemplateGlobalTitle new;
add: TemplatePath new;
add: (TemplateColumns new
add: (TemplateRows new
add: TemplateOperations new;
add: TemplateReferences new;
yourself);
add: (TemplateRows new
add: TemplatePageTitle new;
add: TemplatePageContent new;
yourself);
yourself);
yourself
The rendering is done using an visitor. It walks trough the tree (and
if necessary also trough your document) and creates the html in its
own design. If you like to have a different look you have to subclass
the visitor.
To implement a new widget (e.g. a history functionality) we simply
create a new component and create a class-extension to the
rendering-visitor to render our widget.
You might already have a look at the code, if you like. But be warned,
it has been tagged as "Under progress" because the code is quite a
mess (unused code) now and there are a lot of bugs to be expected.
Also I have not written a cool renderer yet, so you will feel like in
the good old Lynx days ...
Cheers
Lukas
--
Lukas Renggli
http://renggli.freezope.org
--
Tudor Adrian Girba Software Composition Group
(
www.iam.unibe.ch/~girba) University of Bern, Switzerland
"We cannot reach the flow of things unless we let go."