Lodahl's blog

26 September 2015

Templates - Avoid the pitfalls

This article is an addition to my speak at the LibreOffice Conference in Aarhus. You can find the introduction here: http://conference.libreoffice.org/2015/the-program/talks/migration-user-experiance-and-marketing/#Templates%20-%20Avoid%20the%20pitfalls  The presentation and video of the presentation will be available as soon as possible.

Introduction to templates

If you provide your users with good and solid templates they will not only create consistent and beautiful documents. The documents will also be good and solid. One example is that if you produce your templates with care, you can actually make them more interoperable with Microsoft Office. If you know that interoperability is an issue you should avoid specific features that is known to have problems when converting the document to Microsoft Office formats.

Working with templates sounds pretty straight forward if you read the manual. But when it comes to the real world the story might turn a bit on the way to the final result.

I have written about how to develop good and solid templates here: http://lodahl.blogspot.dk/2014/12/making-good-and-solid-templates.html and there is an article about styles here: http://lodahl.blogspot.dk/2015/09/something-about-styles.html.

But when you are done with the development you need to deploy the templates in a safe way.

Deployment

Templates can be deployed in many different ways and what method you should choose depends very much of the circumstances. If you have a lot of different templates that are to be used bu different people in different departments then you have one situation. But if you only have a few standard letters that is to be used by everybody in the company then its another situation. You also need to take into account how often you expect to update the templates and perhaps deploy new ones.

Methods for deployment:
  • Import templates in LibreOffice
  • Store templates in the users template directory
  • Store templates in the program directory
  • Deploy templates via an extension
  • Register a personal folder as template directory
  • Register a file share as template directory
And each of these technical methods even has variations because you can deploy extensions in several different ways.

Import templates in LibreOffice

Importing templates manually is not suitable as this requires manual work.

Store templates in the users template directory

You can deploy templates simply by copying the ott-files into the user directory /user/template/...
This path is also the default place to put imported template files.

Store templates in the program directory
You can of cause store the templates files directly into the program path (/share/template/common/...) as mentioned above, but this is not the recommended way.

Deploy templates via an extension

Its rather easy to wrap up you templates in a nice extension and submit that to your users. By using an extension for handling the templates you are able to keep track of version and variations. But if you expect to make regular updates or even deploy more templates in the future, the packaging procedure is on the other hand a little time consuming.

You can find the details about making extension packages here: https://wiki.openoffice.org/wiki/Non-code_extensions#Templates_Extensions

Register a personal folder as template directory

This method is most likely one of the most commonly used methods. You need to create a folder somewhere on each local computer under the users personal directory. Then you register that location as a new template location. You can do that manually in Tools - Settings - Paths. Select the Templates type and click Edit.



Please note that in this case I have four places for templates and that one of them is the default (with the radio button ticked) and this is where imported templates are copied to.

This setting can be granted all your users easily with an extension that contains a single instruction about this path. It consist of an XML-file with the following content:


You can use variables like $(user) for the users local settings, $(insturl) for the installation path or $(work) for My Documents in Windows environment. You can find them all here: http://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1util_1_1PathSubstitution.html

Details about how to make it into an extension is here: https://wiki.openoffice.org/wiki/Non-code_extensions#Path_Settings

You can also add this path setting using Windows Registry and this can be managed through one or more Group Policies in the Active Directory or similar administration system. You can read more about that on my blog here: http://lodahl.blogspot.dk/2014/10/managing-settings-on-windows.html

After implementing the extension all you need to do is drop the template files into this folder on each computer. The advantage is that the templates are always available but the disadvantage is that you need to drop files on each computer.

Be careful though not to add too many paths as template paths. Multiple paths will slow down LibreOffice in starting up. This is primarily the case if the paths are network drives but also multiple paths on you local machine will slow LibreOffice.

Deploying templates via shared server

If you have a lot of templates and you expect to make multiple new deployments and edits in the future and if you need to deploy different template to different users in different departments you might want to use a shared file server for the purpose. You can create a folder for each department and simply dump the template files into each department folder. Access to the templates can be administrated through the access to each department folder and this is most likely the most common way to deploy multiple templates as its rather simple to administrate when first setup. But be aware that this method over time can lead to conflicts if you use multiple templates with the same name. Also there is a risk that people with access to multiple department folders (e.g., the IT-department) ends up having problems loading any of the templates. The amount of templates simply overloads LibreOffice attempting to generate the template overview.

The advantage of using a shared server is that its very easy for you to maintain the content. If you need to deploy a new template or change the content of another, you can simply just drop a new file on the server and it will be available for all users immediately.

It IS possible to register an URL as template path (HTTP-address) but personally I couldn't make it work most likely because of network latency. LibreOffice becomes very slow when trying to generate the template overview, and in some cases no templates where shown at all.

Conclusion

The method to use depends very much on the circumstances. if you have many templates and you expect to maintain them regularly in the future, then the recommended way will be to deploy the templates on a shared file server and add the path to the templates with an extension.

Further ideas

To avoid network latency its possible to put templates on an ownCloud server and sync the files to each computer. The folder where ownCloud syncs can then be registered as template folder. That way you can distribute templates without thinking of network latency.

Further topics

Now I will point out some technical details that are very important to know before you begin.

Remove unused pre-installed templates

LibreOffice comes with some pre-installed templates ands some of them are in English. A resume with English text and even pre-filled names are not suitable for a business environment and you might want to remove them in the first place. The templates are located in the program directory in the path /share/template/common/... but you should have in mind that some of the Impress templates and layouts are suitable to leave as they are.

Naming templates

Each template has a name. The name is what you see below the preview in the templates overview. The template name is given in the template file under File - Properties - Description tab in the Title field. Be careful about naming your templates. If you have multiple templates with the same name then you will only find one of them in the templates overview and in the menu "New document from template". If you have a template in your environment but can't find it in the templates overview then its most likely because another template exist with the same name. And you have no tools to identify the problem.

Be aware that when you create a new template from another template then the new template will automatically inherit the name from the original template. This is very unfortunate as this results by default in a conflict. The second template (or the original) will vanish from the templates overview.

Organizing templates in folders

If you identify a path as your template folder, that path will be registered and any template file in the folder will be visible for the user in "Templates" from the Start Center. But if you create sub-folders in the template folder these folders will be visible as separate folders along with My templates and NOT within My templates. Please not that you can NOT establish cascading folders with multiple levels. All you can do is to choose not to put templates in My templates but in a separate folder.



Its unclear when a new template in a custom path actually turns up in the templates overview. Sometimes it requires a restart of LibreOffice and sometimes even a restart of the computer. Also the overview of templates doesn't seem to be in sync with the Edit template overview.





It is possible to put a link in a template folder that refers to a template somewhere else. This means that you can put templates in one place (e.g., on a server) and put links or references to these templates where the templates belongs (e.g., on the local machine).

Inherit styles from the template

Documents can inherit styles from their template. When you create a new document from a template, that document is still connected to the original template. In case you open the document at a later time, and the template has changes to its styles in the meantime, then you will be asked if the document should inherit the changes (update styles from the template) or not.



This is very useful also because one template can inherit from another template.

Unfortunately its not logical LibreOffice determines what template to inherit form. It seems to be based on the path- and file name alone and NOT with the name. Therefor its very important not to change file name or move any templates after deployment.

The meta data in the ODT-file looks like this:


When it comes to inheriting styles from one template to another I prefer NOT to inherit automatically as I don't find it reliable. in stead I load styles manually with Load styles. Although this dialog has a pretty annoying behavior.










Something about styles

Styles are much more than defining the look and feel of text in a paragraph. Its almost everything about how paragraphs behave in the context. A Paragraph style for example defines how words are hyphenated and in what language the text in the paragraph should be spell checked.

Remember also to take advantage of the benefits of Page styles and Frame styles.

Page styles are mostly used to setup the general design of how the page is looking, but its also very convenient when it comes controlling the overall document pagination.

Frame styles is not commonly used (at least i think) witch is actually a pity. Especially if you use templates to control you document layouts it gives you rather comprehensive methods to control the look and feel when it comes to consistency. If you create new frame styles for different purposes, you can completely control the layout of the content in the documents. For example you can define two or three different image styles (one for small logo'ish images, a second for photos and a third for drawings and illustrations). Each type can have different behaviors regarding anchor point, size and even position. Also you can control how text wraps around each type. The same is relevant for OLE objects and frames.

Only remember that new custom styles doesn't have any effect unless the user manually assigns them to the objects.

Avoid using list styles
Yes but avoid using it. It doesn't work! According to the documentation its possible to design and setup custom bullets and numbering styles but this area of the software is so buggy that its completely useless. Sorry to say that but thats how it is.

08 July 2015

Something about styles in LibreOffice

Styles are much more than defining the look and feel of text in a paragraph. Its almost everything about how paragraphs behave in the context. A Paragraph style for example defines how words are hyphenated and in what language the text in the paragraph should be spell checked.

Remember also to take advantage of the benefits of Page styles and Frame styles.

Page styles are mostly used to setup the general design of how the page is looking, but its also very convenient when it comes controlling the overall document pagination.

Frame styles is not commonly used (at least i think) witch is actually a pity. Especially if you use templates to control you document layouts it gives you rather comprehensive methods to control the look and feel when it comes to consistency. If you create new frame styles for different purposes, you can completely control the layout of the content in the documents. For example you can define two or three different image styles (one for small logo'ish images, a second for photos and a third for drawings and illustrations). Each type can have different behaviors regarding anchor point, size and even position. Also you can control how text wraps around each type. The same is relevant for OLE objects and frames.

Only remember that new custom styles doesn't have any effect unless the user manually assigns them to the objects.

List styles

Yes but avoid using it. It doesn't work! According to the documentation its possible to design and setup custom bullets and numbering styles but this area of the software is so buggy that its completely useless. Sorry to say that but thats how it is.

16 February 2015

Spelling in Malawi

This weekend I was contacted by my good friend Ove Larsen, from the organization FAIR, that are currently working in Malawi to prepare computers for use in high schools. Computers that are disposed in Denmark, but which can easily be used by students in the third world. The message was about compiling a spellchecker in LibreOffice for the language Chichewa, which is the main language in Malawi. Malawi is on the UN top-10 list of least developed countries, and there exists no official dictionary.

The starting point was an old American priest who many years ago manually typed 50,000 words into an RTF-file.

Benjamin Bach, who is also in Malawi on behalf of FAIR, first made a prototype, as Esben Aaberg quickly formed into a useful dictionary.

Dictionaries are parts of the efforts to make information technology more relevant and accessible. Open source is absolutely fundamental, and schools in the projects enjoying the results and expressed great enthusiasm for, among many others; Ubuntu, Wikipedia and LibreOffice. The latter is now officially supported in the examination at secondary schools.

The inquiry from Malawi was passed to our local expert, Esben Aaberg, who after a few hours of work got the dictionary to work. Unfortunately dictionaries can not be registered without the language been known by LibreOffice. Instead, Esben "cheated" by using a language code from another language. Of course we need the language Chichewa registered, but here and now, it works after all.

About FAIR

Every year hundreds of thousands of computers are discarded here in Denmark. Computers that are discarded because they are not fast enough, don't have enough capacity etc. We buy new computers because we want something that is faster and more modern, with new features and functions. And they are rarely broken ... In the third world such a computer is as good as a new one!

Schools, educational institutions, health care, etc. in developing countries have a great need for this technology to become part of the information society globally. Information technology is an important prerequisite for development within democracy, education and health.

About FAIR: http://www.fairdanmark.dk/en/
About Malawi: http://en.wikipedia.org/wiki/Malawi
About Chichewa (Nyanja): http://en.wikipedia.org/wiki/Chewa_language

09 February 2015

Is LibreOffice better than the competitor?


One of the most common objections to open source applications such as LibreOffice is that there may not be quite the same features in open source programs. They are simply not good enough - it is said.

Let's have a look at some of the areas where LibreOffice is actually BETTER than the competitor Microsoft Office.

PDF

PDF is one of LibreOffice's very strong areas. Here are a few examples:
  • With LibreOffice you can create PDF-files of very high quality. In fact, such high quality that they live up to most government requirements for PDF files for document exchange. It's the special document format called PDF/A-1a. PDF/A-1a has two particular advantages: they can be read by machines, so for example a screen reader (used primarily by blind people) and that they are self-explanatory, making them completely independent of software from one vendor. The latter is important for documents that are to be long time archived. In a 100 years from now, it is not certain that [insert a product name here] exists.
  • With LibreOffice you can (with the drawing application Draw) make corrections to existing PDF files. For instance you can do what is normally called merge-and-split (e.g., you can pick a single page from one PDF file and paste thar page into another PDF). You can actually do minor changes to the content itself.
  • It is possible to export to PDF with comments (comments are converted to PDF comments).
  • With LibreOffice, you can save the editable ODF file as part of the PDF file. The result is a rather large PDF file, but you can open it with LibreOffice and edit the content. This also applies if it is a spreadsheet.
  • With LibreOffice, you can create PDF forms with input fields.
  • With LibreOffice you can sign PDF files digitally if you have a digital signature.

Import filters

Another of LibreOffice's very powerful features is all import filters. LibreOffice can open virtually all relevant file types, including old Microsoft file types, that even Microsoft Office can't open.
Here are some examples:
  • LibreOffice supports the SVG-formatet. Inserted SVG-images can be ediited directly from e.g., Incskape through the contect emnu "edit with external tools...". After editing the image with Inkscape you can save the changes back directly to the LibreOffice document.
  • Import of graphic formats: DXF, MET, PBM, PCD, PCX, PGM, PPM, PPM, RAS, SGF, SVM, TGA, XBM, XPM.
  • Import of MacOS older vector and bitmap graphics formats: Beagle Works, ClarisWorks, Great Works, MacPaint, MacWorks, Super Paint, MacDraw, MacDraw II, ragtime for Mac 2-3.
  • Importing video and audio formats FLAC Audio flac, Flash Video (flv), Matroska Media (MKV), OGG Audio, Ogg Video, Quicktime Video, WebM Video, Real Audio (.ra), RealMedia (.rm), Digital video (.dv) Audio Codec (.ac3) and Ogg Opus (.opus).
  • Older Mac OS word processing documents: MS Word for Mac (1 to 5.1), MS Works for Mac (1-4), ClarisWorks / AppleWorks, Write Now, MacWriteII / MacWritePro, DOCMaker 4 FullWrite Professional, HanMac Word-K / J, LightWayText for Mac 4.5, Mariner Write Mac Classic 1.6 to 3.5, MindWrite Document, Nisus Writer Classic Mac 3.4 to 6.5, TeachText / SimpleText 1, Tex-Edit 2 Writer Plus, Z-Write 1.3, eDOC 2 Acta Mac Classic, Beagle Works / WordPerfect Works 1, Great Works, MacDoc 1 MoreMac 2-3, ragtime for Mac 2-3
  • Older DOS / Windows word processing documents: Microsoft WinWord 5, Microsoft Word 6.0 / 95, Hangul WP97 and Text 602 (T602), Lotus WordPro.
  • Import of e-book formats: Fiction Book 2.0, Broadband, Plucker (Palm) eReader (Palm), zTXT (Palm), TealDoc (Palm), PalmDOC (Palm), AbiWord files.
  • DocBook import and export.
  • Import of MS Visio files.
  • Import and export AportisDoc (Palm), Pocket Word documents.

Specific features

You can use color palettes from GIMP as palettes in LibreOffice.

Writer works almost as a DTP-program with frames, styles and conditional formatting.

In Calc you can format celles with styres and conditional formatting.

With Draw you can edit and manage your diagrams, show them in Writer, Calc or Impress; Draw is a small «Corel Draw» with underestimated power; use it to annotate bitmaps too, bitmaps that can be enhanced with filters directly in Draw.

Impress has a built in "Presentation console", that gives the presenter access to his notes, the outline of the presentation and a preview of the next slide. All at the same time as the current slide is on the main monitor or projector.

The Navigator

The so called Navigator in LibreOffice is a unique feature that is not available in MS Word. With the Navigator you can always get an overview of your document, and everything the document contains.
The Navigator shows among other things an overview of all the headings, and you can click on the headings and jump directly to that location in the document. You can also move around the headings and change heading level. The text in that section follows the heading. You can thus move around the chapters and sections in one simple process.
At the same time, you have an overview of all your tables, text frames, pictures, bookmarks, etc.

Frequent updates

LibreOffice is released with new versions every six months. Between versions, is published on a monthly basis bug-fixing versions for the last two or three main versions. The frequent updates may seem like an inconvenience to end users, but you don't necessarily have to upgrade every time. It is perfectly possible to upgrade once or twice per year.
The advantage of the frequent updates is that the development of e.g., the user interface is ongoing, and you will experience only small improvements in each version. Often brand new features are not mandatory to use in the first few versions. This is unlike proprietary products, which often takes several years between updates, and you will therefore experience major changes every time. The advantage for users is that you, the user does not experience going through a period of learning each time the application is upgraded.
One can explain it in the way that LibreOffice is evolutionary, whereas MS Office develops revolutionary.

Free support

Most home users and small business users can easily use the free support that can be found on the Internet. There are user forums in many native languages, and on the international level, there are a number of places where users help users – this applies to both beginners and advanced users.
If you use LibreOffice professionally, you may need professional support through a consultancy company that offers such support.
Similarly, you have the opportunity to submit bug reports and ideas for new features. If you are not qualified for this, you can get help from local companies or consultants who are better qualified. I have reported a number of major and minor bugs and got most of them corrected in subsequent versions.

Working across computer types

You can run LibreOffice on Windows, Mac, Linux and BSD and Documents can move freely between these environments without any problems.
LibreOffice can both open and save OOXML and Microsoft XML formats. The opposite is unfortunately not the case to the same extent. LibreOffice even supports the "clean" OOXML format, namely OOXML Strict, which Microsoft Office do not. LibreOffice is also found in a "portable" version, which you can run from a Windows computer without first installing the program.

Enhancing with plug-ins

LibreOffice can be enhanced with extensions e.g., containing images, templates, special settings or code. The code can be Basic, Python, Java, JavaScript, or C ++. Such extensions are normally also usable across computer systems.

Other functions

Writer supports complex spreadsheet calculations in text tables.
Writer supports master documents.

Open source

You get a wide range of advantages as a result of the open source license.

Openness

With LibreOffice, you are not bound by specific, often quite expensive, cloud solutions, that a particular supplier has chosen for you. You are not bound by anything, simply because you have the right to change the program's source code. LibreOffice already supports a variety of standards and protocols, including CMIS and WebDAW, which makes it possible to work directly from document management systems, such as Alfresco, Google Drive, Nuxeo, MS SharePoint, MS OneDrive, IBM FileNet LotusLive Files, Lotus Quickr Domino, Open Data Space or OpenText ELS.
LibreOffice uses a file format which is an open standard - not only by name. In fact it has been instrumental, so that other office applications use the same file format. For example, WebODF an editor for websites, where you can edit text files and get the result as odt-files. And it means that the application Calibre can convert ODF-files to a wide range of e-book formats.

Transparency

Although only very few people care about it, you have as user the opportunity to look the project over the shoulder. You can improving the code, and even that fewest people have resources to proofread the source code, the possibility is there. You can see both the source code, but also follow the bug list and the internal mailing lists. There are professional consultants who specialize in this kind of work like the company Coverty who have machine analyzed the source code in LibreOffice, and reported a number of potential errors. Most of these errors has subsequently been corrected by the community. The latest statistics from Coverty suggests an error density of 0.02 defects per thousand lines of code. Commercial software vendors probably implement similar analysis, but the results will not be published.

Free as in free speech

One of the basic advantages of open source is the right and the opportunity to develop new features or fix bugs in the program. This is a possibility which is certainly not found in Microsoft Office. It may well be that you don't have such skills to hack the code you self, but you might find a freelance consultant or a local company who can do it for a fee. And maybe there are others who have the same needs as you have, and so you can team up to pay the consultant. A good example of this, is a group of German and Swiss authorities who together made a public tender to improved implementation of OOXML in LibreOffice.
It is also the same "freedom to improve the program" that enables us to translate LibreOffice into Danish and many other languages. LibreOffice comes in more than 100 different languages, including some of the "narrow" language that Microsoft Office doesn't support. If you need additional languages, you can download them for free.

Free as in free beer

LibreOffice is free and you are under no obligation to buy expensive subscriptions from a particular supplier. You are welcome to make a donation, but it is optional whether to pay or perhaps help us translate the next version. At the same time you risk nor the supplier suddenly change the license terms.
Free applies as mentioned before, if you need additional language packs or dictionaries. You can get lots of dictionaries for spell checking, but also grammar of English – and its all for free.