DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:docimporter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:docimporter [2014-08-19 11:18] 62.225.141.75plugin:docimporter [2023-10-29 13:16] (current) Klap-in
Line 1: Line 1:
 ====== docimporter Plugin ====== ====== docimporter Plugin ======
  
-<code> 
 ---- plugin ---- ---- plugin ----
 description: Import your word documents (.doc and .docx) into DokuWiki description: Import your word documents (.doc and .docx) into DokuWiki
Line 12: Line 11:
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : import, word, doc, docx+tags       : import, word, docx
  
 downloadurl: https://github.com/marginweb/dokuwiki-docimporter/blob/master/docimporter.zip?raw=true downloadurl: https://github.com/marginweb/dokuwiki-docimporter/blob/master/docimporter.zip?raw=true
Line 19: Line 18:
  
 ---- ----
-</code> 
  
-This plugin imports your Microsoft Word documents (.doc or .docx) into Dokuwiki and preserve the following properties of the word document :+This plugin imports your Microsoft Word documents (.doc or .docx) into DokuWiki and preserve the following properties of the word document :
    * Basic layout : italic, bold, underlined text.    * Basic layout : italic, bold, underlined text.
    * Bullet and numbered list with sublevels.    * Bullet and numbered list with sublevels.
Line 33: Line 31:
 **//Install this plugin at your own risk, there is absolutely no guarantee that it will work correctly and will not make gremlins eat you alive.//** **//Install this plugin at your own risk, there is absolutely no guarantee that it will work correctly and will not make gremlins eat you alive.//**
  
-Please note that this plugin has been developped on Linux (Ubuntu/Debian) and is not tested on MS Windows or any other OS. I have absolutely no plans to support any other OS than Linux. +Please note that this plugin has been developed on Linux (Ubuntu/Debian) and is not tested on MS Windows or any other OS. I have absolutely no plans to support any other OS than Linux. 
  
-:!: **External requirements:** This plugin requires the following additional components that must be installed separately, they are given as ubuntu packages name :+:!: **External requirements:** This plugin requires the following additional components that must be installed separately, they are given as Ubuntu packages name :
   * php-pear   * php-pear
   * libreoffice-writer   * libreoffice-writer
   * libreoffice-wiki-publisher   * libreoffice-wiki-publisher
  
-Install the plugin using the [[plugin:plugin|Plugin Manager]] and the download URL above, which points to latest version of the plugin. Refer to [[:Plugins]] on how to install plugins manually.+Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 You will also need to create the file : You will also need to create the file :
Line 113: Line 111:
  
 ===== Discussion ===== ===== Discussion =====
 +
 +>This plugin imports my Microsoft Word documents! Actually [[Windows Microsoft Word]]. It would make more sense to develop and value a plugin in his own environment, where Actually I need, more then other Linux users who don't have MS Word, in the first place. I have tons of MS Documents  What workflow do you advice us (windows users)?f l o r i n k o -gmail.
 +
  
 ==== No Change to xmlrpc.php ==== ==== No Change to xmlrpc.php ====
