Index: tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/UpdateCorpusImagePaths.java
===================================================================
--- tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/UpdateCorpusImagePaths.java	(revision 1037)
+++ tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/UpdateCorpusImagePaths.java	(revision 1038)
@@ -15,7 +15,7 @@
 	
 	public boolean process(MainCorpus corpus, String newpathprefix) throws CqiClientException, IOException, CqiServerError, XMLStreamException {
 
-		File binDir = corpus.getBaseDirectory();
+		File binDir = corpus.getProjectDirectory();
 		File htmlDir = new File(binDir, "HTML");
 		if (!htmlDir.exists()) {
 			System.out.println("Error: no html directory: "+htmlDir);
Index: tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java
===================================================================
--- tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java	(revision 1037)
+++ tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java	(revision 1038)
@@ -35,7 +35,7 @@
 	 * @return
 	 */
 	public static HashMap<String, Object> getInitialisationProperties(Class clazz, MainCorpus corpus) {
-		String path = corpus.getBaseDirectory().getAbsolutePath()+"/temporary_annotations/db";
+		String path = corpus.getProjectDirectory().getAbsolutePath()+"/temporary_annotations/db";
 		
 		HashMap<String, Object> properties = new HashMap<String, Object>();
 		//System.out.println("CLASSLOADER: "+Toolbox.class.getClassLoader());
Index: tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/KRAnnotationEngine.java
===================================================================
--- tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/KRAnnotationEngine.java	(revision 1037)
+++ tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/KRAnnotationEngine.java	(revision 1038)
@@ -10,7 +10,7 @@
 import org.txm.annotation.kr.core.repository.KnowledgeRepository;
 import org.txm.annotation.kr.core.repository.KnowledgeRepositoryManager;
 import org.txm.annotation.kr.core.repository.SQLKnowledgeRepository;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.objects.BaseParameters;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
@@ -210,9 +210,9 @@
 	 */
 	public static List<String> getKnowledgeRepositoryNames(Corpus corpus) {
 		if (corpus == null) return new ArrayList<String>();
-		Base base = corpus.getBase();
+		Project base = corpus.getProject();
 		if (base == null) return new ArrayList<String>();
-		BaseParameters params = base.getBaseParameters();
+		BaseParameters params = base.getProjectParameters();
 		return getKnowledgeRepositoryNames(params);
 	}
 	
Index: tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepositoryManager.java
===================================================================
--- tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepositoryManager.java	(revision 1037)
+++ tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepositoryManager.java	(revision 1038)
@@ -154,7 +154,7 @@
 			}
 		}
 
-		BaseParameters bp = corpus.getBase().getBaseParameters();
+		BaseParameters bp = corpus.getProject().getProjectParameters();
 		Element krCorpusElement = KRAnnotationEngine.getKnowledgeRepositoryElement(bp, name);
 		if (krCorpusElement == null) krCorpusElement = KRAnnotationEngine.createKnowledgeRepositoryElement(bp, name);
 		String sKRCorpusVersion = krCorpusElement.getAttribute("version");
Index: tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/conversion/CorpusRuledConvertion.java
===================================================================
--- tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/conversion/CorpusRuledConvertion.java	(revision 1037)
+++ tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/conversion/CorpusRuledConvertion.java	(revision 1038)
@@ -50,7 +50,7 @@
 	}
 
 	public boolean process(MainCorpus corpus) throws XMLStreamException, IOException {
-		File binaryCorpusDirectory = corpus.getBaseDirectory();
+		File binaryCorpusDirectory = corpus.getProjectDirectory();
 		File txmDirectory = new File(binaryCorpusDirectory, "txm");
 		if (!txmDirectory.exists()) {
 			System.out.println("'txm' directory not found in "+binaryCorpusDirectory.getAbsolutePath());
Index: tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java
===================================================================
--- tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java	(revision 1037)
+++ tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java	(revision 1038)
@@ -98,7 +98,7 @@
 			return false;
 		}
 		
-		File inputDirectory = corpus.getBaseDirectory();
+		File inputDirectory = corpus.getProjectDirectory();
 		File corpusTxmDirectory = new File(inputDirectory, "txm/"+corpus.getName());
 		
 		System.out.println("Writing annotations XML files in "+resultDirectory);
@@ -140,7 +140,7 @@
 		int[] start_limits = corpus.getTextStartLimits();
 		List<String> textsIds = corpus.getTextsID();
 
-		File inputDirectory = corpus.getBaseDirectory();
+		File inputDirectory = corpus.getProjectDirectory();
 		File txmDirectory = new File(inputDirectory, "txm/"+corpus.getName());
 
 		ArrayList<Annotation> textAnnotations = new ArrayList<Annotation>();
Index: tmp/org.txm.core/src/java/org/txm/Toolbox.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/Toolbox.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/Toolbox.java	(revision 1038)
@@ -587,7 +587,7 @@
 			return false;
 		}
 
-		File workspaceFile = new File(txmhomedir, "workspaces/default.xml");
+		File workspaceFile = new File(txmhomedir, "corpora/default.xml");
 		Version currentVersion = BundleUtils.getBundleVersion("org.txm.core");
 		Log.info("Current toolbox version: " + currentVersion + ".");
 		String installedVersionString = getPreference(TBXPreferences.VERSION);
@@ -638,7 +638,7 @@
 			Log.info(TXMCoreMessages.Toolbox_12 + workspaceFile); 
 			state = true;
 
