Revision 516

tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/ChartsEngine.java (revision 516)
333 333
	public File createTmpFile(String prefix)	{
334 334
		File file = null;
335 335
		try {
336
			File resultsDir = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "results"); //$NON-NLS-1$
336
			File resultsDir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "results"); //$NON-NLS-1$
337 337
			resultsDir.mkdirs();
338 338
			
339 339
			// right padding to 3 characters long
tmp/org.txm.annotation.core/src/org/txm/annotation/core/repository/KnowledgeRepositoryManager.java (revision 516)
103 103
	
104 104
	public static KnowledgeRepository getKnowledgeRepository(String name) {
105 105
		KnowledgeRepository kr = null;
106
		File krconf = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME),"repositories/"+name+"/conf.xml");
106
		File krconf = new File(Toolbox.getTXMHOMEPATH(),"repositories/"+name+"/conf.xml");
107 107
		if (repositories.containsKey(name)) {
108 108
			kr = repositories.get(name);
109 109
		} else {
......
129 129
	 */
130 130
	public static KnowledgeRepository getKnowledgeRepository(String name, org.txm.objects.Corpus corpus) {
131 131
		KnowledgeRepository kr = null;
132
		File krconf = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME),"repositories/"+name+"/conf.xml");
132
		File krconf = new File(Toolbox.getTXMHOMEPATH(),"repositories/"+name+"/conf.xml");
133 133
		if (repositories.containsKey(name)) {
134 134
			kr = repositories.get(name);
135 135
		} else {
......
221 221
	public static String generateLocalURLPage(String krname, String name, String id) {
222 222
	
223 223
		KnowledgeRepository kr = getKnowledgeRepository(krname);
224
		String path = Toolbox.getParam(TBXPreferences.USER_TXM_HOME)+"/repositories/"+krname;
224
		String path = Toolbox.getTXMHOMEPATH()+"/repositories/"+krname;
225 225
		//File htmlTemplateFile = new File(path+"/template.html");
226 226
		File newHtmlFile = null;
227 227
		String htmlString;
tmp/org.txm.annotation.core/src/org/txm/annotation/core/repository/LocalKnowledgeRepository.java (revision 516)
27 27

  
28 28
		String path = accessProperties.get(SQLConnection.SQL_ADDRESS);
29 29
		if (path == null || path.trim().length() == 0) { // no address, forge one 
30
			path = Toolbox.getParam(TBXPreferences.USER_TXM_HOME)+"/repositories/"+getName();
30
			path = Toolbox.getTXMHOMEPATH()+"/repositories/"+getName();
31 31
			System.out.println("No address given to build values. No values created");
32 32
			return true;
33 33
		}
tmp/org.txm.annotation.core/src/org/txm/annotation/core/repository/KnowledgeRepository.java (revision 516)
63 63
	 * @return
64 64
	 */
65 65
	public EntityManager initializeEntityManager(){
66
		this.dbPath = Toolbox.getParam(TBXPreferences.USER_TXM_HOME)+"/repositories/"+name;
66
		this.dbPath = Toolbox.getTXMHOMEPATH()+"/repositories/"+name;
67 67
		//System.out.println("KnowledgeRepository.initializeEntityManager [DB @ "+dbPath+"]");
68 68
		EntityManagerFactory emf;
69 69
		HashMap<String, Object> properties = new HashMap<String, Object>();
tmp/org.txm.annotation.core/src/org/txm/annotation/core/conversion/CorpusRuledConvertion.java (revision 516)
94 94
					}
95 95
					if (errors.size() > 10) {
96 96
						try {
97
							File errorFile = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "errors.txt");
97
							File errorFile = new File(Toolbox.getTXMHOMEPATH(), "errors.txt");
98 98
							IOUtils.write(errorFile, StringUtils.join(errors, "\t"));
99 99
							System.out.println("More errors, see "+errorFile.getAbsolutePath());
100 100
						} catch (Exception e) {
tmp/org.txm.annotation.core/src/org/txm/annotation/core/AnnotationWriter.java (revision 516)
15 15
import org.txm.annotation.core.repository.AnnotationType;
16 16
import org.txm.annotation.core.repository.KnowledgeRepository;
17 17
import org.txm.core.preferences.TBXPreferences;
18
import org.txm.core.preferences.TXMPreferences;
18 19
import org.txm.importer.ValidateXml;
19 20
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
20 21
import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
......
89 90
		List<String> textsIds = corpus.getTextsID();
90 91
		System.out.println("Exporting annotations of "+StringUtils.join(textsIds, ", ")+".");
91 92

  
92
		File resultDirectory = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "results/"+corpus.getName()+"_annotations");
93
		File resultDirectory = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "results/"+corpus.getName()+"_annotations");
93 94
		DeleteDir.deleteDirectory(resultDirectory);
94 95
		resultDirectory.mkdirs();
95 96
		if (!(resultDirectory.exists() && resultDirectory.canWrite())) {
tmp/org.txm.annotation.core/src/org/txm/annotation/core/AnnotationEngines.java (revision 516)
20 20
		for (Engine e : engines.values()) {
21 21
			AnnotationEngine se = (AnnotationEngine)e;
22 22
			if (monitor != null) monitor.subTask("Starting "+ se.getName()+" annotation engine.");
23
			se.start(monitor);
23
			try {
24
				se.start(monitor);
25
			} catch (Exception ex) {
26
				System.out.println("Error: failed to start annotation engine: "+se.getName()+": "+ex.getLocalizedMessage());
27
			}
24 28
		}
25 29
		return true;
26 30
	}
......
30 34
		for (Engine e : engines.values()) {
31 35
			AnnotationEngine se = (AnnotationEngine)e;
32 36
			System.out.println("Stoping "+ se.getName()+" annotation engine.");
33
			se.stop();
37
			try {
38
				se.stop();
39
			} catch (Exception ex) {
40
				System.out.println("Error: failed to stop annotation engine: "+se.getName()+": "+ex.getLocalizedMessage());
41
			}
34 42
		}
35 43
		return true;
36 44
	}
......
53 61
				} else {
54 62
					System.out.println("Fail to initialize "+e.getName()+" annotation engine.");
55 63
				}
56
			} catch(CoreException e) {
57
				System.out.println("Fail instanciate "+contributions[i].getName()+": "+e.getLocalizedMessage());
64
			} catch(Exception e) {
65
				System.out.println("Error: fail instanciate "+contributions[i].getName()+": "+e.getLocalizedMessage());
58 66
				e.printStackTrace();
59 67
			} 
60 68
		}
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/AbstractCqiServer.java (revision 516)
55 55
	 * Start.
56 56
	 *
57 57
	 * @return true, if successful
58
	 * @throws Exception 
58 59
	 */
59 60
	@Override
60
	public abstract Boolean start();
61
	public abstract Boolean start() throws Exception;
61 62
	
62 63
	/**
63 64
	 * Convert stream to string.
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/MemCqiServer.java (revision 516)
39 39
import org.apache.commons.lang.ArrayUtils;
40 40
import org.apache.commons.lang.StringUtils;
41 41
import org.txm.Toolbox;
42
import org.txm.core.messages.TXMCoreMessages;
43
import org.txm.core.preferences.TBXPreferences;
42
import org.txm.core.preferences.TXMPreferences;
44 43
import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
45 44
import org.txm.searchengine.cqp.clientExceptions.UnexpectedAnswerException;
46 45
import org.txm.searchengine.cqp.serverException.CqiCqpErrorNoSuchCorpus;
......
50 49

  
51 50
// TODO: Auto-generated Javadoc
52 51
/**
53
 * This class aims at handling a CQi server process. It is not a CQi server per
54
 * se.
52
 * Memory implementation of CQP Server usqing the cqi JNI library
55 53
 * 
56
 * @author Jean-Philippe Magué
54
 * @author mdecorde
57 55
 */
