dr. strangelove, or how i learned to love plugin development

80
How I Learned To Stop Worrying And Love Plugin Development Ulrich Krause, London, UK, September 12, 2014

Upload: ulrich-krause

Post on 11-Jan-2015

309 views

Category:

Technology


2 download

DESCRIPTION

Building a plugin for the Notes client is hard and you need to be a rocket scientist to write a simple menu extension. This is exactly, what I thought, when I first heard of plugin development. In this session, you will learn, how to setup an Eclipse environment, connect it to your Notes Client for debugging and testing, and finally deploy your plugin to your users. Become familiar with the basics, and you will no longer be scared.

TRANSCRIPT

How I Learned To Stop Worrying And Love Plugin Development

Ulrich Krause, London, UK, September 12, 2014

ICON UK 2014 – Plugin Development

About: Ulrich Krause Administrator /Developer since 1993 Senior Software Architect at BCC Blog http://www.eknori.de IBM Champion 2011/2012/2013/2014

ICON UK 2014 – Plugin Development

Agenda Types of Plugins What‘s All The Parts Needed ? Setup The Development Environment Run / Debug Configuration Build a simple Menue extension Build a Sidebar Plug-In Working with existing code Extension Points Deploy Plug-Ins Plug-In Security

ICON UK 2014 – Plugin Development

It‘s only one way of doing it …

And I know there's a few to demonstrate the theory

ICON UK 2014 – Plugin Development

No animals were harmed * during the making of this

presentation !

* That part comes, when you download the slides from http://slideshare.net

ICON UK 2014 – Plugin Development

Types of Plug-Ins Adding new items to a menue bar or a context menue Display data in the Sidebar • Ralf Petter: Document Spy: Admins little helper

http://www.everythingaboutit.eu/2014/08/document-spy-admins-little-helper.html

Execute code when the client starts, after the user has logged in or when the client has shut down. • Karsten Lehmann: Mindoo Xulrunner Prefs.js Management Plugin

http://www.openntf.org/main.nsf/project.xsp?r=project/Mindoo%20Xulrunner%20Prefs.js%20Management%20Plugin/summary

ICON UK 2014 – Plugin Development

Download, Install, Configure

ICON UK 2014 – Plugin Development

Download Eclipse SDK

https://www.eclipse.org/downloads/packages/release/ganymede/sr2

ICON UK 2014 – Plugin Development

Download Expeditor Toolkit

IBM Lotus Expeditor Toolkit provides a complete, integrated set of tools that allows you to develop, debug, test, package, and deploy client applications to IBM Lotus Expeditor V6.2, IBM Lotus Symphony V1.2, and IBM Lotus Notes V8.5+

http://www14.software.ibm.com/webapp/download/nochargesearch.jsp?q=Lotus+Expeditor+Toolkit+6.2

ICON UK 2014 – Plugin Development

Unpack Eclipse and Expeditor

ICON UK 2014 – Plugin Development

Install Eclipse Decompress into the directory of your choice It is strongly recommended to configure Eclipse with the specific JVM that you want Set the workspace

http://wiki.eclipse.org/Eclipse/Installation#Configure_Eclipse_to_use_the_JVM

ICON UK 2014 – Plugin Development

Install Lotus Expeditor Toolkit in Eclipse

ICON UK 2014 – Plugin Development

Configure Expeditor Toolkit Configure Test Environment

ICON UK 2014 – Plugin Development

Configure Expeditor Toolkit Set Target Location • <ClientInstall> framework rcp eclipse

ICON UK 2014 – Plugin Development

Configure Expeditor Toolkit VM Name & Compiler Compliance Level is set automatically. Leave as is …

ICON UK 2014 – Plugin Development

Configure Eclipse SDK Open „Plug-in Development“ perspective

ICON UK 2014 – Plugin Development

Configure Eclipse SDK Create Run Configuration(s)

ICON UK 2014 – Plugin Development

Create RunConfiguration / Main

ICON UK 2014 – Plugin Development

Create RunConfiguration / Select Plugins

ICON UK 2014 – Plugin Development

Build Your First Plugin

ICON UK 2014 – Plugin Development

