Technical blog

A more subdued subheader

ARender : New release – 2.0.4

The ARender team is proud to announce the 4th release of the Helium version of ARender : 2.0.4.

This new release brings a lot of bug fixes and optimizations, especially dealing with massive usage of ARender on client desktops : lots of tabs or windows, large documents…

The changelog can be seen here, and in brief :

Bug fixes

Images &  Internet Explorer Cache

By default, most browsers keep images in their cache. With previous versions of ARender, massive usage with IE 8 could lead to a images cache saturation.

As a result, ARender now forces the browser to disable this cache feature, which is rather useless as the server side of ARender has a better and more robust way to handle image caches.

 

Cache issues when upgrading ARender

As a reminder, ARender is built on top of GWT, which is in charge of compiling and optimizing the Javascript code executed at client-side.

This Javascript code is accessed in a file called arendergwt.nocache.js. The problem is : the browser keeps this file in cache, even when the version at the server-side has been upgraded, leading to version mismatches between client and server.

To fix this, we changed the filename on a per-version basis, e.g. for the 2.0.4 version :  arendergwt.nocache.2.0.4.js. This solved the issue completely while not reducing performance and local cache optimizations.

 

Evolutions

Javascript API

ARender offers JavaScript API to allow client-side customisations.

This API can be used while integrating ARender in a business-oriented application, in a iFrame for example.

Various methods are available, and to name but a few :

Method Description
loadDocument(fileName,callback) Pre-loads a document, returning its Id in the callback
openDocument(documentId) Effectively loads a document using the Id provided
askChangePage(type,offset,ratio) Page changing (can be absolute or relative to the current page)
registerCurrentDocumentChangeEvent(callback) Register to the event of document switching
registerNotifyPageChangeEvent(callback) Register to the event of page changing
registerNotifyAlterDocumentContentEvent(callback) Register to the event of document content alteration API (document splitting for example)

 

getDocumentLayout.jsp

This JSP offers a way to fetch the structure of a document or a document-set in a JSON format.

In the case of a simple document, it provides the dimensions of each page, its title, and the mime-type associated :

{ "pageDimensionsList": [ { "width": 595.276, "height": 841.89, "rotation": 0 }, { "width": 595.276, "height": 841.89, "rotation": 0 } ], "documentId": { "stringValue": "3c25766e-11a3-4049-9bb7-b6611a0b0df2" }, "documentTitle": "Plaquette_aRender", "mimeType": "application/pdf" }

In the case of a composite document (mails, zip, ECM folders), it provides the structure of the document set, and the IDs to fetch the structure of each embedded document. Here we have an e-mail with 3 attachments :

{ "children": [ { "documentId": { "stringValue": "83ee7dc4-0700-48d0-8084-79a09a37909d" } }, { "documentId": { "stringValue": "d9afda33-7e36-41e5-a597-a90f2447c467" } }, { "documentId": { "stringValue": "3c25766e-11a3-4049-9bb7-b6611a0b0df2" } }, { "documentId": { "stringValue": "338235b1-42d6-4b10-a593-66fce5a6e780" } } ], "documentId": { "stringValue": "2ba0ec00-5cf8-3d65-a449-33a88b228af2" }, "documentTitle": "f2p8_mail_pfo_2.eml" }