You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Berin Loritsch <bl...@apache.org> on 2003/02/25 22:33:16 UTC

Site.xml questions.

The site.xml is too abstract for me to get my head around.  I need some
help understanding how the site.xml relates to the menus for tabs.

I have the enclosed site.xml and tabs.xml files, but when I generate my
site, I get nothing in the menu for the tabs.

Also, I find it anoying that the full Site.xml menu is rendered for the
first level pages.  Is there any way to suppress that behavior?  I will
be having some project specific documentation in connection with a main
site, so I want everything to blend nicely.  I am not seeing how this
can be done without using the old book.xml format--which I would rather
not do.  HOwever it is not convenient to have to manage my menu in a
global context to have my local content rendered.

I want to have my tabs set up, and then the sites for the associated
projects linked to--without getting the annoying error pages.

Re: Site.xml questions.

Posted by Mark Vovsi <ma...@vovsi.com>.
Berin,

I've attached a site.xml and tabs.xml for a sample site I set up. You should
be able to figure everything out from them I think. To start off make sure
to include the href attribute in your menu tags, like ...
<guiapp label="GUI App" href="guiapp/">

You can also check out the site.xml and tabs.xml from the forrest site, the
source for which comes with the distribution.

- Mark


----- Original Message -----
From: "Berin Loritsch" <bl...@apache.org>
To: <fo...@xml.apache.org>
Sent: Tuesday, February 25, 2003 4:33 PM
Subject: Site.xml questions.


> The site.xml is too abstract for me to get my head around.  I need some
> help understanding how the site.xml relates to the menus for tabs.
>
> I have the enclosed site.xml and tabs.xml files, but when I generate my
> site, I get nothing in the menu for the tabs.
>
> Also, I find it anoying that the full Site.xml menu is rendered for the
> first level pages.  Is there any way to suppress that behavior?  I will
> be having some project specific documentation in connection with a main
> site, so I want everything to blend nicely.  I am not seeing how this
> can be done without using the old book.xml format--which I would rather
> not do.  HOwever it is not convenient to have to manage my menu in a
> global context to have my local content rendered.
>
> I want to have my tabs set up, and then the sites for the associated
> projects linked to--without getting the annoying error pages.
>


----------------------------------------------------------------------------
----


> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE tabs PUBLIC "-//APACHE//DTD Cocoon Documentation Tab V1.0//EN"
"tab-cocoon-v10.dtd">
>
> <tabs software="MyProj"
>   title="MyProj"
>   copyright="Foo"
>   xmlns:xlink="http://www.w3.org/1999/xlink">
>
>   <!-- The rules are:
>     @dir will always have /index.html added.
>     @href is not modified unless it is root-relative and obviously
specifies a
>     directory (ends in '/'), in which case /index.html will be added
>   -->
>
>
>   <tab label="Home" dir=""/>
>   <tab label="GUI App" dir="guiapp"/>
>   <tab label="ExFormula" dir="exformula"/>
>
> </tabs>
>


----------------------------------------------------------------------------
----


> <?xml version="1.0"?>
>
> <!--
> Forrest site.xml
>
> This file contains an outline of the site's information content.  It is
used to:
> - Generate the website menus (though these can be overridden - see docs)
> - Provide semantic, location-independent aliases for internal 'site:'
URIs, eg
> <link href="site:changes"> links to changes.html (or ../changes.html if in
>   subdir).
> - Provide aliases for external URLs in the external-refs section.  Eg,
<link
>   href="ext:cocoon"> links to http://xml.apache.org/cocoon/
>
> See http://xml.apache.org/forrest/linking.html for more info
> -->
>
> <site label="D-Haven.org" href=""
xmlns="http://apache.org/forrest/linkmap/1.0">
>
>   <about label="About">
>     <index label="Index" href="index.html"/>
>     <faq label="FAQ" href="faq.html"/>
>     <changes label="Changes" href="changes.html"/>
>     <todo label="Todo" href="todo.html"/>
>   </about>
>
>   <guiapp label="GUI App">
>     <index label="About" href="index.html"/>
>   </guiapp>
>
>   <exformula label="ExFormula">
>     <index label="About" href="index.html"/>
>   </exformula>
>
> </site>
>

java exception when running as webapp

Posted by Mark Vovsi <ma...@vovsi.com>.
When I run my forrest site as a webapp I constantly get long Java Exception
messages, which start with:

java.lang.ClassNotFoundException:
org/apache/xml/dtm/ref/IncrementalSAXSource_Xerces

Do I maybe have an incorrect version of some .jar? I'm using Tomcat 4.1.12
on Windows XP, with jdk 1.4.

