Serna Free 4.4.0 and Serna Enterprise 4.4.0 pre-release binaries are available for download for early adopters and production testing. This release introduces several important new features, usability improvements and bug-fixes. Please see release history for more details.
Please see Release History for more details about changes and new features.
Serna Free 4.3.0 and Serna Enterprise 4.3.0 pre-release binaries are available for download for early adopters and production testing.
Starting from the version 4.3, Serna Free (Open Source) and Serna Enterprise will share same code-base, so new features added to Open Source version can be swiftly added to Serna Enterprise releases and vice versa.
There are other significant changes. Please see Beta Release History for more details.
Syntext Serna Enterpise 4.1.6 stable maintenance release is available for download.
Please see Release History for more details.
Use case: open a file (or url) in external viewer from Serna using file type association rules defined in Tools -> Preferences -> Applications dialog.
Synopsis:
Command: LaunchBrowser
Arguments:
url: string, path/url to a file.
1 2 3 4 5 6 7 8 9 10 11 | class SomeCustomPlugin(DocumentPlugin): # Some code goes here ... def openExternalBrowser(self, path): browse_info = PropertyNode("external-viewer") url_arg = PropertyNode("url", path) browse_info.appendChild(url_arg) self.executeCommandEvent("LaunchBrowser", browse_info) # And some code below ... |
document path here can be a path to local file as well as URI.
Code Snippet: open document in Serna
Use Case: open an XML document in Serna from a plugin.
It is achieved using OpenDocumentWithDsi Serna command event.
Synopsis:
command:
OpenDocumentWithDsiarguments:
doc-src: string, path to a document.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | class SomeCustomPlugin(DocumentPlugin): # Some code goes here ... def openDocument(self, documentPath): # Create the root property node. It holds all arguments passed to the invoked command. # It may have any name you like. Please, make sure it has a descriptive name open_info_property = PropertyNode("doc-src-info") # Create a named argument. doc_src_arg = PropertyNode("doc-src", documentPath) # All arguments must be made descendant for the root property node. open_info_property.appendChild(doc_src_arg) # Invoke the command passing required argument self.executeCommandEvent("OpenDocumentWithDsi", open_info_property) # And some code below ... |
As far as you know Serna has a set of internal commands which perform various jobs. They are all accessible through the SAPI. Each command is represented by a name and possibly with a set of arguments and is invoked by emitting a so called ‘command event’. All command events should be emitted by DocumentPlugin instance only. Command arguments are represented as PropertyNode`s: tree-like hierarchical objects which hold required values.
Example of using:
1 2 3 4 5 6 7 8 9 10 | class SomeCustomPlugin(DocumentPlugin): # Some code goes here ... def myHandler(self, path): ... document = self.computePath(path) self.openDocument(document) ... # And some code below ... |
Code Snippets: intro
Hello there,
I want to introduce you a new tag of Development category here: code snippet. Code snippet is a small piece of reusable code which show something interesting. Snippets are often used to clarify the meaning of an otherwise “cluttered” function, or to minimize the use of repeated code that is common to other functions (wikipedia). Here I am going to share some tips and tricks that may help you in Serna plugin development.
Feel free to leave your suggestions about desired code snippets as comments on this post.
Stay tuned to get the first one soon!
// Andrew Sichevoi
Filename Extensions Handling in Linux
You are publishing a document as an HTML page. When the transformation is done, you will definitely try to View the generated page. But it gets opened by a wrong browser, because a few days ago you decided not to use Firefox anymore because you liked Chromium and forgot to update the corresponding settings in Serna. Or it is not opened: you have set up a wrong association in the Serna Preferences dialog.
How to make Serna open non-xml resources by using system preferences? If your Linux distribution is XDG-friendly, you may use a trick which I’ll show below. XDG stands here for X Desktop Group — a group of enthusiasts (currently known as FreeDesktop.org project) which works on interoperability and shared base technology for free software desktop environments for the X Window System. One of the countless things they have invented is a centralized base where file extensions might be associated with default applications. It means that by default all files with a particular extension will be handled by a specified application. And when such an association is changed in the base, this update is automatically propagated to other applications which use this system. Seems very helpful, isn’t it?
Ok, no more words, let’s see the trick.
File extension handing in Serna is managed through the Tools -> Preferences -> Applications dialog. That’s what it usually looks like:
But now, having a knowledge about a centralized base of default applications, we’ll replace all the Application entries with the /usr/bin/xdg-open command:
xdg-open is a small application (it is available by default in all desktop-oriented Linux distributions) by fd.o which opens a resource passed as an argument by using a default user-preferred application. Examples:
/usr/bin/xdg-open http://google.com will open the Google homepage in Firefox (by default in Ubuntu)
/usr/bin/xdg-open ~/images/serna-on-android.png will open the image in Eye Of Gnome (eog) (by default in Ubuntu)
With this approach, we do not use a “hardcoded” application to handle a file, but we delegate this to the 3rd-party utility which will surely do this. So if one day you decide that you do not like Firefox anymore and set up Chromium as your default browser, all the HTML pages published with Serna will be opened in Chromium.
Syntext Releases Serna Free v4.2
This release brings integration with Antenna House XSL Formatter for high quality PDF publishing and the ability to specify multiple search paths for plugins. Also, a number of stability issues were fixed.
See the detailed release notes. Download Serna Free now!
Hello,
I have goods news for Ubuntu/Debian users. An experimental Ubuntu/Debian repository of Serna Free is launched! A magic string to add the repository to the system is:
deb http://downloads.syntext.com/deb/ oss main

