Very Quick Wiki

Very Quick Wiki is originally by GarethCronin and has been taken over by MartijnVanDerKleijn? since September 2005. It can be downloaded from: http://www.vqwiki.org/downloads.php or http://sourceforge.net/projects/veryquickwiki.

The project has its own domain since around december 2005: http://www.vqwiki.org This domain also hosts its own VQWiki instance running the latest version. (released on May 1st, 2006: v.2.7.8)

It consists of a few JSPs and a few class files. It subscribes to almost all of the TextFormattingRules to conform to the WikiPrinciples, and includes a RecentChanges system and a search engine - it resides in a single WAR file. Drop it into the ApacheTomcat webapps directory or deploy in some other J2EE container instantly - no configuration necessary.

A demo used to run at http://jamienettles.com/. The domain is now expired.

Version 2.2 released on 24th October 2002 features email subscription/notification for topic changes.

Other features:


It took me a while to find my way through the source code for this wiki. I will excerpt a few key files here to show you what it looks like. It starts with a jsp file. This is an html file that has escapes into java code. The java code in this jsp creates a file handler and asks it to readLinked() at the point where it wants the processed page text to appear within the html.

  <html>
<head> <%@page import="vqwiki.*"%> <% String topic = request.getQueryString(); if( topic == null )
  topic = "StartingPoints";
FileHandler handler = new FileHandler(); handler.setFileName( topic + ".txt" ); %> </head> <body> <h1><%= topic %></h1> <%=handler.readLinked()%> <hr> <a href="edit.jsp?topic=<%=topic%>">Edit This</a> </body>
  </html>
Here is the implementation of readLinked() where the raw text file is opened. The opened input file is passed on to another program called Yylex where the token by token translation to html takes place.

  public synchronized String readLinked( String fileName ) throws IOException{
String contents = ""; fileName = fileBase + System.getProperty( "file.separator" ) + fileName; file = new File( fileName ); if( file.exists() ){ BufferedReader in = new BufferedReader( new FileReader( file ) ); Yylex lexer = new Yylex( in ); while( true ){ String line = lexer.yylex(); if( line == null ) break; contents += line; } } else return null;
  }
Here is the source for Yylex. This isn't java. It is a special language for describing tokens using regular expressions. After a few declarations, it is basically one big switch statement that answers what to do with various character sequences found in the input.

  newline= (\n|\r|\r\n)
  boundary= ({newline}[\ ]*{newline})
  newlinenotab= ({newline}[^\t])
  hr= (----)
  link= ([A-z][a-z]+([A-Z][a-z]+)+)
  hyperlink= (((http)|(ftp)|(mailto)|(news)):[^\ \t\r\n<>'\"]+[a-zA-Z0-9])
  image= ({hyperlink}(\.gif|\.jpg|\.png|\.jpeg))

{hr} {
return "\n<hr>\n"; }

  {image} {
String link = yytext(); return "<img src=\"" + link.trim() + "\">"; }

  {hyperlink} {
String link = yytext(); return "<a href=\"" + link.trim() + "\">" + ink + "</a>"; }

  "'''" {
if( strong ){ strong = false; return( "</strong>" ); } else{ strong = true; return( "<strong>" ); } }

  "''" {
if( em ){ em = false; return( "</em>" ); } else{ em = true; return( "<em>" ); } }

  {link} {
String link = yytext(); if( exists( link ) ){ return "<a href=\"wiki.jsp?" + link.trim() + "\">" + link + "</a>"; } else{ return link + "<a href=\"edit.jsp?topic=" + link.trim() + "\">?</a>"; } }

  . {
return yytext(); } I have taken some liberties with this code. Mostly I've deleted boilerplate that is required to hook the pieces together. I've also mixed a few versions as I sought to find the essence. If you are studying this and finding inconsistencies, it is time to read the real source. -- WardCunningham


It took me about 2 mins to set this up and start playing - great little program! It then took about half an hour to find out where it was putting the text files (turns out to be in the users default dir under Win2K). Would be nicer if they were somewhere under WEB-INF for the application. I wonder if minimal database support could be added......

...MySQL support is added as of 17-Feb-2002

Regarding the location of the files - you can easily go to the admin screen and change the location (don't forget to migrate your existing files to the new location).

I set up a wiki in my group using VeryQuickWiki. But I had to make some modifications on the JSPs and yylex to make it fit in Chinese. That edition can only run on containers that support servlet 2.3. I wonder whether these modifications can help others.

Those modifications will be added to the main release in the near future; in the mean time, I'll put them up on the web site. Which 2.3-only features are being used?


I seem to have a problem with edit locks in 2.4 on a filesystem-based 'vanilla' install. Any tips or tricks to be allowed to edit my pages again? Solution: rename the filename.lock to filename (overwrite).


2.4 (and 2.5) with Orion 2.0 yield the following:

 :500 Internal Server Error
 :Error parsing JSP page /wiki/jsp/wiki.jsp

:Error creating jsp-page instance: java.lang.ClassFormatError?: __jspPage2_jsp_wiki_jsp (Code of a method longer than 65535 bytes)

This is caused by the generated servlet source doPost/doGet method being larger than 64k. Java has a limit of a single method of 64k, this sort of things happens a lot with complex tag libraries for example. Hope that helps....[http://www.twinfeats.com]


The editing textarea definition could do with wrap=soft (or virtual) so that horizontal scrolling isn't needed when using a browser for which that isn't the default.


I'm running it with MySQL as the repository, but I haven't a clue where the thing stashes attachments. Anyone got any pointers to this ? About to delve into the source code...

On mine, (2.6.3, I think), the wiki inserted a 'jsp' directory within the directory I specified for downloads in the admin page, and placed the attached files there. Hope this helps.


Seeking help

1. Does anybody know of a live system running that I can go see?

2. What I can do to display the Chinese characters correctly?

3. Does anybody know how to attach doc (Ms Word) or PDF files on Linux (the error I get is - An error has occurred:null)?

Answer (2005-3-2): 1. see http://thinkbase.net 2. thinkbase provide a solution (it use UTF-8 entirely)

There is another GBK version, which use GBK for character encoding.

Since VQWiki release 2.7.8 it has full support for UTF-8. This should mean full support for languages like Chinese or Japanese.


CategoryWikiImplementation


EditText of this page (last edited May 12, 2006) or FindPage with title or text search