SlideShare a Scribd company logo
IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Out Of Building Extension Libraries
BP106: From XPages Hero
To OSGi Guru: Taking The
Scary Out Of Building
Extension Libraries
Paul Withers, Intec Systems Ltd
Christian Guedemann, WebGate Consulting AG
Paul Withers
 XPages Developer since 2009
 IBM Champion
 OpenNTF Board Member
 Author of XPages Extension Library
 Developer XPages OpenLog Logger
 Co-Developer of OpenNTF Domino API
Christian Guedemann
 IBM Champion
 OpenNTF Chairman
 Architect of XPages Toolkit, POI4XPages,
JUnit4XPages and myWebGate
 Notes since Version 2
 Java since Version 1.2
 Eclipse since Version 3
 Freak… don’t now when this started, but must be short after I’ve learned to spell computer
Agenda
 Why?
 Development Environment & Debugging
 Repository Structure / Deployment
 Basic Plugin Structure
 Providing Client-Side Resources
 Providing Third-Party Java Classes
 Providing Components
 Summary
WHY PLUGINS?
XPages Developers
 11 types of developer - Stephan Wissel
 Three types of developer - Niklas Heidloff
 Five tiers of developers - Greg Reeder, in "A Few Years of XPage Development" series
Extension Library development should be
the goal of XPages developers
Why?
 Build Once, Use Anywhere (virtually!)
 Easier to deploy new versions and exploit replication
 Deploy third-party libraries
– Apache POI etc
– JDBC Drivers
 Deploy client-side code server-wide
 More easily avoid Java security exceptions
– Security tightened in Domino 9
 Required for DOTS (Domino OSGi Tasklet Service) or XPiNC XSP.executeCommand
Examples Plugins
 XPages Extension Library
 IBM SBT
 XPages OpenLog Logger
 OpenNTF Domino API
 Bootstrap4XPages
 XPage Debug Toolbar
 XPages Scaffolding
 XPages Toolkit
 POI4XPages
JDBC Driver Plugin Wizard
 Enhancement to RDBMS part of Ext Lib
– Designer Client only functionality
 Requires latest version of ExtLib
 Allows a plugin to be created from one dialog
for a JDBC driver
 See 3:15 on video
http://www.openntf.org/main.nsf/blog.xsp
?permaLink=NHEF-9N7CKD
DEVELOPMENT
ENVIRONMENT &
DEBUGGING
Configuring the Environment
 Eclipse
 XPages SDK
 Local Domino Server recommended
 See Installation video from Niklas Heidloff
– Dates from before Debug Plugin was incorporated into XPages SDK
– Dates from before Extension Library was Maven-ized
• See http://www.openntf.org/main.nsf/blog.xsp?permaLink=PWIS-9QZTH2 for that
 See blog series from Paul Withers
Eclipse for RCP and RAP Developers
 Latest release is Luna
– Latest release of XPages SDK fixed to support this release
 Can have multiple versions installed
 Load multiple instances
XPages SDK
 Gives XPages JREs and Target Platforms
– JRE → which plugins and jar files are automatically available
– Target Platform → which application / OS plugins are built for
 From 4:40 in video
 Point Preferences to Domino and Notes installs
 Ensure “Automatically create JRE” ticked
 Tick relevant entry in Java > Installed JREs
 Create and select entry under Plug-in Development > Target Platform
Debugging
 Debug Plugin now part of XPages SDK install
 Allows you to point Domino server direct to projects in relevant workspace
 From 14:10 in video
 Point Preferences to Domino install
 Configure Domino server for Java debugging, as for Java development
 Run > Debug Configurations
– Create Debug Configuration
 Connect as with Domino
– Use Step filters to skip certain packages
OSGi Configuration
 Allows Domino Server to use plugins directly from Eclipse workspace
– Direct access to source code (.java files), not compiled code (.class files)
– Speeds up development / debugging
 Create new OSGi Framework configuration
– Set as Domino OSGi Framework
– Set auto-start to false
– Click Debug – creates pde.launch.ini
– Issue “res task http” command
– Obviously will cause problems on networked server!
When Plugins Are Created / Imported / Amended
 For added / imported plugins
– Go to OSGi Framework configuration
– Select the new plugin
– Click Debug to update config
– Issue “res task http” command
 If plugin is changed
– Issue “res task http” command
REPOSITORY
STRUCTURE /
DEPLOYMENT
Structure
 Project inter-relations will differ for Mavenized plugins
– Maven is XML structure for automatically importing dependencies and building multiple plugins
– Managed by a “parent” project, see Ext Lib demos or Christian’s blog series
– Maven has its own learning curve, so we’ll skip that for now
 Plugin project