58 56
public class MemCqiServer extends AbstractCqiServer {
59 57

  
......
133 131
	 * @param monitorOutput the monitor output
134 132
	 * @throws Exception 
135 133
	 */
136
	public MemCqiServer(String pathToExecutable, String pathToRegistry,
134
	public MemCqiServer(String pathToRegistry,
137 135
			String pathToInitFile, String additionalOptions,
138 136
			boolean monitorOutput) throws Exception {
139 137

  
140
		this.pathToExecutable = pathToExecutable;
141 138
		this.pathToRegistry = pathToRegistry;
142 139
		this.pathToInitFile = pathToInitFile;
143 140
		this.additionalOptions = additionalOptions;
144 141
		this.monitorOutput = monitorOutput;
142
	}
145 143

  
144
	/**
145
	 * Gets the last cmd line.
146
	 *
147
	 * @return the last cmd line
148
	 */
149

  
150
	public String getLastCmdLine() {
151
		return StringUtils.join(cmdLine, " "); //$NON-NLS-1$
152
	}
153

  
154
	/**
155
	 * Start.
156
	 *
157
	 * @return true, if successful
158
	 * @throws SecurityException 
159
	 * @throws NoSuchFieldException 
160
	 */
161
	public Boolean start() throws Exception {
162

  
146 163
		if (!isLoaded) {
147
			
164

  
148 165
			Field LIBRARIES = ClassLoader.class.getDeclaredField("loadedLibraryNames");
149 166
			LIBRARIES.setAccessible(true);
150
			
167

  
151 168
			try {
169

  
170
				String cqplibpath = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPPreferences.PREFERENCES_NODE);
171
				if (cqplibpath == null || cqplibpath.length() == 0) {
172
					System.out.println("Error: cqp lib path is not set in preferences");
173
					return false;
174
				}
152 175
				String path = System.getProperty("java.library.path");
153
				String libpath = System.getProperty("path.separator")+Toolbox.getParam(CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB);
176
				String libpath = System.getProperty("path.separator")+cqplibpath;
177

  
154 178
				if (!path.contains(libpath)) {
155 179
					path += libpath;
156 180
				}
......
161 185
				Field fieldSysPath = ClassLoader.class.getDeclaredField( "sys_paths" );
162 186
				fieldSysPath.setAccessible( true );
163 187
				fieldSysPath.set( null, null );
164
				
188

  
165 189
				System.loadLibrary("cqpjni");
166 190
				Log.info("cqpjni loaded from dirs "+path);
167 191
				isLoaded = true;
......
173 197
				throw new Exception(e);
174 198
			}
175 199
		}
176
	}
177 200

  
178
	/**
179
	 * Gets the last cmd line.
180
	 *
181
	 * @return the last cmd line
182
	 */
183

  
184
	public String getLastCmdLine() {
185
		return StringUtils.join(cmdLine, " "); //$NON-NLS-1$
186
	}
187

  
188
	/**
189
	 * Start.
190
	 *
191
	 * @return true, if successful
192
	 */
193
	public Boolean start() {
194
		String[] cmd = { pathToExecutable, "-I", pathToInitFile, "-r", pathToRegistry }; //$NON-NLS-1$ //$NON-NLS-2$
201
		String[] cmd = { "", "-I", pathToInitFile, "-r", pathToRegistry }; //$NON-NLS-1$ //$NON-NLS-2$
195 202
		cmdLine = (String[]) ArrayUtils.addAll(cmd, additionalOptions.trim().split(" ")); //$NON-NLS-1$
196 203
		Log.info("Starting NullSearchEngineServer: "+Arrays.toString(cmdLine)+" ... ");
197 204

  
198 205
		//try {
199
			isLoaded = start(cmdLine);
200
			//System.out.println("IS LOADED: "+isLoaded);
201
			if (isLoaded) {
202
				//System.out.println(TXMCoreMessages.CqiClient_34);
203
			} else {
204
				System.out.println("Failed to start SearchEngine in memory mode.");
205
			}
206
			return isLoaded;
207
//		} catch(Exception e) {
208
//			System.out.println("Failed to start MemCqiServer: "+e+ " (error code: "+getErrorCode()+")");
209
//			return false;
210
//		}
206
		isLoaded = start(cmdLine);
207
		//System.out.println("IS LOADED: "+isLoaded);
208
		if (isLoaded) {
209
			//System.out.println(TXMCoreMessages.CqiClient_34);
210
		} else {
211
			System.out.println("Failed to start SearchEngine in memory mode.");
212
		}
213
		return isLoaded;
211 214
	}
212 215

  
213 216
	/**
......
427 430
	 * @throws Exception 
428 431
	 */
429 432
	public static void main(String[] args) throws Exception {
430
		String pathToExecutable = "/home/mdecorde/workspace37/CWB-lib/src/cqp/";
433
		String pathToCQPLibDirectory = "/home/mdecorde/workspace37/CWB-lib/src/cqp/";
431 434
		String cqpserverPathToExecutable = "/home/mdecorde/workspace37/CWB-lib/src/cqp/cqpserver";
432 435
		String pathToRegistry = "/home/mdecorde/TXM/registry";
433 436
		String pathToInitFile = "/usr/lib/TXM/cwb/cqpserver.init";
......
452 455
		String[] strings = {"je", "jamais"};
453 456
		int[] strucpos = {0, 1, 2, 3 , 4};
454 457

  
455
		Toolbox.setParam(CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, pathToExecutable);
458
		TXMPreferences.putString(CQPPreferences.PREFERENCES_NODE, CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, pathToCQPLibDirectory);
456 459

  
457
		MemCqiServer server = new MemCqiServer(pathToExecutable, pathToRegistry, pathToInitFile, " -b 10000000 -d OFF", false);
460
		MemCqiServer server = new MemCqiServer(pathToRegistry, pathToInitFile, " -b 10000000 -d OFF", false);
458 461
		if (server.start()) System.out.println("Mem Server ok");
459 462
		MemCqiClient client = new MemCqiClient(server);
460 463
		if (client.connect("anonymous", "")) System.out.println("Mem Client ok");
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPEngine.java (revision 516)
28 28
	 */
29 29
	boolean state = false;
30 30
	boolean useNetCQi = false;
31
	
31

  
32 32
	@Override
33 33
	public String getName() {
34 34
		return "CQP";
35 35
	}
36
	
36

  
37 37
	/**
38 38
	 * Starts the corpus engine if not remove then launch cqpserver.
39 39
	 *
40 40
	 * @return true, if successful
41 41
	 */
42
	public boolean start(IProgressMonitor monitor) {
42
	public boolean start(IProgressMonitor monitor) throws Exception {
43 43

  
44 44
		if (monitor != null) monitor.subTask("Starting Corpus Engine...");
45
		
45

  
46 46
		boolean cqiserverok = false;
47
		
47

  
48 48
		useNetCQi = Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_NETWORK_MODE, CQPPreferences.PREFERENCES_NODE));
49 49

  
50 50
		Log.warning("Killing CQP and RServe process if any");
51 51
		killSearchEngine();
52 52

  
53
		
53

  
54 54
		boolean remote = Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_SERVER_IS_REMOTE, CQPPreferences.PREFERENCES_NODE));
55 55
		state = false;
56 56
		// test if must-have properties for CWB are set
57 57

  
58
		String exec_path = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, CQPPreferences.PREFERENCES_NODE);
58

  
59 59
		String reg_path = ""; // new way that concats registry of loaded corpus
60 60
		String path_separator = System.getProperty("path.separator");
61 61
		for (Base b : Toolbox.workspace.getProject("default").getBases()) {
......
81 81
		}
82 82
		if (reg_path.length() > 0) reg_path = reg_path.substring(path_separator.length()); // remove first path_separator
83 83
		reg_path = reg_path.replace("\\\\", "//"); // fix the UNC paths for mingw
84
		
84

  
85 85
		String init_path = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_INIT_FILE, CQPPreferences.PREFERENCES_NODE);
