Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/MemCqiServer.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/MemCqiServer.java	(revision 588)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/MemCqiServer.java	(revision 589)
@@ -38,8 +38,8 @@
 
 import org.apache.commons.lang.ArrayUtils;
 import org.apache.commons.lang.StringUtils;
-import org.txm.Toolbox;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
 import org.txm.searchengine.cqp.clientExceptions.UnexpectedAnswerException;
 import org.txm.searchengine.cqp.serverException.CqiCqpErrorNoSuchCorpus;
@@ -167,7 +167,7 @@
 
 			try {
 
-				String cqplibpath = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPPreferences.PREFERENCES_NODE);
+				String cqplibpath = TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPLibPreferences.PREFERENCES_NODE);
 				if (cqplibpath == null || cqplibpath.length() == 0) {
 					System.out.println("Error: cqp lib path is not set in preferences");
 					return false;
@@ -455,7 +455,7 @@
 		String[] strings = {"je", "jamais"};
 		int[] strucpos = {0, 1, 2, 3 , 4};
 
-		TXMPreferences.put(CQPPreferences.PREFERENCES_NODE, CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, pathToCQPLibDirectory);
+		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, pathToCQPLibDirectory);
 
 		MemCqiServer server = new MemCqiServer(pathToRegistry, pathToInitFile, " -b 10000000 -d OFF", false);
 		if (server.start()) System.out.println("Mem Server ok");
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPPreferences.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPPreferences.java	(revision 588)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPPreferences.java	(revision 589)
@@ -1,5 +1,7 @@
 package org.txm.searchengine.cqp;
 
+import java.io.File;
+
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.service.prefs.Preferences;
@@ -12,44 +14,10 @@
 	
 	public static String PREFERENCES_NODE = FrameworkUtil.getBundle(CQPPreferences.class).getSymbolicName();
 	
-	/** The Constant CQI_SERVER_HOST. */
-	public static final String CQI_SERVER_HOST = "cqi_server_host"; //$NON-NLS-1$
 
-	/** The Constant CQI_SERVER_PORT. */
-	public static final String CQI_SERVER_PORT = "cqi_server_port"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_LOGIN. */
-	public static final String CQI_SERVER_LOGIN = "cqi_server_login"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_PASSWORD. */
-	public static final String CQI_SERVER_PASSWORD = "cqi_server_password"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_PATH_TO_EXECUTABLE. */
-	public static final String CQI_SERVER_PATH_TO_EXECUTABLE = "cqi_server_path_to_executable"; //$NON-NLS-1$
-
-	public static final String CQI_SERVER_PATH_TO_CQPLIB = "cqi_server_path_to_cqplib"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_PATH_TO_INIT_FILE. */
-	public static final String CQI_SERVER_PATH_TO_INIT_FILE = "cqi_server_path_to_init_file"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_ADDITIONAL_OPTIONS. */
-	public static final String CQI_SERVER_ADDITIONAL_OPTIONS = "cqi_server_additional_options"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_MONITOR_OUTPUT. */
-	public static final String CQI_SERVER_MONITOR_OUTPUT = "cqi_server_monitor_output"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_IS_REMOTE. */
-	public static final String CQI_SERVER_IS_REMOTE = "cqi_server_is_remote"; //$NON-NLS-1$
-
-	/** The Constant CQI_SERVER_MODE. */
-	public static final String CQI_NETWORK_MODE = "cqi_server_mode"; //$NON-NLS-1$
-
-	public static final String CQP_EMPTY_VALUE_CODE = "cqp_empty_value_code";
-
 	/** The Constant MAXVALUE. */
 	public static final String MAXVALUE = "diag_max_value"; //$NON-NLS-1$
 
-	
 	@Override
 	public void initializeDefaultPreferences() {
 		Log.info(TXMCoreMessages.Toolbox_4 + TBXPreferences.getID()); 
@@ -57,14 +25,5 @@
 		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
 		
 		preferences.putInt(MAXVALUE, 10);
-		
-		preferences.put(CQI_SERVER_ADDITIONAL_OPTIONS, "-b 1000000 -d OFF"); //$NON-NLS-1$
-		preferences.put(CQI_SERVER_PORT, "4877"); //$NON-NLS-1$
-		preferences.put(CQI_SERVER_HOST, "localhost"); //$NON-NLS-1$
-		preferences.put(CQI_SERVER_LOGIN, "anonymous"); //$NON-NLS-1$
-		preferences.put(CQI_SERVER_PASSWORD, ""); //$NON-NLS-1$
-		preferences.put(CQI_SERVER_IS_REMOTE, "" + false); //$NON-NLS-1$
-		preferences.putBoolean(CQI_NETWORK_MODE, false); //$NON-NLS-1$
-		preferences.put(CQP_EMPTY_VALUE_CODE, ""); //$NON-NLS-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 588)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPEngine.java	(revision 589)
@@ -10,6 +10,7 @@
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
 import org.txm.importer.cwb.PatchCwbRegistry;
+import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.objects.Base;
 import org.txm.searchengine.core.SearchEngine;
 import org.txm.searchengine.core.SearchEngines;
@@ -45,13 +46,13 @@
 
 		boolean cqiserverok = false;
 
-		useNetCQi = Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_NETWORK_MODE, CQPPreferences.PREFERENCES_NODE));
+		useNetCQi = Boolean.parseBoolean(TXMPreferences.getString(CQPLibPreferences.CQI_NETWORK_MODE, CQPLibPreferences.PREFERENCES_NODE));
 
 		Log.warning("Killing CQP and RServe process if any");
 		killSearchEngine();
 
 
-		boolean remote = Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_SERVER_IS_REMOTE, CQPPreferences.PREFERENCES_NODE));
+		boolean remote = Boolean.parseBoolean(TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_IS_REMOTE, CQPLibPreferences.PREFERENCES_NODE));
 		state = false;
 		// test if must-have properties for CWB are set
 
@@ -82,7 +83,7 @@
 		if (reg_path.length() > 0) reg_path = reg_path.substring(path_separator.length()); // remove first path_separator
 		reg_path = reg_path.replace("\\\\", "//"); // fix the UNC paths for mingw
 
-		String init_path = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_INIT_FILE, CQPPreferences.PREFERENCES_NODE);
+		String init_path = TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE, CQPLibPreferences.PREFERENCES_NODE);
 
 
 		if (!remote) {
@@ -91,30 +92,30 @@
 				try {
 					cqiServer = new MemCqiServer(reg_path, 
 							init_path, 
-							TXMPreferences.getString(CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, CQPPreferences.PREFERENCES_NODE)
-							+ " -P " + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE), //$NON-NLS-1$
-							Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_SERVER_MONITOR_OUTPUT, CQPPreferences.PREFERENCES_NODE)));
+							TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, CQPLibPreferences.PREFERENCES_NODE)
+							+ " -P " + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PORT, CQPLibPreferences.PREFERENCES_NODE), //$NON-NLS-1$
+							Boolean.parseBoolean(TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_MONITOR_OUTPUT, CQPLibPreferences.PREFERENCES_NODE)));
 				} catch (Exception e) {
 					// TODO Auto-generated catch block
 					org.txm.utils.logger.Log.printStackTrace(e);
 				}
 			} else {
 
-				String exec_path = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, CQPPreferences.PREFERENCES_NODE);
+				String exec_path = TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, CQPLibPreferences.PREFERENCES_NODE);
 
 				if (exec_path == null || exec_path.length() == 0) {
-					System.out.println("Error: the '"+CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
+					System.out.println("Error: the '"+CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
 				}
 				if (new File(exec_path).exists()) {
-					System.out.println("Error: the '"+CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
+					System.out.println("Error: the '"+CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
 				}
 
 				cqiServer = new NetCqiServer(exec_path,
 						reg_path, 
 						init_path, 
-						TXMPreferences.getString(CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, CQPPreferences.PREFERENCES_NODE)
-						+ " -P " + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE), //$NON-NLS-1$
-						Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_SERVER_MONITOR_OUTPUT, CQPPreferences.PREFERENCES_NODE)));
+						TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, CQPLibPreferences.PREFERENCES_NODE)
+						+ " -P " + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PORT, CQPLibPreferences.PREFERENCES_NODE), //$NON-NLS-1$
+						Boolean.parseBoolean(TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_MONITOR_OUTPUT, CQPLibPreferences.PREFERENCES_NODE)));
 			}
 
 			if (cqiServer != null)
