Index: tmp/org.txm.dictionary.rcp/src/org/txm/dictionary/functions/jpa/Dictionary.java
===================================================================
--- tmp/org.txm.dictionary.rcp/src/org/txm/dictionary/functions/jpa/Dictionary.java	(revision 489)
+++ tmp/org.txm.dictionary.rcp/src/org/txm/dictionary/functions/jpa/Dictionary.java	(revision 490)
@@ -31,7 +31,7 @@
 import org.eclipse.persistence.queries.Cursor;
 import org.txm.Toolbox;
 import org.txm.annotation.DatabasePersistenceManager;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.stat.utils.ConsoleProgressBar;
 import org.txm.utils.logger.Log;
 
@@ -62,7 +62,7 @@
 		addEntries(ids, null);
 	}
 
-	private void addEntries(ArrayList<EntryId> ids, ProgressWatcher monitor) {
+	private void addEntries(ArrayList<EntryId> ids, IProgressMonitor monitor) {
 		jpaem.getTransaction().begin();
 
 		for (EntryId t : ids) {
@@ -135,11 +135,11 @@
 		addTypes(types, null);
 	}
 
-	public void addTypes(ArrayList<EntryPropertyType> types, ProgressWatcher monitor) {
+	public void addTypes(ArrayList<EntryPropertyType> types, IProgressMonitor monitor) {
 		jpaem.getTransaction().begin();
 		for (EntryPropertyType t : types) {
 			jpaem.persist(t);
-			if (monitor != null) monitor.worked();
+			if (monitor != null) monitor.worked(1);
 			autoFlush();
 		}
 		jpaem.getTransaction().commit();
Index: tmp/org.txm.querycooccurrences.rcp/src/org/txm/functions/coocmatrix/QueryAutoCooccurrence.java
===================================================================
--- tmp/org.txm.querycooccurrences.rcp/src/org/txm/functions/coocmatrix/QueryAutoCooccurrence.java	(revision 489)
+++ tmp/org.txm.querycooccurrences.rcp/src/org/txm/functions/coocmatrix/QueryAutoCooccurrence.java	(revision 490)
@@ -9,7 +9,7 @@
 import org.txm.ca.core.functions.CA;
 import org.txm.ca.core.functions.ICAComputable;
 import org.txm.core.results.TXMResult;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
 import org.txm.rcp.IImageKeys;
@@ -44,7 +44,7 @@
 	protected boolean oriented = false;
 
 	public QueryAutoCooccurrence(Corpus corpus, ArrayList<Query> queries, 
-			ArrayList<String> names, int dist, int minCooc, String struct, boolean oriented, ProgressWatcher monitor) throws CqiClientException, RWorkspaceException {
+			ArrayList<String> names, int dist, int minCooc, String struct, boolean oriented, IProgressMonitor monitor) throws CqiClientException, RWorkspaceException {
 		this.queries = queries;
 		this.names = names;
 		this.corpus = corpus;
Index: tmp/org.txm.searchengine.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.searchengine.core/META-INF/MANIFEST.MF	(revision 489)
+++ tmp/org.txm.searchengine.core/META-INF/MANIFEST.MF	(revision 490)
@@ -4,8 +4,7 @@
 Bundle-SymbolicName: org.txm.searchengine.core;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.txm.searchengine.core.Activator
-Require-Bundle: org.txm.annotation.core;bundle-version="1.0.0",
- org.eclipse.core.runtime,
+Require-Bundle: org.eclipse.core.runtime,
  org.txm.core;bundle-version="0.7.0",
  org.txm.utils
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Index: tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java
===================================================================
--- tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java	(revision 489)
+++ tmp/org.txm.cooccurrence.rcp/src/org/txm/cooccurrence/rcp/handlers/ComputeCooccurrences.java	(revision 490)
@@ -175,7 +175,4 @@
 		
 		return selection;
 	}
-
-
-
 }
Index: tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java
===================================================================
--- tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 489)
+++ tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 490)
@@ -42,7 +42,7 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.eclipse.osgi.util.NLS;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.index.core.messages.IndexCoreMessages;
 import org.txm.lexicon.core.corpusengine.cqp.Lexicon;
@@ -1017,7 +1017,7 @@
 
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		if (query != null) {
 			if (parent instanceof Corpus) {
 				Corpus corpus = (Corpus)parent;
Index: tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF	(revision 489)
+++ tmp/org.txm.concordance.rcp/META-INF/MANIFEST.MF	(revision 490)
@@ -5,8 +5,7 @@
 Bundle-Version: 1.0.0.qualifier
 Bundle-Vendor: Textometrie.org
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Require-Bundle: org.txm.annotation.core;bundle-version="1.0.0",
- org.eclipse.core.runtime;bundle-version="3.10.0",
+Require-Bundle: org.eclipse.core.runtime;bundle-version="3.10.0",
  org.eclipse.ui;bundle-version="3.106.1",
  org.txm.cooccurrence.core;bundle-version="1.0.0",
  org.txm.cooccurrence.rcp;bundle-version="1.0.0",
@@ -17,8 +16,8 @@
  org.txm.core,
  org.txm.rcp,
  org.eclipse.core.expressions;bundle-version="3.4.600",
- org.txm.para.rcp,
- org.txm.searchengine.core;bundle-version="1.0.0"
+ org.txm.searchengine.core;bundle-version="1.0.0",
+ org.txm.annotation.core;bundle-version="1.0.0"
 Export-Package: org.txm.concordance.rcp.adapters,
  org.txm.concordance.rcp.editors,
  org.txm.concordance.rcp.handlers,
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 489)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 490)
@@ -100,6 +100,7 @@
 import org.txm.Toolbox;
 import org.txm.annotation.Annotation;
 import org.txm.annotation.AnnotationManager;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.annotation.repository.AnnotationType;
 import org.txm.annotation.repository.KnowledgeRepository;
 import org.txm.annotation.repository.KnowledgeRepositoryManager;
@@ -427,7 +428,7 @@
 
 	private void initializeEditor() {
 		this.corpus = ((ConcordanceEditorInput) getEditorInput()).getCorpus();
-		this.annotManager = corpus.getAnnotationManager();
+		this.annotManager = KRAnnotationEngine.getAnnotationManager(corpus);
 
 		this.standardComparators = new ArrayList<LineComparator>();
 		this.userDefinedComparators = new ArrayList<LineComparator>();
@@ -1022,6 +1023,8 @@
 		Log.warning("Corpus KRs: "+krs); //$NON-NLS-1$
 
 		for (KnowledgeRepository kr : krs) {
+			if (kr == null) continue;
+			
 			currentKnowledgeRepository = kr;
 			Log.warning(" KR: "+kr); //$NON-NLS-1$
 			List<AnnotationType> krtypes = kr.getAllAnnotationTypes();
@@ -1045,6 +1048,11 @@
 			Log.warning("Available annotation types: "+typesList);
 			break;
 		}
+		
+		if (currentKnowledgeRepository == null) {
+			System.out.println("Error: no suitable KnowledgeRepository found");
+			return;
+		}
 
 		annotationArea = new Composite(parent, SWT.NONE);
 		annotationArea.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, false, false));
@@ -1790,7 +1798,7 @@
 		});
 
 
