Aquileo | Lodahl's blog: Extensions
Showing posts with label Extensions. Show all posts
Showing posts with label Extensions. Show all posts

11 February 2013

[UPDATED]OpenClipart - Part II

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 4.0.0.3 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.

25 March 2010

Chemestry formulas in OpenOffice.org

With this extension you can insert chemical formulas directly in OpenOffice.org documents.



Download it here: extensions.services.openoffice.org/en/project/chemestry

20 February 2010

2D barcodes in OpenOffice.org

This extension provides you with 2D barcodes directly inserted into your OpenOffice.org text document or spreadsheet.

Select the text and click the button or click the button and type the text.

You can get the extension here: http://extensions.services.openoffice.org/en/project/2DBarcode

Do you have ideas about how to take advantage of 2D barcodes? Please comment!

26 September 2009

Extension help content

I have created a few extensions over the last few years. Some of them even include help content to help the users. One problem is, that the XML syntax are rather dificult to figure out. Even a simple document with a few headers and some paragraphs are rather difficult to create.

It would be rather nice if there where an export filter for xhp-files. I have head that such filter exists but I have never found it.

Expired by this article an Linux Magazine by Dimtri Popov ( http://www.linux-magazine.com/Online/Blogs/Productivity-Sauce-Dmitri-s-open-source-blend-of-productive-computing/Format-Writer-Documents-with-Any-Markup ) I decided to try to make a macro to export a document to xhp. So far I got headers, paragraphs and links. There is still some work to do because tables and pictures.

Also the macro will mess up the original document. It would be nice if it only exported the content leaving the original text untouched.

Here is the macro:


REM ***** BASIC *****

Sub HelpContent
If not ThisComponent.hasLocation Then
MsgBox ("Save document befor export", 0 ,"Export to Help content")
stop
End If


MarkupHeadingsFunc("Text body", "", "")
MarkupHeadingsFunc("Heading 1", "", "")
MarkupHeadingsFunc("Heading 2", "", "")
MarkupHeadingsFunc("Heading 3", "", "")
MarkupTextFunc("CharWeight", com.sun.star.awt.FontWeight.BOLD, "&")
MarkupURLFunc

AddText
ExportTheThing

End Sub

Function MarkupHeadingsFunc (StyleName, StartTag, EndTag)
ThisDoc=ThisComponent
ThisText=ThisDoc.Text
ParaEnum=ThisText.createEnumeration
While ParaEnum.hasmoreElements
Para=ParaEnum.nextElement
PortionEnum = Para.createEnumeration
While PortionEnum.hasMoreElements
Portion=PortionEnum.nextElement
If Portion.paraStyleName = StyleName then
Portion.String = StartTag + Portion.String + EndTag
End if
Wend
Wend
End Function

Function MarkupTextFunc(SearchAttrName, SearchAttrValue, ReplaceStr)
Dim SearchAttributes(0) As New com.sun.star.beans.PropertyValue
ThisDoc=ThisComponent
SearchAttributes(0).Name=SearchAttrName
SearchAttributes(0).Value=SearchAttrValue
ReplaceObj=ThisDoc.createReplaceDescriptor
ReplaceObj.SearchRegularExpression=true
ReplaceObj.searchStyles=false
ReplaceObj.searchAll=true
ReplaceObj.SetSearchAttributes(SearchAttributes)
ReplaceObj.SearchString=".*"
ReplaceObj.ReplaceString=ReplaceStr
ThisDoc.replaceAll(ReplaceObj)
End Function

Sub MarkupURLFunc
ThisDoc=ThisComponent
ThisText=ThisDoc.Text
ParaEnum=ThisText.createEnumeration
While ParaEnum.hasmoreElements
Para=ParaEnum.nextElement
PortionEnum=Para.createEnumeration
While PortionEnum.hasMoreElements
Portion=PortionEnum.nextElement
If Portion.HyperlinkURL "" then
Portion.String = "" +Portion.String + ""
End if
Wend
Wend
End Sub

function SetFileName() as String


Dim oDoc
Dim sDocURL
If (Not GlobalScope.BasicLibraries.isLibraryLoaded("Tools")) Then
GlobalScope.BasicLibraries.LoadLibrary("Tools")
End If

sDocURL = ThisComponent.getURL()
Directory = DirectoryNameoutofPath(sDocURL, "/")
File_Name = FileNameoutofPath(sDocURL, "/")
New_File_name = ConvertFromUrl(Left(File_Name, Len(File_Name)-4))


SetFileName = ""
boInitialized = false

oListener = CreateUnoListener("MyPick01_", "com.sun.star.ui.dialogs.XFilePickerListener")
oFP = CreateUnoService( "com.sun.star.ui.dialogs.FilePicker" )
With oFP
.setMultiSelectionMode(False)

.Initialize( Array(com.sun.star.ui.dialogs.TemplateDescription.FILESAVE_SIMPLE) )
.appendFilter("Help content", "*.xhp" )
.setTitle( "Help content ..." )
.setDisplayDirectory(Directory)
.setDefaultName(New_File_Name & ".xhp")



If .execute() Then OpenFile = .Files(0)

.removeFilePickerListener(oListener)
.Dispose()
End With
SetFileName = OpenFile

If SetFileName = "" Then
Stop
End if


end function

sub AddText


Starttext= "" & CHR$(10) & "" & CHR$(10) & "" & CHR$(10) & "" & CHR$(10) & "write title here" & CHR$(10) & "write filename here" & CHR$(10) & "" & CHR$(10) & "" & CHR$(10) & "" & CHR$(10) & "" & CHR$(10) & "xxx" & CHR$(10) & "xxx; yyy" & CHR$(10) & ""

EndText = CHR$(10) & "" & CHR$(10) & "
"

Dim oText As Object
oText = ThisComponent.Text

REM Insert some simple text at the start
oText.insertString(oText.getStart(), StartText & CHR$(13), False)
REM Append a new paragraph at the end
oText.insertString(oText.getEnd(), EndText & CHR$(13), False)



end sub

sub ExportTheThing
FileName = SetFilename()


Dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = "FilterName"
args(0).Value = "Text"
ThisComponent.storeToURL(FileName,args())


end sub

REM ***** END BASIC *****

17 September 2009

Export to Freemind part III

I just uploaded a new version of the Export Freemind extension. Now you can export any document with any headings. The mindmap structure will be based on the documents outline numbering (Tools - Outline numbering).

If a level is missing (e.g. if Heading 1 - Heading 3 (no Heading 3) the missing level is replaced with a 'dummy' heading with a red color.

New version available at http://extensions.services.openoffice.org/project/Freemind

Feel free to comment and vote.

13 September 2009

Export to Freemind Part II

I have been working to improve the export to Freemind over the last few days.

Here are the new features:

Freemind structure is changed, so that top level is from document properties. I am using Title and Subject if available. Otherwise I just use the filename.

If one or more levels are missing, I will substitute with dummy levels that will be colored red in Freemind. That is to keep the strict structure.

Help content added.

Launching the file with Freemind if possible (For Windows and Linux only). That is if I can find the Freemind program.

Added status in statusbar

Fixed bugs:
Correct encoding of filename with spaces.
Problem with "" and & in headers
Pushing the Cancel button in Save file dialog results in an error.

You can download the extension here: http://extensions.services.openoffice.org/project/Freemind

10 September 2009

Export from OpenOffice to Freemind

I just launched a new extension that exports the structure of headings in a text document to Freemind 0.8 format.




Quite nice if you need to get an overview of a large document.

Please help me test it.

http://extensions.services.openoffice.org/project/Freemind

08 July 2009

Lorem Ipsum 1.6.0

I have handed over the Lorem Ipsum extension to Magenta ApS. I am still the one working with it, so no change there.

I have just uploaded a new version now with 22 languages: Turkish, Indonesian, Arab, Dutch (Netherlands), Dutch (Belgium), Portuguese, Russian, Hungarian, Japanese, Spanish, Czech, German, Serbian (Cyrillic), Serbian (Latin), Romanian, Norwegian bokmål, Italian, Polish, Swedish, French, English and Danish.

Also th problem that the extension writes to (and overwrites) the status bar is fixed. You can download it here: http://extensions.services.openoffice.org/project/Magenta_Lorem_ipsum_generator

03 March 2009

Translating OpenOffice.org extensions

One very important feature in OpenOffice.org is the ability to extend the functionality of the program with extensions. Most public extensions can be found in the official extension repository here: http://extensions.services.openoffice.org/.

It is very important for the community, that as many extensions as possible are localized or translated into as many languages as possible. There is a tool for translation in the form of an extension. You can find it here: http://extensions.services.openoffice.org/project/extension-translator. When you have installed this extension, you can translate all other extensions that you have installed. You just have to remember to return the translated file to the original developer.

I though find this a little too technical.

I tried to find another way that makes it more easy for the end user to submit a translation. I own an extension called Lorem Ipsum Generator. You can find it here: http://extensions.services.openoffice.org/project/Lorem_ipsum_generator. And I would very much like it to be translated into more languages. I have created a Form on Google Docs, where you can fill in the translated strings and then submit it directly to me. You can find the form here: http://spreadsheets.google.com/viewform?formkey=cEhWWTVMUmRFdmpSR0NtQjVEM1FTUGc6MA..

The extension Lorem Ipsum Generator is so far in English, Danish and Italian. Please provide me with more translations.

01 March 2009

Lorem Ipsum Generator now in italian

Thanks to Maurizio Salzano the extension is now also localized into italian.

http://extensions.services.openoffice.org/project/Lorem_ipsum_generator

20 December 2008

The market opportunity for OpenOffice.org integrations

My friend Roberto Galoppini speaks about business opportunities in the market for migrating customers from Microsoft Office to OpenOffice.org. Roberto think that many of the technical difficulties that we are facing should be taken care of by Sun Microsystems. Robertos blogpost was even refered to by infoworld.com here: http://weblog.infoworld.com/openresource/archives/2008/12/the_market_oppo.html

When I speak to customers about taking Openoffice.org into consideration the talk often comes to mission critical business software and integration. Not long ago, I had a good talk with a company (large public energy provider). There is no doubt that they have a good business case: more than 2.000 thousand users. They would like to look into OpenOffice.org (and other F/OSS software applications), but when we began counting, we found more than 100 individual pieces of integration.

The same thing with many other companies:

  • Edit your website with your favorite text editor and save directly to your website (CMS integration).
  • From you customer register (CRM), do mail merge directly.
  • Ask the bookkeeper to give you an overview of next month cash flow. You will get the result as a spreadsheet. The report from ERP will be created directly.
Roberto writes on his blog ( http://robertogaloppini.net/tag/openoffice-migration/ )that Sun Microsystems should help contributing to this problem. I disagree. Not that we don't need Sun, but Sun is already doing what they can and we shouldn't point our fingers at sun all the time.

Sun is already contributing (with IBM and others) to a project to ODF-Toolkit ( http://odftoolkit.openoffice.org/ ) and a few extensions e.g. Sun Wiki Publisher ( http://extensions.services.openoffice.org/project/wikipublisher ) and Weblog Publisher ( http://extensions.services.openoffice.org/project/swp ).

Sun Microsystems are already deeply involved with this and what we need is that other IT companies will join the case and create extensions. Whats more important is, that local (domestic) companies will begin to listen to their customers and provide a real choice. Today many companies doesn't actually have a choice. The provider of ERP is making the choice for them.

The market places are different. I Denmark Sun is not an active participant. Sun StarOffice ( http://www.sun.com/software/staroffice/ ) doesn't come in Danish and there is no Danish certified business partners. Not a single provider that can use the various migration tools Sun provides. This open for a new business opportunities. Small companies and freelance consultants has a good chance to find a business in this segment. In other market places the situation is different and the businesses is to be found individually in each country.

08 December 2008

Extension: Sun Weblog Publisher

Extension: Sun Weblog publisher

This post is a actually writen in OpenOffice.org Writer and published directly on the blog. I'm using the Sun Weblog publisher.

After installing the extension you must first register your blog account information. You can do that from the extension manager or you can find do it from Tools – Settings – Internet – Weblog.

When you have writen our blogpost in writer, just select Files – Send – To Weblog.

As you can see on the screen dump above, the extension has some problems with localized strings. In this screen its mostly Swedish, but mixed with English. In other screens its a mix of Danish, English and Spanish.

When I post the entry to www.blogger.com I get an error 8in Swedish again) telling me, that the browser couldn't be found.Actually I had to edit the post manually, because the image didn't upload correctly and I couldn't add tags to the post.

It should be possible to load a list of recent posts (and edit them?). I can't make that work. The list is always empty.

Sun Weblog Publisher

http://extensions.services.openoffice.org/project/swp


06 December 2008

Extension: Lorem ipsum

This free extension generates Lorem ipsum dummy text from www.lipsum.com. I made this one my self by the way.

When you install this extension you will se another icon in the icon bar. Click the icon and you will see a dialog, where you can select how much Lorem Ipsum text you want. Select a number and select paragraph, words, bytes or list.

You can also choose if your tex should begin with 'Lorem ipsum dolor ...'


This screen shot is in Danish, but if you are using another language, you will see the English version.

Using this extension requires access to the Internet because the text is provided by a service from http://www.lipsum.com. The extension itself doesn't contain any Lorem Ipsum text.

The result will be some text that has no meaning, but can be used e.g. to test a template or to show a brochure without any content.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut adipiscing mauris. Etiam aliquam eros sed nisl. Praesent sapien. Quisque fermentum varius nulla. Praesent erat pede, facilisis sed, euismod eget, euismod at, dui. Duis elementum rhoncus risus. Pellentesque blandit, mi et volutpat aliquam, est justo vehicula lectus, vitae porttitor arcu mi et erat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In adipiscing sem eu ipsum. In pretium risus eu magna. Donec porttitor eleifend magna. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Pellentesque sagittis cursus lorem. Aenean vel risus. Etiam pretium. Morbi nibh. Cras magna dui, volutpat et, elementum sit amet, vulputate sed, sapien. Vestibulum volutpat gravida eros. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec tristique ligula at nisl

I created this extension when I was investigating the phenomenon a couple of years ago. I used this as a showcase. Later on, I found that this extra little action button in OpenOffice.org Writer is rather valuable to me.

05 December 2008

SVG Import

This is an absolute must have extension. SVG is a free format for scalable vector graphics. Vector graphics can be resized and rotation can be changed without loose of quality as you will experience with normal bitmaps. In the future, SVG is expected to be integrated in OpenOffice.org but until then this extension is what you need.

SVG-Import: http://www.ipd.uka.de/~hauma/svg-import
OpenClipart: http://www.openclipart.org/

04 December 2008

Extension: Template changer

With this extension you wll see to new menu items in Files - Templates that makes it possible for you to change template for one document or for all documents in a specific folder. All styles in the document(s) will be replaced by styles from the newly loaded template.

This extension is translated into several languages.

Template Changer: http://extensions.services.openoffice.org/project/templatechanger
More extensions: http://extensions.services.openoffice.org/

03 December 2008

clker.com openoffice.org addon

This extension is an example of how an extension to OpenOffice.org can make internet services available directly in OpenOffice.org. Clker.com is a website with free clip art. The site is funded by advertising. The service operates in the way that you register on the site and adding various clip art to your cart (you can also download them).

Through this extension to OpenOffice.org, you can retrieve your clip art directly into the document, without having to open your Web browser and download the images.

It irritates me a little, that the extension doesn't remember my account info from time to time.

clker.com openoffice.org addon

http://extensions.services.openoffice.org/project/clker_com

clker.com

http://www.clker.com/

More extensions

http://extensions.services.openoffice.org

02 December 2008

Extension: mOOo

It sounds like a cow and the logo is a cow. The name stands for Mobile OpenOffice.org and the project target is to create several individual applications for OpenOffice.org and mobile phones. The project is a school project.

The first application from this project makes it possible for you to control your Impress presentation from your mobile phone using Bluetooth technology. So now you can walk around and navigate your slides without having to return to your computer every time.

The solution consist of two parts: An extension for OpenOffice.org Impress and a Java application for your mobile phone. Before you begin the presentation, you will connect the two devices.

I have used this on a few occations and I feel its very nice to be independant fom my computer. It's quite easy to hold the mobile descrete in your hand and the navigation is ok. Only I would like the OK-button to navigate forward. The application even keeps track of time on the mobile display. Unfortunately it is not the time from the presentation started, bu from when the application was launched. Ok, I can live with that.

Be carefull: The application is still beta and I have found that it can make OpenOffice.org crash ! Lucky for me it didn't happen during the presentation.

Please remember to put the mobile on silent first.

The extension for Impress: http://extensions.services.openoffice.org/project/moooic
The Java application for your mobile: https://mooo.dev.java.net/

Extensions for OpenOffice.org

One of the nice features in OpenOffice.org is the ability to develop and publish extensions. The extension philosophy has been very well implemented in other f/oss projects and who doesn't have a bunch of Firefox extensions installed already.

The OpenOffice.org extension repository now consist of several hundred (perhaps thousand?) more or less nifty little things. In the monthly newsletter that I deistribute from the Danish community I have introduced extension of the month. I have done this for several reasons. First of all to put focus on the extension way of doing things, but also to focus on what is actually possible to do with OpenOffice.org. It is my hope that more Danish developers and OpenOffice.org users will work with and use extensions more in the future.

I will try to put some of the extensions to your attention in the future here on my blog.

15 November 2008

Why not Lotus Symphony right away ?

As I often advocate for OpenOffice.org in both private and business societies, I get questions about Lotus Symphony and Lotus Notes 8 from time to time. My advise to companies that are already using Lotus Notes is, to take Lotus Symphony serious as a future possibility. Right now I say: "Use Openoffice.org 3.0".

The reason for not advocating Lotus Symphony at the present time is, that the application is basically build on old code. If you look at it from a functions- and features perspective, the Lotus Symphony is not as rich as OpenOffice.org. At the same tim IBM has been very closed when it comes to information about the actual plans. Last autumn I asked IBM if there where plans to move from OOo 1.x code base to 3.x code base. I also asked if IBM had plans to implement support for extensions. No reply. During this years OpenOffice.org Conference IBM announced that there are plans to elevate the application to OOo 3 code base but still no time frame for the plans (did I miss something?). That is the reason why I put Lotus Symphony 'on hold' as the best alternative for the moment. I hope IBM will show me that they can do better, but at the time that happens, a lot of customers will be using OpenOffice.org. With a clear and accurate time plan for the development of Lotus Symphony, lots of customers might be able to make another decision.

I see a lot of good perspective in Lotus Notes in the future. It give meaning to build productivity tools on the same (eclipse) platform and the screencasts I have seen so far from Notes 8.5 looks nice. Imaging composite applications with Lotus Notes, Websites and a spreadsheet or text document ? It gives very good meaning.

16 September 2008

I made a small update to my first (and so far only) openoffice.org Extension Lorem Ipsum Generator extensions.services.openoffice.org/project/Lorem_ipsum_generator.

This small nifty extension shows as an extra icon in Writer. With a click, you can fetch a piece of true Lorem Ipsum text from www.lipsum.com.

This time I added some error handling to prevent the macro to stop (and show the Basic IDE) if the user don't have access to the internet or if he website www.lipsum.com is down.