Tags:
editing2Add my vote for this tag create new tag
, view all tags
(This is a posting of an editor daemon developed by TimEdwards for use within Motorola. I asked Tim to release it because I found it very useful - and easy to use - when I worked in Motorola. I haven't done any repackaging, so what you see in the attached zip is exactly what Tim has released. As is usual with such packages, there is absolutely no comeback on Motorola, Tim or myself if it fails to function as advertised. Caveat Emptor. -- CrawfordCurrie - 20 May 2004)

TWILOC

This initial proof-of-concept implementation of Twiloc allows a local editor to be triggered by the browser (using CGI apptype) for Twiki edits. Whenever the local file is saved, the Twiloc daemon refreshes a preview in the connected browser. When editing is done, the user simply commits the preview in their browser and exits the edit session. Twiloc attempts to cleanup after itself when the editor exits.

The twiki_resources/ subdirectory includes the templates necessary to enable a 'twiloc' edit button on your twiki, as well as the two-line change necessary to enable the 'apptype' directive for the edit script (see the README in that directory).

There is a hiccup in the methodology related to Internet Explorer. The problem with IE is that it ignores the apptype directive and chooses to interpret such files as it pleases. There doesn't seem to be a good way to fix this other than using a suffix to force the behavior. But file suffixes are not easy beasts to register, and I grew disgusted with the whole IE mess before finding a decent solution.

The daemon remembers authentication information for a given server, but uses shallow encryption (caveat emptor) and simply fails if the cached password doesn't match in later sessions -- The cache must be manually cleared to proceed (see .twilocauthinfo).

Imbedded form data is maintained (no small feat!) but not exposed in this version of the tool. It would be possible to display that data for edit as well, either as an addendum to the rest of the data or in another window.

For better or worse, this initial version of Twiloc is implemented in Tcl/Tk. I can easily imagine a Perl implementation, which would be more in the Twiki spirit of things, but I enjoy prototyping in Tcl/Tk for the easy graphical interface. The tclkit package (http://www.equi4.com/tclkit.html) is used to bundle the script into a standalone executable for either a UNIX or Windows platform. The two-button (EXIT/console) window that comes up is for debug purposes. See the "build" script for UNIX, or the build.bat batch file for Windows.

INSTALLATION & USAGE

  1. Get tclkit for your platform (http://www.equi4.com/tclkit.html).
  2. Name the binary "tclkit" or "tclkit.exe", and then make a copy to "tclkit_copy" or "tclkit_copy.exe".
  3. Use "build" (unix) or "build.bat" (windows) to build a binary. NOTE: Both a 'tclkit' and a 'tclkit_copy" executable are required for building, since the latter is used by the former during the build process. I know, it seems weird.
  4. Install the templates in twiloc_resources/, and make the small change described there to the 'edit' script to enable apptype.
  5. View a page with the 'twiloc' skin to enable the twiloc edit button, and trigger an edit.
  6. Associate the apptype with the twiloc binary you built in step 3. (saved by your browser for later sessions).
  7. Pick your editor (saved in the .twiloc preferences file for later sessions).
  8. Edit the content and 'save' in your editor.
  9. Examine the preview in your browser.

DEBUGGING

You can press the "console" button to get a Tcl prompt, where you can interact with runtime variables. A debugging toplevel '.t' is available if you issue the command 'wm deiconify .t', and can be used to view runtime messages from the script.

The most common problem will likely be the interaction with the browser when saving in the editor. On UNIX platforms, the command "netscape" is used to trigger this interaction... You may need to change this to some other name ("firefox.exe", for example) on the "set ::netscape" line near the top of the script. After making such a change, you'll need to re-build the binary. This should really be part of an install script or somesuch...

- May 2004 - Tim J. Edwards

Copyright

This code is an original development of Motorola Inc. and is protected by the following copyrights:

  • Copyright (C) 2004 Motorola Inc. All Rights Reserved.
  • Copyright (C) 2004 Freescale Inc. All Rights Reserved.

License

As required for the publication of all extensions to TWiki, this software is published under the terms of the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details, published at http://www.gnu.org/copyleft/gpl.html

Add-On Info

  • Set SHORTDESCRIPTION = Edit TWiki topics with a client side editor

Add-on Author: TWiki:Main/TimEdwards
Add-on Version: 20 May 2004 (v1.000)
Change History:  
20 May 2004: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
License: GPL
Add-on Home: http://TWiki.org/cgi-bin/view/Plugins/EditorDaemonAddOn
Feedback: http://TWiki.org/cgi-bin/view/Plugins/EditorDaemonAddOnDev

Related Topic: TWikiAddOns

-- CrawfordCurrie - 20 May 2004

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip twiloc.zip r2 r1 manage 162.9 K 2004-05-21 - 06:18 CrawfordCurrie Unzip in a temporary directory and follow README
Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2006-10-07 - 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.