Lodahl's blog: 2013

19 December 2013

I have been fooling around

I have been fooling around for a couple of days. 

Yes I admit it. From time to time I enjoy working with something totally different from what I do in my daily life and something that is absolutely irrational. This time I suddenly found my self playing around with ownCloud (https://www.owncloud.org ).

I found that I could launch a pre-configured cloud server on Amazon ( http://aws.amazon.com ) from Bitnami ( http://bitnami.com/stack/owncloud/cloud ).

It took me about half an hour to order and fire up the basic server and after another hour of configuration I had a safe and sound cloud server running. And it all comes in my native language (Danish) out of the box.

I wanted to install a few extra apps for different tasks e.g., a music player that for some reason isn't included in the standard edition of ownCloud 6. The only problem with that was that the music app depends on another apps 'App Framework'. Unfortunately that wasn't very clear in the instructions, and it took me a couple of hours to find the solution and implement it. I made another mistake by activating the app 'FluXX Compensator (Y)'. A friend of mine recommended it to me, but it seems to mess up ownCloud completely. It took me quite some time what caused the problem but when I found the cause it was pretty easy to disable it. I couldn't use the web interface (as it was messed up) but I could remove the app folder through SSH.

So now my family and I can store and share files in a relatively safe way. I know that Amazon might not be the safest place (in the Snowden years), but I somehow feel safer now where I son't have to use Dropbox or Google Drive. I don't like storing my private documents on a server that doesn't belong to me. 

Never mind.

I'n now using my ownCloud as family calendar completely sync'ed with my locally installed Thunderbird/Lightning. The only missing feature is the lack of inviting and accepting invitations directly in my mail and calendar program.
What I find extremely interesting is the way ownCloud can work with documents. First of all ownCloud supports WebDAV and I can open and save files directly from LibreOffice.

Open documents in LibreOffice

But more interesting is a new interesting feature in ownCloud 6: WebODF ( http://webodf.org/ )!

WebODF is a separate open source project that is a JavaScript implementation of the OpenDocument format. So far WebODF only implemented som very basic parts of text documents but its a nice first step. And a step in the right direction. I know that WebODF is working on a spreadsheet thing too and that's exiting.
Another extremely cool feature is that WebODF supports collaborative editing of rich-text documents. We are talking about two or more editors working on the same document at the same time.

Editing on line

WebODF is not a web version of LibreOffice but you can create and edit documents with basic formatting and styles. I even discovered that uploading a rather complicated ODT document from LibreOffice with a table of content and cross references works fine. Some visual features are visible in the browser version of the document, but even if not the unsupported features survives being edited with WebODF.


My conclusion is clearly 'enthusiasm'. I will certainly be using ownCloud as my private cloud server from now on and I can see some very cool ideas coming in the future. I'm exited about WebODF working with ODF documents using JavaScript and I can see many useful things to use it for. I can clearly see ownCloud useful for small business and e.g., schools and NGOs.

I give it a thumb up.

03 December 2013

LibreOffice now has a built in XML-parser

LibreOffice is using a XML based document format so of cause there is a built in XML parser. But until now it has been quite cumbersome to deal with XML in macros. You need to manually traverse through the entire XML structure like this example (thanks to Andrew Pitonyak):

Function CreateDocumentHandler()
oDocHandler = CreateUnoListener( "DocHandler_", "com.sun.star.xml.sax.XDocumentHandler" )
glLocatorSet = False
CreateDocumentHandler() = oDocHandler
End Function

' Methods of our document handler call these
' global functions.
' These methods look strangely similar to
' a SAX event handler. ;-)
' These global routines are called by the Sax parser
' as it reads in an XML document.
' These subroutines must be named with a prefix that is
' followed by the event name of the com.sun.star.xml.sax.XDocumentHandler interface.

Sub DocHandler_characters( cChars As String )

if xNode = "lipsum" then
cChars= Left(cChars,len(cChars)-1)
if len(cChars)>1 then
cChars= cChars+ Chr$(13)
WriteLoremipsum (cChars, oWrite)
Else oWrite=0
End Sub

Sub DocHandler_ignorableWhitespace( cWhitespace As String )
End Sub

Sub DocHandler_processingInstruction( cTarget As String, cData As String )
End Sub

Sub DocHandler_startDocument()
End Sub

Sub DocHandler_endDocument()
End Sub

Sub DocHandler_startElement( cName As String, oAttributes As com.sun.star.xml.sax.XAttributeList )
xNode = cName
End Sub

Sub DocHandler_endElement( cName As String )
End Sub

Sub DocHandler_setDocumentLocator( oLocator As com.sun.star.xml.sax.XLocator )
' Save the locator object in a global variable.
' The locator object has valuable methods that we can
' call to determine
goLocator = oLocator
glLocatorSet = True
End Sub

This example above is from the extension Lorem Ipsum generator that you can download from here: http://extensions.libreoffice.org/extension-center/magenta-lorem-ipsum-generator

But now its much easier as LibreOffice 4.2 comes with two new spreadsheet functions called WEBSERVICE and FILTERXML. In a macro it is possible to call and use such built in spreadsheet functions even when you are working with text documents.

The example below does pretty much the same as the one above

Sub Main
svc = createUnoService( "com.sun.star.sheet.FunctionAccess" ) 'Create a service to use Calc functions
XML_String = svc.callFunction("WEBSERVICE",array("http://www.lipsum.com/feed/xml?amount=2&what=paras&start=Yes"))
Lipsum = svc.callFunction("FILTERXML", array(XML_String, "/feed/lipsum" ))
Print Lipsum
End Sub

I'm really looking forward play around with these nifty little features in Calc.

08 August 2013

How to benefit

How to take advantage of crowd sourcing and contribute too:

I'm looking forward to my vacation starting two days from now. My wife and I are happy to see southern Spain.

We will rent a car in the airport and drive the approximately 100 km to the house in the small village called Gualchos.

As always when preparing a vacation where I need to find my way around by myself I start looking for maps. Years ago that was printed maps. Who remembers the good old fashioned maps from Michelin? Today that is digital maps on the internet. Like Google, Bing or OpenStreetMap.

About a month ago I started looking for maps and found that the area was pretty bad covered on both Google, Bing and OSM. Bad luck.

I then invested about two saturday afternoons mapping the village and the close surroundings from air photos. Most of the world is covered by images taken from airplanes.

You can see the result here: http://tools.geofabrik.de/mc/?lon=-3.3897&lat=36.74396&zoom=16&num=2&mt0=mapnik&mt1=google-map

Yesterday I downloaded the resulting data as a Garmin navigation file from http://garmin.openstreetmap.nl/ and installed it on my own Garmin device. It works like a charm.

So could I have done the same thing with Google Maps? Perhaps I could. But not for my Garmin device or any other device exept for devices that Google chooses to support. The reason for this is that Google owns and control the data behind their maps and they don't give me access to the core data. They only gives me access to the services that Google wants me to use. I'm not the customer so I'm part of the product.

From OpenStreetMap nobody owns or controls the data. The data belongs to you and me and we can do with them what we want. Without any restrictions exept for respecting the license.

When I get back from my vacation I will bring local knowledge and notes about further observations. I will also bring the trip log from my Garmin navigator. I will then update the map with corrections and additional information.

I hope other tourists or locals will take advantage of my improvements and I also hope that other tourists in Spain, Denmark and other places will do the same and add details to the map.

Note: When you map areas that you don't know your self you must be very carefull. Don't make up details and remember that its pretty difficukt to interpret air photos from a landscape that you don't know your self. So don't map anything that you are not 100% certain is what you think it is.

Happy mapping.

16 July 2013

LibreOffice is becoming the Swiss army knife in the office

What started as a simple text editor and later became am office suite is actually becoming a very comprehensive set of tools for the daily office work.

LibreOffice is most likely the only application that can open almost any office file format in the world. Legacy and modern - it doesn't matter LibreOffice can handle them. Even some legacy file formats from older versions of Microsoft Office that can't be recognized by supported versions of Microsoft Office can be opened and converted with LibreOffice. Its a well known fact that some corrupted files from legacy Microsoft Office versions can only be opened with LibreOffice. I'm just mentioning a few file formats here: Lotus Word Pro, MS Works, WordPerfect and Cores Draw. Also older versions of office files from outdated Mac computers like Microsoft Word for Mac, Write Now, MacWrite Pro and AppleWorks is now accessible.

Besides that LibreOffice is constantly improving the Microsoft OOXML Import and Export filters as well as for the Microsoft Office binary file formats and the RTF format.

With LibreOffice you can store PDF-files and even embed the original text document or spreadsheet within the PDF. This makes it possible to do later edits of the file directly by loading it into LibreOffice. But there is more that. With the drawing application you can open any PDF-file that is stored without encryption. You can even edit the content and you can merge and split the document as you like. Hereby LibreOffice can replace some of the separate tools that is often used to do these tasks.

With the spreadsheet application Calc you can import CSV files and even arbitrary XML files into a spreadsheet.

LibreOffice runs on almost any thinkable platform ans operating system and its free. Free as in free beer and as in free speech. you can download it from here: https://www.libreoffice.org/download/ .

What more do you want of interoperability?

10 June 2013

Best new feature in LibreOffice 4.1?

I wrote about embedding of fonts in this blogpost: http://lodahl.blogspot.dk/2013/06/libreoffice-41-most-important-new.html

The embedded fonts will most likely result in better interoperability with Microsoft Office and between different OS'. But there is even more coming on that shelf: Even better interoperability.

From the release notes: https://wiki.documentfoundation.org/ReleaseNotes/4.1

  • Import and export of graphical bullets of numberings in the DOC, DOCX and RTF filters.
  • Numerous improvements have been made to the Microsoft OOXML Import and Export filters as well as for the Microsoft Office binary file formats and the RTF format.

These new features (or fixes) is absolutely on my list of favorites in this upcoming version.

05 June 2013

LibreOffice 4.1: Most important new feature?

In an earlier post (http://lodahl.blogspot.dk/2013/05/exiting-new-design-initiative.html) I wrote about the new design features that will be exposed as experimental feature in LibreOffice 4.1.

Among the other new features, there is one that I believe is worth noticing. Embedding fonts in documents will make a interoperability much better - both between Office suites but also between different operating systems as Windows, Linux and Mac.

Under normal circumstances fonts are not embedded in the document, and when the document is opened on another computer that doesn't have the used font installed, then the application will try to replace the fonts "best possible". The problem is that best possible is not always good enough.
If (or when) the fonts are embedded in the document the rendering of the document will always be more accurate as the fonts used is exactly the same as on the original machine.

The feature in LibreOffice works in all modules, text editing, spreadsheet, drawings and presentations. Besides that this opportunity is compatible with Microsoft Office, and no matter if the document is interchanged as .odt or .docx, then the document is opened in the opposite application with the original fonts.

I have performed a small and very simple test both ways (between Linux and Windows, and LibreOffice versus Microsoft Office accordingly) with success.

Embedding fonts is activated for each document in the dialog Files - Properties on the tab Fonts.

This medal has a back side, as the file will become large compared with the same document without embedded fonts. Although I will recommend that fonts are embedded in all documents that will be exchanged between operating systems or office suites.

03 June 2013

Exciting new design initiative

Through out the last couple of years we have seem quite a few suggestions to a new and more modern look and feel for LibreOffice. Some of these initiatives has already found its way into the product, and you can e.g., see a much more light weight ruler in Writer and the whole sphere around using and handling templates has been reworked with a new design. Each of these examples are small steps ahead towards a more modern layout. But when will we see something more like a jump into the future?

We already got it although you might not actually notice it. More than two hundred dialogues has been recomposed with a completely new development method. This work has a big strategic importance for the community, because in addition to improving the appearance of the UI right now, it opens a lot of long term opportunities.

An example is the word count dialogue. This is how the old method looked:

And with the new WidgetLayout method:

You can read more about this new Widget Layout here: https://wiki.documentfoundation.org/Development/WidgetLayout .

But soon you will see some eye candy too.

Experiments are going on to take advantage of the fact that more and more screens are 16:9 format and not as earlier in 4:3 format. This development is resulting in wider screens both on laptops but also when using traditional desktop computers. This challenges the planning of the application wire frame. The trend goes towards vertical panels or tool bars that takes advantage of the wider screens. This is in contradiction to the Microsoft approach that implements his ribbons under the ceiling taking up space where there is no space.
Illustrating the proportions

I will emphasize that this is a suggestion and not yet a decision and the final implementation will probably take some time.

An example of how the context sensible tools can appear to the right.

Sidebar in Writer
Please notice that these screen shots are not only mock-ups but actual screen shots from a running version on Windows. Please note that this is a very early and absolutely not stable version.

More screen shot below in this article.

The idea is a panel in the right (or left) side of the screen with a bunch of tools. Some tools are static e.g., the Navigator and the Gallery and some others are context sensitive and changes its content from what your cursor is selecting. This is the case with the the properties tool.

You can select between the various tools with the small icons most right. The plan is that these tools will replace some of the traditional toolbars in the top of the screen. Then we take really advantage of the wide screen.

Last but not least it seems that its possible to develop and install extensions that enhance the functionality also in the panel. I have installed two extensions that uses the task pane in earlier versions of LibreOffice and they automatically show up in the icon bar but the extensions doesn't show up in the pane yet. But it really looks good.

The background for this experiment is actually a result of IBM donating Lotus Symphony to Apache Open Office. The donation is licensed in such way that the functionalities can be ported to LibreOffice.

As mentioned earlier this feature is absolutely in a very early stage and it needs a lot of fine tuning to be ready for production. First of all the original code was developed back in 2008 and has not been maintained since. Also it takes quite a lot of effort to make it fit into the LibreOffice code base in a proper and safe way.

More screen shots:
Navigator in the Sidebar

Sidebar in Calc
Gallery in Calc

22 February 2013

OpenClipart.org in LibreOffice - part 3

I have been discussing the subject before and now I just want to tell about our progress. We have managed to use the Task pane to show the dialog so from now the feature is no longer in the Insert - Picture menu. Instead you should use View - Task pane.

It works on Linux but for some reason Windows doesn't show any preview images and it doesn't insert anything either. Don't worry we will figure that out soon.

Bu the way, if you want to give it a try you can get it from the extension website here: http://extensions.libreoffice.org/extension-center/openclipart-org-integration .

Here is a short video to show the concept:

19 February 2013

LibreOffice and WebDAV

Recently I made a small demonstration of how to use LibreOffice with CMIS. Now I have also made a video of how to use LibreOffice with WebDAV.

In this demonstration I'm using my ownCloud server on a Raspberry Pi.

Tell me what you think!

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

03 February 2013

Video tutorials and promotions

If you look around on Youtube and other video repositories you will find that many tutorials are available for open source projects. I my self learned Gimp qiute fast using these small videos. Many of the videos are produced by absolute amateurs but never the less brings a lot of value to the projects.
'These videos are an important part of marketing but also a simple way of teaching users how to do stuff with your application.

Unfortunately LibreOffice don't have a tradition for making tutorials or promotion videos. I would like us to change that.

I have made a few tutorials but none of them is close to being perfect. I'm also an amateur when it comes to making videos. Never the less I would like to parse my experience to others both in LibreOffice but also in other open source project. 

If you have comments or if you can help me with additional knowledge - please don't hold back :-)

Lesson one: Prerequisite

Before you even begin thinking of making video tutorials you need to get some software. But before that you need a piece of hardware to run your software on. And of cause you do. But I mention this explicitly because when it comes to video and audio editing the hardware configuration is essential. Even a recording of your desktop actually requires quite a lot of effort from your hardware. I recommend at least 4 Gb RAM and a dual core processor. I am using Ubuntu Linux 64 bit on a 4Gb Ram machine and I don't always have enough power.

We need some tools, right?

Yes. First of all you need a program to record your desktop. I find that Recordmydesktop suites my needs. I'm some kind of a KISS (Keep It Simple Stupid) person. Recordmydesktop does what the name says: It records my desktop and saves it as a video file on my hard drive. Other programs does the same and its completely up to you. Recordmydesktop is in most Linux distributions repositories so search for it.

A nifty little tool I have found is the key-mon project (http://code.google.com/p/key-mon/). This is a small window on your screen that shows what happens on your keyboard. Remember the desktop recorder doesn't record your keyboard and key-mon just shows any keyboard activity on the screen so that this will be recorded as part of the video. If you want to explain shortcuts and other keyboard tricks this is absolutely a nice tool.

You need some image editing software too. I usually use Gimp but from time to time I need to edit scalable vector graphics too so I recommend also to install Inkscape. Both applications are probably in your distribution already.

Editing the video is what is the key issue. I prefer OpenShot but you can use Kdenlive or other programs if you like. OpenShot has been criticized for being unstable and that it lacks advanced features but I find that it suits my needs and when it comes to stability its not more nor less stable than other applications. When OpenShot crashes its usually because of lack of ram on my computer.
If you want to use speak in your video you will first of all need a good microphone. The built in microphone will usually NOT do the job. I have a set of earphones with a microphone that didn't cost much. But I know that others prefer to record the voice on a mobile phone witch is actually a pragmatic solution.

You might find that OpenShot can do what you need with the voice track but if you need to edit or fine tune you voice take you might find Audacity a nifty tool. I think Audacity is state of the art when it comes to audio editing.

Lesson two: Plan the video

Before you even think of recording anything you must plan the project. First is to create whats called a story board. Imagine what you want to do in your video and write it down. Break the video down into scenes. Write down precisely what is to happen in each scene. For each scene you should also plan whats on the screen before you start. An empty desktop or the application open? Should you prepare a document?

Remember that when you shift from one scene to the next you might want the two scenes to be linked together in the way that the second scene starts exactly as the previous scene ended. Write that down.
My experience is that the more you prepare in the story board the easier the rest of the work will be. You simply can't prepare enough but experience will show you.

Lesson three: Strategy

Do you want to make the complete tutorial in one shot and speak as you take the scene? Or do you plan to take each scene one by one and then cut/paste everything together when you are done? You can even do the complete video and cut it together and then record the speak later.
If you plan to take everything in one shot you will need to rehearse several times before you record it. If you prefer this strategy you will most likely end of with a great tutorial but with a lot of small mistakes. But if you rehearse before you record you can do it. Some of the best tutorials on Youtube are made this way.
I prefer to take each scene one by one. That way I can re-take a scene if I make too many mistakes. I also prefer to record and add the voice at a later time. One reason is that I either ask somebody else to speak or that I need to record the voice in a different place.

On the other side some of the best tutorials are actually one long take. Take a look at this example: https://www.youtube.com/watch?v=A8OTSC_iVT0

This is a video where you can feel the soul of the author. You kan feel that this guy really loves what he is doing. If we edit too much we will end up having a nive video but with no spirit. The key is in the voice.

Lesson four: Recording voice

My office isn't a good place to record voice because there is too much background noise. Besides that the room is an office with hard walls and floor. In professional sound recording studios you will find that the room is covered with soft material to avoid sound reflections. You can imitate that by using a room with soft walls and heavy curtains. The best place to record voice is actually in my bedroom.  

02 February 2013

LibreOffice and CMIS

Here you can see a short video demonstration of how CMIS integration works in LibreOffice 4.0:

24 January 2013

LibreOffice and OpenClipart.org

For several years I have been very fond of clip arts from the Open Clipart Library (OCAL) and when LibreOffice now has built in usage of SVG files I was very happy. Now I could use these exelent cliparts in scalable format. Until then the only way was to convert to bitmap (png or jpg) format first.
Soon I began thinking of getting access to the library directly from the UI in LibreOffice. I  discovered that from Inkscape you can insert cliparts from online already.

Hmmm. It must be possible in LibreOffice also. I investigated the API.
I started prototyping in LibreOffice Basic and even got as far as designing a dialog and access to the API.

Aaaarg handling JSON and XML in LibreOffice Basic is .......trouble! Ok I then started over with Python. Perfect because I can handle JSON and XML quite easy.

The project has been described before and its on the list of potential GSOC project on the wiki.
Nice. And there is even a prototype from an earlier GSOC project there ;-) 

I made a few mock ups (Gimp) showing my idea about using the task panel.

I talked to one of my colleagues about it (I don't know about C++ at all). He grapped the idea just a few days ago and we will continue to work on it together. The idea is to look at both the Inkscape implementation and the GSOC project and create a prototype.

Dear students: I don't like taking the bread out of your mouth bu my colleage is a newbee in LibreOffice context and I am taking the liberty to look at this as "easy hack" for my friend.

Please tell me what you say about the rough drafts here. Is this something that will be of value to you?