Plug yourself in and your app will never be the same (1 hr edition)


Published on

My presentation from the Belgian Lotus User Group 2011 (1 hour edition)

Published in: Technology, Business
1 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

Plug yourself in and your app will never be the same (1 hr edition)

  1. 1. Belux Lotus User Group 2011 Antwerp, Belgium Plug yourself in and your applications will never be the same! (An introduction to plugin development for Lotus Notes, Domino and Sametime)
  2. 2. About me <ul><li>Developer: Notes / Domino / Sametime / Java / DB2 / WebSphere / web / plug-ins
  3. 3. Design Partner for Domino NEXT and Lotus Connections 3.0
  4. 4. Active blogger:
  5. 5. Speaker at Lotusphere
  6. 6. Articles for THE VIEW
  7. 7. E-mail:
  8. 8. .com/lekkim </li></ul>
  9. 9. What I do! <ul><li>Well plugins of course... But ”plugins” are a many-headed beast! </li><ul><li>It's not just ”stuff” for the Notes sidebar
  10. 10. It's about extending the UI in Notes, Sametime and Symphony
  11. 11. It's about delivering a UI capable of doing stuff you cannot do in ”traditional” Notes
  12. 12. It's about developing custom components for the XPages Extensibility Library
  13. 13. It's about DOTS (previously JAVADDIN) and OSGi on the Lotus Domino Server </li></ul></ul>
  14. 14. What's possible with plugins
  15. 15. RedWiki for plugin development <ul><li>Lotus Notes and Domino Application Development wiki / IBM Redbook Publications </li><ul><li>
  16. 16. ...or use the link >> </li></ul></ul>
  17. 17. What I'm going to build (if time permits) <ul><li>Sidebar panel containing </li><ul><li>A list box
  18. 18. Three buttons at the bottom </li><ul><li>One button reads from a web service
  19. 19. One button reads contacts from names.nsf
  20. 20. One button creates a new email </li><ul><li>Reads recipient from list
  21. 21. Create document
  22. 22. Set subject
  23. 23. Add data from web service call to body </li></ul></ul></ul><li>Create a feature for the plugin
  24. 24. Create an update site with the feature
  25. 25. Create a widget for the feature from the update site </li></ul>
  26. 26. Agenda <ul><li>About Eclipse and Lotus Expeditor Toolkit
  27. 27. Installing Lotus Expeditor Toolkit
  28. 28. Plugin Development Basics
  29. 29. Building UI's with SWT and JFace
  30. 30. Jobs, Jobs, Jobs
  31. 31. Time to build some stuff...
  32. 32. Resources / Q&A </li></ul>
  33. 33. Eclipse architecture Workbench JFace SWT Core Extension Point Framework Service Framework Rich Client Platform Plug-in Plug-in Extension Pt. Plug-in Extension Point Extension Point Extension Point A software component in Eclipse Extension Point declares contract to extend plug-in functionality Extension code extends this functionality RCP allows you to build GUI apps on multiple OS SWT provides uniform UI API across multiple OS that calls OS UI API for native look and feel JFace provides components to make it easier to write a GUI e.g. wizards, preference pages, actions, dialogs Workbench is desktop UI and customizable Service Framework supports registration and lifecycle management of plug-ins
  34. 34. IBM Lotus Clients – built on Eclipse Sametime Expeditor Apps and Plug-ins (ISV + Customer) Notes Symphony Industry knowledge and experience ecosystem of partners open and extensible collaborative services Integrated applications Portal Browser Desktop Mobile Multiplatform support Scalability Security
  35. 35. Eclipse workbench
  36. 36. Notes workbench s
  37. 37. Lotus Expeditor (XPD) Toolkit <ul><li>An integrated set of tools to develop, test, and deploy applications built on top of Expeditor </li><ul><li>Supports Expeditor, Sametime, Notes and Symphony
  38. 38. FREE! No charge to use the Expeditor toolkit
  39. 39. Supported on Windows and Linux operating systems </li></ul><li>Benefits Of Using The Toolkit </li><ul><li>Easily configure your development environment to develop for the platforms above </li><ul><li>Takes ~ 1 minute to configure your environment </li><ul><li>Set your target environment
  40. 40. Point to the target locations on your machine </li></ul></ul><li>Provides a new launcher to launch products built on top of Expeditor </li><ul><li>Create a new launch configuration to launch the application from Eclipse </li></ul><li>Provides numerous samples to get your started developing for Expeditor based products </li></ul></ul>
  41. 41. Installing XPD Toolkit (1) <ul><li>Download the XPD Toolkit </li><ul><li>
  42. 42. Unzip </li></ul><li>In Eclipse </li><ul><li>Help -> Software Updates... </li></ul></ul>
  43. 43. Installing XPD Toolkit (2) <ul><li>Click New Local Site...
  44. 44. Browse to unziped update site
  45. 45. Select OK </li></ul>
  46. 46. Installing XPD Toolkit (3) <ul><li>Select The XPD Toolkit
  47. 47. Click Install... </li></ul>
  48. 48. Installing XPD Toolkit (4) <ul><li>Agree to the license agreement
  49. 49. Install all features
  50. 50. Restart </li></ul>
  51. 51. Installing XPD Toolkit (5) <ul><li>Start IDE
  52. 52. Select Test Environment </li><ul><li>Notes, Sametime, Symphony, XPD </li></ul><li>Specify Target Location </li><ul><li>Point to target runtime
  53. 53. <install>/framework/rcp/eclipse </li></ul><li>Click OK
  54. 54. Run -> Run Configuration
  55. 55. Double Click Client Services
  56. 56. Give The Configuration A Name
  57. 57. Select Run </li></ul>
  58. 58. What are plugins? <ul><li>Plugins are the building blocks of Eclipse based applications </li><ul><li>At their core a plugin is some code plus some declarations (extension points)
  59. 59. By themselves plugins may not do anything, but when you start combining plugins you can build very powerful applications
  60. 60. Examples: Eclipse, Notes, Sametime, Symphony </li></ul></ul>Application Plugin
  61. 61. Anatomy of a plugin <ul><li>Java code (optional)
  62. 62. </li><ul><li>Basic properties of a plugin
  63. 63. Specifies dependencies this plugin has </li></ul><li>Plugin.xml </li><ul><li>Extension points the plugin uses / defines </li></ul><li> </li><ul><li>Manages the build configuration of the plugin </li></ul><li>Resources (optional) </li><ul><li>Jars the plugin may need
  64. 64. Files used for translation
  65. 65. Images
  66. 66. etc.... </li></ul></ul>
  67. 67. Extension Points <ul><li>Extension points make plugins “pluggable” </li><ul><li>Plugins define extension points for other plugins to use </li><ul><li>Examples: sidebar, toolbar buttons, right click menus... </li></ul><li>Extension points allow the platform to be more performant
  68. 68. Eclipse has a nice editor for adding and defining extension points </li></ul><li>How do I know what extension points are available? </li><ul><li> and the Expeditor wiki are your friends </li></ul></ul>Plugin Using Extension Point Extension Point Definition
  69. 69. Key Extension Points <ul><li>org.eclipse.ui.views </li><ul><li>Registers a view part with the platform
  70. 70. View parts can be used inside perspectives or in the sidebar </li></ul><li> </li><ul><li>An Expeditor extension point
  71. 71. Used to add a view part to the sidebar </li></ul><li>org.eclipse.ui.actionSets </li><ul><li>Used to add top level toolbars and menus </li></ul><li>org.eclipse.ui.menus </li><ul><li>Used to add context menus </li></ul><li>org.eclipse.ui.preferencePages </li><ul><li>Used to add preference pages to the preferences </li></ul></ul>
  72. 72. The arcane art of building UI's
  73. 73. UI's are built using code <ul><li>UI's are </li><ul><li>built using Java code adding widgets (controls) to containes (composites)
  74. 74. custom drawn using Java code to listen for paint events </li></ul><li>In either case it isn't WYSIWYG :-( </li></ul>
  75. 75. Standard Widget Toolkit (SWT) <ul><li>Platform native look and feel …
  76. 76. Protection from OS Level Changes
  77. 77. Very responsive
  78. 78. Resulting UI looks like native platform applications </li></ul>
  79. 79. Meet WindowBuilder!
  80. 80. Threading lightly <ul><li>A thread is an abstraction in computers to allow programs to perform multiple operations simultaneously </li><ul><li>Avoid tying up the program with background operations </li></ul><li>Two ways to call other code </li><ul><li>Synchronously == blocking </li><ul><li>Blocks current code until call is done and then returns to continue processing
  81. 81. Like you're used to from LotusScript </li></ul><li>Asynchronously == non-blocking </li><ul><li>The calling code continues to run – you now have two pieces of code running
  82. 82. To tell the caller we're done we use callbacks or listeners
  83. 83. Harder to grasp
  84. 84. Used in AJAX – you request data in the background and once the data has been fetched you are told </li></ul></ul></ul>
  85. 85. Jobs, jobs, jobs - lets vote for jobs! <ul><li>Eclipse Job Framework </li><ul><li>java.lang.Thread is way too low-level and error prone
  86. 86. Allows for easy background processing
  87. 87. Very simple to use
  88. 88. Allows scheduling of jobs (“run this code in 2 minutes”)
  89. 89. Allows weaving of jobs
  90. 90. Allows for listening to job status etc.
  91. 91. Standard UI for manipulating jobs </li></ul><li>Two types of Job </li><ul><li>Job – for background processing
  92. 92. UIJob – for user interface updates </li></ul><li>Both are abstract classes and normally used as anonymous inner classes </li></ul>
  93. 93. There can be only one <ul><li>Any Eclipse application only has ONE thread that may update the user interface
  94. 94. It's – surprise, surprise – called the “UI thread”
  95. 95. This means that </li><ul><li>Tying up the UI thread will render the entire client unresponsive
  96. 96. Attempts to access the UI (i.e. set the text of a label) outside the UI thread will fail with an exception
  97. 97. You need a way to “do stuff” in the UI thread </li></ul><li>To do stuff in the UI thread you use an UIJob from the Job API </li></ul>
  98. 98. Using Job in code public void fireOnTheEmpire(int initDelay, final String jediName) { // create recurring job to poll web service new Job(&quot;Poll the Force!&quot;) { protected IStatus run(IProgressMonitor monitor) { // invoke endpoint using input String srvc = “”; WSFacade facade = new WSFacade(srvc); String result =; // do something with the result ... // reschedule this job (in 5 mintues) this.schedule(5 * 60 * 1000); // return return Status.OK_STATUS; } }.schedule(initialDelay * 60 * 1000); } final
  99. 99. Weaving Jobs <ul><li>Most operations usually include a UI and a background component so you need to “weave jobs”
  100. 100. A typical operation from the user consists of 3 steps: </li></ul><ul><ul><li>Usually you start of with a UI call (button click i.e. button selection)
  101. 101. You perform some background operation (e.g. load data from a web service or similar)
  102. 102. You need to “call back” into the UI and update or inform </li></ul></ul><ul><li>We call this “to weave job”
  103. 103. We do it by nesting Job instances </li></ul>
  104. 104. Let us build something!
  105. 105. DOTS (used to be JAVADDIN)
  106. 106. XPages Extensibility Library ” A new project has been created which contains a simple sample for how to to develop a 'native' XPages control via the Java extensibility API. This control can be deployed globally as an OSGi bundle/plugin to Lotus Domino and Lotus Notes/Domino Designer and then used in all NSFs without having to put the code in all NSFs redundantely. The new control shows up in the palette in Designer as other out of the box controls.”
  107. 107. Summary and resources <ul><li>RedWiki about plugin development >>
  108. 108. HIGHLY recommended article on the Job API >>
  109. 109. Eclipse articles >>
  110. 110. Eclipse WindowBuilder >> </li></ul>
  111. 111. Q&A <ul><li>But!
  112. 112. How do I?
  113. 113. Doesn't that mean?
  114. 114. Give it to me! :-) </li></ul>