View
1.950
Download
0
Category
Tags:
Preview:
DESCRIPTION
Slide deck from The Real World Integration webinar for LotusUserGroup.org. Presented by John Head and Alex Kassabov of PSC.
Citation preview
The Real World of Integration: How Lotus Notes & Domino Can Work with Microsoft Office, Lotus Symphony and the Power of Integra for Notes
John D. Head
Alex Kassabov
Who are we?
John D. Head (www.johndavidhead.com)
Director of Enterprise Collaboration at PSC Group, LLC
Speaker, Author – Lotus Guru
Alex Kassabov (kassabov.wordpress.com)
Vice President of Collaboration at PSC Group, LLC
Speaker – Industry Expert
PSC Group, LLC
IBM Premium Business Partner for 18+ Years
Microsoft Managed Partner
Notes & Domino 8.5 Design Partner
Host of IdeaJam.net
Former Host of OpenNTF.org
Winner of 2007 & 2009 Lotus Awards!
Host of the following blogs: Ed Brill’s
(www.edbrill.com) Alan Lepofsky’s Notes Tip’s
(www.alanlepofsky.net) Alan Gartenberg - Sametime
(www.adamgartenberg.com) Domino Server Team
(www.dominoblog.com) Lotus Connections Team
(synch.rono.us) Chris Pepin – IBM CTO’s Office
(www.chrispepin.com) Lotus Usability (Mary Beth
Raven)(www.notesdesign.com)
Agenda
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Reporting Options
Looking forward
Wrap-up and Q&A
Definitions for Notes Programmers
Let’s go over a few words you need to know COM OLE
What is COM?
Component Object Model
Microsoft standard
Defines the guidelines for objects Objects must tell all other programs what is supported
– Properties
– Methods
– Objects
Consistent, programmatic access to functionality
What is OLE?
Object Linking and Embedding
Another Microsoft standard
Allows one application document to include a portion of another application
A Word document with an Excel spreadsheet inside
OLE/1 — attachments
OLE/2 — linking or embedding
Integration from Notes
From Notes, you will write code to manipulate the application
You can integrate pretty much with anything
In most cases, you will be converting Visual Basic for Applications (VBA) code to LotusScript
The VBA code will be written so it saves in Notes as LotusScript
Once you get the knack of converting the code, you can focus on the process vs. the code
Creating a Word Document
Create an instance of the application object
All applications that support COM have object names
To find the object name:– Review the application documentation– Look it up in the Windows registry
Never use version-specific application object names
– Good: Word.application– Bad: Word.application.11– When the application upgrades, you must modify
your codeVariant Application
Object NameLotusScript Method
Set hwd = CreateObject("Word.Application")
Creating a Word Document (cont.)
You must follow the application’s object model: Word.application
– Documents Document
Paragraph
Bookmark
CustomDocumentProperties
If accessing the current open document, use:– Application.ActiveDocument
– Application.ActiveWorkbook
– Application.ActivePresentation
– etc.
All applications have an object map in help
The Easiest Way to Start
Microsoft Office provides us with a recorder
Records all keyboard actions Mouse actions are sometimes recorded, so avoid
when possible
Generates VBA code for you
Easy way to learn how something is done Table is created
Page settings are set
etc.
What’s up with the Recorded Syntax?
This is the recorded syntax:
Saving LotusScript with wdToggle and wdAlignParagraphCenter fails!
Need to replace VBA constants with raw values Write a macro
– Msgbox [constantname]
Or …
Selection.TypeText Text:="this is new text"Selection.TypeParagraphSelection.TypeParagraphSelection.Font.Bold = wdToggleSelection.ParagraphFormat.Alignment = wdAlignParagraphCenterSelection.TypeText Text:="this is more text"
Creating a Word Document — “Hello World”
Demo — Example 1
Launch MicrosoftWord and enter some text
Merging Mail from Notes
Most requested Notes-to-Office Integration functionality
Users have no idea how to get data from Notes into Word
Lotus has not provided this functionality … yet
Quick win for you — take this code back and add it to your boss’s personal name and address book and be the HERO!
Mail Merge in Different Versions of Word
Mail merge is version-specific One version for Word 2000 and before One version for Word XP One version for Word 2003
– Minor change on closing documents in 2003 New version for Word 2007
Use the Mail Merge Wizard to Your Advantage
The Mail Merge Wizard has six steps 1. Select document type
2. Select starting document
3. Select recipients
4. Write your letter
5. Preview your letters
6. Complete the merge
You can control which: Wizard steps display
Step to start on
Mail Merge from Address Book
Demo — Example 2
Generate a mail mergefrom the personalname and addressbook
Moving to the Other Side
This part covers the more advanced subjects Such as automating Lotus Notes from Microsoft
Office and other technologies
We will use COM, XML, Web services, and .NET technologies
Things we CAN do …
Microsoft Word and Web services
Microsoft Excel and XML
Microsoft InfoPath and Web services
.NET and Lotus Notes/Domino
Visual Studio tools for Office
Automation from the Microsoft Side
Many integration scenarios require that user interaction start, or solely be, from an application other than Notes
Many times we will not have the Notes client installed
We will not be writing LotusScript We may call LotusScript through the Notes COM
interface
We need to take advantage of “new” technologies XML Web services .NET Managed code
Domino COM Basics
Working with the Domino Objects is almost the same as writing code in Notes!
Only supports back-end objects No NotesUIDocument, NotesUIView,
NotesUIWorkspace, etc.
COM support was added in Notes 5.0.2b
Updated in 6.5.1 to support 6.X
ND7, 8 & 8.5 – COM support out of the box
COM interface is the same as LotusScript, with some minor exceptions
Registering the Notes COM Objects
Sometimes Notes does not register itself properly with the Windows registry
From the Windows run line:
Regsvr32 “c:\program files\lotus\notes\nlsxbe.dll”
From a Notes agent:
Shell(|regsvr32 “c:\program files\lotus\notes\nlsxbe.dll”|)
Domino COM Basics
Before you start writing VBA code, you must load the Domino COM objects
In MS Office Tools References
Make Your End Users Happy!
Prevent password prompts by …
Notes 5.X Notes 6, 7 and 8
Word Template — Data from Notes
Demo — Example 3
Create a new documentPrompt userPlace data into document
About Web Services
Self-contained application published and invoked from the Web
Based on XML
Uses WSDL and SOAP
Designed for machine-to-machine interaction
Advantages: Connects various applications running on different
platforms Uses open standards and protocols Uses HTTP, bypassing firewall and other security measures
Disadvantages: Poor performance as opposed to Distributed COM (DCOM) Requires an Internet connection
First Things First
First, you need to build a Web service
It can be written using LotusScript, Java, or importing WSDL
It is very similar to an agent
To be able to write a Web service, you must know how to write a class
If you are working with Notes 6.5 or before, you can build an agent and “fake” it into being a Web service
Web Service Classes
Example of a simple LotusScript custom class:
Class GetPersonInfo
Sub New
End Sub
Public Function GetEmailAddress(personname As String) As String
End Function
Public Function GetPhoneNumber(personname As String) As String
End Function
End Class
Just like an agent, except the New function Acts just like the agent Initialize
Calling a Web Service from Microsoft Word
To call a Web service from Word (or other Office application), use the following code:
SWSDL = "http://www.johndavidhead.com/ls08sessions.nsf/SessionInfo?wsdl"
Set Client = CreateObject("MSSOAP.SoapClient")
Call Client.mssoapinit(sWSDL)
GetSessionList = Client.ListAllSessions
This code uses the SOAPClient control that is part of Windows and Internet Explorer
SOAP is a way to package and interact with a Web service
More Detailed Web Services with Word
Now, we want to take something the user selected and get more info about it
This is a second method in the Web service:Public Function GetSessionFieldValue(sessionid, fieldName) As String
sWSDL = "http://www.johndavidhead.com/advisorsession042006.nsf/SessionInfo?wsdl"
Set Client = CreateObject("MSSOAP.SoapClient")
Call Client.mssoapinit(sWSDL)
GetSessionFieldValue = Client.GetSessionInfo(sessionid, fieldName)
End Function
Sessionid and fieldName are values we pass into the Web service
The return value comes back as string
Ways to Add Domino Functionality to ASP.NET
Using Notes/Domino’s COM interface
Using Domino Web services
Using Domino Web agents and XML
NOTE: Selecting the right option is dependent on the Domino Server version and the developer’s skill
Domino COM in ASP
From within Visual Studio .NET, using the ASP.NET template
Add the Domino COM reference like we have done in Office and VSTO
Build the ASP.NET page
Building the ASP.NET Page
Add the standard fields and labels to the ASP page
The COM code is behind the button
ASP.NET Calling a Domino Web Service
We will call a Domino Web service
ASP.NET will import the Web service
ASP.NET Calling Domino via a Web Service
Demo — Example 4
Creating an ASP.NETWeb page that callsDomino via aWeb service
Integra4Notes and Integra Quick Reports
Integra4Notes A Notes application that allows importing and
exporting of data between Lotus Notes and Word, Excel, PDF files, and XML files
The premier reporting framework for Notes developers
Integra Quick Reports Ad hoc reporting for end users to Microsoft Excel
Mail merge and labels to Microsoft Word
From any Lotus Notes database
Integra4Notes Key Features and Benefits
More advanced capabilities Event-driven script, for example Access multiple databases and sources
– Oracle, SAP, mySQL, etc.
Non-intrusive — no designer changes
Zero footprint — no EXE, no DLLs, etc.
Distribute via email, save to Notes document, send doclinks, send to printer, fax, etc.
Notes client, browser, and scheduled
Export and import
Generate PDFs 4.5 ships with print driver – no extra cost
Third-Party Application Demonstration
Demo — Example 5
Integra4Notes andIntegra Quick Reportsamples
Integra for Notes Personal Edition
Provides the user with integration for their Contacts to do the following:
Mail Merge Labels Mass Email Export to Excel Ad-hoc export to Excel
with Pivot Tables and Charting
Supports Notes 6.5, 7, 8, & 8.5
Supports Office 97 thru 2007
www.integra4notes.com/personal FREE!!!!
Lotus Symphony – The Developer Perspective
Symphony has multiple methods for customization
UNO API Symphony Plug-ins Composite Applications
Introduction to OpenOffice.org development
Designed on an interface-based component model called Universal Network Objects (UNO)
UNO definition UNO offers interoperability between different
programming languages, different object models, different machine architectures, and different processes; either in a local network or even via the Internet
UNO components can be implemented in, and accessed from, any programming language for which a UNO languagebinding exists
Does this work with Lotus Symphony?
The demo will be done using Lotus Symphony
You will need Notes 8.0.1 or higher IBM has exposed the Lotus Symphony objects to the
registry to allow COM to work
If you want run the demos in 8.0.0, they will invoke OpenOffice.org
What is the ServiceManager?
ServiceManager is similar to the NotesSession class
It is a factory class that gets you to other places
Set SM=CreateObject("com.sun.star.ServiceManager")
Think of the ServiceManager as a back-end class, and we want the front end (like NotesUIWorkspace)
Set Desktop=SM.createInstance("com.sun.star.frame.Desktop")
What Did That Do?
Calling the ServiceManager created an OpenOffice.org window, but we need to do more …
Let’s Start Writer — Word Processing Application
So far we have an OpenOffice.Org window, but it doesn’t know what application it will be — we have to tell it
Dim args()
Set WriterApplication=Desktop.loadComponentFromURL ("private:factory/swriter","_blank",0,args)
Args is a variant array We don’t want to pass any parameters, but it must
be an array
The “s” in “swriter” stands for “Star”
Now we have a word processor up and running
The Picture So Far
Now we have an application open
Time to do something!
Let’s Add Some Text First, we need to get a handle to the text part of
the document
Set WriterText=WriterApplication.getText()
Next, we need a cursor position where we can insert the text
Set Cursor=WriterText.createTextCursor()
Finally, we can make the traditional greeting
Call WriterText.insertString(Cursor,"Hello World!",False)
Hello World!
After executing all of the code we walked through, this is the result
Now let’s try it for real
Notes to Writer
Demo — Example 6
“Hello World” fromNotes to Writer
2009 and Beyond
We finally have great tools VS.NET 2008 Lotus Symphony LotusScript API
We have multiple options Office, Symphony, OpenOffice.org, Google Docs, etc.
The Document Format Decision You will be forced into making a decision in the next 24 months
Competition will be good for us … if we can deal with all the changes
If you are going to Lotusphere
Jumpstart JMP205 - Integration of IBM Lotus Notes and Lotus Domino with Microsoft Office, .NET, and IBM Lotus Symphony
Dolphin Americas Seminar : Sunday, 1/18/2009 : 8 AM to 9:30 AM
Swan : Sunday, 1/18/2009 : 1:30 PM to 3:30 PM
BP110: IBM Lotus Symphony and You - A Developer's Perspective
Swan 1-2 : Wednesday, 1/21/2009 : 10 AM to 11 AM
BP305: The Document Format Dance Swan 1-2 : Wednesday, 1/21/2008 : 11:15 AM to 12:15 PM
If you are NOT going to Lotusphere
Don't despair
Full presentation slide decks and ALL demos will be available at
www.johndavidhead.com kassabov.wordpress.com
Thank You!
Questions & Answers
Samples available from Samples available from
www.johndavidhead.comwww.johndavidhead.com
kassabov.wordpress.comkassabov.wordpress.com
jhead@psclistens.com akassabov@psclistens.com
www.johndavidhead.com kassabov.wordpress.com
www.psclistens.com
Recommended