– This is all that's needed for OSGi framework configuration
 Feature project loads one or more plugin
 Update Site project points to one or more feature
– Creates plugins and features jars
– Export as General > File System
Update Site Project
Deployment to Server / DDE
 Server:
– Run from Eclipse using Domino Debug Plugin
– Install to remote server as other Ext Libs
• See Chapter 2 of XPages Extension Library pp28+
 Client
– Install to DDE as other Ext Libs
• Every change you make to the component re-install the update
• Quite laborious for development, but know when you need to re-import and when you don’t!
– Add directly to DDE plugins
• Best to create separate directory. See blog post by John Cooper or slides at end
Troubleshooting
 Server
– “tell http osgi diag com.myplugin.name” console command confirms any missing
dependencies
 Client
– check Help > Support > View Log and View Trace for errors / print statements
Troubleshooting
Deployment to Development Team / XPiNC
 Add to Widget Catalog from Update Site database
– See XPages Extension Library pp40+
 Best practice is using Desktop Policy, ensures updates automatically deployed
BASIC PLUGIN
STRUCTURE
Plugin Structure
 See Extensibility API Developers Guide
 Activator is optional
– Allows generic code to be run
 Extend org.eclipse.core.runtime.Plugin
Extensions Tab
 Extensions load other Java classes
 Use extension point
com.ibm.commons.Extension
 Use “tell http osgi pt -v com.ibm.
commons.Extension” to see types
and classes currently loaded
Library Class
 This is what is selected in Xsp Properties
 Type: com.ibm.xsp.Library
 Class: your.package.Library extends AbstractXspLibrary
 Defines
– Dependencies
– Faces-Config files
– Xsp-Config files
Contributor Class
 This adds factories
– Holds server-level maps
– Load implicit objects (variables)
 Type: com.ibm.xsp.library.Contributor
 Class your.package.Contributor extends XspContributor
From XSP Starter Kit to Clean Plugin
PROVIDING CLIENT-
SIDE RESOURCES
Angular 4 ALL
Angular for all!
 Angular.JS is popular java script framework to build client-side applications.
 XPages Developers typically distribute Angular to their application by adding the script
library to the WebContent folder
 But let me show how easy it is to deploy angular as part of a plugin and imagine how easy
it would be to deploy your java script standard components
Making your plugin to a resource provider
 Time to contribute to an extension
– com.ibm.commons.Extension
• Type: com.ibm.xsp.GlobalResourceProvider
• Class: your.package.ResourcesProvider ->
extends BundleResourceProvider
 Add some folders to the plugin
– resources/web/angular
– put angular.1.3.8.min.js, angular.1.2.28.min.js and
angular-1.1.4.min.js in the folder
Lets write some code to make the files available as
.ibmxspres/.angular/xxx.js
 The following code let the resource provider understand where he can find the .js files:
Lets write some code to make the files available as
.ibmxspres/.angular/xxx.js
Don’t forget to export the resources during the build
 You won’t believe how many times I was struggling at this point.
– Open the Manifest.MF and go to the tab build
All done? How can a developer now consume this java script libs?
 He knows the following url statement /.ibmxspres/.angular/angular.1.3.8.min.js  UGLY
 We can build a custom theme and provide this
theme (like the Bootstrap4XPages Project does)
 We build a component and gives the user choice.
The component (A java representation of an XPages Element)
 The following Code represents the component (Paul will later explain more about)
Angular.xsp-config (make the component visible in the DDE)
 Here the .xsp-config file to make the component visible in the DDE (Paul will also explain
this later ;) )
The renderer (This piece of code brings the angular.js on your page)
 (Yes Paul will also explain this!)
Angular-faces-config.xml -> Instruction for the renderer
Demo and Summary
 Imagine that you can in the same way multiply the usage of your brilliant java script code
or the CSS style sheet for your cooperate design
 Imagine that you can also customize the look and feel of all Application-Layout based
XPages Apps by defining a plugin with some resources and an new Theme
 Imagine how productive your development team can become because you have make
your work easy consumable
PROVIDING THIRD
PARTY JARS
Plugin for Third Party Jars
 Create a separate plugin
– New > Plug-in from Existing JAR Archives
• Add .qualifier to version
• Always adds a new version to plugin folder of Update Site
– For additional jars
• Import the jar
• Add to Build Path
• Ensure included in Binary Build on build.properties
– Also blog post by John Dalsgaard
Including Plugin
 Add as Required Plug-in to plugin.xml
 Click on Properties and tick “Reexport this dependency”
 Add to feature
 Ensure “Unpack the plug-in archive after the installation” is ticked