86 86

  
87 87

  
88 88
		if (!remote) {
89
			if (exec_path == null
90
					|| reg_path == null
91
					|| init_path == null) {
92
				Log.severe(TXMCoreMessages.Toolbox_1); 
93
			} else {
94
				if (!useNetCQi) {
95
					try {
96
						cqiServer = new MemCqiServer(exec_path,
97
								reg_path, 
98
								init_path, 
99
								TXMPreferences.getString(CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, CQPPreferences.PREFERENCES_NODE)
100
								+ " -P " + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE), //$NON-NLS-1$
101
								Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_SERVER_MONITOR_OUTPUT, CQPPreferences.PREFERENCES_NODE)));
102
					} catch (Exception e) {
103
						// TODO Auto-generated catch block
104
						org.txm.utils.logger.Log.printStackTrace(e);
105
					}
106
				} else {
107
					cqiServer = new NetCqiServer(exec_path,
108
							reg_path, 
89

  
90
			if (!useNetCQi) {
91
				try {
92
					cqiServer = new MemCqiServer(reg_path, 
109 93
							init_path, 
110 94
							TXMPreferences.getString(CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, CQPPreferences.PREFERENCES_NODE)
111 95
							+ " -P " + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE), //$NON-NLS-1$
112 96
							Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_SERVER_MONITOR_OUTPUT, CQPPreferences.PREFERENCES_NODE)));
97
				} catch (Exception e) {
98
					// TODO Auto-generated catch block
99
					org.txm.utils.logger.Log.printStackTrace(e);
113 100
				}
114
				if (cqiServer != null)
115
					cqiserverok = cqiServer.start();
101
			} else {
102

  
103
				String exec_path = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE, CQPPreferences.PREFERENCES_NODE);
104

  
105
				if (exec_path == null || exec_path.length() == 0) {
106
					System.out.println("Error: the '"+CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
107
				}
108
				if (new File(exec_path).exists()) {
109
					System.out.println("Error: the '"+CQPPreferences.CQI_SERVER_PATH_TO_EXECUTABLE+"' preference is not set.");
110
				}
111

  
112
				cqiServer = new NetCqiServer(exec_path,
113
						reg_path, 
114
						init_path, 
115
						TXMPreferences.getString(CQPPreferences.CQI_SERVER_ADDITIONAL_OPTIONS, CQPPreferences.PREFERENCES_NODE)
116
						+ " -P " + TXMPreferences.getString(CQPPreferences.CQI_SERVER_PORT, CQPPreferences.PREFERENCES_NODE), //$NON-NLS-1$
117
						Boolean.parseBoolean(TXMPreferences.getString(CQPPreferences.CQI_SERVER_MONITOR_OUTPUT, CQPPreferences.PREFERENCES_NODE)));
116 118
			}
119

  
120
			if (cqiServer != null)
121
				cqiserverok = cqiServer.start();
122

  
117 123
		}
118 124

  
119 125
		// create cqi client
......
149 155
		} catch (Exception e1) {
150 156
			Log.severe(Log.toString(e1));
151 157
		}
152
	
158

  
153 159
		if (state == false) {
154 160
			System.out.println(TXMCoreMessages.Toolbox_29); 
155 161
			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$
......
180 186
			org.txm.utils.logger.Log.printStackTrace(e);
181 187
			Log.severe(TXMCoreMessages.Toolbox_18 + e);
182 188
		} 
183
		
189

  
184 190
		if (Toolbox.workspace == null) {
185 191
			System.out.println("Can't start CQP with workspace not ready.");
186 192
			return false;
......
197 203

  
198 204
		return state;
199 205
	}
200
	
206

  
201 207
	public boolean loadCQPCorpora(Base base, IProgressMonitor monitor) {
202 208
		//System.out.println("Load corpus from params: "+params.corpora);
203 209
		for (String corpusname : base.getBaseParameters().corpora.keySet()) {
......
295 301
		}
296 302
		return true;
297 303
	}
298
	
304

  
299 305
	/**
300 306
	 * kill cqpserver process.
301 307
	 */
......
375 381
		}
376 382
		return false;
377 383
	}
378
	
384

  
379 385
	/**
380 386
	 * test if searchEngine is initialized.
381 387
	 *
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/ICqiServer.java (revision 516)
45 45
	 * Start.
46 46
	 *
47 47
	 * @return true, if successful
48
	 * @throws Exception 
48 49
	 */
49
	public Boolean start();
50
	public Boolean start() throws Exception;
50 51

  
51 52
	/**
52 53
	 * Convert stream to string.
tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbEncode.java (revision 516)
38 38
import org.txm.Toolbox;
39 39
import org.txm.core.messages.TXMCoreMessages;
40 40
import org.txm.core.preferences.TBXPreferences;
41
import org.txm.core.preferences.TXMPreferences;
41 42
import org.txm.searchengine.cqp.CQPPreferences;
42 43
import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
43 44
import org.txm.stat.utils.ConsoleProgressBar;
......
181 182
		 */
182 183

  
183 184
		// Warning !! for WINDOWS ONLY the "" value does not work with the ProcessBuilder we must set the value to "\"\""
184
		String empty_value_code = Toolbox.getParam(CQPPreferences.CQP_EMPTY_VALUE_CODE);
185
		String empty_value_code = TXMPreferences.getString(CQPPreferences.CQP_EMPTY_VALUE_CODE, CQPPreferences.PREFERENCES_NODE);
