BP204 Integration of OpenOffice.org and IBM Lotus Notes and Domino


Published on

By John Head and Alan Bell

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

BP204 Integration of OpenOffice.org and IBM Lotus Notes and Domino

  1. 1. BP204 Integration of OpenOffice.org and IBM Lotus Notes and Domino <ul><ul><li>Alan Bell </li></ul></ul><ul><ul><li>John D. Head </li></ul></ul>
  2. 2. Before we begin <ul><li>Please turn off/set to vibrate/mute all Cell Phones Pagers Computers Please remember to fill out your evaluations </li></ul>
  3. 3. Agenda <ul><li>Who are we? </li></ul><ul><li>What is OpenOffice.org </li></ul><ul><li>EXAMPLE 1 thru 3 – The Hello World examples </li></ul><ul><li>EXAMPLE 4 – Hello World using Java </li></ul><ul><li>EXAMPLE 5 – Mail Merge </li></ul><ul><li>EXAMPLE 6 – Fun with Spreadsheets </li></ul><ul><li>EXAMPLE 7 – A Real World Notes Application </li></ul><ul><li>EXAMPLE 8 – Impress with Impress </li></ul><ul><li>Notes 8 Productivity Editors </li></ul>
  4. 4. Who are we? <ul><li>Alan Bell </li></ul><ul><ul><li>Dominux Consulting </li></ul></ul><ul><ul><li>Penumbra Group </li></ul></ul><ul><ul><li>The Open Learning Centre </li></ul></ul>
  5. 5. About Dominux
  6. 6. Who are we? <ul><li>John D. Head </li></ul><ul><li>Offering and Development Manager for frameworks at PSC Group, LLC </li></ul><ul><li>Involved in Lotus technology since 1993 </li></ul><ul><li>Speaker </li></ul><ul><ul><li>Over 22 sessions at Lotusphere since 1996 </li></ul></ul><ul><ul><li>Speaker at Advisor conferences </li></ul></ul><ul><li>Author </li></ul><ul><ul><li>Advisor Magazine and other publications on Office and SmartSuite integration with Notes </li></ul></ul><ul><ul><li>LotusUserGroup.org contributing Author and Forum moderator </li></ul></ul><ul><li>www.johndavidhead.com </li></ul>
  7. 7. PSC Group, LLC <ul><li>IBM Premium Business Partner for 15+ Years </li></ul><ul><li>Microsoft Gold Partner </li></ul><ul><li>Host of OpenNTF.org </li></ul><ul><li>Winner of 2007 Lotus Award! </li></ul><ul><li>Host of the following blogs: </li></ul><ul><ul><li>Ed Brill’s ( www.edbrill.com ) ‏ </li></ul></ul><ul><ul><li>Alan Lepofsky’s Notes Tip’s ( www.alanlepofsky.net ) ‏ </li></ul></ul><ul><ul><li>Alan Gartenberg - Sametime ( www.adamgartenberg.com ) ‏ </li></ul></ul><ul><ul><li>Jeff Eisen – Hannover  ( www.jeffeisen.com ) ‏ </li></ul></ul><ul><ul><li>Domino Server Team (www.dominoblog.com) ‏ </li></ul></ul>
  8. 8. A little poll ... <ul><li>Who is using … </li></ul><ul><ul><li>Office 97 and earlier </li></ul></ul><ul><ul><li>Office 2000 </li></ul></ul><ul><ul><li>Office XP </li></ul></ul><ul><ul><li>Office 2003 </li></ul></ul><ul><ul><li>OpenOffice / StarOffice </li></ul></ul><ul><ul><li>Other </li></ul></ul>
  9. 9. OpenOffice.org – The History <ul><li>Star Division Star Office written in the mid 80s </li></ul><ul><li>Bought by Sun Microsystems in 1999 </li></ul><ul><li>Sun Star Office released in August 1999 </li></ul><ul><li>Source code released October 2000 </li></ul><ul><li>OpenOffice.org 1.0 released May 2002 </li></ul><ul><li>OpenOffice.org 2.0 released October 2005 </li></ul><ul><li>OpenDocument format becomes international standard ISO/IEC 26300 November 2006 </li></ul><ul><li>IBM Lotus Workplace Productivity Editors released 2005 </li></ul><ul><ul><li>Based on OpenOffice 1.1 </li></ul></ul><ul><li>Notes 8 to include IBM Productivity Editors </li></ul>
  10. 10. What is OpenOffice.org? <ul><li>From the website: free office suite - OpenOffice.org is a multiplatform and multilingual office suite and an open-source project. Compatible with all other major office suites, the product is free to download, use, and distribute. To help build the community, join us. </li></ul><ul><li>And the mission statement: To create, as a community, the leading international office suite that will run on all major platforms and provide access to all functionality and data through open-component based APIs and an XML-based file format. </li></ul>
  11. 11. What is OpenOffice.org? <ul><li>Getting past the marketing speak … </li></ul><ul><li>… OpenOffice is an alternative to Microsoft Word, Excel, and PowerPoint … which is FREE </li></ul><ul><li>Provides the following applications </li></ul><ul><ul><li>Writer – Document Editor </li></ul></ul><ul><ul><li>Impress – Presentation Program </li></ul></ul><ul><ul><li>Math – Math Function Creator </li></ul></ul><ul><ul><li>Draw – Vector Drawing Tool </li></ul></ul><ul><ul><li>Calc - Spreadsheet </li></ul></ul><ul><ul><li>Base - Database </li></ul></ul>
  12. 12. Why should I care about OpenOffice.org? <ul><li>Only office suite that supports Open Document Format (ODF) 100% </li></ul><ul><li>A free alternative to Microsoft Office </li></ul><ul><li>Runs on 3 platforms </li></ul><ul><ul><li>Windows </li></ul></ul><ul><ul><li>Mac </li></ul></ul><ul><ul><li>Linux </li></ul></ul><ul><li>Saves to PDF Natively </li></ul><ul><li>OpenOffice is the basis of the IBM Productivity Tools included with IBM Lotus Notes 8 </li></ul>
  13. 13. OpenOffice.org - Licensing <ul><li>Licensing </li></ul><ul><ul><li>LGPL – the GNU Lesser General Public License </li></ul></ul><ul><ul><li>“ Lesser” means that non-free code can use integration with OpenOffice.org (roughly speaking) ‏ </li></ul></ul><ul><li>Is it really Free? </li></ul><ul><ul><li>Yes </li></ul></ul><ul><li>Will it always be Free? </li></ul><ul><ul><li>Yes </li></ul></ul>
  14. 14. OpenOffice.org != StarOffice <ul><li>StarOffice is Sun’s packaged version of OpenOffice </li></ul><ul><li>Sun adds other software, services, and support </li></ul><ul><li>For development purposes, you can write code that runs in both </li></ul>
  15. 15. Introduction to OpenOffice.org Development <ul><li>The OpenOffice Development effort is designed on an interface-based component model called UNO ( Universal Network Objects) ‏ </li></ul><ul><li>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. </li></ul>
  16. 16. Say Hi to the ServiceManager <ul><li>The ServiceManager is kind of like the NotesSession class, it is a factory class that gets you to other places </li></ul><ul><ul><ul><li>Set SM=CreateObject(&quot;com.sun.star.ServiceManager&quot;) ‏ </li></ul></ul></ul><ul><li>You can think of the ServiceManager as a back end class, and we want the front end, (like NotesUIWorkspace) ‏ </li></ul><ul><ul><ul><li>Set Desktop=SM.createInstance(&quot;com.sun.star.frame.Desktop&quot;) ‏ </li></ul></ul></ul>
  17. 17. What did that do?
  18. 18. Lets start an application <ul><li>So far we have an OpenOffice.Org window, but it doesn't yet know what application it will be, so we have to tell it. </li></ul><ul><ul><ul><li>Dim args() ‏ </li></ul></ul></ul><ul><ul><ul><li>Set WriterApplication=Desktop.loadComponentFromURL (&quot;private:factory/swriter&quot;,&quot;_blank&quot;,0,args) ‏ </li></ul></ul></ul><ul><li>Args is a variant array, we don't want to pass any parameters, but it must be an array. </li></ul><ul><li>The s in swriter stands for “Star” </li></ul><ul><li>Now we have a word processor up and running </li></ul>
  19. 19. The picture so far . . .
  20. 20. Now for some text <ul><li>First we need to get a handle to the text part of the document </li></ul><ul><ul><ul><li>Set WriterText=WriterApplication.getText() ‏ </li></ul></ul></ul><ul><li>And we need a cursor position where we can insert some text </li></ul><ul><ul><ul><li>Set Cursor=WriterText.createTextCursor() ‏ </li></ul></ul></ul><ul><li>Finally we can make the traditional greeting </li></ul><ul><ul><ul><li>Call WriterText.insertString(Cursor,&quot;Hello World!&quot;,False) ‏ </li></ul></ul></ul>
  21. 21. Hello World!
  22. 22. EXAMPLE 1 Writer “Hello World” - Lets see all the code together <ul><ul><ul><li>Sub Click(Source As Button) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set SM=CreateObject(&quot;com.sun.star.ServiceManager&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set Desktop=SM.createInstance(&quot;com.sun.star.frame.Desktop&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>Dim args() ‏ </li></ul></ul></ul><ul><ul><ul><li>Set WriterApplication=Desktop.loadComponentFromURL_ </li></ul></ul></ul><ul><ul><ul><li>(&quot;private:factory/swriter&quot;,&quot;_blank&quot;,0,args) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set WriterText=WriterApplication.getText() ‏ </li></ul></ul></ul><ul><ul><ul><li>Set Cursor=WriterText.createTextCursor() ‏ </li></ul></ul></ul><ul><ul><ul><li>Call WriterText.insertString(Cursor,&quot;Hello World!&quot;,False) ‏ </li></ul></ul></ul><ul><ul><ul><li>End Sub </li></ul></ul></ul>
  23. 23. EXAMPLE 2 Hello Calc <ul><ul><ul><li>Sub Click(Source As Button) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set SM=CreateObject(&quot;com.sun.star.ServiceManager&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set Desktop=SM.createInstance(&quot;com.sun.star.frame.Desktop&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>Dim args() </li></ul></ul></ul><ul><ul><ul><li>Set CalcApplication=Desktop.loadComponentFromURL_ </li></ul></ul></ul><ul><ul><ul><li>(&quot;private:factory/scalc&quot;,&quot;_blank&quot;,0,args) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set Worksheet=CalcApplication.Sheets.getByName(&quot;Sheet1&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set cell=Worksheet.getCellByPosition(3,6) ‏ </li></ul></ul></ul><ul><ul><ul><li>Call cell.setString(&quot;Hello World!&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>End Sub </li></ul></ul></ul><ul><li>We have set the string in a cell, but which cell is it? </li></ul>
  24. 24. D7!
  25. 25. Rows and columns are numbered from zero
  26. 26. Now for Impress <ul><li>Impress and Draw are almost the same application </li></ul><ul><li>Pages contain shapes </li></ul><ul><li>Shapes can contain Text </li></ul><ul><li>Text is handled just like it is in Writer </li></ul>
  27. 27. EXAMPLE 3 Hello World from Impress <ul><ul><ul><li>Sub Click </li></ul></ul></ul><ul><ul><ul><li>Set SM=CreateObject(&quot;com.sun.star.ServiceManager&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set Desktop=SM.createInstance(&quot;com.sun.star.frame.Desktop&quot;) ‏ </li></ul></ul></ul><ul><ul><ul><li>Dim args() </li></ul></ul></ul><ul><ul><ul><li>Set ImpressApplication=Desktop.loadComponentFromURL_ </li></ul></ul></ul><ul><ul><ul><li>(&quot;private:factory/simpress&quot;,&quot;_blank&quot;,0,args) ‏ </li></ul></ul></ul><ul><ul><ul><li>Set Presentation=ImpressApplication.getDrawPages() ‏ </li></ul></ul></ul><ul><ul><ul><li>Set Slide=Presentation.getByIndex(0) ‏ </li></ul></ul></ul><ul><ul><ul><li>Slide.layout=1 'this layout has a title and an outline </li></ul></ul></ul><ul><ul><ul><li>Set title=Slide.getbyindex(0) 'the first shape is the title </li></ul></ul></ul><ul><ul><ul><li>Set TitleText=title.getText() 'this bit is like talking to writer </li></ul></ul></ul><ul><ul><ul><li>Set Cursor=TitleText.createTextCursor() ‏ </li></ul></ul></ul><ul><ul><ul><li>Call TitleText.insertString(Cursor,&quot;Hello World!&quot;,False) ‏ </li></ul></ul></ul><ul><ul><ul><li>End Sub </li></ul></ul></ul>
  28. 29. The Help Files – how to read them <ul><li>Objects </li></ul><ul><li>Interfaces – collections of properties </li></ul><ul><li>In LotusScript you can use methods and properties from any interface </li></ul><ul><li>In Java and C you have to specify which interface you want to use. </li></ul>
  29. 30. EXAMPLE 4 Lets see some Java <ul><li>The examples in the help files are typically in Java </li></ul><ul><li>You have to specify the interface you want to use on an object </li></ul>
  30. 31. More to say then “Hello” <ul><li>So far, we have shown you the basics </li></ul><ul><ul><li>How to connect to OpenOffice.org from Notes </li></ul></ul><ul><ul><li>LotusScript and Java examples </li></ul></ul><ul><li>Now, let's show you some real-world, useful demos </li></ul>
  31. 32. EXAMPLE 5 Mail Merge <ul><li>Same concepts as Word Mail Merge </li></ul><ul><ul><li>User selects data </li></ul></ul><ul><ul><li>Generate data file </li></ul></ul><ul><ul><li>Detach template </li></ul></ul><ul><ul><li>Launch Writer </li></ul></ul><ul><ul><li>Execute Mail Merge </li></ul></ul><ul><ul><li>Produce End Document </li></ul></ul><ul><li>Two steps today </li></ul>
  32. 33. Spreadsheets with Calc <ul><li>How would you like your spreadsheet to work? </li></ul><ul><li>Something like this? </li></ul><ul><ul><ul><li>Dim ss as new spreadsheet </li></ul></ul></ul><ul><ul><ul><li>ss.setcell(3,6,”Hello World!”) ‏ </li></ul></ul></ul><ul><ul><ul><li>ss.underline(3,6) ‏ </li></ul></ul></ul><ul><ul><ul><li>ss.rotate(3,6,45) ‏ </li></ul></ul></ul><ul><ul><ul><li>print ss.findrow(3,”Hello World!”) ‏ </li></ul></ul></ul>
  33. 34. EXAMPLE 6 Spreadsheets <ul><ul><ul><li>Demo Time </li></ul></ul></ul>
  34. 35. How it works <ul><ul><ul><li>Class Spreadsheet </li></ul></ul></ul><ul><ul><ul><li>public cols list as Column </li></ul></ul></ul><ul><ul><ul><li>... </li></ul></ul></ul><ul><ul><ul><li>End Class </li></ul></ul></ul><ul><ul><ul><li>Class Column </li></ul></ul></ul><ul><ul><ul><li>public rows list as Cell </li></ul></ul></ul><ul><ul><ul><li>... </li></ul></ul></ul><ul><ul><ul><li>End Class </li></ul></ul></ul><ul><ul><ul><li>Class Cell </li></ul></ul></ul><ul><ul><ul><li>'all the hard work happens here </li></ul></ul></ul><ul><ul><ul><li>End Class </li></ul></ul></ul><ul><li>Lists are cool </li></ul><ul><li>Lists of lists are very cool </li></ul>
  35. 36. EXAMPLE 7 OpenOffice.org in a Real World Application <ul><ul><ul><li>Demo Time </li></ul></ul></ul>
  36. 37. EXAMPLE 8 Impresing with Impress <ul><ul><ul><li>Demo Time </li></ul></ul></ul>
  37. 38. The Notes 8 Productivity Editors <ul><li>How do they relate to OpenOffice.org? </li></ul><ul><li>How similar is the API? </li></ul>
  38. 39. Wrap-Up <ul><li>Who are we? </li></ul><ul><li>What is OpenOffice.org </li></ul><ul><li>The Hello World examples </li></ul><ul><li>Hello World using Java </li></ul><ul><li>Mail Merge </li></ul><ul><li>Fun with Spreadsheets </li></ul><ul><li>A Real World Notes Application </li></ul><ul><li>Impress with Impress </li></ul><ul><li>Notes 8 Productivity Editors </li></ul><ul><li>8 Examples you can take home with you! </li></ul>
  39. 40. Resources <ul><li>LDD Discussions (Notes.Net) http://www-130.ibm.com/developerworks/lotus </li></ul><ul><li>OpenOffice.org http://www.openoffice.org </li></ul><ul><li>OpenOffice Developers Guide http://api.openoffice.org/DevelopersGuide/DevelopersGuide.html </li></ul><ul><li>Programming OpenOffice with Visual Basic http://www.kalitech.fr/clients/doc/VB_APIOOo_en.html </li></ul><ul><li>Alan Bell's blog http://www.dominux.co.uk/dominuxblog.nsf </li></ul><ul><li>John Head’s blog http://www.johndavidhead.com </li></ul><ul><li>Slides and content available from http://www.johndavidhead.com http://www.dominux.co.uk </li></ul>
  40. 41. Thank You! Questions & Answers We will be in the speaker room after the session Please remember to fill out your evaluation. alan@dominux.co.uk http://www.dominux.co.uk/dominuxblog.nsf http://www.dominux.co.uk [email_address] www.johndavidhead.com www.psclistens.com