Lines 28-34
Link Here
|
28 |
import org.eclipse.core.runtime.CoreException; |
28 |
import org.eclipse.core.runtime.CoreException; |
29 |
import org.eclipse.core.runtime.FileLocator; |
29 |
import org.eclipse.core.runtime.FileLocator; |
30 |
import org.eclipse.core.runtime.IProgressMonitor; |
30 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
|
31 |
import org.eclipse.core.runtime.IStatus; |
31 |
import org.eclipse.core.runtime.Platform; |
32 |
import org.eclipse.core.runtime.Platform; |
|
|
33 |
import org.eclipse.core.runtime.Status; |
32 |
import org.eclipse.osgi.util.NLS; |
34 |
import org.eclipse.osgi.util.NLS; |
33 |
import org.eclipse.update.configuration.IActivity; |
35 |
import org.eclipse.update.configuration.IActivity; |
34 |
import org.eclipse.update.configuration.IConfiguredSite; |
36 |
import org.eclipse.update.configuration.IConfiguredSite; |
Lines 497-502
Link Here
|
497 |
if (featurePlugin != null) |
499 |
if (featurePlugin != null) |
498 |
pluginVersion = featurePlugin.getVersionedIdentifier().getVersion().toString(); |
500 |
pluginVersion = featurePlugin.getVersionedIdentifier().getVersion().toString(); |
499 |
|
501 |
|
|
|
502 |
// Find the site |
503 |
SiteEntry siteEntry = null; |
504 |
try { |
505 |
URL featureUrl = new URL(cSite.getPlatformURLString()); |
506 |
siteEntry = (SiteEntry)runtimeConfiguration.findConfiguredSite(featureUrl); |
507 |
} catch (MalformedURLException e) { |
508 |
throw Utilities.newCoreException(NLS.bind(Messages.InstallConfiguration_UnableToCreateURL, (new String[] { cSite.getPlatformURLString() })), e); |
509 |
} catch (ClassCastException e) { |
510 |
throw Utilities.newCoreException(Messages.InstallConfiguration_UnableToCast, e); |
511 |
} |
512 |
|
513 |
// if the URL doesn't exist throw a CoreException |
514 |
if (siteEntry == null) { |
515 |
throw new CoreException( |
516 |
new Status(IStatus.ERROR, UpdateCore.getPlugin().getBundle().getSymbolicName(), |
517 |
NLS.bind(Messages.InstallConfiguration_unableToFindSite, (new String[] { cSite.getSite().getURL().toExternalForm(), runtimeConfiguration.getConfigurationLocation().toExternalForm() })))); |
518 |
} |
519 |
|
500 |
// write the primary features |
520 |
// write the primary features |
501 |
if (feature.isPrimary()) { |
521 |
if (feature.isPrimary()) { |
502 |
// get any fragments for the feature plugin |
522 |
// get any fragments for the feature plugin |
Lines 515-521
Link Here
|
515 |
String application = feature.getApplication(); |
535 |
String application = feature.getApplication(); |
516 |
FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, true, application, roots); |
536 |
FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, true, application, roots); |
517 |
featureEntry.setURL(getFeatureRelativeURL(feature)); |
537 |
featureEntry.setURL(getFeatureRelativeURL(feature)); |
518 |
SiteEntry siteEntry = (SiteEntry)runtimeConfiguration.findConfiguredSite(cSite.getSite().getURL()); |
|
|
519 |
siteEntry.addFeatureEntry(featureEntry); |
538 |
siteEntry.addFeatureEntry(featureEntry); |
520 |
} else { |
539 |
} else { |
521 |
// write non-primary feature entries |
540 |
// write non-primary feature entries |
Lines 523-529
Link Here
|
523 |
String pluginIdentifier = feature.getPrimaryPluginID(); |
542 |
String pluginIdentifier = feature.getPrimaryPluginID(); |
524 |
FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, false, null, null); |
543 |
FeatureEntry featureEntry = (FeatureEntry)runtimeConfiguration.createFeatureEntry(id, version, pluginIdentifier, pluginVersion, false, null, null); |
525 |
featureEntry.setURL(getFeatureRelativeURL(feature)); |
544 |
featureEntry.setURL(getFeatureRelativeURL(feature)); |
526 |
SiteEntry siteEntry = (SiteEntry)runtimeConfiguration.findConfiguredSite(cSite.getSite().getURL()); |
|
|
527 |
siteEntry.addFeatureEntry(featureEntry); |
545 |
siteEntry.addFeatureEntry(featureEntry); |
528 |
} |
546 |
} |
529 |
|
547 |
|