185 186
		if (OSDetector.isFamilyWindows()) {
186 187
			if (empty_value_code == null) empty_value_code = "\"\"";
187 188
			empty_value_code = empty_value_code.trim();
tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbProcess.java (revision 516)
38 38
import org.apache.commons.lang.StringUtils;
39 39
import org.txm.core.messages.TXMCoreMessages;
40 40
import org.txm.core.preferences.TBXPreferences;
41
import org.txm.core.preferences.TXMPreferences;
41 42
import org.txm.searchengine.cqp.CQPPreferences;
42 43
import org.txm.searchengine.cqp.clientExceptions.ServerNotFoundException;
43 44
import org.txm.utils.logger.Log;
......
243 244
	 */
244 245
	public static String getCWBLocation()
245 246
	{
246
		String cwbLoc = org.txm.Toolbox.getParam(CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB)+File.separator;
247
		String cwbLoc = TXMPreferences.getString(CQPPreferences.CQI_SERVER_PATH_TO_CQPLIB, CQPPreferences.PREFERENCES_NODE)+File.separator;
247 248

  
248 249
		if (!new File(cwbLoc).exists()) {
249 250
			System.out.println(TXMCoreMessages.CwbProcess_5+cwbLoc);
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java (revision 516)
254 254
				//System.out.println("reload");
255 255
				
256 256
				try {
257
					File homedir = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
257
					File homedir = new File(Toolbox.getTXMHOMEPATH());
258 258
					long time = System.currentTimeMillis();
259 259
					File tmp = new File(homedir, "REvalLogs.txt"); //$NON-NLS-1$
260 260
					RWorkspace.saveEvalLog(tmp);
tmp/org.txm.groovy.core/src/groovy/org/txm/importer/xtz/ImportModule.java (revision 516)
82 82

  
83 83
		
84 84
		this.sourceDirectory = importParameters.paramFile.getParentFile();
85
		this.binaryDirectory = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "corpora/"+corpusName.toUpperCase());
85
		this.binaryDirectory = new File(Toolbox.getTXMHOMEPATH(), "corpora/"+corpusName.toUpperCase());
86 86

  
87 87
		if (!updateCorpus) { // clean directories only if it's a new import
88 88
			DeleteDir.deleteDirectory(binaryDirectory);
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/messages/messages.properties (revision 516)
3 3
LexicalTableImpl_10 = columns
4 4
LexicalTableImpl_12 = Error: margin 
5 5
LexicalTableImpl_13 = is higher than the partition size
6
LexicalTableImpl_3  = \ <no partition> /
7 6
LexicalTableImpl_5  = not enough columns: minimum 2 (here: 
8 7
LexicalTableImpl_8  = line
9 8
LexicalTableImpl_9  = does not have 
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/messages/messages_fr.properties (revision 516)
3 3
LexicalTableImpl_10 = colonnes
4 4
LexicalTableImpl_12 = Erreur: les marges
5 5
LexicalTableImpl_13 = \ sont plus grandes que la taille des parties
6
LexicalTableImpl_3  = \ <sans partition> /
7
LexicalTableImpl_5  = pas assez de colonnes : minimum 2 (ici : 
6
sLexicalTableImpl_5  = pas assez de colonnes : minimum 2 (ici : 
8 7
LexicalTableImpl_8  = ligne
9 8
LexicalTableImpl_9  = n'a pas 
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/messages/LexicalTableCoreMessages.java (revision 516)
15 15
	public static String LexicalTableImpl_8;
16 16
	public static String LexicalTableImpl_9;
17 17

  
18
	
19
	//FIXME: unused key
20
	public static String LexicalTableImpl_3;
21
	// end of fixme
22
	
23 18
	static {
24 19
		// initialize resource bundle
25 20
		Utf8NLS.initializeMessages(BUNDLE_NAME, LexicalTableCoreMessages.class);
26 21
	}
27

  
28
	private LexicalTableCoreMessages() {
29
	}
30 22
}
tmp/org.txm.core/src/java/org/txm/Engine.java (revision 516)
18 18
	
19 19
	public abstract boolean getState();
20 20
	
21
	public abstract boolean initialize();
21
	public abstract boolean initialize() throws Exception;
22 22
	
23
	public abstract boolean start(IProgressMonitor monitor);
23
	public abstract boolean start(IProgressMonitor monitor) throws Exception;
24 24
	
25
	public abstract boolean stop();
25
	public abstract boolean stop() throws Exception;
26 26
}
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 516)
14 14
import java.util.Set;
15 15

  
16 16
import org.eclipse.core.internal.preferences.Base64;
17
import org.eclipse.core.runtime.Platform;
17 18
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
18 19
import org.eclipse.core.runtime.preferences.DefaultScope;
19 20
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
21
import org.eclipse.core.runtime.preferences.IPreferencesService;
20 22
import org.eclipse.core.runtime.preferences.IScopeContext;
21 23
import org.eclipse.core.runtime.preferences.InstanceScope;
22 24
import org.osgi.service.prefs.BackingStoreException;
......
656 658
	}
657 659

  
658 660
	public static Serializable toSerializable(byte[] bytes) {
659
		
661

  
660 662
		try {
661 663
			ByteArrayInputStream breader = new ByteArrayInputStream(bytes);
662 664
			ObjectInputStream reader = new ObjectInputStream(breader);
......
793 795
		scope.getNode(nodeQualifier).put(key, "");
794 796
	}
795 797

  
798
	/**
799
	 * print TxmPreferences in the console.
800
	 */
801
	public static void dump() {
802
		try {
803
			IPreferencesService service = Platform.getPreferencesService();
804
			System.out.println("root:"); //$NON-NLS-1$
805
			for (String children : service.getRootNode().childrenNames()) {
806
				System.out.println(" scope: " + children); //$NON-NLS-1$
807
				String[] subchildren = service.getRootNode().node(children).childrenNames();
808
				Arrays.sort(subchildren);
809
				for (String children2 : subchildren) {
810
					System.out.println("  node: "+ children2); //$NON-NLS-1$
811
					String[] keys = service.getRootNode().node(children).node(children2).keys();
812
					Arrays.sort(keys);
813
					for (String key2 : keys) {
814
						System.out.println(
815
								"   " + key2 + " = " + service.getRootNode().node(children).node(children2).get(key2, null)); //$NON-NLS-1$ //$NON-NLS-2$
816
					}
817
				}
818
			}
819
		} catch (Exception e) {
820
			System.err.println(e);
821
		}
822
	}
796 823

  
797 824
	/**
798 825
	 * Dumps the keys and values of the specified node.
......
1034 1061
		else if (Boolean.class.isInstance(value))	{
1035 1062
			putLocalBoolean(result, key, (Boolean) value);
1036 1063
		}
1037
//		else if (Serializable.class.isInstance(value))	{
1038
//			putLocalSerializable(result, key, (Serializable) value);
1039
//		} else {
1040
//			//FIXME: Debug
1041
//			System.err.println("TXMPreferences.putLocal(): error, can't find a put method that matches the value type: " + value.getClass() + "="+value+".");
1042
//		}
1064
		//		else if (Serializable.class.isInstance(value))	{
1065
		//			putLocalSerializable(result, key, (Serializable) value);
1066
		//		} else {
1067
		//			//FIXME: Debug
1068
		//			System.err.println("TXMPreferences.putLocal(): error, can't find a put method that matches the value type: " + value.getClass() + "="+value+".");
1069
		//		}
1043 1070
	}
1044 1071

  
1045 1072
	private static void putLocalSerializable(TXMResult result, String key, Serializable value) {
tmp/org.txm.core/src/java/org/txm/objects/Corpus.java (revision 516)
551 551
	 */
552 552
	public File getBaseDirectory()
553 553
	{
554
		String txmhome = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
554
		String txmhome = Toolbox.getTXMHOMEPATH();
555 555
		Base base = this.getBase();
556 556
		if (base != null)
557 557
			return base.params.paramFile.getParentFile();
tmp/org.txm.core/src/java/org/txm/Toolbox.java (revision 516)
110 110
		return true;
111 111
	}
112 112

  
113

  
114 113
	public static EnginesManager<?> getEngineManager(EngineType et) {
115 114
		
116 115
		if (engines == null) {
......
118 117
		}
119 118
		return engines.get(et);
120 119
	}
121
	
120

  
122 121
	/**
123
	 * Use TXMPreferences.getString(key, TBXPreferences.PREFERENCES_NODE) instead
124 122
	 * 
125
	 * @param key
126
	 * @return
123
	 * @return the TXM working directory set with the USER_TXM_HOME preference key 
127 124
	 */
128
	@Deprecated
129
	public static String getParam(String key) {
130
		return TXMPreferences.getString(key, TBXPreferences.PREFERENCES_NODE);
125
	public static String getTXMHOMEPATH() {
126
		return TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE);
131 127
	}
132

  
128
	
133 129
	/**
134 130
	 * Initializes the toolbox with the parameters read in the file
135 131
	 * textometrie.properties found in the user home directory
......
393 389
	}
394 390

  
395 391
	/**
396
	 * use TBXPreferences.setString(key, value) instead
397
	 * 
398
	 * @param key
399
	 * @param value
400
	 */
401
	@Deprecated
402
	public static void setParam(String key, String value) {
403
		TXMPreferences.putString(TBXPreferences.PREFERENCES_NODE, key, value);
404
	}
405

  
406
	/**
407 392
	 * Shut the toolbox down.
408 393
	 */
409 394
	public static void shutdown() {
tmp/org.txm.core/build.properties (revision 516)
27 27
               lib/jurt-3.2.1.jar,\
28 28
               lib/ridl-3.2.1.jar,\
29 29
               lib/unoil-3.2.1.jar,\
30
               bin/,\
31 30
               src/groovy/,\
32 31
               plugin.xml,\
33 32
               lib/hsqldb.jar,\
tmp/org.txm.core/.classpath (revision 516)
22 22
	<classpathentry exported="true" kind="lib" path="lib/juniversalchardet-1.0.3.jar"/>
23 23
	<classpathentry exported="true" kind="lib" path="lib/textcat-1.0.1.jar"/>
24 24
	<classpathentry exported="true" kind="lib" path="lib/json-20090211.jar"/>
25
	<classpathentry exported="true" kind="lib" path="lib/juh-3.2.1.jar"/>
25
	<classpathentry exported="true" kind="lib" path="lib/juh-3.2.1.jar" sourcepath="src/java"/>
26 26
	<classpathentry exported="true" kind="lib" path="lib/jurt-3.2.1.jar"/>
27 27
	<classpathentry exported="true" kind="lib" path="lib/ridl-3.2.1.jar"/>
28 28
	<classpathentry exported="true" kind="lib" path="lib/unoil-3.2.1.jar"/>
......
37 37
	</classpathentry>
38 38
	<classpathentry kind="src" path="src/java"/>
39 39
	<classpathentry kind="src" path="test"/>
40
	<classpathentry exported="true" kind="lib" path="bin/" sourcepath="src/java"/>
41 40
	<classpathentry kind="src" path="res"/>
42 41
	<classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
43 42
	<classpathentry exported="true" kind="lib" path="lib/hsqldb.jar"/>
tmp/org.txm.core/META-INF/MANIFEST.MF (revision 516)
273 273
 lib/ridl-3.2.1.jar,
274 274
 lib/unoil-3.2.1.jar,
275 275
 lib/hsqldb.jar,
276
 bin/,
277 276
 lib/sqlite-jdbc-3.8.11.2.jar,
278 277
 lib/postgresql-9.4.1207.jre6.jar,
279 278
 lib/jodconverter-core-3.1-beta.jar
tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/commands/ExportStandoff.java (revision 516)
81 81
		//FileDialog dialog = new FileDialog(shell, SWT.SAVE);
82 82
		FileDialog dialog = new FileDialog(shell, SWT.SAVE);
83 83
		MainCorpus corpus = (MainCorpus) s;
84
		String path = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
84
		String path = Toolbox.getTXMHOMEPATH();
85 85
		dialog.setFilterPath(path); //To set a specific path
86 86
		dialog.setFileName(corpus.getName()+"_annotations.zip");
87 87
		dialog.setFilterExtensions(new String[]{"*.zip"});
tmp/org.txm.annotation.rcp/src/org/txm/annotation/rcp/commands/RecodeCorpus.java (revision 516)
105 105
		monitor.worked(1);
106 106
		
107 107
		// update corpus indexes and edition
108
		String txmhome = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
108
		String txmhome = Toolbox.getTXMHOMEPATH();
109 109

  
110 110
		BaseParameters params = corpus.getBase().getBaseParameters();
111 111
		params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
tmp/org.txm.searchengine.core/src/org/txm/searchengine/core/SearchEngines.java (revision 516)
18 18
			SearchEngine se = (SearchEngine)e;
19 19
			//System.out.println("Starting "+ se.getName()+" searchengine.");
20 20
			if (monitor != null) monitor.subTask("Starting "+ se.getName()+" searchengine.");
21
			se.start(monitor);
21
			try {
22
				se.start(monitor);
23
			} catch (Exception e2) {
24
				System.out.println("Error: fail to start SearchEngine: "+se.getName()+": "+e2.getLocalizedMessage());
25
			}
22 26
		}
23 27
		return true;
24 28
	}
......
28 32
		for (Engine e : engines.values()) {
29 33
			SearchEngine se = (SearchEngine)e;
30 34
			System.out.println("Stoping "+ se.getName()+" searchengine.");
35
			try {
31 36
			se.stop();
37
		} catch (Exception e2) {
38
			System.out.println("Error: fail to stop SearchEngine: "+se.getName()+": "+e2.getLocalizedMessage());
32 39
		}
40
		}
33 41
		return true;
34 42
	}
35 43

  
......
59 67
				} else {
60 68
					System.out.println("Fail to initialize "+e.getName()+" search engine.");
61 69
				}
62
			} catch(CoreException e) {
63
				System.out.println("Fail instanciate "+contributions[i].getName()+": "+e.getLocalizedMessage());
70
			} catch(Exception e) {
71
				System.out.println("Error: fail to instanciate "+contributions[i].getName()+": "+e.getLocalizedMessage());
64 72
				e.printStackTrace();
65 73
			} 
66 74
		}
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/rcp/commands/base/ExportCorpus.java (revision 516)
77 77
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
78 78
				.getShell();
79 79

  
80
		String txmhome = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
80
		String txmhome = Toolbox.getTXMHOMEPATH();
81 81
		if (!(selection.getFirstElement() instanceof MainCorpus))
82 82
			return null;
83 83

  
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/preferences/CQPPreferencePage.java (revision 516)
28 28
package org.txm.searchengine.cqp.rcp.preferences;
29 29

  
30 30

  
31
import java.io.IOException;
32

  
33 31
import org.eclipse.jface.preference.BooleanFieldEditor;
34 32
import org.eclipse.jface.preference.DirectoryFieldEditor;
35 33
import org.eclipse.jface.preference.FieldEditor;
36
import org.eclipse.jface.preference.FieldEditorPreferencePage;
37 34
import org.eclipse.jface.preference.FileFieldEditor;
38 35
import org.eclipse.jface.preference.IntegerFieldEditor;
39 36
import org.eclipse.jface.preference.StringFieldEditor;
40 37
import org.eclipse.jface.util.PropertyChangeEvent;
41
import org.eclipse.osgi.util.NLS;
42 38
import org.eclipse.ui.IWorkbench;
43
import org.eclipse.ui.IWorkbenchPreferencePage;
44
import org.eclipse.ui.preferences.ScopedPreferenceStore;
45 39
import org.osgi.service.prefs.Preferences;
46
import org.txm.core.preferences.TBXPreferences;
47 40
import org.txm.rcp.Application;
48 41
import org.txm.rcp.RCPMessages;
49 42
import org.txm.rcp.preferences.TXMPreferencePage;
......
56 49
 * can use the field support built into JFace that allows us to create a page
57 50
 * that is small and knows how to save, restore and apply itself.
58 51
 * <p>
59
 * This page is used to modif y preferences only. They are stored in the
52
 * This page is used to modify preferences only. They are stored in the
60 53
 * preference store that belongs to the main plug-in class. That way,
61 54
 * preferences can be accessed directly via the preference store.
62 55
 */
tmp/org.txm.searchengine.cqp.rcp/plugin.xml (revision 516)
260 260
         point="org.eclipse.ui.preferencePages">
261 261
      <page
262 262
            category="org.txm.rcp.preferences.AdvancePreferencePage"
263
            class="org.txm.rcp.preferences.CQPPreferencePage"
264
            id="org.txm.rcp.preferences.CQPPreferencePage"
263
            class="org.txm.searchengine.cqp.rcp.preferences.CQPPreferencePage"
264
            id="org.txm.searchengine.cqp.rcp.preferences.CQPPreferencePage"
265 265
            name="CQP">
266 266
      </page>
267 267
   </extension>
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/preferences/ConcordancePreferencePage.java (revision 516)
44 44
 */
