DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:jspwiki_import

jspwiki_import Plugin

Compatible with DokuWiki

2008-05-05

plugin Adds a toolbar button to import JSPWiki pages

Last updated on
2007-05-11
Provides
Action

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Extension 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 and install the plugin using the Extension Manager. Refer to Plugins on how to install plugins manually.

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: 2023-10-30 23:06 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki