提案をありがとうサイモン-私はこの投稿からの提案を使用してより直接的な方法を見つけました-> http://www.eclipsezone.com/eclipse/forums/t97689.html
更新のための構成操作(IConfigureFeatureOperation)の追加LotusNotesのplatform.xmlファイルに対する機能のバージョン。アプローチを説明するサンプルスニペットを次に示します。
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();}