OpenWGA 7.0 - Updating to OpenWGA 7.0

Updating from OpenWGA 6.0 » To consider before updating

Adapt custom functionalties that read image link items created by <tml:image item="itemname">

The attribute "item" on tag <tml:image> is used to store link information about an image to display inside a content item on the current document. The author can choose the image in OpenWGA Content Manager whose information then will be stored to the addressed item.

With OpenWGA 7.0 we change the format of this stored link inside the item to be better extendable. However OpenWGA 7.0 is backward compatible with the old format of image items, so they will continue to work and there is no need to migrate old image links. They however will get upgraded to the new format once the image is changed.

It is possible that existing OpenWGA designs contain custom functionalities to manually read the stored information from an image item and use it for some special purposes. These functionalities, which are then bound to the old format (a list of string values) will cease to work with image items created under OpenWGA 7.0. 

An example of such a functionality, using TMLScript to read the item and then use the information to generate an URL (only the file name as parsing and interpreting the other information could be very complicated):

<tml:script>

var imageItem = itemList("theImageItem");

imageName = imageItem.get(0).split(',')[0];

</tml:script>

<tml:url type="file" file="{imageName}">

Generally we do not encourage to bind any custom design functionality to undocumented data formats like these image items, as they may change between versions.

With OpenWGA 7.0 there is a supported and documented way for designs for reading image items which works with all formats and takes care of parsing and interpretation automatically. This is the new OpenWGA Service API de.innovationgate.wgpublisher.webtml.utils.ImageLinkReader. If you have such custom functionality which reads image items in your designs then you need to rewrite it using this API so it continues to work under OpenWGA 7.0.

A TMLScript example using the ImageLinkReader to read the same image from the previous example:

<tml:script>

var reader = WGA.service(Packages.de.innovationgate.wgpublisher.webtml.utils.ImageLinkReader);

imageLink = reader.read(itemList("theImageItem"));

</tml:script>

<tml:url type="file" file="{imageLink.getFile()}">