Mailing List Archive

Forrest 0.5.1: site.xml, tabs.xml & menus
I'm still having trouble with my menu generation. The best I get is that the my index.html files
get the complete index (too much, it is selecting all site.xml elements, regardless
of the tab attribute). On detail pages, I get the correct menus.

Examples:

http://jakarta.apache.org/hivemind/

Contains all the menus (including for the "Module: hivemind" and "Module: hivemind-lib" menus). It
should just have the project menus.

http://jakarta.apache.org/hivemind/services.html has the correct menu (everything at the project
level should have this menu).

Likewise, the index.html for the hivemind and hivemind-lib menus is off, showing everything (just
like the root index.html).

http://jakarta.apache.org/hivemind/hivemind/ant/ConstructRegistry.html has the correct menu (just
the stuff in the "Module: hivemind" menu).


I've enclosed my tabs.xml and site.xml ... obviously, I've been playing with different approaches
and not finding the right one. I tried directory based menus and that was close,
except that the root index.html got no menu at all (and the pages linked only from the root
index.html were not generated).

There seems to be some contention between what the dir and href attributes do and mean, and I can't
follow whats going on inside all that cocoon and xslt to figure it out. Talk about a steep learning
curve! Without the href attribute, the tabs don't display properly (i.e., highlighting the
currently selected tab) for the index.html pages. At this point, I've been through so many
iteration, I don't know if the dir attribute is needed or not.


tabs.xml:

<!DOCTYPE tabs PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.0//EN"
"http://apache.org/forrest/dtd/tab-cocoon-v10.dtd">

<tabs software="HiveMind"
title="HiveMind Project"
copyright="Apache Software Foundation"
xmlns:xlink="http://www.w3.org/1999/xlink">

<!-- The rules are:
@dir will always have '/@indexfile' added.
@indexfile gets appended to @dir if the tab is selected. Defaults to 'index.html'
@href is not modified unless it is root-relative and obviously specifies a
directory (ends in '/'), in which case /index.html will be added

HLS NOTE: I don't think the following line is accurate!

If @id's are present, site.xml entries with a matching @tab will be in that tab.
-->

<tab label="HiveMind Project" href="index.html" id="project"/>

<tab label="Module: hivemind" dir="hivemind" href="hivemind" id="hivemind"/>
<tab label="Module: hivemind-lib" dir="hivemind-lib" href="hivemind-lib" id="hivemind-lib"/>

</tabs>


site.xml:

<?xml version="1.0"?>

<!DOCTYPE site
[.
<!ENTITY project-report-menu.ent SYSTEM "project-report-menu.ent">
<!ENTITY hivemind-report-menu.ent SYSTEM "hivemind-report-menu.ent">
<!ENTITY hivemind-lib-report-menu.ent SYSTEM "hivemind-lib-report-menu.ent">
]
>

<site xmlns="http://apache.org/forrest/linkmap/1.0" tab="project">

<project label="HiveMind Project">
<reference label="Reference">
<services label="Services" href="services.html"/>
<configurations label="Configurations" href="configurations.html"/>
<sdl label="Simple Data Language" href="sdl.html"/>
<hivedoc label="HiveDoc" href="hivedoc.html"/>
<descriptor label="Module Descriptor" href="descriptor.html"/>
<rules label="Contribution Processing Rules" href="rules.html"/>
</reference>

<downloads href="downloads.html" label="Downloads"/>

<tutorials label="Tutorials and Information">
<bootstrap label="Bootstrapping the Registry" href="bootstrap.html"/>
<case1 label="Case Study #1: Panorama Startup" href="case1.html"/>
<ioc label="Inversion Of Control" href="ioc.html"/>
<localization label="Localization" href="localization.html"/>
<multithreading label="Multi-Threading" href="multithreading.html"/>
<filter label="Servlets" href="filter.html"/>
<interceptors label="Creating New Interceptors" href="interceptors.html"/>
<override label="Overriding Services" href="override.html"/>
</tutorials>

<reports label="Reports">
&project-report-menu.ent;
</reports>
</project>

<hivemind label="Module: hivemind" tab="hivemind" href="hivemind/">

<services label="Services">

