edittwiki - external editor tool for TWiki

January 2005
MoTuWeThFrSaSu
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
31      
Dec
2004
 Feb
2005

Home page for edittwiki - the external editor tool for TWiki wiki topics.

XML-Image Syndication

XML-Image Comment Feed

Letterimage Contact me

edittwiki - an external editor for TWiki wiki topics.

I have been using the editMoin tool to edit my Personal Wiki and have found the superior editing capabilities of an editor extremely handy. Integrated spell checking, syntax highlighting ... all very helpful. I've been working with a TWiki installation lately and have struggled to find a similar capability. SO, in the spirit of the editMoin tool, I have written the edittwiki external editor utility.

Download

The edittwiki 0.1.4 distribution can be downloaded from here. In addition the source is also available.

Prerequisites

You must have installed a current JRE/JDK for your platform and the java executable should be in your path. To test this, run java -version from a command prompt. You should get a response from your java installation with its release information.

This has been tested on Windows XP and should work on any platform that has a recent java JDK/JRE.

Installation

editTwiki is written in python and compiled into a java jar using Jython which makes it a regular java application packaged into a jar.

To install it, unzip the distribution into an installation directory. Next add the distribution's bin directory to your path and add the edittwiki.jar file to your CLASSPATH. Next, define the EDITTWIKI environment variable to point to to the edittwiki.cfg config file and edit the config file to reflect the twiki installation you want to use it with. Once you are setup, run the following:

java edittwiki --help

This should display the usage information. You are done and ready to work.

Edittwiki defaults to using notepad as your editor. To set your own editor, define the EDITOR variable to the full path to your editor of choice. For example:

SET EDITOR=c:\tools\vim\vim63\gvim.exe

Usage

The basic commands are follows:

java edittwiki -H host_section -T Web.Topic

If you have defined a twiki host section in your config file pointing to the twiki.org site, you would use this as follows:

java edittwiki -H twiki -T Main.MyUserHomePage

edittwiki.cfg

The purpose of the config file is allow you to setup the connection details for the TWiki sites you use in advance. This keeps the amount of typing down to a minimum.

The following is a sample config file:

[general]
host=www.twiki.org
protocol=http
userid=YourId
password=YourPassw0rd

[local]
host=localhost:8080
protocol=http
[external]
host=external.wiki.com 
subdir=/twiki
cgibin=bin
protocol=http
userid=YourId
password=YouPassw0rd

section

The section name is used on the command line to specify which server you want to talk to. If you do not specify a section, it looks for the general section as a default.

host

The host entry is the FQDN of the hostname where TWiki is installed. If your twiki install is on a port other than port 80, you should add it to the host setting. For example:

host=my.weird.server.com:8080

protocol

This is either http or https and must match your TWiki's installation (obviously).

subidr

If your TWiki site is installed in the root directory of the server and you access it through a url like:

http://my.server.org/bin/view/Main/MyTopic

Then you can safely ignore this setting. If however you use a url like the following:

http://my.server.org/twiki/bin/view/Main/MyTopic

then you need to define the initial directory after the hostname via the subdir setting.

cgibin

If your TWiki site has installed its scripts in a directory other than cgi-bin, you need to specify that here:

cgibin=bin

userid / password

If your TWiki install is secured, you will be prompted to enter your credentials when you run the edittwiki tool. To avoid this hassle, define your userid and password in the config section for the secured host and you will not be prompted.

Limitations

Thanks to David Blank-Edelman for extensively testing this with an https server. His conclusion is that due to a limitation in jython, it is not possible at this time. The current work around is to use the python source directly and update your python install to support https via openssl.

Feedback and Questions

I have tried to test this as extensively as I can, but doubtless there are many bugs and assumptions which will cause issues for others with their individual TWiki installations. Please provide any feedback you may have to (etaekema at earthlink dot net).

Updates

  • Version 0.1.4 - Exceptions were not being handled at all. This is a first cut at sensible exception and error reporting.

  • Version 0.1.3 - This release now handles TWiki forms safely.

  • Version 0.1.2 adds a cgibin configuration file entry to allow users to specific the 'bin' directory that the twiki scripts are in.

  • Version (0.1.1) to address tempfile creation bugs on linux. Thanks to Josh Sled for catching this.

last change 2005-01-02 22:37:36

Creative Commons License
This work is licensed under a Creative Commons License.