https://jira.talendforge.org/browse/TUP-2107 : Add after update function.
This commit is contained in:
@@ -25,7 +25,7 @@ import org.talend.updates.runtime.model.ExtraFeature;
|
||||
*/
|
||||
public class ExtraFeaturesUpdatesFactory {
|
||||
|
||||
private ExtraFeaturesUpdatesReader reader = new ExtraFeaturesUpdatesReader();
|
||||
private final static ExtraFeaturesUpdatesReader updatesFactoryReader = new ExtraFeaturesUpdatesReader();
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -41,11 +41,20 @@ public class ExtraFeaturesUpdatesFactory {
|
||||
if (uninstalledExtraFeatures == null) {
|
||||
Assert.isNotNull(uninstalledExtraFeatures);
|
||||
}
|
||||
AbstractExtraUpdatesFactory[] updatesFactories = reader.getUpdatesFactories();
|
||||
AbstractExtraUpdatesFactory[] updatesFactories = updatesFactoryReader.getUpdatesFactories();
|
||||
if (updatesFactories != null) {
|
||||
for (AbstractExtraUpdatesFactory factory : updatesFactories) {
|
||||
factory.retrieveUninstalledExtraFeatures(monitor, uninstalledExtraFeatures);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void afterUpdate() {
|
||||
AbstractExtraUpdatesFactory[] updatesFactories = updatesFactoryReader.getUpdatesFactories();
|
||||
if (updatesFactories != null) {
|
||||
for (AbstractExtraUpdatesFactory factory : updatesFactories) {
|
||||
factory.afterUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@ public abstract class AbstractExtraUpdatesFactory {
|
||||
|
||||
public abstract void retrieveUninstalledExtraFeatures(IProgressMonitor monitor, Set<ExtraFeature> uninstalledExtraFeatures);
|
||||
|
||||
// after update studio, will do this.
|
||||
public void afterUpdate() {
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is used to add an item to the set and use a specific realm if the Set is an IObservable, any
|
||||
* observant be notified of the set modification.
|
||||
|
||||
@@ -39,8 +39,6 @@ import org.talend.updates.runtime.engine.InstallNewFeatureJob;
|
||||
import org.talend.updates.runtime.i18n.Messages;
|
||||
import org.talend.updates.runtime.model.ExtraFeature;
|
||||
|
||||
import com.sun.org.apache.xml.internal.serializer.utils.Utils;
|
||||
|
||||
/**
|
||||
* created by sgandon on 25 févr. 2013 Detailled comment
|
||||
*
|
||||
@@ -113,7 +111,8 @@ public class UpdateStudioWizard extends Wizard {
|
||||
// display message in case of any success
|
||||
String firstPartOfMessage = Messages.getString("UpdateStudioWizard.all.feautures.installed.successfully"); //$NON-NLS-1$
|
||||
if (hasAnySuccess) {
|
||||
Utils.removeLicenseDateFile();// force the reload of plugins after any sucessfull install.
|
||||
ExtraFeaturesUpdatesFactory updatesFactory = new ExtraFeaturesUpdatesFactory();
|
||||
updatesFactory.afterUpdate();
|
||||
if (hasAnyFailure) {
|
||||
firstPartOfMessage = Messages.getString("UpdateStudioWizard.some.feautures.installed.sucessfully"); //$NON-NLS-1$
|
||||
}// else only success to keep initial message
|
||||
|
||||
Reference in New Issue
Block a user