Commit 15be455c authored by Romain Bioteau's avatar Romain Bioteau Committed by Romain Bioteau
Browse files

BS-14324

Export related resources when exporting a repository
(not only based on canBeExported)
parent 96e6cac2
......@@ -502,6 +502,7 @@ public class Repository implements IRepository, IJavaContainer {
final Set<IResource> allResources = new HashSet<IResource>();
for (final IRepositoryStore<?> store : getAllExportableStores()) {
allResources.add(store.getResource());
allResources.addAll(allRelatedResources(store));
}
operation.setResources(allResources);
final IStatus status = operation.run(NULL_PROGRESS_MONITOR);
......@@ -510,6 +511,16 @@ public class Repository implements IRepository, IJavaContainer {
}
}
private List<IResource> allRelatedResources(final IRepositoryStore<?> store) {
final List<IResource> relatedResources = new ArrayList<IResource>();
for (final IRepositoryFileStore fs : store.getChildren()) {
for (final IRepositoryFileStore related : fs.getRelatedFileStore()) {
relatedResources.add(related.getResource());
}
}
return relatedResources;
}
protected void logErrorStatus(final IStatus status) {
final StringBuilder sb = new StringBuilder();
if (status.isMultiStatus()) {
......
/**
* Copyright (C) 2012-2015 Bonitasoft S.A.
* Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble
* Copyright (C) 2012 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
......@@ -13,7 +13,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.bonitasoft.studio.diagram.custom.repository;
import java.io.File;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
......@@ -51,7 +52,6 @@ import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.swt.graphics.Image;
/**
* @author Romain Bioteau
*/
......@@ -76,7 +76,7 @@ public class ProcessConfigurationRepositoryStore extends AbstractEMFRepositorySt
@Override
public boolean canBeExported() {
return true;
return false;
}
@Override
......
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