-			if (workspace == null || workspace.getProject("default") == null) { //$NON-NLS-1$
+			if (workspace == null) { //$NON-NLS-1$
 				Log.severe(TXMCoreMessages.Toolbox_14 + workspaceFile); 
 				state = false;
 				//System.out.println(TXMCoreMessages.FAILED);
Index: tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java	(revision 1038)
@@ -86,7 +86,7 @@
 		
 //		//FIXME: USE osgi.instance.area later & done in ApplicationWorkbenchAdvisor
 //		preferences.put(TBXPreferences.USER_TXM_HOME, System.getProperty("user.home")+"/TXM");
-		preferences.put(TBXPreferences.USER_TXM_HOME, System.getProperty("user.home")); //$NON-NLS-1$
+	//	preferences.put(TBXPreferences.USER_TXM_HOME, System.getProperty("user.home")); //$NON-NLS-1$
 		
 		preferences.putBoolean(TBXPreferences.EXPERT_USER, false); //$NON-NLS-1$
 		
Index: tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 1038)
@@ -22,7 +22,7 @@
 import org.txm.Toolbox;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.utils.logger.Log;
 
 // FIXME: At this moment, an empty list is created for children, to not return
@@ -1283,10 +1283,10 @@
 	 * @param type
 	 * @return null if the TXMResult is not attached to a BinaryCorpus
 	 */
-	synchronized public Base getBinaryCorpus() {
-		Object o = getFirstParent(Base.class);
+	synchronized public Project getBinaryCorpus() {
+		Object o = getFirstParent(Project.class);
 		if (o != null) {
-			return (Base)o;
+			return (Project)o;
 		} else {
 			return null;
 		}
Index: tmp/org.txm.core/src/java/org/txm/objects/Base.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Base.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/Base.java	(revision 1038)
@@ -1,365 +0,0 @@
-// Copyright © 2010-2013 ENS de Lyon.
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform 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 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform 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 the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-// 
-// 
-// 
-// $LastChangedDate: 2017-01-24 18:11:42 +0100 (Tue, 24 Jan 2017) $
-// $LastChangedRevision: 3400 $
-// $LastChangedBy: mdecorde $ 
-//
-package org.txm.objects;
-
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.HashMap;
-
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.txm.core.messages.TXMCoreMessages;
-import org.txm.core.results.TXMResult;
-import org.txm.utils.logger.Log;
-import org.txm.utils.zip.Zip;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class Base.
- */
-public class Base extends TxmObject {
-
-	/** The Constant serialVersionUID. */
-	private static final long serialVersionUID = -4798832481060407512L;
-
-	/** The project. */
-	Project project;
-	BaseParameters params;
-
-	private HashMap<String, Alignement> links = new HashMap<String, Alignement>();
-
-//	private BasePreferenceScope scope;
-	
-	public String toString() { return params.name;};
-	
-	/**
-	 * Instantiates a new base.
-	 *
-	 * @param project the project
-	 * @param parameters the b
-	 */
-	public Base(Project project, BaseParameters parameters) {
-		super(project);
-		this.setPath(project.getPath() + getName());
-		params = parameters;
-		setSelfElement(params.root);
-		this.project = project;
-		//load();
-		this.name = params.name;
-		if (!name.equals(name.toUpperCase())) {
-			System.out.println("Warning in Base.init: binary corpus name contains lower case letters: "+this.name);
-		}
-		
-//		this.scope = new BasePreferenceScope(this);
-	}
-	
-//	public BasePreferenceScope getPreferenceScope() {
-//		return scope;
-//	}
-
-	/**
-	 * Gets the project.
-	 *
-	 * @return the project
-	 */
-	public Project getProject() {
-		return this.project;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.txm.objects.TxmObject#save()
-	 */
-	@Override
-	protected boolean _save() {
-		//System.out.println("SAVE BASE: "+params.root+" "+params.paramFile);
-		try {
-			// Création de la source DOM
-			Source source = new DOMSource(params.root);
-
-			// Création du fichier de sortie
-			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(params.paramFile), "UTF-8")); //$NON-NLS-1$
-			Result resultat = new StreamResult(writer);
-
-			// Configuration du transformer
-			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
-			Transformer transformer = fabrique.newTransformer();
-			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
-			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
-			
-			// Transformation
-			transformer.transform(source, resultat);
-			writer.close();
-		} catch (Exception e) {
-			e.printStackTrace();
-			Log.severe("Error while saving corpus parameters: "+e.getLocalizedMessage());
-			return false;
-		}
-		return true;
-	}
-
-
-	/* (non-Javadoc)
-	 * @see org.txm.objects.TxmObject#load()
-	 */
-	@Override
-	protected boolean _load() {
-
-		loadMetadata(); // read the prop tags
-
-		// get Alignements
-		//System.out.println("Load alignement from params: "+params.links);
-		for (String alignname : params.links.keySet()) {
-			Element link = params.links.get(alignname);
-
-			String target = link.getAttribute("target"); //$NON-NLS-1$
-			String[] split = target.split("#"); //$NON-NLS-1$
-			if (split.length != 3) {
-				System.out.println(TXMCoreMessages.Base_6+target);
-				continue;
-			}
-			String from = split[1].trim();
-			String to = split[2].trim();
-
-			Alignement align = new Alignement(this, from, to, 
-					link.getAttribute("alignElement"), Integer.parseInt(link.getAttribute("alignLevel"))); //$NON-NLS-1$ //$NON-NLS-2$
-			links.put("#"+from+" #"+to, align); //$NON-NLS-1$ //$NON-NLS-2$
-
-			align = new Alignement(this, to, from, 
-					link.getAttribute("alignElement"), Integer.parseInt(link.getAttribute("alignLevel"))); //$NON-NLS-1$ //$NON-NLS-2$
-			links.put("#"+to+" #"+from, align); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		return true;
-	}
-
-//	/* (non-Javadoc)
-//	 * @see org.txm.objects.TxmObject#getChildren()
-//	 */
-//	@Override
-//	public List<TxmObject> getChildren() {
-//		List<TxmObject> rez = new ArrayList<TxmObject>();
-//		rez.addAll(corpora.values());
-//		return rez;
-//	}
-
-//	/* (non-Javadoc)
-//	 * @see org.txm.objects.TxmObject#removeChildren(org.txm.objects.TxmObject)
-//	 */
-//	public TxmObject removeChildren(TxmObject o) {
-//		if (o == null)
-//			return null;
-////		if (o instanceof MainCorpus) {
-////			params.corporaElement.removeChild(o.selfElement);
-////			params.corpora.remove(o.getName());
-////			//corpus.deleteFromCWB() already called
-////			Toolbox.workspace.save();
-////			return o;
-////		}
-//
-//		return null;
-//	}
-
-//	/**
-//	 * Removes the script.
-//	 *
-//	 * @param name the name
-//	 * @return the script
-//	 */
-//	public MainCorpus removeCorpus(String name) {
-//		MainCorpus corpus = corpora.get(name);
-//		if (corpus != null) {
-//			params.corporaElement.removeChild(corpus.selfElement);
-//			params.corpora.remove(name);
-//		}
-//		return corpus;
-//	}
-
-//	/* (non-Javadoc)
-//	 * @see org.txm.objects.TxmObject#hasChildren(org.txm.objects.TxmObject)
-//	 */
-//	public boolean hasChildren(TxmObject o) {
-//		if (o == null)
-//			return false;
-//		if (o instanceof MainCorpus)
-//			return params.corpora.values().contains(o);
-//		return false;
-//	}
-
-	/* (non-Javadoc)
-	 * @see org.txm.objects.TxmObject#getParent()
-	 */
-	@Override
-	public TxmObject getParent() {
-		return getProject();
-	}
-
-	/**
-	 * Register maincorpus.
-	 *
-	 * @param corpusName the corpus name
-	 */
-	public Element registerMaincorpus(String corpusName) {
-		Document doc = getSelfElement().getOwnerDocument();
-		Element maincorpus = doc.createElement("corpus"); //$NON-NLS-1$
-		maincorpus.setAttribute("name", corpusName); //$NON-NLS-1$
-		if (getSelfElement().getElementsByTagName("corpora").getLength() == 0) { //$NON-NLS-1$
-			Log.severe(TXMCoreMessages.Base_22);
-			return null;
-		}
-		Element corporaElem = (Element) getSelfElement().getElementsByTagName("corpora").item(0); //$NON-NLS-1$
-		corporaElem.appendChild(maincorpus); // append maincorpus
-		return maincorpus;
-	}
-
-//	/**
-//	 * Gets the corpus.
-//	 *
-//	 * @param name the name
-//	 * @return the corpus
-//	 */
-//	public MainCorpus getCorpus(String name) {
-//		return corpora.get(name);
-//	}
-//
-//	/**
-//	 * Gets the corpora.
-//	 *
-//	 * @return the corpora
-//	 */
-//	public HashMap<String, MainCorpus> getCorpora() {
-//		return corpora;
-//	}
-
-	public boolean export(File exportzip) {
-		return export(exportzip, null);
-	}
-	
-	/**
-	 * Export.
-	 *
-	 * @param exportzip the exportzip
-	 * @return true, if successful
-	 */
-	public boolean export(File exportzip, IProgressMonitor monitor) {
-		File binarydir = this.params.paramFile.getParentFile();
-
-		if (binarydir.exists() && exportzip.getParentFile().exists()) {
-			try {
-				Zip.compress(binarydir, exportzip, monitor);
-			} catch (IOException e) {
-				org.txm.utils.logger.Log.printStackTrace(e);
-				return false;
-			}
-			return true;
-		} else {
-			System.out.println(TXMCoreMessages.Base_0+binarydir+TXMCoreMessages.Base_3);
-			System.out.println(TXMCoreMessages.Base_4+exportzip.getParentFile()+TXMCoreMessages.Base_5);
-
-		}
-		return false;
-	}
-
-	/**
-	 * Gets the base directory.
-	 *
-	 * @return the base directory
-	 */
-	public File getBaseDirectory()
-	{
-		return this.params.paramFile.getParentFile();
-	}
-
-	public HashMap<String, Alignement> getLinks()
-	{
-		return links;
-	}
-
-	public ArrayList<Alignement> getLinksFrom(String from)
-	{
-		ArrayList<Alignement> rez = new ArrayList<Alignement>();
-		for(String key : links.keySet())
-			if(key.startsWith("#"+from+" ")) //$NON-NLS-1$ //$NON-NLS-2$
-				rez.add(links.get(key));
-		return rez;
-	}
-
-	public ArrayList<Alignement> getLinksTo(String to)
-	{
-		ArrayList<Alignement> rez = new ArrayList<Alignement>();
-		for(String key : links.keySet())
-			if(key.endsWith(" #"+to)) //$NON-NLS-1$
-				rez.add(links.get(key));
-		return rez;
-	}
-
-	public Alignement getLink(String from, String to)
-	{
-		return links.get("#"+from+" #"+to ); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/**
-	 * Gets the author.
-	 *
-	 * @return the author
-	 */
-	public String getAuthor() {
-		return params.author;
-	}
-
-	/**
-	 * Gets the description.
-	 *
-	 * @return the description
-	 */
-	public String getDescription() {
-		return params.description;
-	}
-	
-	public void setDescription(String newDescription) {
-		params.description = newDescription;
-	}
-
-	public BaseParameters getBaseParameters() {
-		return params;
-	}
-}
Index: tmp/org.txm.core/src/java/org/txm/objects/Alignement.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Alignement.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/Alignement.java	(revision 1038)
@@ -16,7 +16,7 @@
 	String from, to , struct;
 	int level;
 	
-	public Alignement(Base base, String from2, String to2, String struct2, int level2) {
+	public Alignement(Project base, String from2, String to2, String struct2, int level2) {
 		super(base);
 		from = from2;
 		to = to2;
Index: tmp/org.txm.core/src/java/org/txm/objects/Edition.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Edition.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/Edition.java	(revision 1038)
@@ -300,7 +300,7 @@
 	public File getHtmlDir() {
 		if (defaultHtmlDir == null) {
 			String corpusname = getText().getCorpus().getName();
-			File binDir = getText().getCorpus().getBase().params.paramFile.getParentFile();
+			File binDir = getText().getCorpus().getProject().params.paramFile.getParentFile();
 			defaultHtmlDir = new File(binDir, "HTML/"+corpusname+"/"+getName()); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 		return defaultHtmlDir;
Index: tmp/org.txm.core/src/java/org/txm/objects/BasePreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/BasePreferences.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/BasePreferences.java	(revision 1038)
@@ -11,7 +11,7 @@
  */
 public class BasePreferences extends EclipsePreferences {
 	
-	public BasePreferences(Base base) {
+	public BasePreferences(Project base) {
 		super(null, "TXMCORPUS-"+base.getName());
 		PreferencesService.getDefault();
 	}
Index: tmp/org.txm.core/src/java/org/txm/objects/Workspace.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Workspace.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/Workspace.java	(revision 1038)
@@ -33,11 +33,13 @@
 import java.io.IOException;
 import java.io.OutputStreamWriter;
 import java.io.Writer;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.OutputKeys;
 import javax.xml.transform.Result;
 import javax.xml.transform.Source;
@@ -62,6 +64,7 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
 
 /**
  * The Class Workspace: manages the TXM corpora in the $TXMHOME/corpora directory
@@ -71,11 +74,9 @@
 	/** The Constant serialVersionUID. */
 	private static final long serialVersionUID = -8059395782871546280L;
 
-	/** The bases. */
-	HashMap<String, Base> bases = new HashMap<String, Base>();
+	private static final String CURRENTCORPUSVERSION = "0.8.0";
 
-	/** The projects. */
-	HashMap<String, Project> projects = new HashMap<String, Project>();
+	private static final String NAME = "name";
 
 	/** The xmlfile. */
 	File xmlDefinitionFile;
@@ -96,7 +97,8 @@
 	 */
 	public static Workspace createOrUpdate(File txmhomedir) {
 		//TODO replace this old directory&file with the ".project" Eclipse project configuration file
-		File xmlfile = new File(txmhomedir, "workspaces/default.xml");
+		File workspaceDirectory = new File(txmhomedir, "corpora");
+		File xmlfile = new File(workspaceDirectory, "default.xml");
 
 		try {
 			txmhomedir.mkdirs();
@@ -109,7 +111,7 @@
 			// create folders
 			String createfolders[] = {
 					"corpora", "clipboard", //$NON-NLS-1$ //$NON-NLS-2$
-					"workspaces", "css", "xsl", "schema", "scripts"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+					"css", "xsl", "schema", "scripts"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 			String deletefolders[] = {"clipboard"}; //$NON-NLS-1$ //$NON-NLS-2$
 
 			for (String folder : deletefolders) {
@@ -189,7 +191,7 @@
 	 */
 	protected static boolean writeEmptyWorkspaceFile(File xmlfile)
 	{
-		xmlfile.getParentFile().mkdir();
+		xmlfile.getParentFile().mkdirs();
 		try {
 			OutputStreamWriter writer = new OutputStreamWriter(
 					new FileOutputStream(xmlfile), TXMPreferences.DEFAULT_ENCODING);
@@ -223,46 +225,47 @@
 		_load();
 	}
 
-	/**
-	 * Adds the project.
-	 *
-	 * @param name the name
-	 * @return the project
-	 */
-	public Project addProject(String name) {
-		if (projects.containsKey(name))
-			return projects.get(name);
-		Element projRoot = (Element) getSelfElement().getElementsByTagName("projects").item(0); //$NON-NLS-1$
-		Element projElem = doc.createElement("project"); //$NON-NLS-1$
-		projElem.setAttribute("name", name); //$NON-NLS-1$
-		projRoot.appendChild(projElem);
+//	/**
+//	 * Adds the project.
+//	 *
+//	 * @param name the name
+//	 * @return the project
+//	 * @throws IOException 
+//	 * @throws SAXException 
+//	 * @throws ParserConfigurationException 
+//	 */
+//	public Project addProject(String name) throws Exception {
+//		if (projects.containsKey(name))
+//			return projects.get(name);
+//		
+//		File dir = new File(xmlDefinitionFile.getParentFile(), name);
+//		dir.mkdirs();
+//		File paramFile = new File(dir, "import.xml");
+//		BaseParameters.createEmptyParams(paramFile, name);
+//		BaseParameters params = new BaseParameters(paramFile);
+//		
+//		Project project = new Project(this, params);
+//
+//		return project;
+//	}
+//
+//	/**
+//	 * Removes the project.
+//	 *
+//	 * @param name the name
+//	 * @return the project
+//	 */
+//	public Project removeProject(String name) {
+//		Project p = projects.get(name);
+//		if (p != null) {
+//			Element projRoot = (Element) getSelfElement().getElementsByTagName(
+//					"projects").item(0); //$NON-NLS-1$
+//			projRoot.removeChild(p.getSelfElement());
+//			projects.remove("name"); //$NON-NLS-1$
+//		}
+//		return p;
+//	}
 
-		Element baseRoot = doc.createElement("bases"); //$NON-NLS-1$
-		projElem.appendChild(baseRoot);
-
-		Project project = new Project(this, projElem);
-		projects.put(name, project);
-
-		return project;
-	}
-
-	/**
-	 * Removes the project.
-	 *
-	 * @param name the name
-	 * @return the project
-	 */
-	public Project removeProject(String name) {
-		Project p = projects.get(name);
-		if (p != null) {
-			Element projRoot = (Element) getSelfElement().getElementsByTagName(
-					"projects").item(0); //$NON-NLS-1$
-			projRoot.removeChild(p.getSelfElement());
-			projects.remove("name"); //$NON-NLS-1$
-		}
-		return p;
-	}
-
 	/* (non-Javadoc)
 	 * @see org.txm.objects.TxmObject#load()
 	 */
@@ -279,29 +282,42 @@
 			// System.out.println("build projects");
 			// projs = (Element)
 			// selfElement.getElementsByTagName("projects").item(0);
-			NodeList projList = getSelfElement().getElementsByTagName("project"); //$NON-NLS-1$
-			for (int i = 0; i < projList.getLength(); i++) {
-				Element project = (Element) projList.item(i);
-				Project p = new Project(this, project);
-				projects.put(p.getName(), p);
+//			NodeList projList = getSelfElement().getElementsByTagName("project"); //$NON-NLS-1$
+//			for (int i = 0; i < projList.getLength(); i++) {
+//				Element project = (Element) projList.item(i);
+//				Project p = new Project(this, project);
+//				projects.put(p.getName(), p);
+//			}
+			
+			for (File dir : xmlDefinitionFile.getParentFile().listFiles()) {
+				if (!dir.isDirectory()) continue;
+				
+				File paramFile = new File(dir, "import.xml");
+				if (!paramFile.exists()) continue;
+				
+				BaseParameters params = new BaseParameters(paramFile);
+				new Project(this, params);
 			}
 
 			loadMetadata();
 			return true;
 		} catch (Exception e) {
 			System.out.println(TXMCoreMessages.Workspace_2 + e);
-			System.out.println(TXMCoreMessages.Workspace_8);
-			File copyFile = new File(xmlDefinitionFile.getParentFile(), "copy_of_"+xmlDefinitionFile.getName());
-			try {
-				System.out.println("Writing a copy in "+copyFile);
-				FileCopy.copy(xmlDefinitionFile, copyFile);
-			} catch (IOException e1) {
-				System.out.println("Failed to write a copy of "+xmlDefinitionFile);
-				Log.printStackTrace(e1);
-			}
-
-			if (writeEmptyWorkspaceFile(xmlDefinitionFile))
-				return _load();
+			e.printStackTrace();
+			
+//TODO implement this solution or not ?			
+//			System.out.println(TXMCoreMessages.Workspace_8);
+//			File copyFile = new File(xmlDefinitionFile.getParentFile(), "copy_of_"+xmlDefinitionFile.getName());
+//			try {
+//				System.out.println("Writing a copy in "+copyFile);
+//				FileCopy.copy(xmlDefinitionFile, copyFile);
+//			} catch (IOException e1) {
+//				System.out.println("Failed to write a copy of "+xmlDefinitionFile);
+//				Log.printStackTrace(e1);
+//			}
+//
+//			if (writeEmptyWorkspaceFile(xmlDefinitionFile))
+//				return _load();
 			return false;
 		}
 	}
@@ -341,28 +357,12 @@
 	}
 
 	/**
-	 * Describe.
-	 */
-	public void describe() {
-		Workspace w = this;
-		for (Project p : w.projects.values()) {
-			System.out.println(TXMCoreMessages.Workspace_3 + p.getName());
-			for (Base b : p.bases.values()) {
-				System.out.println(TXMCoreMessages.Workspace_4 + b.getName());
-				//				for (MainCorpus c : b.corpora.values()) {
-				//					System.out.println(TXMCoreMessages.Workspace_10+c);
-				//				}
-			}
-		}
-	}
-
-	/**
 	 * Gets the projects.
 	 *
 	 * @return the projects
 	 */
-	public Collection<Project> getProjects() {
-		return projects.values();
+	public ArrayList<Project> getProjects() {
+		return (ArrayList<Project>) getChildren(Project.class);
 	}
 
 	/**
@@ -372,7 +372,12 @@
 	 * @return the project
 	 */
 	public Project getProject(String name) {
-		return projects.get(name);
+		for (Project p : getProjects()) {
+			if (p.getName().equals(name)) {
+				return p;
+			}
+		}
+		return null;
 	}
 
 	/**
@@ -384,44 +389,44 @@
 		return xmlDefinitionFile;
 	}
 
+//
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#removeChildren(org.txm.objects.TxmObject)
+//	 */
+//	public TxmObject removeChildren(TxmObject o) {
+//		if (o == null) {
+//			return null;
+//		}
+//		if (o instanceof Project) {
+//			Project proj = (Project) o;
+//			getSelfElement().removeChild(proj.getSelfElement());
+//			return projects.remove(((Project) o).getName());
+//		}
+//		return null;
+//	}
+//
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#hasChildren(org.txm.objects.TxmObject)
+//	 */
+//	public boolean hasChildren(TxmObject o) {
+//		if (o == null) {
+//			return false;
+//		}
+//		if (o instanceof Project) {
+//			return projects.containsKey(((Project) o).getName());
+//		}
+//		return false;
+//	}
+//
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#getParent()
+//	 */
+//	@Override
+//	public TxmObject getParent() {
+//		return null;
+//	}
 
 	/* (non-Javadoc)
-	 * @see org.txm.objects.TxmObject#removeChildren(org.txm.objects.TxmObject)
-	 */
-	public TxmObject removeChildren(TxmObject o) {
-		if (o == null) {
-			return null;
-		}
-		if (o instanceof Project) {
-			Project proj = (Project) o;
-			getSelfElement().removeChild(proj.getSelfElement());
-			return projects.remove(((Project) o).getName());
-		}
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.txm.objects.TxmObject#hasChildren(org.txm.objects.TxmObject)
-	 */
-	public boolean hasChildren(TxmObject o) {
-		if (o == null) {
-			return false;
-		}
-		if (o instanceof Project) {
-			return projects.containsKey(((Project) o).getName());
-		}
-		return false;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.txm.objects.TxmObject#getParent()
-	 */
-	@Override
-	public TxmObject getParent() {
-		return null;
-	}
-
-	/* (non-Javadoc)
 	 * @see org.txm.objects.TxmObject#delete()
 	 */
 	@Override
@@ -429,11 +434,6 @@
 		return false;
 	}
 
-	public static final String DEFAULT = "default";
-	public Project getDefaultProject() {
-		return getProject(DEFAULT);
-	}
-
 	@Override
 	public String getSimpleName() {
 		// TODO Auto-generated method stub
@@ -449,7 +449,6 @@
 	@Override
 	public void clean() {
 		// TODO Auto-generated method stub
-
 	}
 
 	@Override
@@ -461,4 +460,82 @@
 	public File getLocation() {
 		return xmlDefinitionFile.getParentFile().getParentFile(); // this work for now, must be changed when we use properly Eclipse workspaces
 	}
+	
+	/**
+	 * Scan directory: 
+	 * 1- check the binary corpus format
+	 * 2- register in the workspace
+	 *
+	 * @param binCorpusDir the base
+	 * @return the base
+	 * @throws IOException 
+	 * @throws SAXException 
+	 * @throws ParserConfigurationException 
+	 */
+	public Project scanDirectory(File binCorpusDir) throws ParserConfigurationException, SAXException, IOException {
+
+		//System.out.println(Messages.Project_5);
+		File HTMLs = new File(binCorpusDir, "HTML"); //$NON-NLS-1$
+		//File TXMs = new File(binCorpusDir, "txm"); //$NON-NLS-1$
+		File DATAs = new File(binCorpusDir, "data"); //$NON-NLS-1$
+		File REGISTRY = new File(binCorpusDir, "registry"); //$NON-NLS-1$
+		File PARAMS = new File(binCorpusDir, "import.xml"); //$NON-NLS-1$
+
+		if (HTMLs.exists() && DATAs.exists()
+				&& REGISTRY.exists() && PARAMS.exists())// && correspfile.exists())
+		{// minimal base data
+			BaseParameters parameters = new BaseParameters(PARAMS);
+			if (!parameters.load()) {
+				System.out.println(TXMCoreMessages.Project_11+PARAMS);
+				Log.severe(TXMCoreMessages.Project_11+PARAMS);
+				return null;
+			}
+
+//			if (parameters.version == null || parameters.version.length() == 0) {
+//				System.out.println(TXMCoreMessages.Project_14);
+//				return null;
+//			} else if (CURRENTCORPUSVERSION.compareTo(parameters.version) > 0) {
+//				System.out.println(TXMCoreMessages.Project_15);
+//				System.out.println(CURRENTCORPUSVERSION+" > "+parameters.version); //$NON-NLS-1$
+//				return null;
+//			}
+
+			Project p = getProject(parameters.name);
+			if (p != null) {
+				p.delete();
+			}
+
+			//System.out.println(parameters.toString());
+			Project b = new Project(this, parameters);
+
+			//System.out.println("CREATE CORPORA? "+b.corpora.values());
+			for (Element c : parameters.corpora.values()) {
+				String corpusname = c.getAttribute(NAME);
+				//File TXMc = new File(TXMs, corpusname);
+				File HTMLc = new File(HTMLs, corpusname);
+				File REGISTRYc = new File(REGISTRY, corpusname.toLowerCase());
+				File DATAc = new File(DATAs, corpusname);
+
+				if (!(PARAMS.exists() && HTMLc.exists() && REGISTRYc.exists() && DATAc.exists())) {
+					System.out.println(TXMCoreMessages.Project_17+corpusname);
+					System.out.println(TXMCoreMessages.Project_18+PARAMS);
+					System.out.println("HTMLc: "+HTMLc+" : "+HTMLc.exists()); //$NON-NLS-1$ //$NON-NLS-2$
+					System.out.println("REGISTRYc: "+REGISTRYc+" : "+REGISTRYc.exists()); //$NON-NLS-1$ //$NON-NLS-2$
+					System.out.println("DATAc: "+DATAc+" : "+DATAc.exists()); //$NON-NLS-1$ //$NON-NLS-2$
+					continue;
+				}
+			}
+
+			return b;
+		} else {
+			System.out.println(TXMCoreMessages.bind(TXMCoreMessages.Project_26, binCorpusDir));
+			System.out.println(TXMCoreMessages.Project_28+HTMLs+", "+DATAs+", "+REGISTRY+TXMCoreMessages.Project_31+PARAMS); //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
+		}
+		return null;
+	}
+
+	public File getDirectory() {
+		return xmlDefinitionFile.getParentFile();
+	}
+
 }
Index: tmp/org.txm.core/src/java/org/txm/objects/BaseParameters.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/BaseParameters.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/BaseParameters.java	(revision 1038)
@@ -91,7 +91,7 @@
 		writer.close();
 	}
 	
-	public static String getBaseName(File paramfile) throws ParserConfigurationException, SAXException, IOException {
+	public static String getProjectName(File paramfile) throws ParserConfigurationException, SAXException, IOException {
 		Document root = DomUtils.load(paramfile);
 		return root.getDocumentElement().getAttribute("name");
 	}
Index: tmp/org.txm.core/src/java/org/txm/objects/CorpusParameters.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/CorpusParameters.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/CorpusParameters.java	(revision 1038)
@@ -248,11 +248,11 @@
 				String from = split[1].trim();
 				String to = split[2].trim();
 
-				Alignement align = new Alignement(this.corpus.getBase(), from, to, 
+				Alignement align = new Alignement(this.corpus.getProject(), from, to, 
 						link.getAttribute("alignElement"), Integer.parseInt(link.getAttribute("alignLevel")));
 				links.put("#"+from+" #"+to, align);
 				
-				align = new Alignement(this.corpus.getBase(), to, from, 
+				align = new Alignement(this.corpus.getProject(), to, from, 
 						link.getAttribute("alignElement"), Integer.parseInt(link.getAttribute("alignLevel")));
 				links.put("#"+to+" #"+from, align);
 
Index: tmp/org.txm.core/src/java/org/txm/objects/BasePreferenceScope.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/BasePreferenceScope.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/BasePreferenceScope.java	(revision 1038)
@@ -15,7 +15,7 @@
 	 */
 	public static final String SCOPE = "binarycorpus"; //$NON-NLS-1$
 
-	private Base context;
+	private Project context;
 	
 	public BasePreferenceScope() {
 		
@@ -28,7 +28,7 @@
 	 * @param context the project
 	 * @exception IllegalArgumentException if the project is <code>null</code>
 	 */
-	public BasePreferenceScope(Base context) {
+	public BasePreferenceScope(Project context) {
 		super();
 		if (context == null) {
 			throw new IllegalArgumentException("NULL context");
@@ -53,7 +53,7 @@
 	 */
 	@Override
 	public IPath getLocation() {
-		Path location = new Path(context.getBaseDirectory().getAbsolutePath());
+		Path location = new Path(context.getProjectDirectory().getAbsolutePath());
 		System.out.println("LOCATION: "+location);
 		return location == null ? null : location.append(EclipsePreferences.DEFAULT_PREFERENCES_DIRNAME);
 	}
Index: tmp/org.txm.core/src/java/org/txm/objects/Script.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Script.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/Script.java	(revision 1038)
@@ -62,7 +62,7 @@
 	}
 
 	/** The base. */
-	Base base;
+	Project base;
 	
 	/** The type. */
 	String type;
@@ -73,7 +73,7 @@
 	 * @param b the b
 	 * @param script the script
 	 */
-	public Script(Base b, Element script) {
+	public Script(Project b, Element script) {
 		super(b);
 		this.setPath(b.getPath() + getName());
 		setSelfElement(script);
@@ -86,7 +86,7 @@
 	 *
 	 * @return the base
 	 */
-	public Base getBase() {
+	public Project getProject() {
 		return base;
 	}
 
Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1038)
@@ -21,357 +21,348 @@
 // 
 // 
 // 
-// $LastChangedDate: 2015-12-17 12:11:39 +0100 (Thu, 17 Dec 2015) $
-// $LastChangedRevision: 3087 $
+// $LastChangedDate: 2017-01-24 18:11:42 +0100 (Tue, 24 Jan 2017) $
+// $LastChangedRevision: 3400 $
 // $LastChangedBy: mdecorde $ 
 //
 package org.txm.objects;
 
+
+import java.io.BufferedWriter;
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
+import java.io.Writer;
 import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.List;
+import java.util.HashMap;
 
-import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
 
-import org.eclipse.osgi.util.NLS;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.core.messages.TXMCoreMessages;
+import org.txm.core.results.TXMResult;
 import org.txm.utils.logger.Log;
+import org.txm.utils.zip.Zip;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
 
+// TODO: Auto-generated Javadoc
 /**
- * The Class Project.
- * TODO: remove this class, to be replace with the usage of a IProject
+ * The Class Base.
  */
 public class Project extends TxmObject {
 
-	String CURRENTCORPUSVERSION = "0.6"; //$NON-NLS-1$
-
 	/** The Constant serialVersionUID. */
-	private static final long serialVersionUID = 9158349064157589887L;
+	private static final long serialVersionUID = -4798832481060407512L;
 
-	/** The bases. */
-	LinkedHashMap<String, Base> bases = new LinkedHashMap<String, Base>();
+	/** The project. */
+	Workspace project;
+	BaseParameters params;
 
-	/** The workspace. */
-	Workspace workspace;
+	private HashMap<String, Alignement> links = new HashMap<String, Alignement>();
 
-	private static String NAME = "name"; //$NON-NLS-1$
-
-	/** The bases elem. */
-	Element basesElem;
-
+//	private BasePreferenceScope scope;
+	
+	public String toString() { return params.name;};
+	
 	/**
-	 * Instantiates a new project.
+	 * Instantiates a new base.
 	 *
-	 * @param workspace the workspace
 	 * @param project the project
+	 * @param parameters the b
 	 */
-	public Project(Workspace workspace, Element project) {
-		super(workspace);
-		this.workspace = workspace;
-		setSelfElement(project);
-		_load();
-		this.setPath(workspace.getPath() + "/"+getName());
+	public Project(Workspace project, BaseParameters parameters) {
+		super(project);
+		
+		parameters.load();
+		
+		this.setPath(project.getPath() + getName());
+		params = parameters;
+		setSelfElement(params.root);
+		this.project = project;
+		//load();
+		this.name = params.name;
+		if (!name.equals(name.toUpperCase())) {
+			System.out.println("Warning in Base.init: binary corpus name contains lower case letters: "+this.name);
+		}
+		
+//		this.scope = new BasePreferenceScope(this);
 	}
+	
+//	public BasePreferenceScope getPreferenceScope() {
+//		return scope;
+//	}
 
 	/**
-	 * Gets the workspace.
+	 * Gets the project.
 	 *
-	 * @return the workspace
+	 * @return the project
 	 */
 	public Workspace getWorkspace() {
-		return this.workspace;
+		return this.project;
 	}
 
 	/* (non-Javadoc)
+	 * @see org.txm.objects.TxmObject#save()
+	 */
+	@Override
+	protected boolean _save() {
+		//System.out.println("SAVE BASE: "+params.root+" "+params.paramFile);
+		try {
+			// Création de la source DOM
+			Source source = new DOMSource(params.root);
+
+			// Création du fichier de sortie
+			Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(params.paramFile), "UTF-8")); //$NON-NLS-1$
+			Result resultat = new StreamResult(writer);
+
+			// Configuration du transformer
+			TransformerFactory fabrique = new net.sf.saxon.TransformerFactoryImpl();
+			Transformer transformer = fabrique.newTransformer();
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes"); //$NON-NLS-1$
+			transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); //$NON-NLS-1$
+			
+			// Transformation
+			transformer.transform(source, resultat);
+			writer.close();
+		} catch (Exception e) {
+			e.printStackTrace();
+			Log.severe("Error while saving corpus parameters: "+e.getLocalizedMessage());
+			return false;
+		}
+		return true;
+	}
+
+
+	/* (non-Javadoc)
 	 * @see org.txm.objects.TxmObject#load()
 	 */
 	@Override
 	protected boolean _load() {
-		loadMetadata();
-		name = getSelfElement().getAttribute(NAME); 
-		// System.out.println(" build project "+name);
 
-		ArrayList<String> loaded = new ArrayList<String>();
-		basesElem = (Element) getSelfElement().getElementsByTagName("bases").item(0); //$NON-NLS-1$
-		NodeList basesList = basesElem.getElementsByTagName("base"); //$NON-NLS-1$
+		loadMetadata(); // read the prop tags
 
-		LinkedHashMap<String, Date> baseParametersDate = new LinkedHashMap<String, Date>();
-		LinkedHashMap<String, BaseParameters> basesToLoad = new LinkedHashMap<String, BaseParameters>();
-		LinkedHashMap<BaseParameters, Element> elementReadToCreateBaseParameter = new LinkedHashMap<BaseParameters, Element>();
-		//		for (int i = 0; i < basesList.getLength(); i++) {
-		//			Element baseElement = (Element) basesList.item(i);
-		//			String name = baseElement.getAttribute(NAME).toUpperCase();
-		//			
-		//			if (baseElementsToLoad.containsKey(name)) {
-		//				Element baseWithSameName = baseElementsToLoad.get(name);
-		//				//if (baseElement.getAttribute("date").compareTo(baseWithSameName.getAttribute("date")) > 0) { // baseWithSameName older than baseElement 
-		//				//baseElementsToLoad.put(name, baseElement);
-		//				System.out.println("Corpus directory name conflict detected using corpus with configuration file "+baseWithSameName.getAttribute("file"));
-		//				//}
-		//			} else {
-		//				baseElementsToLoad.put(name, baseElement);
-		//			}
-		//		}
-		HashSet<String> paramsFilesSeen = new HashSet<String>(); // manage case of corpus with the same parameter file  set in the "file" attribute in the workspace default.xml file
-		for (int i = 0; i < basesList.getLength(); i++) {
-			//for (String k : baseElementsToLoad.keySet()) {
-			try {
-				Element baseElement = (Element) basesList.item(i);
-				String name = baseElement.getAttribute(NAME).toUpperCase(); // force all binary corpus id to beUppercased
-				baseElement.setAttribute(NAME, name); // fix name 
-				File PARAMS = new File(baseElement.getAttribute("file")); // the base declaration is standoff //$NON-NLS-1$
-				if (paramsFilesSeen.contains(baseElement.getAttribute("file"))) {
-					System.out.println("Warning: duplicate corpus declaration in workspace file: "+PARAMS+". Ignoring corpus declaration.");
-					continue; // process next element
-				} else {
-					paramsFilesSeen.add(baseElement.getAttribute("file"));
-				}
-				
-				if (name == null || name.length() == 0) { // check name attribute
-					System.out.println(TXMCoreMessages.bind(TXMCoreMessages.Project_2, PARAMS));
-					if (PARAMS.exists() && PARAMS.canRead()) { // try fixing the name
-						System.out.println(TXMCoreMessages.Project_0);
-						name = PARAMS.getParentFile().getName().toUpperCase();
-						baseElement.setAttribute(NAME, name);
-					} else { // no luck :)
-						System.out.println(TXMCoreMessages.Project_1+PARAMS);
-						basesElem.removeChild(baseElement);
-					}
-				} 
+		// get Alignements
+		//System.out.println("Load alignement from params: "+params.links);
+		for (String alignname : params.links.keySet()) {
+			Element link = params.links.get(alignname);
 
-				if (PARAMS.exists() && PARAMS.canRead()) {
-
-					BaseParameters parameters = new BaseParameters(PARAMS);
-					if (parameters.load()) {
-						String upperCasedName = parameters.name.toUpperCase();
-						elementReadToCreateBaseParameter.put(parameters, baseElement);
-						//check base name conflict before adding the base
-						if (baseParametersDate.containsKey(upperCasedName)) {
-							Date dateStored = baseParametersDate.get(upperCasedName);
-							if (parameters.date.compareTo(dateStored) > 0) { // this base is more recent
-								System.out.println("Warning: removing corpus '"+basesToLoad.get(upperCasedName).name+"' described by "+basesToLoad.get(upperCasedName).paramFile+" seems to be a duplicated of corpus '"+parameters.name+"' described by "+ parameters.paramFile);
-								baseParametersDate.put(upperCasedName, parameters.date);
-								basesToLoad.put(upperCasedName, parameters);
-								
-								//remove the duplicated element
-								Element duplicate = elementReadToCreateBaseParameter.get(basesToLoad.get(upperCasedName));
-								if (duplicate != null) {
-									duplicate.getParentNode().removeChild(duplicate);
-								}
-							} else { // don't add the base since its date is older
-								System.out.println("Warning: removing corpus '"+parameters.name+"' described by "+parameters.paramFile+" seems to be a duplicated of corpus '"+basesToLoad.get(upperCasedName).name+"' described by "+ basesToLoad.get(upperCasedName).paramFile);
-								baseElement.getParentNode().removeChild(baseElement);
-							}
-						} else { // no prob, continue
-							baseParametersDate.put(upperCasedName, parameters.date);
-							basesToLoad.put(upperCasedName, parameters);
-						}
-					} else {
-						System.out.println(TXMCoreMessages.Project_6+PARAMS);
-					}
-				} else {
-					System.out.println(NLS.bind(TXMCoreMessages.Project_8, PARAMS));
-					baseElement.getParentNode().removeChild(baseElement);
-				}
-			} catch (Exception e1) {
-				System.out.println(TXMCoreMessages.Project_10+e1);
+			String target = link.getAttribute("target"); //$NON-NLS-1$
+			String[] split = target.split("#"); //$NON-NLS-1$
+			if (split.length != 3) {
+				System.out.println(TXMCoreMessages.Base_6+target);
+				continue;
 			}
-		}
-		for (String k : basesToLoad.keySet()) {
-			BaseParameters parameters = basesToLoad.get(k);
-			File PARAMS = parameters.paramFile;
+			String from = split[1].trim();
+			String to = split[2].trim();
 
-			try {
-				
-				Base b = new Base(this, parameters);
-				b.load();
-				bases.put(b.getName(), b);
-			} catch (Exception e) {
-				System.out.println(TXMCoreMessages.Project_7+PARAMS);
-				org.txm.utils.logger.Log.printStackTrace(e);
-			}
+			Alignement align = new Alignement(this, from, to, 
+					link.getAttribute("alignElement"), Integer.parseInt(link.getAttribute("alignLevel"))); //$NON-NLS-1$ //$NON-NLS-2$
+			links.put("#"+from+" #"+to, align); //$NON-NLS-1$ //$NON-NLS-2$
+
+			align = new Alignement(this, to, from, 
+					link.getAttribute("alignElement"), Integer.parseInt(link.getAttribute("alignLevel"))); //$NON-NLS-1$ //$NON-NLS-2$
+			links.put("#"+to+" #"+from, align); //$NON-NLS-1$ //$NON-NLS-2$
 		}
 
-
-		return _save();
+		return true;
 	}
 
-	/**
-	 * Gets the base.
-	 *
-	 * @param id the id
-	 * @return the base
-	 */
-	public Base getBase(String id) {
-		return this.bases.get(id);
-	}
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#getChildren()
+//	 */
+//	@Override
+//	public List<TxmObject> getChildren() {
+//		List<TxmObject> rez = new ArrayList<TxmObject>();
+//		rez.addAll(corpora.values());
+//		return rez;
+//	}
 
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#removeChildren(org.txm.objects.TxmObject)
+//	 */
+//	public TxmObject removeChildren(TxmObject o) {
+//		if (o == null)
+//			return null;
+////		if (o instanceof MainCorpus) {
+////			params.corporaElement.removeChild(o.selfElement);
+////			params.corpora.remove(o.getName());
+////			//corpus.deleteFromCWB() already called
+////			Toolbox.workspace.save();
+////			return o;
+////		}
+//
+//		return null;
+//	}
+
+//	/**
+//	 * Removes the script.
+//	 *
+//	 * @param name the name
+//	 * @return the script
+//	 */
+//	public MainCorpus removeCorpus(String name) {
+//		MainCorpus corpus = corpora.get(name);
+//		if (corpus != null) {
+//			params.corporaElement.removeChild(corpus.selfElement);
+//			params.corpora.remove(name);
+//		}
+//		return corpus;
+//	}
+
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#hasChildren(org.txm.objects.TxmObject)
+//	 */
+//	public boolean hasChildren(TxmObject o) {
+//		if (o == null)
+//			return false;
+//		if (o instanceof MainCorpus)
+//			return params.corpora.values().contains(o);
+//		return false;
+//	}
+
 	/* (non-Javadoc)
-	 * @see org.txm.objects.TxmObject#save()
+	 * @see org.txm.objects.TxmObject#getParent()
 	 */
 	@Override
-	protected boolean _save() {
-//		for (Base b : bases.values())
-//			b.save();
-		return true;
+	public TxmObject getParent() {
+		return getWorkspace();
 	}
 
 	/**
-	 * Scan directory: 
-	 * 1- check the binary corpus format
-	 * 2- register in the workspace
+	 * Register maincorpus.
 	 *
-	 * @param binCorpusDir the base
-	 * @return the base
-	 * @throws IOException 
-	 * @throws SAXException 
-	 * @throws ParserConfigurationException 
+	 * @param corpusName the corpus name
 	 */
-	public Base scanDirectory(File binCorpusDir) throws ParserConfigurationException, SAXException, IOException {
+	public Element registerMaincorpus(String corpusName) {
+		Document doc = getSelfElement().getOwnerDocument();
+		Element maincorpus = doc.createElement("corpus"); //$NON-NLS-1$
+		maincorpus.setAttribute("name", corpusName); //$NON-NLS-1$
+		if (getSelfElement().getElementsByTagName("corpora").getLength() == 0) { //$NON-NLS-1$
+			Log.severe(TXMCoreMessages.Base_22);
+			return null;
+		}
+		Element corporaElem = (Element) getSelfElement().getElementsByTagName("corpora").item(0); //$NON-NLS-1$
+		corporaElem.appendChild(maincorpus); // append maincorpus
+		return maincorpus;
+	}
 
-		//System.out.println(Messages.Project_5);
-		File HTMLs = new File(binCorpusDir, "HTML"); //$NON-NLS-1$
-		//File TXMs = new File(binCorpusDir, "txm"); //$NON-NLS-1$
-		File DATAs = new File(binCorpusDir, "data"); //$NON-NLS-1$
-		File REGISTRY = new File(binCorpusDir, "registry"); //$NON-NLS-1$
-		File PARAMS = new File(binCorpusDir, "import.xml"); //$NON-NLS-1$
+//	/**
+//	 * Gets the corpus.
+//	 *
+//	 * @param name the name
+//	 * @return the corpus
+//	 */
+//	public MainCorpus getCorpus(String name) {
+//		return corpora.get(name);
+//	}
+//
+//	/**
+//	 * Gets the corpora.
+//	 *
+//	 * @return the corpora
+//	 */
+//	public HashMap<String, MainCorpus> getCorpora() {
+//		return corpora;
+//	}
 
-		if (HTMLs.exists() && DATAs.exists()
-				&& REGISTRY.exists() && PARAMS.exists())// && correspfile.exists())
-		{// minimal base data
-			BaseParameters parameters = new BaseParameters(PARAMS);
-			if (!parameters.load()) {
-				System.out.println(TXMCoreMessages.Project_11+PARAMS);
-				Log.severe(TXMCoreMessages.Project_11+PARAMS);
-				return null;
-			}
+	public boolean export(File exportzip) {
+		return export(exportzip, null);
+	}
+	
+	/**
+	 * Export.
+	 *
+	 * @param exportzip the exportzip
+	 * @return true, if successful
+	 */
+	public boolean export(File exportzip, IProgressMonitor monitor) {
+		File binarydir = this.params.paramFile.getParentFile();
 
-			if (parameters.version == null || parameters.version.length() == 0) {
-				System.out.println(TXMCoreMessages.Project_14);
-				return null;
-			} else if (CURRENTCORPUSVERSION.compareTo(parameters.version) > 0) {
-				System.out.println(TXMCoreMessages.Project_15);
-				System.out.println(CURRENTCORPUSVERSION+" > "+parameters.version); //$NON-NLS-1$
-				return null;
+		if (binarydir.exists() && exportzip.getParentFile().exists()) {
+			try {
+				Zip.compress(binarydir, exportzip, monitor);
+			} catch (IOException e) {
+				org.txm.utils.logger.Log.printStackTrace(e);
+				return false;
 			}
-
-			if (this.bases.keySet().contains(parameters.name)) {
-				// remove element 
-				// remove base
-				this.removeBase(parameters.name);
-			}
-
-			//System.out.println(parameters.toString());
-			Base b = this.addBase(parameters, PARAMS);
-
-			//System.out.println("CREATE CORPORA? "+b.corpora.values());
-			for (Element c : parameters.corpora.values()) {
-				String corpusname = c.getAttribute(NAME);
-				//File TXMc = new File(TXMs, corpusname);
-				File HTMLc = new File(HTMLs, corpusname);
-				File REGISTRYc = new File(REGISTRY, corpusname.toLowerCase());
-				File DATAc = new File(DATAs, corpusname);
-
-				if (!(PARAMS.exists() && HTMLc.exists() && REGISTRYc.exists() && DATAc.exists())) {
-					System.out.println(TXMCoreMessages.Project_17+corpusname);
-					System.out.println(TXMCoreMessages.Project_18+PARAMS);
-					System.out.println("HTMLc: "+HTMLc+" : "+HTMLc.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-					System.out.println("REGISTRYc: "+REGISTRYc+" : "+REGISTRYc.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-					System.out.println("DATAc: "+DATAc+" : "+DATAc.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-					continue;
-				}
-			}
-
-			return b;
+			return true;
 		} else {
-			System.out.println(TXMCoreMessages.bind(TXMCoreMessages.Project_26, binCorpusDir));
-			System.out.println(TXMCoreMessages.Project_28+HTMLs+", "+DATAs+", "+REGISTRY+TXMCoreMessages.Project_31+PARAMS); //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-1$
+			System.out.println(TXMCoreMessages.Base_0+binarydir+TXMCoreMessages.Base_3);
+			System.out.println(TXMCoreMessages.Base_4+exportzip.getParentFile()+TXMCoreMessages.Base_5);
+
 		}
-		return null;
+		return false;
 	}
 
 	/**
-	 * Adds the base.
+	 * Gets the base directory.
 	 *
-	 * @param name the name
-	 * @param files the files
-	 * @return the base
+	 * @return the base directory
 	 */
-	public Base addBase(BaseParameters params, File paramFile) {
-		// System.out.println("ADD BASE: "+params.name);
-		name = params.name;
-		this.removeBase(name);
+	public File getProjectDirectory()
+	{
+		return this.params.paramFile.getParentFile();
+	}
 
-		// register the base in the workspace
-		Document doc = getSelfElement().getOwnerDocument();
-		Element baseRoot = (Element) getSelfElement().getElementsByTagName("bases").item(0); //$NON-NLS-1$
-		NodeList basesElem = baseRoot.getElementsByTagName("base"); //$NON-NLS-1$
-		for (int i = 0 ; i < basesElem.getLength() ;i++) {
-			Element baseE = (Element) basesElem.item(i);
-			if (name != null && name.equals(baseE.getAttribute(NAME))) {
-				baseRoot.removeChild(baseE);
-				i--;
-			}
-		}
+	public HashMap<String, Alignement> getLinks()
+	{
+		return links;
+	}
 
-		Element baseElem = doc.createElement("base"); //$NON-NLS-1$
-		baseRoot.appendChild(baseElem);
-		baseElem.setAttribute(NAME, name); 
-		baseElem.setAttribute("file", paramFile.getAbsolutePath()); //$NON-NLS-1$
+	public ArrayList<Alignement> getLinksFrom(String from)
+	{
+		ArrayList<Alignement> rez = new ArrayList<Alignement>();
+		for(String key : links.keySet())
+			if(key.startsWith("#"+from+" ")) //$NON-NLS-1$ //$NON-NLS-2$
+				rez.add(links.get(key));
+		return rez;
+	}
 
-		// create the base using params.root
-		Base b = new Base(this, params);
-		bases.put(name, b);
-		return b;
+	public ArrayList<Alignement> getLinksTo(String to)
+	{
+		ArrayList<Alignement> rez = new ArrayList<Alignement>();
+		for(String key : links.keySet())
+			if(key.endsWith(" #"+to)) //$NON-NLS-1$
+				rez.add(links.get(key));
+		return rez;
 	}
 
-	/**
-	 * Removes the base.
-	 *
-	 * @param name the name
-	 * @return the base
-	 */
-	public Base removeBase(String name) {
-		name = name.toUpperCase(); // force Name to be UPPERCASED
-		Base b = bases.remove(name);
-		if (b != null) {
-			Element baseRoot = (Element) getSelfElement().getElementsByTagName("bases").item(0); //$NON-NLS-1$
-			NodeList baseElems = baseRoot.getElementsByTagName("base"); //$NON-NLS-1$
-			for (int i = 0 ; i < baseElems.getLength() ; i++) {
-				Element baseElem = (Element) baseElems.item(i);
-				if (name.equals(baseElem.getAttribute(NAME))) {
-					baseRoot.removeChild(baseElem);
-					return bases.remove(name);
-				}
-			}
-		}
-		return b;
+	public Alignement getLink(String from, String to)
+	{
+		return links.get("#"+from+" #"+to ); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 
 	/**
-	 * Gets the bases.
+	 * Gets the author.
 	 *
-	 * @return the bases
+	 * @return the author
 	 */
-	public Collection<Base> getBases() {
-		return bases.values();
+	public String getAuthor() {
+		return params.author;
 	}
 
 	/**
-	 * Gets the base names.
+	 * Gets the description.
 	 *
-	 * @return the base names
+	 * @return the description
 	 */
-	public List<String> getBaseNames() {
-		return new ArrayList<String>(this.bases.keySet());
+	public String getDescription() {
+		return params.description;
 	}
+	
+	public void setDescription(String newDescription) {
+		params.description = newDescription;
+	}
+
+	public BaseParameters getProjectParameters() {
+		return params;
+	}
 }
Index: tmp/org.txm.core/src/java/org/txm/objects/Corpus.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Corpus.java	(revision 1037)
+++ tmp/org.txm.core/src/java/org/txm/objects/Corpus.java	(revision 1038)
@@ -58,7 +58,7 @@
 	private static final long serialVersionUID = 6906032980183899327L;
 
 	/** The base. */
-	private Base base;
+	private Project base;
 
 	/** The texts element. */
 	Element textsElement;
@@ -164,7 +164,7 @@
 	 * @param base the base
 	 * @param c the c
 	 */
-	public Corpus(Base base, Element c, String uuid) {
+	public Corpus(Project base, Element c, String uuid) {
 		super(uuid, base);
 		this.persistable = true;
 		this.userPersistable = false;
@@ -555,7 +555,7 @@
 	 * @return true, if successful
 	 */
 	public boolean export(File exportzip, IProgressMonitor monitor) {
-		File binarydir = this.getBaseDirectory();
+		File binarydir = this.getProjectDirectory();
 		if (binarydir.exists() && exportzip.getParentFile().exists()) {
 			try {
 				Zip.compress(binarydir, exportzip, monitor);
@@ -577,10 +577,10 @@
 	 *
 	 * @return the base directory
 	 */
-	public File getBaseDirectory()
+	public File getProjectDirectory()
 	{
 		String txmhome = Toolbox.getTxmHomePath();
-		Base base = this.getBase();
+		Project base = this.getProject();
 		if (base != null)
 			return base.params.paramFile.getParentFile();
 		//return new File(new File(txmhome,"corpora"), getName());
@@ -778,7 +778,7 @@
 						//String id = ref.substring(5);
 						HashMap<String, String> infos = sAttributesInfos.get(ref);
 						if (infos == null) {
-							Log.warning("Malformed sattribute tag in "+this.getBase().getBaseParameters().paramFile+" at uis/command/selection: could not find s-attribute informations for @ref="+ref);
+							Log.warning("Malformed sattribute tag in "+this.getProject().getProjectParameters().paramFile+" at uis/command/selection: could not find s-attribute informations for @ref="+ref);
 						}
 						//System.out.println("REF: "+ref+" infos: "+infos);
 						if (infos != null)
@@ -1035,15 +1035,6 @@
 	 * @return the project
 	 */
 	public Project getProject() {
-		return base.getProject();
-	}
-
-	/**
-	 * Gets the base.
-	 *
-	 * @return the base
-	 */
-	public Base getBase() {
 		return base;
 	}
 
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/SubcorpusSelectionResult.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/SubcorpusSelectionResult.java	(revision 0)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/SubcorpusSelectionResult.java	(revision 1038)
@@ -0,0 +1,72 @@
+package org.txm.searchengine.cqp.corpus;
+
+import java.util.ArrayList;
+
+//import org.txm.searchengine.cqp.core.functions.selection.SelectionResult;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+public class SubcorpusSelectionResult {
+//	public void setSelectionResult(SelectionResult selectionResult) {
+//		this.selectionResult = selectionResult;
+//		if (this.getSelfElement() != null) {
+//			//remove old node if any
+//			NodeList selectionList = getSelfElement().getElementsByTagName("selection"); //$NON-NLS-1$
+//			for (int i = 0 ; i < selectionList.getLength() ; i++)
+//				getSelfElement().removeChild(selectionList.item(i));
+//
+//			Document doc = this.getParent().getSelfElement().getOwnerDocument();
+//			Element selectionElem = doc.createElement("selection"); // the selection element //$NON-NLS-1$
+//			for (String txt : selectionResult) // the text ids
+//			{
+//				Element textElem = doc.createElement("selText"); //$NON-NLS-1$
+//				textElem.setAttribute("id", txt); //$NON-NLS-1$
+//				selectionElem.appendChild(textElem);
+//			}
+//			for (String crit : selectionResult.critera.keySet()) // the critera
+//			{
+//				ArrayList<String> values = selectionResult.critera.get(crit);
+//				for (String value : values) {
+//					Element criteraElem = doc.createElement("selCrit"); //$NON-NLS-1$
+//					criteraElem.setAttribute("id", crit); //$NON-NLS-1$
+//					criteraElem.setAttribute("value", value); //$NON-NLS-1$
+//					selectionElem.appendChild(criteraElem);
+//				}
+//			}
+//			getSelfElement().appendChild(selectionElem);// append selection elem to self
+//		}
+//	}
+//
+//	public SelectionResult initSelectionResult() {
+//
+//		if (getSelfElement() != null) {
+//			selectionResult = new SelectionResult();
+//			NodeList selectionList = getSelfElement().getElementsByTagName("selection"); //$NON-NLS-1$
+//			for (int i = 0 ; i < selectionList.getLength() ;) {
+//				Element selection = (Element) selectionList.item(i); // the selection element
+//
+//				NodeList textList = selection.getElementsByTagName("selText"); // get text ids //$NON-NLS-1$
+//				for (int j = 0 ; j < textList.getLength() ; j++) {
+//					Element text = (Element) textList.item(j);
+//					selectionResult.add(text.getAttribute("id")); //$NON-NLS-1$
+//				}
+//
+//				NodeList critList = selection.getElementsByTagName("selCrit"); // get the criteria //$NON-NLS-1$
+//				for (int j = 0 ; j < critList.getLength() ; j++) {
+//					Element crit = (Element) critList.item(j);
+//					String name = crit.getAttribute("id"); // the name of the critera //$NON-NLS-1$
+//					if (!selectionResult.critera.containsKey(name)) // create new list if new critera
+//						selectionResult.critera.put(name, new ArrayList<String>());
+//					selectionResult.critera.get(name).add(crit.getAttribute("value")); // add the value //$NON-NLS-1$
+//				}
+//				break; // process only one selection node
+//			}
+//		}
+//		return selectionResult;
+//	}
+//
+//	public SelectionResult getSelectionResult() {
+//		return selectionResult;
+//	}
+}

Property changes on: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/SubcorpusSelectionResult.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java	(revision 1037)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java	(revision 1038)
@@ -28,7 +28,7 @@
 package org.txm.searchengine.cqp.corpus;
 
 import org.txm.core.results.TXMResult;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
 import org.txm.searchengine.cqp.corpus.query.Query;
@@ -168,11 +168,11 @@
 	}
 
 	/* (non-Javadoc)
-	 * @see org.txm.searchengine.cqp.corpus.Subcorpus#getBase()
+	 * @see org.txm.searchengine.cqp.corpus.Subcorpus#getProject()
 	 */
 	@Override
-	public Base getBase() {
-		return this.partition.getParent().getBase();
+	public Project getProject() {
+		return this.partition.getParent().getProject();
 	}
 
 	/* (non-Javadoc)
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java	(revision 1037)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Corpus.java	(revision 1038)
@@ -40,7 +40,7 @@
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.TXMResult;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.objects.TxmObject;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
@@ -459,7 +459,7 @@
 	 * @return the base
 	 */
 	@Override
-	public abstract Base getBase();
+	public abstract Project getProject();
 
 	/**
 	 * Get the charset set in the CQP registry file.
@@ -909,7 +909,7 @@
 	 */
 	@Override
 	public TxmObject removeChildren(TxmObject children) {
-		Element preBuildElement = this.getBase().getBaseParameters().getPreBuildElement();
+		Element preBuildElement = this.getProject().getProjectParameters().getPreBuildElement();
 		if (children instanceof Subcorpus) {
 			try {
 				if (children.getSelfElement() != null && 
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/creationdelete partition et subcorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/creationdelete partition et subcorpus.java	(revision 0)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/creationdelete partition et subcorpus.java	(revision 1038)
@@ -0,0 +1,544 @@
+//import org.eclipse.osgi.util.NLS;
+//import org.txm.core.messages.TXMCoreMessages;
+//import org.txm.searchengine.cqp.CQPSearchEngine;
+//import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+//import org.txm.searchengine.cqp.corpus.query.Query;
+//import org.txm.utils.logger.Log;
+//import org.w3c.dom.Element;
+//import org.w3c.dom.NodeList;
+
+//import java.util.ArrayList;
+//import java.util.List;
+//
+//import org.txm.core.messages.TXMCoreMessages;
+//import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+//import org.txm.searchengine.cqp.corpus.query.Query;
+//import org.txm.utils.logger.Log;
+//import org.w3c.dom.Element;
+//import org.w3c.dom.NodeList;
+
+//
+//import java.util.List;
+//
+//import org.eclipse.osgi.util.NLS;
+//import org.txm.core.messages.TXMCoreMessages;
+//import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
+//import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
+//import org.txm.searchengine.cqp.core.functions.selection.SelectionResult;
+//import org.txm.searchengine.cqp.corpus.query.Query;
+//import org.txm.searchengine.cqp.corpus.query.QueryPart;
+//import org.txm.utils.logger.Log;
+//import org.w3c.dom.Element;
+//
+//
+//
+//	
+//	/**
+//	 * Creates a partition using a list of CQP queries and names each part.
+//	 *
+//	 * @param name the name
+//	 * @param queries the queries
+//	 * @param partnames the partnames
+//	 * @param registered the registered
+//	 * @return the partition
+//	 * @throws CqiClientException the cqi client exception
+//	 */
+//	public Partition createPartition(String name, List<String> queries, List<String> partnames, boolean registered) throws Exception {
+//		Partition partition = new Partition(this);
+//		partition.setParameters(name, queries, partnames);
+//		partition.compute();
+//		if (!registered) {
+//			partition.registerToParent();
+//		}
+//		return partition;
+//	}
+//
+//	/**
+//	 * Creates the partition.
+//	 *
+//	 * @param structure the structure
+//	 * @param property the property
+//	 * @param values the values
+//	 * @param registered the registered
+//	 * @return the partition
+//	 * @throws CqiClientException the cqi client exception
+//	 */
+//	public Partition createPartition(String name, StructuralUnit structure, StructuralUnitProperty property, List<String> values, boolean registered) throws Exception {
+//		Partition partition = new Partition(this);
+//		partition.setParameters(name, property, values);
+//		partition.compute();
+//		if (!registered) {
+//			partition.registerToParent();
+//		}
+//		return partition;
+//	}
+//
+//	/**
+//	 * Creates a subcorpus using workspace definition.
+//	 *
+//	 * @param elem the XML element
+//	 * @return the subcorpus
+//	 * @throws CqiClientException the cqi client exception
+//	 */
+//	public Subcorpus createSubcorpus(Element elem) throws CqiClientException {
+//		Query query = new Query(elem.getAttribute("query")); //$NON-NLS-1$
+//		String subcorpusName = elem.getAttribute("name"); //$NON-NLS-1$
+//
+//		Subcorpus subcorpus;
+//		String subcorpusCqpId = subcorpusNamePrefix	+ getNextSubcorpusCounter();
+//
+//		// long start = System.currentTimeMillis();
+//		try {
+//			CQPSearchEngine.getCqiClient().cqpQuery(this.getQualifiedCqpId(), subcorpusCqpId,
+//					query.getQueryString());
+//			subcorpus = new Subcorpus(subcorpusCqpId, subcorpusName, this, query);
+//			subcorpus.setSelfElement(elem);
+//		} catch (Exception e) {
+//			throw new CqiClientException(e);
+//		}
+//
+//		return subcorpus;
+//	}
+//
+//	/**
+//	 * Create a named subcorpus from a query on this corpus.
+//	 * 
+//	 * @param query
+//	 *            the query
+//	 * @param subcorpusName
+//	 *            the resulting subcorpus name
+//	 * 
+//	 * @return the resulting subcorpus
+//	 * 
+//	 * @throws CqiClientException
+//	 *             the cqi client exception
+//	 */
+//	public Subcorpus createSubcorpus(Query query, String subcorpusName)
+//			throws CqiClientException {
+//		Subcorpus sc = createSubcorpus(query, subcorpusName, false);
+//		return sc;
+//	}
+//
+//	/**
+//	 * Creates a subcorpus and save configuration in the workspace.
+//	 *
+//	 * @param query the query
+//	 * @param subcorpusName the subcorpus name
+//	 * @param registered the registered
+//	 * @return the subcorpus
+//	 * @throws CqiClientException the cqi client exception
+//	 */
+//	public Subcorpus createSubcorpus(Query query, String subcorpusName,
+//			boolean registered) throws CqiClientException {
+//		Subcorpus subcorpus;
+//		String subcorpusCqpId = subcorpusNamePrefix + getNextSubcorpusCounter().toString();
+//		Log.finest(TXMCoreMessages.CREATING_SUBCORPUS + this.getQualifiedCqpId()
+//				+ " " + subcorpusName + " " + query.getQueryString()); //$NON-NLS-1$ //$NON-NLS-2$
+//
+//		long start = System.currentTimeMillis();
+//		try {
+//			CQPSearchEngine.getCqiClient().cqpQuery(
+//					this.getQualifiedCqpId(), subcorpusCqpId,
+//					query.getQueryString());
+//			//System.out.println("SUBCORPUS: "+subcorpusCqpId+" q="+query.getQueryString());
+//			subcorpus = new Subcorpus(subcorpusCqpId, subcorpusName, this, query);
+//		} catch (Exception e) {
+//			throw new CqiClientException(e);
+//		}
+//		long end = System.currentTimeMillis();
+//		Log.finest(TXMCoreMessages.SUBCORPUS_CREATED + subcorpusName
+//				+ TXMCoreMessages.Corpus_8 + (end - start));
+//
+//		if (!registered) subcorpus.registerToParent();
+//		return subcorpus;
+//	}
+//
+//	public Subcorpus createSubcorpus(String name, QueryResult queryResult) throws InvalidCqpIdException {
+//		Subcorpus sub = new Subcorpus(queryResult.getCqpId(), name, this, null);
+//		return sub;
+//	}
+//
+//	public Subcorpus createSubcorpus(String name, String cqpid) throws InvalidCqpIdException {
+//		Subcorpus sub = new Subcorpus(cqpid, name, this, null);
+//		return sub;
+//	}
+//	
+//	/**
+//	 * Creates the subcorpus.
+//	 *
+//	 * @param elem the elem
+//	 * @return the subcorpus
+//	 * @throws CqiClientException the cqi client exception
+//	 */
+//	public Subcorpus createSubcorpus(String name, SelectionResult selectionResult) throws CqiClientException {
+//		Subcorpus sub = createSubcorpus(this.getStructuralUnit("text"), this.getStructuralUnit("text").getProperty("id"), selectionResult, name); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+//		sub.setSelectionResult(selectionResult);
+//		return sub;
+//	}
+//	
+//	/**
+//	 * Creates the subcorpus.
+//	 *
+//	 * @param structuralUnit the structural unit
+//	 * @param structuralUnitProperty the structural unit property
+//	 * @param values the values
+//	 * @param subcorpusName the subcorpus name
+//	 * @return the subcorpus
+//	 * @throws CqiClientException the cqi client exception
+//	 */
+//	public Subcorpus createSubcorpus(StructuralUnit structuralUnit,
+//			StructuralUnitProperty structuralUnitProperty, List<String> values,
+//			String subcorpusName) throws CqiClientException {
+//		if (values.size() == 0) {
+//			Log.warning(TXMCoreMessages.Corpus_5);
+//			return null;
+//		}
+//		String value = ""; //$NON-NLS-1$
+//		for (String v : values)
+//			value += Query.addBackSlash(v) + "|"; //$NON-NLS-1$
+//		value = value.substring(0, value.length() - 1);
+//		
+//		Query query = new QueryPart(structuralUnit, structuralUnitProperty, value);
+//		return createSubcorpus(query, subcorpusName);
+//		//return createSubcorpus(structuralUnit, structuralUnitProperty, value, subcorpusName);
+//	}
+//
+//	/**
+//	 * Create a subcorpus from a structural unit, a property on this structural
+//	 * unit and a value for this property.
+//	 *
+//	 * @param structuralUnit the structural unit
+//	 * @param structuralUnitProperty the structural unit property
+//	 * @param value the value
+//	 * @param subcorpusName the subcorpus name
+//	 * @return the subcorpus
+//	 * @throws CqiClientException the cqi client exception
+//	 * @author Sylvain Loiseau
+//	 */
+//	public Subcorpus createSubcorpus(StructuralUnit structuralUnit,
+//			StructuralUnitProperty structuralUnitProperty, String value,
+//			String subcorpusName) throws CqiClientException {
+//		Query query = new QueryPart(structuralUnit, structuralUnitProperty,
+//				Query.addBackSlash(value));
+//		// System.out.println("forged query : "+query.getQueryString());
+//		return createSubcorpus(query, subcorpusName);
+//	}
+//
+//	/**
+//	 * Create a subcorpus from a structural unit, a property on this structural
+//	 * unit and a value for this property.
+//	 *
+//	 * @param structuralUnit the structural unit
+//	 * @param structuralUnitProperty the structural unit property
+//	 * @param value the value
+//	 * @param subcorpusName the subcorpus name
+//	 * @return the subcorpus
+//	 * @throws CqiClientException the cqi client exception
+//	 * @author Sylvain Loiseau
+//	 */
+//	public Subcorpus createSubcorpusWithQueryString(StructuralUnit structuralUnit,
+//			StructuralUnitProperty structuralUnitProperty, String value,
+//			String subcorpusName) throws CqiClientException {
+//		Query query = new QueryPart(structuralUnit, structuralUnitProperty,
+//				value);
+//		// System.out.println("forged query : "+query.getQueryString());
+//		return createSubcorpus(query, subcorpusName);
+//	}
+//
+//	/**
+//	 * Drop all the partitions.
+//	 * 
+//	 * @throws CqiClientException
+//	 *             the cqi client exception
+//	 */
+//	public void dropAllPartitions() throws CqiClientException {
+//		List<Partition> _partitions = (List<Partition>) getChildren(Partition.class);
+//		for (Partition partition : _partitions) {
+//			this.dropPartition(partition);
+//		}
+//		_partitions = null;
+//	}
+//
+//	/**
+//	 * Drop all the subcorpora.
+//	 * 
+//	 * @throws CqiClientException
+//	 *             the cqi client exception
+//	 */
+//	public void dropAllSubcorpora() throws CqiClientException {
+//		//System.out.println("!! drop all subcorpora: "+subcorpora.size());
+//		List<Subcorpus> subcorpora = getSubcorpora();
+//		while(subcorpora.size() > 0) {
+//			this.dropSubcorpus(subcorpora.get(0));
+//		}
+//	}
+//
+//	/**
+//	 * Drops a partition.
+//	 * 
+//	 * @param partition
+//	 *            the partition
+//	 * 
+//	 * @throws CqiClientException
+//	 *             the cqi client exception
+//	 */
+//	public void dropPartition(Partition partition) throws CqiClientException {
+//		Log.finest(TXMCoreMessages.info_deletingPartition + partition.getName());
+//		for (Part part : partition.getParts())
+//			try {
+//				CQPSearchEngine.getCqiClient().dropSubCorpus(part.getQualifiedCqpId());
+//			} catch (Exception e) {
+//				throw new CqiClientException(e);
+//			}
+//	}
+//
+//	/**
+//	 * Drop query result.
+//	 * 
+//	 * @param queryResult
+//	 *            the query result
+//	 * 
+//	 * @throws CqiClientException
+//	 *             the cqi client exception
+//	 */
+//	public void dropQueryResult(QueryResult queryResult)
+//			throws CqiClientException {
+//		Log.finest(TXMCoreMessages.DROP_QUERYRESULT + queryResult.getName());
+//		try {
+//			CQPSearchEngine.getCqiClient().dropSubCorpus(queryResult.getQualifiedCqpId());
+//		} catch (Exception e) {
+//			throw new CqiClientException(e);
+//		}
+//	}
+//
+//	/**
+//	 * Drops a subcorpus in CQP also its subcorpus and partitions.
+//	 * 
+//	 * @param subcorpus
+//	 *            the subcorpus
+//	 * 
+//	 * @throws CqiClientException
+//	 *             the cqi client exception
+//	 */
+//	public boolean dropSubcorpus(Corpus subcorpus) throws CqiClientException {
+//		Log.finest(NLS.bind(TXMCoreMessages.DROP_SUBCORPUS, subcorpus.getName()));
+//		subcorpus.dropAllSubcorpora();
+//		subcorpus.dropAllPartitions();
+//		try {
+//			CQPSearchEngine.getCqiClient().dropSubCorpus(subcorpus.getQualifiedCqpId());
+//		} catch (Exception e) {
+//			throw new CqiClientException(e);
+//		}
+//		return true;
+//	}
+//
+//
+//
+//
+
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#load()
+//	 */
+//	protected boolean _loadCorpus() {
+//		//System.out.println("*** Load corpus: "+name);
+//		if (getSelfElement() == null) {
+//			System.out.println(TXMCoreMessages.Corpus_14+this+TXMCoreMessages.Corpus_15);
+//			return false;
+//		}
+//
+//		// 1- texts queries then
+//		// 2- get metadatas, pattributes, sattributes, editions, biblios,  uis,
+//		super._load();  
+//		// System.out.println("Load corpus : "+this.name);
+//		this.loadMetadata(); // read <prop>s
+//
+//		// 3- build saved subcorpus and partition
+//		//System.out.println("restore subcorpora: "+selfElement);
+//		NodeList preBuildElems = getSelfElement().getElementsByTagName("preBuild"); //$NON-NLS-1$
+//		if (preBuildElems.getLength() > 0) {
+//			Element preBuildElem = (Element) preBuildElems.item(0);
+//			NodeList subcorpusElems = preBuildElem.getElementsByTagName("subcorpus"); //$NON-NLS-1$
+//			for (int i = 0 ; i < subcorpusElems.getLength() ; i++) {
+//				Element subcorpusElem = (Element) subcorpusElems.item(i);
+//				if (!subcorpusElem.getParentNode().equals(preBuildElem)) continue; //level 1 elements
+//				//System.out.println("subcorpus "+subcorpusElem.getAttribute("name"));
+//				try {
+//					Subcorpus subcorp = this.createSubcorpus(subcorpusElem);
+//					subcorp.load(subcorpusElem);
+//				} catch (CqiClientException e) {
+//					Log.warning(this.name + TXMCoreMessages.Corpus_12 + name
+//							+ " : " + e); //$NON-NLS-1$
+//				}
+//			}
+//
+//			NodeList partitionElems = preBuildElem.getElementsByTagName("partition"); //$NON-NLS-1$
+//			for (int i = 0 ; i < partitionElems.getLength() ; i++) {
+//				Element partitionElem = (Element) partitionElems.item(i);
+//				if (!partitionElem.getParentNode().equals(preBuildElem)) continue; //level 1 elements
+//				String name = partitionElem.getAttribute("name"); //$NON-NLS-1$
+//				List<String> names = new ArrayList<String>();
+//				List<String> queries = new ArrayList<String>();
+//
+//				NodeList partElems = partitionElem.getElementsByTagName("part"); //$NON-NLS-1$
+//				for (int j = 0; j < partElems.getLength(); j++) {
+//					Element part = (Element) partElems.item(j);
+//					names.add(part.getAttribute("name")); //$NON-NLS-1$
+//					queries.add(part.getAttribute("query")); //$NON-NLS-1$
+//				}
+//				try {
+//					//System.out.println("Create Partition with corpus "+this+" : "+name+", queries "+queries+", names "+names);
+//					Partition partition = this.createPartition(name, queries, names, true);
+//					partition.load(partitionElem);
+//				} catch (Exception e) {
+//					Log.warning(this.name + TXMCoreMessages.Corpus_19 + name
+//							+ " : " + e); //$NON-NLS-1$
+//					//c.getParentNode().removeChild(c);
+//				}
+//			}
+//		}
+//
+//		return true;
+//	}
+
+
+///*
+// * (non-Javadoc)
+// * 
+// * @see org.txm.searchengine.cqp.corpus.Corpus#getLocale()
+// */
+//@Override
+//protected boolean _loadSubcorpus() {
+//	if (getSelfElement() != null) {
+//		this.query = new Query(getSelfElement().getAttribute("query")); //$NON-NLS-1$
+//
+//		NodeList subcorpusElems = getSelfElement().getElementsByTagName("subcorpus"); //$NON-NLS-1$
+//		for (int i = 0 ; i < subcorpusElems.getLength() ; i++) {
+//			Element subcorpusElem = (Element) subcorpusElems.item(i);
+//			try {
+//				Subcorpus subcorp = this.createSubcorpus(subcorpusElem);
+//				subcorp.load(subcorpusElem);
+//			} catch (CqiClientException e) {
+//				Log.warning(this.name + TXMCoreMessages.Corpus_12 + name
+//						+ " : " + e); //$NON-NLS-1$
+//			}
+//		}
+//
+//		NodeList partitionElems = getSelfElement().getElementsByTagName("partition"); //$NON-NLS-1$
+//		for (int i = 0 ; i < partitionElems.getLength() ; i++) {
+//			Element partitionElem = (Element) partitionElems.item(i);
+//			String name = partitionElem.getAttribute("name"); //$NON-NLS-1$
+//			List<String> names = new ArrayList<String>();
+//			List<String> queries = new ArrayList<String>();
+//
+//			NodeList partElems = partitionElem.getElementsByTagName("part"); //$NON-NLS-1$
+//			for (int j = 0; j < partElems.getLength(); j++) {
+//				Element part = (Element) partElems.item(j);
+//				names.add(part.getAttribute("name")); //$NON-NLS-1$
+//				queries.add(part.getAttribute("query")); //$NON-NLS-1$
+//			}
+//			try {
+//				//System.out.println("Create Partition with corpus "+this+" : "+name+", queries "+queries+", names "+names);
+//				Partition partition = this.createPartition(name, queries, names, true);
+//				partition.load(partitionElem);
+//			} catch (Exception e) {
+//				Log.warning(this.name + TXMCoreMessages.Corpus_19 + name
+//						+ " : " + e); //$NON-NLS-1$
+//				//c.getParentNode().removeChild(c);
+//			}
+//		}
+//	}
+//	initSelectionResult();
+//	//System.out.println("Subcorpus.load: Selection of "+this+" = "+selectionResult);
+//	//return super.load();
+//	return true;
+//}
+
+//	/* (non-Javadoc)
+//	 * @see org.txm.objects.TxmObject#load()
+//	 */
+//	@Override
+//	protected boolean _loadPartition() {
+//		if (this.getUUID().length() > 0) return true; // partition already persisted
+//
+//		if (this.hasBeenComputedOnce) return true; // partition already computed
+//		
+//		if (this.getSelfElement() != null && this.getParent() != null) {
+//			NodeList partList = getSelfElement().getChildNodes();
+//			for (int i = 0; i < partList.getLength(); i++) {
+//				if (partList.item(i).getNodeType() == 1) {
+//					Element c = (Element) partList.item(i);
+//					if (c.getNodeName().equals("part")) //$NON-NLS-1$
+//					{
+//						String pname = c.getAttribute("name"); //$NON-NLS-1$
+//						String pshortname = c.getAttribute("shortname"); //$NON-NLS-1$
+//						String pquery = c.getAttribute("query"); //$NON-NLS-1$
+//						for (Part part : getParts())
+//							if (part.getName().equals(pname)) {
+//								part.setName(pname);
+//								part.setShortName(pshortname);
+//								part.setQuery(pquery);
+//							}
+//					}
+//				}
+//			}
+//			this.loadMetadata();
+//			return true;
+//		}
+//
+//		return false;
+//	}
+
+
+///**
+// * Creates the part.
+// *
+// * @param partitionName the partition name
+// * @param partName the part name
+// * @param query the query
+// * @return the part
+// * @throws CqiClientException the cqi client exception
+// */
+//private Part createPart(String partitionName, String partName, Query query)	throws CqiClientException {
+//	if (partName.length() == 0) {
+//		partName = "-"; //$NON-NLS-1$
+//	}
+//	return createPart(partitionName, partName, query.getQueryString());
+//}
+//
+///**
+// * Create a part with a raw query.
+// *
+// * @param partitionName the partition name
+// * @param partName the part name
+// * @param query the query
+// * @return the part
+// * @throws CqiClientException the cqi client exception
+// * 
+// * @author Sylvain Loiseau, mdecorde
+// */
+//public Part createPart(String partitionName, String partName, String query) throws CqiClientException {
+//	Part part;
+//	String partCqpId = CqpObject.partNamePrefix + Corpus.getNextSubcorpusCounter();
+//	Log.finest(NLS.bind(TXMCoreMessages.CREATING_PART,partName, query));
+//	long start = System.currentTimeMillis();
+//	try {
+//		CQPSearchEngine.getCqiClient().cqpQuery(this.getParent().getQualifiedCqpId(), partCqpId, query);
+//		part = new Part(partCqpId, partitionName, partName, this, new Query(query));
+//
+//		// FIXME: persistence tests: define the UUID as the concatenation of all part CQP id
+////		this.uniqueID += partCqpId;
+//
+//	} catch (Exception e) {
+//		try {
+//			throw new CqiClientException(TXMCoreMessages.Partition_9 + partitionName + "_" + partName + e + " last error: " + CQPSearchEngine.getCqiClient().getLastCQPError()); //$NON-NLS-1$ //$NON-NLS-2$
+//		} catch (Exception e1) {
+//			System.out.println(TXMCoreMessages.Partition_18+e1);
+//			org.txm.utils.logger.Log.printStackTrace(e1);
+//			return null;
+//		}
+//	}
+//	long end = System.currentTimeMillis();
+//	Log.finest(NLS.bind(TXMCoreMessages.info_partCreatedInXMs, partitionName + "_" + partName, (end - start))); //$NON-NLS-1
+//
+//	return part;
+//}
\ No newline at end of file

Property changes on: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/creationdelete partition et subcorpus.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 1037)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 1038)
@@ -40,7 +40,7 @@
 
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.objects.TxmObject;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.CQPSearchEngine;
@@ -111,8 +111,8 @@
 	@Override
 	public boolean export(File exportzip, IProgressMonitor monitor)
 	{
-		if (this.getBase() != null)
-			return this.getBase().export(exportzip, monitor);
+		if (this.getProject() != null)
+			return this.getProject().export(exportzip, monitor);
 		return false;
 	}
 	
@@ -340,7 +340,7 @@
 		boolean ret = super._load();
 		
 		// FIXME: test to create a project scope
-//		CorpusScope scope = new CorpusScope(this.getName(), this.getBaseDirectory());
+//		CorpusScope scope = new CorpusScope(this.getName(), this.getProjectDirectory());
 //		CorpusScope.addScope(scope);
 		
 		return ret;
@@ -353,7 +353,7 @@
 	@Override
 	public boolean delete() {
 		removeFromCWB();
-		Base b = this.getBase();
+		Project b = this.getProject();
 		if (b != null) b.delete();
 		
 		// FIXME: test to remove the project scope
@@ -376,7 +376,7 @@
 	 *
 	 * @param base the new parent
 	 */
-	public void setParent(Base base) {
+	public void setParent(Project base) {
 		this.parent = base;
 	}
 
@@ -398,17 +398,17 @@
 		CorpusManager.deleteCorpus(this);
 
 		// delete binaries
-		File binaries = this.getBaseDirectory();
+		File binaries = this.getProjectDirectory();
 		System.out.println(TXMCoreMessages.MainCorpus_2+binaries);
 		return DeleteDir.deleteDirectory(binaries);
 	}
 
 	/* (non-Javadoc)
-	 * @see org.txm.searchengine.cqp.corpus.Corpus#getBase()
+	 * @see org.txm.searchengine.cqp.corpus.Corpus#getProject()
 	 */
 	@Override
-	public Base getBase() {
-		return (Base) getParent();
+	public Project getProject() {
+		return (Project) getParent();
 	}
 
 
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 1037)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 1038)
@@ -34,7 +34,7 @@
 import org.eclipse.osgi.util.NLS;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.TXMParameters;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.objects.TxmObject;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.NetCqiClient;
@@ -381,15 +381,15 @@
 	}
 
 	/* (non-Javadoc)
-	 * @see org.txm.searchengine.cqp.corpus.Corpus#getBase()
+	 * @see org.txm.searchengine.cqp.corpus.Corpus#getProject()
 	 */
 	@Override
-	public Base getBase() {
+	public Project getProject() {
 		TxmObject o = getParent();
-		if (o instanceof Base)
-			return (Base)o;
+		if (o instanceof Project)
+			return (Project)o;
 		else if (o instanceof Corpus)
-			return ((Corpus)o).getBase();
+			return ((Corpus)o).getProject();
 		else 	
 			return null;
 	}
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 1037)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java	(revision 1038)
@@ -15,7 +15,7 @@
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.importer.cwb.PatchCwbRegistry;
 import org.txm.libs.cqp.CQPLibPreferences;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.searchengine.core.SearchEngine;
 import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
 import org.txm.searchengine.cqp.corpus.CorpusManager;
@@ -64,8 +64,8 @@
 
 		String reg_path = ""; // new way that concats registry of loaded corpus
 		String path_separator = System.getProperty("path.separator");
-		for (Base b : Toolbox.workspace.getProject("default").getBases()) {
-			File binDir = b.getBaseDirectory();
+		for (Project b : Toolbox.workspace.getProjects()) {
+			File binDir = b.getProjectDirectory();
 			File registryDir = new File(binDir, "registry");
 			reg_path += path_separator + registryDir.getAbsolutePath();
 			File[] files = registryDir.listFiles();
@@ -200,7 +200,7 @@
 
 		// initialize pre-configured subcorpus and partition of corpus registered in the default.xml workspace file
 		System.out.print(TXMCoreMessages.Toolbox_workspace_init);
-		for (Base b : Toolbox.workspace.getProject("default").getBases()) {
+		for (Project b : Toolbox.workspace.getProjects()) {
 			
 			Log.info("Loading CQP corpora of " + b.getName() + " corpus...");
 			
@@ -214,10 +214,10 @@
 		return state;
 	}
 
-	public boolean loadCQPCorpora(Base base, IProgressMonitor monitor) {
+	public boolean loadCQPCorpora(Project base, IProgressMonitor monitor) {
 		//System.out.println("Load corpus from params: "+params.corpora);
-		for (String corpusname : base.getBaseParameters().corpora.keySet()) {
-			Element c = base.getBaseParameters().corpora.get(corpusname);
+		for (String corpusname : base.getProjectParameters().corpora.keySet()) {
+			Element c = base.getProjectParameters().corpora.get(corpusname);
 			try {
 				MainCorpus corp = CorpusManager.getCorpusManager().getCorpus(corpusname);
 				if (monitor != null) {
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/selection/Selection.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/selection/Selection.java	(revision 1037)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/selection/Selection.java	(revision 1038)
@@ -115,7 +115,7 @@
 	 */
 	private boolean init() {
 		try {
-			if (corpus.getBase() == null) {
+			if (corpus.getProject() == null) {
 				System.out.println(TXMCoreMessages.Selection_6+corpus+TXMCoreMessages.Selection_7);
 				return false;
 			}
Index: tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java
===================================================================
--- tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 1037)
+++ tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java	(revision 1038)
@@ -60,7 +60,7 @@
 import org.eclipse.ui.part.ViewPart;
 import org.txm.Toolbox;
 import org.txm.core.results.TXMResult;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.rcp.IImageKeys;
 import org.txm.rcp.commands.R.CopySelection;
 import org.txm.rcp.handlers.files.EditFile;
@@ -449,9 +449,9 @@
 		 */
 		@Override
 		public Object[] getElements(Object element) {
-			Collection<Base> input = (Collection<Base>) element;
+			Collection<Project> input = (Collection<Project>) element;
 			Object[] objects = new Object[input.size()];
-			Iterator<Base> it = input.iterator();
+			Iterator<Project> it = input.iterator();
 			int i = 0;
 			while (it.hasNext()) {
 				objects[i] = it.next();
Index: tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/RecodeCorpus.java
===================================================================
--- tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/RecodeCorpus.java	(revision 1037)
+++ tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/RecodeCorpus.java	(revision 1038)
@@ -107,7 +107,7 @@
 		// update corpus indexes and edition
 		String txmhome = Toolbox.getTxmHomePath();
 
-		BaseParameters params = corpus.getBase().getBaseParameters();
+		BaseParameters params = corpus.getProject().getProjectParameters();
 		params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
 		params.getKeyValueParameters().put(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
 		params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "true");
Index: tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Apply.java
===================================================================
--- tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Apply.java	(revision 1037)
+++ tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Apply.java	(revision 1038)
@@ -65,7 +65,7 @@
 	
 	public static void apply(Corpus corpus, final File model, final String[] properties, final String[] options) {
 		final MainCorpus mainCorpus = corpus.getMainCorpus();
-		final File corpusBinaryDirectory = mainCorpus.getBaseDirectory();
+		final File corpusBinaryDirectory = mainCorpus.getProjectDirectory();
 		final File txmDirectory = new File(corpusBinaryDirectory, "txm/"+mainCorpus.getName());
 		
 		if (!txmDirectory.exists()) {
Index: tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/LemmaProjection.java
===================================================================
--- tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/LemmaProjection.java	(revision 1037)
+++ tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/LemmaProjection.java	(revision 1038)
@@ -93,7 +93,7 @@
 	public static void apply(final Corpus corpus, final File dictionary, final File extrarules, final String posproperty, 
 			final String targetproperty, final LinkedHashSet<String> formAsLemmaPosList, final LinkedHashSet<String> sourceprioritylist) {
 		final MainCorpus mainCorpus = corpus.getMainCorpus();
-		final File corpusBinaryDirectory = mainCorpus.getBaseDirectory();
+		final File corpusBinaryDirectory = mainCorpus.getProjectDirectory();
 		final File txmDirectory = new File(corpusBinaryDirectory, "txm/"+mainCorpus.getName());
 
 		if (!txmDirectory.exists()) {
@@ -256,7 +256,7 @@
 					// update corpus indexes and edition
 					//					String txmhome = Toolbox.getTxmHomePath();
 					//
-					//					BaseParameters params = corpus.getBase().getBaseParameters();
+					//					BaseParameters params = corpus.getProject().getProjectParameters();
 					//					params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
 					//					params.getKeyValueParameters().put(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
 					//					params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "true");
Index: tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/RemoveProperties.java
===================================================================
--- tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/RemoveProperties.java	(revision 1037)
+++ tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/RemoveProperties.java	(revision 1038)
@@ -74,7 +74,7 @@
 
 	public static void apply(final Corpus corpus, final HashSet<String> propertiesSet) {
 		final MainCorpus mainCorpus = corpus.getMainCorpus();
-		final File corpusBinaryDirectory = mainCorpus.getBaseDirectory();
+		final File corpusBinaryDirectory = mainCorpus.getProjectDirectory();
 		final File txmDirectory = new File(corpusBinaryDirectory, "txm/"+mainCorpus.getName());
 
 		if (!txmDirectory.exists()) {
Index: tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Train.java
===================================================================
--- tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Train.java	(revision 1037)
+++ tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Train.java	(revision 1038)
@@ -105,7 +105,7 @@
 				try {
 					File lexique2 = lexique;
 					MainCorpus mainCorpus = corpus.getMainCorpus();
-					File corpusBinaryDirectory = mainCorpus.getBaseDirectory();
+					File corpusBinaryDirectory = mainCorpus.getProjectDirectory();
 					
 					System.out.println("TRAIN : "+corpus+" with "+lexique2+" to create "+model+ " with properties "+Arrays.toString(properties));
 
@@ -126,7 +126,7 @@
 					Property lemma = corpus.getProperty(properties[1]);
 					
 					// Prepare temporary directory
-					File treetaggerSrcDirectory = new File(mainCorpus.getBaseDirectory(), "treetagger");
+					File treetaggerSrcDirectory = new File(mainCorpus.getProjectDirectory(), "treetagger");
 					DeleteDir.deleteDirectory(treetaggerSrcDirectory);
 					treetaggerSrcDirectory.mkdirs();
 					
Index: tmp/org.txm.analec.rcp/src/org/txm/macro/analec/export/ExportAsMacro.groovy
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/macro/analec/export/ExportAsMacro.groovy	(revision 1037)
+++ tmp/org.txm.analec.rcp/src/org/txm/macro/analec/export/ExportAsMacro.groovy	(revision 1038)
@@ -51,7 +51,7 @@
 	return false
 }
 
-File binDirectory = mainCorpus.getBaseDirectory()
+File binDirectory = mainCorpus.getProjectDirectory()
 String binName = binDirectory.getName()
 
 
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/AnalecCorpora.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/AnalecCorpora.java	(revision 1037)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/AnalecCorpora.java	(revision 1038)
@@ -27,8 +27,8 @@
 	 * @return the Corpus loaded and stored
 	 */
 	public static Corpus getCorpus(MainCorpus mcorpus) {
-		File fichierCorpus = new File(mcorpus.getBaseDirectory(), "analec/"+mcorpus+".ec"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		File fichierVue = new File(mcorpus.getBaseDirectory(), "analec/"+mcorpus+".ecv");
+		File fichierCorpus = new File(mcorpus.getProjectDirectory(), "analec/"+mcorpus+".ec"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		File fichierVue = new File(mcorpus.getProjectDirectory(), "analec/"+mcorpus+".ecv");
 		Corpus corpus = null;
 		if (AnalecCorpora.corpora.containsKey(mcorpus)) {
 			corpus = AnalecCorpora.corpora.get(mcorpus);
@@ -110,7 +110,7 @@
 	public static boolean saveCorpus(MainCorpus mcorpus) {
 		Corpus corpus = getCorpus(mcorpus);
 		Vue vue = getVue(mcorpus);
-		File dir = new File(mcorpus.getBaseDirectory(), "analec/"); //$NON-NLS-1$ //$NON-NLS-2$
+		File dir = new File(mcorpus.getProjectDirectory(), "analec/"); //$NON-NLS-1$ //$NON-NLS-2$
 		dir.mkdir();
 		File fichierCorpus = new File(dir,mcorpus+".ec"); //$NON-NLS-1$
 		File fichierVueCorpus = new File(dir,mcorpus+".ecv"); //$NON-NLS-1$
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveVue.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveVue.java	(revision 1037)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveVue.java	(revision 1038)
@@ -34,7 +34,7 @@
 		MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.Corpus)first).getMainCorpus();
 		corpus = AnalecCorpora.getCorpus(mainCorpus);
 
-		File binaryCorpusDirectory = mainCorpus.getBaseDirectory();
+		File binaryCorpusDirectory = mainCorpus.getProjectDirectory();
 		File fichierVue = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getName()+".ecv"); //$NON-NLS-1$ //$NON-NLS-2$
 		System.out.println(Messages.SaveVue_3+corpus+Messages.SaveVue_4+fichierVue);
 
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructure.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructure.java	(revision 1037)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveStructure.java	(revision 1038)
@@ -37,7 +37,7 @@
 	public static boolean save(MainCorpus mainCorpus) {
 		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 
-		File binaryCorpusDirectory = mainCorpus.getBaseDirectory();
+		File binaryCorpusDirectory = mainCorpus.getProjectDirectory();
 		File fichierStructure = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getName()+".ecs"); //$NON-NLS-1$ //$NON-NLS-2$
 		System.out.println(Messages.SaveStructure_3+corpus+Messages.SaveStructure_4+fichierStructure);
 
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveCorpus.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveCorpus.java	(revision 1037)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/SaveCorpus.java	(revision 1038)
@@ -43,7 +43,7 @@
 	}
 
 	public static boolean save(final MainCorpus mainCorpus, ExecutionEvent event) {
-		File binaryCorpusDirectory = mainCorpus.getBaseDirectory();
+		File binaryCorpusDirectory = mainCorpus.getProjectDirectory();
 		File fichierCorpus = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getName()+".ec"); //$NON-NLS-1$ //$NON-NLS-2$
 		Corpus corpus = AnalecCorpora.getCorpus(mainCorpus);
 		System.out.println(Messages.SaveCorpus_3+corpus+Messages.SaveCorpus_1+fichierCorpus);
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEICorpus.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEICorpus.java	(revision 1037)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/commands/ImportTEICorpus.java	(revision 1038)
@@ -125,7 +125,7 @@
 				protected IStatus run(IProgressMonitor monitor) {
 					try {
 					MainCorpus corpus = CorpusManager.getCorpusManager().getCorpus(name.toUpperCase());
-					File analecDirectory = new File(corpus.getBaseDirectory(), "analec"); //$NON-NLS-1$
+					File analecDirectory = new File(corpus.getProjectDirectory(), "analec"); //$NON-NLS-1$
 					analecDirectory.mkdirs();
 					Corpus analecCorpus = AnalecCorpora.getCorpus(corpus);
 					analecCorpus.clearAll(); // remove all : annotations, structure
Index: tmp/org.txm.analec.rcp/src/org/txm/analec/export/AnalecAnnotationTEIExporter.java
===================================================================
--- tmp/org.txm.analec.rcp/src/org/txm/analec/export/AnalecAnnotationTEIExporter.java	(revision 1037)
+++ tmp/org.txm.analec.rcp/src/org/txm/analec/export/AnalecAnnotationTEIExporter.java	(revision 1038)
@@ -174,7 +174,7 @@
 		System.out.println("Processing text: "+textid);
 
 		// 1) copy the XML-TXM file
-		File xmltxmFileFromBin = new File(mainCorpus.getBaseDirectory(), "txm/"+mainCorpus.getName().toUpperCase()+"/"+textid+".xml");
+		File xmltxmFileFromBin = new File(mainCorpus.getProjectDirectory(), "txm/"+mainCorpus.getName().toUpperCase()+"/"+textid+".xml");
 		if (!xmltxmFileFromBin.exists()) {
 			System.out.println("Error: could not find the XML-TXM reference file: "+xmltxmFileFromBin);
 			return false;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/ApplyXQueryMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/ApplyXQueryMacro.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/ApplyXQueryMacro.groovy	(revision 1038)
@@ -45,7 +45,7 @@
 }
 
 MainCorpus mainCorpus = ((Corpus)corpusViewSelection).getMainCorpus();
-File binDir = mainCorpus.getBaseDirectory();
+File binDir = mainCorpus.getProjectDirectory();
 File txmDir = new File(binDir, "txm/"+mainCorpus.getName());
 
 if (!txmDir.exists()) {
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/cqp/SaveSubCorpusMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/cqp/SaveSubCorpusMacro.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/cqp/SaveSubCorpusMacro.groovy	(revision 1038)
@@ -32,7 +32,7 @@
 
 MainCorpus maincorpus = corpusViewSelection.getMainCorpus()
 File outputFile = new File(outputDir, corpusViewSelection.getQualifiedCqpId())
-File regFile = new File(maincorpus.getBaseDirectory(), "registry")
+File regFile = new File(maincorpus.getProjectDirectory(), "registry")
 if (!regFile.exists()) {
 	println "Could not find corpus registry file $regFile"
 	return
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/edition/XTZEditionBuilderMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/edition/XTZEditionBuilderMacro.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/prototypes/edition/XTZEditionBuilderMacro.groovy	(revision 1038)
@@ -39,13 +39,13 @@
 if (!ParametersDialog.open(this)) return;
 // END OF PARAMETERS
 
-File binDirectory = corpus.getBase().getBaseDirectory()
+File binDirectory = corpus.getProject().getProjectDirectory()
 File txmDirectory = new File(binDirectory, "txm/"+corpus.getName().toUpperCase())
 
 File HTMLDirectory = new File(binDirectory, "HTML")
 File newEditionDirectory = new File(HTMLDirectory, corpus.getName().toUpperCase()+"/"+editionName)
 
-BaseParameters parameters = corpus.getBase().params
+BaseParameters parameters = corpus.getProject().params
 
 if (!HTMLDirectory.exists()) {
 	println "ERROR: can't find this corpus 'HTML' directory: $HTMLDirectory. Aborting"
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/EditionUpdaterMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/EditionUpdaterMacro.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/EditionUpdaterMacro.groovy	(revision 1038)
@@ -65,9 +65,9 @@
 if (args.size() == 0) { // corpus informations
 	defaultEditionName = corpus.getDefaultEdition()
 	corpusName = corpus.getName()
-	binDirectory = corpus.getBase().getBaseDirectory()
+	binDirectory = corpus.getProject().getProjectDirectory()
 	txmDirectory = new File(binDirectory, "txm/"+corpusName.toUpperCase())
-	params = corpus.getBase().params
+	params = corpus.getProject().params
 } else { // the "corpus" variable does not exists
 	defaultEditionName = "default"
 	binDirectory = args["binDirectory"]
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/FacsEditionBuilderMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/FacsEditionBuilderMacro.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/FacsEditionBuilderMacro.groovy	(revision 1038)
@@ -58,12 +58,12 @@
 }
 
 if (args.size() == 0) { // the "corpus" variable exists
-	binDirectory = corpus.getBase().getBaseDirectory()
+	binDirectory = corpus.getProject().getProjectDirectory()
 	txmDirectory = new File(binDirectory, "txm/"+corpus.getName().toUpperCase())
 	tokenizedDirectory = new File(binDirectory, "tokenized")
 	HTMLDirectory = new File(binDirectory, "HTML")
 	newEditionDirectory = new File(HTMLDirectory, corpus.getName().toUpperCase()+"/"+editionName)
-	params = corpus.getBase().params
+	params = corpus.getProject().params
 } else { // the "corpus" variable does not exist, get informations from the "args" map
 	binDirectory = args["binDirectory"]
 	txmDirectory = args["txmDirectory"]
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/prototypes/CQPBenchmark.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/prototypes/CQPBenchmark.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/prototypes/CQPBenchmark.groovy	(revision 1038)
@@ -40,7 +40,7 @@
 import org.txm.utils.DeleteDir;
 import org.txm.*;
 import org.txm.lexicaltable.core.functions.LexicalTable
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.ca.core.functions.CA
 import org.txm.ahc.core.functions.AHC
 import org.txm.concordance.core.functions.Concordance
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bvh/bvhLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bvh/bvhLoader.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bvh/bvhLoader.groovy	(revision 1038)
@@ -67,7 +67,7 @@
 		encoding= "UTF-8";// not used by bvh
 		model="rgaqcj"; //not used by bvh
 		basename="bvh"
-		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/qgraalLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/qgraalLoader.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/graal/qgraalLoader.groovy	(revision 1038)
@@ -50,7 +50,7 @@
 //	if(!org.txm.Toolbox.isInitialized())
 //	{
 //		rootDir = userDir+"/xml/qgraal/";
-//		org.txm.Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+//		org.txm.Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 //		org.txm.Toolbox.setParam(org.txm.Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
 //	}
 //}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/pager.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/pager.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/pager.groovy	(revision 1038)
@@ -412,7 +412,7 @@
 		println "DEV MODE";//exception means we debug
 		if(!org.txm.Toolbox.isInitialized()){
 			rootDir = "D:\\Travail_Sev\\Projets\\Corpus\\TXM\\hyperprince"; //userDir+"/xml/hyperprince/";//"D:\\Travail_Sev\\Projets\\Corpus\\TXM\\hyperprince";
-			org.txm.Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+			org.txm.Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 			org.txm.Toolbox.setParam(org.txm.Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
 		}
 		
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/hyperprinceLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/hyperprinceLoader.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperprince/hyperprinceLoader.groovy	(revision 1038)
@@ -57,7 +57,7 @@
 		lang="fr";
 		encoding= "UTF-8";
 		model="rgaqcj";
-		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
 		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/lasla/laslaLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/lasla/laslaLoader.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/lasla/laslaLoader.groovy	(revision 1038)
@@ -63,7 +63,7 @@
 		lang="fr";
 		encoding= "ISO-8859-1";
 		model="rgaqcj";//not used
-		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,"/usr/lib/TXM");
 		Toolbox.setParam(Toolbox.METADATA_ENCODING, "UTF-8");
 		Toolbox.setParam(Toolbox.METADATA_COLSEPARATOR, ",");
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/perrault/perraultLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/perrault/perraultLoader.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/perrault/perraultLoader.groovy	(revision 1038)
@@ -61,7 +61,7 @@
 		lang="fr";
 		encoding= "UTF-8"; // not used
 		model="fr";
-		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"txminstall"));
 		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"txminstall/treetagger"));
 		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"txminstall/treetagger/models"));
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/corptef/corptefLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/corptef/corptefLoader.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/corptef/corptefLoader.groovy	(revision 1038)
@@ -61,7 +61,7 @@
 		lang="fr";
 		encoding= "UTF-8";
 		model="rgaqcj";
-		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"txminstall"));
 		Toolbox.setParam(Toolbox.TREETAGGER_INSTALL_PATH,new File(userDir,"txminstall/treetagger"));
 		Toolbox.setParam(Toolbox.TREETAGGER_MODELS_PATH,new File(userDir,"txminstall/treetagger/models"));
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/RGAQCJ/rgaqcjLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/RGAQCJ/rgaqcjLoader.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/RGAQCJ/rgaqcjLoader.groovy	(revision 1038)
@@ -59,7 +59,7 @@
 		lang="fr";
 		encoding= "UTF-8";
 		model="rgaqcj";// not used
-		Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
+		Toolbox.workspace = new Workspace(new File(userDir,"TXM/corpora/default.xml"));
 		Toolbox.setParam(Toolbox.INSTALL_DIR,new File(userDir,"txminstall"));
 		Toolbox.setParam(Toolbox.USER_TXM_HOME, new File(System.getProperty("user.home"),"TXM"));
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/Tmx2XmlFiles.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/Tmx2XmlFiles.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/Tmx2XmlFiles.groovy	(revision 1038)
@@ -39,7 +39,7 @@
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.stream.*;
 
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TokenizerXml.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TokenizerXml.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/TokenizerXml.groovy	(revision 1038)
@@ -54,7 +54,7 @@
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/OldSimpleTokenizerXml.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/OldSimpleTokenizerXml.groovy	(revision 1037)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/filters/Tokeniser/OldSimpleTokenizerXml.groovy	(revision 1038)
@@ -55,7 +55,7 @@
 import javax.xml.transform.stream.StreamResult;
 
 import org.txm.scripts.importer.graal.PersonalNamespaceContext;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
Index: tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java
===================================================================
--- tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 1037)
+++ tmp/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/OpenEdition.java	(revision 1038)
@@ -119,7 +119,7 @@
 		return null;
 	}
 	public static String[] getDefaultEditions(Corpus c) {
-		BaseParameters params = c.getBase().getBaseParameters();
+		BaseParameters params = c.getProject().getProjectParameters();
 		Element editionsElement = params.getEditionsElement(params.getCorpusElement());
 		return editionsElement.getAttribute("default").split(","); //$NON-NLS-1$ //$NON-NLS-2$
 	}
Index: tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java
===================================================================
--- tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java	(revision 1037)
+++ tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java	(revision 1038)
@@ -44,7 +44,7 @@
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.properties.core.messages.PropertiesCoreMessages;
 import org.txm.properties.core.preferences.PropertiesPreferences;
 import org.txm.searchengine.cqp.AbstractCqiClient;
@@ -461,8 +461,8 @@
 	 *
 	 * @return the base
 	 */
-	public Base getBase() {
-		return corpus.getBase();
+	public Project getBase() {
+		return corpus.getProject();
 	}
 
 	/**
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/RemoveProject.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/RemoveProject.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/RemoveProject.java	(revision 1038)
@@ -61,7 +61,7 @@
 		}
 
 		if (p != null)
-			p.getWorkspace().removeProject(p.getName());
+			p.delete();
 
 		BasesView.refresh();
 		return null;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/PurgeCorpora.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/PurgeCorpora.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/PurgeCorpora.java	(revision 1038)
@@ -99,7 +99,7 @@
 						}
 						registry.mkdir();
 						System.out.println(TXMUIMessages.PurgeCorpora_10);
-						File xmlfile = new File(workspace, "workspaces/default.xml"); //$NON-NLS-1$
+						File xmlfile = new File(workspace, "corpora/default.xml"); //$NON-NLS-1$
 						this.acquireSemaphore();
 						Toolbox.workspace = Workspace.createEmptyWorkspaceDefinition(xmlfile);
 						this.releaseSemaphore();
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/RemoveBase.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/RemoveBase.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/RemoveBase.java	(revision 1038)
@@ -35,7 +35,7 @@
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.handlers.HandlerUtil;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.rcp.views.BasesView;
 // TODO: Auto-generated Javadoc
 /**
@@ -49,19 +49,19 @@
 	@Override
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		System.out.println(""); //$NON-NLS-1$
-		Base p = null;
+		Project p = null;
 		ISelection selection = HandlerUtil.getCurrentSelection(event);
 		if (selection != null & selection instanceof IStructuredSelection) {
 			IStructuredSelection strucSelection = (IStructuredSelection) selection;
 			for (Iterator<Object> iterator = strucSelection.iterator(); iterator
 					.hasNext();) {
-				p = (Base) iterator.next();
+				p = (Project) iterator.next();
 				break;
 			}
 		}
 
 		if (p != null)
-			p.getProject().removeBase(p.getName());
+			p.delete();
 
 		BasesView.refresh();
 		return null;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java	(revision 1038)
@@ -17,7 +17,7 @@
 import org.txm.core.engines.EngineType;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.importer.Convert5To6;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.rcp.commands.RestartTXM;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.utils.JobHandler;
@@ -53,7 +53,7 @@
 						converter.start();
 						this.releaseSemaphore();
 
-						Base base = LoadBinaryCorpus.loadBinaryCorpus(outdir);
+						Project base = LoadBinaryCorpus.loadBinaryCorpus(outdir);
 						if (base == null) {
 							System.out.println(TXMUIMessages.ConvertCorpus_0);
 							return Status.CANCEL_STATUS;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 1038)
@@ -44,7 +44,7 @@
 		
 		String txmhome = Toolbox.getTxmHomePath();
 		
-		BaseParameters params = corpus.getBase().getBaseParameters();
+		BaseParameters params = corpus.getProject().getProjectParameters();
 		params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
 		params.getKeyValueParameters().put(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
 		params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "true");
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/AddProject.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/AddProject.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/AddProject.java	(revision 1038)
@@ -30,6 +30,7 @@
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.views.BasesView;
 
+import java.io.File;
 import java.util.Iterator;
 
 import org.eclipse.core.commands.AbstractHandler;
@@ -41,6 +42,7 @@
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.objects.BaseParameters;
 import org.txm.objects.Project;
 import org.txm.objects.Workspace;
 
@@ -78,8 +80,15 @@
 			name = dlg.getValue();
 		}
 
-		if (w != null && name != null && !name.matches("")) //$NON-NLS-1$
-			w.addProject(name);
+		if (w != null && name != null && !name.matches(""))
+			try {
+				File paramFile = w.getDirectory();
+				BaseParameters.createEmptyParams(paramFile, name);;
+				new Project(w, new BaseParameters(paramFile));
+			} catch (Exception e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
 		BasesView.refresh();
 		return null;
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java	(revision 1038)
@@ -48,8 +48,8 @@
 import org.txm.Toolbox;
 import org.txm.core.engines.EngineType;
 import org.txm.core.preferences.TBXPreferences;
-import org.txm.objects.Base;
 import org.txm.objects.Project;
+import org.txm.objects.Project;
 import org.txm.objects.Workspace;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.commands.RestartTXM;
@@ -157,7 +157,7 @@
 							continue;
 						}
 
-						Base base = LoadBinaryCorpus.loadBinaryCorpus(corpusDirectory);
+						Project base = LoadBinaryCorpus.loadBinaryCorpus(corpusDirectory);
 						if (base == null) {
 							System.out.println("Fail to load binary corpus: "+corpusDirectory);
 						}
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 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java	(revision 1038)
@@ -44,8 +44,8 @@
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.Toolbox;
 import org.txm.core.engines.EngineType;
-import org.txm.objects.Base;
 import org.txm.objects.Project;
+import org.txm.objects.Project;
 import org.txm.objects.Workspace;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.commands.RestartTXM;
@@ -193,7 +193,7 @@
 					monitor.worked(50);
 
 					monitor.subTask(TXMUIMessages.AddBase_32);
-					Base base = loadBinaryCorpus(new File(corporaDir, basedirname));
+					Project base = loadBinaryCorpus(new File(corporaDir, basedirname));
 					if (base == null) {
 						System.out.println(TXMUIMessages.AddBase_4);
 						return Status.CANCEL_STATUS;
@@ -208,7 +208,7 @@
 					Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
 					this.releaseSemaphore();
 
-					final Base base2 = Toolbox.workspace.getDefaultProject().getBase(base.getName()); //$NON-NLS-1$
+					final Project base2 = Toolbox.workspace.getProject(base.getName()); //$NON-NLS-1$
 					if (base2 == null) {
 						System.out.println(TXMUIMessages.LoadBinaryCorpus_4);
 						return null;
@@ -279,7 +279,7 @@
 	 * @return the base
 	 * @throws Exception the exception
 	 */
-	public static Base loadBinaryCorpus(File binCorpusDirectory) throws Exception {
+	public static Project loadBinaryCorpus(File binCorpusDirectory) throws Exception {
 		if (!(binCorpusDirectory.exists() && binCorpusDirectory.isDirectory())) {
 			Log.severe(NLS.bind(TXMUIMessages.AddBase_24, binCorpusDirectory.getAbsolutePath()));
 			System.out.println(NLS.bind(TXMUIMessages.AddBase_24, binCorpusDirectory.getAbsolutePath()));
@@ -290,24 +290,13 @@
 		//txmregistry.mkdir();
 		File txmcorpora = new File(Toolbox.getTxmHomePath(), "corpora"); //$NON-NLS-1$
 		txmcorpora.mkdir();
-
-		Workspace w = org.txm.Toolbox.workspace;
-		if (w == null) {
-			System.out.println(TXMUIMessages.AddBase_34);
-			return null;
-		}
-		Project p = w.getProject("default"); //$NON-NLS-1$
-		if (p == null) {
-			System.out.println(TXMUIMessages.AddBase_34);
-			return null;
-		}
-		Base base = p.scanDirectory(binCorpusDirectory);
+		Project base = Toolbox.workspace.scanDirectory(binCorpusDirectory);
 		if (base == null) {
 			Log.severe(NLS.bind(TXMUIMessages.AddBase_2, binCorpusDirectory)); 
 			return null;
 		}
 
-		w.save();
+		Toolbox.workspace.save();
 		return base;
 	}
 }
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportSelectedText.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportSelectedText.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/ImportSelectedText.java	(revision 1038)
@@ -78,16 +78,10 @@
 			return null;
 		}
 		System.out.println(TXMUIMessages.ImportSelectedText_0);
-		Project projet;
+
 		try {
-			projet = Toolbox.workspace.getProject("default"); //$NON-NLS-1$
-		} catch (Exception e) {
-			System.out.println(TXMUIMessages.ImportSelectedText_6+e);
-			return null;
-		}
-		try {
 			String corpusName = TXMUIMessages.ImportSelectedText_1+(nextclipcorpus++);
-			while (projet.getBase(corpusName) != null)
+			while (Toolbox.workspace.getProject(corpusName) != null)
 				corpusName = TXMUIMessages.ImportSelectedText_1+(nextclipcorpus++);
 			importText(result, corpusName);
 		} catch (Exception e) {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 1038)
@@ -84,7 +84,8 @@
 import org.txm.Toolbox;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
+import org.txm.objects.Project;
 import org.txm.rcp.commands.OpenWelcomePage;
 import org.txm.rcp.commands.RestartTXM;
 import org.txm.rcp.commands.workspace.LoadBinaryCorpus;
@@ -847,7 +848,7 @@
 						continue;
 					}
 
-					Base base = LoadBinaryCorpus.loadBinaryCorpus(basedir);
+					Project base = LoadBinaryCorpus.loadBinaryCorpus(basedir);
 					if (base != null) {
 						basenames.add(base.getName());
 						sampleCorpusLoaded.add(base.getName());
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java	(revision 1038)
@@ -86,7 +86,7 @@
 			// FIXME: need to check that all has been well moved in Workspace class or build.properties
 //		} else if (argsList.contains("-standalone")) { //$NON-NLS-1$
 //			File userhomeDirectory = new File("workspace").getAbsoluteFile(); // eclipse default workspace directory
-//			File defaultWorkspaceFile = new File("workspace/workspaces/default.xml");
+//			File defaultWorkspaceFile = new File("workspace/corpora/default.xml");
 //			if (!defaultWorkspaceFile.exists()) {
 //				System.out.println("Stand alone launch, creating minimal TXM user home directory in "+userhomeDirectory.getAbsolutePath());
 //				System.out.println("Sample corpora, scripts, import scripts and macros files are not yet installed.");
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/AdapterFactory.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/AdapterFactory.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/AdapterFactory.java	(revision 1038)
@@ -77,7 +77,7 @@
 				if (firstCorpusDiag) {	
 					firstCorpusDiag = false;
 					for (MainCorpus corpus : corpora) {
-						if (corpus.getBase() == null) {
+						if (corpus.getProject() == null) {
 							System.out.println(NLS.bind(TXMUIMessages.AdapterFactory_0, corpus));
 						}
 					}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/TXMResultContentProvider.java	(revision 1038)
@@ -37,8 +37,8 @@
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.ui.model.IWorkbenchAdapter;
 import org.txm.core.results.TXMResult;
-import org.txm.objects.Base;
 import org.txm.objects.Project;
+import org.txm.objects.Workspace;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 
 /**
@@ -101,11 +101,11 @@
 	 */
 	@Override
 	public Object[] getElements(Object element) {
-		if (element instanceof Project) {
+		if (element instanceof Workspace) {
 			ArrayList<MainCorpus> elements = new ArrayList<MainCorpus>();
-			Project p = (Project) element;
+			Workspace p = (Workspace) element;
 
-			for (Base b : p.getBases()) {
+			for (Project b : p.getProjects()) {
 				for (TXMResult o : b.getChildren(MainCorpus.class)) {
 					elements.add((MainCorpus)o);
 				}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/corpora/CorporaView.java	(revision 1038)
@@ -175,8 +175,7 @@
 			
 			Workspace w = Toolbox.workspace;
 			if (w == null) return;
-			Project p = w.getProject("default"); //$NON-NLS-1$
-			treeViewer.setInput(p);
+			treeViewer.setInput(w);
 			treeViewer.refresh();
 		}
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/BasesView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/BasesView.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/BasesView.java	(revision 1038)
@@ -52,7 +52,7 @@
 import org.eclipse.ui.part.ViewPart;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.txm.Toolbox;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.objects.Edition;
 import org.txm.objects.Page;
 import org.txm.objects.Project;
@@ -138,7 +138,7 @@
 				TreeSelection selection = (TreeSelection) tv.getSelection();
 				if (selection.getFirstElement() instanceof Corpus) {
 					Corpus corpus = (Corpus)selection.getFirstElement();
-					File selectedItem = new File(corpus.getBaseDirectory(), "cqp/"+corpus.getName()+".cqp");
+					File selectedItem = new File(corpus.getProjectDirectory(), "cqp/"+corpus.getName()+".cqp");
 					if (selectedItem.exists())
 						EditFile.openfile(selectedItem.getAbsolutePath());
 				} else if (selection.getFirstElement() instanceof Text) {
@@ -225,9 +225,6 @@
 			if (element instanceof Project)
 				imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
 						Application.PLUGIN_ID, IImageKeys.PROJECT);
-			else if (element instanceof Base)
-				imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
-						Application.PLUGIN_ID, IImageKeys.BASE);
 			else if (element instanceof MainCorpus)
 				imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(
 						Application.PLUGIN_ID, IImageKeys.CORPUS);
@@ -266,9 +263,7 @@
 			if (element instanceof Workspace) {
 				return ((Workspace) element).getProjects().toArray();
 			} else if (element instanceof Project) {
-				return ((Project) element).getBases().toArray();
-			} else if (element instanceof Base) {
-				return ((Base) element).getChildren(MainCorpus.class).toArray();
+				return ((Project) element).getChildren(MainCorpus.class).toArray();
 			} else if (element instanceof MainCorpus) {
 				return ((Corpus) element).getTexts().toArray();
 			} else if (element instanceof Text) {
@@ -290,10 +285,8 @@
 				return null;
 			} else if (element instanceof Project) {
 				return ((Project) element).getWorkspace();
-			} else if (element instanceof Base) {
-				return ((Base) element).getProject();
 			} else if (element instanceof MainCorpus) {
-				return ((MainCorpus) element).getBase();
+				return ((MainCorpus) element).getProject();
 			} else if (element instanceof Text) {
 				return ((Text) element).getCorpus();
 			} else if (element instanceof Edition) {
@@ -314,9 +307,7 @@
 			if (element instanceof Workspace) {
 				return !((Workspace) element).getProjects().isEmpty();
 			} else if (element instanceof Project) {
-				return !((Project) element).getBases().isEmpty();
-			} else if (element instanceof Base) {
-				return !((Base) element).getChildren(MainCorpus.class).isEmpty();
+				return !((Project) element).getChildren(MainCorpus.class).isEmpty();
 			} else if (element instanceof Corpus) {
 				return !((Corpus) element).getTexts().isEmpty();
 			} else if (element instanceof Text) {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/QueriesView.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/QueriesView.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/QueriesView.java	(revision 1038)
@@ -62,7 +62,7 @@
 import org.eclipse.ui.part.ViewPart;
 import org.txm.Toolbox;
 import org.txm.core.preferences.TBXPreferences;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.objects.Corpus;
 import org.txm.objects.Project;
 import org.txm.objects.SavedQuery;
@@ -92,9 +92,6 @@
 	/** The activated project. */
 	Project activatedProject;
 	
-	/** The activated base. */
-	Base activatedBase;
-	
 	/** The tv. */
 	TreeViewer tv;
 
@@ -278,15 +275,6 @@
 	}
 
 	/**
-	 * Gets the activated base.
-	 *
-	 * @return the activated base
-	 */
-	public Base getActivatedBase() {
-		return activatedBase;
-	}
-
-	/**
 	 * The Class TxmObjectLabelProvider.
 	 */
 	public class TxmObjectLabelProvider extends LabelProvider {
@@ -361,9 +349,9 @@
 		 */
 		@Override
 		public Object[] getElements(Object element) {
-			Collection<Base> input = (Collection<Base>) element;
+			Collection<Project> input = (Collection<Project>) element;
 			Object[] objects = new Object[input.size()];
-			Iterator<Base> it = input.iterator();
+			Iterator<Project> it = input.iterator();
 			int i = 0;
 			while (it.hasNext()) {
 				objects[i] = it.next();
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java	(revision 1037)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteImportScript.java	(revision 1038)
@@ -63,7 +63,7 @@
 import org.txm.core.engines.EngineType;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.importer.ImportKeys;
-import org.txm.objects.Base;
+import org.txm.objects.Project;
 import org.txm.objects.BaseParameters;
 import org.txm.rcp.Application;
 import org.txm.rcp.StatusLine;
@@ -221,7 +221,7 @@
 			@Override
 			protected IStatus run(IProgressMonitor monitor) {
 				this.runInit(monitor);
-				Base base = null;
+				Project base = null;
 				try {
 					//this.setCurrentMonitor(monitor);
 					monitor.beginTask(TXMUIMessages.RunGroovyScript_10 + p.rootDir, 100); //$NON-NLS-1$
@@ -278,7 +278,7 @@
 							Log.info("Restart Toolbox search engine"); //$NON-NLS-1$
 							Toolbox.restartWorkspace(null);
 							Toolbox.getEngineManager(EngineType.SEARCH).restartEngines();
-							final Base base2 = base;
+							final Project base2 = base;
 							syncExec(new Runnable() {
 								@Override
 								public void run() {
Index: tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/BackToMedia.java
===================================================================
--- tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/BackToMedia.java	(revision 1037)
+++ tmp/org.txm.backtomedia.rcp/src/org/txm/backtomedia/commands/function/BackToMedia.java	(revision 1038)
@@ -165,7 +165,7 @@
 //					return null;
 //				}
 
-				File binDir = corpus.getBase().getBaseParameters().paramFile.getParentFile();
+				File binDir = corpus.getProject().getProjectParameters().paramFile.getParentFile();
 				File mediaDir = new File(binDir, "media"); //$NON-NLS-1$
 				File audioFile = new File(mediaDir, textid+".mp3"); //$NON-NLS-1$
 				if (!audioFile.exists()) audioFile = new File(mediaDir, textid+".ogg"); //$NON-NLS-1$
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java	(revision 1037)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java	(revision 1038)
@@ -65,8 +65,8 @@
 		if (isTIgerInitialized) return isTIgerInitialized;
 
 		String id = getCorpus().getMainCorpus().getName();
-		File configfile = new File(getCorpus().getBaseDirectory(),"tiger/tigersearch.logprop");
-		File registrydir = new File(getCorpus().getBaseDirectory(), "tiger");
+		File configfile = new File(getCorpus().getProjectDirectory(),"tiger/tigersearch.logprop");
+		File registrydir = new File(getCorpus().getProjectDirectory(), "tiger");
 
 		TSCorpusManager manager = new TSCorpusManager(registrydir, configfile);
 		if (manager.isInitialized()) {
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 1037)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 1038)
@@ -39,9 +39,9 @@
 		this.corpus = corpus.getMainCorpus();
 
 		String id = corpus.getName();
-		File configfile = new File(corpus.getBaseDirectory(),"tiger/tigersearch.logprop");
-		File registrydir = new File(corpus.getBaseDirectory(), "tiger");
-		File tscorpusdir = new File(corpus.getBaseDirectory(), "tiger/"+id);
+		File configfile = new File(corpus.getProjectDirectory(),"tiger/tigersearch.logprop");
+		File registrydir = new File(corpus.getProjectDirectory(), "tiger");
+		File tscorpusdir = new File(corpus.getProjectDirectory(), "tiger/"+id);
 		
 		if (!tscorpusdir.exists()) {
 			System.out.println("Error: can't find corpus directory: "+tscorpusdir);
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/tester/TIGERSearchTester.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/tester/TIGERSearchTester.java	(revision 1037)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/tester/TIGERSearchTester.java	(revision 1038)
@@ -42,7 +42,7 @@
 				}
 				MainCorpus corpus = (MainCorpus) receiver;
 
-				return new File(corpus.getBaseDirectory(), "tiger").exists();
+				return new File(corpus.getProjectDirectory(), "tiger").exists();
 			}
 		}
 		return false;
Index: tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java
===================================================================
--- tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 1037)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/editors/TIGERSearchEditor.java	(revision 1038)
@@ -165,8 +165,8 @@
 
 	protected void initializeFields() {
 		String id = corpus.getName();
-		File configfile = new File(corpus.getBaseDirectory(),"tiger/tigersearch.logprop");
-		File registrydir = new File(corpus.getBaseDirectory(), "tiger");
+		File configfile = new File(corpus.getProjectDirectory(),"tiger/tigersearch.logprop");
+		File registrydir = new File(corpus.getProjectDirectory(), "tiger");
 
 		if (!registrydir.exists()) {
 			System.out.println("TIGERSearch corpus '"+id+"' has no TIGERSearch registry directory: "+registrydir);
