Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2009-05-05 18:34:52 +0000
committerPascal Rapicault2009-05-05 18:34:52 +0000
commit5520aa2f5ee3fa8709f22589d9bb846224bb04b5 (patch)
tree6a363c32a64b6454b073c1db81255d9deb1fdfa4 /bundles/org.eclipse.equinox.p2.publisher/src
parent42c2867df9b76f2a37025f773067606759484bc9 (diff)
downloadrt.equinox.p2-5520aa2f5ee3fa8709f22589d9bb846224bb04b5.tar.gz
rt.equinox.p2-5520aa2f5ee3fa8709f22589d9bb846224bb04b5.tar.xz
rt.equinox.p2-5520aa2f5ee3fa8709f22589d9bb846224bb04b5.zip
Bug 274695 - [publisher] Redundant 'feature.jars' entry on "Review license" page
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.publisher/src')
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java45
1 files changed, 33 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
index 0c2937d9b..fb0f96c8a 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/eclipse/FeaturesAction.java
@@ -59,17 +59,19 @@ public class FeaturesAction extends AbstractPublisherAction {
iu.setId(id);
Version version = Version.parseVersion(feature.getVersion());
iu.setVersion(version);
+
+ // set properties for other feature attributes
+ iu.setProperty(IInstallableUnit.PROP_NAME, feature.getLabel());
+ if (feature.getDescription() != null)
+ iu.setProperty(IInstallableUnit.PROP_DESCRIPTION, feature.getDescription());
+ if (feature.getDescriptionURL() != null)
+ iu.setProperty(IInstallableUnit.PROP_DESCRIPTION_URL, feature.getDescriptionURL());
+ if (feature.getProviderName() != null)
+ iu.setProperty(IInstallableUnit.PROP_PROVIDER, feature.getProviderName());
if (feature.getLicense() != null)
iu.setLicense(MetadataFactory.createLicense(toURIOrNull(feature.getLicenseURL()), feature.getLicense()));
if (feature.getCopyright() != null)
iu.setCopyright(MetadataFactory.createCopyright(toURIOrNull(feature.getCopyrightURL()), feature.getCopyright()));
-
- // The required capabilities are not specified at this level because we don't want the feature jar to be attractive to install.
- iu.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI);
- iu.setFilter(INSTALL_FEATURES_FILTER);
- iu.setSingleton(true);
-
- // set properties for other feature attributes
if (feature.getApplication() != null)
iu.setProperty(UPDATE_FEATURE_APPLICATION_PROP, feature.getApplication());
if (feature.getPlugin() != null)
@@ -79,6 +81,11 @@ public class FeaturesAction extends AbstractPublisherAction {
if (feature.isPrimary())
iu.setProperty(UPDATE_FEATURE_PRIMARY_PROP, Boolean.TRUE.toString());
+ // The required capabilities are not specified at this level because we don't want the feature jar to be attractive to install.
+ iu.setTouchpointType(PublisherHelper.TOUCHPOINT_OSGI);
+ iu.setFilter(INSTALL_FEATURES_FILTER);
+ iu.setSingleton(true);
+
if (feature.getInstallHandler() != null && feature.getInstallHandler().trim().length() > 0) {
String installHandlerProperty = "handler=" + feature.getInstallHandler(); //$NON-NLS-1$
@@ -91,18 +98,32 @@ public class FeaturesAction extends AbstractPublisherAction {
iu.setProperty(PublisherHelper.ECLIPSE_INSTALL_HANDLER_PROP, installHandlerProperty);
}
+ ArrayList providedCapabilities = new ArrayList();
+ providedCapabilities.add(PublisherHelper.createSelfCapability(id, version));
+ providedCapabilities.add(PublisherHelper.FEATURE_CAPABILITY);
+ providedCapabilities.add(MetadataFactory.createProvidedCapability(PublisherHelper.CAPABILITY_NS_UPDATE_FEATURE, feature.getId(), version));
+
iu.setCapabilities(new IProvidedCapability[] {PublisherHelper.createSelfCapability(id, version), PublisherHelper.FEATURE_CAPABILITY, MetadataFactory.createProvidedCapability(PublisherHelper.CAPABILITY_NS_UPDATE_FEATURE, feature.getId(), version)});
iu.setArtifacts(new IArtifactKey[] {createFeatureArtifactKey(feature.getId(), version.toString())});
- // TODO its not clear when this would ever be false reasonably. Features are always
- // supposed to be installed unzipped. It is also not clear what it means to set this prop.
- // Anyway, in the future it seems reasonable that features be installed as JARs...
- // Note: We have decided to always unzip features when they are installed (regardless of whether they
- //were zipped when we found them). https://bugs.eclipse.org/bugs/show_bug.cgi?id=267282
Map touchpointData = new HashMap();
touchpointData.put("zipped", "true"); //$NON-NLS-1$ //$NON-NLS-2$
iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
+ Map localizations = feature.getLocalizations();
+ if (localizations != null) {
+ for (Iterator iter = localizations.keySet().iterator(); iter.hasNext();) {
+ Locale locale = (Locale) iter.next();
+ Properties translatedStrings = (Properties) localizations.get(locale);
+ Enumeration propertyKeys = translatedStrings.propertyNames();
+ while (propertyKeys.hasMoreElements()) {
+ String nextKey = (String) propertyKeys.nextElement();
+ iu.setProperty(locale.toString() + '.' + nextKey, translatedStrings.getProperty(nextKey));
+ }
+ providedCapabilities.add(PublisherHelper.makeTranslationCapability(id, locale));
+ }
+ }
+
processInstallableUnitPropertiesAdvice(iu, info);
return MetadataFactory.createInstallableUnit(iu);
}

Back to the top