– Otherwise DDE will not see the jars
PROVIDING
COMPONENTS
Creating Component Plugin
 Take a custom control and make it global
 NotesIn9 64 by Tim Tripcony #codefortim
 Or code within Eclipse
 Extensibility API 9.0.1
Classes for Component
 Component class DOMINO / DDE (Setters / Adders only)
 .xsp-config to add properties DDE
– See http://avatar.red-pill.mobi/tim/blog.nsf/d6plinks/TTRY-8DDDEZ for making Eclipse identify
*.xsp-config files as XML files #codefortim
 Renderer class, if required DOMINO
– Use getRendererType() to find an existing renderer
 faces-config.xml to register renderer with server DOMINO
 Load xsp-config and faces-config.xml in Library class
Demo Plugin
 Add component for Separator
 Allow properties for:
– separatorType (New Line / Space)
– count (integer, defaulting to 1)
 Deploy org.apache.commons.lang3
 Add utility method to convert any object to string detailing properties
SUMMARY
Links to Demos
 Third Party Library / Component Plugin
– https://github.com/paulswithers/BP106
• Demo database is in notes folder
 AngularJS Plugin
– https://github.com/guedeWebGate/pluginDemoAngularJS
Thank You
• Paul Withers
• pwithers@intec.co.uk
• http://www.intec.co.uk/blog
• http://twitter.com/paulswithers
• Christian Güdemann
• Christian.guedemann@webgate.biz
• http://guedebyte.wordpress.com
• http://twitter.com/guedeWebGate
Engage Online
 SocialBiz User Group socialbizug.org
– Join the epicenter of Notes and Collaboration user groups
 Social Business Insights blog ibm.com/blogs/socialbusiness
– Read and engage with our bloggers
 Follow us on Twitter
– @IBMConnect and @IBMSocialBiz
 LinkedIn http://bit.ly/SBComm
– Participate in the IBM Social Business group on LinkedIn
 Facebook https://www.facebook.com/IBMConnected
– Like IBM Social Business on Facebook
Notices and Disclaimers
Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM.
U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM.
Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include
unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED.
IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF
PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided.
Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice.
Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results
they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary.
References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business.
Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational
purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation.
It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory
requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products
will ensure that the customer is in compliance with any law.
Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with
this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers
of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES,
EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right.
IBM, the IBM logo, ibm.com, BrassRing®, Connections™, Domino®, Global Business Services®, Global Technology Services®, SmartCloud®, Social Business®, Kenexa®, Notes®, PartnerWorld®, Prove It!®,
PureSystems®, Sametime®, Verse™, Watson™, WebSphere®, Worklight®, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service
names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
Configuring DDE for Adding Plugin Directly
 Navigate to framework directory inside the Notes Data Directory
 Create a new plugin directory
 Create a .link file
 Inside your newly created text file add the following:
 path=C:/Program Files (x86)/IBM/Notes/framework/pluginsExt
 Update platform.xml
 Change the transient attribute on the config tag to false
 Replace all the instances of policy="MANAGED-ONLY" to policy="USER-EXCLUDE"
Exporting Plugins Directly to DDE
 Export plugin as a “Deployable Plugin and Fragment”
 Put in newly created directory
 Restart designer
 You can also launch Domino Designer from Eclipse
– http://www.everythingaboutit.eu/2014/06/launch-domino-designer-from-eclipse-to.html

More Related Content

PPTX
Let me introduce you: DOTS
PDF
Domino OSGi Development
PPTX
BP207 - Meet the Java Application Server You Already Own – IBM Domino
PPTX
An XPager's Guide to Process Server-Side Jobs on Domino
PPTX
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
PPTX
Utilizing the OpenNTF Domino API
PPTX
CollabSphere 2018 - Java in Domino After XPages
PDF
DNUG Webcast: IBM Notes V10 Performance Boost
Let me introduce you: DOTS
Domino OSGi Development
BP207 - Meet the Java Application Server You Already Own – IBM Domino
An XPager's Guide to Process Server-Side Jobs on Domino
CollabSphere 2021 - DEV114 - The Nuts and Bolts of CI/CD With a Large XPages ...
Utilizing the OpenNTF Domino API
CollabSphere 2018 - Java in Domino After XPages
DNUG Webcast: IBM Notes V10 Performance Boost

What's hot (20)

PPTX
OpenNTF Webinar May 2021 - Jesse
PPTX
Introducing CrossWorlds for IBM Domino
PDF
Dr. Strangelove, or how I learned to love plugin development
PPTX
[DanNotes] XPages - Beyound the Basics
PDF
UKLUG 2012 - XPages, Beyond the basics
PDF
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
PDF
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
PPTX
Managed Beans: When, Why and How
PPTX
CollabSphere 2020 - NSF ODP Tooling
PDF
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
PPTX
OpenNTF Domino API - Overview Introduction
PDF
What's New in NetBeans IDE 7.x
ODP
Eureka moment
PDF
Polygot Java EE on the GraalVM
PPTX
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
PDF
Play Framework: The Basics
PPTX
Faster java ee builds with gradle [con4921]
PPTX
Symfony Under Control by Maxim Romanovsky
PPTX
Why jakarta ee matters (ConFoo 2021)
PDF
Apache DeltaSpike the CDI toolbox
OpenNTF Webinar May 2021 - Jesse
Introducing CrossWorlds for IBM Domino
Dr. Strangelove, or how I learned to love plugin development
[DanNotes] XPages - Beyound the Basics
UKLUG 2012 - XPages, Beyond the basics
From XPages Hero to OSGi Guru: Taking the Scary out of Building Extension Lib...
Connect2017 DEV-1550 Why Java 8? Or, What's a Lambda?
Managed Beans: When, Why and How
CollabSphere 2020 - NSF ODP Tooling
ICONUK 2013 - An XPager's Guide to Process Server-Side Jobs on IBM® Domino®
OpenNTF Domino API - Overview Introduction
What's New in NetBeans IDE 7.x
Eureka moment
Polygot Java EE on the GraalVM
Manage your Windows Infrastructure with Puppet Bolt - August 26 - 2020
Play Framework: The Basics
Faster java ee builds with gradle [con4921]
Symfony Under Control by Maxim Romanovsky
Why jakarta ee matters (ConFoo 2021)
Apache DeltaSpike the CDI toolbox
Ad

Viewers also liked (18)

PDF
IBM ConnectED 2015 - MAS103 XPages Performance and Scalability
PDF
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
PDF
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
PPTX
Speed up your XPages Application performance
PDF
XPages: Performance-Optimierung - Ulrich Krause (eknori) SNoUG 2013
PPTX
IBM Connections Cloud Administration
PPTX
Life in the fast lane. Full speed XPages
PDF
BP205: There’s an API for that! Why and how to build on the IBM Connections P...
ODP
IBM ConnectED 2015 - AD302 - Responsive Application Development for XPages
PDF
IBM ConnectED 2015 BP110: Mastering Your Logs, Everything You Should Know abo...
PDF
The future of web development write once, run everywhere with angular js an...
PDF
BP201 Creating Your Own Connections Confection - Getting The Flavour Right
PPTX
ConnectED 2015 - IBM Notes Traveler Daily Business
PDF
Connections Directory Integration: A Tour Through Best Practices for Directo...
PDF
External Users Accessing Connections
ODP
MAS202 - Customizing IBM Connections
PPTX
Customizing the Mobile Connections App
PDF
GraphQL 101
IBM ConnectED 2015 - MAS103 XPages Performance and Scalability
BP204 It's Not Infernal: Dante's Nine Circles of XPages Heaven
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
Speed up your XPages Application performance
XPages: Performance-Optimierung - Ulrich Krause (eknori) SNoUG 2013
IBM Connections Cloud Administration
Life in the fast lane. Full speed XPages
BP205: There’s an API for that! Why and how to build on the IBM Connections P...
IBM ConnectED 2015 - AD302 - Responsive Application Development for XPages
IBM ConnectED 2015 BP110: Mastering Your Logs, Everything You Should Know abo...
The future of web development write once, run everywhere with angular js an...
BP201 Creating Your Own Connections Confection - Getting The Flavour Right
ConnectED 2015 - IBM Notes Traveler Daily Business
Connections Directory Integration: A Tour Through Best Practices for Directo...
External Users Accessing Connections
MAS202 - Customizing IBM Connections
Customizing the Mobile Connections App
GraphQL 101
Ad

Similar to IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Out Of Building Extension Libraries (20)