<hivemind.BuilderFactory label="BuilderFactory" href="BuilderFactory.html"/>
<hivemind.LoggingInterceptor label="LoggingInterceptor"
href="LoggingInterceptor.html"/>
<hivemind.ShutdownCoordinator label="ShutdownCoordinator"
href="ShutdownCoordinator.html"/>
<hivemind.ThreadLocalStorage label="ThreadLocalStorage"
href="ThreadLocalStorage.html"/>

</services>

<configs label="Configurations">

<hivemind.ApplicationDefaults label="ApplicationDefaults"
href="ApplicationDefaults.html"/>
<hivemind.EagerLoad label="EagerLoad" href="EagerLoad.html"/>
<hivemind.FactoryDefaults label="FactoryDefaults"
href="FactoryDefaults.html"/>
<hivemind.ServiceModels label="ServiceModels" href="ServiceModels.html"/>
<hivemind.SymbolSources label="SymbolSources" href="SymbolSources.html"/>
<hivemind.Translators label="Translators" href="Translators.html"/>

</configs>

<anttasks label="Ant Tasks">

<ConstructRegistry label="ConstructRegistry"
href="ant/ConstructRegistry.html"/>
<ManifestClassPath label="ManifestClassPath"
href="ant/ManifestClassPath.html"/>

</anttasks>

<reports label="Reports">
&hivemind-report-menu.ent;
</reports>

</hivemind>

<hivemind.lib label="Module: hivemind.lib" tab="hivemind-lib" href="hivemind-lib/">

<services label="Services">
<hivemind.lib.EJBProxyFactory label="EJBProxyFactory"
href="EJBProxyFactory.html"/>
<hivemind.lib.NameLookup label="NameLookup" href="NameLookup.html"/>
<hivemind.lib.RemoteExceptionCoordinator label="RemoteExceptionCoordinator"
href="RemoteExceptionCoordinator.html"/>
<hivemind.lib.SpringLookupFactory label="SpringLookupFactory"
href="SpringLookupFactory.html"/>
</services>

<reports label="Reports">
&hivemind-lib-report-menu.ent;
</reports>

</hivemind.lib>

<complete-site label="Complete Site">
<complete-html label="HTML" href="site.html"/>
</complete-site>
<related label="Related Projects">
<tapestry label="Tapestry" href="http://jakarta.apache.org/tapestry/"/>
<spring label="Spring" href="http://www.springframework.org"/>
</related>
</site>

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com
Re: Forrest 0.5.1: site.xml, tabs.xml & menus [ In reply to ]
Howard M. Lewis Ship wrote:



> I'm still having trouble with my menu generation. The best I get is
> that the my index.html files get the complete index (too much, it is
> selecting all site.xml elements, regardless of the tab attribute).
> On detail pages, I get the correct menus.

[cut]

I'm not any fluent on Forrest generation stuff, but I think that all
elements of your site should be defined in site.xml. It is also a
point for 'index.xml' files - that is, files used by tabs. So if there
is any index.xml, which is not specified in site.xml, Forrest 'thinks'
that this file has 'tab' attribute equal to "". During menus generation
all files with the same 'tab' attribute are in the same menu, so
clicking on the tab brings you complete index.

Maybe somebody from forrest-dev could correct this statement?

Below is a simple example that works for me. Try it on fresh forrest seed
and then adjust to your needs.


===[directory_structure]=======


xdocs/
- index.xml
- site.xml
- tabs.xml
- a/
- first.xml
- second.xml
- b/
- b_index.xml
- third.xml
- fourth.xml
- c/
- c_index.xml
- fifth.xml
- sixth.xml


===[site.xml]=======

<site label="MyProj" href="" xmlns="http://apache.org/forrest/linkmap/1.0" tab="a">

<main_index_file tab="a">
<index href="index.html"/>
</main_index_file>

<tab_a href="a/" label="A" tab="a">
<first label="First" href="first.html"/>
<second label="Second" href="second.html"/>
</tab_a>

<tab_b href="b/" label="B" tab="b">
<index href="b_index.html"/>
<third label="Third" href="third.html"/>
<fourth label="Fourth" href="fourth.html"/>
</tab_b>

<tab_c href="c/" label="C" tab="c">
<index href="c_index.html"/>
<fifth label="Fifth" href="fifth.html"/>
<sixth label="Sixth" href="sixth.html"/>
</tab_c>

</site>


===[tabs.xml]=======

<tabs software="MyProj"
title="MyProj"
copyright="Foo"
xmlns:xlink="http://www.w3.org/1999/xlink">

