Simplifying RCP Update and Install

2,556 views 31 slides Mar 19, 2010
Slide 1
Slide 1 of 31
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31

About This Presentation

EclipseCon 2010 presentation
http://www.eclipsecon.org/2010/sessions/?page=sessions&id=1079


Slide Content

Simplifying Update and Extension Install for RCP
applications
Susan McCourt (IBM Rational), Steffen Pingel (Tasktop Technologies)

Simplifying RCP Update and Install
What (and why) do we need to simplify?
What are we doing about it?
How do p2 and p2/Mylyn Discovery fit together?
Examples and Demos

RCP Install/Update in 3.5
p2 UI class library structured with RCP in mind
Separate the building blocks from UI contributions
Configurable policy to control aspects of UI
Building blocks (wizards, pages, viewers, etc.) to customize
the experience
SDK UI must support a diverse set of users
Continuous balancing of concerns
Plug-in developers, update site producers, end users
Product branding has not been critical path
RCP users not served well out of the box

RCP Developers' Reaction to 3.5
Customization of UI is too hard
Don't want to write Java code
p2 API is too complex
Critical pieces (branding) are missing
Customization examples aren't enough/aren't hitting the
right use cases
We need a bolt-on self update feature that can
handle the 80% case without writing Java code
When a product supports add-ons, our users
expect the Firefox Install experience

Deliverables in 3.6
Declare API
p2 Operations API
Simple things should be simple
Refactor the 80% case out of the UI code
Metadata enhancements to support branding
Enhance the story for RCP self-update
Move Mylyn Discovery to p2
Discovery is the recommended install for branded, filtered
installs
'Install New Software...' is still the default to support plug-
in developer use cases

API: R3.5 Headless Update

API: R3.6 Headless Update

API: Branding Metadata
Branding begins at discovery
Discovery can happen in different ways
Users read blogs, email, announcements (drag the URL
into Eclipse)
Aggregators design catalogs (rankings, search, tags, ...)
Different restrictions in different deployments
Once an item has been installed, we need to
retain its branding identity
Installed software list
Update notifications

RCP Mail Update Example
Snapshot of demo, give demo

RCP Example: Good ol' RCP Code
Snapshot of demo, give demo
Need a status line and progress indicator
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer =
getWindowConfigurer();
configurer.setInitialSize(new Point(600, 400));
configurer.setShowCoolBar(true);
configurer.setShowStatusLine(true);
configurer.setShowProgressIndicator(true);
}
Define menus and locations for additions
protected void fillMenuBar(IMenuManager menuBar) {
...
MenuManager toolsMenu = new MenuManager("&Tools", M_TOOLS);
toolsMenu.add(preferencesAction);
toolsMenu.add(new Separator());
toolsMenu.add(new
GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
}

RCP Example: Menu
Snapshot of demo, give demo
Contribute the menu
<extension point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:tools?after=additions" >
<command commandId=
"org.eclipse.equinox.p2.examples.rcp.cloud.command.update"
mnemonic="%Update.command.mnemonic"
id="org.eclipse.equinox.p2.examples.rcp.cloud.menu.update">
</command>
</menuContribution>
</extension>

RCP Example: Update Command
Snapshot of demo, give demo
Contribute the command and handler
<extension point="org.eclipse.ui.commands">
<command
name="%Update.command"
id="org.eclipse.equinox.p2.examples.rcp.cloud.command.update">
</command>
</extension>
<extension point="org.eclipse.ui.handlers">
<handler
commandId="org.eclipse.equinox.p2.examples.rcp.cloud.command.update"
class="org.eclipse.equinox.p2.examples.rcp.cloud.p2.UpdateHandler">
</handler>
</extension>

RCP Self-Update in 3.5
What's wrong
with this
picture?

RCP Example: Update Code
Snapshot of demo, give demo
The update code
// create the update operation. The defaults are fine.
UpdateOperation operation =
getProvisioningUI().getUpdateOperation( null, null);
// check for updates
operation.resolveModal( null);
if (UpdateSingleIUWizard. validFor(operation)) {
// Special case for only updating a single root
UpdateSingleIUWizard wizard = new
UpdateSingleIUWizard(getProvisioningUI(), operation);
WizardDialog dialog = new WizardDialog(getShell(), wizard);
dialog.create();
dialog.open();
} else {
// Open the normal version of the update wizard
getProvisioningUI().openUpdateWizard( false, operation, null);
}

RCP Example: Branding Metadata
Snapshot of demo, give demo
Define a document suitable for displaying in a browser that
describes your update.
Refer to it in the metadata.
<unit id="org.eclipse.equinox.p2.examples.rcp.cloud.product"
version="2.0.0.z201003162033">
<update
id="org.eclipse.equinox.p2.examples.rcp.cloud.product"
description="This update contains Mylyn Discovery!"
range="0.0.0"
severity="0"
uri="file:/C:/_projects/eclipsecon2010/updatenotification.png" />

RCP Self-Update in 3.6
Better?

RCP Install
One size does not fit all
Support, enable, and encourage UI for more targeted
groups of users
Move Mylyn Discovery to p2
Branded, configurable catalogs, Firefox-like simplicity
Look for integration but avoid temptation
As p2 catalog and branding metadata evolves, will
Mylyn/p2 Discovery replace 'Install New Software...'?
Fight complexity
Installation conflicts
User configurability

Extension Install

Motivation
Mylyn has a broad ecosystem of Agile and ALM
integrations
Users had trouble getting connectors
Most connectors are maintained and hosted outside of
Eclipse
The default p2 installer is geared towards advanced users

Mylyn 3.0 Extension Install

Requirements
Simple install
Install embedded into regular workflow
Pretty branding
Catalogs updatable remotely

Solution
Mylyn connector discovery released for
Ganymede
Code moved to Equinox p2 in Helios
Extension point based catalog
Front-end for browsing p2 Repositories
Extensible UI framework

Mylyn 3.2 Extension Install

Remote Catalogs
http://.../directory.xml
http://eclipse.../catalog.jar
http://tasktop.../catalog.jar

Catalog-based Discovery
Enables browsing of extension catalogs
Catalog items point to a feature and p2 repository
PDE tooling is used for editing
Easily embeddable in regular workflows
Implementations
Mylyn connector discovery
Subversive connector installer
SpringSource Tool Suite extensions page

Catalog Item

Simplified p2 Front-end
Enables browsing of p2 repositories
Meta-data comes from repository
No need to maintain a separate catalog

Integrating p2 Discovery

UI components were designed with extensibility
in mind
Pluggable discovery strategy
Extensible data model
Viewer based UI
Implementations
Eclipse Marketplace Client
Build Your Own p2 UI

Outlook
Streamline install experience
Do not require restart
Integrate discovery with P2 license and install wizard

P2 Project
http://wiki.eclipse.org/Equinox_p2_User_Interface
http://wiki.eclipse.org/Equinox/p2/Discovery
Mylyn Discovery
http://wiki.eclipse.org/Mylyn/Discovery
Marketplace Client
http://eclipse.org/mpc
Questions?