PPT
Extension Library - Viagra for XPages
PPT
XPages -Beyond the Basics
PPT
Implementing xpages extension library
PDF
We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell
PPTX
NLLUG 2012 - XPages Extensibility API - going deep!
PDF
UKLUG 2012 - XPages Extensibility API - going deep!
PDF
Ad110 - Unleash the Power of Xpages
PDF
AD1545 - Extending the XPages Extension Library
PDF
2. extension toolkit installation
PDF
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
PDF
X pages jumpstart jmp101
PDF
Anatomy of a UI Control - Extension Library Case Study
PPT
ITU - MDD - Eclipse Plug-ins
ODP
Intro to XPages for Administrators (DanNotes, November 28, 2012)
PDF
AD101: IBM Domino Application Development Futures
ODP
The xsp starter kit
PPTX
Normalizing x pages web development
PDF
Harness the power of XPages in Lotus Domino
PDF
SHOW102 XPages: Still No Experience Necessary IBM Connect 2014
DOCX
Extension Library - Viagra for XPages
XPages -Beyond the Basics
Implementing xpages extension library
We4IT LCTY 2013 - x-pages-men - ibm domino xpages - performance in a nutshell
NLLUG 2012 - XPages Extensibility API - going deep!
UKLUG 2012 - XPages Extensibility API - going deep!
Ad110 - Unleash the Power of Xpages
AD1545 - Extending the XPages Extension Library
2. extension toolkit installation
Ad108 - XPages in the IBM Lotus Notes Client - A Deep Dive!
X pages jumpstart jmp101
Anatomy of a UI Control - Extension Library Case Study
ITU - MDD - Eclipse Plug-ins
Intro to XPages for Administrators (DanNotes, November 28, 2012)
AD101: IBM Domino Application Development Futures
The xsp starter kit
Normalizing x pages web development
Harness the power of XPages in Lotus Domino
SHOW102 XPages: Still No Experience Necessary IBM Connect 2014

More from Paul Withers (20)

PDF
Engage 2019: Introduction to Node-Red
PDF
Engage 2019: Modernising Your Domino and XPages Applications
PDF
Engage 2019: AI What Is It Good For
PDF
Social Connections 14 - ICS Integration with Node-RED and Open Source
PDF
ICONUK 2018 - Do You Wanna Build a Chatbot
PDF
IBM Think Session 8598 Domino and JavaScript Development MasterClass
PDF
IBM Think Session 3249 Watson Work Services Java SDK
PDF
GraphQL 101
PDF
OpenNTF Domino API (ODA): Super-Charging Domino Development
PDF
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
PDF
Social Connections 2015 CrossWorlds and Domino
PDF
ICON UK 2015 - ODA and CrossWorlds
PDF
What's New and Next in OpenNTF Domino API (ICON UK 2014)
PDF
Engage 2014 OpenNTF Domino API Slides
PDF
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
PDF
Embracing the power of the notes client
PDF
Beyond Domino Designer
PDF
DanNotes 2013: OpenNTF Domino API
PDF
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
PDF
Eureka Moment UKLUG
Engage 2019: Introduction to Node-Red
Engage 2019: Modernising Your Domino and XPages Applications
Engage 2019: AI What Is It Good For
Social Connections 14 - ICS Integration with Node-RED and Open Source
ICONUK 2018 - Do You Wanna Build a Chatbot
IBM Think Session 8598 Domino and JavaScript Development MasterClass
IBM Think Session 3249 Watson Work Services Java SDK
GraphQL 101
OpenNTF Domino API (ODA): Super-Charging Domino Development
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
Social Connections 2015 CrossWorlds and Domino
ICON UK 2015 - ODA and CrossWorlds
What's New and Next in OpenNTF Domino API (ICON UK 2014)
Engage 2014 OpenNTF Domino API Slides
IBM Connect 2014 BP204: It's Not Infernal: Dante's Nine Circles of XPages Heaven
Embracing the power of the notes client
Beyond Domino Designer
DanNotes 2013: OpenNTF Domino API
BP206 It's Not Herculean: 12 Tasks Made Easier with IBM Domino XPages
Eureka Moment UKLUG

Recently uploaded (20)

PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
Modernizing your data center with Dell and AMD
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Mobile App Security Testing_ A Comprehensive Guide.pdf
Understanding_Digital_Forensics_Presentation.pptx
NewMind AI Weekly Chronicles - August'25 Week I
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
cuic standard and advanced reporting.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Review of recent advances in non-invasive hemoglobin estimation
Unlocking AI with Model Context Protocol (MCP)
Reach Out and Touch Someone: Haptics and Empathic Computing
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
Modernizing your data center with Dell and AMD
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

