The VisualSiteMap action (see download on ActionMarket) is based on the LocalSiteMap action and uses the GraphViz package for a graphical representation of linked pages. It is nice for presenting the wiki concept.

SiteMap.png

The above is a screenshot of the sitemap for the HelpOnEditing page (using neato).

If you've got any questions, problems or feature proposals, contact me by email. -- ThomasLorenz 2004-09-13 08:08:21

What's different from webdot action?

The idea is based on the webdot.py action, but I more or less redid it from scratch. It differs from the webdot action in several ways:

Known Problems and troubleshooting

Discussion

   1     dotfile.write('fontcolor=black, fontname=%s , fontsize=%s, style=filled, color="%s"]\n' % ("arial","8", BOX_COLOR))

but is not working. Are there any 'tricks' to do this? (I know nothing about GraphViz, and little about Python). Thanks! 2004-12-02 Jaime Barciela (jbarciela at yahoo dot com)

Potential bug with pages with accented chars

We found what it seems a potential bug in VisualSiteMap when rendering maps of pages with accented characters. There is a differente coding for accented characters that makes the URL of the image and the image filename different.

For example, PáginaInicial (InitialPage in Spanish) is P(c3a1)ginaInicial on disk. However, in the URL PáginaInicial gets translated as P%C3%A1ginaInicial. The result is that the IMG SRC used is not the same that the URL.

The macro is not yet installed in the examples new server, so the URLs are not working right now. They will be in the next days. -- EduardoMercovich 2007-02-22 17:23:12

Note in this last working example that the nodes that contain accented characters (GestiónDelConocimiento, in the lower right corner) are generated wrong by graphviz.

Solved!

The solution to the utf8 problem that is in the current 1.3 release only solves the appearence of accented characters in nodes in the graphic.

The remaining problem was that, when you tried to build the VisualSiteMap of a node that has itself an accented character, the graphic wouldn't appear a all in the page. After examining what was happening in the server, I noticed that the problem was as follows:

Now, as I noted above, this image file is where moin is not processing anything, so the <img > tag is referencing a file named /wiki/cache/LaLetraEñe_2.png but the image is at /wiki/cache/LaLetraE(c3b1)e_2.png.

The solution: I could've bypassed the call to wikiutil.quoteWikinameFS(pagename) and directly generate the non-encoded name that would be found by the <img > tag, but there's a risk on how the os and the web server treat utf8 in the filenames (that's the reason for the existence of the wikiutil.quoteWikinameFS() method, after all. What I did, instead, is to simply quote the wikinamefs variable I got, and quoted that (instead of the original pagename) to generate the wikinameurl we'll use in the <img > tag.

The VisualSiteMap-image_utf8_name.patch is all you should need to get this right. :-)

-- MarianoAbsatz 2007-05-27 12:31:06

Permissions problems with image file generated

I guess this is due to my lack of knowledge of Python, but I have the following problem: VisualSiteMap is creating the files in the cache directory with mode '660' (-rw-rw----), however, the Apache server won't show me the .png file unless it has mode '644' (-rw-r--r--). Now, the .png file is actually created by a os.system() call to neato... how can I modify the subshell umask so that, at least that os.system() call generates the .png with the right permissions?

-- MarianoAbsatz 2007-02-23 15:32:22

Solved!

Well... I think noone took a look at this, 'cause the solution ended up being quite easy. I simple called os.umask(022) before VisualSiteMap started writing to files... I could've done it immediately before the os.system invocations, but that way, the .dot file would then have a different mode.

The VisualSiteMap-umask.patch is all you should need to get this right. :-)

-- MarianoAbsatz 2007-03-22 14:19:04

Using in a wiki farm

I'm trying (without success) to adapt VisualSiteMap in order that it can be used in multiple instances of a farm. I posted my question in FarmQuestions#find_directory_path if someone here can give me a hand, I'd be very grateful.

-- MarianoAbsatz 2007-05-15 20:34:58

(somehow) Solved

The only solution I could find to this turned out to be quite dumb: The path in CACHE_DIR need not be absolute. It can be relative to the directory where moin.cgi is. Since I have a different moin.cgi for every instance of the farm, I use the same name for the cache directory in a different branch of my directory structure and that's it.

Note also that CACHE_URL need not have the http:// prefix, so it can be an absolute path within this instance. So the first lines of my VisualSiteMap.py look like:

   1 # This should be a public path on your web server. The dot files, images and map files are created in this directory and
   2 # served from there.
   3 #CACHE_DIR  = "C:/DocumentRoot/cache"
   4 #CACHE_URL  = "http://my-server/cache"
   5 #CACHE_DIR  = "/org/de.wikiwikiweb.moinmaster/htdocs/cache"
   6 #CACHE_URL  = "http://moinmaster.wikiwikiweb.de/wiki/cache"
   7 CACHE_DIR  = "wiki/cache"
   8 CACHE_URL  = "/wiki/cache"
   9 
  10 # Absolute location of the dot (or neato) executable.
  11 #DOT_EXE    = "C:/Programme/ATT/GraphViz/bin/dot.exe"
  12 #DOT_EXE    = "/usr/bin/dot"
  13 DOT_EXE    = "/usr/bin/neato"
  14 
  15 # Categories are filtered in some way.
  16 CATEGORY_STRING = "^Category"

-- MarianoAbsatz 2007-05-27 12:47:02

Related

See also WikiVisualization and MoinMoinAsPim.

MoinMoin: VisualSiteMap (last edited 2007-10-29 19:19:45 by localhost)