Line 144: Line 145:
 == Response to Joe - no page created == == Response to Joe - no page created ==
 In my case i onliest need to create a link /var/www/dokuwiki because i use /var/www/wiki and it works. <sub> Bruno Emanuel. 11.02.2014 </sub> In my case i onliest need to create a link /var/www/dokuwiki because i use /var/www/wiki and it works. <sub> Bruno Emanuel. 11.02.2014 </sub>
 +
 +
 +== Another response! ==
 +In our case it was due to the server not being able to access the postback URL from the plugin itself.  Under action.php you'll find the following:
 +
 +''$client = new IXR_Client('http://localhost/dokuwiki/lib/exe/xmlrpc.php');''
 +
 +If your web server is set up to not be able to access internal PHP files via localhost, this might break.  (Let's leave aside the hard-coded wiki path for the moment: you can symlink that problem away!).  What you can try is setting the domain explicitly:
 +
 +''$client = new IXR_Client('http://yoursite.com/dokuwiki/lib/exe/xmlrpc.php');''
 +
 +Or just letting PHP do the work for you:
 +
 +'' $client = new IXR_Client( "http:⁄⁄" . $_SERVER["SERVER"] . "⁄dokuwiki⁄lib⁄exe⁄xmlrpc.php" ); ''
 +
 +Try that, and see if that works.  <sub> Chris. 01.15.2015 </sub>
 +
 +== Similar trouble ==
 +Similarly, the plugin fails to create a new page and I get the following error in my server's error log:
 +<code>2016/08/01 15:22:08 [error] 2990#2990: *890 FastCGI sent in stderr: "PHP message: PHP Warning:  Declaration of action_plugin_docimporter::register($controller) should be compatible with DokuWiki_Action_Plugin::register(Doku_Event_Handler $controller) in /var/www/html/dokuwiki/lib/plugins/docimporter/action.php on line 0" while reading response header from upstream, client: 192.168.200.87, server: _, request: "GET /dokuwiki/doku.php?id=start&do=admin&page=config HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.soc:", host: "192.168.200.144", referrer: "http://192.168.200.144/dokuwiki/doku.php?id=start&do=admin&page=config"</code>
 +
 +Chris's suggestion did not help. Instead, it just caused my wiki to display completely blank pages. Reverting the change to the plugin's action.php fixed that problem, fortunately. Any other ideas? Does this plugin still work for anyone? Thanks.  --- [[user>l3lackEyedAngels|l3lackEyedAngels]] //2016-08-01 23:38//
 +
 +
 +==== No Images shown in Imported Page ====
 +
 +When importing .docx Word files I had a well formatted page added to the wiki, but with %%{{wiki:}}%% instead of images/pictures.  After digging through the process, I found that the regex responsible for matching the images was case sensitive (my HTML img tags were lower case).  I made this change to case-insensitive and everything started working:
 +
 +Line 95 in /var/www/dokuwiki/lib/plugins/docimporter/ImportUtils.php from:
 +<code>
 +preg_match_all("/<IMG SRC=...>/", $myHTMLContent, $image_tags);
 +</code>
 +to:
 +<code>
 +preg_match_all("/<IMG SRC=...>/i", $myHTMLContent, $image_tags);
 +</code>
 +
 +I have a further issue in that the HTML output of the LibreOffice conversion is putting the images inline in base64 data URIs instead of external jpg/png files and Dokuwiki doesn't support them - but at least the text is usable and has been formatted properly.
 +<sub>Charles, Aug 20, 2014</sub>
 +
 +---
 +
 +Confirmed - Images do not import with this plugin. Have tried 4.2.7 (default for 14.04), as well as the latest beta - 4.4.x. None seem to parse image export correctly. This is a real shame :(
 +Have banged my head against this plugin for too long.
 +
 +If anyone knows of any way to actually import a basic document with a few images properly, I would really love to know of a good way. It is rather tedious to have to manually save each image, and then upload. Oh well. At this point, I might as well just link to the original document. This is, sadly, the best option I can think of without spending the time to manually "re-invent the wheel" here.
 +
 +Also, the dev has stopped maintaining this plugin. Abandon all hope, ye who enter here.
 +-somedude - Dec.18.2014
 +
 +
 +I have the same problem than you ... since October. We need a plugin like docimporter, but for the moment, we haven't solution.
 +Fire24 - 19/01/2015
 +
 +
 +--- 
 +
 +The plugin works very well. Thank you for it. Just few installation notes:
 +  * Make sure that XML-RPC remote API is configured correctly
 +  * Make sure that XML-RPC user have enough rights to create documents in the wiki
 +  * Make sure that Libre(Open)Office is 4.1, or older. Since 4.2, images are embedded to the html
 +  * May be needed to edit ImportUtils.php
 +<code>
 +diff ImportUtils.phpOLD ImportUtils.php
 +113c113
 +<         array_push($image_names, "{{".$left_align."image:".$image_tags[1][$i]."?".$image_tags[3][$i]."x".$image_tags[4][$i].$righ_align."}}");
 +---
 +>         array_push($image_names, "{{".$left_align.":".$image_tags[1][$i]."?".$image_tags[3][$i]."x".$image_tags[4][$i].$righ_align."}}");
 +</code>
 +
 +maaca - 16.4.2015
 +
 +==== pgrep_match_all ====
 +Does not work here :( \\ Error with pgrep_match_all line 298 in ImportUtils.php \\ 
 +preg_match_all(): Unknown modifier 'y' \\ 
 +No clue ... \\ 
 +\\ 
 +Bert- 11.01.2016
plugin/docimporter.1408439918.txt.gz · Last modified: 2014-08-19 11:18 by 62.225.141.75

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