Create A Simple Menue Plugin Add a new menue Add a new menue entry Display a message

ICON UK 2014 – Plugin Development

Create A New Plug-In Project Alt + Shift + n

ICON UK 2014 – Plugin Development

Plug-In Basic Configuration Give your Plug-In a name Set the Provider Check „Generate an activator …“

ICON UK 2014 – Plugin Development

Create From Template Select a template

ICON UK 2014 – Plugin Development

Your Workspace Should Look Like This

ICON UK 2014 – Plugin Development

Anatomy of a plugin The plugin.xml contains meta-information for Eclipse, and contains the extension points declared/used by this plug-in The MANIFEST.MF is a standard Jar manifest, but contains meta-information used by Equinox, which is Eclipse's internal OSGi engine. Although there are specific entries in here for Eclipse (such as Eclipse-LazyStart ) the majority of entries here are standard OSGi

ICON UK 2014 – Plugin Development

Anatomy of a plugin The Activator is run when your plug-in starts, and before any other code that's defined in your bundle is used. You can use this to initialise data structures, start listening to network sockets etc. It's also got a call when Eclipse shuts down Last (but not least), the SampleHandler , which just prints out "Hello, ConnectSCOTT" when you click on the little blue Eclipse icon in the toolbar.

ICON UK 2014 – Plugin Development

Source Code (SampleHandler.java)

ICON UK 2014 – Plugin Development

Create A New Run Configuration

ICON UK 2014 – Plugin Development

Create A New Run Configuration

ICON UK 2014 – Plugin Development

Assign Plug-ins to Launch Configuration

ICON UK 2014 – Plugin Development

Run / Launch Plug-In

ICON UK 2014 – Plugin Development

Debug Plug-In Code

ICON UK 2014 – Plugin Development

Create A Sidebar Plug-In

ICON UK 2014 – Plugin Development

Create a SideBar Plugin Simple Sidebar Plug-In for text snippets Content can be • loaded from file • saved to file

Content is persistent between sessions

ICON UK 2014 – Plugin Development

Create A Sidebar Plugin (cont) Create a new Plug-In Project

• File New Plug-In Project

• Type in Project Name

ICON UK 2014 – Plugin Development

Create A Sidebar Plugin (cont) Check „Generate An Activator“ Leave Defaults or set it to a name of your choice. Depaends on how you organize your code Click NEXT to use a wizard, or FINISH to go do the heavy lifting on your own

ICON UK 2014 – Plugin Development

Create A Sidebar Plugin (cont) Your project will look similar to the screenshot; Extension section is empty

ICON UK 2014 – Plugin Development

Create A Sidebar Plugin (cont) Add Extension Points

ICON UK 2014 – Plugin Development

Create A Sidebar Plugin (cont) Add category and view to the „org.eclipse.ui.views“ extension Repeat steps for all other extensions

• com.ibm.rcp.ui.shelfViews • org.eclipse.ui.viewActions

ICON UK 2014 – Plugin Development

Create A Sidebar Plugin (cont) Set the properties

ICON UK 2014 – Plugin Development

Create A Sidebar Plugin (cont) Write Java code

ICON UK 2014 – Plugin Development

Working With Existing Projects

ICON UK 2014 – Plugin Development

Working with existing projects

ICON UK 2014 – Plugin Development

Import into Eclipse Workspace

ICON UK 2014 – Plugin Development

Plugin imported, but … ERRORS

1. Go to the Build Path settings in the project properties. 2. Remove the JRE System Library 3. Add it back; Select "Add Library" and select the JRE

System Library.

ICON UK 2014 – Plugin Development

Extension Points

ICON UK 2014 – Plugin Development

Understanding Extension Points http://www.eclipsezone.com/eclipse/forums/t93753.html?start=0

ICON UK 2014 – Plugin Development

Extension Point Description Select the extension point in the Extensions section of the manifest and click „Show extension point description“ . This will open a new tab with all the information about the extension point

ICON UK 2014 – Plugin Development

Plug-In Provisioning

ICON UK 2014 – Plugin Development

Plug-In Provisioning Prerequisites Before we can install / deploy our plugin, we have to do some additional work