IBM ConnectED 2015 - BP106 From XPages Hero To OSGi Guru: Taking The Scary Out Of Building Extension Libraries

  • 2. BP106: From XPages Hero To OSGi Guru: Taking The Scary Out Of Building Extension Libraries Paul Withers, Intec Systems Ltd Christian Guedemann, WebGate Consulting AG
  • 3. Paul Withers  XPages Developer since 2009  IBM Champion  OpenNTF Board Member  Author of XPages Extension Library  Developer XPages OpenLog Logger  Co-Developer of OpenNTF Domino API
  • 4. Christian Guedemann  IBM Champion  OpenNTF Chairman  Architect of XPages Toolkit, POI4XPages, JUnit4XPages and myWebGate  Notes since Version 2  Java since Version 1.2  Eclipse since Version 3  Freak… don’t now when this started, but must be short after I’ve learned to spell computer
  • 5. Agenda  Why?  Development Environment & Debugging  Repository Structure / Deployment  Basic Plugin Structure  Providing Client-Side Resources  Providing Third-Party Java Classes  Providing Components  Summary
  • 7. XPages Developers  11 types of developer - Stephan Wissel  Three types of developer - Niklas Heidloff  Five tiers of developers - Greg Reeder, in "A Few Years of XPage Development" series Extension Library development should be the goal of XPages developers
  • 8. Why?  Build Once, Use Anywhere (virtually!)  Easier to deploy new versions and exploit replication  Deploy third-party libraries – Apache POI etc – JDBC Drivers  Deploy client-side code server-wide  More easily avoid Java security exceptions – Security tightened in Domino 9  Required for DOTS (Domino OSGi Tasklet Service) or XPiNC XSP.executeCommand
  • 9. Examples Plugins  XPages Extension Library  IBM SBT  XPages OpenLog Logger  OpenNTF Domino API  Bootstrap4XPages  XPage Debug Toolbar  XPages Scaffolding  XPages Toolkit  POI4XPages
  • 10. JDBC Driver Plugin Wizard  Enhancement to RDBMS part of Ext Lib – Designer Client only functionality  Requires latest version of ExtLib  Allows a plugin to be created from one dialog for a JDBC driver  See 3:15 on video http://www.openntf.org/main.nsf/blog.xsp ?permaLink=NHEF-9N7CKD
  • 12. Configuring the Environment  Eclipse  XPages SDK  Local Domino Server recommended  See Installation video from Niklas Heidloff – Dates from before Debug Plugin was incorporated into XPages SDK – Dates from before Extension Library was Maven-ized • See http://www.openntf.org/main.nsf/blog.xsp?permaLink=PWIS-9QZTH2 for that  See blog series from Paul Withers
  • 13. Eclipse for RCP and RAP Developers  Latest release is Luna – Latest release of XPages SDK fixed to support this release  Can have multiple versions installed  Load multiple instances
  • 14. XPages SDK  Gives XPages JREs and Target Platforms – JRE → which plugins and jar files are automatically available – Target Platform → which application / OS plugins are built for  From 4:40 in video  Point Preferences to Domino and Notes installs  Ensure “Automatically create JRE” ticked  Tick relevant entry in Java > Installed JREs  Create and select entry under Plug-in Development > Target Platform
  • 15. Debugging  Debug Plugin now part of XPages SDK install  Allows you to point Domino server direct to projects in relevant workspace  From 14:10 in video  Point Preferences to Domino install  Configure Domino server for Java debugging, as for Java development  Run > Debug Configurations – Create Debug Configuration  Connect as with Domino – Use Step filters to skip certain packages
  • 16. OSGi Configuration  Allows Domino Server to use plugins directly from Eclipse workspace – Direct access to source code (.java files), not compiled code (.class files) – Speeds up development / debugging  Create new OSGi Framework configuration – Set as Domino OSGi Framework – Set auto-start to false – Click Debug – creates pde.launch.ini – Issue “res task http” command – Obviously will cause problems on networked server!
  • 17. When Plugins Are Created / Imported / Amended  For added / imported plugins – Go to OSGi Framework configuration – Select the new plugin – Click Debug to update config – Issue “res task http” command  If plugin is changed – Issue “res task http” command
  • 19. Structure  Project inter-relations will differ for Mavenized plugins – Maven is XML structure for automatically importing dependencies and building multiple plugins – Managed by a “parent” project, see Ext Lib demos or Christian’s blog series – Maven has its own learning curve, so we’ll skip that for now  Plugin project – This is all that's needed for OSGi framework configuration  Feature project loads one or more plugin  Update Site project points to one or more feature – Creates plugins and features jars – Export as General > File System
  • 21. Deployment to Server / DDE  Server: – Run from Eclipse using Domino Debug Plugin – Install to remote server as other Ext Libs • See Chapter 2 of XPages Extension Library pp28+  Client – Install to DDE as other Ext Libs • Every change you make to the component re-install the update • Quite laborious for development, but know when you need to re-import and when you don’t! – Add directly to DDE plugins • Best to create separate directory. See blog post by John Cooper or slides at end
  • 22. Troubleshooting  Server – “tell http osgi diag com.myplugin.name” console command confirms any missing dependencies  Client – check Help > Support > View Log and View Trace for errors / print statements
  • 24. Deployment to Development Team / XPiNC  Add to Widget Catalog from Update Site database – See XPages Extension Library pp40+  Best practice is using Desktop Policy, ensures updates automatically deployed
  • 26. Plugin Structure  See Extensibility API Developers Guide  Activator is optional – Allows generic code to be run  Extend org.eclipse.core.runtime.Plugin
  • 27. Extensions Tab  Extensions load other Java classes  Use extension point com.ibm.commons.Extension  Use “tell http osgi pt -v com.ibm. commons.Extension” to see types and classes currently loaded
  • 28. Library Class  This is what is selected in Xsp Properties  Type: com.ibm.xsp.Library  Class: your.package.Library extends AbstractXspLibrary  Defines – Dependencies – Faces-Config files – Xsp-Config files
  • 29. Contributor Class  This adds factories – Holds server-level maps – Load implicit objects (variables)  Type: com.ibm.xsp.library.Contributor  Class your.package.Contributor extends XspContributor
  • 30. From XSP Starter Kit to Clean Plugin
  • 32. Angular for all!  Angular.JS is popular java script framework to build client-side applications.  XPages Developers typically distribute Angular to their application by adding the script library to the WebContent folder  But let me show how easy it is to deploy angular as part of a plugin and imagine how easy it would be to deploy your java script standard components
  • 33. Making your plugin to a resource provider  Time to contribute to an extension – com.ibm.commons.Extension • Type: com.ibm.xsp.GlobalResourceProvider • Class: your.package.ResourcesProvider -> extends BundleResourceProvider  Add some folders to the plugin – resources/web/angular – put angular.1.3.8.min.js, angular.1.2.28.min.js and angular-1.1.4.min.js in the folder
  • 34. Lets write some code to make the files available as .ibmxspres/.angular/xxx.js  The following code let the resource provider understand where he can find the .js files:
  • 35. Lets write some code to make the files available as .ibmxspres/.angular/xxx.js
  • 36. Don’t forget to export the resources during the build  You won’t believe how many times I was struggling at this point. – Open the Manifest.MF and go to the tab build
  • 37. All done? How can a developer now consume this java script libs?  He knows the following url statement /.ibmxspres/.angular/angular.1.3.8.min.js  UGLY  We can build a custom theme and provide this theme (like the Bootstrap4XPages Project does)  We build a component and gives the user choice.
  • 38. The component (A java representation of an XPages Element)  The following Code represents the component (Paul will later explain more about)
  • 39. Angular.xsp-config (make the component visible in the DDE)  Here the .xsp-config file to make the component visible in the DDE (Paul will also explain this later ;) )
  • 40. The renderer (This piece of code brings the angular.js on your page)  (Yes Paul will also explain this!)
  • 42. Demo and Summary  Imagine that you can in the same way multiply the usage of your brilliant java script code or the CSS style sheet for your cooperate design  Imagine that you can also customize the look and feel of all Application-Layout based XPages Apps by defining a plugin with some resources and an new Theme  Imagine how productive your development team can become because you have make your work easy consumable
  • 44. Plugin for Third Party Jars  Create a separate plugin – New > Plug-in from Existing JAR Archives • Add .qualifier to version • Always adds a new version to plugin folder of Update Site – For additional jars • Import the jar • Add to Build Path • Ensure included in Binary Build on build.properties – Also blog post by John Dalsgaard
  • 45. Including Plugin  Add as Required Plug-in to plugin.xml  Click on Properties and tick “Reexport this dependency”  Add to feature  Ensure “Unpack the plug-in archive after the installation” is ticked – Otherwise DDE will not see the jars
  • 47. Creating Component Plugin  Take a custom control and make it global  NotesIn9 64 by Tim Tripcony #codefortim  Or code within Eclipse  Extensibility API 9.0.1
  • 48. Classes for Component  Component class DOMINO / DDE (Setters / Adders only)  .xsp-config to add properties DDE – See http://avatar.red-pill.mobi/tim/blog.nsf/d6plinks/TTRY-8DDDEZ for making Eclipse identify *.xsp-config files as XML files #codefortim  Renderer class, if required DOMINO – Use getRendererType() to find an existing renderer  faces-config.xml to register renderer with server DOMINO  Load xsp-config and faces-config.xml in Library class
  • 49. Demo Plugin  Add component for Separator  Allow properties for: – separatorType (New Line / Space) – count (integer, defaulting to 1)  Deploy org.apache.commons.lang3  Add utility method to convert any object to string detailing properties
  • 51. Links to Demos  Third Party Library / Component Plugin – https://github.com/paulswithers/BP106 • Demo database is in notes folder  AngularJS Plugin – https://github.com/guedeWebGate/pluginDemoAngularJS
  • 52. Thank You • Paul Withers • pwithers@intec.co.uk • http://www.intec.co.uk/blog • http://twitter.com/paulswithers • Christian Güdemann • Christian.guedemann@webgate.biz • http://guedebyte.wordpress.com • http://twitter.com/guedeWebGate
  • 53. Engage Online  SocialBiz User Group socialbizug.org – Join the epicenter of Notes and Collaboration user groups  Social Business Insights blog ibm.com/blogs/socialbusiness – Read and engage with our bloggers  Follow us on Twitter – @IBMConnect and @IBMSocialBiz  LinkedIn http://bit.ly/SBComm – Participate in the IBM Social Business group on LinkedIn  Facebook https://www.facebook.com/IBMConnected – Like IBM Social Business on Facebook
  • 54. Notices and Disclaimers Copyright © 2015 by International Business Machines Corporation (IBM). No part of this document may be reproduced or transmitted in any form without written permission from IBM. U.S. Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM. Information in these presentations (including information relating to products that have not yet been announced by IBM) has been reviewed for accuracy as of the date of initial publication and could include unintentional technical or typographical errors. IBM shall have no responsibility to update this information. THIS DOCUMENT IS DISTRIBUTED "AS IS" WITHOUT ANY WARRANTY, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL IBM BE LIABLE FOR ANY DAMAGE ARISING FROM THE USE OF THIS INFORMATION, INCLUDING BUT NOT LIMITED TO, LOSS OF DATA, BUSINESS INTERRUPTION, LOSS OF PROFIT OR LOSS OF OPPORTUNITY. IBM products and services are warranted according to the terms and conditions of the agreements under which they are provided. Any statements regarding IBM's future direction, intent or product plans are subject to change or withdrawal without notice. Performance data contained herein was generally obtained in a controlled, isolated environments. Customer examples are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual performance, cost, savings or other results in other operating environments may vary. References in this document to IBM products, programs, or services does not imply that IBM intends to make such products, programs or services available in all countries in which IBM operates or does business. Workshops, sessions and associated materials may have been prepared by independent session speakers, and do not necessarily reflect the views of IBM. All materials and discussions are provided for informational purposes only, and are neither intended to, nor shall constitute legal or other guidance or advice to any individual participant or their specific situation. It is the customer’s responsibility to insure its own compliance with legal requirements and to obtain advice of competent legal counsel as to the identification and interpretation of any relevant laws and regulatory requirements that may affect the customer’s business and any actions the customer may need to take to comply with such laws. IBM does not provide legal advice or represent or warrant that its services or products will ensure that the customer is in compliance with any law. Information concerning non-IBM products was obtained from the suppliers of those products, their published announcements or other publicly available sources. IBM has not tested those products in connection with this publication and cannot confirm the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions on the capabilities of non-IBM products should be addressed to the suppliers of those products. IBM does not warrant the quality of any third-party products, or the ability of any such third-party products to interoperate with IBM’s products. IBM EXPRESSLY DISCLAIMS ALL WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. The provision of the information contained herein is not intended to, and does not, grant any right or license under any IBM patents, copyrights, trademarks or other intellectual property right. IBM, the IBM logo, ibm.com, BrassRing®, Connections™, Domino®, Global Business Services®, Global Technology Services®, SmartCloud®, Social Business®, Kenexa®, Notes®, PartnerWorld®, Prove It!®, PureSystems®, Sametime®, Verse™, Watson™, WebSphere®, Worklight®, are trademarks of International Business Machines Corporation, registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at: www.ibm.com/legal/copytrade.shtml.
  • 55. Configuring DDE for Adding Plugin Directly  Navigate to framework directory inside the Notes Data Directory  Create a new plugin directory  Create a .link file  Inside your newly created text file add the following:  path=C:/Program Files (x86)/IBM/Notes/framework/pluginsExt  Update platform.xml  Change the transient attribute on the config tag to false  Replace all the instances of policy="MANAGED-ONLY" to policy="USER-EXCLUDE"
  • 56. Exporting Plugins Directly to DDE  Export plugin as a “Deployable Plugin and Fragment”  Put in newly created directory  Restart designer  You can also launch Domino Designer from Eclipse – http://www.everythingaboutit.eu/2014/06/launch-domino-designer-from-eclipse-to.html