<tab id="a" label="tab_A" dir=""/>
<tab id="b" label="tab_B" dir="b" indexfile="b_index.html"/>
<tab id="c" label="tab_C" dir="c" indexfile="c_index.html"/>

</tabs>


Best regards,
Lechique
RE: Forrest 0.5.1: site.xml, tabs.xml & menus [ In reply to ]
Thanks! Adding the <index href="index.html"> (for the project, for each of the modules) solved my
issues.

Double checked http://xml.apache.org/forrest/linking.html and it doesn't mention anything about
<index> being necessary and magic.

--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind
http://howardlewisship.com


> -----Original Message-----
> From: Lechique [mailto:lechique@poczta.onet.pl]
> Sent: Tuesday, June 01, 2004 1:55 PM
> To: Howard M. Lewis Ship
> Subject: Re: Forrest 0.5.1: site.xml, tabs.xml & menus
>
>
>
> Howard M. Lewis Ship wrote:
>
>
>
> > I'm still having trouble with my menu generation. The best I get is
> > that the my index.html files get the complete index (too much, it is
> > selecting all site.xml elements, regardless of the tab attribute).
> > On detail pages, I get the correct menus.
>
> [cut]
>
> I'm not any fluent on Forrest generation stuff, but I think that all
> elements of your site should be defined in site.xml. It is also a
> point for 'index.xml' files - that is, files used by tabs. So if there
> is any index.xml, which is not specified in site.xml, Forrest 'thinks'
> that this file has 'tab' attribute equal to "". During menus
> generation
> all files with the same 'tab' attribute are in the same menu, so
> clicking on the tab brings you complete index.
>
> Maybe somebody from forrest-dev could correct this statement?
>
> Below is a simple example that works for me. Try it on fresh
> forrest seed
> and then adjust to your needs.
>
>
> ===[directory_structure]=======
>
>
> xdocs/
> - index.xml
> - site.xml
> - tabs.xml
> - a/
> - first.xml
> - second.xml
> - b/
> - b_index.xml
> - third.xml
> - fourth.xml
> - c/
> - c_index.xml
> - fifth.xml
> - sixth.xml
>
>
> ===[site.xml]=======
>
> <site label="MyProj" href=""
> xmlns="http://apache.org/forrest/linkmap/1.0" tab="a">
>
> <main_index_file tab="a">
> <index href="index.html"/>
> </main_index_file>
>
> <tab_a href="a/" label="A" tab="a">
> <first label="First" href="first.html"/>
> <second label="Second" href="second.html"/>
> </tab_a>
>
> <tab_b href="b/" label="B" tab="b">
> <index href="b_index.html"/>
> <third label="Third" href="third.html"/>
> <fourth label="Fourth" href="fourth.html"/>
> </tab_b>
>
> <tab_c href="c/" label="C" tab="c">
> <index href="c_index.html"/>
> <fifth label="Fifth" href="fifth.html"/>
> <sixth label="Sixth" href="sixth.html"/>
> </tab_c>
>
> </site>
>
>
> ===[tabs.xml]=======
>
> <tabs software="MyProj"
> title="MyProj"
> copyright="Foo"
> xmlns:xlink="http://www.w3.org/1999/xlink">
>
> <tab id="a" label="tab_A" dir=""/>
> <tab id="b" label="tab_B" dir="b" indexfile="b_index.html"/>
> <tab id="c" label="tab_C" dir="c" indexfile="c_index.html"/>
>
> </tabs>
>
>
> Best regards,
> Lechique
>
Re: Forrest 0.5.1: site.xml, tabs.xml & menus [ In reply to ]
Howard M. Lewis Ship escribió:
> Thanks! Adding the <index href="index.html"> (for the project, for each of the modules) solved my
> issues.
>
> Double checked http://xml.apache.org/forrest/linking.html and it doesn't mention anything about
> <index> being necessary and magic.
>

Humm... I do not why, this is a requierement... It looks like if there
is not a index.html href then the tab is not selected.

Is this right?

As a minimun we should add a note on
http://xml.apache.org/forrest/linking.html#tab-selection


Can anyone with better english skins apply this patch?


Cheers,
Cheche
Re: Forrest 0.5.1: site.xml, tabs.xml & menus [ In reply to ]
Juan Jose Pablos wrote:

> Howard M. Lewis Ship escribió:
>
>> Thanks! Adding the <index href="index.html"> (for the project, for
>> each of the modules) solved my
>> issues.
>>
>> Double checked http://xml.apache.org/forrest/linking.html and it
>> doesn't mention anything about
>> <index> being necessary and magic.
>>
>
> Humm... I do not why, this is a requierement... It looks like if there
> is not a index.html href then the tab is not selected.
>
> Is this right?
>
> As a minimun we should add a note on
> http://xml.apache.org/forrest/linking.html#tab-selection
>
>
> Can anyone with better english skins apply this patch?
>

Hello Juan,
I can apply the patch but the english is alright ;-).
So go ahead and apply it yourself ;-)

BTW I have the same problem, I guess, with the
http://cocoon.apache.org/lenya/.
Have a look it shows all nodes!
In comparision to
http://olr.kbs.uni-hannover.de:8080/lenya/docs-new/project/index.html
where it does not!

I guess it is a point for upgrading to 06.
I will have a look after work and see whether the index.html within a
node with tab-attribute is doing the trick.

Will report back tomorrow.

King regards
thorsten

>
> Cheers,
> Cheche
>
>------------------------------------------------------------------------
>
>Index: linking.xml
>===================================================================
>--- linking.xml (revision 20771)
>+++ linking.xml (working copy)
>@@ -289,7 +289,9 @@
> <p>
> The tab selection algorithm is quite simple: the tab with the
> <code>id</code> matching that of the current <code>site.xml</code>
>- node is "selected".
>+ node is "selected". If you experiment any problems try to add a
>+ <code>&lt;foo label="Foo" href="index.html"/&gt;</code> on
>+ <code>site.xml</code>
> </p>
> </section>
>
>
>


--
Thorsten Scherler

Departamento de Desarrollo de Proyectos
Sociedad Andaluza para el Desarrollo de la Sociedad de la Información S.A.U.
Avda. de la Arboleda s/n
41940 - Tomares, (Sevilla)
Tlfn: (+34) 955 062 627
e-mail: thorsten.scherler.ext@juntadeandalucia.es

Este correo electrónico y, en su caso, cualquier fichero anexo al mismo,
contiene información de carácter confidencial exclusivamente dirigida a su
destinatario o destinatarios. Queda prohibida su divulgación, copia o
distribución a terceros sin la previa autorización escrita de "Sociedad
Andaluza para el Desarrollo de la Sociedad de la Información, S.A.U.". Si no
es Ud. el destinatario del mensaje le ruego lo destruya sin hacer copia
digital o física, comunicando a Sociedad Andaluza para el Desarrollo de la
Sociedad de la Información S.A.U. vía e-mail o fax la recepción del presente
mensaje. Toda declaración de voluntad contenida deberá ser tenida por no
producida. Gracias.
____________________________________________________________________________
___________________

The information in this e-mail and in any attachments is confidential and
solely for the attention and use of the named addressee(s). You are hereby
notified that any dissemination, distribution or copy of this communication
is prohibited without the prior written consent of "Sociedad Andaluza para
el Desarrollo de la Sociedad de la Información, S.A.U.". If you are not the
formal receiver of this message please destroy it without making any digital
or physical copy and inform "Sociedad Andaluza para el Desarrollo de la
Sociedad de la Información S.A.U." , by e-mail or fax, of the reception of
the present message. Any whatsoever involuntary declaration contained
herewith must be taken as having no legal effect. Thank you.
Re: Forrest 0.5.1: site.xml, tabs.xml & menus [ In reply to ]
Juan Jose Pablos wrote:
> Can anyone with better english skins apply this patch?

Do not worry about that - just commit. People can fix it
afterwards if it is not quite right.

I know that in this case it is already done, but this is
a note to make sure that nobody else worries about grammar,
spelling, and stuff - just do it.

--David
Re: Forrest 0.5.1: site.xml, tabs.xml & menus [ In reply to ]
David Crossley escribió:
> Juan Jose Pablos wrote:
>
>>Can anyone with better english skins apply this patch?
>
>
> Do not worry about that - just commit. People can fix it
> afterwards if it is not quite right.
>
> I know that in this case it is already done, but this is
> a note to make sure that nobody else worries about grammar,
> spelling, and stuff - just do it.
>
> --David
>

Thanks David.