-		if (corpus.getKnowledgeRepositoryNames().size() > 0) { // shown only if corpus has a registered KR
+		if (KRAnnotationEngine.getKnowledgeRepositoryNames(corpus).size() > 0) { // shown only if corpus has a registered KR
 
 			annotationButton = new Button(navigationPanel, SWT.PUSH);
 			annotationButton.setToolTipText(Messages.ConcordancesEditor_75);
@@ -1799,7 +1807,7 @@
 				@Override
 				public void widgetSelected(SelectionEvent e) {
 					if (annotationArea != null) {
-						AnnotationManager am = corpus.getMainCorpus().getAnnotationManager();
+						AnnotationManager am = KRAnnotationEngine.getAnnotationManager(corpus);
 						if (am != null && am.hasChanges()) {
 							// && MessageDialog.openConfirm(e.display.getActiveShell(), "Confirm annotation save", "Saving annotation will close this editor. Are you sure you want to save annotations right now ?")
 							JobHandler saveJob = SaveAnnotations.save(corpus.getMainCorpus());
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java	(revision 489)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineSortReferencePattern.java	(revision 490)
@@ -47,7 +47,6 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
 import org.txm.concordance.rcp.editors.ConcordanceEditor;
-import org.txm.para.rcp.editors.ParaBrowserEditor;
 import org.txm.rcp.Messages;
 import org.txm.searchengine.cqp.ReferencePattern;
 import org.txm.searchengine.cqp.corpus.Property;
@@ -70,9 +69,6 @@
 	/** The concordance editor. */
 	private ConcordanceEditor concordanceEditor;
 	
-	/** The para browser editor. */
-	private ParaBrowserEditor paraBrowserEditor;
-
 	/**
 	 * Instantiates a new define reference pattern.
 	 *
@@ -88,22 +84,6 @@
 		setToolTipText(Messages.DefineReferencePattern_4);
 	}
 
-	/**
-	 * Instantiates a new define reference pattern.
-	 *
-	 * @param window the window
-	 * @param paraBrowserEditor the para browser editor
-	 */
-	public DefineSortReferencePattern(IWorkbenchWindow window,
-			ParaBrowserEditor paraBrowserEditor) {
-		this.window = window;
-		this.paraBrowserEditor = paraBrowserEditor;
-		setId(ID);
-		setText(Messages.DefineReferencePattern_3);
-		setToolTipText(Messages.DefineReferencePattern_4);
-	}
-
-	
 	/* (non-Javadoc)
 	 * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
 	 */
@@ -119,19 +99,11 @@
 		List<StructuralUnit> structuralUnits = null;
 		List<Property> availableReferenceItems = new ArrayList<Property>();
 		try {
-			if (paraBrowserEditor != null) {
-				structuralUnits = paraBrowserEditor.getCorpus()
-						.getOrderedStructuralUnits();
-				availableReferenceItems.addAll(paraBrowserEditor.getCorpus()
-						.getOrderedProperties());
-
-			} else if (concordanceEditor != null) {
 				structuralUnits = concordanceEditor.getCorpus()
 						.getOrderedStructuralUnits();
 				availableReferenceItems.addAll(concordanceEditor.getCorpus()
 						.getOrderedProperties());
 
-			}
 
 		} catch (Exception e) {
 			org.txm.rcp.utils.Logger.printStackTrace(e);
@@ -143,34 +115,18 @@
 
 		// System.out.println("selected "+concordanceEditor.getSelectedReferences());
 		// System.out.println("before avail"+availableReferenceItems);
-		if (paraBrowserEditor != null) {
-			availableReferenceItems.remove(paraBrowserEditor
-					.getSelectedReferences());
-		} else {
 			availableReferenceItems.remove(concordanceEditor
 					.getSelectedSortReferences());
-		}
 
-		// System.out.println("after avail"+availableReferenceItems);
+			// System.out.println("after avail"+availableReferenceItems);
 		DefineReferencePatternDialog d = null;
-		if (paraBrowserEditor != null) {
 			d = new DefineReferencePatternDialog(window.getShell(),
-					availableReferenceItems, paraBrowserEditor
-							.getSelectedReferences());
-		} else if (concordanceEditor != null) {
-			d = new DefineReferencePatternDialog(window.getShell(),
 					availableReferenceItems, concordanceEditor
 							.getSelectedSortReferences());
-		}
 
 		if (d.open() == Window.OK) {
-			if (paraBrowserEditor != null) {
-				paraBrowserEditor.setReferencePattern(new ReferencePattern(d
-						.getSelectesdReferenceItems()));
-			} else if (concordanceEditor != null) {
 				concordanceEditor.setRefSortPattern(new ReferencePattern(d
 						.getSelectesdReferenceItems()));
-			}
 			//System.out.println(concordanceEditor.getSortReferencePattern());
 		}
 	}
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java	(revision 489)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/DefineViewReferencePattern.java	(revision 490)
@@ -47,7 +47,6 @@
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.actions.ActionFactory.IWorkbenchAction;
 import org.txm.concordance.rcp.editors.ConcordanceEditor;
-import org.txm.para.rcp.editors.ParaBrowserEditor;
 import org.txm.rcp.Messages;
 import org.txm.searchengine.cqp.ReferencePattern;
 import org.txm.searchengine.cqp.corpus.Property;
@@ -70,9 +69,6 @@
 	/** The concordance editor. */
 	private ConcordanceEditor concordanceEditor;
 	
-	/** The para browser editor. */
-	private ParaBrowserEditor paraBrowserEditor;
-
 	/**
 	 * Instantiates a new define reference pattern.
 	 *
@@ -88,22 +84,6 @@
 		setToolTipText(Messages.DefineReferencePattern_2);
 	}
 
-	/**
-	 * Instantiates a new define reference pattern.
-	 *
-	 * @param window the window
-	 * @param paraBrowserEditor the para browser editor
-	 */
-	public DefineViewReferencePattern(IWorkbenchWindow window,
-			ParaBrowserEditor paraBrowserEditor) {
-		this.window = window;
-		this.paraBrowserEditor = paraBrowserEditor;
-		setId(ID);
-		setText(Messages.DefineReferencePattern_1);
-		setToolTipText(Messages.DefineReferencePattern_2);
-	}
-
-	
 	/* (non-Javadoc)
 	 * @see org.eclipse.ui.actions.ActionFactory.IWorkbenchAction#dispose()
 	 */
@@ -119,20 +99,11 @@
 		List<StructuralUnit> structuralUnits = null;
 		List<Property> availableReferenceItems = new ArrayList<Property>();
 		try {
-			if (paraBrowserEditor != null) {
-				structuralUnits = paraBrowserEditor.getCorpus()
-						.getOrderedStructuralUnits();
-				availableReferenceItems.addAll(paraBrowserEditor.getCorpus()
-						.getOrderedProperties());
-
-			} else if (concordanceEditor != null) {
 				structuralUnits = concordanceEditor.getCorpus()
 						.getOrderedStructuralUnits();
 				availableReferenceItems.addAll(concordanceEditor.getCorpus()
 						.getOrderedProperties());
 
-			}
-
 		} catch (Exception e) {
 			org.txm.rcp.utils.Logger.printStackTrace(e);
 		}
@@ -143,34 +114,18 @@
 
 		// System.out.println("selected "+concordanceEditor.getSelectedReferences());
 		// System.out.println("before avail"+availableReferenceItems);
-		if (paraBrowserEditor != null) {
-			availableReferenceItems.remove(paraBrowserEditor
-					.getSelectedReferences());
-		} else {
 			availableReferenceItems.remove(concordanceEditor
 					.getSelectedViewReferences());
-		}
 
 		// System.out.println("after avail"+availableReferenceItems);
 		DefineReferencePatternDialog d = null;
-		if (paraBrowserEditor != null) {
 			d = new DefineReferencePatternDialog(window.getShell(),
-					availableReferenceItems, paraBrowserEditor
-							.getSelectedReferences());
-		} else if (concordanceEditor != null) {
-			d = new DefineReferencePatternDialog(window.getShell(),
 					availableReferenceItems, concordanceEditor
 							.getSelectedViewReferences());
-		}
 
 		if (d.open() == Window.OK) {
-			if (paraBrowserEditor != null) {
-				paraBrowserEditor.setReferencePattern(new ReferencePattern(d
-						.getSelectesdReferenceItems()));
-			} else if (concordanceEditor != null) {
 				concordanceEditor.setRefViewPattern(new ReferencePattern(d
 						.getSelectesdReferenceItems()));
-			}
 			//System.out.println(concordanceEditor.getViewReferencePattern());
 		}
 	}
Index: tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java
===================================================================
--- tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 489)
+++ tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java	(revision 490)
@@ -43,7 +43,7 @@
 import org.txm.ca.core.statsengine.r.functions.ICA;
 import org.txm.chartsengine.core.results.IChartResult;
 import org.txm.core.preferences.TXMPreferences;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.core.functions.LexicalTableFactory;
@@ -989,7 +989,7 @@
 
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		return stepLexicalTable() && stepSortTableLexical() && stepCompute();
 	}
 
Index: tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/TEI2Project.java
===================================================================
--- tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/TEI2Project.java	(revision 489)
+++ tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/TEI2Project.java	(revision 490)
@@ -12,7 +12,7 @@
 import org.eclipse.core.runtime.Platform;
 import org.osgi.framework.Bundle;
 import org.txm.Toolbox;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.importer.ApplyXsl2;
 import org.txm.importer.WriteIdAndNAttributes;
 import org.txm.utils.BundleUtils;
@@ -36,7 +36,7 @@
 		this.createArchive = createArchive;
 	}
 	
-	public boolean process(ProgressWatcher monitor) throws IOException, XMLStreamException, TransformerException {
+	public boolean process(IProgressMonitor monitor) throws IOException, XMLStreamException, TransformerException {
 		if (!xmlFile.exists()) {
 			System.out.println("Could not read input XML input file: "+xmlFile);
 			return false;
@@ -125,7 +125,7 @@
 		try {
 
 			System.out.println("Applying "+xslMissingMilestones+" to "+xmlWFile+"...");
-			if (monitor != null) monitor.worked(1, "Applying "+xslMissingMilestones+" to "+xmlWFile+"...");
+			if (monitor != null) { monitor.worked(1); monitor.subTask("Applying "+xslMissingMilestones+" to "+xmlWFile+"...");}
 			ApplyXsl2 builder = new ApplyXsl2(xslMissingMilestones);
 			if (!builder.process(xmlFileCopy, xmlWFile)) {
 				System.out.println("Failed to process "+xmlWFile+" with "+xslMissingMilestones);
@@ -133,7 +133,7 @@
 			}
 
 			System.out.println("Applying "+xslTokenizer+" to "+xmlWFile+"...");
-			if (monitor != null) monitor.worked(15, "Applying "+xslTokenizer+" to "+xmlWFile+"...");
+			if (monitor != null) {monitor.worked(15); monitor.subTask( "Applying "+xslTokenizer+" to "+xmlWFile+"...");};
 			builder = new ApplyXsl2(xslTokenizer);
 			if (!builder.process(xmlWFile, xmlWFile)) {
 				System.out.println("Failed to process "+xmlFileCopy+" with "+xslTokenizer);
@@ -141,7 +141,7 @@
 			}
 
 			System.out.println("Merging words </w><w>");
-			if (monitor != null) monitor.worked(15, "Merging words </w><w>");
+			if (monitor != null) {monitor.worked(15); monitor.subTask("Merging words </w><w>");}
 			String content = IOUtils.getText(xmlWFile, "UTF-8");
 			content = content.replaceAll("</w><w[^>]*>", "");
 			content = content.replaceAll("</w>\\s*(<milestone[^>]*>)?\\s*(<pb[^>]*>)?\\s*(<cb[^>]*>)?\\s*(<lb[^>]*break=\"no\"[^>]*>)\\s*<w[^>]*>", "$1$2$3$4");
@@ -155,7 +155,7 @@
 			}
 
 			System.out.println("Applying "+xslPatchLbInWords+" to "+xmlWFile+"...");
-			if (monitor != null) monitor.worked(15, "Applying "+xslPatchLbInWords+" to "+xmlWFile+"...");
+			if (monitor != null) {monitor.worked(15); monitor.subTask("Applying "+xslPatchLbInWords+" to "+xmlWFile+"...");}
 			builder = new ApplyXsl2(xslPatchLbInWords);
 			if (!builder.process(xmlWFile, xmlWFile)) {
 				System.out.println("Failed to process "+xmlFileCopy+" with "+xslPatchLbInWords);
@@ -163,7 +163,7 @@
 			}
 
 			System.out.println("Fixing 'id' and 'n' attributes in "+xmlWFile+"...");
-			if (monitor != null) monitor.worked(15, "Fixing 'id' and 'n' attributes in "+xmlWFile+"...");
+			if (monitor != null) {monitor.worked(15); monitor.subTask("Fixing 'id' and 'n' attributes in "+xmlWFile+"...");}
 			WriteIdAndNAttributes wiana = new WriteIdAndNAttributes(xmlWFile, projectName);
 			File tmp = new File(xmlWFile.getParentFile(), "tmp_"+xmlWFile.getName());
 			if (!wiana.process(tmp)) {
@@ -180,7 +180,7 @@
 			}
 
 			System.out.println("Applying "+xslCharactersTokenizer+" to "+xmlWFile+"...");
-			if (monitor != null) monitor.worked(15, "Applying "+xslCharactersTokenizer+" to "+xmlWFile+"...");
+			if (monitor != null) {monitor.worked(15); monitor.subTask("Applying "+xslCharactersTokenizer+" to "+xmlWFile+"...");}
 			builder = new ApplyXsl2(xslCharactersTokenizer);
 			if (!builder.process(xmlWFile, xmlWCFile)) {
 				System.out.println("Failed to process "+xmlWFile+" with "+xslCharactersTokenizer);
@@ -188,7 +188,7 @@
 			} 
 
 			System.out.println("Applying "+xslCharactersIdentifier+" to "+xmlWCFile+"...");
-			if (monitor != null) monitor.worked(1, "Applying "+xslCharactersIdentifier+" to "+xmlWCFile+"...");
+			if (monitor != null) {monitor.worked(1); monitor.subTask("Applying "+xslCharactersIdentifier+" to "+xmlWCFile+"...");}
 			builder = new ApplyXsl2(xslCharactersIdentifier);
 			if (!builder.process(xmlWCFile, xmlWCFile)) {
 				System.out.println("Failed to process "+xmlWCFile+" with "+xslCharactersIdentifier);
@@ -196,7 +196,7 @@
 			}
 
 			System.out.println("Applying "+xslZones+" to "+xmlWFile+"...");
-			if (monitor != null) monitor.worked(15, "Applying "+xslZones+" to "+xmlWFile+"...");
+			if (monitor != null) {monitor.worked(15); monitor.subTask("Applying "+xslZones+" to "+xmlWFile+"...");}
 			builder = new ApplyXsl2(xslZones);
 			if (!builder.process(xmlWFile, null)) {
 				System.out.println("Failed to process "+xmlFileCopy+" with "+xslZones);
@@ -211,7 +211,7 @@
 			}
 
 			if (createArchive) {
-				if (monitor != null) monitor.worked(15, "Building Oriflamms binary project... ");
+				if (monitor != null) {monitor.worked(15); monitor.subTask("Building Oriflamms binary project... ");}
 				File zipFile = new File(xmlFileParentDirectory, projectName+".oriflamms");
 				zipFile.delete();
 				Zip.compress(projectDirectory, zipFile);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/JobHandler.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/JobHandler.java	(revision 489)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/utils/JobHandler.java	(revision 490)
@@ -34,14 +34,14 @@
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Display;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.rcp.Messages;
 import org.txm.rcp.StatusLine;
 import org.txm.utils.logger.Log;
 
 // TODO: Auto-generated Javadoc
 /**
- * Simplified RCP Job that implements the Toolbox ProgressWatcher class to allow TBX functions to manager the Job monitor.
+ * Simplified RCP Job that implements the Toolbox IProgressMonitor class to allow TBX functions to manager the Job monitor.
  * 
  * the implemented run methods returns a Status.OK_STATUS or Status.CANCEL_STATUS that can be tested with the getResult() after the join method is called.
  * 
@@ -49,7 +49,7 @@
  * 
  * @author mdecorde, nkredens
  */
-public abstract class JobHandler extends Job implements ProgressWatcher, IProgressMonitor {
+public abstract class JobHandler extends Job implements IProgressMonitor {
 
 	/** The parent. */
 	IProgressMonitor currentMonitor;
@@ -83,7 +83,6 @@
 		currentMonitor = monitor;
 	}
 	
-	@Override
 	public void beginTask(String name, long totalWork) {
 		if (currentMonitor != null) {
 			currentMonitor.beginTask(name, (int) totalWork);
@@ -104,30 +103,8 @@
 			currentMonitor.worked(amount);
 		}
 	}
-	
 
 	@Override
-	public void worked() {
-		if (currentMonitor != null) {
-			currentMonitor.worked(1);
-		}
-	}
-
-	@Override
-	public void worked(int amount, String message) {
-		if (currentMonitor != null) {
-			currentMonitor.worked(amount);
-			currentMonitor.subTask(message);
-		}
-	}
-
-	@Override
-	public void setMessage(String message) {
-		if (currentMonitor != null)
-			currentMonitor.subTask(message);
-	}
-
-	@Override
 	public boolean isCanceled() {
 		if (currentMonitor != null) {
 			return currentMonitor.isCanceled();
@@ -142,7 +119,6 @@
 		}
 	}
 	
-	@Override
 	public void acquireSemaphore() {
 		try {
 			this.mySemaphore.acquire();
@@ -151,12 +127,10 @@
 		}
 	}
 
-	@Override
 	public boolean tryAcquireSemaphore() {
 		return this.mySemaphore.tryAcquire();
 	}
 
-	@Override
 	public void releaseSemaphore() {
 		this.mySemaphore.release();
 		if (isCanceled()) {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/InitializeKnowledgeRepository.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/InitializeKnowledgeRepository.java	(revision 489)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/InitializeKnowledgeRepository.java	(revision 490)
@@ -10,6 +10,7 @@
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.handlers.HandlerUtil;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.annotation.repository.KnowledgeRepository;
 import org.txm.annotation.repository.KnowledgeRepositoryManager;
 import org.txm.rcp.swt.dialog.UsernamePasswordDialog;
@@ -43,8 +44,8 @@
 	public static List<KnowledgeRepository> get(MainCorpus corpus) {
 		List<KnowledgeRepository> ret = new ArrayList<KnowledgeRepository>();
 		
-		for (String kr_name : corpus.getKnowledgeRepositoryNames()) {
-			KnowledgeRepository kr = corpus.getKnowledgeRepository(kr_name);
+		for (String kr_name : KRAnnotationEngine.getKnowledgeRepositoryNames(corpus)) {
+			KnowledgeRepository kr = KRAnnotationEngine.getKnowledgeRepository(corpus, kr_name);
 			if (kr == null) {
 				System.out.println("Warning '"+kr_name+"' KR is null. Please check KR configuration.");
 				continue;
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/ExportStandoff.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/ExportStandoff.java	(revision 489)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/ExportStandoff.java	(revision 490)
@@ -43,6 +43,7 @@
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.Toolbox;
 import org.txm.annotation.AnnotationManager;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.rcp.Messages;
 import org.txm.rcp.StatusLine;
@@ -98,7 +99,7 @@
 	}
 
 	public static boolean exportAnnotations(final MainCorpus corpus, final File resultZipFile) {
-		final AnnotationManager am = corpus.getAnnotationManager();
+		final AnnotationManager am = KRAnnotationEngine.getAnnotationManager(corpus);
 		if (am == null) return true; // nothing to do
 		
 		JobHandler saveJob = SaveAnnotations.save(corpus);
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/SaveAnnotations.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/SaveAnnotations.java	(revision 489)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/annotation/SaveAnnotations.java	(revision 490)
@@ -13,6 +13,7 @@
 import org.eclipse.swt.widgets.MessageBox;
 import org.eclipse.ui.handlers.HandlerUtil;
 import org.txm.annotation.AnnotationManager;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.rcp.Messages;
 import org.txm.rcp.commands.CloseEditorsUsing;
 import org.txm.rcp.commands.workspace.UpdateCorpus;
@@ -42,10 +43,10 @@
 	}
 
 	public static JobHandler save(final MainCorpus corpus) {
-		final AnnotationManager am = corpus.getAnnotationManager();
+		final AnnotationManager am = KRAnnotationEngine.getAnnotationManager(corpus);
 		if (am == null) return null; // nothing to do
 		
-		if (!corpus.needToSaveAnnotations()) {
+		if (!KRAnnotationEngine.needToSaveAnnotations(corpus)) {
 			return null;
 		}
 
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/AnnotationSection.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/AnnotationSection.java	(revision 489)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/AnnotationSection.java	(revision 490)
@@ -12,6 +12,7 @@
 import org.eclipse.ui.forms.widgets.ScrolledForm;
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.objects.BaseParameters;
 
 public class AnnotationSection extends ImportEditorSection {
@@ -54,7 +55,7 @@
 	public void update(BaseParameters params) {
 		if (this.section.isDisposed()) return;
 		if (params == null) return;
-		List<String> values = params.getKnowledgeRepositoryNames();
+		List<String> values = KRAnnotationEngine.getKnowledgeRepositoryNames(params);
 		
 		String value = params.getCorpusName()+DEFAULTNAMESUFFIX;
 		if (values.size() > 0) {
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/tests/AnnotationLookUp.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/tests/AnnotationLookUp.java	(revision 489)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/tests/AnnotationLookUp.java	(revision 490)
@@ -9,6 +9,7 @@
 import org.txm.annotation.Annotation;
 import org.txm.annotation.AnnotationManager;
 import org.txm.annotation.CQPAnnotationManager;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.annotation.repository.AnnotationType;
 import org.txm.annotation.repository.KnowledgeRepository;
 import org.txm.annotation.repository.KnowledgeRepositoryManager;
@@ -392,7 +393,7 @@
 			if (c == null) return;
 			InitializeKnowledgeRepository.get(c);
 			KnowledgeRepository kr = KnowledgeRepositoryManager.getKnowledgeRepository("localkrfortesting", c);
-			AnnotationManager am = c.getAnnotationManager();
+			AnnotationManager am = KRAnnotationEngine.getAnnotationManager(c);
 
 			for (String test : args) {
 				System.out.println("******************** *** ********************");
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 489)
+++ tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 490)
@@ -3,7 +3,10 @@
  */
 package org.txm.core.results;
 
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.UUID;
 
 import org.osgi.framework.FrameworkUtil;
@@ -22,10 +25,10 @@
 public abstract class TXMResult implements Cloneable {
 	
 	/**
-	 * Unique ID of the object.
+	 * Unique ID of the object built with : class + date + number
 	 */
 	protected String uniqueID;
-	
+	public static final DateFormat ID_TIME_FORMAT = new SimpleDateFormat("YYYYMMDD");
 	/**
 	 * The weight, essentially used for sorting purpose.
 	 */
@@ -80,8 +83,9 @@
 	public TXMResult(TXMResult parent, TXMParameters parameters) {
 		
 		// FIXME: discuss about this method and validate it. Also discuss about a getInternalName() method that should also return an unique ID.
-		this.uniqueID = this.getClass().getName() + '@' + Integer.toHexString(System.identityHashCode(this)) + "_" + UUID.randomUUID();
 		
+		this.uniqueID = this.getClass().getName() + '@' + ID_TIME_FORMAT.format(new Date(System.currentTimeMillis())) + "_" + UUID.randomUUID();
+		
 		this.weight = 0;
 		this.visible = true;
 		if(parent != null)	{
@@ -161,6 +165,10 @@
 		return TXMPreferences.getString(key, this.parameters, this, this.preferencesNodeQualifier);
 	}
 	
+	public void saveParameters() {
+		TXMPreferences.putLocalParameters(this, this.parameters);
+	}
+	
 	/**
 	 * Deletes the object from its parent, also deletes the children.
 	 * The <code>TXMResult.clean()</code> methods of this result and children results are applied before the deletion.
@@ -319,10 +327,10 @@
 	synchronized public ArrayList<TXMResult> getResults(Class type, boolean onlyVisible)	{
 		return TXMResult.getNodes(this.children, type, onlyVisible);
 	}
-	
 
 	/**
 	 * Gets the children of all the branch in a flat list.
+	 * 
 	 * @return
 	 */
 	synchronized protected ArrayList<TXMResult> getDeepResults(TXMResult parent, ArrayList<TXMResult> results)	{
Index: tmp/org.txm.core/src/java/org/txm/objects/Base.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Base.java	(revision 489)
+++ tmp/org.txm.core/src/java/org/txm/objects/Base.java	(revision 490)
@@ -48,7 +48,7 @@
 
 import org.txm.Toolbox;
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.utils.logger.Log;
 import org.txm.utils.zip.Zip;
 import org.w3c.dom.Document;
@@ -272,7 +272,7 @@
 	 * @param exportzip the exportzip
 	 * @return true, if successful
 	 */
-	public boolean export(File exportzip, ProgressWatcher monitor) {
+	public boolean export(File exportzip, IProgressMonitor monitor) {
 		File binarydir = this.params.paramFile.getParentFile();
 
 		if (binarydir.exists() && exportzip.getParentFile().exists()) {
Index: tmp/org.txm.core/src/java/org/txm/objects/Corpus.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Corpus.java	(revision 489)
+++ tmp/org.txm.core/src/java/org/txm/objects/Corpus.java	(revision 490)
@@ -36,15 +36,10 @@
 import java.util.HashMap;
 import java.util.List;
 
-import javax.persistence.EntityManager;
-
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.Toolbox;
-import org.txm.annotation.AnnotationManager;
-import org.txm.annotation.repository.KnowledgeRepository;
-import org.txm.annotation.repository.KnowledgeRepositoryManager;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TBXPreferences;
-import org.txm.functions.ProgressWatcher;
 import org.txm.metadatas.DateMetadata;
 import org.txm.metadatas.Metadata;
 import org.txm.metadatas.MetadataGroup;
@@ -162,8 +157,6 @@
 	protected int conc_left_context = 8; // read only
 	protected int conc_right_context = 12; // read only
 
-	/** The persistence manager for annotations **/
-	private EntityManager jpaem;
 
 	/**
 	 * Gets the text.
@@ -533,7 +526,7 @@
 	 * @param exportzip the exportzip
 	 * @return true, if successful
 	 */
-	public boolean export(File exportzip, ProgressWatcher monitor) {
+	public boolean export(File exportzip, IProgressMonitor monitor) {
 		File binarydir = this.getBaseDirectory();
 		if (binarydir.exists() && exportzip.getParentFile().exists()) {
 			try {
@@ -1094,15 +1087,4 @@
 	public void setDefaultViewProperty(String defaultViewProperty) {
 		this.defaultViewProperty = defaultViewProperty;
 	}
-
-	public abstract boolean canBeAnnotated();
-	public abstract KnowledgeRepository getKnowledgeRepository(String name);
-	public abstract  List<String> getKnowledgeRepositoryNames();
-	public abstract AnnotationManager getAnnotationManager();
-
-	@SuppressWarnings("unchecked")
-	public boolean[] mustLoginToKnowledgeRepository(String kr_name) {
-		return KnowledgeRepositoryManager.mustLoginToKnowledgeRepository(kr_name, this);
-	}
-
 }
Index: tmp/org.txm.core/src/java/org/txm/objects/BaseParameters.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/BaseParameters.java	(revision 489)
+++ tmp/org.txm.core/src/java/org/txm/objects/BaseParameters.java	(revision 490)
@@ -17,8 +17,6 @@
 
 import javax.xml.parsers.ParserConfigurationException;
 
-import org.txm.annotation.repository.SQLKnowledgeRepository;
-import org.txm.sql.SQLConnection;
 import org.txm.utils.xml.DomUtils;
 import org.txm.utils.logger.Log;
 import org.w3c.dom.Document;
@@ -374,157 +372,7 @@
 		return text;
 	}
 
-	public Element getKnowledgeRepositoriesElement(Element corpusElement) {
-		NodeList textsList = corpusElement.getElementsByTagName("knowledgeRepositories");
-		if (textsList.getLength() == 0) {
-			Element knowledgeRepositories = corpusElement.getOwnerDocument().createElement("knowledgeRepositories");
-			corpusElement.appendChild(knowledgeRepositories);
-			return knowledgeRepositories;
-		} else {
-			return (Element) textsList.item(0);
-		}
-	}
 
-	public Element getKnowledgeRepositoryElement(String name) {
-		Element rElement = getKnowledgeRepositoriesElement(this.getCorpusElement());
-		NodeList repositoriesList = rElement.getElementsByTagName("repository");
-		for (int i = 0 ; i < repositoriesList.getLength() ; i++) {
-			Element e = ((Element)repositoriesList.item(i));
-			if (name.equals(e.getAttribute("name"))) {
-				return e;
-			}
-		}
-
-		return null;
-	}
-	
-	public Element createKnowledgeRepositoryElement(String name) {
-		Element rElement = getKnowledgeRepositoriesElement(this.getCorpusElement());
-		Element e = rElement.getOwnerDocument().createElement("repository");
-		e.setAttribute("name", name);
-		e.setAttribute("mode", "file");
-		e.setAttribute("user", "false");
-		e.setAttribute("password", "false");
-		e.setAttribute("version", "0");
-		
-		rElement.appendChild(e);
-		return e;
-	}
-
-	/**
-	 * Utility method to get a knowledge repository configuration
-	 * 
-	 * @param name the repository name
-	 * @return
-	 */
-	public List<String> getKnowledgeRepositoryNames() {
-		ArrayList<String> names = new ArrayList<String>();
-		Element corpusElement = getCorpusElement();
-		if (corpusElement == null) return names;
-		
-		Element rElement = getKnowledgeRepositoriesElement(corpusElement);
-		if (rElement == null) return names;
-		
-		NodeList repositoriesList = rElement.getElementsByTagName("repository");
-		for (int i = 0 ; i < repositoriesList.getLength() ; i++) {
-			names.add(((Element)repositoriesList.item(i)).getAttribute("name"));
-		}
-		return names;
-	}
-
-	public static String KNOWLEDGE_ACCESS = "access";
-	public static String KNOWLEDGE_TYPEQUERIES = "queries";
-	public static String KNOWLEDGE_TYPES = "fields";
-	public static String KNOWLEDGE_STRINGS = "strings";
-	public static String KNOWLEDGE_TYPEWEBACCESS = "typeaccess";
-	
-	/**
-	 * Utility method to get a knowledge repository configuration
-	 * 
-	 * @param name the repository name
-	 * @return
-	 */
-	public static HashMap<String, HashMap<String, ?>> getKnowledgeRepositoryConfiguration(String name, Element e) {
-		HashMap<String, HashMap<String, ?>> repConfiguration = new HashMap<String, HashMap<String, ?>>();
-
-		HashMap<String, String> access = new HashMap<String, String>();
-		HashMap<String, HashMap<String, String>> strings = new HashMap<String, HashMap<String, String>>();
-		HashMap<String, HashMap<String, String>> fields = new HashMap<String, HashMap<String, String>>();
-
-		if (e == null) return null;
-
-		access.put(SQLKnowledgeRepository.NAME, e.getAttribute(SQLKnowledgeRepository.NAME));
-		access.put("version", e.getAttribute("version"));
-		access.put("mode", e.getAttribute("mode"));
-		access.put(SQLKnowledgeRepository.TYPE_URL, e.getAttribute(SQLKnowledgeRepository.TYPE_URL));
-		access.put(SQLKnowledgeRepository.TYPE_RESURL, e.getAttribute(SQLKnowledgeRepository.TYPE_RESURL));
-		access.put(SQLKnowledgeRepository.TYPE_TYPEURL, e.getAttribute(SQLKnowledgeRepository.TYPE_TYPEURL));
-		access.put(SQLConnection.SQL_ADDRESS, e.getAttribute(SQLConnection.SQL_ADDRESS));
-		access.put(SQLConnection.SQL_DRIVER, e.getAttribute(SQLConnection.SQL_DRIVER));
-		access.put(SQLConnection.SQL_PORT, e.getAttribute(SQLConnection.SQL_PORT));
-		access.put(SQLConnection.SQL_USER, e.getAttribute(SQLConnection.SQL_USER));
-		access.put(SQLConnection.SQL_PASSWORD, e.getAttribute(SQLConnection.SQL_PASSWORD));
-
-		//<type id="" name> ... </type>
-		NodeList typesList = e.getElementsByTagName("type");
-		for (int i = 0 ; i < typesList.getLength() ; i++) {
-			//<field type="xxx">yyy</field>
-			Element typeElement = (Element)typesList.item(i);
-			String type_id = ""+typeElement.getAttribute(SQLKnowledgeRepository.TYPE_ID);
-			
-			String type_name = typeElement.getAttribute(SQLKnowledgeRepository.NAME);
-			if (type_name == null || type_name.length() == 0) type_name = type_id;
-			
-			String type_url = ""+typeElement.getAttribute(SQLKnowledgeRepository.TYPE_URL);
-			
-			String type_size = typeElement.getAttribute(SQLKnowledgeRepository.TYPE_SIZE);
-			if (type_size == null || type_size.length() == 0) type_size = "SMALL"; // show all by default 
-			type_size = type_size.toUpperCase();
-			
-			String type_effect = typeElement.getAttribute(SQLKnowledgeRepository.TYPE_EFFECT);
-			if (type_effect == null || type_effect.length() == 0) type_effect = "SEGMENT"; // segment annotation by default 
-			type_effect = type_effect.toUpperCase();
-
-			HashMap<String, String> hashFields = new HashMap<String, String>();
-			NodeList fieldsList = typeElement.getElementsByTagName("field"); // contains KR type specific properties
-			for (int j = 0 ; j < fieldsList.getLength() ; j++) {
-				Element fieldElement = (Element)fieldsList.item(j);
-				hashFields.put(fieldElement.getAttribute("type"), fieldElement.getTextContent());
-			}
-
-			hashFields.put(SQLKnowledgeRepository.TYPE_URL, type_url);
-			hashFields.put(SQLKnowledgeRepository.NAME, type_name);
-			hashFields.put(SQLKnowledgeRepository.TYPE_SIZE, type_size);
-			hashFields.put(SQLKnowledgeRepository.TYPE_EFFECT, type_effect);
-			fields.put(type_id, hashFields);
-		}
-		
-		NodeList stringsList = e.getElementsByTagName("strings");
-		for (int i = 0 ; i < stringsList.getLength() ; i++) {
-			Element stringsElement = (Element)stringsList.item(i);
-			String lang = stringsElement.getAttribute("lang");
-			if (lang == null) lang = "en"; // default lang is "en"
-			
-			HashMap<String, String> values = new HashMap<String, String>();
-			strings.put(lang, values);
-			
-			NodeList stringList = stringsElement.getElementsByTagName("string");
-			for (int j = 0 ; j < stringList.getLength() ; j++) {
-				Element stringElement = (Element)stringList.item(j);
-				String key = stringElement.getAttribute("key");
-				if (key != null) {
-					values.put(key, stringElement.getTextContent());
-				}
-			}
-		}
-
-		repConfiguration.put(KNOWLEDGE_ACCESS, access);
-		repConfiguration.put(KNOWLEDGE_TYPES, fields);
-		repConfiguration.put(KNOWLEDGE_STRINGS, strings);
-		
-		return repConfiguration;
-	}
-
 	public Element getTextsElement(Element corpusElement) {
 		NodeList textsList = corpusElement.getElementsByTagName("texts");
 		if(textsList.getLength() == 0) {
Index: tmp/org.txm.core/src/java/org/txm/functions/TXMCommand.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/functions/TXMCommand.java	(revision 489)
+++ tmp/org.txm.core/src/java/org/txm/functions/TXMCommand.java	(revision 490)
@@ -29,9 +29,12 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.util.concurrent.Semaphore;
 
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.core.results.TXMParameters;
 import org.txm.core.results.TXMResult;
+import org.txm.utils.logger.Log;
 
 /**
  * 
@@ -50,74 +53,63 @@
 	/**
 	 * 
 	 */
-	protected ProgressWatcher monitor;
-	
-	
-	
+	protected IProgressMonitor monitor;
+		
 	public TXMCommand() {
 		super();
 		// TODO Auto-generated constructor stub
 	}
 
-	public TXMCommand(TXMResult parent, TXMParameters parameters) {
-		super(parent, parameters);
+	public TXMCommand(TXMResult parent) {
+		super(parent);
 		// TODO Auto-generated constructor stub
 	}
 
-	public TXMCommand(TXMResult parent) {
-		super(parent);
+	public TXMCommand(TXMResult parent, TXMParameters parameters) {
+		super(parent, parameters);
 		// TODO Auto-generated constructor stub
 	}
 
-	
-	/**
-	 * You must set the current monitor to be available to manage the process progress
-	 * @param monitor
-	 */
-	public void setCurrentMonitor(ProgressWatcher monitor) {
-		this.monitor = monitor;
-	}
-	
-	/**
-	 * increment the process 
-	 * @param amount of work
-	 */
-	public void worked(int amount) {
-		if (monitor != null) {
-			//System.out.println("worked "+amount);
-			monitor.worked(amount);
+	Semaphore progressSemaphore = new Semaphore(1);
+	public void acquireSemaphore() {
+		try {
+			this.progressSemaphore.acquire();
+		} catch (InterruptedException e) {
+			Log.printStackTrace(e);
 		}
 	}
 	
 	/**
-	 * increment the progress and show a message
-	 * @param amount
-	 * @param message
+	 * Computes the result according to specified command parameters.
+	 * 
+	 * @param parameters
+	 * @return
 	 */
-	public void worked(int amount, String message) {
-		if (monitor != null) {
-			monitor.worked(amount, message);
-		}
+	public boolean compute() throws Exception {
+		return this.compute(null);
 	}
 	
 	/**
-	 * show a message in progress
-	 * @param message
+	 * Computes the result according to stored command parameters.
+	 * 
+	 * @param watcher
+	 * @return
+	 * @throws InvalidCqpIdException 
+	 * @throws CqiServerError 
+	 * @throws CqiClientException 
+	 * @throws IOException 
 	 */
-	public void setMessage(String message) {
-		if (monitor != null)
-			monitor.setMessage(message);
-	}
+	public abstract boolean compute(IProgressMonitor watcher) throws Exception;
 	
 	/**
-	 * 
-	 * @return true if the monitor has been canceled by the user
+	 * Computes the result according to specified command parameters.
+	 * @param watcher
+	 * @param parameters
+	 * @return
 	 */
-	public boolean isCanceled() {
-		if (monitor != null) {
-			return monitor.isCanceled();
-		}
-		return false;
+	public boolean compute(IProgressMonitor watcher, TXMParameters parameters) throws Exception {
+		this.parameters = parameters;
+		return this.compute(watcher);
 	}
 	
 	public void done() {
@@ -126,32 +118,6 @@
 		}
 	}
 	
-	public void acquireSemaphore() {
-		if (monitor != null)
-			monitor.acquireSemaphore();
-	}
-	
-	public boolean tryAcquireSemaphore() {
-		if (monitor != null)
-			return monitor.tryAcquireSemaphore();
-		else
-			return false;
-	}
-	
-	public void releaseSemaphore() {
-		if (monitor != null)
-			monitor.releaseSemaphore();
-	}
-	
-	//public abstract boolean toTxt(File file, String encoding) throws Exception;
-	@Deprecated
-	//FIXME: should be moved in an exporter extension
-	public abstract boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception;
-	
-	
-	
-
-	
 	/**
 	 * 
 	 * @return the array of extensions to show in the FileDialog SWT widget
@@ -164,6 +130,17 @@
 	
 	/**
 	 * 
+	 * @return true if the monitor has been canceled by the user
+	 */
+	public boolean isCanceled() {
+		if (monitor != null) {
+			return monitor.isCanceled();
+		}
+		return false;
+	}
+	
+	/**
+	 * 
 	 * @return the parent Object that contains this result
 	 */
 	@Deprecated
@@ -179,38 +156,64 @@
 		return false;
 	}
 	
+	public boolean tryAcquireSemaphore() {
+		return this.progressSemaphore.tryAcquire();
+	}
+
+	public void releaseSemaphore() {
+		this.progressSemaphore.release();
+	}
+
 	
 	/**
-	 * Computes the result according to specified command parameters.
-	 * @param parameters
-	 * @return
+	 * You must set the current monitor to be available to manage the process progress
+	 * @param monitor
 	 */
-	public boolean compute() throws Exception {
-		return this.compute(null);
+	public void setCurrentMonitor(IProgressMonitor monitor) {
+		this.monitor = monitor;
 	}
 	
+	
+	
 
+	
 	/**
-	 * Computes the result according to stored command parameters.
-	 * @param watcher
-	 * @return
-	 * @throws InvalidCqpIdException 
-	 * @throws CqiServerError 
-	 * @throws CqiClientException 
-	 * @throws IOException 
+	 * show a message in progress
+	 * @param message
 	 */
-	public abstract boolean compute(ProgressWatcher watcher) throws Exception;
+	public void setMessage(String message) {
+		if (monitor != null)
+			monitor.subTask(message);
+	}
 	
+	//public abstract boolean toTxt(File file, String encoding) throws Exception;
+	@Deprecated
+	//FIXME: should be moved in an exporter extension
+	public abstract boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception;
+	
+	/**
+	 * increment the process 
+	 * @param amount of work
+	 */
+	public void worked(int amount) {
+		if (monitor != null) {
+			//System.out.println("worked "+amount);
+			monitor.worked(amount);
+		}
+	}
+	
 
 	/**
-	 * Computes the result according to specified command parameters.
-	 * @param watcher
-	 * @param parameters
-	 * @return
+	 * increment the progress and show a message
+	 * 
+	 * @param amount
+	 * @param message
 	 */
-	public boolean compute(ProgressWatcher watcher, TXMParameters parameters) throws Exception {
-		this.parameters = parameters;
-		return this.compute(watcher);
+	public void worked(int amount, String message) {
+		if (monitor != null) {
+			monitor.worked(amount);
+			monitor.subTask(message);
+		}
 	}
 	
 	
Index: tmp/org.txm.core/src/java/org/txm/stat/utils/ConsoleProgressBar.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/stat/utils/ConsoleProgressBar.java	(revision 489)
+++ tmp/org.txm.core/src/java/org/txm/stat/utils/ConsoleProgressBar.java	(revision 490)
@@ -1,7 +1,7 @@
 package org.txm.stat.utils;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 
-public class ConsoleProgressBar implements ProgressWatcher {
+public class ConsoleProgressBar implements IProgressMonitor {
 	static int LINE_PROGRESS = 10; // number of tick to draw a line
 	static int TOTAL_PROGRESS = 100;
 	
@@ -53,14 +53,12 @@
 		}
 	}
 
-	@Override
 	public void worked(int amount, String message) {
 		this.tick();
 		System.out.println(message);
 		
 	}
 
-	@Override
 	public void setMessage(String message) {
 		System.out.println(message);
 	}
@@ -81,26 +79,22 @@
 		for (int i = 0 ; i < step ; i++) tick();
 	}
 	
-	@Override
 	public void worked() {
 		tick();
 	}
 
-	@Override
 	public void acquireSemaphore() {
 		
 	}
 
-	@Override
 	public boolean tryAcquireSemaphore() {
 		return false;
 	}
 
-	@Override
 	public void releaseSemaphore() { }
 
 	@Override
-	public void beginTask(String name, long l) {
+	public void beginTask(String name, int l) {
 		System.out.println("Begining "+name);
 		this.start(l);
 	}
@@ -110,4 +104,20 @@
 		// FIXME: not yet implemented
 		System.err.println("ConsoleProgressBar.subTask(): not yet implemented.");
 	}
+
+	@Override
+	public void internalWorked(double work) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void setCanceled(boolean value) {
+		if (value) done();
+	}
+
+	@Override
+	public void setTaskName(String name) {
+		// nothing to show
+	}
 }
\ No newline at end of file
Index: tmp/org.txm.core/META-INF/persistence.xml
===================================================================
--- tmp/org.txm.core/META-INF/persistence.xml	(revision 489)
+++ tmp/org.txm.core/META-INF/persistence.xml	(revision 490)
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence version="2.0" 
-	xmlns="http://java.sun.com/xml/ns/persistence" 
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">	
-		<persistence-unit name="MyPUWithHSQL" transaction-type="RESOURCE_LOCAL">
-		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
-		
-		<class>org.txm.annotation.Annotation</class>
-		<class>org.txm.annotation.repository.AnnotationType</class>
-		<class>org.txm.annotation.repository.TypedValue</class>
-<!--	<class>org.txm.functions.dictionary_jpa.EntryId</class>
-		<class>org.txm.functions.dictionary_jpa.EntryProperty</class>
-		<class>org.txm.functions.dictionary_jpa.EntryPropertyType</class>-->
-		<properties>
-			<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
-			<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:file:txmdb/db;shutdown=true;hsqldb.write_delay=false;hsqldb.lock_file=false;hsqldb.applog=0;hsqldb.sqllog=0"/>
-			<property name="javax.persistence.jdbc.user" value="SA"/>
-			
-			<property name="eclipselink.logging.parameters" value="false"/>
- 			<property name="eclipselink.logging.level" value="OFF" />
- 			
-<!-- 			<property name="eclipselink.jdbc.read-connections.min" value="1" />
-			<property name="eclipselink.jdbc.write-connections.min" value="1" />
-			<property name="eclipselink.jdbc.batch-writing" value="JDBC" />
-  -->
-			<!-- Logging 
-			<property name="eclipselink.logging.file" value="output.log"/>
-			<property name="eclipselink.logging.logger" value="JavaLogger"/>
-			-->
-		
-<!-- 		<property name="eclipselink.logging.level" value="FINE" />
-			<property name="eclipselink.logging.timestamp" value="false" />
-			<property name="eclipselink.logging.session" value="false" />
-			<property name="eclipselink.logging.thread" value="false" /> -->
-			
-			<!-- <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> -->
-			<!-- <property name="eclipselink.ddl-generation.output-mode" value="database"/> -->
-		</properties>
- 
-	</persistence-unit>
-</persistence>
\ No newline at end of file
Index: tmp/org.txm.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 489)
+++ tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 490)
@@ -4,15 +4,12 @@
 Bundle-SymbolicName: org.txm.core;singleton:=true
 Bundle-Version: 0.7.9.qualifier
 Bundle-Activator: org.txm.toolbox.Activator
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.10.0",
- javax.persistence;bundle-version="2.1.0",
+Require-Bundle: org.txm.libs.groovy-all;bundle-version="1.0.0";visibility:=reexport,
+ org.eclipse.core.runtime;bundle-version="3.10.0";visibility:=reexport,
  org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
- org.eclipse.osgi.util;bundle-version="3.2.0",
- org.eclipse.core.net,
- org.eclipse.osgi,
- org.txm.libs.groovy-all;bundle-version="1.0.0";visibility:=reexport,
- org.txm.statsengine.r.core;bundle-version="1.0.0",
- org.txm.annotation.core;bundle-version="1.0.0"
+ org.eclipse.osgi.util;bundle-version="3.2.0";visibility:=reexport,
+ org.eclipse.core.net;visibility:=reexport,
+ org.eclipse.osgi;visibility:=reexport
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: EDU.oswego.cs.dl.util.concurrent,
  EDU.oswego.cs.dl.util.concurrent.misc,
Index: tmp/org.txm.lexicon.core/src/org/txm/lexicon/core/corpusengine/cqp/Lexicon.java
===================================================================
--- tmp/org.txm.lexicon.core/src/org/txm/lexicon/core/corpusengine/cqp/Lexicon.java	(revision 489)
+++ tmp/org.txm.lexicon.core/src/org/txm/lexicon/core/corpusengine/cqp/Lexicon.java	(revision 490)
@@ -39,7 +39,7 @@
 
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.TXMResult;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.lexicon.core.messages.LexiconCoreMessages;
 import org.txm.searchengine.cqp.ICqiClient;
@@ -574,7 +574,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		if (parent instanceof MainCorpus) {
 			initLexiconWith((MainCorpus)parent, property);
 		} else if (parent instanceof Subcorpus) {
Index: tmp/org.txm.utils/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.utils/META-INF/MANIFEST.MF	(revision 489)
+++ tmp/org.txm.utils/META-INF/MANIFEST.MF	(revision 490)
@@ -3,10 +3,10 @@
 Bundle-Name: org.txm.utils
 Bundle-SymbolicName: org.txm.utils
 Bundle-Version: 1.0.0.qualifier
-Require-Bundle: org.eclipse.osgi.util;bundle-version="3.3.0",
- org.eclipse.core.runtime,
+Require-Bundle: org.eclipse.osgi.util;bundle-version="3.3.0";visibility:=reexport,
+ org.eclipse.core.runtime;visibility:=reexport,
  org.txm.libs.saxon;bundle-version="9.0.0";visibility:=reexport,
- org.eclipse.core.net;bundle-version="1.2.200",
+ org.eclipse.core.net;bundle-version="1.2.200";visibility:=reexport,
  org.txm.libs.colt;bundle-version="1.2.0";visibility:=reexport,
  org.txm.libs.itext;bundle-version="2.1.5";visibility:=reexport
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
@@ -130,7 +130,6 @@
  org.mozilla.universalchardet.prober.distributionanalysis,
  org.mozilla.universalchardet.prober.sequence,
  org.mozilla.universalchardet.prober.statemachine,
- org.txm.functions,
  org.txm.utils;
   uses:="org.eclipse.core.runtime,
    org.osgi.framework,
Index: tmp/org.txm.utils/src/org/txm/utils/zip/Zip.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/utils/zip/Zip.java	(revision 489)
+++ tmp/org.txm.utils/src/org/txm/utils/zip/Zip.java	(revision 490)
@@ -44,7 +44,7 @@
 import java.util.zip.ZipInputStream;
 import java.util.zip.ZipOutputStream;
 
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.utils.logger.Log;
 
 /**
@@ -89,7 +89,7 @@
 	 * @param targetZipFile the Zip file to create
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
-	public static void compress(final File file, final File targetZipFile, ProgressWatcher monitor)
+	public static void compress(final File file, final File targetZipFile, IProgressMonitor monitor)
 			throws IOException {
 		compress(file, targetZipFile, DEFAULT_LEVEL_COMPRESSION, monitor);
 	}
@@ -107,7 +107,7 @@
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
 	public static void compress(final File file, final File targetZipFile,
-			final int compressionLevel, ProgressWatcher monitor)
+			final int compressionLevel, IProgressMonitor monitor)
 					throws IOException {
 		final File source = file.getCanonicalFile();
 
@@ -192,7 +192,7 @@
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
 	private final static void compressFile(final ZipOutputStream out,
-			final String parentFolder, final File file, ProgressWatcher monitor)
+			final String parentFolder, final File file, IProgressMonitor monitor)
 					throws IOException {
 		final String zipName = new StringBuilder(parentFolder)
 		.append(file.getName())
@@ -223,7 +223,7 @@
 					new FileInputStream(file));
 
 			try {
-				if (monitor != null) monitor.beginTask("Compressing "+file+" file ("+file.length()+" bytes).", file.length());
+				if (monitor != null) monitor.beginTask("Compressing "+file+" file ("+file.length()+" bytes).", (int)file.length());
 				final byte[] buf = new byte[8192];
 				int bytesRead;
 				while (-1 != (bytesRead = in.read(buf))) {
@@ -284,7 +284,7 @@
 	 * @param monitor, change progress state
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
-	public static void decompress(final File file, final File folder, final boolean deleteZipAfter, ProgressWatcher monitor)
+	public static void decompress(final File file, final File folder, final boolean deleteZipAfter, IProgressMonitor monitor)
 			throws IOException {
 		ZipInputStream zis = new ZipInputStream(new BufferedInputStream(
 				new FileInputStream(file.getCanonicalFile())));
@@ -408,7 +408,7 @@
 	 * @throws IOException Signals that an I/O exception has occurred.
 	 */
 	public static void decompress(final String fileName, final String folderName,
-			final boolean deleteZipAfter, ProgressWatcher monitor)
+			final boolean deleteZipAfter, IProgressMonitor monitor)
 					throws IOException {
 		decompress(new File(fileName), new File(folderName), deleteZipAfter, monitor);
 	}
Index: tmp/org.txm.utils/src/org/txm/functions/ProgressWatcher.java
===================================================================
--- tmp/org.txm.utils/src/org/txm/functions/ProgressWatcher.java	(revision 489)
+++ tmp/org.txm.utils/src/org/txm/functions/ProgressWatcher.java	(revision 490)
@@ -1,21 +0,0 @@
-package org.txm.functions;
-
-/**
- * Interface for RCP monitors
- * 
- * @author mdecorde
- *
- */
-public interface ProgressWatcher {
-	public void worked(int amount, String message);
-	public void setMessage(String message);
-	public boolean isCanceled();
-	public void done();
-	public void worked(int step);
-	public void acquireSemaphore();
-	public boolean tryAcquireSemaphore();
-	public void releaseSemaphore();
-	public void beginTask(String name, long l);
-	public void subTask(String name);
-	public void worked();
-}
Index: tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java
===================================================================
--- tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 489)
+++ tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 490)
@@ -38,7 +38,7 @@
 import java.util.Map;
 
 import org.txm.chartsengine.r.core.themes.DefaultTheme;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.progression.core.messages.ProgressionCoreMessages;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
@@ -157,7 +157,7 @@
 	 * @throws CqiServerError 
 	 * @throws IOException 
 	 */
-	public boolean compute(ProgressWatcher monitor) throws CqiClientException, IOException, CqiServerError {
+	public boolean compute(IProgressMonitor monitor) throws CqiClientException, IOException, CqiServerError {
 		return stepQueries() && stepStructuralUnits() && stepFinalize();
 	}
 
Index: tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java
===================================================================
--- tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 489)
+++ tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 490)
@@ -41,6 +41,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.rosuda.REngine.REXPMismatchException;
 import org.txm.concordance.core.functions.Concordance;
 import org.txm.concordance.core.functions.Line;
@@ -49,7 +50,7 @@
 import org.txm.cooccurrence.core.preferences.CooccurrencePreferences;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.core.results.TXMParameters;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.index.core.functions.Index;
 import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
@@ -69,23 +70,21 @@
 import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
 import org.txm.utils.logger.Log;
 
-// TODO: Auto-generated Javadoc
 /**
- * Compute a coocurrence from a concordance.
+ * Compute a cooccurrences from a concordance.
  *
  * @author mdecorde
  * 
  */
 public class Cooccurrence extends TXMCommand  {
 
-	/** The voc. */
-	Index voc;
+	/** The index. */
+	Index index;
 
 	/** The conc. */
-	Concordance conc;
-	/**
-	 * The reference corpus to use = the R symbol that point to a matrix WordxFreqs
-	 */
+	Concordance concordance;
+	
+	/** The reference corpus to use = the R symbol that point to a matrix WordxFreqs. */
 	String referenceCorpus;
 
 	/** The conclines. */
@@ -883,7 +882,7 @@
 	 */
 	private boolean initConcInfos(Concordance conc, int from, int to) {
 		try {
-			this.conc = conc;
+			this.concordance = conc;
 			conclines = conc.getLines(from, to);
 			return initConcInfos(conc, conclines);
 		} catch (Exception e) {
@@ -901,7 +900,7 @@
 	 */
 	private boolean initConcInfos(Concordance conc, List<Line> conclines) {
 		try {
-			this.conc = conc;
+			this.concordance = conc;
 			corpus = conc.getCorpus();
 			this.P = corpus.getSize()
 					/ (conc.getLeftContextSize() + conc.getRightContextSize());
@@ -953,9 +952,9 @@
 	 * @param buildLexicalTableWithCooccurrents
 	 * @return
 	 */
-	public boolean compute(ProgressWatcher watcher, Query query, List<Property> properties, StructuralUnit limit, int minleft, int maxleft, int minright,
+	public boolean compute(IProgressMonitor watcher, Query query, List<Property> properties, StructuralUnit limit, int minleft, int maxleft, int minright,
 			int maxright, int minf, double minscore, int mincof, boolean includeXpivot, boolean buildLexicalTableWithCooccurrents)	{
-		
+
 		this.query = query;
 		this.properties = properties;
 		this.limit = limit;
@@ -1023,13 +1022,12 @@
 		}
 		
 		return true;
-
 	}
 	
 	
 	@Override
-	public boolean compute(ProgressWatcher watcher) {
-		if(this.compute(
+	public boolean compute(IProgressMonitor watcher) {
+		if (this.compute(
 				watcher,
 				new Query(this.getStringParameterValue(CooccurrencePreferences.QUERY)),
 				(List<Property>) parameters.get("properties"),
@@ -1045,7 +1043,7 @@
 				this.getBooleanParameterValue(CooccurrencePreferences.PARTIAL_LEXICAL_TABLE)))	{
 			
 			// persistence
-			TXMPreferences.putLocalParameters(this, parameters);
+			this.saveParameters();
 			return true;
 		}
 		return false;
@@ -1058,9 +1056,9 @@
 	 */
 	//FIXME: not used? or may in portal? in any case, need to use other method compute() now
 	public boolean compute() {
-		if (conclines == null || conc == null || P == -1 || FA == -1
+		if (conclines == null || concordance == null || P == -1 || FA == -1
 				|| properties == null || corpus == null) {
-			System.err.println(CooccurrenceCoreMessages.Cooccurrence_5 + conc);
+			System.err.println(CooccurrenceCoreMessages.Cooccurrence_5 + concordance);
 			return false;
 		}
 		// System.out.println("seuils: freq="+seuil_freq+", count="+seuil_count+", score="+seuil_score);
@@ -1070,18 +1068,18 @@
 		}
 		queryfreq = queryfreq.substring(0, queryfreq.length() - 1) + "]"; //$NON-NLS-1$
 		try {
-			voc = new Index(corpus, new Query(queryfreq), properties);
+			index = new Index(corpus, new Query(queryfreq), properties);
 		} catch (Exception e){
 			Log.severe("Error while computing Index for the cooccurrence: "+e.getLocalizedMessage());
 			return false;
 		}
 		// voc.getCorpus().storeResult(voc);
 
-		count = new HashMap<String, Integer>(voc.getV());
-		dist = new HashMap<String, Float>(voc.getV());
-		freq = new HashMap<String, Integer>(voc.getV());
-		scores = new HashMap<String, Double>(voc.getV());
-		occproperties = new HashMap<String, List<String>>(voc.getV());
+		count = new HashMap<String, Integer>(index.getV());
+		dist = new HashMap<String, Float>(index.getV());
+		freq = new HashMap<String, Integer>(index.getV());
+		scores = new HashMap<String, Double>(index.getV());
+		occproperties = new HashMap<String, List<String>>(index.getV());
 
 		// System.out.println("Lignes");
 		// System.out.println("leftC\tKeyword\trightC");
@@ -1183,8 +1181,8 @@
 			if (freq.get(occ) == null) {
 				// System.out.println("compute freq of "+occ);
 				int occfreq = -1; // calcul avec l'index
-				for (org.txm.index.core.functions.Line l : voc
-						.getLines(0, voc.getV())) {
+				for (org.txm.index.core.functions.Line l : index
+						.getLines(0, index.getV())) {
 					if (l.toString().equals(occ)) {
 						// System.out.println("FOUND "+occ);
 						occfreq = l.getFrequency();
@@ -1773,7 +1771,7 @@
 		}
 	}
 
-	//FIXME: useless?
+	//FIXME: useless? 
 	public void clearMemory() {
 		distances = null;
 		distancescounts = null;
@@ -1798,7 +1796,6 @@
 		return this.corpus.getSimpleName() + ": " + this.getSimpleName(); //$NON-NLS-1$ 
 	}
 
-
 	@Override
 	public String getSimpleName() {
 		String output = "";
@@ -1825,8 +1822,4 @@
 		buf.append(" Filters: freq>" + this.seuil_freq + " ; count>" + seuil_count + " ; score>" + seuil_score + "\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
 		return buf.toString();
 	}
-
-
-
-
 }
Index: tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java
===================================================================
--- tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 489)
+++ tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 490)
@@ -15,7 +15,7 @@
 import org.txm.core.results.TXMResult;
 import org.txm.core.results.TXMParameters;
 import org.txm.functions.TXMCommand;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.CQPEngine;
 import org.txm.searchengine.cqp.NetCqiClient;
@@ -60,7 +60,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher watcher, TXMParameters parameters) {
+	public boolean compute(IProgressMonitor watcher, TXMParameters parameters) {
 		this.parameters = parameters;
 		try {
 			StructuralUnit su = this.getCorpus().getStructuralUnit((String) parameters.get(TextsBalancePreferences.STRUCTURAL_UNIT));
@@ -78,7 +78,7 @@
 	}
 	
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		try {
 			StructuralUnit su = this.getCorpus().getStructuralUnit((String) parameters.get(TextsBalancePreferences.STRUCTURAL_UNIT));
 			return this.compute(
Index: tmp/org.txm.concordance.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.concordance.core/META-INF/MANIFEST.MF	(revision 489)
+++ tmp/org.txm.concordance.core/META-INF/MANIFEST.MF	(revision 490)
@@ -7,11 +7,11 @@
 Require-Bundle: org.txm.annotation.core;bundle-version="1.0.0",
  org.txm.utils;bundle-version="1.0.0",
  org.txm.searchengine.cqp.core;bundle-version="1.1.0",
- org.txm.statsengine.r.core;bundle-version="1.0.0",
  org.eclipse.osgi;bundle-version="3.10.2",
  org.eclipse.core.runtime;bundle-version="3.10.0",
  org.txm.core,
- org.txm.searchengine.core;bundle-version="1.0.0"
+ org.txm.searchengine.core;bundle-version="1.0.0",
+ org.txm.statsengine.r.core;bundle-version="1.0.0"
 Export-Package: org.txm.concordance.core.functions,
  org.txm.concordance.core.functions.comparators,
  org.txm.concordance.core.messages,
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 489)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 490)
@@ -47,11 +47,12 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.annotation.Annotation;
 import org.txm.annotation.AnnotationManager;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.annotation.repository.AnnotationType;
 import org.txm.annotation.repository.TypedValue;
 import org.txm.concordance.core.functions.comparators.LineComparator;
 import org.txm.concordance.core.messages.ConcordanceMessages;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.MemCqiClient;
@@ -330,7 +331,7 @@
 	 * @throws CqiClientException 
 	 */
 	@Override
-	public boolean compute(ProgressWatcher monitor) throws CqiClientException {
+	public boolean compute(IProgressMonitor monitor) throws CqiClientException {
 		this.queryResult = this.getCorpus().query(query, query.getQueryString()
 				.replace(" ", "_") + "_concordance", true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 
@@ -383,7 +384,7 @@
 
 		Log.info(ConcordanceMessages.Concordance_6 + (to - from + 1) + ConcordanceMessages.Concordance_7);
 
-		AnnotationManager am = this.getCorpus().getAnnotationManager();
+		AnnotationManager am = KRAnnotationEngine.getAnnotationManager(this.getCorpus());
 
 		AbstractCqiClient cqiClient = CorpusManager.getCorpusManager().getCqiClient();
 		
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 489)
+++ tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java	(revision 490)
@@ -8,7 +8,7 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.model.IWorkbenchAdapter;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.searchengine.cqp.corpus.Corpus;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
@@ -219,7 +219,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		// TODO Auto-generated method stub
 		return false;
 	}
Index: tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpI.java
===================================================================
--- tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpI.java	(revision 489)
+++ tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpI.java	(revision 490)
@@ -19,7 +19,7 @@
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.model.IWorkbenchAdapter;
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.index.core.functions.LineComparator.SortMode;
 import org.txm.index.core.messages.IndexCoreMessages;
@@ -379,7 +379,7 @@
 	};
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		System.out.println("ExpI.compute(monitor): not implemented.");
 		return false;
 	}
Index: tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ContextSubcorpus.java
===================================================================
--- tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ContextSubcorpus.java	(revision 489)
+++ tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ContextSubcorpus.java	(revision 490)
@@ -9,7 +9,7 @@
 import java.util.HashMap;
 
 import org.txm.core.results.TXMResult;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.searchengine.cqp.CQPEngine;
 import org.txm.searchengine.cqp.MemCqiClient;
@@ -71,7 +71,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher monitor) throws IOException, CqiClientException, CqiServerError, InvalidCqpIdException {
+	public boolean compute(IProgressMonitor monitor) throws IOException, CqiClientException, CqiServerError, InvalidCqpIdException {
 if (!(CQPEngine.getCqiClient() instanceof MemCqiClient));
 		
 		MemCqiClient CQI = (MemCqiClient) CQPEngine.getCqiClient();
Index: tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ValuesOfQuery.java
===================================================================
--- tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ValuesOfQuery.java	(revision 489)
+++ tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ValuesOfQuery.java	(revision 490)
@@ -11,7 +11,7 @@
 import java.util.Arrays;
 
 import org.txm.core.results.TXMResult;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.searchengine.cqp.CQPEngine;
 import org.txm.searchengine.cqp.MemCqiClient;
@@ -192,7 +192,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		// TODO Auto-generated method stub
 		return false;
 	}
Index: tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpII.java
===================================================================
--- tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpII.java	(revision 489)
+++ tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpII.java	(revision 490)
@@ -23,7 +23,7 @@
 import org.eclipse.ui.model.IWorkbenchAdapter;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.results.TXMResult;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.index.core.functions.LineComparator.SortMode;
 import org.txm.index.core.messages.IndexCoreMessages;
@@ -293,7 +293,7 @@
 			monitor.worked(1);
 		}
 		
-		monitor.setMessage("Finalizing doc_word_freq_2.txt file...");
+		monitor.subTask("Finalizing doc_word_freq_2.txt file...");
 		for (String key : keywordsMaxCountsLexicon.keySet()) {
 			int[] keyMaxValues = keywordsMaxCountsLexicon.get(key);
 			for (int noText = 0 ; noText < textBoundaries.length ; noText++) {
@@ -307,7 +307,7 @@
 		queriesFileReader.close();
 		writer.close();
 		
-		monitor.setMessage("Writing lexicon file...");
+		monitor.subTask("Writing lexicon file...");
 		writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(lexiconFile), "UTF-8")));
 		for (String query : idxLexicon.keySet()) {
 			String name = keywordQueriestoName.get(query);
@@ -681,7 +681,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) throws Exception {
+	public boolean compute(IProgressMonitor watcher) throws Exception {
 		System.out.println("ExpII.compute(monitor): not implemented.");
 		return false;
 	}
Index: tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java
===================================================================
--- tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 489)
+++ tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java	(revision 490)
@@ -6,7 +6,7 @@
 import java.util.List;
 
 import org.txm.chartsengine.core.results.IChartResult;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.index.core.functions.Index;
 import org.txm.index.core.functions.Line;
@@ -253,7 +253,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher watcher) {
+	public boolean compute(IProgressMonitor watcher) {
 		// from corpus
 		if(source instanceof Corpus)	{
 			try {
Index: tmp/org.txm.annotation.core/plugin.xml
===================================================================
--- tmp/org.txm.annotation.core/plugin.xml	(revision 0)
+++ tmp/org.txm.annotation.core/plugin.xml	(revision 490)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension-point id="org.txm.annotation.AnnotationEngine" name="org.txm.annotation.AnnotationEngine" schema="schema/org.txm.annotation.AnnotationEngine.exsd"/>
+   <extension
+         point="org.txm.EnginesManager">
+      <EngineManager
+            class="org.txm.annotation.AnnotationEngines"
+            description="Annotation engines"
+            name="org.txm.annotation.AnnotationEngines">
+      </EngineManager>
+   </extension>
+
+</plugin>

Property changes on: tmp/org.txm.annotation.core/plugin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.annotation.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.annotation.core/META-INF/MANIFEST.MF	(revision 489)
+++ tmp/org.txm.annotation.core/META-INF/MANIFEST.MF	(revision 490)
@@ -1,17 +1,18 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Annotation
-Bundle-SymbolicName: org.txm.annotation.core
+Bundle-SymbolicName: org.txm.annotation.core;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.txm.annotation.Activator
-Require-Bundle: org.eclipse.persistence.jpa;bundle-version="2.6.0",
- org.eclipse.persistence.jpa.jpql;bundle-version="2.6.0",
- javax.persistence;bundle-version="2.1.0",
+Require-Bundle: org.txm.searchengine.cqp.core,
+ org.eclipse.persistence.jpa;bundle-version="2.6.0";visibility:=reexport,
+ org.eclipse.persistence.jpa.jpql;bundle-version="2.6.0";visibility:=reexport,
+ javax.persistence;bundle-version="2.1.0";visibility:=reexport,
  org.txm.utils;bundle-version="1.0.0",
  org.eclipse.osgi;bundle-version="3.10.2",
  org.txm.core;bundle-version="0.7.0",
  org.eclipse.ui,
- org.txm.searchengine.cqp.core
+ org.txm.searchengine.core;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.txm.annotation,
Index: tmp/org.txm.annotation.core/META-INF/persistence.xml
===================================================================
--- tmp/org.txm.annotation.core/META-INF/persistence.xml	(revision 0)
+++ tmp/org.txm.annotation.core/META-INF/persistence.xml	(revision 490)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence version="2.0" 
+	xmlns="http://java.sun.com/xml/ns/persistence" 
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">	
+		<persistence-unit name="MyPUWithHSQL" transaction-type="RESOURCE_LOCAL">
+		<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
+		
+		<class>org.txm.annotation.Annotation</class>
+		<class>org.txm.annotation.repository.AnnotationType</class>
+		<class>org.txm.annotation.repository.TypedValue</class>
+<!--	<class>org.txm.functions.dictionary_jpa.EntryId</class>
+		<class>org.txm.functions.dictionary_jpa.EntryProperty</class>
+		<class>org.txm.functions.dictionary_jpa.EntryPropertyType</class>-->
+		<properties>
+			<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
+			<property name="javax.persistence.jdbc.url" value="jdbc:hsqldb:file:txmdb/db;shutdown=true;hsqldb.write_delay=false;hsqldb.lock_file=false;hsqldb.applog=0;hsqldb.sqllog=0"/>
+			<property name="javax.persistence.jdbc.user" value="SA"/>
+			
+			<property name="eclipselink.logging.parameters" value="false"/>
+ 			<property name="eclipselink.logging.level" value="OFF" />
+ 			
+<!-- 			<property name="eclipselink.jdbc.read-connections.min" value="1" />
+			<property name="eclipselink.jdbc.write-connections.min" value="1" />
+			<property name="eclipselink.jdbc.batch-writing" value="JDBC" />
+  -->
+			<!-- Logging 
+			<property name="eclipselink.logging.file" value="output.log"/>
+			<property name="eclipselink.logging.logger" value="JavaLogger"/>
+			-->
+		
+<!-- 		<property name="eclipselink.logging.level" value="FINE" />
+			<property name="eclipselink.logging.timestamp" value="false" />
+			<property name="eclipselink.logging.session" value="false" />
+			<property name="eclipselink.logging.thread" value="false" /> -->
+			
+			<!-- <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> -->
+			<!-- <property name="eclipselink.ddl-generation.output-mode" value="database"/> -->
+		</properties>
+ 
+	</persistence-unit>
+</persistence>
\ No newline at end of file

Property changes on: tmp/org.txm.annotation.core/META-INF/persistence.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.annotation.core/schema/org.txm.annotation.AnnotationEngine.exsd
===================================================================
--- tmp/org.txm.annotation.core/schema/org.txm.annotation.AnnotationEngine.exsd	(revision 0)
+++ tmp/org.txm.annotation.core/schema/org.txm.annotation.AnnotationEngine.exsd	(revision 490)
@@ -0,0 +1,102 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.txm.annotation.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.txm.annotation.core" id="org.txm.annotation.AnnotationEngine" name="org.txm.annotation.AnnotationEngine"/>
+      </appinfo>
+      <documentation>
+         Annotation engine
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <choice minOccurs="1" maxOccurs="unbounded">
+            <element ref="AnnotationEngine"/>
+         </choice>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute translatable="true"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="AnnotationEngine">
+      <complexType>
+         <attribute name="class" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn="org.txm.annotation.AnnotationEngine:"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiinfo"/>
+      </appinfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+
+</schema>

Property changes on: tmp/org.txm.annotation.core/schema/org.txm.annotation.AnnotationEngine.exsd
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationEngines.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationEngines.java	(revision 0)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationEngines.java	(revision 490)
@@ -0,0 +1,60 @@
+package org.txm.annotation;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.txm.Engine;
+import org.txm.EngineType;
+import org.txm.EnginesManager;
+import org.txm.Toolbox;
+
+public abstract class AnnotationEngines extends EnginesManager<AnnotationEngine> {
+	@Override
+	public boolean startEngines(IProgressMonitor monitor) {
+		
+		for (Engine e : engines.values()) {
+			AnnotationEngine se = (AnnotationEngine)e;
+			if (monitor != null) monitor.subTask("Starting "+ se.getName()+" annotation engine.");
+			se.start(monitor);
+		}
+		return true;
+	}
+
+	@Override
+	public boolean stopEngines() {
+		for (Engine e : engines.values()) {
+			AnnotationEngine se = (AnnotationEngine)e;
+			System.out.println("Stoping "+ se.getName()+" annotation engine.");
+			se.stop();
+		}
+		return true;
+	}
+
+	@Override
+	public EngineType getEnginesType() {
+		return EngineType.ANNOTATION;
+	}
+
+	@Override
+	protected boolean fetchEngines() {
+		
+		IConfigurationElement[] contributions = Platform.getExtensionRegistry().getConfigurationElementsFor(AnnotationEngine.EXTENSION_POINT_ID);
+		//System.out.println("search engine contributions: "+SearchEngine.EXTENSION_POINT_ID);
+		for (int i = 0; i < contributions.length; i++) {
+			try {
+				AnnotationEngine e = (AnnotationEngine)contributions[i].createExecutableExtension("class"); //$NON-NLS-1$
+				if (e.initialize()) {
+					engines.put(e.getName(), e);
+				} else {
+					System.out.println("Fail to initialize "+e.getName()+" annotation engine.");
+				}
+			} catch(CoreException e) {
+				System.out.println("Fail instanciate "+contributions[i].getName()+": "+e.getLocalizedMessage());
+				e.printStackTrace();
+			} 
+		}
+		
+		return engines.size() > 0;
+	}
+}

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

Index: tmp/org.txm.annotation.core/src/org/txm/annotation/KRAnnotationEngine.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/KRAnnotationEngine.java	(revision 0)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/KRAnnotationEngine.java	(revision 490)
@@ -0,0 +1,288 @@
+package org.txm.annotation;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.txm.annotation.repository.KnowledgeRepository;
+import org.txm.annotation.repository.KnowledgeRepositoryManager;
+import org.txm.annotation.repository.SQLKnowledgeRepository;
+import org.txm.objects.BaseParameters;
+import org.txm.searchengine.cqp.corpus.Corpus;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
+import org.txm.sql.SQLConnection;
+import org.txm.utils.logger.Log;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+public class KRAnnotationEngine extends AnnotationEngine {
+
+	static HashMap<MainCorpus, AnnotationManager> ams = new HashMap<MainCorpus, AnnotationManager>();
+	public static String KNOWLEDGE_ACCESS = "access";
+	public static String KNOWLEDGE_STRINGS = "strings";
+	public static String KNOWLEDGE_TYPEQUERIES = "queries";
+	public static String KNOWLEDGE_TYPES = "fields";
+	
+	public static String KNOWLEDGE_TYPEWEBACCESS = "typeaccess";
+
+	public static boolean canBeAnnotated(MainCorpus corpus) {
+		return getKnowledgeRepositoryNames(corpus).size() > 0;
+	}
+
+	public static AnnotationManager getAnnotationManager(Corpus corpus){
+		return ams.get(corpus.getMainCorpus());
+	}
+
+	public static AnnotationManager getAnnotationManager(MainCorpus corpus) {
+		AnnotationManager am = ams.get(corpus);
+		if (am == null) {
+			if (getKnowledgeRepositoryNames(corpus).size() > 0) {
+				am = new AnnotationManager(corpus);
+				ams.put(corpus, am);
+			}
+				
+		}
+		return am;
+	}
+	
+	protected static Element getKnowledgeRepositoriesElement(Element corpusElement) {
+		NodeList textsList = corpusElement.getElementsByTagName("knowledgeRepositories");
+		if (textsList.getLength() == 0) {
+			Element knowledgeRepositories = corpusElement.getOwnerDocument().createElement("knowledgeRepositories");
+			corpusElement.appendChild(knowledgeRepositories);
+			return knowledgeRepositories;
+		} else {
+			return (Element) textsList.item(0);
+		}
+	}
+
+	/**
+	 * 
+	 * Lazy load KR
+	 * 
+	 * @param name KnowledgeRepository's name
+	 * @return may return null if the KnowledgeRepository does not exist
+	 */
+	public static KnowledgeRepository getKnowledgeRepository(Corpus corpus, String name) {
+		return KnowledgeRepositoryManager.getKnowledgeRepository(name, corpus.getMainCorpus());
+	}
+
+	/**
+	 * Utility method to get a knowledge repository configuration
+	 * 
+	 * @param name the repository name
+	 * @return
+	 */
+	public static HashMap<String, HashMap<String, ?>> getKnowledgeRepositoryConfiguration(String name, Element e) {
+		HashMap<String, HashMap<String, ?>> repConfiguration = new HashMap<String, HashMap<String, ?>>();
+
+		HashMap<String, String> access = new HashMap<String, String>();
+		HashMap<String, HashMap<String, String>> strings = new HashMap<String, HashMap<String, String>>();
+		HashMap<String, HashMap<String, String>> fields = new HashMap<String, HashMap<String, String>>();
+
+		if (e == null) return null;
+
+		access.put(SQLKnowledgeRepository.NAME, e.getAttribute(SQLKnowledgeRepository.NAME));
+		access.put("version", e.getAttribute("version"));
+		access.put("mode", e.getAttribute("mode"));
+		access.put(SQLKnowledgeRepository.TYPE_URL, e.getAttribute(SQLKnowledgeRepository.TYPE_URL));
+		access.put(SQLKnowledgeRepository.TYPE_RESURL, e.getAttribute(SQLKnowledgeRepository.TYPE_RESURL));
+		access.put(SQLKnowledgeRepository.TYPE_TYPEURL, e.getAttribute(SQLKnowledgeRepository.TYPE_TYPEURL));
+		access.put(SQLConnection.SQL_ADDRESS, e.getAttribute(SQLConnection.SQL_ADDRESS));
+		access.put(SQLConnection.SQL_DRIVER, e.getAttribute(SQLConnection.SQL_DRIVER));
+		access.put(SQLConnection.SQL_PORT, e.getAttribute(SQLConnection.SQL_PORT));
+		access.put(SQLConnection.SQL_USER, e.getAttribute(SQLConnection.SQL_USER));
+		access.put(SQLConnection.SQL_PASSWORD, e.getAttribute(SQLConnection.SQL_PASSWORD));
+
+		//<type id="" name> ... </type>
+		NodeList typesList = e.getElementsByTagName("type");
+		for (int i = 0 ; i < typesList.getLength() ; i++) {
+			//<field type="xxx">yyy</field>
+			Element typeElement = (Element)typesList.item(i);
+			String type_id = ""+typeElement.getAttribute(SQLKnowledgeRepository.TYPE_ID);
+			
+			String type_name = typeElement.getAttribute(SQLKnowledgeRepository.NAME);
+			if (type_name == null || type_name.length() == 0) type_name = type_id;
+			
+			String type_url = ""+typeElement.getAttribute(SQLKnowledgeRepository.TYPE_URL);
+			
+			String type_size = typeElement.getAttribute(SQLKnowledgeRepository.TYPE_SIZE);
+			if (type_size == null || type_size.length() == 0) type_size = "SMALL"; // show all by default 
+			type_size = type_size.toUpperCase();
+			
+			String type_effect = typeElement.getAttribute(SQLKnowledgeRepository.TYPE_EFFECT);
+			if (type_effect == null || type_effect.length() == 0) type_effect = "SEGMENT"; // segment annotation by default 
+			type_effect = type_effect.toUpperCase();
+
+			HashMap<String, String> hashFields = new HashMap<String, String>();
+			NodeList fieldsList = typeElement.getElementsByTagName("field"); // contains KR type specific properties
+			for (int j = 0 ; j < fieldsList.getLength() ; j++) {
+				Element fieldElement = (Element)fieldsList.item(j);
+				hashFields.put(fieldElement.getAttribute("type"), fieldElement.getTextContent());
+			}
+
+			hashFields.put(SQLKnowledgeRepository.TYPE_URL, type_url);
+			hashFields.put(SQLKnowledgeRepository.NAME, type_name);
+			hashFields.put(SQLKnowledgeRepository.TYPE_SIZE, type_size);
+			hashFields.put(SQLKnowledgeRepository.TYPE_EFFECT, type_effect);
+			fields.put(type_id, hashFields);
+		}
+		
+		NodeList stringsList = e.getElementsByTagName("strings");
+		for (int i = 0 ; i < stringsList.getLength() ; i++) {
+			Element stringsElement = (Element)stringsList.item(i);
+			String lang = stringsElement.getAttribute("lang");
+			if (lang == null) lang = "en"; // default lang is "en"
+			
+			HashMap<String, String> values = new HashMap<String, String>();
+			strings.put(lang, values);
+			
+			NodeList stringList = stringsElement.getElementsByTagName("string");
+			for (int j = 0 ; j < stringList.getLength() ; j++) {
+				Element stringElement = (Element)stringList.item(j);
+				String key = stringElement.getAttribute("key");
+				if (key != null) {
+					values.put(key, stringElement.getTextContent());
+				}
+			}
+		}
+
+		repConfiguration.put(KNOWLEDGE_ACCESS, access);
+		repConfiguration.put(KNOWLEDGE_TYPES, fields);
+		repConfiguration.put(KNOWLEDGE_STRINGS, strings);
+		
+		return repConfiguration;
+	}
+
+	public static Element getKnowledgeRepositoryElement(BaseParameters params, String name) {
+		Element rElement = getKnowledgeRepositoriesElement(params.getCorpusElement());
+		NodeList repositoriesList = rElement.getElementsByTagName("repository");
+		for (int i = 0 ; i < repositoriesList.getLength() ; i++) {
+			Element e = ((Element)repositoriesList.item(i));
+			if (name.equals(e.getAttribute("name"))) {
+				return e;
+			}
+		}
+
+		return null;
+	}
+	
+
+	/**
+	 * Utility method to get a knowledge repository configuration
+	 * 
+	 * @param params
+	 * @return the repository names
+	 */
+	public static List<String> getKnowledgeRepositoryNames(BaseParameters params) {
+		ArrayList<String> names = new ArrayList<String>();
+		Element corpusElement = params.getCorpusElement();
+		if (corpusElement == null) return names;
+		
+		Element rElement = getKnowledgeRepositoriesElement(corpusElement);
+		if (rElement == null) return names;
+		
+		NodeList repositoriesList = rElement.getElementsByTagName("repository");
+		for (int i = 0 ; i < repositoriesList.getLength() ; i++) {
+			names.add(((Element)repositoriesList.item(i)).getAttribute("name"));
+		}
+		return names;
+	}
+	
+	/**
+	 * 
+	 * @param corpus the corpus
+	 * @return the repository names
+	 */
+	public static List<String> getKnowledgeRepositoryNames(Corpus corpus) {
+		BaseParameters params = corpus.getBase().getBaseParameters();
+		return getKnowledgeRepositoryNames(params);
+	}
+	
+	/**
+	 * 
+	 * @param corpus
+	 * @return true if there are annotations to save for this corpus
+	 */
+	public static boolean needToSaveAnnotations(MainCorpus corpus) {
+		AnnotationManager am = ams.get(corpus);
+		if (am != null) 
+			return am.hasChanges();
+		else
+			return false;
+	}
+	
+	public void closeAnnotationManager(MainCorpus corpus) {
+		AnnotationManager am = ams.get(corpus);
+		if (am != null) {
+			//System.out.println("  Closing AM...");
+			am.closeAll();
+		}
+	}
+	
+	protected Element createKnowledgeRepositoryElement(BaseParameters params, String name) {
+		Element rElement = getKnowledgeRepositoriesElement(params.getCorpusElement());
+		Element e = rElement.getOwnerDocument().createElement("repository");
+		e.setAttribute("name", name);
+		e.setAttribute("mode", "file");
+		e.setAttribute("user", "false");
+		e.setAttribute("password", "false");
+		e.setAttribute("version", "0");
+		
+		rElement.appendChild(e);
+		return e;
+	}
+	
+	@Override
+	public String getName() {
+		return "KR Annotation engine";
+	}
+
+	@Override
+	public boolean getState() {
+		return true;
+	}
+
+	@Override
+	public boolean initialize() { // nothing to load right now, the kr and am are lazy
+		return false;
+	}
+
+	@SuppressWarnings("unchecked")
+	public boolean[] mustLoginToKnowledgeRepository(Corpus corpus, String kr_name) {
+		return KnowledgeRepositoryManager.mustLoginToKnowledgeRepository(kr_name, corpus.getMainCorpus());
+	}
+
+	@Override
+	public boolean start(IProgressMonitor monitor) {
+		return true;
+	}
+
+	@Override
+	public boolean stop() {
+		boolean success = true; 
+		for (KnowledgeRepository kr : KnowledgeRepositoryManager.getKnowledgeRepositories()) {
+			try {
+				if (kr.getJPAManager().isOpen())
+					kr.getJPAManager().close();
+			} catch(Exception e) {
+				System.out.println("Error: cannot close KR "+kr+": "+e.getLocalizedMessage());
+				Log.printStackTrace(e);
+				success = false;
+			}
+		}
+		for (AnnotationManager am : ams.values()) {
+			try {
+				if (am.isOpen())
+					am.closeAll();
+			} catch(Exception e) {
+				System.out.println("Error: cannot close AM "+am+": "+e.getLocalizedMessage());
+				Log.printStackTrace(e);
+				success = false;
+			}
+		}
+		
+		return success;
+	}
+}

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

Index: tmp/org.txm.annotation.core/src/org/txm/annotation/repository/KnowledgeRepository.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/repository/KnowledgeRepository.java	(revision 489)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/repository/KnowledgeRepository.java	(revision 490)
@@ -91,6 +91,10 @@
 		// <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
 
 		emf = new PersistenceProvider().createEntityManagerFactory(DatabasePersistenceManager.PERSISTENCE_UNIT_NAME, properties);
+		if (emf == null) {
+			System.out.println("Error: could not create the PersistenceProvider with name: "+DatabasePersistenceManager.PERSISTENCE_UNIT_NAME);
+			return null;
+		}
 		EntityManager entityManager = (EntityManager) emf.createEntityManager();
 		this.jpaem = entityManager;
 		return entityManager;
Index: tmp/org.txm.annotation.core/src/org/txm/annotation/repository/KnowledgeRepositoryManager.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/repository/KnowledgeRepositoryManager.java	(revision 489)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/repository/KnowledgeRepositoryManager.java	(revision 490)
@@ -4,9 +4,12 @@
 import java.util.HashMap;
 import java.util.List;
 
+import javax.persistence.EntityManager;
+
 import org.apache.commons.io.FileUtils;
 import org.txm.Toolbox;
 import org.txm.annotation.DatabasePersistenceManager;
+import org.txm.annotation.KRAnnotationEngine;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.objects.BaseParameters;
 import org.txm.sql.SQLConnection;
@@ -36,7 +39,7 @@
 	 */
 	@SuppressWarnings("unchecked")
 	public static KnowledgeRepository createKnowledgeRepository(String name, Element element) {
-		HashMap<String, HashMap<String, ?>> conf = BaseParameters.getKnowledgeRepositoryConfiguration(name, element);
+		HashMap<String, HashMap<String, ?>> conf = KRAnnotationEngine.getKnowledgeRepositoryConfiguration(name, element);
 		return createKnowledgeRepository(name, conf);
 	}
 	
@@ -52,9 +55,9 @@
 
 		//System.out.println("Creating Knowledge repository ["+name+"] with configuration="+conf);
 
-		HashMap<String, String> access = (HashMap<String, String>) conf.get(BaseParameters.KNOWLEDGE_ACCESS);
-		HashMap<String, HashMap<String, String>> fields = (HashMap<String, HashMap<String, String>>) conf.get(BaseParameters.KNOWLEDGE_TYPES);
-		HashMap<String, HashMap<String, String>> strings = (HashMap<String, HashMap<String, String>>) conf.get(BaseParameters.KNOWLEDGE_STRINGS);
+		HashMap<String, String> access = (HashMap<String, String>) conf.get(KRAnnotationEngine.KNOWLEDGE_ACCESS);
+		HashMap<String, HashMap<String, String>> fields = (HashMap<String, HashMap<String, String>>) conf.get(KRAnnotationEngine.KNOWLEDGE_TYPES);
+		HashMap<String, HashMap<String, String>> strings = (HashMap<String, HashMap<String, String>>) conf.get(KRAnnotationEngine.KNOWLEDGE_STRINGS);
 		String access_type = access.get("mode");
 		
 		KnowledgeRepository kr = null;
@@ -79,7 +82,8 @@
 			kr.setAccessProperties(access);
 			kr.setStrings(strings);
 			kr.setFieldsTypesProperties(fields);
-			kr.initializeEntityManager();
+			EntityManager em = kr.initializeEntityManager();
+			if (em == null) return null;
 			kr.buildTypesAndValues();
 		} else {
 			System.out.println("Error. KR not created.");
@@ -106,6 +110,7 @@
 			if (krconf.exists()) {
 				try {
 					kr = createKnowledgeRepository(name, DomUtils.load(krconf).getDocumentElement());
+					if (kr == null) return null;
 					repositories.put(name, kr);
 				} catch (Exception e) {
 					System.out.println("Fail to load KR from configuration file: "+krconf);
@@ -135,6 +140,7 @@
 						repositories.put(name, kr);
 					} else {
 						System.out.println("KR not created: "+name);
+						return null;
 					}
 				} catch (Exception e) {
 					System.out.println("Fail to load KR from configuration file: "+krconf);
@@ -143,7 +149,7 @@
 			}
 		}
 		
-		Element krCorpusElement = corpus.getBase().getBaseParameters().getKnowledgeRepositoryElement(name);
+		Element krCorpusElement = KRAnnotationEngine.getKnowledgeRepositoryElement(corpus.getBase().getBaseParameters(), name);
 		String sKRCorpusVersion = krCorpusElement.getAttribute("version");
 		
 		if (kr != null) {
Index: tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationEngine.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationEngine.java	(revision 0)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationEngine.java	(revision 490)
@@ -0,0 +1,11 @@
+package org.txm.annotation;
+
+import org.txm.Engine;
+
+public abstract class AnnotationEngine implements Engine {
+
+	public static final String EXTENSION_POINT_ID = AnnotationEngine.class.getCanonicalName();
+
+	@Override
+	public abstract String getName();
+}

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

Index: tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationManager.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationManager.java	(revision 489)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationManager.java	(revision 490)
@@ -6,11 +6,11 @@
 import java.util.HashMap;
 import java.util.List;
 
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.annotation.repository.AnnotationEffect;
 import org.txm.annotation.repository.AnnotationType;
 import org.txm.annotation.repository.TypedValue;
 import org.txm.annotation.storage.temporary.TemporaryAnnotationManager;
-import org.txm.functions.ProgressWatcher;
 import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.searchengine.cqp.corpus.query.Match;
 import org.txm.utils.logger.Log;
@@ -76,7 +76,7 @@
 	 * @return
 	 * @throws Exception
 	 */
-	public boolean deleteAnnotations(AnnotationType type, ProgressWatcher job) throws Exception {
+	public boolean deleteAnnotations(AnnotationType type, IProgressMonitor job) throws Exception {
 		List<Annotation> temporaryAnnotations = null;
 		List<Annotation> cqpAnnotations = null;
 		try {
@@ -113,7 +113,7 @@
 		return true;
 	}
 	
-	public boolean deleteAnnotations(AnnotationType type, List<Match> matches, ProgressWatcher job) throws Exception {
+	public boolean deleteAnnotations(AnnotationType type, List<Match> matches, IProgressMonitor job) throws Exception {
 		try {
 			tempManager.getEntityManager().getTransaction().begin();
 			for (Match m : matches) {
@@ -208,7 +208,7 @@
 	 * @return
 	 */
 	public HashMap<Match,List<Annotation>> createAnnotations(AnnotationType annotSelectedType,
-			TypedValue annotSelectedTypedValue, List<Match> matches, ProgressWatcher job) {
+			TypedValue annotSelectedTypedValue, List<Match> matches, IProgressMonitor job) {
 
 		HashMap<Match,List<Annotation>> allAnnotationsThatCollides = new HashMap<Match, List<Annotation>>();
 		tempManager.getEntityManager().getTransaction().begin(); // warning
@@ -299,4 +299,8 @@
 		tempManager.close();
 		cqpManager.close();
 	}
+
+	public boolean isOpen() {
+		return tempManager.getEntityManager().isOpen();
+	}
 }
Index: tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationWriter.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationWriter.java	(revision 489)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/AnnotationWriter.java	(revision 490)
@@ -34,7 +34,7 @@
 
 	public AnnotationWriter(MainCorpus corpus){
 		this.corpus = corpus;
-		defaultKR = corpus.getKnowledgeRepository(corpus.getKnowledgeRepositoryNames().get(0));
+		defaultKR = KRAnnotationEngine.getKnowledgeRepository(corpus, KRAnnotationEngine.getKnowledgeRepositoryNames(corpus).get(0));
 		types = defaultKR.getAllAnnotationTypes();
 		
 	}
@@ -196,7 +196,7 @@
 				ArrayList<Annotation> allSegmentAnnotations = new ArrayList<Annotation>();
 				ArrayList<Annotation> allTokenAnnotations = new ArrayList<Annotation>();
 
-				KnowledgeRepository defaultKR = corpus.getKnowledgeRepository(corpus.getKnowledgeRepositoryNames().get(0));
+				KnowledgeRepository defaultKR = KRAnnotationEngine.getKnowledgeRepository(corpus, KRAnnotationEngine.getKnowledgeRepositoryNames(corpus).get(0));
 				System.out.println("Using KR="+defaultKR);
 				for (Annotation a : allAnnotations) {
 					AnnotationType type = defaultKR.getType(a.getType());
Index: tmp/org.txm.annotation.core/src/org/txm/annotation/CQPAnnotationManager.java
===================================================================
--- tmp/org.txm.annotation.core/src/org/txm/annotation/CQPAnnotationManager.java	(revision 489)
+++ tmp/org.txm.annotation.core/src/org/txm/annotation/CQPAnnotationManager.java	(revision 490)
@@ -78,8 +78,8 @@
 		if (type == null) {
 			
 			// first get know annotations from corpus's KR
-			for (String kr_name : corpus.getKnowledgeRepositoryNames()) {
-				KnowledgeRepository kr = corpus.getKnowledgeRepository(kr_name);
+			for (String kr_name : KRAnnotationEngine.getKnowledgeRepositoryNames(corpus)) {
+				KnowledgeRepository kr = KRAnnotationEngine.getKnowledgeRepository(corpus, kr_name);
 				if (kr == null) continue;
 				List<AnnotationType> types = kr.getAllAnnotationTypes();
 				for (AnnotationType t : types) {
Index: tmp/org.txm.annotation.core/build.properties
===================================================================
--- tmp/org.txm.annotation.core/build.properties	(revision 489)
+++ tmp/org.txm.annotation.core/build.properties	(revision 490)
@@ -1,4 +1,2 @@
-source.. = src/
 output.. = bin/
-bin.includes = META-INF/,\
-               .
+bin.includes = plugin.xml
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java	(revision 489)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/functions/diagnostic/Diagnostic.java	(revision 490)
@@ -43,7 +43,7 @@
 
 import org.eclipse.osgi.util.NLS;
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.objects.Base;
 import org.txm.searchengine.cqp.AbstractCqiClient;
@@ -600,7 +600,7 @@
 	}
 
 	@Override
-	public boolean compute(ProgressWatcher monitor) throws Exception {
+	public boolean compute(IProgressMonitor monitor) throws Exception {
 		if (monitor != null) monitor.beginTask("Computing informations...", 3);
 		stepGeneralInfos();
 		if (monitor != null) monitor.worked(1);
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPEngine.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPEngine.java	(revision 489)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPEngine.java	(revision 490)
@@ -276,9 +276,6 @@
 		try {
 			if (cqiClient instanceof MemCqiClient) {
 				try  {
-					for (MainCorpus corpus : CorpusManager.getCorpusManager().getCorpora()) {
-						corpus.closeAnnotationManager();
-					}
 				} catch(Exception e) {}
 				for (String name : ((MemCqiClient)cqiClient).listCorpora()) {
 					((MemCqiClient)cqiClient).dropCorpus(name);
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 489)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java	(revision 490)
@@ -39,11 +39,8 @@
 import java.util.UUID;
 
 import org.txm.Toolbox;
-import org.txm.annotation.AnnotationManager;
-import org.txm.annotation.repository.KnowledgeRepository;
-import org.txm.annotation.repository.KnowledgeRepositoryManager;
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.objects.Base;
 import org.txm.objects.BaseParameters;
 import org.txm.objects.TxmObject;
@@ -64,8 +61,6 @@
  */
 public class MainCorpus extends Corpus {
 	
-	AnnotationManager am;
-
 	private static final long serialVersionUID = 6776153557376588804L;
 
 	/**
@@ -117,7 +112,7 @@
 	 * @return true, if successful
 	 */
 	@Override
-	public boolean export(File exportzip, ProgressWatcher monitor)
+	public boolean export(File exportzip, IProgressMonitor monitor)
 	{
 		if (this.getBase() != null)
 			return this.getBase().export(exportzip, monitor);
@@ -359,7 +354,6 @@
 	 */
 	@Override
 	public boolean delete() {
-		closeAnnotationManager();
 		removeFromCWB();
 		Base b = this.getBase();
 		if (b != null) b.delete();
@@ -539,16 +533,6 @@
 	}
 
 
-	
-	public AnnotationManager getAnnotationManager() {
-		//return null;
-		if (am == null) {
-			if (this.getKnowledgeRepositoryNames().size() > 0)
-			am = new AnnotationManager(this);
-		}
-		return am;
-	}
-	
 	protected boolean modified = false;
 	public boolean isModified() { return modified; }
 	public void setIsModified(boolean b) { modified = b; }
@@ -558,56 +542,7 @@
 		else
 			return getName();
 	}
-	
-	public boolean needToSaveAnnotations() {
-		if (getAnnotationManager() != null)
-			return am.hasChanges();
-		else
-			return false;
-	}
 
-	public boolean canBeAnnotated() {
-		return getKnowledgeRepositoryNames().size() > 0;
-	}
-
-	/**
-	 * 
-	 * Lazy load KR
-	 * 
-	 * @param name KnowledgeRepository's name
-	 * @return may return null if the KnowledgeRepository does not exist
-	 */
-	public KnowledgeRepository getKnowledgeRepository(String name) {
-		return KnowledgeRepositoryManager.getKnowledgeRepository(name, this);
-		
-//		if (kr != null) return kr; // \o/
-//		
-//		BaseParameters params = this.getBase().getBaseParameters();
-//		HashMap<String, HashMap<String, ?>> conf = params.getKnowledgeRepository(name);
-//		
-//		if (conf == null) return null;
-//
-//		return KnowledgeRepositoryManager.createKnowledgeRepository(name, conf);
-	}
-
-	/**
-	 * 
-	 * @param name KnowledgeRepository's name
-	 * @return may return null if the KnowledgeRepository does not exist
-	 */
-	public List<String> getKnowledgeRepositoryNames() {
-		BaseParameters params = this.getBase().getBaseParameters();
-		return params.getKnowledgeRepositoryNames();
-	}
-
-	public void closeAnnotationManager() {
-		if (am != null) {
-			//System.out.println("  Closing AM...");
-			am.closeAll();
-		}
-	}
-
-
 	@Override
 	public String getDetails() {
 		// TODO Auto-generated method stub
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 489)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 490)
@@ -32,14 +32,11 @@
 import java.util.List;
 
 import org.eclipse.osgi.util.NLS;
-import org.txm.annotation.AnnotationManager;
-import org.txm.annotation.repository.KnowledgeRepository;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.functions.selection.SelectionResult;
 import org.txm.objects.Base;
 import org.txm.objects.TxmObject;
 import org.txm.searchengine.cqp.AbstractCqiClient;
-import org.txm.searchengine.cqp.ICqiClient;
 import org.txm.searchengine.cqp.NetCqiClient;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
@@ -512,40 +509,17 @@
 	}
 
 	@Override
-	public KnowledgeRepository getKnowledgeRepository(String name) {
-		return this.getMainCorpus().getKnowledgeRepository(name);
-	}
-
-	@Override
-	public List<String> getKnowledgeRepositoryNames() {
-		return this.getMainCorpus().getKnowledgeRepositoryNames();
-	}
-
-	@Override
-	public AnnotationManager getAnnotationManager() {
-		return this.getMainCorpus().getAnnotationManager();
-	}
-
-	@Override
-	public boolean canBeAnnotated() {
-		return this.getMainCorpus().canBeAnnotated();
-	}
-
-	@Override
 	public String getSimpleName() {
-		// TODO Auto-generated method stub
-		return null;
+		return this.getName();
 	}
 
 	@Override
 	public String getDetails() {
-		// TODO Auto-generated method stub
-		return null;
+		return this.getName()+ " (" + this.getQualifiedCqpId()+")";
 	}
 
 	@Override
 	public void clean() {
 		// TODO Auto-generated method stub
-		
 	}
 }
Index: tmp/org.txm.searchengine.cqp.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.searchengine.cqp.core/META-INF/MANIFEST.MF	(revision 489)
+++ tmp/org.txm.searchengine.cqp.core/META-INF/MANIFEST.MF	(revision 490)
@@ -8,8 +8,7 @@
  org.txm.core;bundle-version="0.7.0",
  org.txm.searchengine.core;bundle-version="1.0.0",
  org.txm.libs.cqp;bundle-version="1.0.0",
- org.txm.utils;bundle-version="1.0.0",
- org.txm.annotation.core;bundle-version="1.0.0"
+ org.txm.utils;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ClassPath: res/,
  .
Index: tmp/org.txm.referencer.core/src/org/txm/functions/referencer/Referencer.java
===================================================================
--- tmp/org.txm.referencer.core/src/org/txm/functions/referencer/Referencer.java	(revision 489)
+++ tmp/org.txm.referencer.core/src/org/txm/functions/referencer/Referencer.java	(revision 490)
@@ -57,7 +57,7 @@
 import java.util.Map;
 
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
@@ -147,7 +147,7 @@
 	 *
 	 * @return true, if successful
 	 */
-	public boolean compute(ProgressWatcher monitor)
+	public boolean compute(IProgressMonitor monitor)
 	{
 		try {
 			if (this.parent == null || query == null || pattern == null || prop == null)
Index: tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesResult.java
===================================================================
--- tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesResult.java	(revision 489)
+++ tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitesResult.java	(revision 490)
@@ -39,7 +39,7 @@
 
 import org.rosuda.REngine.REXPMismatchException;
 import org.rosuda.REngine.Rserve.RserveException;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.lexicaltable.core.functions.LexicalTableFactory;
@@ -130,7 +130,7 @@
 	protected double[][] selectedSpecificitiesIndex;
 	
 	
-	public boolean compute(ProgressWatcher monitor) {
+	public boolean compute(IProgressMonitor monitor) {
 		//TODO: not implemented yet. The specificitesResults should work with a LexicalTable only? if yes, then the calling commands must build it
 		return false;
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImport.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImport.groovy	(revision 489)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/XTZImport.groovy	(revision 490)
@@ -6,7 +6,7 @@
 import java.util.Arrays;
 import java.util.Collections;
 
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.utils.xml.DomUtils;
 import org.txm.metadatas.Metadatas
 import org.txm.objects.BaseParameters
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/ImportModule.java
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/ImportModule.java	(revision 489)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/ImportModule.java	(revision 490)
@@ -9,7 +9,7 @@
 
 import org.txm.Toolbox;
 import org.txm.core.preferences.TBXPreferences;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.utils.xml.DomUtils;
 import org.txm.objects.BaseParameters;
 import org.txm.utils.DeleteDir;
@@ -36,9 +36,9 @@
 	public boolean updateCorpus = false;
 	public String corpusName;
 
-	ProgressWatcher monitor;
+	IProgressMonitor monitor;
 	
-	public void setMonitor(ProgressWatcher monitor) {
+	public void setMonitor(IProgressMonitor monitor) {
 		this.monitor = monitor;
 	}
 
Index: tmp/org.txm.lexicaltable.core/src/org/txm/functions/intertextualdistance/InterTextDistance.java
===================================================================
--- tmp/org.txm.lexicaltable.core/src/org/txm/functions/intertextualdistance/InterTextDistance.java	(revision 489)
+++ tmp/org.txm.lexicaltable.core/src/org/txm/functions/intertextualdistance/InterTextDistance.java	(revision 490)
@@ -7,7 +7,7 @@
 
 import org.rosuda.REngine.REXP;
 import org.rosuda.REngine.REXPMismatchException;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
@@ -27,7 +27,7 @@
 	
 	
 	@Override
-	public boolean compute(ProgressWatcher watcher) {
+	public boolean compute(IProgressMonitor watcher) {
 try {
 	//		Corpus corpus = CorpusManager.getCorpusManager().getCorpus("VOEUX");
 	//		String method = "euclidean"; // "euclidean"’, ‘"maximum"’, ‘"manhattan"’, ‘"canberra"’, ‘"binary"’ or ‘"minkowski"’
Index: tmp/org.txm.cah.core/src/org/txm/cah/core/functions/CAH.java
===================================================================
--- tmp/org.txm.cah.core/src/org/txm/cah/core/functions/CAH.java	(revision 489)
+++ tmp/org.txm.cah.core/src/org/txm/cah/core/functions/CAH.java	(revision 490)
@@ -35,7 +35,7 @@
 import org.txm.cah.core.messages.CAHCoreMessages;
 import org.txm.cah.core.preferences.CAHPreferences;
 import org.txm.core.preferences.TXMPreferences;
-import org.txm.functions.ProgressWatcher;
+import org.eclipse.core.runtime.IProgressMonitor;
 import org.txm.functions.TXMCommand;
 import org.txm.lexicaltable.core.functions.LexicalTable;
 import org.txm.searchengine.cqp.corpus.Corpus;
@@ -217,7 +217,7 @@
 	protected static int nocah = 1;
 
 	@Override
-	public boolean compute(ProgressWatcher watcher)	{
+	public boolean compute(IProgressMonitor watcher)	{
 		
 		Log.info("Computing CAH...");
 		try {
