====== jspwiki_import Plugin ====== ---- plugin ---- description: Adds a toolbar button to import JSPWiki pages author : email : bihler@iai.uni-bonn.de type : action lastupdate : 2007-05-11 compatible : 2008-05-05 depends : conflicts : similar : tags : convert, syntax, toolbar, import downloadurl: http://pb.wh4f.de/dokuwiki/jspwiki_import.zip ---- When migrating from [[http://www.jspwiki.org/|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|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 - renaming ''insertJspWikiImportButton()'' to ''insertJspWikiImportButtonOld()'' - 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 [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually. * http://pb.wh4f.de/dokuwiki/jspwiki_import.zip ===== Usage ===== This plugin adds a new button to your toolbar, when in edit mode: {{ http://pb.wh4f.de/dokuwiki/jspwiki_screenshot.png }} 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 [[http://code.google.com/webtoolkit/|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 [[http://pb.wh4f.de/dokuwiki/JspConverter.zip|here]] as [[http://www.googlipse.com/|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 ''/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