DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:jspwiki_import

DokuWiki Plugin: jspwiki_import

Compatible with DokuWiki

2008-05-05, 2006-11-06

plugin Adds a toolbar button to import JSPWiki pages

Plugin name contains underscore, will not generate popularity points.

Tagged with convert, import, syntax, toolbar

When migrating from JspWiki to DokuWiki, this plugin may help you in adapting the syntax style. With the help of JavaScript, it converts the most common notations from one language to the other.

Requirements

I've developed the plugin under the DokuWiki version of 2006-11-06. Since the current Development Version provides a new way to add toolbar buttons, I don't know whether it still works then without adaptation.

It does not work. Button is not incorporated into the toolbar.

Just change your lib/plugins/jspwiki_import/script.js by

  1. renaming insertJspWikiImportButton() to insertJspWikiImportButtonOld()
  2. Add the following code :
function addBtnActionJspInsert(btn,props,edid){
        addEvent(btn,'click',function(){
        openJspWikiTranslationPage();
        return false;
        }
        );
        return true;
}
/*
 * Register the toolbar button (old fashioned way)
 */
function insertJspWikiImportButton() {
  if(window.toolbar!=undefined){
  toolbar[toolbar.length] = {"type":"JspInsert",
                             "title":"Import JSPWiki-page",
                             "icon":"../../plugins/jspwiki_import/jspwiki_logo.png",
                             "key":"j"}
  }
}

Download / Installation

Download the plugin here (manually or via Plugin Manager): http://pb.wh4f.de/dokuwiki/jspwiki_import.zip

Usage

This plugin adds a new button to your toolbar, when in edit mode: When you click this button, a new window will pop up, providing an edit box where you can paste your JspWiki syntax. Then, click the Conversion button and the converted text will be inserted into your current DokuWiki page.

Shortcomings

The importer is written using the Google Web Toolkit to compile the original Java JspWikiParser to JavaScript. Therefore, the JavaScript-file is currently somehow huge. As well, transformation is not 100% perfect, but it nevertheless is a big time saver.

Source

The source of this plugin can be downloaded here as Googlipse project.

Known issues

Syntax error in action.php

The provided plugin does not work, because it contains a synthax error in action.php. So in order to get this working, you have to change line 31 to:

 'name'   => 'JspWiki Import', 

Path error in script.js

Pressing the “JspWiki Import” button opened the URL <wiki page path>/lib/plugins/jspwiki_import/importer/JspConverter.html, which page really doesn't exist. I changed the line 27 from script.js from

function openJspWikiTranslationPage () {
    jspw_converter = window.open("lib/plugins/jspwiki_import/importer/JspConverter.html", 'JspWikiConverter', "dependent=yes,locationbar=no,menubar=0,resizable=yes,status=no,width=560,height=400");
    jspw_converter.focus();
}

to

function openJspWikiTranslationPage () {
    jspw_converter = window.open("./importer/JspConverter.html", 'JspWikiConverter', "dependent=yes, locationbar=no,menubar=0,resizable=yes,status=no,width=560,height=400");
    jspw_converter.focus();
}

Now it is working — Uwe Kirbach

No, that was false. Original path should be kept. — Uwe Kirbach 03.05.2009

plugin/jspwiki_import.txt · Last modified: 2012/07/25 20:04 by Klap-in