Tags:
create new tag
view all tags

EditTWikiExternalEditorAddOnDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on EditTWikiExternalEditorAddOn contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Development Site for EditTWikiExternalEditorAddOn

Just a quick note, the original version of the edittwiki tool made a mess of the form meta data. This has now been corrected in release 0.1.3.

Here are links to the binary distribution as well as the source code for anyone who had difficulty finding it::

-- EdTaekema - 01 Jul 2004

While you're at it, can you give us a run-down of how this differs from/is better than: EditDaemonWithGVimIntegration and EditorDaemonAddOn?

-- CrawfordCurrie - 02 Jul 2004

Thanks for your feedback on EditTWikiExternalEditorAddOn. I've updated the download information on the home page for edittwiki.

As far as a comparison to EditDaemonWithGVimIntegration and EditorDaemonAddOn is concerned, the main differences as I see them are the following:

  • Requires no skin changes so you can use it pretty widely with most public TWiki installs and it is likely to work with even highly customized sites.
    • AFAIK neither does EditorDaemonAddOn; it parses the 'edit' page to extract the textarea, I think. -- CC
  • Runs on Java and so most users will not need to add additional software to use this.
    • Au contraire, most users will need the Java Plugin if Java 1.3/1.4 is required. Can you repackage for JRE1.1? -- CC
    • Actually, this is packaged as a Java app not an applet... so you can run it from an icon on the desktop / or from the command line and it supports JRE/JDK 1.1 and forward I believe. Alternatively, if you download the source code (read script) you can run it using either jython or python at any recent release (2.1 and forward) ... ET
  • It less complicated in that it 'understands' the edit presentation in twiki and is command line driven so you can easily save off the topics you regularly edit and invoke them quickly.
    • I'm all in favour of simplicity! -- CC
In the end, it is similar in effect. One of the directions I am taking this is to write an offline editor for twiki. This is mostly done, but I need to merge the latest cut of the edittwiki code that fixes form data handling issues into it. WHen it is done, it correctly 'merges' changes made since the topic was saved locally before publishing it up to the twiki host again. In order to make all that work, I needed an edittwiki type of app that was command line and filesystem focussed.

I am interested in how the EditorDaemonAddOn is invoked as that is something I had thought would make this much easier ... Finally, I am looking at a way to integrate offline TWiki editing with existing Wiki editors for other systems like TimTam and others.

I hope this helps.

EdTaekema - 02 Jul 2004

Ed, when you say "offline editing" I assume that you mean that you check out a topic (i.e., lock for editing for an indefinite time) and then edit in the file system? Or are you saying that you edit a topic and later attempt to merge albeit there might have been numerous changes to the topic since you took the copy offline?

I think that the offline editing will be a wonderful addition either way. You might also think how one could use the same idea to implement a distributed twiki where the topics are on various locations, edited locally, but then reflected on the other sites. (There is some code in the code base but it never got finished.)

-- ThomasWeigert - 03 Jul 2004

Thanks Ed for contributing this add-on!

I renamed the add-on topic from TwikiExternalEditor to EditTWikiExternalEditorAddOn. This is more descriptive and lets it identify as an add-on.

Any reason to use HTML in the add-on topic? It makes it kind of hard to maintain.

For a later version could you attach it to the add-on topic?

-- PeterThoeny - 05 Jul 2004

Sorry, Peter, this was my fault. I took the HTML from Ed's project page and inserted it in the twiki to have more explanation. This should eventually be translated into twiki ML, I believe...

-- ThomasWeigert - 06 Jul 2004

Peter, thanks for the wiki gardening ... I wasn't really sure where to put this. I will translate the html pages into twiki Markup as soon as I have a few spare seconds...

As far as the "offline editing" I mentioned above, what I have working at the moment is a publish / subscribe model that allows you to automatically merge changes made to your offline topics into topics you are editing ... very much like how CVS works. I still need to add in the the meta data smarts that edittwiki has and then I may release it. So far it seems to work quite well.

-- EdTaekema - 06 July 2004

Ed, I had a number of problems getting this going.

  1. Errors in getting the URL are unhelpfully reported as stack traces
  2. The default path to the editor c:\windows\system32\notepad.exe doesn't exist on my machine. notepad is on the PATH; this default should just be 'notepad'.
  3. SET EDITOR=C:\PROGRA~1\pfe101i\pfe32.exe caused edittwiki to give me this error: c:progra~1pfe101ipfe32.exe not found
  4. edittwiki just crashes when I try to java -cp c:\edittwiki\lib\edittwiki.jar edittwiki -H twiki -T Main.CrawfordCurrie
I gave up at this point. edittwiki.cfg contains:
[general]
host=localhost
protocol=http
cgibin=bin
[local]
host=localhost
subdir=
cgibin=bin
protocol=http
userid=Crawford
password=********
[twiki]
host=twiki.org
cgibin=cgi-bin
subdir=
protocol=http
userid=CrawfordCurrie
password=********

-- CrawfordCurrie - 09 Jul 2004

I think that if you leave out the subdir= line altogether it shold work. The next release of edittwiki will likely have better error handling ... Thanks for testing this out!

Here is my config file that I am using at the moment to edit this entry.

[general]
host=localhost:8080
protocol=http
cgibin=bin

[twiki]
host=twiki.org
protocol=http
userid=EdTaekema
password=*********
cgibin=cgi-bin

The command I run to launch this edit session is:


java edittwiki -H twiki -T Plugins.EditTWikiExternalEditorAddOnDev

-- EdTaekema - 9 Jul 2004

I succeeded in getting this addon to work following the instructions and using the config file given above, except that I had to explicitly set the EDITOR environmental variable. Relying on the default did not start an editor. I tried Notepad and Xemacs as editors.

A suggestion, though. When you invoke edittwiki on a topic, there is no indication whether somebody else is already editing the topic. Consequentially, loss of data is likely to result unless one is the only person on the system. I would add a check that will cause edittwiki to fail if the topic is being edited already. Alternatively, a prompt similar to the one when editing on the wiki could be offered. (Albeit that should optionally be done programmatically, in case one uses editors such as emacs to edit the topic).

Assuming that the possibility of data corruption can be minimized, I think that my users would very much embrace this addon.

-- ThomasWeigert - 9 Jul 2004

You are probably aware of this, but error handling is not very strong. For example, when you try to edit a topic that is protected (I was trying to test this), you merely get a stack trace:

Exception in thread "main" Traceback (innermost last):
  File "C:\Tools\eclipse\workspace\editTWiki\pysrc\edittwiki.py", line 0, in main
  File "C:\Tools\eclipse\workspace\editTWiki\pysrc\edittwiki.py", line 0, in edit
  File "C:\Tools\eclipse\workspace\editTWiki\pysrc\edittwiki.py", line 0, in parseForm
AttributeError: 'None' object has no attribute 'fetch'
You might want to catch these exceptions and report what happened.

-- ThomasWeigert - 9 Jul 2004

Thank you very much for all your suggestions. I am working on a new cut of this tool this week and am planning to add the following improvements:

  • Improved error handling for web connections
  • Improved detection of locked web pages
  • better file extensions to work with the GVIM twiki syntax file

Again, thank you very much and keep an eye on this page for new release info.

-- EdTaekema - 12 Jul 2004

I've spent some time and added some basic exception handling and error checking. The new release 0.1.4 is now available.

Enjoy!

-- EdTaekema - 14 Jul 2004

Thanks a lot for that script. We're unix-based (one edittwiki.pyc binary, multiple users) and were looking for a way to have automated scripts contribute content to our intranet TWiki.

I configured TWiki to be by default protected by apache basic authentification, so I had to change one line in your script for it to work:

        #baseurl = '%s://%s%s' % (protocol, host, subdir)
        baseurl = '%s://%s:%s@%s%s' % (protocol, userid, password, host, subdir)
I also protect attachements directories with apache's BASIC authentification (.htaccess/.htpasswd). I plan on using it with our content-generator scripts by setting EDITOR to the name of the script before hand, so that those scripts edit the temporary file.

As we generate pages with images (GIF files), could your script be extended to support uploading attachments too ?

Again, thanks a lot.

-- GillesEricDescamps - 15 Mar 2005

FWIW, there is a QUICK & DIRTY perl script to complement edittwiki and upload attachments to a TWiki page at: ScriptToUploadAttachments

-- GillesEricDescamps - 30 Mar 2005

I added a SHORTDESCRIPTION to the "Add-On Info" section so that this add-on is represented properly in the AddOnPackage topic and query topics. Please feel free to take this into the next release.

-- PeterThoeny - 07 Oct 2006

I set this to ObsoleteAddOnPackage since the zip file is missing and the download link on external site is is no longer working.

-- PeterThoeny - 10 Feb 2007

Edit | Attach | Watch | Print version | History: r23 < r22 < r21 < r20 < r19 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r23 - 2020-04-26 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.