Some time ago I wrote about our plans to intergrate OpenClipart.org API in LibreOffice. You can read that post here: http://lodahl.blogspot.dk/2013/01/libreoffice-and-openclipartorg.html .
And thanks for all the good advice on the comments list. All input will be read and taken seriously.
Now I want to tell you how far we are...
First of all we decided to go with LibreOffice 4.0 because the embedded Python runtime environment has been upgraded. We didn't want to go with yesterdays technology.
We developed a Python routine that draws the dialog and searches through the API. We get the result back and present titel and thumb nail image in the dialog. When clicking on a thumbnail image the SVG-file will be inserted into the document at the cursor position. Some meta data from OpenClipart.org is added to the inserted image.
It actually works :-)
You can find a very unofficial extension here. Do NOT try to install this extension in other thann LibreOffice 4.0.
The core insert of the image is actually done by a Basic macro as this is the most easy way to do that. We decided to use the dispatcher for it.
Well we still have a lot of work to do. First of all error handling and we must find some way to disable the dialog while we get data over the internet. Otherwise we get an error from Python even if we just touch the dialog - because the dialog is not ready yet.
We also need to be able to control the size of the inserted image. So far we just use 100% page width witch is probably not what we should do. We are still working on that.
Next is to put the dialog into the task panel as I mentioned in my earlier post. Perhaps we should just try to make dockable window instead but we will see to that. Does any of you guys know how to?
We tried to create an extension so that you guys can try it out but that failed. Something is wrong and it seems that LibreOffice 126.96.36.199 is a little buggy. In the daily built it actually installs but it doesn't run. It claims that Python is not a supported scripting language. (reported as a bug already as https://bugs.freedesktop.org/show_bug.cgi?id=60694 ). You can pick up the extension from there if you like. It doesn't work but it can be installed manually (Python and Basic ...copy and paste you know). As soon as we know whats going on I'll be back. I want to get it out to you as soon as possible so you can try it out.
Here is a short video for demonstration:
By the way we discovered another but (as reported here: https://bugs.freedesktop.org/show_bug.cgi?id=60692 ). It seems that LibreOffice 4.0 extension manager doesn't recognize its own version number. Its simply not possible to install an extension that depends on 4.0. But thats another bug.