Automating Google Workspace (GWS) & more with Apps Script
Uklug2009 Hairy Bikers Cookbook
1. The Hairy Bikers Domino Cookbook
Presenter: Bill Buchan & Steve McDonagh
Company: hadsl & AVX
2. The Hairy Bikers ?
• “The Hairy Bikers” are two hairy
bikers who do cooking
–Simon King & Dave Myers
–Have a BBC Series
• Their web site is at:
–http://hairybikers.com
• Steve and I are both bikers
–And he can cook
• So we thought....
3. Programming is like Cooking
• Programming is like cooking
–You get a recipe to help you start
–As you get better, you can adapt it
–We’ll give you a short tutorial on each item
• But... You know all about Domino
Programming
4. This is not...
• This is NOT about Domino Programming
• This is about interfacing Domino to different systems
• Remember:
–A good corporate programmer does not develop
from scratch
–A good corporate developer is there to join up components in
order to deliver results
–Sometimes, the components are outside Domino
–Like a hairy biker, we knock stuff out using the stuff we find
5. Remember:
• Whilst the business might love Domino
–Other parts of the business use different tools.
• Its part of our job to make it easy
–For those other parts to see our data
–For our applications to use other data
• Not only does that make us gods in our world
–It makes us good corporate programmers to other teams
• Job Security....
6. So what we going to cover?
• The worlds simplest Lotus Notes Application
–A wee contact database
• Then we access it via a:
–Web service
–Ajax front end
–BlackBerry SmartPhone
–Flex Front End
–.Net Visual Basic Service
7. We’re focusing on..
• We’re focusing on
–The pros and cons for each platform
–Hacking Developing each solution
–Debugging each solution
• We’re not really interested in the Domino application
- you know all about those
• We’re not delivering production quality code here
–Thats your homework
8. The Application is:
• The Application is:
–Very simple - single view and Form
–No complex code, validation, error checking
• Remember,
–The application isnt the point of this presentation
–The point is how it interfaces with other systems
11. Serving Web Services to others...
• Ingredients:
–Domino 7.x or above
–Lotusscript
–Soap UI (http://soapui.org)
–Domino Designer 7 or above
• Level: Simple
12. How to create a Web Service...
• Create a LotusScript-based web service in Domino
Designer
• Name the class which exposes your methods
• Save the class
• You can access the web service using:
–http://<server>/<database.nsf>/WebServiceName?WSDL
–In any browser
• You can now test the web service using SoapUI
• Demo!
13. Ajax Applications
• Ingredients:
–Domino 5.x or above
–Lotusscript
–Domino Designer 5 or above
• Level: Simple (if you know javascript)
14. How to create an Ajax application
• You need to choose a Ajax Framework:
–Dojo is included in Domino and used within iNotes
• Attach them to the application
–Simplest is to embed in the application
• Write forms and views using Javascript for function
and CSS for display
• Test, test, test, and test again
–In all browsers...
• Demo!
16. SoapUI and the Web Service
• This shows the ‘GetBuddyNames’ Call.
–The SOAP web service call on the left, results on the right
17. SoapUI and the Web Service
• This shows the ‘GetBuddy’ Call.
–The SOAP web service call on the left, results on the right
18. Flex Applications
• Ingredients:
–Adobe Flex Builder v3 or above (adobe.com)
–Lotusscript
–Domino Designer 7 or above
• Level: Medium (if you know java)
19. How to create a Flex application
• Open up Flex Builder
–Do the flex bits..
• Embed the SWF file in a page or form
–Copy+paste the launch code from Flex Builder to the page
• Demo!
20. Rich Internet Applications...
• Rich Internet Applications allow the developer
to have apps
A. that are connected
B. that are engaging
C. respect user adoption over
technical integration
21. My experience of using RIA’s
As a corporation we needed :
• Something that would give a unified corporate look and feel
• Something easily localised to 14 languages
• Something that looked and worked the same on all platforms
• Something easily deployable on all conceivable platforms
• Something that could “talk” to multiple data sources
• Something that could produce amazing results quickly
23. How to create an .net application
• Open up Visual Studio 2005 or 2008
• Create a ‘Windows Console’ application
• On the project explorer, create a web service
• Point it at our Domino web service
• Wire in some code...
24. How to create a .net application
• On Solution explorer, ‘Add Service Reference’
• Point it at our Domino web service:
25. How to create a .net service
• In my case, I want
to create a .net v2
service, so click on
Advanced,
–Then click on ‘Add
Web Reference’
26. How to create a .net service
• Enter a
web
reference
name
–The click
on ‘Add
Reference’
–
28. Windows Services
• If you want code that will run all the time consider
using a windows service:
–It has a ‘sleep/wakeup’ protocol so it could poll for work on
a regular basis
–If it detects work, it can then spawn worker threads to
execute this work.
–Its harder to install - I used MakeMSI to make the .MSI
installer for my windows services.
–If you call an authenticated web service, where do you
store the username/password ?
• Clear text isnt good enough.
29. A Quick Gotcha!
• Applications built using
–VS2005 want to use .Net Framework 2.5
–VS2008 want to use .Net Framework 3.0 or 3.5
• Customers in general have NOT rolled out .Net
Framework v3 to their clients, nor their servers
• You can target these projects to use .Net
Framework v2.5 - this may make your deployment
easier
30. So to round up
• Be very good at Domino
• Be good at other things too
• Domino is not a walled garden
• Everything is a weapon