Commit 5c7e606d authored by Romain Bioteau's avatar Romain Bioteau

fix issue with worksapce api

parent e3c89445
......@@ -134,7 +134,7 @@ public class UIDesignerServerManager implements IBonitaProjectListener {
waitForUID(pageDesignerURLBuilder);
BonitaStudioLog.info(String.format("UI Designer has been started on http://localhost:%s/bonita", port),
UIDesignerPlugin.PLUGIN_ID);
new MigrateUIDOperation().run(monitor);
new MigrateUIDOperation(pageDesignerURLBuilder).run(monitor);
} catch (final CoreException | IOException | InvocationTargetException | InterruptedException e) {
BonitaStudioLog.error("Failed to run ui designer war", e);
} finally {
......
......@@ -16,6 +16,7 @@ package org.bonitasoft.studio.designer.core.repository;
import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import org.bonitasoft.studio.designer.core.PageDesignerURLFactory;
......@@ -34,18 +35,36 @@ import org.restlet.resource.ResourceException;
public class MigrateUIDOperation implements IRunnableWithProgress {
private PageDesignerURLFactory pageDesignerURLBuilder;
public MigrateUIDOperation(PageDesignerURLFactory pageDesignerURLBuilder) {
this.pageDesignerURLBuilder = pageDesignerURLBuilder;
}
public MigrateUIDOperation() {
}
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.subTask(Messages.migratingUID);
PageDesignerURLFactory urlBuilder = pageDesignerURLBuilder == null
? new PageDesignerURLFactory(getPreferenceStore()) : pageDesignerURLBuilder;
URI uri = null;
try {
uri = urlBuilder.migrate().toURI();
} catch (MalformedURLException | URISyntaxException e1) {
throw new InvocationTargetException(new MigrationException(e1));
}
try {
ClientResource clientResource = new ClientResource(
new PageDesignerURLFactory(getPreferenceStore()).migrate().toURI());
ClientResource clientResource = new ClientResource(uri);
clientResource.setRetryOnError(true);
clientResource.setRetryDelay(500);
clientResource.setRetryAttempts(10);
clientResource.post(new EmptyRepresentation());
} catch (MalformedURLException | URISyntaxException | ResourceException e) {
throw new InvocationTargetException(new MigrationException(e));
} catch (ResourceException e) {
throw new InvocationTargetException(new MigrationException(e),
"Failed to post on " + uri);
}
}
......
......@@ -119,7 +119,7 @@ public abstract class AbstractGroovyScriptConfigurationSynchronizer implements I
FragmentContainer container = getContainer(configuration);
for (Fragment f : container.getFragments()) {
IResource member = srcFolder.findMember(Path.fromOSString(f.getValue()));
if (!member.exists()) {
if (member == null || !member.exists()) {
cc.append(RemoveCommand.create(editingDomain, container,
ConfigurationPackage.Literals.FRAGMENT_CONTAINER__FRAGMENTS, f));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment