Jmp205 Final
-
Upload
akassabov -
Category
Technology
-
view
1.414 -
download
0
Transcript of Jmp205 Final
Slide 1
JMP205: Integration of IBM Lotus Notes and Lotus Domino with
Microsoft Office, .NET, and IBM Lotus Symphony
John D. Head
Alex Kassabov
Otherwise known as the
Kum-bah-ya session
Before we begin
Please turn off/set to vibrate/mute all
Cell Phones
Pagers
Computers
Please remember to fill out your evaluations
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
We are sharing 21 samples, 3 real world demos & 3 free take-homes in 120 minutes get ready!
Who are we?
John D. Head
Director of Enterprise Collaboration at PSC Group, LLC
Involved in Lotus technology since 1993
Speaker
Over 30 sessions at Lotusphere since 1996
Speaker at Lotus Developer and ILUG conferences
Author
Advisor Magazine and other publications on Office and SmartSuite integration with Notes
LotusUserGroup.org contributing Author and Forum moderator
www.johndavidhead.com
Who are we?
Alex Kassabov
Vice President of Collaboration at PSC Group, LLC
Involved in Lotus technology since 1995
Notes R3 got dragged there kicking and screaming
Speaker
Lotusphere sessions on Desktop Integration
Collaboration Summit
GRAINTE Chicago Lotu
kassabov.wordpress.com
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 Award!
Host of the following blogs:
Ed Brills
(www.edbrill.com)
Lotus Sametime
(www.thesametimeblog.com)
Domino Server Team
(www.dominoblog.com)
Lotus Connections Team
(synch.rono.us)
Lotus Usability (Mary Beth Raven)
(www.notesdesign.com)
Lotus Mashups
(www.mix-and-mash.com)
Alan Gartenberg - DB2
(www.adamgartenberg.com)
Alan Lepofskys Notes Tips
(www.alanlepofsky.net)
Chris Pepin IBM CTOs Office
(www.chrispepin.com)
The Demo Databases
Presentation example database
Single database with all examples
You can configure it for your Notes client
Example numbers in the presentation match those in the database
Lotusphere 2009 session database
From Genii Software
Updated version inside the demo database
Personal name and address book
Our demos work with the standard Notes 6, 7, 8, & 8.5 templates
Lets take a little poll
Who is using
Office 97 and earlier
Office 2000
Office XP
Office 2003
Office 2007
OpenOffice / StarOffice
Lotus Symphony
iWork
Other
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
Integration History
1994
DDE with Ami Pro
1996
Notes R4
OLE
LotusScript
VBA
1997
SmartSuite with LotusScript (Word Pro)
1998
Notes R5 with COM support
2001
Notes Domino 6
2004
Notes Domino 6.5 with LS2J and DXL
2005
Notes Domino 7 with Web services
2007
2007 Office System
Lotus Notes/Domino 8
Lotus Symphony
2008
Visual Studio 2008
Notes/Domino 8.5
Timeline w/ logos
The Good News
We have entered the Industrial Revolution period of the
Integration Era
In the Medieval Times
DDE with Ami Pro
NotesSQL was used to get even the most basic of data
OLE embedding
Notes F/X
2 slides the medieval times (bad graphic of plague), second slide about he renaissance w/ picture of da vinci and why
The Good News (continued)
The Renaissance brought us new tools
OLE automation
COM automation
And much more
The Revolution brings us major changes
A true competitor to Office
Visual Studio.NET 2008 and VSTO 3.0
Code begins to move from inside a document to complete applications
Definitions for Notes Programmers
Lets 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
OLE/1 File Attachments
Advantages:
Functionality clearly divided between applications
No memory issues
Much smaller size footprint
Enables template usage
OLE/1 File Attachments (cont)
Disadvantages:
Requires more planning
More effort for basic functionality
Attachment does not know about the Notes object
Must manually connect and update
Notes 6 added the ability to round-trip edit attachments
OLE/2 Linking and Embedding
Advantages:
Integrated single interface when using embedded objects (when used in-line)
Document containing objects is aware of the embedded object
Less work to get object open for the user
OLE/2 Linking and Embedding (cont.)
Disadvantages:
OLE embedded objects are:
Much bigger 10 to 15 times
Difficult for users when the object is more than one page
OLE embedding was not reliable before Office XP with Windows XP
File menu of container application is never updated
#1 issue no clean way to export data from embedded objects
Locked data is bad
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
Integration from the Notes Client
Integrating Microsoft Word
Integrating Lotus Symphony Documents
Working With Attachments
Mail Merge
Integrating Microsoft Excel
Integrating Lotus Symphony Spreadsheets
Integrating Microsoft PowerPoint
Integrating Lotus Symphony Presentations
Integrating Microsoft Project
Integration from Notes
From Notes, you will write code to manipulate the application
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 Hello World
Demo Example 1
Launch MicrosoftWord and enter some text
pe01832_
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 code
Variant
Application Object Name
LotusScript Method
Set hwd = CreateObject("Word.Application")
Screenshots of demos
Creating a Word Document (cont.)
You must follow the applications 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.
Recording Actions in Microsoft Word
Demo Example 2
Use the Microsoft Wordmacro recorder to write VBA for us
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Whats 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"
Use the Microsoft Constants Database
Provides a listing of all Microsoft Office variables and their converted constants
Extraction of constants by John Collidge
Database built by Tom Duff
Now an OpenNTF.org project
Supports Microsoft Office 2000, XP, 2003, and 2007
More features planned!
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
Domino COM Basics (cont.)
The COM objects must be able to find the Notes.ini
Looks in:
Notes program directory
Path
KeyFileName in Notes.ini is used to determine what ID to use for authentication
Multiple installed versions of Notes are a problem
Uses the last installed version
HKEY_CLASSES_ROOT\.nsf\Shell\Open\Command
HKEY_CLASSES_ROOT\notes.exe\Shell\Open\Command
HKEY_LOCAL_MACHINE\SOFTWARE\Lotus\Notes
Make Your End Users Happy!
Prevent password prompts by
Notes 5.X
Notes 6 , 7, 8 & 8.5
Domino COM Basics
Must use NotesSession.Initialize("") to establish connection between application and Notes
Can not use extended syntax (i.e., dot notation) to reference items in a document
NO
NotesDocument.Form(0)
YES
NotesDocument.GetItemValue(Form)(0)
Domino COM Basics (cont.)
Can not use New to create Domino objects
Exception is NotesSession
NO
Dim db as New NotesDatabase(server, dbpath)
YES
Dim db as NotesDatabase
Set db = NotesSession.GetDatabase(server, path)
Domino COM Basics (cont.)
No such thing as a current environment or object
No CurrentDatabase, DocumentContext, etc.
If a property returns an array of objects, you must assign the property to a variable first
NO
Dim view as NotesView
Set view = NotesDatabase.Views(0)
YES
Dim views as Variant, view as NotesView
views = NotesDatabase.Views
Set view = views(0)
Domino COM Basics (cont.)
VB doesnt use ForallEndAll
Uses For EachNext, instead
VB doesnt support Today keyword
VB doesnt support using pipes ( | ) and braces ( {} ) for string delimiting
Refer to ND Designer Help for more information
Word Template Data from Notes
Demo Example 3
Create a new documentPrompt userPlace data into document
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Managing the Template
How did I get that template in my new dialog?
Template installation tool
Each template is a document
Supports all Office 2000 through 2007 applications
Can also be used as a programmatic template tool
Located on OpenNTF.org and on the conference CD
Attachments
How the user interacts directly with the attachment may be the make or break part of your application
Store the attachment in a rich text field
Programmatically detach and save the attachment
Prevents user error
Take advantage of the ND6 and ND7 in place editing functionality
Working with the Attachment
This code is used to detach an attachment
Set attachmentfield = document.getfirstitem(fieldname)
If attachmentfield.embeddedobjects(0) Is Nothing Then
Msgbox No embedded objects were found on the document, 16, Attachment Demo
Exit Function
End If
If attachmentfield.EmbeddedObjects(0).Type EMBED_ATTACHMENT Then
Msgbox No attachments were found on the document, 16, Attachment Demo
Exit Function
End If
Forall o In attachmentfield.EmbeddedObjects
filename = o.source
End Forall
Set Object = document.GetAttachment(filename)
Call Object.ExtractFile (filepath + filename)
Get the rich text field
Extract the attachment
Get the object based on the filename
Get the filename of the attachment in the field
Check for an attachment
Check for an object
Saving the Attachment
Once the code is complete, save the attachment back to the Notes document
This will prevent user mistakes
Dim newrichtextfield As notesrichtextitemDim newobject As notesembeddedobjectnewdoc.removeitem ("Attachment")Set newrichtextfield = newdoc.CreateRichTextItem("Attachment")Set newobject = newrichtextfield.EmbedObject(EMBED_ATTACHMENT, "", filepath + filename)
Attachment Demo
Demo Example 4
User form that workswith attachments
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
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 language
binding exists
OpenOffice.org? StarOffice? Lotus Symphony?
StarDivision StarOffice written in the mid 80s
Bought by Sun Microsystems in 1999, StarOffice released in August 1999
Source code released October 2000
OpenOffice.org 1.0 released May 2002, 2.0 in October 2005
OpenDocument format becomes international standard ISO/IEC 26300 November 2006
IBM Lotus Workplace Productivity Editors released 2005
Based on OpenOffice.org 1.1
OpenOffice.org 2.2 released March 2007
Notes 8 to include IBM Productivity Tools, based on OpenOffice.org 1.1X
Lotus Symphony Beta 1 released in October 2007, Beta 2 in December 2007
Lotus Symphony 1.2 stand-alone, included in 8.5
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
Lets Start Writer Word Processing Application
So far we have an OpenOffice.Org window, but it doesnt 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 dont 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!
Lets 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 lets try it for real
Notes to Lotus Symphony Documents
Demo Example 5
Hello World fromNotes to Lotus SymphonyDocuments
pe01832_
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 bosss personal name and address book and be the HERO!
Screenshot of action in PNAB absract size
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 6
Generate a mail mergefrom the personalname and addressbook
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Mail Merge with OpenOffice.org Writer
Just like the other applications, mail merge has its
own URL
Set objMailMerge = objServiceManager.createInstance
("com.sun.star.text.MailMerge")
Mail merge has seven arguments
DocumentURL
DataSourceName
CommandType
Command
OutputType
OutputURL
FileNamePrefix
Mail Merge with OpenOffice.org Writer (cont.)
Set the seven arguments
Set args(1) = OOoNamedValue("DocumentURL", url)
Set args(0) = OOoNamedValue("DataSourceName", "mrgdata")
Set args(2) = OOoNamedValue("CommandType", 0)
Set args(3) = OOoNamedValue("Command", "mrgdata")
Set args(4) = OOoNamedValue("OutputType", 2)
Output has two options
1 = Send to printer
2 = Save to file
Set args(5) = OOoNamedValue("OutputURL", savelocation)
Set args(6) = OOoNamedValue("FileNamePrefix", "mailmergeoutput1")
Mail Merge with OpenOffice.org Writer (cont.)
Finally, call the Execute method to complete the
mail merge
objMailMerge.Execute args()
Lotus Symphony Documents Mail Merge and Notes
Demo Example 7
Creating a mail mergeletter from the Notespersonal name
and
address book
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Integration with Microsoft Excel
Working with Excel is very different from Word
The objects we use are different
In Excel, we tend to move more data from Notes to the application
Lots of rows in Excel vs. filling in bookmarks in Word
The Beginning with Excel
To start, use a different object
Set hwd = CreateObject("Excel.Application")
Next, create a new workbook
hwd.Workbooks.Add
And its time to add data
Working with Cells and Ranges
We can work with cells or ranges
For operating on a specific cell
hwd.cells(1,1).value=Name
hwd.cells(1,2).value=Category
For operating on multiple cells use a range
xlRange="$A$1:$C$1
With hwd
.Range(xlRange).Font.Bold = True ' set row to bold
.Range(xlRange).Borders.LineStyle=1' set border
.Range(xlRange).Borders.Weight=1 ' set weight of border
End With
Dealing with the Default Row and Column Size
Excel does not autosize columns and rows
Do it within your code
hwd.Range(xlRange).EntireColumn.AutoFit
or
hwd.Range(xlRange).EntireRow.AutoFit
Creating a Chart
xlRange="$A$1:$C$10"
hwd.Charts.Add
hwd.ActiveChart.ChartType = 51
hwd.ActiveChart.SetSourceData hwd.Sheets("Sheet1").Range("A1:C10"), 2
hwd.ActiveChart.SeriesCollection(1).Name = "=""Notes Chart"""
hwd.ActiveChart.Location 2, "Sheet1
With hwd.ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "Notes to Excel Demo
.Axes(1,1).HasTitle = True
.Axes(1,1).AxisTitle.Characters.Text = "X Axis
.Axes(2,1).HasTitle = True
.Axes(2,1).AxisTitle.Characters.Text = "Y Axis
.ApplyDataLabels 2, True
.HasDataTable = False
End With
hwd.ActiveSheet.Shapes("Chart 1").ScaleHeight 1.46, 0,0
Add the chart from the above range
Create the chart on the current sheet
Resize the chart to a specific height
Working with Microsoft Excel
Demo Example 8
Create a spreadsheetfrom Notes data andgenerate a chart
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Lets Start Lotus Symphony Spreadsheets
Calc uses a different URL to define the application
Set CalcApplication = Desktop.loadComponentFromURL_("private:factory/scalc","_blank",0,args)
The command above creates the workbook
Next, we need to get the first sheet
Set Worksheet=CalcApplication.Sheets.getByName("Sheet1")
Lets Start Lotus Symphony Spreadsheets (cont.)
Finally, we access the cell into which we want to
enter text
Set cell=Worksheet.getCellByPosition(3,6)
We have set the string in a cell, but which cell is it?
Notes with Lotus Symphony Spreadsheets
Demo Example 9
Hello World withNotes and Lotus SymphonySpreadsheets
Where will the text go?
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Notes with Lotus Symphony Spreadsheets D7!
Why did the text go into cell D7? Didnt we write to cell (3,6)?
Rows and Columns Are Numbered from Zero
Just like arrays in Notes, the index starts at 0!
PowerPoint is closer to Word than Excel
Integration with Microsoft PowerPoint
The Beginning with PowerPoint
To start, use the PowerPoint object
Set hwd = CreateObject(PowerPoint.Application")
Next, create a new presentation
hwd.Presentation.Add 1, 1
And its time to add data
Working with PowerPoint Shapes
Every slide has shapes
Title text box
Bullet text box
etc.
Each shape has a name
Finding the name is typically hunt and peck
I always use the macro function to determine the shape name
You can also write a macro
Working with Shapes
You have to navigate to enter text in PowerPoint
Shape
TextFrame
Characters
Selection
hwd.ActiveWindow.Selection.SlideRange.Shapes("Rectangle 2").Selecthwd.ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Selecthwd.ActiveWindow.Selection.ShapeRange.TextFrame.TextRange.Characters(1,0).SelectWith hwd.ActiveWindow.Selection.TextRange.Text = sessiontitleEnd With
Working with PowerPoint
Demo Example 10
Create a presentationusing contacts or sessions
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Introduction to Lotus Symphony Presentations
Impress and Draw are almost the same application
Pages contain shapes
Shapes can contain text
Text is handled just as it is in Lotus Symphony Documents
Lets Start Lotus Symphony Presentations
To create the instance of Impress, call its URL
Set ImpressApplication=Desktop.loadComponentFromURL_
("private:factory/simpress","_blank",0,args)
Next, call the getDrawPages function to create the default
presentation
Set Presentation=ImpressApplication.getDrawPages()
To get the first slide, use the getByIndex method
Set Slide=Presentation.getByIndex(0)
Lets Start Lotus Symphony Presentations (cont.)
Each layout type has its own number
To create a title page, enter the following:
Slide.layout=1
Finally, we need to get the title and handle it like its a Lotus
Symphony Documents text object
Set title=Slide.getbyindex(0)
Set TitleText=title.getText()
Set Cursor=TitleText.createTextCursor()
Call TitleText.insertString(Cursor,"Hello World!",False)
Lotus Symphony Presentations & Notes - Result
Lotus Symphony Presentations and Notes
Demo Example 11
Hello World withNotes and Lotus SymphonyPresentations
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Integration with Microsoft Project
Microsoft Projects COM API is the hardest of all the Office applications
Syntax is very different
There is no mapping between the other applications
and Project
Beginning with Project
To start, use the Project object
Set hwd = CreateObject(msproject.Application")
Next, create a new Project file
Call msproject.filenew(False, "", False, False)
And its time to add data
Adding Notes Data to Project
To start, add data to specific rows in Project
You must also specify the field
Call msproject.settaskfield("Name", doc.subject(0), False, True,
1)
Once you have filled all the fields for the row, select the row
to move the cursor
Call msproject.selectrow(projidcount, False, 1)
Microsoft Project
Demo Example 12
Create an MS Projectplan using tasks orsessions
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
What Well Cover
Microsoft Word and Web services
Microsoft Excel and XML
Microsoft InfoPath and Web services
.NET and Lotus Notes/Domino
Visual Studio tools for Office
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
As the title suggests, this part is more technical We are about to pick up the pace
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
Funny picture for limitations
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 for both the client and the server
Alphabet soup picture
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
Class description cover what a class is, how easy it is to build one
Lotus Developer Sessions Web Service
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
Word 2007 and Web Services
Word template that prompts the user
Prompted information is from a Notes database
Instead of using COM, data is obtained via Web services
Code written inside the Visual Basic for Applications Integrated Development Environment (IDE)
Demo Example 13
Word template thatreads a Notes databasevia a Web service
pe01832_
Office and XML Details
Office 2003 added XML support
Word and Excel
Export-like Save option
Excel can import data from an XML file
Import XML schema
Transform XML with XML style sheets
Office and XML Details (cont.)
Office 2007 uses XML as the default new file format
Microsoft is working to make the new XML file format an ISO standard
Called Open XML
Office 2003 can open these new formats with an update you can download from Microsoft
Learn more about OOXML, ODF in John's Best Practices Session
BP305: The Document Format Dance
Working with Domino Data as XML
Use the core Domino classes
LotusScript and Java
Domino XML (DXL)
Cheat
Add passthru HTML to a form
Build your own agent to output XML
A Domino Agent That Creates XML
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim view As NotesView
Set db = s.currentDatabase
Set view = db.GetView( "XML" )
Set doc = view.GetFirstDocument
Print "Content-type: text/xml
Print "
While Not ( doc Is Nothing )
Print ""
Print ""+doc.bookTitle(0)+"
Print ""+doc.bookAuthor(0)+""
Print ""+doc.bookDiscountPrice(0)+""
Print ""+doc.bookCategory(0)+""
Print ""
Set doc = view.GetNextDocument( doc )
Wend
Print ""
How Domino Data Looks as XML
Using XML with Excel
Read XML from a Notes database
XML generated via an agent in Notes database
Chart the data using Excel charting tools
Works with Domino 5.X, 6.X, 6.5.X, 7, 8, & 8.5
For this example, we will not write any code!
Microsoft Excel and XML
Demo Example 14
Importing Domino datainto a spreadsheetusing XML
pe01832_
.NET and Lotus Notes/Domino
The .NET CLR acts like a Java Virtual Machine (JVM) for running code
CLR = Common Language Runtime
It provides a single point for:
Security
Access/registration of objects
Management
Logging
.NET added managed code
Code that is managed, runs
Code that is not managed is stopped
Managed Code
.NET managed code must be signed
Visual Studio .NET can sign the code
Certificates much like the VBA code signatures
You can get one from VeriSign and other companies
Free if its for internal use only
Purchasable if you want to sign code and ship it
Managed Code and Domino
Why does a Domino developer care?
By default, COM is considered unmanaged and unsigned to the .NET Common Language Runtime (CLR)
Managed code also prevents .NET components from being called by COM
You can create COM Callable Wrappers (CCW) in Visual Studio .NET
Generating COM Callable Wrappers
Steps to build a .NET component so that it can be used from COM:
Sign the assembly with a strong name
Build the .NET assembly (component)
Register the .NET component as a COM object
Optional:
Add attributes to the .NET code that give more control of the COM interface that is generated
Visual Studio .NET
Introduced in 2002
Provides the default Microsoft Development Environment
Design goal is to be the only IDE for Microsoft software
Supports multiple languages
VB .NET
C#
etc.
Supports WinForms
Uses .NET security
Lead in to smart documents
Visual Studio Tools for Office 2005
Add-in for Visual Studio .NET
Adds support for:
Word
Excel
InfoPath
Outlook
Can develop in:
Visual Basic
C#
Word with VSTO
Same demo as the Word 2007 Web services demo
Built in VS .NET using VSTO 2005
Uses the Word template that comes with Visual Studio Tools for Office (VSTO)
The Web service is created using the VS .NET Web Service Connector tool
Microsoft Word and VSTO 2005
Demo Example 15
Creating a new Worddocument that promptsthe user and fills out Dominodata via a Web service
pe01832_
Visual Studio .NET 2005
Supported applications and templates
Microsoft Visual Studio 2005 Tools for Office Second Edition Runtime
Supports Office 2007
Free download from Microsoft Developer Network
Only supports add-ins
No document or template Templates
More applications supported
Stopgap support for Office 2007 until VS .NET 2008
Visual Studio .NET 2005 Second Edition Templates
For Office 2007, here are the supported Add-ins:
VS .NET 2005 SE and Domino Data
Session evaluation sample used in the Word and Web services and VS .NET 2005 demos
Rebuilt for Word 2007
Uses a side panel add-in to prompt the user to select some data
2007 Microsoft Office System Logical Architecture
Visual Studio.NET 2008 and VSTO 3.0
VSTO is no longer a separate download
Support for Office 2003 and 2007
Ribbon Designer
Template Options mimic other VS.NET projects
VSTO 3.0 Project Types
http://www.danielmoth.com/Blog/NewO11ProjectB1.jpghttp://www.danielmoth.com/Blog/NewO12ProjectB1.jpg
Office 2007 Server-Side Options
Microsoft SharePoint Services 3.0
Microsoft SharePoint 2007
Microsoft ASP.NET 2.0
Microsoft Excel Services
Microsoft Office Groove
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
Ways to Add Domino Functionality to ASP.NET
Using Notes/Dominos 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 developers 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
Calling Domino via COM in ASP.NET
Below is the code behind that button:
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Dim s As New Domino.NotesSession Dim dbdir As Domino.NotesDbDirectory Dim db As Domino.NotesDatabase Try s.Initialize() you can also use s.Initialize("password") dbdir = s.GetDbDirectory("") db = dbdir.OpenDatabase(TextBox1.Text) Label1.Text = db.Title Label2.Text = db.FileName Label3.Text = db.FilePath Label4.Text = db.ReplicaID Label5.Text = db.Size Label6.Text = db.Created Label7.Text = db.LastModified Catch ex As Exception Label1.Text = ("An Error Happend " & ex.Message & & ex.Source) Finally System.Runtime.InteropServices.Marshal.ReleaseComObject(s) End Try End Sub
ASP.NET Calling Domino via COM
Demo Example 16
Creating an ASP.NETWeb page thatcalls Domino via COM
pe01832_
ASP.NET Calling a Domino Web Service
We can call the same Domino Web service we have used before
ASP.NET will import the Web service
Code behind the button will be virtually the same as when ASP.NET called Domino via COM
ASP.NET Calling Domino via a Web Service
Demo Example 17
Creating an ASP.NETWeb page that callsDomino via aWeb service
pe01832_
ASP.NET Can Also Work with Domino XML
ASP.NET can display Domino data in a great grid control
Steps to make this happen:
Drag a GridView data control onto your page
An XMLDataSource object is automatically added
The XMLDataSource is associated with the GridView control
Set the DataFile property of the XMLDataSource to the
XML agent
Domino Data in a Grid on an ASP.NET Web Page
This is what the data will look like in the grid control:
Displaying Domino XML in an ASP.NET Web Page Grid
Demo Example 18
Creating an ASP.NETWeb page that usesthe grid control to display Domino XMLpe01832_
Microsoft SharePoint Integration
Integration at the Notes client
Mainsoft Sharepoint Integrator
Integration with Domino data
A combination of
VSTO
Domino XML
Some magic :-)
Samples inspired by Gary Devendorf @ Microsoft
Microsoft SharePoint Ingetration
Demo Example 19
Posting documents created via Automationto Microsoft SharePointpe01832_
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
Google Docs Integration
Higher degree of difficulty
Java code integrated with the Notes 8 and 8.5 Standard Clients
Eclipse.org plug-ins
A sidebar application that displays the documents
Just like Quickr!
This sample is not for the timid!
There is also a C# library available
Google Docs Integration Posting Documents
Demo Example 20
Saving Documents fromNotes to Google Docspe01832_
Google Docs Integration Domino Data in Spreadsheet
Demo Example 21
Using Domino Data viaRSS feed in Spreadsheetpe01832_
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
Reporting Options
Use Excel/Calc
Use a third-party tool
Five Third Party Tools Available
Crystal Reports
IntelliPRINT Analytics/Reporting
SWING
SQL Reporting tools via DB2NSF
Integra4Notes/Integra Quick Reports
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 22
Integra4Notes andIntegra Quick Reportsamples
pe01832_
At this point we will demo the file search program at http://www.bvstools.com/cgidev2/filesearch
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 200 thru 2007
FREE!!!!!!!
0.D00.gifwww.integra4notes.com/personal
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
Real World Integration
Real World Use Cases
Zain Africa Challenge Application
www.zainafricachallenge.com
PSC won the 2009 Best Philanthropic Lotus Award for this solution
Integration Samples
Excel for reporting
Word for Scripts
Integra for XML export
Agenda
Who we are?
Integration Background
Integration from the Notes client
Integration from other applications
Integration from a web browser
Integration with Google Docs
Reporting Options
Real World Integration
Looking forward
Wrap-up and Q&A
2009 and Beyond
We finally have great tools
VS.NET 2008
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
Sessions you should see this week
BP110: IBM Lotus Symphony and You - A Developer's Perspective
John Head
Loction TBD
BP305: The Document Format Dance
John Head
Location TBD
BP111: Reports, Charts, and Graphs 2.0
Julian Robichaux & Rob McDonagh
Location TBD
Resources
LDD Discussions (Notes.Net)
www-130.ibm.com/developerworks/lotus
OpenOffice.org
www.openoffice.org
OpenOffice Developers Guide
api.openoffice.org/DevelopersGuide/DevelopersGuide.html
Programming OpenOffice with Visual Basic
www.kalitech.fr/clients/doc/VB_APIOOo_en.html
John Heads blog
www.johndavidhead.com
Slides and content available from
www.johndavidhead.com
kassabov.wordpress.com
Resources (cont.)
Microsoft Office developers Web site
msdn2.microsoft.com/en-us/office/default.aspx
Microsoft Developer Network
msdn.microsoft.com
Microsoft Office blog listing
msdn2.microsoft.com/en-us/office/aa905342.aspx
OpenNTF.org the open source Web site for Notes
www.openntf.org
Integra4Notes Web site
www.integra4notes.com
PSCs Reporting and Office Integration page
www.psclistens.com/enTouchCMS/app/viewCategory?
catgId=66
Thank You!
Questions & AnswersPlease remember to fill out your evaluation.Samples available from www.johndavidhead.com
[email protected] [email protected] kassabov.wordpress.comwww.psclistens.com
Legal disclaimer
IBM Corporation 2008. All Rights Reserved.
The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBMs current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software.
References in this presentation to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. Product release dates and/or capabilities referenced in this presentation may change at any time at IBMs sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.
IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino and Lotusphere are trademarks of International Business Machines Corporation in the United States, other countries, or both. Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries. Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both. Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.
Microsoft WordMicrosoft Excel
Text Position/CursorCell
ParagraphRange
PageWorksheet
DocumentWorkbook
Microsoft WordMicrosoft PowerPoint
Text Position/CursorText Position/Cursor
ParagraphText Block
PageSlide
DocumentPresentation
lotus_logols8_sm
ibm_white_logo_300dpi
ls8
lotus_logols8_sm
Click to edit the outline text format
Second Outline Level
Third Outline Level
Fourth Outline Level
Fifth Outline Level
Sixth Outline Level
Seventh Outline Level
Eighth Outline Level
Ninth Outline Level
Click to edit the outline text format
Second Outline Level
Third Outline Level
Fourth Outline Level
Fifth Outline Level
Sixth Outline Level
Seventh Outline Level
Eighth Outline Level
Ninth Outline Level
Click to edit the outline text format
Second Outline Level
Third Outline Level
Fourth Outline Level
Fifth Outline Level
Sixth Outline Level
Seventh Outline Level
Eighth Outline Level
Ninth Outline Level