45 45
public class ConcordancePreferencePage extends TXMPreferencePage {
46 46
	
47
	public ConcordancePreferencePage() {
48
		super();
49
	}
47 50

  
48 51
	@Override
49 52
	protected void createFieldEditors() {
tmp/org.txm.statsengine.core/src/org/txm/statsengine/core/StatEngines.java (revision 516)
13 13

  
14 14
	@Override
15 15
	protected boolean fetchEngines() {
16
		
16

  
17 17
		IConfigurationElement[] contributions = Platform.getExtensionRegistry().getConfigurationElementsFor(StatEngine.EXTENSION_POINT_ID);
18 18

  
19 19
		for (int i = 0; i < contributions.length; i++) {
......
25 25
				e.printStackTrace();
26 26
			} 
27 27
		}
28
		
28

  
29 29
		return engines.size() > 0;
30 30
	}
31 31

  
......
33 33
	public boolean startEngines(IProgressMonitor monitor) {
34 34
		//System.out.println("StatEngines.startEngines: "+engines);
35 35
		for (Engine e : engines.values()) {
36
			
36

  
37 37
			StatEngine se = (StatEngine)e;
38 38
			if (monitor != null) monitor.subTask("Starting "+se.getName()+" statengine...");
39
			se.start(monitor);
40
			
39
			try {
40
				se.start(monitor);
41
			} catch (Exception e2) {
42
				System.out.println("Error: fail to start StatEngine: "+se.getName()+": "+e2.getLocalizedMessage());
43
			}
44

  
41 45
		}
42 46
		return true;
43 47
	}
44 48

  
45 49
	@Override
46 50
	public boolean stopEngines() {
47
		
51

  
48 52
		for (Engine e : engines.values()) {
49
			
53

  
50 54
			StatEngine se = (StatEngine)e;
51 55
			System.out.println("Stoping "+se.getName()+" statengine...");
52
			se.stop();
56
			try {
57
				se.stop();
58
			} catch (Exception e2) {
59
				System.out.println("Error: fail to stop StatEngine: "+se.getName()+": "+e2.getLocalizedMessage());
60
			}
53 61
		}
54 62
		return true;
55 63
	}
......
58 66
	public EngineType getEnginesType() {
59 67
		return EngineType.STAT;
60 68
	}
61
	
69

  
62 70
	public static StatEngine getREngine() {
63 71
		return (StatEngine) Toolbox.getEngineManager(EngineType.STAT).getEngine("R");
64 72
	}
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/messages_fr.properties (revision 516)
8 8
LexicalTableEditor_15 = ** Erreur lors de l'importation des données :  
9 9
LexicalTableEditor_16 = Filtrage de lignes
10 10
LexicalTableEditor_18 = Fusion de lignes
11
LexicalTableEditor_2  = , Fmin 
12
LexicalTableEditor_3  = , Fmax 
13 11
LexicalTableEditor_4  = Appliquer
14 12
LexicalTableEditor_5  = Garder {0} lignes, Fmin {1}
15 13
LexicalTableEditor_6  = Fmin :
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/messages/LexicalTableUIMessages.java (revision 516)
7 7

  
8 8
	private static final String BUNDLE_NAME = "org.txm.lexicaltable.rcp.messages.messages"; //$NON-NLS-1$
9 9

  
10

  
11 10
	public static String LexicalTableEditor_1;
12 11
	public static String LexicalTableEditor_10;
13 12
	public static String LexicalTableEditor_11;
......
25 24
	public static String LexicalTablePreferencePage_0;
26 25
	public static String LexicalTablePreferencePage_1;
27 26

  
28
	//FIXME: unused keys
29
	public static String LexicalTableEditor_2;
30
	public static String LexicalTableEditor_3;
31
	// end of fixme
32
	
33 27
	static {
34 28
		// initialize resource bundle
35 29
		Utf8NLS.initializeMessages(BUNDLE_NAME, LexicalTableUIMessages.class);
36 30
	}
37

  
38
	private LexicalTableUIMessages() {
39
	}
40 31
}
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/QueriesView.java (revision 516)
167 167
				File output = new File("queries.txt"); //$NON-NLS-1$
168 168

  
169 169
				FileDialog dialog = new FileDialog(arg0.display.getActiveShell(), SWT.SAVE);
170
				String txmhome = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
170
				String txmhome = Toolbox.getTXMHOMEPATH();
171 171
				if (LastOpened.getFile(ID) != null) {
172 172
					dialog.setFilterPath(LastOpened.getFolder(ID));
173 173
					dialog.setFileName(LastOpened.getFile(ID));
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/Explorer.java (revision 516)
75 75
	static public String ID = "org.txm.rcp.views.fileexplorer.Explorer"; //$NON-NLS-1$
76 76

  
77 77
	/** Initialize currentPath with user home directory */
78
	private String currentPath = System.getProperty("user.home");//Toolbox.getParam(TBXPreferences.USER_TXM_HOME);  //$NON-NLS-1$
78
	private String currentPath = System.getProperty("user.home");//Toolbox.getTXMHOMEPATH();  //$NON-NLS-1$
79 79

  
80 80
	/** The tv. */
81 81
	TreeViewer tv;
......
293 293
	 * @return true, if successful
294 294
	 */
295 295
	protected boolean CanDelete(File selectedItem) {
296
		File txmhome = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
297
		File scripts = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "scripts"); //$NON-NLS-1$
298
		File corpora = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "corpora"); //$NON-NLS-1$
299
		//File registry = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "registry"); //$NON-NLS-1$
300
		File workspaces = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "workspaces"); //$NON-NLS-1$
301
		File xsl = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "xsl"); //$NON-NLS-1$
302
		File samples = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "samples"); //$NON-NLS-1$
296
		File txmhome = new File(Toolbox.getTXMHOMEPATH());
297
		File scripts = new File(Toolbox.getTXMHOMEPATH(), "scripts"); //$NON-NLS-1$
298
		File corpora = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
299
		//File registry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
300
		File workspaces = new File(Toolbox.getTXMHOMEPATH(), "workspaces"); //$NON-NLS-1$
301
		File xsl = new File(Toolbox.getTXMHOMEPATH(), "xsl"); //$NON-NLS-1$
302
		File samples = new File(Toolbox.getTXMHOMEPATH(), "samples"); //$NON-NLS-1$
303 303
		if (selectedItem.equals(txmhome) || 
304 304
				selectedItem.equals(txmhome) ||
305 305
				selectedItem.equals(scripts) ||
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/fileexplorer/MacroExplorer.java (revision 516)
78 78
	static public String ID = "org.txm.rcp.views.fileexplorer.MacroExplorer"; //$NON-NLS-1$
79 79

  
80 80
	/** The home. */
81
	private static String home = Toolbox.getParam(TBXPreferences.USER_TXM_HOME); 
81
	private static String home = Toolbox.getTXMHOMEPATH(); 
82 82

  
83 83
	/** The tv. */
84 84
	TreeViewer tv;
......
91 91
	}
92 92

  
93 93
	private static void initCurrentDirectory() {
94
		home = Toolbox.getParam(TBXPreferences.USER_TXM_HOME); 
94
		home = Toolbox.getTXMHOMEPATH(); 
95 95
		if (home == null) home = System.getProperty("user.home"); //$NON-NLS-1$
96 96
		File scriptsDir = new File(home, "scripts"); //$NON-NLS-1$
97 97
		File currentRootDir = new File(scriptsDir, "macro/org/txm/macro"); //$NON-NLS-1$
......
158 158
		newMacro.addSelectionListener(new SelectionAdapter() {
159 159
			@Override
160 160
			public void widgetSelected(SelectionEvent e) {
161
				String scriptRootDir = Toolbox.getParam(TBXPreferences.USER_TXM_HOME) + "/scripts"; //$NON-NLS-1$
161
				String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
162 162
				File currentRootDir = new File(scriptRootDir, "macro/org/txm/macro"); //$NON-NLS-1$
163 163
				currentRootDir.mkdirs();
164 164
				
......
264 264
	 * @return true, if successful
265 265
	 */
266 266
	protected boolean CanDelete(File selectedItem) {
267
		File txmhome = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
268
		File scripts = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "scripts"); //$NON-NLS-1$
269
		File corpora = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "corpora"); //$NON-NLS-1$
270
		//File registry = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "registry"); //$NON-NLS-1$
271
		File workspaces = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "workspaces"); //$NON-NLS-1$
272
		File xsl = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "xsl"); //$NON-NLS-1$
273
		File samples = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "samples"); //$NON-NLS-1$
267
		File txmhome = new File(Toolbox.getTXMHOMEPATH());
268
		File scripts = new File(Toolbox.getTXMHOMEPATH(), "scripts"); //$NON-NLS-1$
269
		File corpora = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
270
		//File registry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
271
		File workspaces = new File(Toolbox.getTXMHOMEPATH(), "workspaces"); //$NON-NLS-1$
272
		File xsl = new File(Toolbox.getTXMHOMEPATH(), "xsl"); //$NON-NLS-1$
273
		File samples = new File(Toolbox.getTXMHOMEPATH(), "samples"); //$NON-NLS-1$
274 274
		if (selectedItem.equals(txmhome) || 
275 275
				selectedItem.equals(txmhome) ||
276 276
				selectedItem.equals(scripts) ||
tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages.properties (revision 516)
211 211
ComplexSubcorpusPanel_4  = Query
212 212
ComplexSubcorpusPanel_5  = Refresh
213 213

  
214
ComputeConcordance_0 = Opening the Concordance result
215
ComputeConcordance_1 = Failed to open concordance editor.
216

  
217 214
ComputeCoocFromLines_0 = Computing Cooccurrents
218 215
ComputeCoocFromLines_1 = Opening the Cooccurrents table
219 216

  
......
274 271

  
275 272
Compute_Specificities        = Computing specificities.
276 273

  
277
ConcordancerPreferencePage_3 = Concordance Parameters
278
ConcordancerPreferencePage_4 = Lines per &Page:
279
ConcordancerPreferencePage_5 = &Left context length in words
280
ConcordancerPreferencePage_6 = &Right context length in words
281

  
282
ConcordancesEditorContributor_0 = Concordance
283

  
284
ConcordancesEditor_0                          = Last CQI error:
285
ConcordancesEditor_1                          = Reference
286
ConcordancesEditor_10                         = . Aborting back to text.
287
ConcordancesEditor_100                        = Available values for {0}
288
ConcordancesEditor_101                        = Cancel
289
ConcordancesEditor_108                        = \ elements. Continue ?
290
ConcordancesEditor_11                         = |<
291
ConcordancesEditor_110                        = New value {0} for category {1}  
292
ConcordancesEditor_112                        = The value {0} is not associated with the category {1}. Associate it ?   
293
ConcordancesEditor_115                        = Add a new category
294
ConcordancesEditor_116                        = Proceed to annotation
295
ConcordancesEditor_12                         = <
296
ConcordancesEditor_13                         = >
297
ConcordancesEditor_14                         = >|
298
ConcordancesEditor_15                         = Category
299
ConcordancesEditor_16                         = &Keyword:
300
ConcordancesEditor_17                         = Keywords annotation
301
ConcordancesEditor_18                         = &Edit
302
ConcordancesEditor_19                         = Found {0} occurrences
303
ConcordancesEditor_2                          = Left context
304
ConcordancesEditor_20                         = Loading line informations...
305
ConcordancesEditor_21                         = Could not instanciate one of the corpus Knowledge repository: 
306
ConcordancesEditor_22                         = Affect
307
ConcordancesEditor_23                         = to
308
ConcordancesEditor_24                         = Delete
309
ConcordancesEditor_25                         = of
310
ConcordancesEditor_26                         = Project id {0} Corpus id {1} Text id {2}
311
ConcordancesEditor_27                         = BackToText: Text {0} is missing
312
ConcordancesEditor_28                         = the annotation
313
ConcordancesEditor_29                         = No page found... for
314
ConcordancesEditor_3                          = Keyword
315
ConcordancesEditor_30                         = BackToText: default edition is missing
316
ConcordancesEditor_31                         = =
317
ConcordancesEditor_32                         = Enter a value for an id
318
ConcordancesEditor_33                         = to
319
ConcordancesEditor_34                         = Opening the Concordance
320
ConcordancesEditor_35                         = selected lines
321
ConcordancesEditor_36                         = Annotating concordance selection...
322
ConcordancesEditor_37                         = Sorting reference column
323
ConcordancesEditor_38                         = Hide settings
324
ConcordancesEditor_39                         = Show settings
325
ConcordancesEditor_4                          = Right context
326
ConcordancesEditor_40                         = Error while annotating concordance selection: 
327
ConcordancesEditor_41                         = Sorting left context column
328
ConcordancesEditor_42                         = page lines
329
ConcordancesEditor_43                         = The {0} corpus has no default references: {1}
330
ConcordancesEditor_44                         = Annotating concordance page...
331
ConcordancesEditor_45                         = Sorting keyword column
332
ConcordancesEditor_46                         = Full text display failed: {0}
333
ConcordancesEditor_47                         = Error while annotating concordance page: 
334
ConcordancesEditor_48                         = Sorting right context column
335
ConcordancesEditor_49                         = all lines
336
ConcordancesEditor_5                          = Concordance of <{0}> in corpus {1}
337
ConcordancesEditor_50                         = Opening corpus edition
338
ConcordancesEditor_51                         = Annotating concordance...
339 274
ONE_RESULT                         = Done: one result.
340
ConcordancesEditor_53                         = Error while annotating concordance: 
341
ConcordancesEditor_54                         = Error while deleting annotation: 
342
ConcordancesEditor_55                         = Opening property dialog
343
ConcordancesEditor_56                         = Start computing concordance
344
ConcordancesEditor_57                         = Looking for TypedValue with id=
345
ConcordancesEditor_58                         = No value found with the {0} id.
346
ConcordancesEditor_59                         = AFFECT 
347
ConcordancesEditor_6                          = Sorting
348
ConcordancesEditor_60                         = \ to SELECTION=
349
ConcordancesEditor_61                         = Could not annotate the value '
350
ConcordancesEditor_62                         = '.\n on certain sequences. \n
351
ConcordancesEditor_63                         = \	- The sequence 
352
ConcordancesEditor_64                         = \ is overlapping with \n
353
ConcordancesEditor_65                         = \	\	- the end of a structure 
354
ConcordancesEditor_66                         = , at [
355
ConcordancesEditor_67                         = \ - 
356
ConcordancesEditor_68                         = ]\n
357
ConcordancesEditor_69                         = \	\	- the start of a structure 
358
ConcordancesEditor_7                          = CQP error:
359
ConcordancesEditor_70                         = , at [
360
ConcordancesEditor_71                         = \ - 
361
ConcordancesEditor_72                         = ]\n
362
ConcordancesEditor_73                         = About annotations
363
ConcordancesEditor_74                         = Error while affection annotation: 
364
ConcordancesEditor_75                         = Annotate
365
ConcordancesEditor_76                         = Save the annotations
366
ConcordancesEditor_77                         = Open the list of categories
367
ConcordancesEditor_78                         = class
368
ConcordancesEditor_79                         = Select a value among the list
369
ConcordancesEditor_8                          = The corpus has no text_id property
370
ConcordancesEditor_80                         = value=
371
ConcordancesEditor_81                         = Please enter the new type name
372
ConcordancesEditor_82                         = New category
373
ConcordancesEditor_83                         = with the category
374
ConcordancesEditor_84                         = with the category
375
ConcordancesEditor_85                         = OK
376
ConcordancesEditor_86                         = Confirm annotation affectation
377
ConcordancesEditor_87                         = You are about to annotate  
378
ConcordancesEditor_88                         = Delete selected line(s)
379
ConcordancesEditor_9                          = Error: could not retrieve line word id for edition 
380
ConcordancesEditor_99                         = List of categories
381
ConcordancesEditor_referenceColumn_text       = Reference
382
ConcordancesEditor_xpndtmNewExpanditem_text   = New ExpandItem
383
ConcordancesEditor_xpndtmNewExpanditem_text_1 = New ExpandItem
384
ConcordancesEditor_xpndtmNewExpanditem_text_2 = New ExpandItem
385
ConcordancesEditor_xpndtmNewParameters_text   = New Parameters
386 275

  
387 276
ConvertCorpus_0 = Corpus conversion failed.
388 277

  
......
554 443

  
555 444
DownloadJobHandler_0 = Downloading...
556 445

  
557
ERROR_WHILE_LOADING_CONCORDANCE_LINE = An error occurred while retrieving the concordance lines: {0}
558

  
559 446
ElementTreeLabelProvider_0 = ** Error: element not registered
560 447
ElementTreeLabelProvider_1 = ** Error: object is not an 'org.w3c.Element'
561 448

  
......
686 573
GenericMultiPageEditor_1 = The input {0} cannot be displayed.
687 574
GenericMultiPageEditor_3 = The number of editors ({0}) and number of inputs ({1}) must be equal.
688 575

  
689
GetConcordancesDialog_0  = ERROR_GetConcordancesDialog: {0}
690
GetConcordancesDialog_1  = Compute specificities
691
GetConcordancesDialog_13 = you must select a property.
692
GetConcordancesDialog_14 = Invalid property
693
GetConcordancesDialog_15 = you must select an property.
694
GetConcordancesDialog_4  = &Property:
695
GetConcordancesDialog_5  = &Left context size:
696
GetConcordancesDialog_6  = &Right context size:
697
GetConcordancesDialog_7  = &Reference:
698

  
699
GetConcordances_4        = Error while computing concordances: {0}
700

  
701 576
GraphicalLogger_0 = Error {0}
702 577

  
703 578
GroovyConsole_4 = \nConsole reports an Internal error.
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/ImportFormEditor.java (revision 516)
128 128
		setSite(site);
129 129
		setInput(input);
130 130
		
131
		String txmhome = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
131
		String txmhome = Toolbox.getTXMHOMEPATH();
132 132
		String filepath = "scripts/import/" + ((ImportFormEditorInput) input).getGroovyFile().getName(); //$NON-NLS-1$ 
133 133
		this.setGroovyscript(new File(txmhome, filepath));
134 134
		
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java (revision 516)
131 131
						if (LastOpened.getFile(ID) != null) {
132 132
							dialog.setFilterPath(LastOpened.getFolder(ID));
133 133
						} else {
134
							dialog.setFilterPath(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
134
							dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
135 135
						}
136 136
						if (dialog.open() != null) {
137 137
							File imgDirectory = new File(dialog.getFilterPath());
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/FrontXSLSection.java (revision 516)
94 94
					dialog.setFilterPath(LastOpened.getFolder(ID));
95 95
					dialog.setFileName(LastOpened.getFile(ID));
96 96
				} else {
97
					dialog.setFilterPath(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
97
					dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
98 98
				}
99 99
				if (dialog.open() != null) {
100 100
					xsltfile = new File(dialog.getFilterPath(), dialog.getFileName());
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 516)
1009 1009
		if (lastOpenedSrcDir != null) {
1010 1010
			dialog.setFilterPath(lastOpenedSrcDir);
1011 1011
		} else if (lastOpenedSrcDir != null) {
1012
			dialog.setFilterPath(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
1012
			dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
1013 1013
		} else
1014 1014
			dialog.setFilterPath(new File(TXMPreferences.getString(TBXPreferences.INSTALL_DIR, TBXPreferences.PREFERENCES_NODE), "corpora").getAbsolutePath()); //$NON-NLS-1$
1015 1015

  
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/MetadataPage.java (revision 516)
54 54
import org.eclipse.ui.forms.widgets.ScrolledForm;
55 55
import org.txm.Toolbox;
56 56
import org.txm.core.preferences.TBXPreferences;
57
import org.txm.core.preferences.TXMPreferences;
57 58
import org.txm.metadatas.Metadata;
58 59
import org.txm.metadatas.Metadatas;
59 60
import org.txm.metadatas.TextInjection;
......
487 488
		Metadatas temp = null;
488 489
		if (metadataFile.exists()) {//if their is a metadata file OK
489 490
			if (metadataFile.getName().endsWith(".csv")) { //$NON-NLS-1$
490
				String encoding = Toolbox.getParam(TBXPreferences.METADATA_ENCODING);
491
				String colsep = Toolbox.getParam(TBXPreferences.METADATA_COLSEPARATOR);
492
				String txtsep = Toolbox.getParam(TBXPreferences.METADATA_TXTSEPARATOR);
491
				String encoding = TXMPreferences.getString(TBXPreferences.METADATA_ENCODING, TBXPreferences.PREFERENCES_NODE);
492
				String colsep = TXMPreferences.getString(TBXPreferences.METADATA_COLSEPARATOR, TBXPreferences.PREFERENCES_NODE);
493
				String txtsep = TXMPreferences.getString(TBXPreferences.METADATA_TXTSEPARATOR, TBXPreferences.PREFERENCES_NODE);
493 494
				temp = new Metadatas(metadataFile, encoding, colsep, txtsep, 1);
494 495
			} else {
495 496
				temp = new Metadatas(metadataFile);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/input/AbstractSVGGraphicable.java (revision 516)
34 34
import org.eclipse.core.runtime.Path;
35 35
import org.txm.Toolbox;
36 36
import org.txm.core.preferences.TBXPreferences;
37
import org.txm.core.preferences.TXMPreferences;
37 38
import org.txm.rcp.RCPMessages;
38 39
import org.txm.rcp.editors.SVGGraphicable;
39 40
import org.txm.utils.logger.Log;
......
66 67
		if (this.path == null) {
67 68
			File tmp = null;
68 69
			try {
69
				String txmhome = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
70
				String txmhome = TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE);
70 71
				File resultDir = new File(txmhome, "results"); //$NON-NLS-1$
71 72
				resultDir.mkdirs();
72 73
				tmp = File.createTempFile("txm", ".svg", resultDir); //$NON-NLS-1$ //$NON-NLS-2$
tmp/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java (revision 516)
94 94

  
95 95
		// initialize the properties file default values store
96 96
		defaultValues = new Properties();
97
		String scriptRootDir = Toolbox.getParam(TBXPreferences.USER_TXM_HOME) + "/scripts"; //$NON-NLS-1$
97
		String scriptRootDir = Toolbox.getTXMHOMEPATH() + "/scripts"; //$NON-NLS-1$
98 98
		File currentRootDir = new File(scriptRootDir, "macro"); //$NON-NLS-1$
99 99

  
100 100
		propFile = new File(currentRootDir, this.script.replace(".", "/")+".properties");
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/ConvertCorpus.java (revision 516)
33 33
				.getShell();
34 34
		DirectoryDialog dialog = new DirectoryDialog(shell);
35 35

  
36
		dialog.setFilterPath(Toolbox.getParam(TBXPreferences.USER_TXM_HOME));
36
		dialog.setFilterPath(Toolbox.getTXMHOMEPATH());
37 37
		String path = dialog.open();
38 38

  
39
		final File corpora = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME),
39
		final File corpora = new File(Toolbox.getTXMHOMEPATH(),
40 40
				"corpora"); //$NON-NLS-1$
41 41
		final File indir = new File(path);
42 42
		final File outdir = new File(corpora, indir.getName() + 6);
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java (revision 516)
42 42
	
43 43
	public static JobHandler update(final MainCorpus corpus) {
44 44
		
45
		String txmhome = Toolbox.getParam(TBXPreferences.USER_TXM_HOME);
45
		String txmhome = Toolbox.getTXMHOMEPATH();
46 46
		
47 47
		BaseParameters params = corpus.getBase().getBaseParameters();
48 48
		params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java (revision 516)
134 134
	public boolean loadBinaryCorpusArchive(final File zipFile) throws ExecutionException {
135 135

  
136 136
		String filename = zipFile.getName();
137
		final File corporaDir = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "corpora"); //$NON-NLS-1$
137
		final File corporaDir = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
138 138
		corporaDir.mkdir();
139 139

  
140 140
		if (!filename.endsWith(".txm") && !filename.endsWith(".zip")) { //$NON-NLS-1$ //$NON-NLS-2$
......
290 290
			return null; 
291 291
		}
292 292

  
293
		//File txmregistry = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "registry"); //$NON-NLS-1$
293
		//File txmregistry = new File(Toolbox.getTXMHOMEPATH(), "registry"); //$NON-NLS-1$
294 294
		//txmregistry.mkdir();
295
		File txmcorpora = new File(Toolbox.getParam(TBXPreferences.USER_TXM_HOME), "corpora"); //$NON-NLS-1$
295
		File txmcorpora = new File(Toolbox.getTXMHOMEPATH(), "corpora"); //$NON-NLS-1$
296 296
		txmcorpora.mkdir();
297 297

  
298 298
		Workspace w = org.txm.Toolbox.workspace;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff