On Fri, 2005-09-16 at 23:10 +0200, Markus Kühn wrote:
> Is there any resource to find out what kind of info the tree needs to 
> display a custom tree structure?

I don't think there's any documentation about that...
But here is an example:

When you click on a [+] sign to open a subtree, the script will load the
children of that node, expecting an xml fragment like the following:

<nav:fragment area="authoring" base="/">
  <nav:node id="index" visibleinnav="true" folder="false" suffix=".html"
basic-url="/index" language-suffix="_de" href="/index_de.html">
    <nav:label xml:lang="de">Home</nav:label>
  </nav:node>

  <nav:node id="tutorial" visibleinnav="true" folder="true"
suffix=".html" basic-url="/tutorial" language-suffix="_de"
href="/tutorial_de.html">
    <nav:label xml:lang="de">Tutorial</nav:label>
  </nav:node>

  <nav:node id="concepts" visibleinnav="true" folder="false"
suffix=".html" basic-url="/concepts" language-suffix=""
href="/concepts.html">
    <nav:label xml:lang="en">Concepts (english only)</nav:label>
  </nav:node>

  <nav:node id="features" visibleinnav="true" folder="false"
suffix=".html" basic-url="/features" language-suffix="_de"
href="/features_de.html">
    <nav:label xml:lang="de">Funktionen</nav:label>
  </nav:node>

  <nav:node id="doctypes" visibleinnav="true" folder="true"
suffix=".html" basic-url="/doctypes" language-suffix="_de"
href="/doctypes_de.html">
    <nav:label xml:lang="de">Dokumenttyp Beispiele</nav:label>
  </nav:node>
</nav:fragment>

The nodes in the fragment will be inserted as nodes in the tree.
The folder attribute indicates whether a node has children.
When the tree is initialized, it will expect a fragment containing an
additional <site> element:

<nav:fragment>
  <nav:site url="" area="authoring" folder="true" label="Authoring">
    <nav:node id="index" visibleinnav="true" folder="false"
suffix=".html" basic-url="index" language-suffix="_de"
href="index_de.html">
      <nav:label xml:lang="de">Home</nav:label>
    </nav:node>
    
    <more nodes here.../>

  </nav:site>
</nav:fragment>


If you want to use the tree script for your own purpose, you may have to
subclass the NavRoot or the NavNode class defined in navtree.js.
You can find an example about how to do this in
src/webapp/lenya/xslt/bxeng/link.xsl
And if the NavRoot/NavNode classes are too specific for you, subclass
the Root/Node classes from tree.js directly.
You will also have to write pipelines to generate the above xml (the
pipeline for the current implementation is in info.xmap).
 
> Does the script of the demo (v 1.2.5) conform to the apache 
> license?

The author of tree.js granted us permission to use it for Apache Lenya.
But I don't know if the license header is correct.

> Should I use v 1.4 ?

The tree script is almost identical in 1.2.x and 1.4-dev

hth,
Josias


> Markus
> 
>  
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to