Commit 3ddb1a7e authored by Romain Bioteau's avatar Romain Bioteau Committed by GitHub

fix(installer) remove workspace import from installer (#534)

Relates to BS-16686
parent d25b5efb
java.version.title=Java version java.version.title=Java version
java.version.message=The installer has not detected a compatible version of Java on your system. If you continue the installation, the installer will add an embedded version of Java to your Bonita BPM Studio.\n Note: This version of Java will not be installed on your system, so it will not impact other applications. If you do not want to use the embedded Java version, cancel the installation, install Java, then restart the installation.\n Do you want to continue the installation and use the embedded Java? java.version.message=The installer has not detected a compatible version of Java on your system. If you continue the installation, the installer will add an embedded version of Java to your Bonita BPM Studio.\n Note: This version of Java will not be installed on your system, so it will not impact other applications. If you do not want to use the embedded Java version, cancel the installation, install Java, then restart the installation.\n Do you want to continue the installation and use the embedded Java?
workspace.recovery.progressMessage=Please wait, retrieving workspace data...
initializing.progressMessage=Please wait, initializing
workspace.location.title=Workspace location
workspace.location.description=Path
workspace.location.explanation=You can migrate only one workspace automatically:
workspace.location.explanation.choice1=- default workspace: browse to the directory where you installed Bonita BPM Studio.
workspace.location.explanation.choice2=- another workspace (Subscription editions): browse to its parent directory.
workspace.location.explanation.end=To migrate other workspaces manually (Subscription editions only): in the old Studio, all diagrams closed, export everything and import the archive into the new Studio.
workspace.location.validation.error=The directory you chose does not contain a valid workspace
keep.workspace.title=Keep workspace ? keep.workspace.title=Keep workspace ?
keep.workspace.msg=Do you want to keep all your existing data? keep.workspace.msg=Do you want to keep all your existing data?
launch=Launch launch=Launch
install.license.error=License file should have a ".lic" extension install.license.error=License file should have a ".lic" extension
install.license.desc=License file (browse your computer) install.license.desc=License file
request.key.explanation=Copy the license key below, log into Bonitasoft Customer Portal (https://customer.bonitasoft.com/license/request) and paste it in the License Request Key field.\nYou will receive your license file by email. Save it locally and come back to this installer.\n request.key.explanation=Copy the license key below, log into Bonitasoft Customer Portal (https://customer.bonitasoft.com/license/request) and paste it in the License Request Key field.\nYou will receive your license file by email. Save it locally and come back to this installer.\n
install.license.title=Product license install.license.title=Product license
retrieve.workspace.title=Retrieve data workspace.setup=Workspace setup
retrieve.workspace.message=Do you want to retrieve data from an existing Bonita BPM workspace? \ No newline at end of file
retrieve.workspace.message.warning=Warning: If you migrate a workspace that contains a shared repository (Subscription editions), all the repository users must migrate to the new version of Studio.
workspace.setup=Workspace setup
no.thanks=No, do not migrate data, I will migrate manually, or I do not have any data to migrate.
yes.import=Yes, migrate a workspace.
\ No newline at end of file
...@@ -215,8 +215,9 @@ ...@@ -215,8 +215,9 @@
Type=Application Type=Application
</text> </text>
</writeFile> </writeFile>
<changePermissions permissions="0755" files="${desktop_path}/@product.short.name@-${product_version}.desktop" /> <changePermissions permissions="0755"
<addFilesToUninstaller files="${desktop_path}/@product.short.name@-${product_version}.desktop"/> files="${desktop_path}/@product.short.name@-${product_version}.desktop" />
<addFilesToUninstaller files="${desktop_path}/@product.short.name@-${product_version}.desktop" />
</actionList> </actionList>
<conditionRuleList> <conditionRuleList>
<platformTest> <platformTest>
...@@ -279,8 +280,9 @@ ...@@ -279,8 +280,9 @@
<substitution> <substitution>
<pattern>-clearPersistedState</pattern> <pattern>-clearPersistedState</pattern>
<value>-clearPersistedState <value>-clearPersistedState
-vm -vm
../../../jre/Contents/Home/bin/java</value> ../../../jre/Contents/Home/bin/java
</value>
</substitution> </substitution>
</substitutionList> </substitutionList>
<ruleList> <ruleList>
...@@ -320,7 +322,8 @@ ...@@ -320,7 +322,8 @@
</copyFile> </copyFile>
<runProgram> <runProgram>
<program>genisoimage</program> <program>genisoimage</program>
<programArguments>-D -V Setup -no-pad -r -apple -o @bitrock.output@/${dmgName} ${tempDir}/output</programArguments> <programArguments>-D -V Setup -no-pad -r -apple -o @bitrock.output@/${dmgName} ${tempDir}/output
</programArguments>
</runProgram> </runProgram>
<deleteFile> <deleteFile>
<path>${tempDir}</path> <path>${tempDir}</path>
...@@ -381,7 +384,8 @@ ...@@ -381,7 +384,8 @@
</runProgram> </runProgram>
<launchBrowser> <launchBrowser>
<show>0</show> <show>0</show>
<url>http://www.bonitasoft.com/bos_redirect.php?bos_redirect_id=126&amp;bos_redirect_product=bos&amp;bos_version=${product_version}&amp;os=${platform_name}&amp;arch=@os_arch@&amp;edition=community</url> <url>http://www.bonitasoft.com/bos_redirect.php?bos_redirect_id=126&amp;bos_redirect_product=bos&amp;bos_version=${product_version}&amp;os=${platform_name}&amp;arch=@os_arch@&amp;edition=community
</url>
</launchBrowser> </launchBrowser>
</finalPageActionList> </finalPageActionList>
...@@ -459,187 +463,7 @@ ...@@ -459,187 +463,7 @@
</component> </component>
</componentList> </componentList>
<parameterList> <parameterList>
<choiceParameter>
<name>retrieveWorksapce</name>
<title>${msg(retrieve.workspace.title)}</title>
<explanation>${msg(retrieve.workspace.message)}
${msg(retrieve.workspace.message.warning)}
</explanation>
<value></value>
<default>false</default>
<allowEmptyValue>0</allowEmptyValue>
<displayType>radiobuttons</displayType>
<insertBefore>installationFinished</insertBefore>
<ordering>default</ordering>
<width></width>
<optionList>
<option>
<description></description>
<image></image>
<text>${msg(no.thanks)}</text>
<value>false</value>
</option>
<option>
<description></description>
<image></image>
<text>${msg(yes.import)}</text>
<value>true</value>
</option>
</optionList>
<postShowPageActionList>
<setInstallerVariable>
<name>java_executable</name>
<value>${installdir}/jre/bin/java.exe</value>
<ruleList>
<isFalse value="${java_autodetected}" />
<platformTest>
<type>windows</type>
</platformTest>
</ruleList>
</setInstallerVariable>
<setInstallerVariable>
<name>java_executable</name>
<value>${installdir}/jre/bin/java</value>
<ruleList>
<isFalse value="${java_autodetected}" />
<platformTest>
<type>linux</type>
</platformTest>
</ruleList>
</setInstallerVariable>
<setInstallerVariable>
<name>java_executable</name>
<value>${installdir}/jre/Contents/Home/bin/java</value>
<ruleList>
<isFalse value="${java_autodetected}" />
<platformTest>
<type>osx</type>
</platformTest>
</ruleList>
</setInstallerVariable>
<showProgressDialog>
<title>${msg(workspace.setup)}</title>
<height>100</height>
<width>400</width>
<actionList>
<runProgram>
<program>${java_executable}</program>
<programArguments>-Xmx512m -jar "${installdir}/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar" -product org.bonitasoft.studio.initializer -application org.bonitasoft.studio.application.InitializerApplication -data "${installdir}/workspace" -noSplash</programArguments>
<progressText>${msg(initializing.progressMessage)} ${product_fullname}...</progressText>
<ruleList>
<isFalse>
<value>${retrieveWorksapce}</value>
</isFalse>
<platformTest>
<negate>1</negate>
<type>osx</type>
</platformTest>
</ruleList>
</runProgram>
</actionList>
<ruleList>
<isFalse>
<value>${retrieveWorksapce}</value>
</isFalse>
</ruleList>
</showProgressDialog>
</postShowPageActionList>
</choiceParameter>
<directoryParameter>
<name>Oldworkspace</name>
<title>${msg(workspace.location.title)}</title>
<description>${msg(workspace.location.description)}</description>
<explanation>${msg(workspace.location.explanation)}
${msg(workspace.location.explanation.choice1)}
${msg(workspace.location.explanation.choice2)}
${msg(workspace.location.explanation.end)}
</explanation>
<value></value>
<default>${platform_install_prefix}/</default>
<allowEmptyValue>0</allowEmptyValue>
<insertAfter>retrieveWorksapce</insertAfter>
<mustBeWritable>1</mustBeWritable>
<mustExist>1</mustExist>
<ruleList>
<!-- <isFalse> -->
<!-- <value>true</value> -->
<!-- </isFalse> -->
<compareValues>
<logic>equals</logic>
<value1>${retrieveWorksapce}</value1>
<value2>true</value2>
</compareValues>
</ruleList>
<validationActionList>
<findFile>
<baseDirectory>${Oldworkspace}</baseDirectory>
<showMessageOnError>1</showMessageOnError>
<customErrorMessage>${msg(workspace.location.validation.error)}</customErrorMessage>
<pattern>workspace</pattern>
<variable>workspaceFound</variable>
</findFile>
</validationActionList>
<postShowPageActionList>
<showProgressDialog>
<title>${msg(workspace.setup)}</title>
<height>100</height>
<width>400</width>
<actionList>
<runProgram>
<program>${java_executable}</program>
<programArguments>-Xmx512m -jar "${installdir}/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar" -product org.bonitasoft.studio.workspaceRecovery -application org.bonitasoft.studio.application.WorkspaceRecovery -data "${Oldworkspace}/workspace/" -newWorkspaceLocation "${installdir}/workspace" -noSplash</programArguments>
<progressText>${msg(workspace.recovery.progressMessage)}</progressText>
<ruleList>
<platformTest>
<negate>1</negate>
<type>osx</type>
</platformTest>
<isTrue>
<value>${retrieveWorksapce}</value>
</isTrue>
</ruleList>
</runProgram>
<runProgram>
<program>${java_executable}</program>
<programArguments>-Xmx512m -jar "${installdir}/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar" -product org.bonitasoft.studio.initializer -application org.bonitasoft.studio.application.InitializerApplication -data "${installdir}/workspace" -noSplash</programArguments>
<progressText>${msg(initializing.progressMessage)} ${product_fullname}...</progressText>
<ruleList>
<platformTest>
<negate>1</negate>
<type>osx</type>
</platformTest>
</ruleList>
</runProgram>
<runProgram>
<program>${java_executable}</program>
<programArguments>-Xmx512m -XstartOnFirstThread -jar "${installdir}/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar" -product org.bonitasoft.studio.workspaceRecovery -application org.bonitasoft.studio.application.WorkspaceRecovery -data "${Oldworkspace}/workspace/" -newWorkspaceLocation "${installdir}/workspace" -noSplash</programArguments>
<progressText>${msg(workspace.recovery.progressMessage)}</progressText>
<ruleList>
<platformTest>
<type>osx</type>
</platformTest>
<isTrue>
<value>${retrieveWorksapce}</value>
</isTrue>
</ruleList>
</runProgram>
<runProgram>
<program>${java_executable}</program>
<!-- Change bundle version when Equinox version change -->
<programArguments>-Xmx512m -XstartOnFirstThread -jar "${installdir}/plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar" -product org.bonitasoft.studio.initializer -application org.bonitasoft.studio.application.InitializerApplication -data "${installdir}/workspace" -noSplash</programArguments>
<progressText>${msg(initializing.progressMessage)} ${product_fullname}...</progressText>
<ruleList>
<platformTest>
<type>osx</type>
</platformTest>
</ruleList>
</runProgram>
</actionList>
</showProgressDialog>
</postShowPageActionList>
</directoryParameter>
<directoryParameter> <directoryParameter>
<name>installdir</name> <name>installdir</name>
<description>Installer.Parameter.installdir.description</description> <description>Installer.Parameter.installdir.description</description>
......
...@@ -744,28 +744,6 @@ ...@@ -744,28 +744,6 @@
id="org.bonitasoft.studio.views.overview"> id="org.bonitasoft.studio.views.overview">
</excludeSources> </excludeSources>
</extension> </extension>
<extension
id="org.bonitasoft.studio.application.InitializerApplication"
point="org.eclipse.core.runtime.applications">
<application
thread="main"
visible="true">
<run
class="org.bonitasoft.studio.application.BonitaStudioInitializerApplication">
</run>
</application>
</extension>
<extension
id="org.bonitasoft.studio.application.WorkspaceRecovery"
point="org.eclipse.core.runtime.applications">
<application
thread="main"
visible="true">
<run
class="org.bonitasoft.studio.application.RecoverWorkspaceApplication">
</run>
</application>
</extension>
<extension <extension
point="org.eclipse.ui.splashHandlers"> point="org.eclipse.ui.splashHandlers">
<splashHandlerProductBinding <splashHandlerProductBinding
...@@ -934,40 +912,6 @@ ...@@ -934,40 +912,6 @@
toolbarPosition="15"> toolbarPosition="15">
</coolbarItem> </coolbarItem>
</extension> </extension>
<extension
id="org.bonitasoft.studio.initializer"
name="Initializer"
point="org.eclipse.core.runtime.products">
<product
application="org.bonitasoft.studio.application.InitializerApplication"
name="Initializer">
<property
name="rendererFactoryUri"
value="bundleclass://org.bonitasoft.studio.application/org.bonitasoft.studio.application.renderer.NullWorkbenchRendererFactory">
</property>
<property
name="applicationXMI"
value="org.bonitasoft.studio.application/LegacyIDE.e4xmi">
</property>
</product>
</extension>
<extension
id="org.bonitasoft.studio.workspaceRecovery"
name="Workspace Recovery"
point="org.eclipse.core.runtime.products">
<product
application="org.bonitasoft.studio.application.WorkspaceRecovery"
name="WorkspaceRecovery">
<property
name="rendererFactoryUri"
value="bundleclass://org.bonitasoft.studio.application/org.bonitasoft.studio.application.renderer.NullWorkbenchRendererFactory">
</property>
<property
name="applicationXMI"
value="org.bonitasoft.studio.application/LegacyIDE.e4xmi">
</property>
</product>
</extension>
<extension <extension
point="org.eclipse.ui.startup"> point="org.eclipse.ui.startup">
<startup <startup
......
/**
* Copyright (C) 2011 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
* <<<<<<< HEAD
*
* =======
*
* >>>>>>> origin/master
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* <<<<<<< HEAD
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* =======
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* >>>>>>> origin/master
*/
package org.bonitasoft.studio.application;
import org.bonitasoft.studio.application.advisor.InitWorkspaceAdvisor;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.equinox.app.IApplication;
/**
* @author Romain Bioteau
*/
public class BonitaStudioInitializerApplication extends BonitaStudioApplication implements IApplication {
@Override
protected BonitaStudioWorkbenchAdvisor createWorkbenchAdvisor() {
return ContextInjectionFactory.make(InitWorkspaceAdvisor.class, EclipseContextFactory.create());
}
}
/**
* Copyright (C) 2011 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.application;
import java.util.Map;
import org.bonitasoft.studio.application.advisor.RecoverWorkspaceAdvisor;
import org.eclipse.core.runtime.Assert;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.EclipseContextFactory;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
/**
* @author Romain Bioteau
*
*/
public class RecoverWorkspaceApplication extends BonitaStudioApplication implements IApplication {
private String newWorkspaceLocation;
/*
* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
*/
@Override
public Object start(final IApplicationContext context) {
final Map<?,?> argument = context.getArguments() ;
final Object args = argument.get(IApplicationContext.APPLICATION_ARGS) ;
if(args != null && args instanceof String[]){
final String[] arguments =(String[]) args ;
for(int i = 0; i < arguments.length ; i++ ){
if(arguments[i].startsWith("-newWorkspaceLocation")){
newWorkspaceLocation = arguments[i+1] ;
}
}
}
Assert.isLegal(newWorkspaceLocation != null && !newWorkspaceLocation.isEmpty());
return super.start(context);
}
@Override
protected BonitaStudioWorkbenchAdvisor createWorkbenchAdvisor() {
final RecoverWorkspaceAdvisor advisor = ContextInjectionFactory.make(RecoverWorkspaceAdvisor.class, EclipseContextFactory.create());
advisor.setNewWorkspaceLocation(newWorkspaceLocation);
return advisor;
}
/* (non-Javadoc)
* @see org.eclipse.equinox.app.IApplication#stop()
*/
@Override
public void stop() {
// NOTHING TO DO
}
}
/**
* Copyright (C) 2009-2014 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.application.advisor;
import java.io.File;
import java.io.FileFilter;
import org.bonitasoft.studio.common.jface.FileActionDialog;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.Repository;
import org.bonitasoft.studio.common.repository.RepositoryManager;
import org.bonitasoft.studio.common.repository.model.IRepository;
import org.bonitasoft.studio.importer.ImporterRegistry;
import org.bonitasoft.studio.importer.processors.ToProcProcessor;
import org.eclipse.core.resources.ResourcesPlugin;
/**
* @author Romain Bioteau
*/
public class InitWorkspaceAdvisor extends InstallerApplicationWorkbenchAdvisor {
/*
* (non-Javadoc)
* @see org.bonitasoft.studio.application.advisor.InstallerApplicationWorkbenchAdvisor#executePostStartupHandler()
*/
@Override
protected void executePostStartupHandler() {
final File[] repositoryToImport = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile().listFiles(new FileFilter() {
@Override
public boolean accept(final File file) {
return file.getName().endsWith(".bos");
}
});
if (repositoryToImport != null && repositoryToImport.length > 0) {
for (final File workspaceArchive : repositoryToImport) {
final String name = workspaceArchive.getName();
final String repositoryName = name.substring(0, name.lastIndexOf("."));
RepositoryManager.getInstance().setRepository(repositoryName, Repository.NULL_PROGRESS_MONITOR);
final IRepository repository = RepositoryManager.getInstance().getRepository(repositoryName);
if (repository != null) {
try {
FileActionDialog.setDisablePopup(true);
final ToProcProcessor importer = ImporterRegistry.getInstance().createImporterFor(name);
if (importer != null) {
importer.setRepository(repositoryName);
importer.createDiagram(workspaceArchive.toURL(), Repository.NULL_PROGRESS_MONITOR);
}
workspaceArchive.delete();
} catch (final Exception e) {
BonitaStudioLog.error(e);
}
}
}
RepositoryManager.getInstance().setRepository("default", Repository.NULL_PROGRESS_MONITOR);
}
}
}
/**
* Copyright (C) 2009-2011 BonitaSoft S.A.
* BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2.0 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.application.advisor;
import org.bonitasoft.studio.application.BonitaStudioWorkbenchAdvisor;
import org.bonitasoft.studio.common.BonitaHomeUtil;
import org.bonitasoft.studio.common.jface.FileActionDialog;
import org.bonitasoft.studio.common.log.BonitaStudioLog;
import org.bonitasoft.studio.common.repository.core.job.WorkspaceInitializationJob;
import org.bonitasoft.studio.engine.BOSWebServerManager;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspace;