Since I accidentally deleted the LibreOffice-Macro for fixing the character and paragraph styles, I tackled the problem by parsing the ODT-XML directly. To do so, just unpack story.odt to a separate directory and then run:
python ~/sisstuff/stuff/text/filters/content_xml.py content.xml
The script converts ODT-XML to FM-XML and handles the following cases:
- Descriptive paragraphs
- Quoted text
- Lisps
- Gurgle
Update a story with SQL
To update a story without deleting and uploading it again, upload the XML-File to the server, find the ID of the story and issue the following commands:
fm=# \set c `cat /tmp/fm.xml`
fm=# update mystories_mystory set the_story = :'c' where id = <id>