UKLUG 2012 - XPages Extensibility API - going deep!

  • 1,279 views
Uploaded on

These slides have been shown at UKLUG 2012 in Cardiff and are an introduction to programming with the XPages Extensiblity API.

These slides have been shown at UKLUG 2012 in Cardiff and are an introduction to programming with the XPages Extensiblity API.

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
1,279
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
33
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. XPages Extensibility API – going deep UKLUG, September 2012, Cardiff René Winkelmeyer midpoints GmbH
  • 2. About me midpoints GmbH http://www.midpoints.de IBM Advanced Business Partner IBM Design Partner for Domino Next IBM Mobile Design Partner Apple Enterprise Developer & MDM Program Samsung MDM Partner Services •  Notes / Domino Consulting •  E-Mail Management •  App Development (IBM Connections, RCP, XPages, mobile, iOS, Android) René Winkelmeyer Senior Consultant We mobilize Notes •  Lotus Traveler planning & deployment •  mobile app development •  Apple iOS Device Management with midpoints iOS.profiler •  Secure Domino-based mobile content with midpoints doc.Store 2 OpenNTF Contributor and OpenNTF Director
  • 3. •  Skype muenzpraeger •  Twitter muenzpraeger •  LinkedIn muenzpraeger •  Facebook muenzpraeger •  Slideshare muenzpraeger •  G+ www.winkelmeyer.com/+ •  WebRené Winkelmeyer http://blog.winkelmeyer.comSenior Consultant http://www.midpoints.de •  Mail mail@winkelmeyer.com rene.winkelmeyer@midpoints.de 3
  • 4. I don‘t do XPages! I go deeper. 4
  • 5. Agenda What will we talk about? -  Differences XPages, Extension Library and Extensibility API -  Starting with Plug-In-Development -  Code examples -  Deployment 5
  • 6. Agenda What will we talk about? -  Differences XPages, Extension Library and Extensibility API -  Starting with Plug-In-Development -  Code examples -  Deployment 6
  • 7. XPages§  XPages is a great technology and expands our possibilities – from the point of administrators, developers and users.§  Starting with XPages could be really simple. For the very first steps is just drag‘n‘drop, computing stuff and so on.§  To be honest: Domino web development never was so easy (after you‘ve learned the basics) - even if it takes „slightly“ more time. 7
  • 8. XPages§  The most powerful component is the editable area. 8
  • 9. XPages / XPages Extension Library§  There are some things which aren‘t so easy... §  You are missing controls in the pallette §  OneUI ist too complex §  You want some custom rendering §  ...§  Here the XPages Extension Library comes to your help. 9
  • 10. XPages Extension Library 10
  • 11. XPages Extension Library§  IBM has introduced the XPages Extensibility API with Notes/Domino 8.5.2.§  This API is a set of Java classes and methods which allow to integrate specialised functionality directly into XPages. §  This means XPages in the browser and XPages in the Notes client.§  IBM has used this API to provide the well-known XPages Extension Library – (first) on OpenNTF and than as part of the core product! 11
  • 12. XPages Extension Library 12
  • 13. XPages Extension Library§  You‘ll finde it on OpenNTF http://extlib.openntf.org 13
  • 14. XPages Extension Library§  It‘s part of Notes/Domino 8.5.3 as „Upgrade Pack 1“ – full product support through IBM! §  Part number: CI5GIEN§  Watch out: If you want to use the Upgrade Pack 1 you‘ll have to uninstall previous versions of the OpenNTF Extension Library. §  IBM installs the UP1 in the program directory. The OpenNTF components are installed in the data directory. §  Currently only available as Installer – not as Updatesite. 14
  • 15. XPages Extensibility API 15
  • 16. XPages Extensibility API§  It only makes sense to develop your own extensions if you need the same functionality across multiple applications.§  An extension (aka OSGi Plug-In) needs only to deployed once per server or client – not per application. http://www.osgi.org <= start here 16
  • 17. XPages Extensibility API§  So called „artefacts“ can be added to the existing API during runtime.§  JSF is an „open standard“ which APIs are publically available.§  The XPages APIs are public since Domino 8.5.2.§  Artefacts can be: §  UI Controls §  Converters §  Validators §  Data Sources §  Simple Actions §  Language Bindings §  ... 17
  • 18. XPages Architektur 18
  • 19. XPages API Concepts§  XPages Library §  OSGi bundle, contains Java code, configuration files§  Controls §  Components which are available in the Designer pallette§  Renderer §  Renderer are responsible for displaying the output (HTML, CSS, ...)§  Complex Types §  Those are i. e. used to create encapsulated functions or store data. 19
  • 20. Agenda What will we talk about? -  Differences XPages, Extension Library and Extensibility API -  Starting with Plug-In-Development -  Code examples -  Deployment 20
  • 21. Powered By Eclipse 21
  • 22. Eclipse Plug-In-Architektur 22
  • 23. IBM Clients/Server based on Eclipse 23
  • 24. Development setup§  We are using Eclipse 4.2 (32bit) – definetly not recommended by IBM. 24
  • 25. Development setup§  For keeping it simple: use the OpenNTF project „XPages SDK for Eclipse RCP. §  Nathan T. Freeman: http://www.openntf.org/internal/home.nsf/project.xsp? action=openDocument&name=XPages%20SDK%20for%20Eclipse %20RCP 25
  • 26. Development setup§  First create a new workspace 26
  • 27. Development setup§  Install new software in Eclipse 27
  • 28. Development setup§  Select the XPages SDK 28
  • 29. Development setup§  XPages SDK installation (I) De-select this check box 29
  • 30. Development setup§  XPages SDK installation (II) 30
  • 31. Development setup§  XPages SDK installation (III) 31
  • 32. Development setup§  XPages SDK installation (IV) §  Unsigned means, that the plug-ins aren‘t digitially signed. That‘s ok. 32
  • 33. Development setup§  XPages SDK installation (V) 33
  • 34. Development setup§  Configuration of the XPages SDK (I) 34
  • 35. Development setup§  Configuration of the XPages SDK (II) 35
  • 36. Development setup§  Configuration of the XPages SDK (III) 36
  • 37. Development setup§  Configuration of the XPages SDK (IV) 37
  • 38. Development setup§  Configuration of the XPages SDK (V) 38
  • 39. Development setup§  Configuration of the XPages SDK (VI) 39
  • 40. Development setup§  Configuration of the XPages SDK (VII) 40
  • 41. Development setup§  You shouldn‘t develop without debugging. So we‘re installing a debugger.§  We are using the OpenNTF Domino Debug Plug-In. §  http://www.openntf.org/internal/home.nsf/release.xsp? documentId=CBF874E9C4607B4C8625799D00287B8C&action=openD ocument 41
  • 42. Development setup§  Installation of the Debug-Plug-In (I) 42
  • 43. Development setup§  Installation of the Debug-Plug-In (II) 43
  • 44. Development setup§  Installation of the Debug-Plug-In (III) 44
  • 45. Development setup§  Installation of the Debug-Plug-In (IV) 45
  • 46. Development setup§  Installation of the Debug-Plug-In (V) 46
  • 47. Development setup§  Installation of the Debug-Plug-In (VI) 47
  • 48. Development setup§  Installation of the Debug-Plug-In §  Currently only local Domino server installations are supported. 48
  • 49. Development setup§  Creating the debug environment (I) 49
  • 50. Development setup§  Creating the debug environment (II) 50
  • 51. Development setup§  Creating the debug environment (II) 51
  • 52. Development setup§  Creating the debug environment (III) 52
  • 53. Development setup§  Add the following notes.ini parameters to the locally installed Domino server (they are needed for the remote debugging) §  JAVADEBUGOPTIONS=transport=dt_socket,server=y,suspend=n,addr ess=8000 §  JAVAENABLEDEBUG=1 53
  • 54. Agenda What will we talk about? -  Differences XPages, Extension Library and Extensibility API -  Starting with Plug-In-Development -  Code examples -  Deployment 54
  • 55. Code examples§  A simple UIComponent created with the XPages Extensibility API Set the request scope Rendered with plug-in 55
  • 56. General library structure§  Java files §  Controls §  javax.faces.component.UIComponent §  Base for all UI components §  Renderers §  javax.faces.render.Renderer §  Writes the output to the browser§  Configuration files §  faces-config.xml §  Runtime JSF configuration, defines i. e. the renderer §  .xsp-config §  Defines the controls, is used to display within Designer and for compiling the XPages §  plugin.xml §  Adding the extensions 56
  • 57. Project structure 57
  • 58. MessagesDialog (UIComponent for Designer) for identification 58
  • 59. MessagesDialog (UIComponent for Designer) 59
  • 60. MessagesRenderer (XPages output) 60
  • 61. MessagesRenderer (XPages output) helper method 61
  • 62. MessagesRenderer (XPages output) 62
  • 63. MessagesRenderer (XPages output) 63
  • 64. Library Case-sensitive Designer (UIComponent) XPages (Renderer) 64
  • 65. manifest.mf optional for JS addin 65
  • 66. plugin.xml plug-ins library class 66
  • 67. Configuration files§  Simple till here...or?§  Now we have to create the configuration files. Remember the standards! 67
  • 68. messages-faces-config.xml (XPage-Rendering) 68
  • 69. messages.xsp-config 69
  • 70. messages.xsp-config 70
  • 71. messages.xsp-config 71
  • 72. messages.xsp-config 72
  • 73. plugin.xml für your own @Commands 73
  • 74. Global Java definiton for your own @Commands 74
  • 75. Detail class for your own @Commands 75
  • 76. D-E-B-U-G-G-I-N-G§  Setup a remote application for debugging. 76
  • 77. D-E-B-U-G-G-I-N-G 77
  • 78. Agenda What will we talk about? -  Differences XPages, Extension Library and Extensibility API -  Starting with Plug-In-Development -  Code examples -  Deployment 78
  • 79. Deployment Domino-Server§  Create a new database/application based on the Updatesite template. I highly recommend to use a dedicated database for server-only plug-ins in a production environment.§  Import the plug-ins into the database.§  Replicate the database with all according servers. §  Plug-Ins couldn‘t be replicated as they „normally“ reside on the file system.§  Set the notes.ini parameter OSGI_HTTP_DYNAMIC_BUNDLES=<database.nsf> on the Domino servers.§  Finished. Restart the http and that‘s all. 79
  • 80. Thank you very much!And thank you for excellent evals! :-D 80