0

I am trying to provide an autoupdate feature for a Lotus Notes 8.5.2. The plugin is being developed under Eclipse 3.4.2. So far I haven't managed to find a standard way for doing this by hooking into the Lotus Notes API. What comes to my mind are the following two approaches.

  • use the Eclipse p2 SDK to perform the autoupgrade at runtime (at early startup of the plugin the updater will be checking for new versions and update the plugin). This entry describes the approach -> http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_api_overview.htm. Unfortunately the SDK is not part of Eclipse 3.4.2 and I didn't manage to use this approach with 3.4.2.

  • use an external process that closes Lotus Notes, removes the old version of the plugin from the plugin directory of Lotus, copies the new version to the plugin directory, starts Lotus Notes again and terminates the process.

The second approach seems reasonable but requires closing of Lotus Notes during the autoupgrade process. So my question is - is there any approach similar to the first one above or any other standard procedure for Lotus Notes ? Thanks in advance.

2 Answers2

0

Have a read of the widget catalog. It will do what you want.

http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/topic/com.ibm.help.domino.admin85.doc/H_MANAGING_CLIENTS_USING_WIDGETS_AND_THE_WIDGETS_CATALOG_OVER.html

You will still need to restart the client after any plugin updates though.

Simon O'Doherty
  • 9,259
  • 3
  • 26
  • 54
  • Thanks for the suggestion Simon - I have found a more direct way using the suggestion from this post -> http://www.eclipsezone.com/eclipse/forums/t97689.html – Martin Toshev Jun 13 '12 at 08:24
0

Thanks for the suggestion Simon - I have found a more direct way using the suggestion from this post -> http://www.eclipsezone.com/eclipse/forums/t97689.html with the addition of a configure operation (IConfigureFeatureOperation) for update the version of the feature to the platform.xml file of Lotus Notes. Here is a sample snippet that illustrates the approach:

        String updateSiteUrl = configuration.getUpdateSiteUrl();

        IProgressMonitor monitor = new NullProgressMonitor();
        ISite updateSite = SiteManager.getSite(new URL(updateSiteUrl),
                monitor);
        IFeatureReference[] siteFeatures = updateSite
                .getFeatureReferences();
        ILocalSite localSite = SiteManager.getLocalSite();

        List<IInstallFeatureOperation> installOps = new ArrayList<IInstallFeatureOperation>();
        List<IConfigFeatureOperation> configOps = new ArrayList<IConfigFeatureOperation>();

        IConfiguredSite[] configuredSites = localSite
                .getCurrentConfiguration().getConfiguredSites();

        for (IConfiguredSite configuredSite : configuredSites) {

            IFeatureReference[] localSiteFeatures = configuredSite
                    .getConfiguredFeatures();

            for (IFeatureReference siteFeature : siteFeatures) {
                for (IFeatureReference localSiteFeature : localSiteFeatures) {

                    VersionedIdentifier featureVi = siteFeature
                            .getVersionedIdentifier();
                    VersionedIdentifier localFeatureVi = localSiteFeature
                            .getVersionedIdentifier();

                    if (featureVi.getIdentifier().equals(
                            localFeatureVi.getIdentifier())) {

                        if (featureVi.getVersion().isGreaterThan(
                                localFeatureVi.getVersion())) {

                            installOps
                                    .add(OperationsManager
                                            .getOperationFactory()
                                            .createInstallOperation(
                                                    configuredSite,
                                                    siteFeature
                                                            .getFeature(monitor),
                                                    null, null, null));

                            configOps
                                    .add(OperationsManager
                                            .getOperationFactory()
                                            .createConfigOperation(
                                                    configuredSite,
                                                    siteFeature
                                                            .getFeature(monitor),
                                                    null, null));
                        }
                    }
                }
            }
        }

        if (installOps.size() > 0) {

                // install new feature
                for (Iterator<?> iter = installOps.iterator(); iter
                        .hasNext();) {
                    IInstallFeatureOperation op = (IInstallFeatureOperation) iter
                            .next();
                    op.execute(monitor, null);
                }

                // configure new feature
                for (Iterator<?> iter = configOps.iterator(); iter
                        .hasNext();) {
                    IConfigFeatureOperation op = (IConfigFeatureOperation) iter
                            .next();
                    op.execute(monitor, null);
                }

                localSite.save();}