Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2009-03-12 22:13:21 -0400
committerSimon Kaegi2009-03-12 22:13:21 -0400
commit24aa98be64bc237f9723c3f2d3544bfbaa59414a (patch)
tree010ca5bfd6c52679a130646f436493e6d582954d /bundles/org.eclipse.equinox.p2.touchpoint.eclipse
parentb4b3442262a5a9d99aac992595ccee6a26a62478 (diff)
downloadrt.equinox.p2-24aa98be64bc237f9723c3f2d3544bfbaa59414a.tar.gz
rt.equinox.p2-24aa98be64bc237f9723c3f2d3544bfbaa59414a.tar.xz
rt.equinox.p2-24aa98be64bc237f9723c3f2d3544bfbaa59414a.zip
Bug 262331 [eclipse] EclipseTouchpoint requires publisher
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.touchpoint.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java29
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PublisherUtil.java26
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties2
4 files changed, 31 insertions, 28 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java
index f55c407d8..c88b29d9e 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseTouchpoint.java
@@ -18,23 +18,12 @@ import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.LogHelper;
import org.eclipse.equinox.internal.provisional.frameworkadmin.FrameworkAdminRuntimeException;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
-import org.eclipse.equinox.internal.provisional.p2.core.Version;
import org.eclipse.equinox.internal.provisional.p2.engine.*;
import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.publisher.PublisherInfo;
-import org.eclipse.equinox.p2.publisher.eclipse.*;
-import org.eclipse.osgi.service.resolver.BundleDescription;
import org.eclipse.osgi.util.NLS;
public class EclipseTouchpoint extends Touchpoint {
-
- // TODO: phase id constants should be defined elsewhere.
- public static final String INSTALL_PHASE_ID = "install"; //$NON-NLS-1$
- public static final String UNINSTALL_PHASE_ID = "uninstall"; //$NON-NLS-1$
- public static final String CONFIGURE_PHASE_ID = "configure"; //$NON-NLS-1$
- public static final String UNCONFIGURE_PHASE_ID = "unconfigure"; //$NON-NLS-1$
-
public static final String PROFILE_PROP_LAUNCHER_NAME = "eclipse.touchpoint.launcherName"; //$NON-NLS-1$
public static final String PARM_MANIPULATOR = "manipulator"; //$NON-NLS-1$
public static final String PARM_PLATFORM_CONFIGURATION = "platformConfiguration"; //$NON-NLS-1$
@@ -160,14 +149,14 @@ public class EclipseTouchpoint extends Touchpoint {
}
public IInstallableUnit prepareIU(IInstallableUnit iu, IProfile profile) {
-
Class c = null;
try {
c = Class.forName("org.eclipse.equinox.p2.publisher.eclipse.BundlesAction"); //$NON-NLS-1$
if (c != null)
c = Class.forName("org.eclipse.osgi.service.resolver.PlatformAdmin"); //$NON-NLS-1$
} catch (ClassNotFoundException e) {
- throw new IllegalStateException(NLS.bind(Messages.generator_not_available, e.getMessage()));
+ LogHelper.log(Util.createError(NLS.bind(Messages.publisher_not_available, e.getMessage())));
+ return null;
}
if (c != null) {
@@ -184,22 +173,10 @@ public class EclipseTouchpoint extends Touchpoint {
LogHelper.log(Util.createError(NLS.bind(Messages.artifact_file_not_found, artifactKey.toString())));
return null;
}
- return createBundleIU(artifactKey, bundleFile);
+ return PublisherUtil.createBundleIU(artifactKey, bundleFile);
}
// should not occur
throw new IllegalStateException(Messages.unexpected_prepareiu_error);
}
-
- private IInstallableUnit createBundleIU(IArtifactKey artifactKey, File bundleFile) {
- BundleDescription bundleDescription = BundlesAction.createBundleDescription(bundleFile);
- PublisherInfo info = new PublisherInfo();
- Version version = new Version(bundleDescription.getVersion().toString());
- AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), version, new Path(bundleFile.getAbsolutePath()), AdviceFileAdvice.BUNDLE_ADVICE_FILE);
- if (advice.containsAdvice())
- info.addAdvice(advice);
- String shape = bundleFile.isDirectory() ? IBundleShapeAdvice.DIR : IBundleShapeAdvice.JAR;
- info.addAdvice(new BundleShapeAdvice(bundleDescription.getSymbolicName(), version, shape));
- return BundlesAction.createBundleIU(bundleDescription, artifactKey, info);
- }
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java
index 36ab93a10..5d9d23426 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Messages.java
@@ -22,7 +22,7 @@ public class Messages extends NLS {
public static String error_saving_platform_configuration;
public static String error_saving_source_bundles_list;
public static String error_parsing_configuration;
- public static String generator_not_available;
+ public static String publisher_not_available;
public static String artifact_write_unsupported;
public static String artifact_file_not_found;
public static String artifact_retrieval_unsupported;
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PublisherUtil.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PublisherUtil.java
new file mode 100644
index 000000000..a0913f030
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/PublisherUtil.java
@@ -0,0 +1,26 @@
+package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
+
+import java.io.File;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.equinox.internal.provisional.p2.core.Version;
+import org.eclipse.equinox.internal.provisional.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.publisher.PublisherInfo;
+import org.eclipse.equinox.p2.publisher.eclipse.*;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+
+public class PublisherUtil {
+
+ public static IInstallableUnit createBundleIU(IArtifactKey artifactKey, File bundleFile) {
+ BundleDescription bundleDescription = BundlesAction.createBundleDescription(bundleFile);
+ PublisherInfo info = new PublisherInfo();
+ Version version = new Version(bundleDescription.getVersion().toString());
+ AdviceFileAdvice advice = new AdviceFileAdvice(bundleDescription.getSymbolicName(), version, new Path(bundleFile.getAbsolutePath()), AdviceFileAdvice.BUNDLE_ADVICE_FILE);
+ if (advice.containsAdvice())
+ info.addAdvice(advice);
+ String shape = bundleFile.isDirectory() ? IBundleShapeAdvice.DIR : IBundleShapeAdvice.JAR;
+ info.addAdvice(new BundleShapeAdvice(bundleDescription.getSymbolicName(), version, shape));
+ return BundlesAction.createBundleIU(bundleDescription, artifactKey, info);
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties
index fb758def5..700ee4729 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/messages.properties
@@ -16,7 +16,7 @@ error_saving_manipulator=Error saving manipulator.
error_saving_platform_configuration=Error saving platform configuration.
error_saving_source_bundles_list=Error saving source bundles list.
error_parsing_configuration=Error parsing platform configuration.
-generator_not_available=The partial IU could not be updated. Generator not available: {0}.
+publisher_not_available=The partial IU could not be updated. Publisher not available: {0}.
artifact_write_unsupported=Repository not writeable.
artifact_file_not_found=The artifact file for {0} was not found.
artifact_retrieval_unsupported=Repository does not support artifact retrieval

Back to the top