Andreone / dokuwiki_plantuml

A plugin for Dokuwiki that generates UML graphs from text using PlantUML
http://www.dokuwiki.org/plugin:plantuml
13 stars 20 forks source link

plantuml not working any more #17

Open joemouth opened 11 years ago

joemouth commented 11 years ago

Hi,

plantuml plugin is not working since some days:

<uml>
testdot
</uml>

Result: GRAPHVIZ_DOT not set (although it is set!) Dot executable: /usr/bin/dot Dot version: dot - graphviz version 2.26.3 Installations seems OK. File generation OK

Complex UML shows: Dot Executable: /usr/bin/dot File does not exist Cannot find Grapviz ....

Result: same as above

Can someone please help me to get it working again?

Thanks, Joe

P.S. DokuWiki version: Release 2013-05-10a "Weatherwax" PHP version 5.3.3-7+squeeze17 vServer Debian

jkettsjr commented 11 years ago

This worked for me.

After several different trials discovered that the new version of Dokuwiki has a modification to the .htaccess.dist file that was causing a rights issue with the java.

1) Used Yum to update php, java, and graphviz. 2) Updated plantuml 3) Checked the plantuml settings 4) Modified the .htaccess.dist file 5) Working as expected now.

joemouth commented 11 years ago

Thanks for your comment.

what is your setting for remote url?

My setting is: http://www.plantuml.com/plantuml

jkettsjr commented 11 years ago

According to the below thread it should be: http://plantuml.com

However, I do local rendering.

http://plantuml.sourceforge.net/qa/?qa=1257/any-reason-the-new-release-would-stop-working-in-dokuwiki&show=1260#a1260

joemouth commented 11 years ago

Thanks, but still not working. Tried different remote rendering urls, .htaccess.dist as .htaccess

It is frustrating! Because it worked fine some time before and my wiki has a lot of uml documentation.

Juergen-aus-Zuendorf commented 11 years ago

I have a similar problem, the plantuml plugin only works for sequence diagrams and not for all the other diagram types. I don't know how to modify the ".htaccess.dist" file. Are there any details availible about the update procedure?

Juergen

TomasKulhanek commented 11 years ago

The remote rendering haven't worked for me too and I haven't succeed with local rendering. I did some checking of the demo server at www.plantuml.com/plantuml/uml and did a workaround to get a rendered graph from this servlet app as the current code didn't get any image from that app.

syntax.php -- added simple_html_dom.php (download it from simplehtmldom.sourceforge.net to the plugin directory next to syntax.php) and modified between str_replace("\n@enduml", '', $uml); and return $img ? io_saveFile($out, $img) : false; in the function _remote()

...
require_once('simple_html_dom.php');
...
            $uml = str_replace("\n@enduml", '', $uml);
            //tomaton workaround/fix
            //$uml = str_replace("\n", '/', $uml);
            $uml = urlencode($uml);
            // decode encoded slashes (or plantuml server won't understand)
            $uml = str_replace('%2F', '/', $uml);
            //$url = "$base_url/startuml/$uml";
            //change the url - post a parameter text to a form - base_url should be plantuml.com/plantuml
            $url = "$base_url/uml?text=$uml";
            $strurl = (string) $url;
            //error_log("tomaton debug url:".$strurl);
        }
       // Create DOM from URL or file
       $html = file_get_html($url);

        // Find second images - it is the diagram - first is some icon of pin
        //TODO some more clever finding

        $element = $html->find('img',1);
        $imgurl = $element->src;

        //$imgurlstr = (string) $imgurl;
        //error_log("tomaton debug img url:".$imgurlstr);
        $img = $http->get($imgurl);
        //end tomaton workaround/fix
        return $img ? io_saveFile($out, $img) : false;
Juergen-aus-Zuendorf commented 11 years ago

Thank you for your elucidations. Unfortunately it doesn't work for me. The image does't appear. Instead of it there is a link "PlantUML Graph". When I try to open it I get the following errormessage:

