Index: tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepository.java
===================================================================
--- tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepository.java	(revision 1192)
+++ tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/KnowledgeRepository.java	(revision 1193)
@@ -81,13 +81,13 @@
 //		
 		//properties.put(PersistenceUnitProperties.ECLIPSELINK_PERSISTENCE_XML, "/home/mdecorde/workspace079/org.txm.annotation.core/META-INF");
 //		//properties.put("javax.persistence.jdbc.driver", "org.hsqldb.jdbcDriver");
-//		String urlProperty = "jdbc:hsqldb:file:"+dbPath+"/db;shutdown=true;hsqldb.lock_file=false;";
-//		if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
-//			urlProperty += "";
-//		} else {
-//			urlProperty += "hsqldb.applog=0;hsqldb.sqllog=0";
-//		}
-//		properties.put("javax.persistence.jdbc.url", urlProperty);
+		String urlProperty = "jdbc:hsqldb:file:"+dbPath+"/db;shutdown=true;hsqldb.lock_file=false;";
+		if (Log.getLevel().intValue() < Level.WARNING.intValue()) {
+			urlProperty += "";
+		} else {
+			urlProperty += "hsqldb.applog=0;hsqldb.sqllog=0";
+		}
+		properties.put("javax.persistence.jdbc.url", urlProperty);
 //		properties.put("javax.persistence.jdbc.username", "SA");
 //		properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE, "database");
 //		properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-or-extend-tables"); // create&update table if needed
Index: tmp/org.txm.setups/shared/win/txm.nsi
===================================================================
--- tmp/org.txm.setups/shared/win/txm.nsi	(revision 1192)
+++ tmp/org.txm.setups/shared/win/txm.nsi	(revision 1193)
@@ -227,7 +227,7 @@
 	
 	SetOutPath $INSTDIR
 	
-	File /r ..\..\exportRCP\win32.win32.x86_64\*.*
+	File /r ..\..\exportRCP\win32.win32.x86_64\TXM\*.*
 	
 	;File /r plugins
 	;File /r features
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 1192)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java	(revision 1193)
@@ -36,8 +36,10 @@
 	public static JobHandler update(final MainCorpus corpus) {
 		
 		Project project = corpus.getProject();
+		if (project == null)  return null;
+		
 		if (!"xtz".equals(project.getImportModuleName())) {
-			System.out.println("Can't update a corpus not imprted with XTZ import module.");
+			System.out.println("Can't update a corpus not imported with the XTZ import module.");
 			return null;
 		}
 		project.setDirty();
Index: tmp/org.txm.rcp.feature/feature.xml
===================================================================
--- tmp/org.txm.rcp.feature/feature.xml	(revision 1192)
+++ tmp/org.txm.rcp.feature/feature.xml	(revision 1193)
@@ -437,4 +437,11 @@
          version="0.0.0"
          unpack="false"/>
 
+   <plugin
+         id="org.txm.libs.hsqldb"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
 </feature>
Index: tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java
===================================================================
--- tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java	(revision 1192)
+++ tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java	(revision 1193)
@@ -537,6 +537,7 @@
 					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());
+						
 						if (saveJob.getResult() == Status.CANCEL_STATUS) {
 							// update editor corpus
 							System.out.println("Fail to save annotations of the corpus."); //$NON-NLS-1$
Index: tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotations.java
===================================================================
--- tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotations.java	(revision 1192)
+++ tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotations.java	(revision 1193)
@@ -81,18 +81,6 @@
 
 					if (rez) {
 						System.out.println("Annotations are saved in XML-TXM files. Updating corpus indexes and editions");
-
-						monitor.setTaskName("updating corpus indexes and editions");
-						if (UpdateCorpus.update(corpus) != null) {
-							monitor.worked(50);
-							this.syncExec(new Runnable() {
-								public void run() {CorporaView.refreshObject(corpus);}
-							});
-						} else {
-							monitor.worked(50);
-							System.out.println("Fail to update corpus. Aborting");
-							System.out.println("Fix XML-TXM files and call command 'UpdateCorpus'");
-						}
 					} else {
 						System.out.println("Error while saving annotations (see logs above).");
 					}
@@ -107,7 +95,7 @@
 		};
 
 		if (doit[0]) jobhandler.startJob(true);
-
+		jobhandler.join();
 		return jobhandler;
 	}
 }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZPager.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZPager.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZPager.groovy	(revision 1193)
