Lotus Notes & Adobe Flex

Manchester LCTY Presentation »
mark barton

About Me
Mark Barton
Developer - worked with Notes since v3.
Working with Adobe Flex for the last couple of years.
http://markbarton.com
markbarton@polymorph.co.uk
Why Adobe Flex?
What Is Adobe Flex?
Rich Internet Applications are typically browser delivered applications which have the characteristics of a Desktop Application giving you the best of both Worlds.
Rich Visual Effects
Have state
Delivered via a plugin & sandboxed
Front end only - need a back end system to provide data
Full blown applications - either browser based or desktop.
Notes 8 Side bar widgets
Intranet widgets
Using Domino Security
Leverage the existing excellent security model & features.
Keep using your Readers & Authors fields.
Using Domino as a Web Server
Add swf (compiled Flex App) to an Application.
Use either file resources or add it to a configuration document.
HTML Container Page contained within the application will force a login.
Flex will then respect the logged in user rights when talking to Domino.
Requires your container HTML to be on the Domino Server
Using a non Domino Web Server
Decide whether to use Session Based Authentication or Basic Authentication
Deploy crossdomain.xml file to the HTML route of the Domino Server Site
Adobe Flex is sandboxed cannot access Data from another Domain without permission
e.g. Amazon
Not secure - password & username transmitted in the clear
Realm based - all domino data sources need to be in the same directory (or lower)
Easy to implement
Timeouts after a period of inactivity
Need to add custom code to Flex app to allow the user to login
Secure and potentially cross Domino Server
Free open source framework.
Compiles to a SWF - native Flash Player file.
Developed using a combination of MXML tags & Actionscript.
Can create desktop AIR applications.
No End Client License Cost - just pay for the Developer IDE.
Integrates with other Adobe design products - Photoshop Illustrator etc.

Why with Lotus Notes?
The Domino server can host the Flex app - built in HTTP Server.
Starts to break down applications to enforce a seperation between the Front End & Back End.
Users expect more dynamic frontends? iPhone anyone?
Can easily create Sidebar widgets.
Can mask Domino frontends.
Job security.
Implement in a staggered release - go from small widgets to full blown apps.
Same developer mindset - similar syntax for Actionscript / Lotusscript.
Don't loose your investment in your back end logic.
Rich Internet Application.
Alternatives
Microsoft Silverlight
Good if your a .net house..
Not as mature as Flex.
Requries another plugin
AJAX / Javascript web site
Good for simple applications.
Can be harder to get a richer experience.
No state.
Debugging code is harder.
More difficult to maintain code control.
No reason why you can not combine with Flex.
X Pages
X Pages are new and potentially a little harder to learn.
Provide great out of the box functionality.
More suited for new Applications.
Can leverage existing Domino knowledge.
Requires 8.51 for browser and 8.52 for client.
Pure Lotus Notes - Advantage / Disadvantage?
Notes can easily expose data via XML or Webservices
Views
Forms
Agents
Web Services
Can make use of Notes Security
ACL
Authors
Readers
NAB
Flex Application
Display Logic
UI Components - Datagrid / Graphs etc
Consumes data from Domino and other systems via XML / SOAP
Domino Server
Business Logic
Security
Administration
Provides Data via XML / SOAP
Other Application Server
Providing other data via XML / SOAP
Setting Up Your Working Environment
Working with the Flex Builder IDE
Working with Remote HTTP Data
XAMPP
Recommend using XAMPP as local web server.
http://www.apachefriends.org/en/xampp.html
Lightweight Apache / MYSQL /PHP Installation
Change Port Number in the Apache httpd file e.g. 8080 - so not to conflict with either local Notes Preview or local Domino Server 
Eclipse IDE.
Now called Flash Builder in version 4.
Difference between Professional & Standard is Monitoring tools - use Firebug as an alternative.
Comes with a debugger version of the Flash Player - works well.
Debugging and Logging a Flex Application
Good built in Debugger - in version 4 conditional breakpoints.
Use a log file to output trace comments = log.nsf.
Use baretail.exe = server console output.
Demo
Demo
Change Project Build Path in the Flex Builder IDE.
Change Project Run / Debug Configuration.
Assume your not going to host on a Domino Server.
Decide whether  to use local XML files or use Development Domino Server.
Configure Domino Server to allow Flex Applications to access the data
Set up Logging for Flex Applications - http://www.markbarton.com/?p=116
Basic Authentication
Session Authentication
Use AJAX based techniques in Actionscript
http://www.markbarton.com/?p=119
Lowest form of Data transfer between Notes & Flex is plain XML.
Works in all version of Notes (ok maybe not R3).
Web services a good option for more complex business functionality.
Web services using Domino as a provider available from R7, as a consumer from 8.
Watch out for HTTP caching - example code always appends date & time to force Domino & Browser not to cache.
Watch out for IE & SSL - need to add a website rule to prevent caching.
Use object as transfer type in Flex - rather than XML or E4X.
Generating XML in Lotus Notes
Use the most effecient method to create the XML
Cached XML
Use scheduled agents to generate XML files of reasonably static data.
If you use an agent to generate XML then it can be converted to cache that XML.
Use the undocumented URL Command - ?OpenField to get individual Rich Text fields which contain XML (see http://www.iminstant.com/iminstant/iminstant.nsf/d6plinks/CTYR-7H6S6R).
Pages with Computed formulas
Use for configuration information - useful in combination with $PublicAccess
Forms with form formulas
Use when display existing notes documents.
i.e. often used when displaying more information when clicking on a row in a datagrid.
Views with $$Viewtemplates
Useful for providing data to a datagrid.
Watchout for server view size limitations.
Flex component has powerful filter & sorting - assuming all view data is loaded.
Agents
Most powerful way of outputting XML.
No size limit - but an Agent that has to do a lot of work can timeout - best to cache the output.
Use the option to Run as Web user to ensure Notes Security is respected.
To Monitor HTTP Traffic
Use firebug in Mozilla Firefox - http://getfirebug.com/
How I build a Flex / Notes Application
Demo App - A Notes 8 Sidebar Widget.
Standard Folder structure in Flex Builder - Demo.
Use standard pages in target Notes Database. 
Config.xml
Application Configuration Options - normally driven by keywords
Mark as PublicAccess and allow anonymous Read Public Access
Userprofile.xml
Logged in user information - username + roles
Use Data Transfer Objects - Demo.
Use Events!! - Demo.
Use ChangeWatcher when binding across Tabs - Demo.
Watch out for Security Caching! 
What Next?
Download the free 60 day Flash Builder Trail
https://www.adobe.com/cfusion/tdrc/index.cfm?product=flash_builder

Use the free learn Flex in a week video course
http://www.adobe.com/devnet/flex/videotraining/

Plenty of Domino Blogs cover Flex & Notes
http://markbarton.com
http://codestore.net
http://flexdomino.net

Speak to Polymorph about a free half day workshop to help convert your existing Notes Apps to have Flex front ends.

Adobe Lifecycle Server
Middle tier server - used for high performance applications which require the use of JMS.
Binary protocol used for data transfer x10 more efficient than XML.
Handles seamless connections to J2EE applications.
Open Source alternative - Blaze / Granite.
Welcome
Lotus Notes and Adobe Flex
Notes 8 Sidebar Widgets
Flex can be used to easily create complex widgets.
The Flex widgets are similar to Google Gadgets  in that they are web based - rather than composite apps.
You can use live text to pass information to the Flex Widget.
Demo.

Loading comments...

Please log in to add your comment.

Report abuse

More presentations by mark barton