JSiteMap Manual
Instructions
Application
What's behind
Configuration
System requirements
Credits
JSiteMap is an open source java site map generator; more precisely is a converter: from an HTML-only map to a Javascript, dynamic HTML map
(click on the links to see the difference).
Instructions:
1. JSiteMap is platform independent, but needs an input HTML code. You can easily generate the HTML map if you are a Microsoft® Windows® user; for everyone else a future release will include also a Java HTML map generator (but in the meantime you can try the Wine emulator; I haven't yet tested on it anyway).
The first step is downloading Xenu's Link Sleuth (TM) for Microsoft® Windows® . Follow the instructions and run it on your PC. Xenu will generate the HTML site map, and also an useful broken link report. I suggest you to customize the report: go to Options - Preferences. Set the maximum level to 5 or 6. You can try other values, but a too great value will generate a chaotic map; anyway that's my opinion, find the best option for you.
2. Now you have to copy the HTML source code into JSiteMap applet. To do so, in most of the browsers, right-click the report and press "HTML" or "View Source". The default editor will open, then select all HTML code and copy it. There's no need to search for the map starting point within the whole code, JSiteMap will do it for you.
3. Paste HTML code into JSiteMap.
4. Press 'Generate'. The applet will elaborate the map and you will find the javascript code in the second textarea.
5. Select all the js code (right-click -> select all could work, depending on your JVM version), copy it and paste it into the file jsitemap/sitemap/generatedCode.js .
6. Open in your browser jsitemap/sitemap/index.html and you will see your first javascript-tree map!
Application
JSiteMap applet can also be used as a standalone application. But to do so you need a JVM insatalled on your system. Click here to download JRE or JDK from Sun's site. To launch the application just click on the jsitemapWin icon inside the jsitemap folder. The features of the application are the same of the applet version.
What's behind
Once the HTML map code has been inserted into the applet, a parsing is done on it. The HTML-only map already has inside the particular structure of a tree (see this example), but is static. In general there is a root node with some children nodes which may have other children. Nodes are grouped in HTML lists, and each of them is placed in a list item. The parsing will retrieve for each node the URL and the title of the page, and they will be put in the javascript tree.
Before generating the javascript code, a tree image is kept in memory, in form of a java tree structure; this step is useful in an object-oriented design, in order to logically separate the parsing (input) from the script-generation (output). An advantage is, for example, that writing a new parser (for instance based on a different HTML-map syntax) will be easier with an object-oriented design. The TreeNode class was written by Craig R. McClanahan (Apache Software Foundation) and modified by me in order to obtain compatibility with Java 1.1 browsers (the majority).
The syntax used in the HTML-only map generated by Xenu Link Sleuth 1.2d is the following:
Description
|
HTML fragment
|
Java field name
|
Map start point | <A name=sitemap> | startTag |
Map end point | <A href="#top"> | STOPTag |
URL start point | <A href=" | hrefTag |
URL end point | "> | endURLTag |
href end point | </A> | hrefEndTag |
list start point | <UL> | startListTag |
list end point | </UL> | endListTag |
list item start point | <LI> | listItemTag |
list item end point | </LI> | endListItemTag |
| | |
The last step is the generation of the script. I choosed Morten Wang's Javascript Tree Menu as dynamic graphical representation of the map. This tree menu is highly configurable, so I suggest you to take a look at Morten's site to learn all the options.
For example: do you want the tree to emulate the same behaviour of Microsoft® Windows Explorer? Simply add this line at the beginning of the file generatedCode.js:
var MTMEmulateWE=true;
Now you're ready to generate your first map or to view the tutorial.
Enjoy it!
Configuration
You can configure the applet editing the file jsitemap/classes/JSiteMap.html ; the application has its own configuration file: jsitemap/config/JSiteMap.cfg
Anyway you shouldn't modify the standard configuration: at the moment there's only one reason to do it. In case JSiteMap doesn't work properly, probably it's because the HTML fragments are parsed in a case-sensitive way. So - only in this case - you can try modifying the fields in the table above.
Another reason (for developers) is to allow different syntaxes, without recompiling the classes.
The last parameter (htmlCode) is useful if you want JSiteMap to start with a particular HTML code displayed. I used this option in the tutorial.
System requirements
JSiteMap has been successfully tested on the following Java 1.1 browsers (minimum requirements):
Microsoft® Internet Explorer 5.0, Netscape® Communicator 4.7, Netscape® Navigator 4.76, Mozilla 1.0.
.. and on the following platforms:
Microsoft® Windows® 98/NT/XP, GNU Linux 2.2.
If you have tested JSiteMap on older versions or different platforms, please let me know!
Credits
Xenu's Link Sleuth(TM) is copyright of Tilman Hausherr.
Javascript Tree Menu is copyright of Morten Wang.
The class TreeNode is copyright of the Apache Software Foundation and was written by Craig R. McClanahan.
Teutoburgo Home
Copyright Pierre Blanc 2003
Legal notice