SNAP Update Center

 

Target release2.0
Epic SENBOX-3 - Getting issue details... STATUS
Document statusDRAFT
Document owner

Marco Peters

Designer
Developers
QAOlga Faber (Unlicensed)

Goals

  • Toolboxes can be installed and updated as bundles
  • Users are informed about updated plugins
  • The handling of dependencies overall update experience and shall be simplified for users

Background and strategic fit

The Update Center is a web service where the SNAP application can get new or updated modules from. Its URL can be added to the Update Center client within the application. The client supports multiple centres. This way users can get new modules from multiple providers. They can even create their own Update Center for their own organization.

Requirements

#TitleUser StoryImportanceNotes
1Pluggable ToolboxesUsers shall be able to install, update and deinstall individual toolboxes: s1tbx, s2tbx, s3tbx from an NB update centerMust have

2Update notificationSNAP shall notify users if module updates are available.Must have

See also SIITBX-8 - Getting issue details... STATUS SIIITBX-10 - Getting issue details... STATUS

User interaction and design

Questions

Below is a list of questions to be addressed as a result of this requirements document:

QuestionOutcome
If there are already modules on the Update Center, how can I merge/update the update.xml file automatically?
NetBeans modules can be signed for security reasons and to identify the author. How to do this?

The signing of NBMs follows the JDK Jar signing.

The nbm-maven-plugin supports this with the nbm goal. This wiki page describes how to do it.

The Keytool for generating the keystore is explained in more detail here.

How to notify users about a new release?

A notification element can be added to the update.xml. The message is shown to the users as balloon tip.

User Notification
<notification url="http://www.netbeans.org/downloads">NetBeans IDE 8.0.2 is available!</notification>

It is not possible to add this via the maven-netbeans-plugin. You need to add this manually to the file. If you do so, remember to update also the update.xml.gz file which is normally the published one.

 

Resources

HowTos

Setup of the Webserver

Resources:

Generating NBMs for the Update Center

The nbm-maven-plugin provides the goal autoupdate. This goals assembles all NetBeans modules into a directory called netbeans_site in the output directory (./target by default) of the project. Additionally the updates.xml file is generated. This file is needed by the Update Center because it holds all necessary information about the modules which are provided by the server.

It seems that the most practical way to deal with the toolboxes and the Updated Center is to have for each toolbox and for the SNAP Engine one Update Center. Each project creates by calling the maven goal org.codehaus.mojo:nbm-maven-plugin:autoupdate its own set of nbm files and also the necessary updates.xml file.

This would lead to a server structure like the following:

www.senbox.org/updatecenter/
s1tbx/updates.xml
s1tbx/*.nbm
s2tbx/updates.xml
s2tbx/*.nbm
s3tbx/updates.xml
s3tbx/*.nbm
snap-engine/updates.xml
snap-engine/*.nbm
snap-desktop/updates.xml
snap-desktop/*.nbm

Signing and Validating Plugins

When installing new plugins the update manager complains if the plugin file is not signed and can not be validated. To sign plugins by the maven-netbeans-plugin the three properties specifying a keystore must be given.

<keystore>keystoreFile</keystore>
<keystorealias>aliasName</keystorealias>
<keystorepassword>password</keystorepassword>

The keystore can be created by using the keytool provided along with the JDK. Signing can be done by following the description in the link mentioned in the Question section.

>keytool.exe -genkey -storepass snap-123 -alias snap -validity 500 -keystore C:\keystore\snap.ks

Afterwards you are asked to provide some additional information like your name and name of your organisation and some regional information.

First and last name: ESA SNAP

Organisation unit: SNAP

Organisation: ESA

City:

Country:

Country code:

password: <ENTER>

 

 

At the end you are asked for a password for the generated key. Just hit ENTER and use the same as for the keystore. This is required.

In order to validate the signed plugins it is necessary to implement your own KeyStoreProvider.

Generating Catalog for Update Center Repositories

For our update center repositories we need to generate the catalog xml files manually. The output of the maven goal nbm-maven-plugin:autoupdate can not be used directly. This goal just generates the catalog for a single maven project but we want to combine multiple maven project in one update center repository.Therefore a tool has been written which gathers all nbm files in a directory and generates the catalog for it. The tool class which implements it is com.bc.ceres.util.GenAUCatalog.

The tool takes up to three parameters:

  1. The path to the directory containing the nbm files (mandatory)
  2. A notification message which is shown to the user as a balloon message in the lower right (optional)
  3. An URL for the notification message (optional)

The resulting update.xml/update.xml.gz can be uploaded to the update center repository along with the nbm files.