Working with multiple Canvases

In Lawson Smart Office your home is the Canvas. You have your informative widgets and your shortcuts just one click a way. But what if you would like to completely swith the canvas for a specific task so that the widgets and shortcuts reflect the type of work that you need to get done? I’ve written about How to create a Menu Widget using the News Reader Widget, you can take this one step further by having the links in the RSS Xxml to point to different Canvas files.

Preparations

1. You need a IIS server (or another Web server) where you can publish the RSS xml file.
2. Save a Canvas.jade file for each and every canvas that you want to work with.
3. Place the different Canvas1.jade, Cavas2.jade files on the web server.
4. Configure the web server to be able to handle *.jade files (I’ll cover one way to do it using my local IIS)

Prepare the RSS XML File

Place a RSS Xml file on the server that contains one item for each Canvas that you plan to create.

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
	<channel>
		<title>My Canvases</title>
		<description>This is an example of having preconfigured canvas files</description>
		<lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
		<pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate>
		<ttl>1800</ttl>
		<item>
			<title>Year End</title>
			<description></description>
			<link>http://localhost/yearend.jade</link>
			<pubDate></pubDate>
		</item>
		<item>
			<title>Quater End</title>
			<description></description>
			<link>http://localhost/quaterend.jade</link>
			<pubDate></pubDate>
		</item>
	</channel>
</rss>

In the example yearend.jade has not been created but that is what we will do inte the next step.

Save different Canvas files

Place all the widgets and shortcuts you want for one of the configurations on your canvas.
Make sure that you have a News Reader configured with the link to your XML file that you created in the previous step.

Save your canvas to a .jade file by selecting Switch Canvas -> Save Canvas.

If the Lawson Smart Client version is a version 9.1.3 or later the Canvas background image and color will be saved as part of the Canvas file as well. (I think it was 9.1.3 – it is up to you to test 🙂

Create one canvas file for each configuration that you want to create. In my case I have these two canvases.

Now you have two *.jade files that contain the theme and the configuration for all widgets that are on the canvas.

Deploying *.jade files to IIS

Copy the jade files to your wwwroot or another web application.
A web server does not handle *.jade file so you will need to allow it and configure it for those types of files.

Start by adding a MIME type for *.jade files. Open the IIS Manager. Click Mime Types, to the left click the Add Action and map .jade to text/xml.

Then configure a handler for *.jade files. Open Handler Mappings.

Add it to a handler that handles XML. In my case I added it to the isapi handler, and I edited an existing entry for *.soap. Soap is xml. I’m not sure exactly how to do it becuase I don’t know IIS that well but adding a mime mapping and a handler mapping did the trick for me.

Now you should have the My Canvases widget on both canvases and a double click in the list will load the entire Canvas.

Some final tips

This approach can be very useful if you want to create a list of different default canvases for the users to choose from. The first time a user starts Lawson Smart Office she will get the default canvas a specified by the Administrator. The default canvas is a file that is placed in the LSO file area under CanvasFiles. The name of the Canvas file is specified in the Settings for Mango.UI using “Canvas”. Starting with version 10.0.4 You can use LSO grid groups with rules to configure different settings for different roles. If you use Microsoft group policies you can still use them as well.

If you are looking for a quick way to be able to push out examples of different canvases this blog post show you how to do that useing the News Reader.

Please note that just becuase a configuration of a widget is available in the Canvas file that widget must still be available in the user’s specific profile for it to appear. Also note that changes to the canvas will not be saved if you have a set of canvases that you switch between. This is becuase as you load a new Canvas all items on your current canvas will be removed.