Thanks,
- Mark


Here's the continuation:

        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:130)
        at
org.apache.xml.dtm.ref.DTMManagerDefault.getDTM(DTMManagerDefault.jav
a:269)
        at org.apache.xpath.XPathContext.getDTM(XPathContext.java:169)
        at
org.apache.xpath.SourceTreeManager.parseToNode(SourceTreeManager.java
:345)
        at
org.apache.xpath.SourceTreeManager.getSourceTree(SourceTreeManager.ja
va:316)
        at
org.apache.xalan.templates.FuncDocument.getDoc(FuncDocument.java:316)

        at
org.apache.xalan.templates.FuncDocument.execute(FuncDocument.java:235
)
        at org.apache.xpath.Expression.asIterator(Expression.java:273)
        at
org.apache.xpath.axes.FilterExprWalker.setRoot(FilterExprWalker.java:
156)
        at
org.apache.xpath.axes.WalkingIteratorSorted.reset(WalkingIteratorSort
ed.java:292)
        at
org.apache.xpath.axes.LocPathIterator.setRoot(LocPathIterator.java:37
3)
        at
org.apache.xpath.axes.WalkingIteratorSorted.setRoot(WalkingIteratorSo
rted.java:170)
        at
org.apache.xpath.axes.LocPathIterator.execute(LocPathIterator.java:24
2)
        at org.apache.xpath.XPath.execute(XPath.java:318)
        at
org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:31
1)
        at
org.apache.xalan.templates.XUnresolvedVariable.execute(XUnresolvedVar
iable.java:166)
        at
org.apache.xpath.VariableStack.getGlobalVariable(VariableStack.java:4
07)
        at org.apache.xpath.operations.Variable.execute(Variable.java:170)
        at org.apache.xpath.Expression.asIterator(Expression.java:273)
        at
org.apache.xpath.axes.FilterExprWalker.setRoot(FilterExprWalker.java:
156)
        at
org.apache.xpath.axes.WalkingIteratorSorted.reset(WalkingIteratorSort
ed.java:292)
        at
org.apache.xpath.axes.LocPathIterator.setRoot(LocPathIterator.java:37
3)


Re: Site.xml questions.

Posted by Berin Loritsch <bl...@apache.org>.
Nicola Ken Barozzi wrote:
> 
> 
>> In that respect it is similar to the way Avalon is set up--but I don't
>> want to use the old book.xml if I can help it.
> 
> 
> I think I get it.
> 
> Well, ATM the "solution" would be to make each subproject an indipendent 
> forrest site and link in the tabs using http urls. The problem is here 
> that you will loose common menus... what about adding xinclude 
> capability to site.xml? How do you build all the docs... would xinclude 
> help?
> 

I am a blank slate right now as everything is just being set up.

How would the xinclude process work?

Then again, I can keep doc building in the master repo and the
xdocs with the subprojects...  But that is fairly messed up too.


Re: Site.xml questions.

Posted by "Joshua P. Dady" <jp...@indecisive.com>.
Nicola Ken Barozzi wrote:
> Currently going to a subdir will show on the left only the part of 
> site.xml related to that dir. Make the tab point to a dir...

Okay, now you've got me going.  8)  Isn't this solving a different, but 
closely related problem to what he's asking about?  (I ask mostly 
because, if I'm confused, I'd like to hear where I went off.  And maybe 
because I want the same behavior I think he's looking for)

Given a layout like the following:

