Index: tmp/org.txm.core/src/java/org/txm/objects/Workspace.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Workspace.java	(revision 2008)
+++ tmp/org.txm.core/src/java/org/txm/objects/Workspace.java	(revision 2009)
@@ -36,6 +36,7 @@
 import org.eclipse.core.resources.IWorkspaceRoot;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.osgi.util.NLS;
 import org.txm.Toolbox;
@@ -309,7 +310,11 @@
 			//FIXME: SJ: old version where there is a bug if the name or path are not in same case
 			//Project project = new Project(this, parameters.name, false);
 			//FIXME: SJ: new version that fix the bug but whe may want to not modify the case of the name? 
-			Project project = new Project(this, parameters.name.toUpperCase(), false);
+			Project project = new Project(this, binCorpusDir.getName(), false);
+//			if (!parameters.name.equals(project.getRCPProject().getName())) {
+//				IPath destination = new Path(project.getRCPProject().getParent().getLocation(), parameters.name);
+//				project.getRCPProject().move(destination, true, project);
+//			}
 
 			project._load(parameters);
 
Index: tmp/org.txm.core/src/java/org/txm/objects/EditionDefinition.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/EditionDefinition.java	(revision 2008)
+++ tmp/org.txm.core/src/java/org/txm/objects/EditionDefinition.java	(revision 2009)
@@ -13,12 +13,19 @@
 public class EditionDefinition {
 
 	Preferences node;
-	
 	public EditionDefinition(Project project, String name) {
 		this.node = project.getPreferencesScope().getNode(EditionDefinition.class.getSimpleName()).node(name);
 		setName(name); //TODO use node.name() instead
 		
 	}
+	
+	public void delete() {
+		try {
+			node.removeNode();
+		} catch (BackingStoreException e) {
+			e.printStackTrace();
+		}
+	}
 
 	public String getName() {
 		return node.get(TBXPreferences.NAME, null);
Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 2008)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 2009)
@@ -1144,6 +1144,22 @@
 		return new EditionDefinition(this, name);
 	}
 	
+	public ArrayList<EditionDefinition> getEditionDefinitions() {
+		ArrayList<EditionDefinition> editions = new ArrayList<EditionDefinition>();
+		IEclipsePreferences editionNode = this.getPreferencesScope().getNode(EditionDefinition.class.getSimpleName());
+		try {
+			for (String editionName : editionNode.childrenNames()) {
+				if (this.hasEditionDefinition(editionName)) {
+					editions.add(getEditionDefinition(editionName));
+				}
+			}
+		} catch (BackingStoreException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		return editions;
+	}
+	
 	public CorpusCommandPreferences getCommandPreferences(String name) {
 		return new CorpusCommandPreferences(this, name);
 	}
Index: tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 2008)
+++ tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java	(revision 2009)
@@ -228,8 +228,8 @@
 	 * @throws MalformedURLException
 	 * @throws IOException
 	 */
