AXEl release 1.3.2

32 views
Skip to first unread message

Stephane

unread,
Jul 15, 2013, 4:35:47 AM7/15/13
to axel-dev
Dear All,

This is a new milestone in AXEL's life as release 1.3.2. is out with two important new features.

The first one is the introduction of a new Javascript API to interact with editors inside web pages. This API should be more familiar to developers used to work with jQuery. It can also take benefit of jQuery selectors if you are using it. Now all interactions with the AXEL library are channeled through a $axel wrapped set object. All you need to know are the $axel().setup(), $axel().transform(), $axel().load() and $axel().xml() functions in order to generate editors and to load / save XML data. No more need to know internal classes such as xtiger.util.Form (note that as a hidden benefit this will give us greater flexibility in improving the internal architecture in future releases). As a side benefit it is also becoming very easy to generate multiple editors in the same page.

Just as a teaser, imagine you have the following embedded XTiger XML code inside a web page (with a minimalistic <xt:head version="1.1" templateVersion="1.0" label="MyDoc"/> line in the <head>) :

<div id="editor">
<p>
<xt:use types="text" label="Text">Hello</xt:use>
<xt:use types="text" label="Text">World</xt:use>
</p>
</div>

Then using a Javascript console and AXEL 1.3.2 you could do :

>>> $axel('#editor').transform()
>>> $axel('#editor').xml()
"<MyDoc>
<Text>Hello</Text>
<Text>World</Text>
</MyDoc>
"

You could also decide to store the XTiger XML template inside an external Hello-World.xhtml file and directly load the editor resulting from its transformation into a '#editor' div :

>>> $axel('#editor').transform('Hello-World.xhtml')

All the details are in a new tutorial [1] and a wiki page [2].

The second new feature is a modification of the XML loading algorithm that makes it capable of reloading XML data into an editor. It is no longer necessary to generate again the editor to reset it before reloading data. For instance you can call :

$('#editor').transform('Article.xhtml')
$('#editor').load('articles/xml-prague.xml')
and then later on to switch to editing another article :
$('#editor').load('articles/xml-london.xml')
without the need to transform again Article.xhtml before loading articles/xml-london.xml as it was the case in previous versions.

This gives a strong execution time improvement, in part because of the unnecessary intermediate transformations and in part because reloading data partially reuses the existing DOM elements which is quicker than loading from an empty editor.

As always do not hesitate to report questions and/or feedbacks,

This is available at https://github.com/ssire/axel/tags (zip or tar.gz or git cloning)

Regards,

Stéphane S.
---

[1] Tutorial - http://ssire.github.io/axel/tutorial/index.xhtml
[2] Wiki page on $axel wrapped set object - https://github.com/ssire/axel/wiki/Wrapped-set


Reply all
Reply to author
Forward
0 new messages