Warning: file_get_contents(plantuml.com/plantuml/image/SyfFqhLppCbCJbMmKaZBp-Tooa-oqTL55W40) [function.file-get-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\dokuwiki\lib\plugins\plantuml\simple_html_dom.php on line 75

Fatal error: Call to a member function find() on a non-object in C:\xampp\htdocs\dokuwiki\lib\plugins\plantuml\syntax.php on line 243

So what can I do?

Regards Juergen

TomasKulhanek commented 11 years ago

That's interesting,  I found the image rendered by your code, which resides at little bit different URL http://plantuml.com/plantuml/img/SyfFqhLppCbCJbMmKaZBp-Tooa-oqTL55W40 

Uncomment the rows with error_log and try to edit the uml in dokuwiki to invoke the php again. The debug logs should be at the end in web servers (apache) error.log and should contain first url where the uml is posted and second url, where the image can be downloaded from the server.

With regards

Tomas

-------- Původní zpráva -------- Od: Juergen-aus-Koeln notifications@github.com Datum: 21. 10. 2013 20:48 (GMT+01:00) Komu: Andreone/dokuwiki_plantuml dokuwiki_plantuml@noreply.github.com Kopie: tomaton tomaton@centrum.cz Předmět: Re: [dokuwiki_plantuml] plantuml not working any more (#17)

Thank you for your elucidations. Unfortunately it doesn't work for me. The image does't appear. Instead of it there is a link "PlantUML Graph". When I try to open it I get the following errormessage:

Warning: file_get_contents(plantuml.com/plantuml/image/SyfFqhLppCbCJbMmKaZBp-Tooa-oqTL55W40) [function.file-get-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\dokuwiki\lib\plugins\plantuml\simple_html_dom.php on line 75

Fatal error: Call to a member function find() on a non-object in C:\xampp\htdocs\dokuwiki\lib\plugins\plantuml\syntax.php on line 243

So what can I do?

Regards Juergen

— Reply to this email directly or view it on GitHub.

Juergen-aus-Zuendorf commented 11 years ago

The logfile contains this text at the end: [Mon Oct 21 21:44:59 2013] [error] [client 127.0.0.1] client denied by server configuration: C:/xampp/htdocs/dokuwiki/data/security.png, referer: https://127.0.0.1/dokuwiki/doku.php?id=plantuml&do=admin The file security.png shows a warning, that the data directory isn't properly secured.

Juergen

TomasKulhanek commented 11 years ago

Got it, you need either comment the if ($java) { ..} block from syntax.php _remote() or remove the 'java' definition within the configuration. Tomas

Juergen-aus-Zuendorf commented 11 years ago

I've found the reason: In the admin panel of dokuwiki, I had defined the path as "plantuml.com/plantuml", but in the config file "...plugins\plantuml\conf\default.php" the path remained to "http://plantuml.no-ip.org/plantuml/uml". So I edited the file, and all works fine.

Thank you very much Juergen

joemouth commented 11 years ago

I believe default.php is for the defaults, the config params will be in: conf/local.php: $conf['plugin']['plantuml']['remote_url'] = 'http://plantuml.com/plantuml';

May be there is another reason, that it is working at your site. At my site it is still not working.

Juergen-aus-Zuendorf commented 11 years ago

The only things I've done furthermore are to modify the syntax.php as described by tomaton and to embed the file package simple_html_dom.php

For information here is my plantuml/conf/default.php: <?php $conf['render_local']='0'; $conf['java']=''; $conf['jar']='plantuml.jar'; $conf['remote_url']='http://www.plantuml.com/plantuml'; $conf['button_enabled']='1'; $conf['button_icon']='res/icon1.png';

... and now these are the relevant entries in conf/local.php: $conf['plugin']['plantuml']['jar'] = ''; $conf['plugin']['plantuml']['remote_url'] = 'http://www.plantuml.com/plantuml';

Juergen

Juergen-aus-Zuendorf commented 10 years ago

Does anyone know how to load the svg file instead of the png file from the plantuml server? Reason is, that the svg file is able to keep web links, and this would be a great feature.

Juergen

lkrzak commented 10 years ago

Hi, I also have a problem with this plugin. Seems the same as above, however none of the solutions worked for me. I'm trying to set up remote rendering using plantuml.com server

I've downloaded the latest dokuwiki and installed the plugin. I've created a simple page with uml sequence diagram. In the settings I've tried just about every possible URL of http://www.plantuml.com/plantuml I've changed it also in the default settings and added lines to conf/local.php All I get on the page is the res/file-broken/file-broken.png instead of a diagram

I've also tried tomaton's fix but this didn't work either - all I got was "broken image" icon.

Can anyone please help ? What should I do to make this plugin work on a fresh dokuwiki install or how can I debug the problem ? Thanks.

NinePts commented 10 years ago

What is the specific change to .htaccess.dist that is needed? I am running on a mac lion system and trying to locally render. My configuration sets the remote_url to http://plantuml.com as noted (although that should not matter with a local install).

I always get the error mentioned above (for sequence diagrams) ...

[Fri Jun 13 01:17:38 2014] [error] [client ::1] client denied by server configuration: /Users/andreaw/Sites/dokuwiki/data/security.png, referer: http://localhost/~andreaw/dokuwiki/doku.php?id=dpm_development&do=admin

Remote rendering is not an option since the install is on a VPN with no external access.

Thanks. Andrea

PanderMusubi commented 9 years ago

Could someone make a new release and make it available at https://www.dokuwiki.org/plugin:plantuml