@@ -116,7 +116,8 @@
 
 				for (i = 0 ; i < ed.getPageFiles().size();) {
 					File f = ed.getPageFiles().get(i);
-					String wordid = ed.getIdx().get(i);
+					String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 					edition.addPage(""+(++i), wordid);
 				}
 			} catch(Exception e) {
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxm/xmltxmLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxm/xmltxmLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xmltxm/xmltxmLoader.groovy	(revision 1193)
@@ -221,7 +221,8 @@
 			edition.setIndex(outdir.getAbsolutePath());
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/discours/discoursLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/discours/discoursLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/discours/discoursLoader.groovy	(revision 1193)
@@ -131,7 +131,8 @@
 		edition.setIndex(outdir.getAbsolutePath());
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/frantext/frantextLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/frantext/frantextLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/frantext/frantextLoader.groovy	(revision 1193)
@@ -203,7 +203,8 @@
 
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			params.addPage(edition, ""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/xmlLoader.groovy	(revision 1193)
@@ -279,7 +279,8 @@
 
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bfm/bfmLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bfm/bfmLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/bfm/bfmLoader.groovy	(revision 1193)
@@ -186,7 +186,8 @@
 		edition.setIndex(outdir.getAbsolutePath());
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/docLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/docLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/docLoader.groovy	(revision 1193)
@@ -315,7 +315,8 @@
 		edition.setIndex(outdir.getAbsolutePath());
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/tmxLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/tmxLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/tmxLoader.groovy	(revision 1193)
@@ -162,7 +162,8 @@
 			edition.setIndex(outdir.getAbsolutePath());
 			for (i = 0 ; i < ed.getPageFiles().size();) {
 				File f = ed.getPageFiles().get(i);
-				String wordid = ed.getIdx().get(i);
+				String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 				edition.addPage(""+(++i), wordid);
 			}
 		}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivaLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivaLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivaLoader.groovy	(revision 1193)
@@ -271,7 +271,8 @@
 
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivamailLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivamailLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/factiva/factivamailLoader.groovy	(revision 1193)
@@ -142,7 +142,8 @@
 		edition.setIndex(outdir.getAbsolutePath());
 	for (i = 0 ; i < ed.getPageFiles().size();) {
 		File f = ed.getPageFiles().get(i);
-		String wordid = ed.getIdx().get(i);
+		String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 		edition.addPage(""+(++i), wordid);
 	}
 }
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/transcriberLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/transcriberLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/transcriberLoader.groovy	(revision 1193)
@@ -279,7 +279,8 @@
 			edition.setIndex(htmlDir.getAbsolutePath());
 			for (i = 0 ; i < ed.getPageFiles().size();) {
 				File f = ed.getPageFiles().get(i);
-				String wordid = ed.getIdx().get(i);
+				String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 				edition.addPage(""+(++i), wordid);
 			}
 		}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/txtLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/txtLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/txt/txtLoader.groovy	(revision 1193)
@@ -186,7 +186,8 @@
 		edition.setIndex(outdir.getAbsolutePath());
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/alcesteLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/alcesteLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/alceste/alcesteLoader.groovy	(revision 1193)
@@ -144,7 +144,8 @@
 		edition.setIndex(outdir.getAbsolutePath());
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/hyperbaseLoader.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/hyperbaseLoader.groovy	(revision 1192)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/hyperbase/hyperbaseLoader.groovy	(revision 1193)
@@ -144,7 +144,8 @@
 
 		for (i = 0 ; i < ed.getPageFiles().size();) {
 			File f = ed.getPageFiles().get(i);
-			String wordid = ed.getIdx().get(i);
+			String wordid = "w_0";
+				if (i < ed.getIdx().size()) wordid = ed.getIdx().get(i);
 			edition.addPage(""+(++i), wordid);
 		}
 	}
Index: tmp/org.txm.core/lib/hsqldb.jar
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: tmp/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1192)
+++ tmp/org.txm.core/src/java/org/txm/objects/Project.java	(revision 1193)
@@ -325,8 +325,6 @@
 		else	{
 			return true;
 		}