@@ -133,23 +134,23 @@
 						cqiserverok = false;
 					}
 				} else {
-					int port = Integer.parseInt(TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE));
-					String host = TXMPreferences.getString(CQPPreferences.CQI_SERVER_HOST, CQPPreferences.PREFERENCES_NODE);
+					int port = Integer.parseInt(TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PORT, CQPLibPreferences.PREFERENCES_NODE));
+					String host = TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_HOST, CQPLibPreferences.PREFERENCES_NODE);
 					cqiClient = new NetCqiClient(host, port);
 				}
 			}
 		} catch (NumberFormatException e1) {
-			Log.severe(TXMCoreMessages.Toolbox_wrong_port + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE)); 
+			Log.severe(TXMCoreMessages.Toolbox_wrong_port + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PORT, CQPLibPreferences.PREFERENCES_NODE)); 
 		} catch (ServerNotFoundException e1) {
-			Log.severe(TXMCoreMessages.Error_CONNECTION_FAILED + TXMPreferences.getString(CQPPreferences.CQI_SERVER_HOST, CQPPreferences.PREFERENCES_NODE)
-					+ TXMCoreMessages.Toolbox_27 + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE)); 
+			Log.severe(TXMCoreMessages.Error_CONNECTION_FAILED + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_HOST, CQPLibPreferences.PREFERENCES_NODE)
+					+ TXMCoreMessages.Toolbox_27 + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PORT, CQPLibPreferences.PREFERENCES_NODE)); 
 		}
 
 		// try connecting to the CWB server
 		try {
 			if (cqiserverok) {
-				String login = TXMPreferences.getString(CQPPreferences.CQI_SERVER_LOGIN, CQPPreferences.PREFERENCES_NODE);
-				String password = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PASSWORD, CQPPreferences.PREFERENCES_NODE);
+				String login = TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_LOGIN, CQPLibPreferences.PREFERENCES_NODE);
+				String password = TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PASSWORD, CQPLibPreferences.PREFERENCES_NODE);
 				state = cqiClient.connect(login, password);
 			}
 		} catch (Exception e1) {
@@ -158,7 +159,7 @@
 
 		if (state == false) {
 			System.out.println(TXMCoreMessages.Toolbox_29); 
-			if (cqiClient instanceof NetCqiClient) System.out.println(TXMCoreMessages.Toolbox_30 + TXMPreferences.getString(CQPPreferences.CQI_SERVER_LOGIN, CQPPreferences.PREFERENCES_NODE) + " " + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PASSWORD, CQPPreferences.PREFERENCES_NODE) + TXMPreferences.getString(CQPPreferences.CQI_SERVER_HOST, CQPPreferences.PREFERENCES_NODE) + " " + Integer.parseInt(TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE))); //$NON-NLS-1$ //$NON-NLS-2$
+			if (cqiClient instanceof NetCqiClient) System.out.println(TXMCoreMessages.Toolbox_30 + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_LOGIN, CQPLibPreferences.PREFERENCES_NODE) + " " + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PASSWORD, CQPLibPreferences.PREFERENCES_NODE) + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_HOST, CQPLibPreferences.PREFERENCES_NODE) + " " + Integer.parseInt(TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PORT, CQPLibPreferences.PREFERENCES_NODE))); //$NON-NLS-1$ //$NON-NLS-2$
 			if (cqiServer != null && cqiServer instanceof NetCqiServer)
 				System.out.println(TXMCoreMessages.Toolbox_33 + cqiServer.getLastCmdLine());
 		} else {
@@ -306,7 +307,7 @@
 	 * kill cqpserver process.
 	 */
 	private static void killSearchEngine() {
-		if (!TXMPreferences.getBoolean(CQPPreferences.CQI_SERVER_IS_REMOTE, CQPPreferences.PREFERENCES_NODE))
+		if (!TXMPreferences.getBoolean(CQPLibPreferences.CQI_SERVER_IS_REMOTE, CQPLibPreferences.PREFERENCES_NODE))
 			// Windows OS
 			if (OSDetector.isFamilyWindows()) {
 				try {
@@ -339,7 +340,7 @@
 			}
 		// Mac, Linux
 			else {
-				String cmd = TXMCoreMessages.Toolbox_37 + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE) + TXMCoreMessages.Toolbox_38;
+				String cmd = TXMCoreMessages.Toolbox_37 + TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PORT, CQPLibPreferences.PREFERENCES_NODE) + TXMCoreMessages.Toolbox_38;
 				try {
 					//Process p = Runtime.getRuntime().exec("killall -9 cqpserver"); //$NON-NLS-1$
 					// System.out.println("kill `ps aux | grep cqpserver | awk '/-P "
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbEncode.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbEncode.java	(revision 588)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbEncode.java	(revision 589)
@@ -39,6 +39,7 @@
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.searchengine.cqp.CQPPreferences;
 import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
 import org.txm.stat.utils.ConsoleProgressBar;
@@ -182,7 +183,7 @@
 		 */
 
 		// Warning !! for WINDOWS ONLY the "" value does not work with the ProcessBuilder we must set the value to "\"\""
-		String empty_value_code = TXMPreferences.getString(CQPPreferences.CQP_EMPTY_VALUE_CODE, CQPPreferences.PREFERENCES_NODE);
+		String empty_value_code = TXMPreferences.getString(CQPLibPreferences.CQP_EMPTY_VALUE_CODE, CQPLibPreferences.PREFERENCES_NODE);
 		if (OSDetector.isFamilyWindows()) {
 			if (empty_value_code == null) empty_value_code = "\"\"";
 			empty_value_code = empty_value_code.trim();
Index: tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbProcess.java
===================================================================
--- tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbProcess.java	(revision 588)
+++ tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbProcess.java	(revision 589)
@@ -37,8 +37,8 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.txm.core.messages.TXMCoreMessages;
-import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.searchengine.cqp.CQPPreferences;
 import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
 import org.txm.utils.logger.Log;
@@ -244,7 +244,7 @@
 	 */
 	public static String getCWBLocation()
 	{
-		String cwbLoc = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPPreferences.PREFERENCES_NODE)+File.separator;
+		String cwbLoc = TXMPreferences.getString(CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPLibPreferences.PREFERENCES_NODE)+File.separator;
 
 		if (!new File(cwbLoc).exists()) {
 			System.out.println(TXMCoreMessages.CwbProcess_5+cwbLoc);
Index: tmp/org.txm.libs.cqp.linux/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.libs.cqp.linux/META-INF/MANIFEST.MF	(revision 588)
+++ tmp/org.txm.libs.cqp.linux/META-INF/MANIFEST.MF	(revision 589)
@@ -3,7 +3,7 @@
 Bundle-Name: CQP.linux
 Bundle-SymbolicName: org.txm.libs.cqp.linux
 Bundle-Version: 1.1.0.qualifier
-Fragment-Host: org.txm.libs.cqp;bundle-version="1.0.0.qualifier"
+Fragment-Host: org.txm.libs.cqp
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-Vendor: Textometrie.org
 Eclipse-PlatformFilter: (osgi.os=linux)
Index: tmp/org.txm.rcp.feature/feature.xml
===================================================================
--- tmp/org.txm.rcp.feature/feature.xml	(revision 588)
+++ tmp/org.txm.rcp.feature/feature.xml	(revision 589)
@@ -83,13 +83,23 @@
          id="org.eclipse.babel.nls_eclipse_ru"
          version="0.0.0"/>
 
+   <includes
+         id="org.txm.statsengine.r.feature"
+         version="0.0.0"/>
+
+   <includes
+         id="org.txm.searchengine.cqp.feature"
+         version="0.0.0"/>
+
    <requires>
+      <import plugin="org.txm.statsengine.r.core" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.runtime" version="3.10.0" match="greaterOrEqual"/>
       <import plugin="org.txm.lexicaltable.core"/>
       <import plugin="org.eclipse.osgi" version="3.10.2" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui" version="3.106.1" match="greaterOrEqual"/>
       <import plugin="org.txm.chartsengine.rcp"/>
       <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
+      <import plugin="org.txm.statsengine.r.rcp" version="1.0.0" match="greaterOrEqual"/>
       <import plugin="org.txm.ca.core"/>
       <import plugin="org.eclipse.core.commands" version="3.6.100" match="greaterOrEqual"/>
       <import plugin="org.txm.utils"/>
@@ -105,10 +115,7 @@
       <import plugin="org.eclipse.osgi.util" version="3.2.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.net"/>
       <import plugin="org.txm.libs.rserve"/>
-      <import plugin="org.txm.statsengine.r.rcp"/>
-      <import plugin="org.txm.searchengine.cqp.core"/>
       <import plugin="org.apache.xerces" version="2.9.0" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.jface"/>
       <import plugin="org.txm.partition.core"/>
       <import plugin="org.txm.concordance.rcp"/>
       <import plugin="org.txm.synopticeditor.rcp"/>
@@ -158,13 +165,9 @@
       <import plugin="org.eclipse.equinox.p2.reconciler.dropins" version="1.1.200" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui.views.log" version="1.0.500" match="greaterOrEqual"/>
       <import plugin="org.txm.groovy.core"/>
-      <import plugin="org.eclipse.ui.workbench" version="3.106.2" match="greaterOrEqual"/>
-      <import plugin="org.txm.statsengine.r.core"/>
-      <import plugin="org.eclipse.jface.text" version="3.9.2" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.console" version="3.5.300" match="greaterOrEqual"/>
-      <import plugin="org.eclipse.ui.ide" version="3.10.2" match="greaterOrEqual"/>
       <import plugin="org.eclipse.ui.browser" version="3.4.100" match="greaterOrEqual"/>
       <import plugin="org.eclipse.jface.databinding" version="1.6.200" match="greaterOrEqual"/>
+      <import plugin="org.eclipse.jface.text" version="3.9.2" match="greaterOrEqual"/>
       <import plugin="org.eclipse.core.net" version="1.2.200" match="greaterOrEqual"/>
       <import plugin="org.txm.specificities.core"/>
       <import plugin="org.txm.lexicaltable.rcp"/>
@@ -189,13 +192,8 @@
       <import plugin="org.eclipse.e4.ui.workbench3" version="0.12.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.e4.ui.workbench.addons.swt" version="0.10.0" match="greaterOrEqual"/>
       <import plugin="org.eclipse.emf.ecore" version="2.7.0" match="greaterOrEqual"/>
-      <import plugin="com.ibm.icu"/>
-      <import plugin="javax.annotation"/>
-      <import plugin="javax.inject"/>
-      <import plugin="org.eclipse.e4.core.commands"/>
-      <import plugin="org.eclipse.e4.ui.services"/>
-      <import plugin="org.eclipse.emf.common"/>
-      <import plugin="javax.xml"/>
+      <import plugin="org.txm.searchengine.cqp.core" version="1.1.0" match="greaterOrEqual"/>
+      <import plugin="org.txm.libs.cqp" version="1.0.0" match="greaterOrEqual"/>
    </requires>
 
    <plugin
@@ -386,13 +384,6 @@
          unpack="false"/>
 
    <plugin
-         id="org.txm.libs.cqp"
-         download-size="0"
-         install-size="0"
-         version="1.0.0.qualifier"
-         unpack="false"/>
-
-   <plugin
          id="org.txm.libs.groovy-all"
          download-size="0"
          install-size="0"
@@ -434,13 +425,6 @@
          unpack="false"/>
 
    <plugin
-         id="org.txm.links.rcp"
-         download-size="0"
-         install-size="0"
-         version="1.0.0.qualifier"
-         unpack="false"/>
-
-   <plugin
          id="org.txm.partition.core"
          download-size="0"
          install-size="0"
@@ -497,20 +481,6 @@
          unpack="false"/>
 
    <plugin
-         id="org.txm.searchengine.cqp.core"
-         download-size="0"
-         install-size="0"
-         version="1.1.0.qualifier"
-         unpack="false"/>
-
-   <plugin
-         id="org.txm.searchengine.cqp.rcp"
-         download-size="0"
-         install-size="0"
-         version="1.0.0.qualifier"
-         unpack="false"/>
-
-   <plugin
          id="org.txm.specificities.core"
          download-size="0"
          install-size="0"
@@ -525,20 +495,6 @@
          unpack="false"/>
 
    <plugin
-         id="org.txm.statsengine.r.core"
-         download-size="0"
-         install-size="0"
-         version="1.0.0.qualifier"
-         unpack="false"/>
-
-   <plugin
-         id="org.txm.statsengine.r.rcp"
-         download-size="0"
-         install-size="0"
-         version="1.0.0.qualifier"
-         unpack="false"/>
-
-   <plugin
          id="org.txm.synopticeditor.rcp"
          download-size="0"
          install-size="0"
@@ -567,20 +523,6 @@
          unpack="false"/>
 
    <plugin
-         id="org.txm.textsbalance.core"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
-         id="org.txm.textsbalance.rcp"
-         download-size="0"
-         install-size="0"
-         version="0.0.0"
-         unpack="false"/>
-
-   <plugin
          id="org.txm.wordcloud.core"
          download-size="0"
          install-size="0"
Index: tmp/org.txm.rcp/build.properties
===================================================================
--- tmp/org.txm.rcp/build.properties	(revision 588)
+++ tmp/org.txm.rcp/build.properties	(revision 589)
@@ -17,5 +17,6 @@
                css/,\
                p2.inf,\
                bin/,\
-               OSGI-INF/
+               OSGI-INF/,\
+               TXM.sh
 bin.excludes = lib/batik/
Index: tmp/org.txm.rcp/TXM.sh
===================================================================
--- tmp/org.txm.rcp/TXM.sh	(revision 0)
+++ tmp/org.txm.rcp/TXM.sh	(revision 589)
@@ -0,0 +1,2 @@
+#!/bin/bash
+./TXM -standalone
Index: tmp/org.txm.rcp/rcpapplication.product
===================================================================
--- tmp/org.txm.rcp/rcpapplication.product	(revision 588)
+++ tmp/org.txm.rcp/rcpapplication.product	(revision 589)
@@ -79,7 +79,6 @@
       </win>
    </launcher>
 
-
    <vm>
       <linux include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</linux>
       <macos include="false">org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7</macos>
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java	(revision 588)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/ImportPreferencePage.java	(revision 589)
@@ -45,6 +45,7 @@
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.rcp.Application;
 import org.txm.rcp.RCPMessages;
 import org.txm.rcp.TxmPreferences;
@@ -147,7 +148,7 @@
 		l.setLayoutData(ldata);
 		addField(defaultlang);
 		
-		empty_code = new StringFieldEditor(CQPPreferences.CQP_EMPTY_VALUE_CODE, "Empty property value code", getFieldEditorParent());
+		empty_code = new StringFieldEditor(CQPLibPreferences.CQP_EMPTY_VALUE_CODE, "Empty property value code", getFieldEditorParent());
 		addField(empty_code);
 		
 	}
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 588)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java	(revision 589)
@@ -543,22 +543,23 @@
 
 				// set the install directory preference
 				String installpath = Platform.getInstallLocation().getURL().getFile(); // the TXM.exe file path
-				File installDirectory = new File(installpath, "..");  //$NON-NLS-1$
+				File installDirectory = new File(installpath);
 				//installDirectory = installDirectory.getCanonicalFile();
 				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR, installDirectory.getAbsolutePath());
 
-				File preferenceFile = new File(installDirectory, "install.prefs"); //$NON-NLS-1$
-				if (preferenceFile.exists()) {
-					System.out.println(NLS.bind(RCPMessages.ApplicationWorkbenchAdvisor_25, preferenceFile));
-					if (Util.isWindows()) //NSIS has generated ISO-8859-1 preference file
-						TxmPreferences.importFromFile(preferenceFile, "ISO-8859-1", false); //$NON-NLS-1$
-					else
-						TxmPreferences.importFromFile(preferenceFile);
-				} else {
-					System.out.println("No installation preference file found in the installation directory: "+preferenceFile);
-					installPreferenceRestored = false;
-					return true;
-				}
+				//TODO: ensure all preferences of install.prefs file are now stored in the default preferences
+//				File preferenceFile = new File(installDirectory, "install.prefs"); //$NON-NLS-1$
+//				if (preferenceFile.exists()) {
+//					System.out.println(NLS.bind(RCPMessages.ApplicationWorkbenchAdvisor_25, preferenceFile));
+//					if (Util.isWindows()) //NSIS has generated ISO-8859-1 preference file
+//						TxmPreferences.importFromFile(preferenceFile, "ISO-8859-1", false); //$NON-NLS-1$
+//					else
+//						TxmPreferences.importFromFile(preferenceFile);
+//				} else {
+//					System.out.println("No installation preference file found in the installation directory: "+preferenceFile);
+//					installPreferenceRestored = false;
+//					return true;
+//				}
 				// restore previous TreeTagger preferences
 				File previousPreferenceFile = new File(System.getProperty("java.io.tmpdir"),  //$NON-NLS-1$
 						"org.txm.rcp.prefs"); //$NON-NLS-1$
Index: tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java
===================================================================
--- tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java	(revision 588)
+++ tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java	(revision 589)
@@ -27,6 +27,7 @@
 //
 package org.txm.rcp;
 
+import java.io.File;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
@@ -51,10 +52,15 @@
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.ServiceReference;
+import org.txm.Toolbox;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.libs.cqp.CQPLibPreferences;
+import org.txm.objects.Workspace;
 import org.txm.searchengine.cqp.CQPPreferences;
 import org.txm.statsengine.r.core.preferences.RPreferences;
+import org.txm.utils.BundleUtils;
+import org.txm.utils.DeleteDir;
 import org.txm.utils.logger.Log;
 
 // TODO: Auto-generated Javadoc
@@ -70,7 +76,7 @@
 	public static final String FIRST_LAUNCH = "first_launch"; //$NON-NLS-1$
 
 	private static ApplicationWorkbenchAdvisor awa;
-	
+
 	//public static OpenDocumentEventProcessor openDocProcessor = new OpenDocumentEventProcessor();	
 	/*
 	 * (non-Javadoc)
@@ -80,7 +86,7 @@
 	@Override
 	public Object start(IApplicationContext context) throws Exception {
 		Map args = context.getArguments();
-		
+
 		List<String> argsList = Arrays.asList((String[])(args.get("application.args")));
 		System.out.println(RCPMessages.Application_0+argsList);
 		if (argsList.contains("-log")) { //$NON-NLS-1$
@@ -94,6 +100,39 @@
 		}
 		if (argsList.contains("-run")) { //$NON-NLS-1$
 			//System.out.println("Running TXM");
+		} else if (argsList.contains("-standalone")) { //$NON-NLS-1$
+			File userhomeDirectory = new File("workspace").getAbsoluteFile(); // eclipse default workspace directory
+			File defaultWorkspaceFile = new File("workspace/workspaces/default.xml");
+			if (!defaultWorkspaceFile.exists()) {
+				System.out.println("Stand alone launch, creating minimal TXM user home directory in "+userhomeDirectory.getAbsolutePath());
+				System.out.println("Sample corpora, scripts, import scripts and macros files are not yet installed.");
+				
+				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.USER_TXM_HOME, userhomeDirectory.getAbsolutePath());
+				TXMPreferences.put(TBXPreferences.PREFERENCES_NODE, TBXPreferences.INSTALL_DIR, userhomeDirectory.getParentFile().getAbsolutePath());
+				
+				File corpusworkspaceDirectory = new File(userhomeDirectory, "workspaces");
+				corpusworkspaceDirectory.mkdirs();
+
+				String createfolders[] = {
+						"corpora", "clipboard", //$NON-NLS-1$ //$NON-NLS-2$
+						"workspaces", "css", "scripts", "scripts/lib", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+						"scripts/macro", "scripts/user", "xsl", "samples", "schema", "R"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+				for (String folder : createfolders) {
+					new File(userhomeDirectory, folder).mkdir();
+				}
+
+				Workspace.createEmptyWorkspace(new File(corpusworkspaceDirectory, "default.xml")); //$NON-NLS-1$
+				BundleUtils.copyFiles("org.txm.core",  "res", "org/txm", "css", new File(userhomeDirectory, "css"));
+				BundleUtils.copyFiles("org.txm.core",  "res", "org/txm/xml", "xsl", new File(userhomeDirectory, "xsl"));
+				BundleUtils.copyFiles("org.txm.core",  "res", "org/txm/xml", "schema", new File(userhomeDirectory, "schema"));
+				File scriptsDirectory = new File(userhomeDirectory, "scripts");
+				new File(scriptsDirectory, "user").mkdir();
+				new File(scriptsDirectory, "import").mkdir();
+				new File(scriptsDirectory, "lib").mkdir();
+				new File(scriptsDirectory, "macro").mkdir();
+				new File(scriptsDirectory, "samples").mkdir();
+			}
 		} else {
 			System.out.println("TXM must be launch with the argument '-run' to start."); //$NON-NLS-1$
 			System.out.println(RCPMessages.Application_4);
@@ -112,7 +151,7 @@
 
 		Display display = PlatformUI.createDisplay();
 		//display.addListener(SWT.OpenDocument, openDocProcessor);
-		
+
 		//Lock the RCP workspace, thus there is only one TXM instance running
 		Log.warning(RCPMessages.Application_8);
 		if (!Platform.getInstanceLocation().lock()){
@@ -154,7 +193,7 @@
 	@Override
 	public void stop() {
 		// TODO Auto-generated method stub
-		
+
 	}
 
 	/**
@@ -162,7 +201,7 @@
 	 */
 	private void  activateProxyService() {
 		String sys_proxy_host = System.getProperty("http.proxyHost"); // must be called before IProxyService is used
-		
+
 		Bundle bundle = Platform.getBundle("org.eclipse.ui.ide"); //$NON-NLS-1$
 		IProxyService  proxyService = null;
 		if (bundle != null) {
@@ -175,34 +214,34 @@
 		} else {
 			//System.out.println("FIRST RUN TEST RESULT: "+ApplicationWorkbenchAdvisor.firstLaunchAfterInstallation());
 			// force active provider as "Manual" on Mac OS X
-            if (Util.isMac() && sys_proxy_host != null && ApplicationWorkbenchAdvisor.testTXMHOMEPreferenceAndDirectory()) {  
-                System.out.println("System proxy detected. Force network provider to manual with proxy_host="+sys_proxy_host);
-                proxyService.setProxiesEnabled(true); 
-            }
-			
+			if (Util.isMac() && sys_proxy_host != null && ApplicationWorkbenchAdvisor.testTXMHOMEPreferenceAndDirectory()) {  
+				System.out.println("System proxy detected. Force network provider to manual with proxy_host="+sys_proxy_host);
+				proxyService.setProxiesEnabled(true); 
+			}
+
 			if (Util.isMac()) { // configure only for Mac OS X
-//				String proxy_conf = "";
-//				ProxyConf conf = new ProxyConf(this);
-//				if (conf.mustSetProxyConfiguration()) { // there is a system proxy configured
-//					System.out.println(Messages.bind(Messages.Application_11, proxy_conf));
-//					proxyService.setProxiesEnabled(true);
-//					//proxyService.setSystemProxiesEnabled(false);
-//					
-//					// prepare a new proxy configuration
-//					boolean requiresAuthentication = conf.proxy_user != null && conf.proxy_user.length() > 0;
-//					IProxyData[] proxies = new IProxyData[1];
-//					proxies[0] = new ProxyData(IProxyData.HTTP_PROXY_TYPE, conf.proxy_host, conf.proxy_port, requiresAuthentication, "");
-//					proxies[0].setPassword(conf.proxy_password);
-//					proxies[0].setUserid(conf.proxy_user);
-//					
-//					try {
-//						proxyService.setProxyData(proxies); // apply the new proxy configuration
-//						System.out.println("TXM proxy configuration set: "+Arrays.toString(proxies));
-//					} catch (Exception e) {
-//						System.out.println("Failed to set TXM proxy configuration: "+Arrays.toString(proxies));
-//						Log.printStackTrace(e);
-//					}
-//				}
+				//				String proxy_conf = "";
+				//				ProxyConf conf = new ProxyConf(this);
+				//				if (conf.mustSetProxyConfiguration()) { // there is a system proxy configured
+				//					System.out.println(Messages.bind(Messages.Application_11, proxy_conf));
+				//					proxyService.setProxiesEnabled(true);
+				//					//proxyService.setSystemProxiesEnabled(false);
+				//					
+				//					// prepare a new proxy configuration
+				//					boolean requiresAuthentication = conf.proxy_user != null && conf.proxy_user.length() > 0;
+				//					IProxyData[] proxies = new IProxyData[1];
+				//					proxies[0] = new ProxyData(IProxyData.HTTP_PROXY_TYPE, conf.proxy_host, conf.proxy_port, requiresAuthentication, "");
+				//					proxies[0].setPassword(conf.proxy_password);
+				//					proxies[0].setUserid(conf.proxy_user);
+				//					
+				//					try {
+				//						proxyService.setProxyData(proxies); // apply the new proxy configuration
+				//						System.out.println("TXM proxy configuration set: "+Arrays.toString(proxies));
+				//					} catch (Exception e) {
+				//						System.out.println("Failed to set TXM proxy configuration: "+Arrays.toString(proxies));
+				//						Log.printStackTrace(e);
+				//					}
+				//				}
 			}
 		}	
 	}
@@ -217,9 +256,9 @@
 	private boolean parseCommandLine() {
 		boolean exit = false;
 		String[] optionsForPreferences = {
-				CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE,
-				CQPPreferences.CQI_SERVER_PATH_TO_INIT_FILE,
-//				TBXPreferences.CQI_SERVER_PATH_TO_REGISTRY,
+				CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE,
+				CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE,
+				//				TBXPreferences.CQI_SERVER_PATH_TO_REGISTRY,
 				RPreferences.PATH_TO_EXECUTABLE,
 				TBXPreferences.INSTALL_DIR };
 		String setPrefAndExit = "setPrefAndExit"; //$NON-NLS-1$
Index: tmp/org.txm.backtomedia.rcp/plugin.xml
===================================================================
--- tmp/org.txm.backtomedia.rcp/plugin.xml	(revision 588)
+++ tmp/org.txm.backtomedia.rcp/plugin.xml	(revision 589)
@@ -75,7 +75,7 @@
    <extension
          point="org.eclipse.ui.preferencePages">
       <page
-            category="org.txm.rcpapplication.preferences.UserPreferencePage"
+            category="org.txm.rcp.preferences.UserPreferencePage"
             class="org.txm.backtomedia.preferences.BackToMediaPreferencePage"
             id="org.txm.backtomedia.preferences.BackToMediaPreferencePage"
             name="%page.name">
Index: tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/CQPPreferencePage.java
===================================================================
--- tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/CQPPreferencePage.java	(revision 588)
+++ tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/CQPPreferencePage.java	(revision 589)
@@ -37,6 +37,7 @@
 import org.eclipse.jface.util.PropertyChangeEvent;
 import org.eclipse.ui.IWorkbench;
 import org.osgi.service.prefs.Preferences;
+import org.txm.libs.cqp.CQPLibPreferences;
 import org.txm.rcp.Application;
 import org.txm.rcp.preferences.TXMPreferencePage;
 import org.txm.rcp.preferences.TXMPreferenceStore;
@@ -103,39 +104,39 @@
 	@Override
 	public void createFieldEditors() {
 
-		cqi_use_network = new BooleanFieldEditor(CQPPreferences.CQI_NETWORK_MODE,
+		cqi_use_network = new BooleanFieldEditor(CQPLibPreferences.CQI_NETWORK_MODE,
 				Messages.CQPPreferencePage_1,
 				BooleanFieldEditor.DEFAULT, getFieldEditorParent());
 		cqi_server_path_to_cqplib = new DirectoryFieldEditor(
-				CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, Messages.CQPPreferencePage_0,
+				CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, Messages.CQPPreferencePage_0,
 				getFieldEditorParent());
-		cqi_server_is_remote = new BooleanFieldEditor(CQPPreferences.CQI_SERVER_IS_REMOTE,
+		cqi_server_is_remote = new BooleanFieldEditor(CQPLibPreferences.CQI_SERVER_IS_REMOTE,
 				Messages.CQPPreferencePage_10,
 				BooleanFieldEditor.DEFAULT, getFieldEditorParent());
-		cqi_server_host = new StringFieldEditor(CQPPreferences.CQI_SERVER_HOST,
+		cqi_server_host = new StringFieldEditor(CQPLibPreferences.CQI_SERVER_HOST,
 				Messages.CQPPreferencePage_11, getFieldEditorParent());
 
-		cqi_server_port = new IntegerFieldEditor(CQPPreferences.CQI_SERVER_PORT,
+		cqi_server_port = new IntegerFieldEditor(CQPLibPreferences.CQI_SERVER_PORT,
 				Messages.CQPPreferencePage_12, getFieldEditorParent());
 
-		cqi_server_user = new StringFieldEditor(CQPPreferences.CQI_SERVER_LOGIN,
+		cqi_server_user = new StringFieldEditor(CQPLibPreferences.CQI_SERVER_LOGIN,
 				Messages.CQPPreferencePage_13, getFieldEditorParent());
 
-		cqi_server_password = new StringFieldEditor(CQPPreferences.CQI_SERVER_PASSWORD,
+		cqi_server_password = new StringFieldEditor(CQPLibPreferences.CQI_SERVER_PASSWORD,
 				Messages.CQPPreferencePage_14, getFieldEditorParent());
 
 		cqi_server_path_to_executable = new FileFieldEditor(
-				CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, Messages.CQPPreferencePage_15,
+				CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, Messages.CQPPreferencePage_15,
 				getFieldEditorParent());
 
 //		cqi_server_path_to_registry = new DirectoryFieldEditor(
 //				CQI_SERVER_PATH_TO_REGISTRY, Messages.CQPPreferencePage_16,
 //				getFieldEditorParent());
 		cqi_server_path_to_init_file = new FileFieldEditor(
-				CQPPreferences.CQI_SERVER_PATH_TO_INIT_FILE, Messages.CQPPreferencePage_17,
+				CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE, Messages.CQPPreferencePage_17,
 				getFieldEditorParent());
 		cqi_server_additional_options = new StringFieldEditor(
-				CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, Messages.CQPPreferencePage_18,
+				CQPLibPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, Messages.CQPPreferencePage_18,
 				getFieldEditorParent());
 
 		addField(cqi_use_network);
@@ -152,10 +153,10 @@
 
 		Preferences preferences = org.eclipse.core.runtime.preferences.InstanceScope.INSTANCE.getNode(Application.PLUGIN_ID);
 		boolean useNetwork = preferences.getBoolean(
-				CQPPreferences.CQI_NETWORK_MODE,
+				CQPLibPreferences.CQI_NETWORK_MODE,
 				false);
 		boolean serverIsRemote = preferences.getBoolean(
-				CQPPreferences.CQI_SERVER_IS_REMOTE,
+				CQPLibPreferences.CQI_SERVER_IS_REMOTE,
 				false);
 		updateFieldsState(useNetwork, serverIsRemote);
 	}
@@ -211,7 +212,7 @@
 	 */
 	@Override
 	public void init(IWorkbench workbench) {
-		this.setPreferenceStore(new TXMPreferenceStore(CQPPreferences.PREFERENCES_NODE));
+		this.setPreferenceStore(new TXMPreferenceStore(CQPLibPreferences.PREFERENCES_NODE));
 	}
 
 	/* (non-Javadoc)
@@ -223,12 +224,12 @@
 		boolean serverIsRemote = false;
 		boolean update = false;
 		if (((FieldEditor) event.getSource()).getPreferenceName().equals(
-				CQPPreferences.CQI_SERVER_IS_REMOTE)) {
+				CQPLibPreferences.CQI_SERVER_IS_REMOTE)) {
 			useNetwork = cqi_use_network.getBooleanValue();
 			serverIsRemote = (Boolean) event.getNewValue();
 			update = true;
 		} else if (((FieldEditor) event.getSource()).getPreferenceName().equals(
-				CQPPreferences.CQI_NETWORK_MODE)) {
+				CQPLibPreferences.CQI_NETWORK_MODE)) {
 			useNetwork = (Boolean) event.getNewValue();
 			serverIsRemote = cqi_server_is_remote.getBooleanValue();
 			update = true;
Index: tmp/org.txm.statsengine.core/.classpath
===================================================================
--- tmp/org.txm.statsengine.core/.classpath	(revision 588)
+++ tmp/org.txm.statsengine.core/.classpath	(revision 589)
@@ -3,5 +3,6 @@
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="res"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java
===================================================================
--- tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java	(revision 588)
+++ tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java	(revision 589)
@@ -1,10 +1,16 @@
 package org.txm.statsengine.r.core.preferences;
 
 
+import java.io.File;
+import java.io.IOException;
+
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.Version;
 import org.osgi.service.prefs.Preferences;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.utils.BundleUtils;
+import org.txm.utils.logger.Log;
 
 /**
  * Default preferences initializer.
@@ -56,6 +62,9 @@
 	public static final String FILE_TRANSFERT = PREFERENCES_PREFIX + "file_transfert"; //$NON-NLS-1$
 	public static final String SVG_DEVICE = PREFERENCES_PREFIX + "svg_device"; //$NON-NLS-1$
 
+	/** Last version since R Preferences have been set -> the setting is done only ONE time.*/
+	public static final String VERSION = "version";
+
 	/**
 	 * 
 	 */
@@ -67,14 +76,6 @@
 	public void initializeDefaultPreferences() {
 		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
 
-		//FIXME: need to define here the PATH_TO_EXECUTABLE preference according to current OS and the current TXM install directory
-		// If the paths are different according to the current OS, a good way could be to have the same projects as for CQP
-		// Project: org.txm.r
-		// Fragment: org.txm.r.win64
-		// Fragment: org.txm.r.linux
-		// and the fragment should initialize this preference
-		preferences.put(PATH_TO_EXECUTABLE, "undefined");
-		
 		preferences.putBoolean(IS_MANDATORY, false);
 		preferences.put(SERVER_ADDRESS, "127.0.0.1");
 		preferences.putBoolean(REMOTE, false);
@@ -88,6 +89,73 @@
 		preferences.putBoolean(FILE_TRANSFERT, false);
 		preferences.put(SVG_DEVICE, "svg");
 		
+		
+		String RFRAGMENT = "org.txm.statsengine.r.core."+System.getProperty("osgi.os");
+		Log.info("R.DoInstallStep.preInstall()");
+		String saved = TXMPreferences.getString(RPreferences.VERSION, RPreferences.PREFERENCES_NODE);
+		Version currentVersion = BundleUtils.getBundleVersion(RFRAGMENT); // the RFRAGMENT plugin contains the right version
+		
+		if (saved != null && saved.length() > 0) {
+			Version savedVersion = new Version(saved);
+			if (currentVersion.compareTo(savedVersion) <= 0) {
+				Log.info("No post-installation of R plugin to do");
+				return; // nothing to do
+			}
+		}
+		Log.info("Updating R preferences for R plugin version="+currentVersion);
+		
+		String os = "win";
+		String ext = "";
+		String osname = System.getProperty("os.name").toLowerCase();
+		if (osname.contains("windows")) { //$NON-NLS-1$
+			if (System.getProperty("os.arch").contains("64")) { os = "win64"; } 
+			else { os = "win32"; }
+			ext = ".exe";
+		} else if (osname.contains("mac")) { //$NON-NLS-1$
+			os = "macosx";
+		} else {
+			os = "linux32";
+			if (System.getProperty("os.arch").contains("64")) 
+				os = "linux64";
+		}
+
+		File bundleDir = BundleUtils.getBundleFile(RFRAGMENT);
+		if (bundleDir == null) {
+			System.out.println("Error while retrieving "+RFRAGMENT+" bundle directory.");
+			return;
+		}
+		File cwbDir = new File(bundleDir, "res");
+		File OSDir = new File(cwbDir, os);
+		File execFile = new File(OSDir, "bin/R"+ext);
+		execFile.setExecutable(true);
+		preferences.put(PATH_TO_EXECUTABLE, execFile.getAbsolutePath());
+				
+		
+		if (!osname.contains("windows")) { 
+			try {
+				Log.info("Setting execution file rights to: "+OSDir.getAbsolutePath());
+				Runtime.getRuntime().exec("chmod -R +x "+OSDir.getAbsolutePath()).waitFor();
+			} catch (Exception e) {
+				System.out.println("Error while setting execution file rights to: "+OSDir.getAbsolutePath());
+				e.printStackTrace();
+				return;
+			}
+		}
+	
+		if (!execFile.exists()) {
+			System.out.println("Cannot find CQP executable file: "+execFile);
+			return;
+		}
+		
+		if (!execFile.canExecute()) {
+			System.out.println("File right setting error, cannot execute: "+execFile);
+			return;
+		}
+		
+		Log.warning("SearchEngine preferences set with: "+OSDir.getAbsolutePath()+" and "+execFile.getAbsolutePath());
+		TXMPreferences.put(RPreferences.PREFERENCES_NODE, RPreferences.VERSION, currentVersion.toString());
+	
+		
 	}
 	
 }
Index: tmp/org.txm.libs.cqp.win32/res/win64/cqp.exe.gz
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/DoInstallStep.java
===================================================================
--- tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/DoInstallStep.java	(revision 588)
+++ tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/DoInstallStep.java	(revision 589)
@@ -1,15 +1,6 @@
 package org.txm.libs.cqp;
 
-import java.io.File;
-import java.io.IOException;
-
-import org.eclipse.jface.util.Util;
-import org.osgi.framework.Version;
 import org.txm.PostInstallationStep;
-import org.txm.core.preferences.TBXPreferences;
-import org.txm.core.preferences.TXMPreferences;
-import org.txm.utils.BundleUtils;
-import org.txm.utils.logger.Log;
 
 public class DoInstallStep extends PostInstallationStep {
 	
@@ -27,84 +18,84 @@
 	@Override
 	public void preInstall() {
 		
-		String CQPFRAGMENT = "org.txm.libs.cqp."+System.getProperty("osgi.os");
-		//TODO: fix preferneces logic between org.txm.cqp.lib et org.txm.searchengine.cqp
-		Log.info("CQP.DoInstallStep.preInstall()");
-		String saved = TXMPreferences.getString(CQPLibPreferences.VERSION, CQPLibPreferences.PREFERENCES_NODE);
-		Version currentVersion = BundleUtils.getBundleVersion(CQPFRAGMENT); // the CQPFRAGMENT plugin contains the right version
-		
-		if (saved != null && saved.length() > 0) {
-			Version savedVersion = new Version(saved);
-			if (currentVersion.compareTo(savedVersion) <= 0) {
-				Log.info("No post-installation of CQP to do");
-				return; // nothing to do
-			}
-		}
-		Log.info("Updating CWB preferences for CQP version="+currentVersion);
-		
-		String os = "win";
-		String ext = "";
-		if (Util.isWindows()) { //$NON-NLS-1$
-			if (System.getProperty("os.arch").contains("64")) { os = "win64"; } 
-			else { os = "win32"; }
-			ext = ".exe";
-		} else if (Util.isMac()) { //$NON-NLS-1$
-			os = "macosx";
-		} else {
-			os = "linux32";
-			if (System.getProperty("os.arch").contains("64")) 
-				os = "linux64";
-		}
-
-		File bundleDir = BundleUtils.getBundleFile(CQPFRAGMENT);
-		if (bundleDir == null) {
-			System.out.println("Error while retrieving TreeTaggerInstaller bundle directory.");
-			return;
-		}
-		File cwbDir = new File(bundleDir, "res");
-		File initFile = new File(cwbDir, "cqpserver.init");
-		File OSDir = new File(cwbDir, os);
-		
-		int n;
-		try { // extract all gz files
-			n = Utils.unGzipFilesInDirectory(OSDir);
-
-			if (n == 0) {
-				System.out.println("Error while extracting CQP files: no file extracted.");
-				return;
-			}
-		} catch (IOException e1) {
-			System.out.println("Error while extracting CQP files: "+e1);
-			return;
-		}
-		
-		File execFile = new File(OSDir, "cqpserver"+ext);
-
-		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, OSDir.getAbsolutePath());
-		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE, initFile.getAbsolutePath());
-		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, execFile.getAbsolutePath());
-		if (!Util.isWindows()) { 
-			try {
-				Log.info("Setting execution file rights to: "+OSDir.getAbsolutePath());
-				Runtime.getRuntime().exec("chmod -R +x "+OSDir.getAbsolutePath()).waitFor();
-			} catch (Exception e) {
-				System.out.println("Error while setting execution file rights to: "+OSDir.getAbsolutePath());
-				e.printStackTrace();
-				return;
-			}
-		}
-	
-		if (!execFile.exists()) {
-			System.out.println("Cannot find CQP executable file: "+execFile);
-			return;
-		}
-		
-		if (!execFile.canExecute()) {
-			System.out.println("File right setting error, cannot execute: "+execFile);
-			return;
-		}
-		
-		Log.warning("SearchEngine preferences set with: "+OSDir.getAbsolutePath()+ ", "+initFile.getAbsolutePath()+ " and "+execFile.getAbsolutePath());
-		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.VERSION, currentVersion.toString());
+//		String CQPFRAGMENT = "org.txm.libs.cqp."+System.getProperty("osgi.os");
+//		//TODO: fix preferneces logic between org.txm.cqp.lib et org.txm.searchengine.cqp
+//		Log.info("CQP.DoInstallStep.preInstall()");
+//		String saved = TXMPreferences.getString(CQPLibPreferences.VERSION, CQPLibPreferences.PREFERENCES_NODE);
+//		Version currentVersion = BundleUtils.getBundleVersion(CQPFRAGMENT); // the CQPFRAGMENT plugin contains the right version
+//		
+//		if (saved != null && saved.length() > 0) {
+//			Version savedVersion = new Version(saved);
+//			if (currentVersion.compareTo(savedVersion) <= 0) {
+//				Log.info("No post-installation of CQP to do");
+//				return; // nothing to do
+//			}
+//		}
+//		Log.info("Updating CWB preferences for CQP version="+currentVersion);
+//		
+//		String os = "win";
+//		String ext = "";
+//		if (Util.isWindows()) { //$NON-NLS-1$
+//			if (System.getProperty("os.arch").contains("64")) { os = "win64"; } 
+//			else { os = "win32"; }
+//			ext = ".exe";
+//		} else if (Util.isMac()) { //$NON-NLS-1$
+//			os = "macosx";
+//		} else {
+//			os = "linux32";
+//			if (System.getProperty("os.arch").contains("64")) 
+//				os = "linux64";
+//		}
+//
+//		File bundleDir = BundleUtils.getBundleFile(CQPFRAGMENT);
+//		if (bundleDir == null) {
+//			System.out.println("Error while retrieving TreeTaggerInstaller bundle directory.");
+//			return;
+//		}
+//		File cwbDir = new File(bundleDir, "res");
+//		File initFile = new File(cwbDir, "cqpserver.init");
+//		File OSDir = new File(cwbDir, os);
+//		
+//		int n;
+//		try { // extract all gz files
+//			n = Utils.unGzipFilesInDirectory(OSDir);
+//
+//			if (n == 0) {
+//				System.out.println("Error while extracting CQP files: no file extracted.");
+//				return;
+//			}
+//		} catch (IOException e1) {
+//			System.out.println("Error while extracting CQP files: "+e1);
+//			return;
+//		}
+//		
+//		File execFile = new File(OSDir, "cqpserver"+ext);
+//
+//		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.CQI_SERVER_PATH_TO_CQPLIB, OSDir.getAbsolutePath());
+//		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE, initFile.getAbsolutePath());
+//		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, execFile.getAbsolutePath());
+//		if (!Util.isWindows()) { 
+//			try {
+//				Log.info("Setting execution file rights to: "+OSDir.getAbsolutePath());
+//				Runtime.getRuntime().exec("chmod -R +x "+OSDir.getAbsolutePath()).waitFor();
+//			} catch (Exception e) {
+//				System.out.println("Error while setting execution file rights to: "+OSDir.getAbsolutePath());
+//				e.printStackTrace();
+//				return;
+//			}
+//		}
+//	
+//		if (!execFile.exists()) {
+//			System.out.println("Cannot find CQP executable file: "+execFile);
+//			return;
+//		}
+//		
+//		if (!execFile.canExecute()) {
+//			System.out.println("File right setting error, cannot execute: "+execFile);
+//			return;
+//		}
+//		
+//		Log.warning("SearchEngine preferences set with: "+OSDir.getAbsolutePath()+ ", "+initFile.getAbsolutePath()+ " and "+execFile.getAbsolutePath());
+//		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.VERSION, currentVersion.toString());
 	}
 }
Index: tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/Activator.java
===================================================================
--- tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/Activator.java	(revision 588)
+++ tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/Activator.java	(revision 589)
@@ -1,6 +1,5 @@
 package org.txm.libs.cqp;
 
-import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.osgi.framework.BundleContext;
 
@@ -47,15 +46,4 @@
 	public static Activator getDefault() {
 		return plugin;
 	}
-
-	/**
-	 * Returns an image descriptor for the image file at the given
-	 * plug-in relative path
-	 *
-	 * @param path the path
-	 * @return the image descriptor
-	 */
-	public static ImageDescriptor getImageDescriptor(String path) {
-		return imageDescriptorFromPlugin(PLUGIN_ID, path);
-	}
 }
Index: tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/CQPLibPreferences.java
===================================================================
--- tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/CQPLibPreferences.java	(revision 588)
+++ tmp/org.txm.libs.cqp/src/org/txm/libs/cqp/CQPLibPreferences.java	(revision 589)
@@ -1,11 +1,16 @@
 package org.txm.libs.cqp;
 
+import java.io.File;
+import java.io.IOException;
+
 import org.eclipse.core.runtime.preferences.DefaultScope;
 import org.osgi.framework.FrameworkUtil;
+import org.osgi.framework.Version;
 import org.osgi.service.prefs.Preferences;
 import org.txm.core.messages.TXMCoreMessages;
 import org.txm.core.preferences.TBXPreferences;
 import org.txm.core.preferences.TXMPreferences;
+import org.txm.utils.BundleUtils;
 import org.txm.utils.logger.Log;
 
 public class CQPLibPreferences extends TXMPreferences {
@@ -24,11 +29,131 @@
 	/** The Constant CQI_SERVER_PATH_TO_INIT_FILE. */
 	public static final String CQI_SERVER_PATH_TO_INIT_FILE = "cqi_server_path_to_init_file"; //$NON-NLS-1$
 	
+	/** The Constant CQI_SERVER_HOST. */
+	public static final String CQI_SERVER_HOST = "cqi_server_host"; //$NON-NLS-1$
+
+	/** The Constant CQI_SERVER_PORT. */
+	public static final String CQI_SERVER_PORT = "cqi_server_port"; //$NON-NLS-1$
+
+	/** The Constant CQI_SERVER_LOGIN. */
+	public static final String CQI_SERVER_LOGIN = "cqi_server_login"; //$NON-NLS-1$
+
+	/** The Constant CQI_SERVER_PASSWORD. */
+	public static final String CQI_SERVER_PASSWORD = "cqi_server_password"; //$NON-NLS-1$
+
+	/** The Constant CQI_SERVER_ADDITIONAL_OPTIONS. */
+	public static final String CQI_SERVER_ADDITIONAL_OPTIONS = "cqi_server_additional_options"; //$NON-NLS-1$
+
+	/** The Constant CQI_SERVER_MONITOR_OUTPUT. */
+	public static final String CQI_SERVER_MONITOR_OUTPUT = "cqi_server_monitor_output"; //$NON-NLS-1$
+
+	/** The Constant CQI_SERVER_IS_REMOTE. */
+	public static final String CQI_SERVER_IS_REMOTE = "cqi_server_is_remote"; //$NON-NLS-1$
+
+	/** The Constant CQI_SERVER_MODE. */
+	public static final String CQI_NETWORK_MODE = "cqi_server_mode"; //$NON-NLS-1$
+
+	public static final String CQP_EMPTY_VALUE_CODE = "cqp_empty_value_code";
+	
 	@Override
 	public void initializeDefaultPreferences() {
+		
+		
 		Log.info(TXMCoreMessages.Toolbox_4 + TBXPreferences.getID()); 
 
 		Preferences preferences = DefaultScope.INSTANCE.getNode(PREFERENCES_NODE);
+
+		preferences.put(CQI_SERVER_ADDITIONAL_OPTIONS, "-b 1000000 -d OFF"); //$NON-NLS-1$
+		preferences.put(CQI_SERVER_PORT, "4877"); //$NON-NLS-1$
+		preferences.put(CQI_SERVER_HOST, "localhost"); //$NON-NLS-1$
+		preferences.put(CQI_SERVER_LOGIN, "anonymous"); //$NON-NLS-1$
+		preferences.put(CQI_SERVER_PASSWORD, ""); //$NON-NLS-1$
+		preferences.put(CQI_SERVER_IS_REMOTE, "" + false); //$NON-NLS-1$
+		preferences.putBoolean(CQI_NETWORK_MODE, false); //$NON-NLS-1$
+		preferences.put(CQP_EMPTY_VALUE_CODE, ""); //$NON-NLS-1$
 		
+		String CQPFRAGMENT = "org.txm.libs.cqp."+System.getProperty("osgi.os");
+		//TODO: fix preferneces logic between org.txm.cqp.lib et org.txm.searchengine.cqp
+		Log.info("CQP.DoInstallStep.preInstall()");
+		String saved = TXMPreferences.getString(CQPLibPreferences.VERSION, CQPLibPreferences.PREFERENCES_NODE);
+		Version currentVersion = BundleUtils.getBundleVersion(CQPFRAGMENT); // the CQPFRAGMENT plugin contains the right version
+		
+		if (saved != null && saved.length() > 0) {
+			Version savedVersion = new Version(saved);
+			if (currentVersion.compareTo(savedVersion) <= 0) {
+				Log.info("No post-installation of CQP to do");
+				return; // nothing to do
+			}
+		}
+		Log.info("Updating CWB preferences for CQP version="+currentVersion);
+		
+		String os = "win";
+		String ext = "";
+		String osname = System.getProperty("os.name").toLowerCase();
+		if (osname.contains("windows")) { //$NON-NLS-1$
+			if (System.getProperty("os.arch").contains("64")) { os = "win64"; } 
+			else { os = "win32"; }
+			ext = ".exe";
+		} else if (osname.contains("mac")) { //$NON-NLS-1$
+			os = "macosx";
+		} else {
+			os = "linux32";
+			if (System.getProperty("os.arch").contains("64")) 
+				os = "linux64";
+		}
+
+		File bundleDir = BundleUtils.getBundleFile(CQPFRAGMENT);
+		if (bundleDir == null) {
+			System.out.println("Error while retrieving "+CQPFRAGMENT+" bundle directory.");
+			return;
+		}
+		File cwbDir = new File(bundleDir, "res");
+		File initFile = new File(cwbDir, "cqpserver.init");
+		File OSDir = new File(cwbDir, os);
+		
+		int n;
+		try { // extract all gz files
+			n = Utils.unGzipFilesInDirectory(OSDir);
+
+			if (n == 0) {
+				System.out.println("Error while extracting CQP files: no file extracted.");
+				return;
+			}
+		} catch (IOException e1) {
+			System.out.println("Error while extracting CQP files: "+e1);
+			return;
+		}
+		
+		File execFile = new File(OSDir, "cqpserver"+ext);
+		preferences.put(CQI_SERVER_PATH_TO_CQPLIB, OSDir.getAbsolutePath());
+		preferences.put(CQI_SERVER_PATH_TO_INIT_FILE, initFile.getAbsolutePath());
+		preferences.put(CQI_SERVER_PATH_TO_EXECUTABLE, execFile.getAbsolutePath());
+		
+		if (!osname.contains("windows")) { 
+			try {
+				Log.info("Setting execution file rights to: "+OSDir.getAbsolutePath());
+				Runtime.getRuntime().exec("chmod -R +x "+OSDir.getAbsolutePath()).waitFor();
+			} catch (Exception e) {
+				System.out.println("Error while setting execution file rights to: "+OSDir.getAbsolutePath());
+				e.printStackTrace();
+				return;
+			}
+		}
+	
+		if (!execFile.exists()) {
+			System.out.println("Cannot find CQP executable file: "+execFile);
+			return;
+		}
+		
+		if (!execFile.canExecute()) {
+			System.out.println("File right setting error, cannot execute: "+execFile);
+			return;
+		}
+		
+		Log.warning("SearchEngine preferences set with: "+OSDir.getAbsolutePath()+ ", "+initFile.getAbsolutePath()+ " and "+execFile.getAbsolutePath());
+		TXMPreferences.put(CQPLibPreferences.PREFERENCES_NODE, CQPLibPreferences.VERSION, currentVersion.toString());
+	
+		
+		
 	}
 }
Index: tmp/org.txm.libs.cqp/plugin.xml
===================================================================
--- tmp/org.txm.libs.cqp/plugin.xml	(revision 588)
+++ tmp/org.txm.libs.cqp/plugin.xml	(revision 589)
@@ -9,5 +9,11 @@
             name="org.txm.libs.cqp.DoInstallStep">
       </PostInstallationStep>
    </extension>
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer
+            class="org.txm.libs.cqp.CQPLibPreferences">
+      </initializer>
+   </extension>
 
 </plugin>
Index: tmp/org.txm.libs.cqp/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.libs.cqp/META-INF/MANIFEST.MF	(revision 588)
+++ tmp/org.txm.libs.cqp/META-INF/MANIFEST.MF	(revision 589)
@@ -4,11 +4,8 @@
 Bundle-SymbolicName: org.txm.libs.cqp;singleton:=true
 Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.txm.libs.cqp.Activator
-Require-Bundle: org.txm.utils;bundle-version="1.0.0",
- org.eclipse.core.runtime,
- org.txm.core,
- org.eclipse.jface,
- org.eclipse.ui.workbench
+Require-Bundle: org.txm.utils;bundle-version="1.0.0";visibility:=reexport,
+ org.txm.core;visibility:=reexport
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Bundle-ActivationPolicy: lazy
 Export-Package: org.txm.libs.cqp
Index: tmp/org.txm.core/plugin.xml
===================================================================
--- tmp/org.txm.core/plugin.xml	(revision 588)
+++ tmp/org.txm.core/plugin.xml	(revision 589)
@@ -9,10 +9,6 @@
       <initializer
             class="org.txm.core.preferences.TBXPreferences">
       </initializer>
-      <scope
-            class="org.txm.objects.BasePreferenceScope"
-            name="binarycorpus">
-      </scope>
    </extension>
 
 </plugin>
Index: tmp/org.txm.core/META-INF/MANIFEST.MF
===================================================================
--- tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 588)
+++ tmp/org.txm.core/META-INF/MANIFEST.MF	(revision 589)
@@ -12,7 +12,7 @@
  org.eclipse.osgi;visibility:=reexport,
  org.eclipse.ui.workbench;visibility:=reexport,
  org.eclipse.core.commands;visibility:=reexport,
- org.eclipse.core.resources
+ org.eclipse.core.resources;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.core/src/java/org/txm/core/preferences/TXMPreferences.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 588)
+++ tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 589)
@@ -997,6 +997,8 @@
 	 */
 	public static String findNodeQualifier(String nodeQualifier, TXMResult result, String key)	{
 
+		if (result == null) return nodeQualifier;
+		
 		boolean keyExists = (result != null && resultScopeKeyExists(result, key));
 
 		// get the result scope preference
Index: tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java
===================================================================
--- tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java	(revision 588)
+++ tmp/org.txm.core/src/java/org/txm/utils/BundleUtils.java	(revision 589)
@@ -21,7 +21,7 @@
 	public static Version getBundleVersion(String bundle_id) {
 		Bundle bundle = Platform.getBundle(bundle_id);
 		if (bundle == null) {
-			System.out.println("Error while initializing Oriflamms plugin: bundle not found.");
+			System.out.println("Error while initializing "+bundle_id+" plugin: bundle not found.");
 			return null;
 		}
 		return bundle.getVersion();