My Site
+- Foo
+- Bar
+- Bonk
|  +- Foo
|  `- Bar
`- Splat
    +- Foo
    `- Bar

And tabs pointing at /, /Bonk/, and /Splat/, I think he's asking how to 
remove the /Bonk and /Splat subtrees from the menu when the / tab is 
selected.  Unless its been too long since I've updated, doesn't this 
only help with /Bonk and /Splat, barring generating the site in a 
different layout than it is deployed?  (Or is this exactly what you're 
suggesting?)  I get the xpath reference in the following paragraph.

   -Josh


RE: Site.xml questions.

Posted by Robert Koberg <ro...@koberg.com>.
Hi,

> -----Original Message-----
> From: Nicola Ken Barozzi [mailto:nicolaken@apache.org]
> Sent: Tuesday, February 25, 2003 3:00 PM

> Berin Loritsch wrote, On 25/02/2003 23.44:
> > Nicola Ken Barozzi wrote:
> >> Berin Loritsch wrote, On 25/02/2003 22.33:
> >>
> >>> The site.xml is too abstract for me to get my head around.  I need some
> >>> help understanding how the site.xml relates to the menus for tabs.
> >>
> >> Simple, they are not related.
> >
> > That is confusing.  They look like they should be.
>
> Actually someone implied that we should unite the two in a single file.
> It was a nice discussion, unfortunately it got sidetracked for now...

Don't know if that someone was me, but I have included an example site.xml and
the W3 XML Schema. There is a little documentation in the XML Schema. I used XML
Spy to generate some documentation but even zipped it is about 120k (mainly the
PNGs), so I thought it was a little much to send to the list. If you have a
graphical viewer (like Spy) for XML Schema's it would make it easier to
understand. If anyone wants I can send off the generated docs.

I also included an HTML/JS/MSXML4 nav. It loads an XSL (sitetree.xsl), loads the
XML and assigns the Schema to it. Then it transforms the site.xml into a nav
tree. The nav tree is basically XML so it uses the nav.css to display it
properly. You can play around with the site.xml and display nav.html in IE to
check validity.

I use the site.xml to build things like the nav, tabs, snailtrail, pager, to
create valid links, and ensure everything in the site is correct (see the keys
and keyrefs in the site Schema).

If people are up for more site.xml talk, I am all for it :)

best,
-Rob

Re: Site.xml questions.

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Berin Loritsch wrote, On 25/02/2003 23.44:
> Nicola Ken Barozzi wrote:
> 
>>
>> Berin Loritsch wrote, On 25/02/2003 22.33:
>>
>>> The site.xml is too abstract for me to get my head around.  I need some
>>> help understanding how the site.xml relates to the menus for tabs.
>>
>> Simple, they are not related.
> 
> That is confusing.  They look like they should be.

Actually someone implied that we should unite the two in a single file.
It was a nice discussion, unfortunately it got sidetracked for now...

...
>>> Also, I find it anoying that the full Site.xml menu is rendered for the
>>> first level pages.  Is there any way to suppress that behavior?
>>
>> Enhance the skin.
> 
> Instructions?
> 
> I have already some changes to the skin to make my site structure
> unique.  The thing about the root menu is how do you know what
> belongs there?  Currently Forrest is a "black box" in my mindset.
> I want to keep it as black box as possible.
> 
> What I want is the root menu to exclude anything that is a tab.
> You can't do that unless the site and tab XML files have a definite
> relationship.
> 
> Can you post an example of how I would exclude site nodes that
> relate to a tab?  Or at lest point me in the right direction?

Currently going to a subdir will show on the left only the part of 
site.xml related to that dir. Make the tab point to a dir...

Another solution, more elaborate but doable, is to work on the site2html 
stylesheet. This stylesheet has access to both the tabs and the menu, so 
with some xpath you can exclude menu parts base on tabs.
In the krysalis skin there is an inverse thing done: we enhance the menu 
on the left with the section titles of the document.

>>> I will
>>> be having some project specific documentation in connection with a main
>>> site, so I want everything to blend nicely.  I am not seeing how this
>>> can be done without using the old book.xml format--which I would rather
>>> not do.  HOwever it is not convenient to have to manage my menu in a
>>> global context to have my local content rendered.
>>
>> Could you please expand on this?
> 
> Ok, I have a new project called "d-haven" at SourceForge.  I want it to
> host some sub projects related to building a developer collaboration
> portal.  I am using Forrest to get started on the docs.  I want the
> sub projects to manage the xdocs local to the sub project CVS structure,
> yet be accessible via a tab (there are only a minimal number of planned
> projects).
> 
> In that respect it is similar to the way Avalon is set up--but I don't
> want to use the old book.xml if I can help it.

I think I get it.

Well, ATM the "solution" would be to make each subproject an indipendent 
forrest site and link in the tabs using http urls. The problem is here 
that you will loose common menus... what about adding xinclude 
capability to site.xml? How do you build all the docs... would xinclude 
help?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: Site.xml questions.

Posted by Berin Loritsch <bl...@apache.org>.
Nicola Ken Barozzi wrote:
> 
> 
> Berin Loritsch wrote, On 25/02/2003 22.33:
> 
>> The site.xml is too abstract for me to get my head around.  I need some
>> help understanding how the site.xml relates to the menus for tabs.
> 
> 
> Simple, they are not related.

That is confusing.  They look like they should be.

>> I have the enclosed site.xml and tabs.xml files, but when I generate my
>> site, I get nothing in the menu for the tabs.
> 
> 
> In the tabs you define that the tabs refer directories, for example 
> guiapp. In the site you define guiapp as a link.
> 
> So the tab links to the guiapp dir, but in site.xml there is no link to 
> the guiapp dir...

Someone pointed out that error, and that fixed the initial problem I
was having.

> 
>> Also, I find it anoying that the full Site.xml menu is rendered for the
>> first level pages.  Is there any way to suppress that behavior?
> 
> 
> Enhance the skin.

Instructions?

I have already some changes to the skin to make my site structure
unique.  The thing about the root menu is how do you know what
belongs there?  Currently Forrest is a "black box" in my mindset.
I want to keep it as black box as possible.

What I want is the root menu to exclude anything that is a tab.
You can't do that unless the site and tab XML files have a definite
relationship.

Can you post an example of how I would exclude site nodes that
relate to a tab?  Or at lest point me in the right direction?


>> I will
>> be having some project specific documentation in connection with a main
>> site, so I want everything to blend nicely.  I am not seeing how this
>> can be done without using the old book.xml format--which I would rather
>> not do.  HOwever it is not convenient to have to manage my menu in a
>> global context to have my local content rendered.
> 
> 
> Could you please expand on this?

Ok, I have a new project called "d-haven" at SourceForge.  I want it to
host some sub projects related to building a developer collaboration
portal.  I am using Forrest to get started on the docs.  I want the
sub projects to manage the xdocs local to the sub project CVS structure,
yet be accessible via a tab (there are only a minimal number of planned
projects).

In that respect it is similar to the way Avalon is set up--but I don't
want to use the old book.xml if I can help it.



Re: Site.xml questions.

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Berin Loritsch wrote, On 25/02/2003 22.33:
> The site.xml is too abstract for me to get my head around.  I need some
> help understanding how the site.xml relates to the menus for tabs.

Simple, they are not related.

> I have the enclosed site.xml and tabs.xml files, but when I generate my
> site, I get nothing in the menu for the tabs.

In the tabs you define that the tabs refer directories, for example 
guiapp. In the site you define guiapp as a link.

So the tab links to the guiapp dir, but in site.xml there is no link to 
the guiapp dir...

> Also, I find it anoying that the full Site.xml menu is rendered for the
> first level pages.  Is there any way to suppress that behavior?

Enhance the skin.

> I will
> be having some project specific documentation in connection with a main
> site, so I want everything to blend nicely.  I am not seeing how this
> can be done without using the old book.xml format--which I would rather
> not do.  HOwever it is not convenient to have to manage my menu in a
> global context to have my local content rendered.

Could you please expand on this?

> I want to have my tabs set up, and then the sites for the associated
> projects linked to--without getting the annoying error pages.


-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Re: Site.xml questions.

Posted by Jeff Turner <je...@apache.org>.
On Tue, Feb 25, 2003 at 04:33:16PM -0500, Berin Loritsch wrote:
> The site.xml is too abstract for me to get my head around.  I need some
> help understanding how the site.xml relates to the menus for tabs.

The HTML is quite deceptive: as you say, it looks like each menu belongs
to a tab.  Actually, tabs are completely optional, passive things.  They
simply react to the current path.  If the tab's path is the longest one
that matches the current page path, then that tab is "on".

IOW, don't worry about tabs until you're happy with your site menu.

> I have the enclosed site.xml and tabs.xml files, but when I generate my
> site, I get nothing in the menu for the tabs.
> 
> Also, I find it anoying that the full Site.xml menu is rendered for the
> first level pages.  Is there any way to suppress that behavior?

Not without sitemap hacking.  Yours is a common need though, so we'll
have to parametrize this sooner or later.

There are two options:

1) Just use book.xml files.  This isn't as bad as it sounds, because you
can use 'site:' links in book.xml:

<menu-item label="Overview" href="site:howto-samples/overview"/>

so you don't have to manually add/delete the ..'s when synching book.xml
files.

2) Make a 1-line addition to the sitemap.

Here is the relevant pipeline (line 539) which selects the subset of
site.xml to render:

         <map:match pattern="abs-linkmap/**">
            <map:generate src="cocoon:/abs-linkmap" />

            <map:transform type="xpath">
               <map:parameter name="include" value="//*[@href='{1}']" />
            </map:transform>

            <map:serialize type="xml" />
         </map:match>

Here, {1} matches the current relative directory path.  The "abs-linkmap"
pipeline serves up a site.xml with absolute paths.  The "xpath"
transformer selects only the node with a matching href path.

To limit the tree, we can provide an "exclude" parameter to the xpath
transformer.

        <map:transform type="xpath">
           <map:parameter name="include" value="//*[@href='{1}']" />
           <map:parameter name="exclude" value="//*[@href='{1}']/*/*/*/*" />
        </map:transform>

Through trial and error, I found that eliminates the listing of sub-menu
contents.

It's a pity that menu titles aren't clickable links, or we could prune
one step further up the menu tree.


--Jeff