-		
-		
 	}
 	
 	/**
Index: tmp/org.txm.core/build.properties
===================================================================
--- tmp/org.txm.core/build.properties	(revision 1192)
+++ tmp/org.txm.core/build.properties	(revision 1193)
@@ -30,7 +30,6 @@
                lib/unoil-3.2.1.jar,\
                src/groovy/,\
                plugin.xml,\
-               lib/hsqldb.jar,\
                lib/sqlite-jdbc-3.8.11.2.jar,\
                lib/postgresql-9.4.1207.jre6.jar,\
                lib/jodconverter-core-3.1-beta.jar,\
Index: tmp/org.txm.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 1192)
+++ tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 1193)
@@ -9,7 +9,8 @@
  org.eclipse.core.commands;visibility:=reexport,
  org.eclipse.core.resources;visibility:=reexport,
  org.txm.libs.office;bundle-version="0.0.0";visibility:=reexport,
- org.txm.libs.msoffice;bundle-version="0.0.0";visibility:=reexport
+ org.txm.libs.msoffice;bundle-version="0.0.0";visibility:=reexport,
+ org.txm.libs.hsqldb;bundle-version="1.0.0";visibility:=reexport
 Export-Package: .,
  EDU.oswego.cs.dl.util.concurrent,
  EDU.oswego.cs.dl.util.concurrent.misc,
@@ -278,29 +279,6 @@
  org.hamcrest,
  org.hamcrest.core,
  org.hamcrest.internal,
- org.hsqldb,
- org.hsqldb.auth,
- org.hsqldb.dbinfo,
- org.hsqldb.error,
- org.hsqldb.index,
- org.hsqldb.jdbc,
- org.hsqldb.jdbc.pool,
- org.hsqldb.lib,
- org.hsqldb.lib.java,
- org.hsqldb.lib.tar,
- org.hsqldb.lib.tar.rb,
- org.hsqldb.map,
- org.hsqldb.navigator,
- org.hsqldb.persist,
- org.hsqldb.resources,
- org.hsqldb.result,
- org.hsqldb.rights,
- org.hsqldb.rowio,
- org.hsqldb.sample,
- org.hsqldb.scriptio,
- org.hsqldb.server,
- org.hsqldb.types,
- org.hsqldb.util,
  org.jdesktop.layout,
  org.json,
  org.jsoup,
@@ -471,18 +449,41 @@
  target
 Bundle-Vendor: Textometrie.org
 Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .,lib/ant-1.7.1.jar,lib/ant-launcher.jar,lib/ant.jar
- ,lib/antlr-2.7.7.jar,lib/asm-analysis-2.2.3.jar,lib/asm-tree-2.2.3.ja
- r,lib/colt-1.2.0.jar,lib/concurrent-1.3.4.jar,lib/dom4j-1.6.1.jar,lib
- /forms-1.0.7.jar,lib/jline-0.9.94.jar,lib/junit-4.5.jar,lib/jvectClip
- board-1.2.jar,lib/liquidlnf.jar,lib/log4j-1.2.12.jar,lib/looks-2.0.1.
- jar,lib/macSpecific.jar,lib/quaqua.jar,lib/REngine.jar,lib/RserveEngi
- ne.jar,lib/rtfCleaner.jar,lib/swing-layout-1.0.3.jar,lib/juniversalch
- ardet-1.0.3.jar,lib/textcat-1.0.1.jar,lib/saxon9he.jar,lib/jtidy-r938
- .jar,lib/json-20090211.jar,lib/juh-3.2.1.jar,lib/jurt-3.2.1.jar,lib/r
- idl-3.2.1.jar,lib/unoil-3.2.1.jar,lib/hsqldb.jar,lib/sqlite-jdbc-3.8.
- 11.2.jar,lib/postgresql-9.4.1207.jre6.jar,lib/jodconverter-core-3.1-b
- eta.jar
+Bundle-ClassPath: .,
+ lib/ant-1.7.1.jar,
+ lib/ant-launcher.jar,
+ lib/ant.jar,
+ lib/antlr-2.7.7.jar,
+ lib/asm-analysis-2.2.3.jar,
+ lib/asm-tree-2.2.3.jar,
+ lib/colt-1.2.0.jar,
+ lib/concurrent-1.3.4.jar,
+ lib/dom4j-1.6.1.jar,
+ lib/forms-1.0.7.jar,
+ lib/jline-0.9.94.jar,
+ lib/junit-4.5.jar,
+ lib/jvectClipboard-1.2.jar,
+ lib/liquidlnf.jar,
+ lib/log4j-1.2.12.jar,
+ lib/looks-2.0.1.jar,
+ lib/macSpecific.jar,
+ lib/quaqua.jar,
+ lib/REngine.jar,
+ lib/RserveEngine.jar,
+ lib/rtfCleaner.jar,
+ lib/swing-layout-1.0.3.jar,
+ lib/juniversalchardet-1.0.3.jar,
+ lib/textcat-1.0.1.jar,
+ lib/saxon9he.jar,
+ lib/jtidy-r938.jar,
+ lib/json-20090211.jar,
+ lib/juh-3.2.1.jar,
+ lib/jurt-3.2.1.jar,
+ lib/ridl-3.2.1.jar,
+ lib/unoil-3.2.1.jar,
+ lib/sqlite-jdbc-3.8.11.2.jar,
+ lib/postgresql-9.4.1207.jre6.jar,
+ lib/jodconverter-core-3.1-beta.jar
 Bundle-Version: 0.8.0.qualifier
 Bundle-Name: TXM Core Toolbox
 Bundle-ManifestVersion: 2
Index: tmp/org.txm.core/.classpath
===================================================================
--- tmp/org.txm.core/.classpath	(revision 1192)
+++ tmp/org.txm.core/.classpath	(revision 1193)
@@ -39,7 +39,6 @@
 	<classpathentry kind="src" path="test"/>
 	<classpathentry kind="src" path="res"/>
 	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
-	<classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>
 	<classpathentry exported="true" kind="lib" path="lib/jodconverter-core-3.1-beta.jar"/>
 	<classpathentry kind="lib" path="lib/jsoup-1.11.3.jar"/>
 	<classpathentry kind="output" path="bin"/>
Index: tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationArea.java
===================================================================
--- tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationArea.java	(revision 1192)
+++ tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationArea.java	(revision 1193)
@@ -59,7 +59,7 @@
 	protected abstract void _close();
 
 	/**
-	 * use this to save the annotations
+	 * use this to save the annotations. Save must end when the files are updated
 	 * 
 	 * @return
 	 */
Index: tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java
===================================================================
--- tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java	(revision 1192)
+++ tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/editor/AnnotationExtension.java	(revision 1193)
@@ -5,7 +5,10 @@
 import java.util.Comparator;
 
 import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.events.SelectionListener;
@@ -14,7 +17,11 @@
 import org.eclipse.swt.widgets.ToolItem;
 import org.txm.core.results.TXMResult;
 import org.txm.rcp.IImageKeys;
+import org.txm.rcp.commands.workspace.UpdateCorpus;
 import org.txm.rcp.editors.TXMEditorExtension;
+import org.txm.rcp.utils.JobHandler;
+import org.txm.rcp.views.corpora.CorporaView;
+import org.txm.searchengine.cqp.corpus.MainCorpus;
 import org.txm.utils.logger.Log;
 
 public class AnnotationExtension extends TXMEditorExtension<TXMResult> {
@@ -26,7 +33,7 @@
 	private SelectionListener defaultListener;
 
 	private ToolItem saveButton;
-	
+
 	public static final String GROUP_NAME = "Annotation";
 
 	@Override
@@ -130,7 +137,32 @@
 						saveSuccessful = saveSuccessful && aa.save();
 					}
 				}
-				saveButton.setEnabled(!saveSuccessful);
+
+				JobHandler job = new JobHandler("Updating corpus editions and indexes", true) {
+
+					@Override
+					protected IStatus run(IProgressMonitor monitor) {
+						final MainCorpus corpus = (MainCorpus) editor.getResult().getFirstParent(MainCorpus.class);
+						monitor.setTaskName("updating corpus indexes and editions");
+						if (corpus != null && UpdateCorpus.update(corpus) != null) {
+							monitor.worked(50);
+							this.syncExec(new Runnable() {
+								public void run() {
+									CorporaView.refreshObject(corpus);
+								}
+							});
+							return Status.OK_STATUS;
+						} else {
+							monitor.worked(50);
+							System.out.println("Fail to update corpus. Aborting");
+							System.out.println("Fix XML-TXM files and call command 'UpdateCorpus'");
+							return Status.CANCEL_STATUS;
+						}
+					}
+				};
+				job.schedule();
+
+
 			}
 
 			@Override
@@ -173,7 +205,7 @@
 			editor.getTopToolbar().setVisible(GROUP_NAME, false);
 		}
 	}
-	
+
 	protected void openDefaultAnnotationMode(SelectionEvent e) {
 		defaultListener.widgetSelected(e);
 	}
