Very Quick Wiki is originally by Gareth Cronin and has been taken over by Martijn Van Der Kleijn since September 2005. It can be downloaded from: www.vqwiki.org or sourceforge.net .
The project has its own domain since around december 2005: 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 Text Formatting Rules to conform to the Wiki Principles, and includes a Recent Changes system and a search engine - it resides in a single WAR file. Drop it into the Apache Tomcat webapps directory or deploy in some other J2EE container instantly - no configuration necessary.
A demo used to run at jamienettles.com . The domain is now expired.
Version 2.2 released on 24th October 2002 features email subscription/notification for topic changes.
Other features:
reports for all topics, orphaned topics, to-do topics
an admin console where topics can be locked (e.g. if you want to lock your Starting Points)
a full built-in diff function that doesn't depend on having the Unix diff tool (or a port of it) on your system
username cookies
binary file uploads/attachments
optional HTML support (not recommended for public Wiki, but useful on Intranets)
Words in "Camel Case" become links to topics as named by the Wiki Name. VQWiki also allows wiki-naming by surrounding a word in back-ticks. (No spaces allowed in back-ticked Wiki Names.)
VQWiki features changeable parsers. This means you can write your own parser. It currently supports parsers based on JFlex but a new system supporting more parsers is in the works.
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>
<%@page import="vqwiki.*"%>
<% String topic = request.getQueryString(); if( topic == null )
topic = "S''''''tartingPoints";
FileHandler handler = new FileHandler(); handler.setFileName( topic + ".txt" );
%>
<%= topic %>
<%=handler.readLinked()%>
</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
\n";
}
{image} {
String link = yytext(); return "";
}
{hyperlink} {
String link = yytext(); return "" + ink + "";
}
"'''" {
if( strong ){ strong = false; return( "" );
} else{ strong = true; return( "" );
}
}
"''" {
if( em ){ em = false; return( "" );
} else{ em = true; return( "" );
}
}
{link} {
String link = yytext(); if( exists( link ) ){ return "" + link + "";
} else{ return link + "?";
}
}
. {
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. -- Ward Cunningham
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 Very Quick Wiki. 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.Class Format Error: __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 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 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.
See original on c2.com