• Create Feature Project

• Create Update Site Project

• Build Update Site content

ICON UK 2014 – Plugin Development

Create a new feature project

An Eclipse feature project contains features. A feature describes a list of plug-ins and other features which can be understood as a logical unit. It also has a name, version number and license information assigned to it. A feature is described via a feature.xml file

File New Feature Project

ICON UK 2014 – Plugin Development

Create a new feature project

Give your project a name Change other values to your needs

ICON UK 2014 – Plugin Development

Create a new feature project

Select the plug-in(s) from the list. You can type in the name to easily navigate to the plug-in. Click Finish and Eclipse will create the feature project.

ICON UK 2014 – Plugin Development

Create a new feature project

If you are using Working Sets, you will not see the feature project Edit the current Working Set and add the feature project

ICON UK 2014 – Plugin Development

Your Workspace Should Look Like This

ICON UK 2014 – Plugin Development

Create Update Site Project The Update Site contains feature and plug-in versions for Eclipse project releases.

ICON UK 2014 – Plugin Development

Create Update Site Project Give your project a name

ICON UK 2014 – Plugin Development

Create Update Site Project Add feature(s)

ICON UK 2014 – Plugin Development

Create Update Site Project Build the content

ICON UK 2014 – Plugin Development

Deploying Plugins Let the user deploy the plugin Deploy during client installation Deploy plugin via Widget Catalog and Desktop Policy

ICON UK 2014 – Plugin Development

Option 1: Let the user install the plugin

ICON UK 2014 – Plugin Development

Option 1: Let the user install the plugin „Install“ not enabled by default. • customize plugin-customization.ini on client

• add com.ibm.notes.branding/enable.update.ui=true

Disabled by Desktop Policy

ICON UK 2014 – Plugin Development

Option 1: Let the user install the plugin

ICON UK 2014 – Plugin Development

Option 2: Deploy during client installation Customizing Notes install for features and plug-ins on Windows and Mac *

*

ICON UK 2014 – Plugin Development

Option 2: Deploy during client installation

ICON UK 2014 – Plugin Development

Option 3: Widget Catalog and Desktop Policy

ICON UK 2014 – Plugin Development

Create Update Site Database If you do not already have an „Update Site“ Create a new Update Site • File Application new • Check „Show advanced templates • Select „Eclipse Update Site“

ICON UK 2014 – Plugin Development

Import Local UpdateSite into Database

ICON UK 2014 – Plugin Development

Install In Sidebar Get URL of the plug-in

ICON UK 2014 – Plugin Development

Install In Sidebar Tools Widgets Getting Started with Widgets Features and Plugins Paste the URL Click „Load“ Check Feature to install Optionally provide an image url

ICON UK 2014 – Plugin Development

Confirm Installation Select „Install plug-in“; Click „OK“

The plug-in will be installed; Then restart the client

ICON UK 2014 – Plugin Development

Publish To Catalog

http://www-01.ibm.com/support/knowledgecenter/SSKTMJ_8.0.1/com.ibm.help.domino.admin.doc/DOC/H_CREATE_EXTENSION_XML_STEPS.html?cp=SSKTMJ_8.0.1%2F1-3-9-2-3

ICON UK 2014 – Plugin Development

Create Desktop Policy

ICON UK 2014 – Plugin Development

Configure Client Preferences Select the catagory of widgets that should be installed

on the client

ICON UK 2014 – Plugin Development

Option 3: Widget Catalog and Desktop Policy

ICON UK 2014 – Plugin Development

Sign Plugins End-to-End HOWTO guide for silently and transparently provisioning and installing Java extensions to Notes 8.5.1+ clients using policies (Mikkel Heisterberg) • http://lekkimworld.com/files/nllug/2009/demos

cript_english_031120091142.pdf

EntwicklerCamp 2011 - Signierung & Verteilung von Plugins für den Notes Client (René Winkelmeyer)

• Link

ICON UK 2014 – Plugin Development

OpenNTF Phonebook sidebar plugin

http://www.openntf.org/main.nsf/project.xsp?r=project/Phonebook%20sidebar%20plugin/summary