-	public static InputStream getInput(File manifest) throws MalformedURLException, IOException {
-		return manifest.toURI().toURL().openStream();
+	public static InputStream getInput(File file) throws MalformedURLException, IOException {
+		return file.toURI().toURL().openStream();
 	}
 
 	public static OutputStream getOutputStream(File file) throws FileNotFoundException {
Index: tmp/org.txm.utils/src/org/txm/utils/Download.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/Download.java	(revision 0)
+++ tmp/org.txm.utils/src/org/txm/utils/Download.java	(revision 2009)
@@ -0,0 +1,16 @@
+package org.txm.utils;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URL;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
+
+public class Download {
+	public static long download(URL source, File output) throws IOException {
+		ReadableByteChannel rbc = Channels.newChannel(source.openStream());
+		FileOutputStream fos = new FileOutputStream(output);
+		return fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+	}
+}
\ No newline at end of file

Property changes on: tmp/org.txm.utils/src/org/txm/utils/Download.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java
===================================================================
--- tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java	(revision 2008)
+++ tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java	(revision 2009)
@@ -148,7 +148,7 @@
 //			}
 //		});
 		HashSet<String> defaultPlugins = new HashSet<String>();
-		getDependancies("org.txm.rcp", defaultPlugins);
+		//getDependancies("org.txm.rcp", defaultPlugins);
 		
 		for (Bundle b : bundles) {
 			if (b == null) continue;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZPager.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZPager.groovy	(revision 2008)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZPager.groovy	(revision 2009)
@@ -53,6 +53,13 @@
 
 		if (!doDefaultEditionStep()) return;
 		if (!doFacsEditionStep()) return;
+		
+		// remove extra XSL editions -> they will be recreated by the doPostEditionXSLStep call 
+		for (EditionDefinition eDef : project.getEditionDefinitions()) {
+			if (eDef.getName() != "facs" || eDef.getName() != "default") {
+				eDef.delete();
+			}
+		}
 		if (!doPostEditionXSLStep()) return;
 
 		isSuccessFul = true;
@@ -115,11 +122,11 @@
 				}
 				edition.setName("default");
 				edition.setIndex(outputDirectory.getAbsolutePath());
-
+				
 				for (i = 0 ; i < ed.getPageFiles().size();) {
 					File f = ed.getPageFiles().get(i);
 					String wordid = "w_0";
-				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
+					if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 					edition.addPage(""+(++i), wordid);
 				}
 			} catch(Exception e) {
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy	(revision 2008)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy	(revision 2009)
@@ -300,6 +300,7 @@
 				return false;
 			}
 
+			println "DEBUG: start parsing"
 			for (int event = parser.next(); event != XMLStreamConstants.END_DOCUMENT; event = parser.next()) {
 				rend = "";
 				switch (event) {
Index: tmp/TXMReleasePlugins.site/site.xml
===================================================================
--- tmp/TXMReleasePlugins.site/site.xml	(revision 2008)
+++ tmp/TXMReleasePlugins.site/site.xml	(revision 2009)
@@ -3,22 +3,22 @@
    <description name="TXM Extensions - RELEASE" url="http://txm.textometrie.org/updates/plugins">
       This update site contains the Release plugins for TXM
    </description>
-   <feature url="features/org.txm.backtomedia.feature_1.0.0.1906.jar" id="org.txm.backtomedia.feature" version="1.0.0.1906">
+   <feature url="features/org.txm.backtomedia.feature_1.0.0.1978.jar" id="org.txm.backtomedia.feature" version="1.0.0.1978">
       <category name="Commands"/>
    </feature>
-   <feature url="features/org.txm.wordcloud.feature_1.0.0.1906.jar" id="org.txm.wordcloud.feature" version="1.0.0.1906">
+   <feature url="features/org.txm.wordcloud.feature_1.0.0.1978.jar" id="org.txm.wordcloud.feature" version="1.0.0.1978">
       <category name="Commands"/>
    </feature>
-   <feature url="features/org.txm.treetagger.binaries.feature_1.0.0.1906.jar" id="org.txm.treetagger.binaries.feature" version="1.0.0.1906" os="" ws="">
+   <feature url="features/org.txm.treetagger.binaries.feature_1.0.0.1978.jar" id="org.txm.treetagger.binaries.feature" version="1.0.0.1978" os="" ws="">
       <category name="Annotation"/>
    </feature>
-   <feature url="features/org.txm.treetagger.models.feature_1.0.0.1906.jar" id="org.txm.treetagger.models.feature" version="1.0.0.1906">
+   <feature url="features/org.txm.treetagger.models.feature_1.0.0.1978.jar" id="org.txm.treetagger.models.feature" version="1.0.0.1978">
       <category name="Annotation"/>
    </feature>
-   <feature url="features/org.txm.annotation.urs.feature_1.0.0.1906.jar" id="org.txm.annotation.urs.feature" version="1.0.0.1906">
+   <feature url="features/org.txm.annotation.urs.feature_1.0.0.1978.jar" id="org.txm.annotation.urs.feature" version="1.0.0.1978">
       <category name="Annotation"/>
    </feature>
-   <feature url="features/org.txm.tigersearch.feature_1.0.0.1906.jar" id="org.txm.tigersearch.feature" version="1.0.0.1906">
+   <feature url="features/org.txm.tigersearch.feature_1.0.0.1978.jar" id="org.txm.tigersearch.feature" version="1.0.0.1978">
       <category name="Annotation"/>
    </feature>
    <category-def name="Commands" label="Commands">
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/ImportWizard.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/ImportWizard.java	(revision 2008)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/ImportWizard.java	(revision 2009)
@@ -65,7 +65,7 @@
 						project = p;
 					}
 				}
-				boolean newProject = project == null;
+				boolean newProject = (project == null);
 				if (newProject) { // it's a new project configuration
 					project = Toolbox.workspace.getProject(name);
 					if (project == null) {
@@ -103,12 +103,12 @@
 					Log.info(NLS.bind(TXMUIMessages.theP1P0CorpusWillBeReplaced, project, date));
 				}
 				
-				if (!project.hasEditionDefinition("default")) {
-					EditionDefinition def = project.getEditionDefinition("default");
-					def.setBuildEdition(true);
-					def.setWordsPerPage(500);
-					def.setPageBreakTag("pb");
-				}
+//				if (!project.hasEditionDefinition("default")) {
+//					EditionDefinition def = project.getEditionDefinition("default");
+//					def.setBuildEdition(true);
+//					def.setWordsPerPage(500);
+//					def.setPageBreakTag("pb");
+//				}
 				
 				project.setDoUpdate(false);
 				project.saveParameters();
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/ComputeTXMResult.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/ComputeTXMResult.java	(revision 2008)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/ComputeTXMResult.java	(revision 2009)
@@ -3,6 +3,7 @@
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IEditorPart;
 import org.eclipse.ui.IWorkbenchPart;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.rcp.editors.TXMEditor;
@@ -20,7 +21,9 @@
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		IWorkbenchPart part = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
-		
+		IEditorPart activeEditor = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActiveEditor();
+		System.out.println("A part="+part);
+		System.out.println("A editor="+activeEditor);
 		// gets the main editor if the active editor is a multipages editor
 		if(part instanceof TXMMultiPageEditor)	{
 			part = (IWorkbenchPart) ((TXMMultiPageEditor)part).getEditors().get(0);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java	(revision 2008)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java	(revision 2009)
@@ -31,6 +31,7 @@
 import java.net.MalformedURLException;
 import java.net.URL;
 
+import org.apache.commons.io.FileUtils;
 import org.eclipse.core.commands.AbstractHandler;
 import org.eclipse.core.commands.ExecutionEvent;
 import org.eclipse.core.commands.ExecutionException;
@@ -58,6 +59,7 @@
 import org.txm.searchengine.core.SearchEnginesManager;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.utils.DeleteDir;
+import org.txm.utils.Download;
 import org.txm.utils.io.FileCopy;
 import org.txm.utils.logger.Log;
 import org.txm.utils.zip.Zip;
@@ -94,14 +96,17 @@
 					URL u = new URL(url);
 					File f = new File(url);
 					File corpora = Toolbox.workspace.getLocation();
-					if (DownloadFile.download(u, corpora)) {
-						zipFile = new File(corpora, f.getName());
-					} else {
-						System.out.println("** Error: could not download corpus at "+url);
-					}
-				} catch (MalformedURLException e) {
+					zipFile = new File(corpora, f.getName());
+					System.out.println("BEF ? "+zipFile.exists());
+					zipFile.delete();
+					System.out.println("DEL ? "+zipFile.exists());
+					FileUtils.copyURLToFile(u, zipFile);
+					System.out.println(zipFile.getAbsolutePath());
+					System.out.println("OK ? "+zipFile.exists());
+				} catch (Exception e) {
 					// TODO Auto-generated catch block
 					e.printStackTrace();
+					return null;
 				}
 			}
 		} else {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/DownloadCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/DownloadCorpus.java	(revision 0)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/DownloadCorpus.java	(revision 2009)
@@ -0,0 +1,50 @@
+package org.txm.rcp.commands.workspace;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.txm.Toolbox;
+import org.txm.objects.Project;
+import org.txm.rcp.utils.JobHandler;
+import org.txm.utils.Download;
+
+public class DownloadCorpus extends AbstractHandler {
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		String key = event
+				.getParameter("org.txm.rcp.commands.commandParameter3"); //$NON-NLS-1$
+		if (key != null && key.trim().length() > 0) {
+			try {
+				return downloadAndLoad(key);
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		return null;
+	}
+
+	public static Project downloadAndLoad(String urlString) throws InterruptedException, ExecutionException, IOException {
+		URL url = new URL(urlString);
+		File binFile = new File(Toolbox.getTxmHomePath(), "results/"+new File(url.getFile()).getName());
+		if (!binFile.getName().endsWith(".txm")) {
+			System.out.println("The downloaded file is not a TXM corpus.");
+			return null;
+		}
+		Download.download(url, binFile);
+		JobHandler job = LoadBinaryCorpus.loadBinaryCorpusArchive(binFile);
+		job.join();
+		Object r = job.getResultObject();
+		if (r != null && r instanceof Project) {
+			return (Project)r;
+		}
+		
+		return null;
+	}
+}

Property changes on: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/DownloadCorpus.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java	(revision 2008)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java	(revision 2009)
@@ -37,6 +37,8 @@
 	Button buildFacsEditionCheckButton;
 	Text imageDirectoryText;
 
+	private Text defaultEditions;
+
 	/**
 	 * 
 	 * @param toolkit2
@@ -146,6 +148,17 @@
 				});
 			}
 		}
+		
+		if (scriptName.startsWith("xtz")) {
+			
+			tmpLabel = toolkit.createLabel(sectionClient, "Default edition: ");
+			tmpLabel.setLayoutData(getLabelGridData());
+			
+			defaultEditions = toolkit.createText(sectionClient, "", SWT.BORDER);
+			TableWrapData gdata = getTextGridData();
+			gdata.colspan = 2;
+			defaultEditions.setLayoutData(gdata);
+		}
 
 		//// First draft of interface to add editions to a corpus
 		//		Button addButton = toolkit.createButton(sectionClient, Messages.CorpusPage_1, SWT.PUSH);
@@ -217,8 +230,11 @@
 		if (this.section.isDisposed()) return;
 		if (project == null) return;
 
-		EditionDefinition edition_params = project.getEditionDefinition("default");
-		if (edition_params != null) {
+		buildEditionCheckButton.setSelection(!project.hasEditionDefinition("default"));
+		
+		if (project.hasEditionDefinition("default")) {
+
+			EditionDefinition edition_params = project.getEditionDefinition("default");
 			boolean be = edition_params.getBuildEdition();
 			buildEditionCheckButton.setSelection(be);
 
@@ -230,7 +246,7 @@
 				pageBreakText.setText(pbt);	
 		}
 
-		edition_params = project.getEditionDefinition("facs");
+		EditionDefinition edition_params = project.getEditionDefinition("facs");
 		boolean bfe = edition_params.getBuildEdition();
 		if (buildFacsEditionCheckButton != null && edition_params != null) {
 			buildFacsEditionCheckButton.setSelection(bfe);
@@ -240,6 +256,11 @@
 			if (imageDirectoryText != null && imageDirectory != null)
 				imageDirectoryText.setText(imageDirectory);
 		}
+		
+		String defaults = project.getDefaultEditionName();
+		if (defaults != null && defaults.length() > 0 && defaultEditions != null) {
+			defaultEditions.setText(defaults);
+		}
 	}
 
 	@Override
@@ -275,6 +296,13 @@
 				edition_params2.setBuildEdition(build);
 				edition_params2.setImagesDirectory(images_directory);
 			}
+			
+			if (defaultEditions != null) {
+				String defaults = defaultEditions.getText();
+				if (defaults != null && defaults.length() > 0) {
+					project.setDefaultEditionName(defaults);
+				}
+			}
 		}
 		return true;
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 2008)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMEditor.java	(revision 2009)
@@ -61,10 +61,12 @@
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMResult;
+import org.txm.rcp.IImageKeys;
 import org.txm.rcp.JobsTimer;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.TXMWindows;
 import org.txm.rcp.editors.listeners.BaseAbstractComputeListener;
+import org.txm.rcp.editors.listeners.ComputeSelectionListener;
 import org.txm.rcp.handlers.BaseAbstractHandler;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.preferences.RCPPreferences;
@@ -390,8 +392,10 @@
 			this.topToolBar = new TXMEditorToolBar(this, this.firstLineComposite, this.extendedParametersComposite, SWT.FLAT | SWT.RIGHT, TOP_TOOLBAR_ID);
 
 			// store the Compute button to access if later, especially from subclasses
-			this.computeButton = this.topToolBar.getItemByContributionId(TOP_TOOLBAR_COMPUTE_BUTTON_ID);
-
+			this.computeButton = new ToolItem(topToolBar, SWT.PUSH);//.topToolBar.getItemByContributionId(TOP_TOOLBAR_COMPUTE_BUTTON_ID);
+			this.computeButton.setImage(IImageKeys.getImage(IImageKeys.START));
+			this.computeButton.addSelectionListener(new ComputeSelectionListener(this, true));
+			
 			// computing parameters components
 			boolean showExtendedParameters = false;
 			// only show the area if the result can not compute and is dirty
@@ -422,10 +426,8 @@
 				this.bottomSubWidgetsComposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false));
 			}
 
-
 			this.bottomToolBar = new TXMEditorToolBar(this, this.bottomToolBarContainer, this.bottomSubWidgetsComposite, SWT.FLAT, "bottom"); //$NON-NLS-1$
 
-
 			this.notifyExtensions("notifyStartOfCreatePartControl"); //$NON-NLS-1$
 			this._createPartControl(); // child editor creates its parameters and displays widgets
 			this.notifyExtensions("notifyEndOfCreatePartControl"); //$NON-NLS-1$
Index: tmp/org.txm.rcp/plugin.xml
===================================================================
--- tmp/org.txm.rcp/plugin.xml	(revision 2008)
+++ tmp/org.txm.rcp/plugin.xml	(revision 2009)
@@ -1209,6 +1209,16 @@
                </parameter>
             </command>
             <command
+                  commandId="org.txm.rcp.commands.workspace.LoadBinaryCorpus"
+                  label="VOEUX"
+                  style="push"
+                  tooltip="Download and load the VOEUX corpus">
+               <parameter
+                     name="url"
+                     value="http://textometrie.ens-lyon.fr/files/corpora/voeux/voeux-bin.txm">
+               </parameter>
+            </command>
+            <command
                   commandId="org.txm.rcp.commands.OpenLocalizedWebPage"
                   label="%command.label.70"
                   style="push">
@@ -2279,13 +2289,6 @@
       <menuContribution
             allPopups="true"
             locationURI="toolbar:TXMEditorTopToolBar">
-         <command
-               commandId="org.txm.rcp.handlers.ComputeTXMResult"
-               icon="icons/functions/run.png"
-               id="compute"
-               label="%command.label.36"
-               style="push">
-         </command>
       </menuContribution>
       <menuContribution
             allPopups="false"
