Révision 3404

TXM/trunk/org.txm.libs.office/src/org/txm/libs/office/ReadODS.java (revision 3404)
42 42
	
43 43
	public ReadODS(File tableFile, String sheetname) throws Exception {
44 44
		
45
		Logger.getLogger(OdfXMLFactory.class.getName()).setLevel(Level.WARNING);
45 46
		spreadsheet = SpreadsheetDocument.loadDocument(tableFile);
46 47
		
47 48
		// the first access to the document causes a very long process
......
138 139
	}
139 140
	
140 141
	public static ArrayList<HashMap<String, String>> toHashMap(File inputFile, String sheetname) throws Exception {
142
		
143
		Logger.getLogger(OdfXMLFactory.class.getName()).setLevel(Level.WARNING);
144
		
141 145
		SpreadsheetDocument spreadsheet = SpreadsheetDocument.loadDocument(inputFile);
142 146
		
143 147
		// the first access to the document causes a very long process
......
193 197
	 */
194 198
	public static ArrayList<ArrayList<String>> toTable(File inputFile, String sheetname) throws Exception {
195 199
		
200
		Logger.getLogger(OdfXMLFactory.class.getName()).setLevel(Level.WARNING);
201
		
196 202
		SpreadsheetDocument spreadsheet = SpreadsheetDocument.loadDocument(inputFile);
197 203
		
198 204
		// the first access to the document causes a very long process
TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationManager.java (revision 3404)
58 58
		
59 59
		if (monitor != null) {
60 60
			monitor.beginTask(KRAnnotationCoreMessages.savingAnnotations, annots.size());
61
			monitor.setTaskName("writing annotations in XML-TXM files");
61
			monitor.setTaskName("Writing annotations in XML-TXM files");
62 62
		}
63 63
		
64 64
		AnnotationWriter writer = new AnnotationWriter(corpus);
TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationInjector.java (revision 3404)
13 13
import javax.xml.stream.XMLInputFactory;
14 14
import javax.xml.stream.XMLStreamException;
15 15

  
16
import org.eclipse.osgi.util.NLS;
16 17
import org.txm.Toolbox;
17 18
import org.txm.importer.StaxIdentityParser;
18 19
import org.txm.importer.ValidateXml;
......
331 332
								toDelete = true;
332 333
								// currentEndAnnotations.remove(a); // MAYBE NOT TO
333 334
								// DO THIS HERE ?
334
								if (debug)
335
									System.out.println(" force delete start annotation " + a);
335
								if (debug) {
336
									Log.finer(" force delete start annotation " + a);
337
								}
336 338
							}
337 339
							else { // update existing annotation, no need to store
338 340
									 // the end of annotation
339 341
								writeStartAnnotation(a);
340 342
								toDelete = true;
341 343
								if (debug) {
342
									System.out.println(" update annotation " + a);
344
									Log.finer(" update annotation " + a);
343 345
								}
344 346
								currentEndAnnotations = annotationsToAddByEndPos.get(a.getEnd());// EL
345 347
								// NO
......
349 351
								// System.out.println(" shall we need to change annotation attribute : "+a.getValue()+
350 352
								// " | currentEndAnnotations : "+currentEndAnnotations);
351 353
								if (currentEndAnnotations == null) {
352
									System.out.println("WARNING ERROR null pointer for end position of annotation " + a);
354
									Log.warning(NLS.bind("Error: null pointer for end position of annotation {0}.", a));
353 355
								}
354 356
								else {
355 357
									currentEndAnnotations.remove(a);
......
369 371
							if (a.getEnd() >= end) { // must write a
370 372
								if (!"#del".equals(a.getValue())) {
371 373
									if (debug) {
372
										System.out.println(" writing of start annotation " + a);
374
										Log.finer(NLS.bind(" writing of start annotation {0}.", a));
373 375
									}
374 376
									writeStartAnnotation(a);
375 377
									
......
377 379
								else {
378 380
									toDelete = true;
379 381
									if (debug) {
380
										System.out.println(" no writing of start annotation " + a);
382
										Log.finer(NLS.bind(" no writing of start annotation {0}.", a));
381 383
									}
382 384
									currentEndAnnotations = annotationsToAddByEndPos.get(a.getEnd());
383 385
									// System.out.println(" shall we need to change annotation attribute : "+a.getValue()+
384 386
									// " | currentEndAnnotations : "+currentEndAnnotations);
385 387
									if (currentEndAnnotations == null) {
386
										System.out.println("WARNING ERROR null pointer for end position of annotation " + a);
388
										Log.warning(NLS.bind("Error: null pointer for end position of annotation {0}.", a));
387 389
									}
388 390
									else {
389 391
										currentEndAnnotations.remove(a);
......
469 471
					// System.out.println("=============== End annot : "+a);
470 472
					if (!"#del".equals(a.getValue())) {
471 473
						if (debug) {
472
							System.out.println(" force write end annotation " + a);
474
							Log.finer(" force write end annotation " + a);
473 475
						}
474 476
						writeEndAnnotation(a);
475 477
					} /*
......
511 513
						// {
512 514
						toDelete = true;
513 515
						if (debug) {
514
							System.out.println(" force delete end annotation " + a);
516
							Log.finer(" force delete end annotation " + a);
515 517
						}
516 518
					}
517 519
					
TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/preferences/KRAnnotationPreferences.java (revision 3404)
37 37
		Preferences preferences = this.getDefaultPreferencesNode();
38 38
		preferences.putBoolean(UPDATE_EDITION, true);
39 39
		preferences.putBoolean(UPDATE_INDEXES, true);
40
		preferences.putBoolean(PRESERVE_ANNOTATIONS, true);
40
		preferences.putBoolean(PRESERVE_ANNOTATIONS, false);
41 41
	}
42 42
}
TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/storage/temporary/TemporaryAnnotationManager.java (revision 3404)
52 52
		properties.put("javax.persistence.jdbc.username", "SA");
53 53
		properties.put(PersistenceUnitProperties.DDL_GENERATION_MODE, "database");
54 54
		if (KRAnnotationPreferences.getInstance().getBoolean(KRAnnotationPreferences.PRESERVE_ANNOTATIONS)) {
55
			properties.put(PersistenceUnitProperties.DDL_GENERATION, "drop-and-create-tables"); // drop-and-create-tables to reset all
55
			properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-or-extend-tables"); // create&update table if needed, drop-and-create-tables to reset all
56 56
		}
57 57
		else {
58
			properties.put(PersistenceUnitProperties.DDL_GENERATION, "create-or-extend-tables"); // create&update table if needed, drop-and-create-tables to reset all
58
			properties.put(PersistenceUnitProperties.DDL_GENERATION, "drop-and-create-tables"); // drop-and-create-tables to reset all
59 59
		}
60 60
		
61 61
		if (Log.getLevel().intValue() < Level.INFO.intValue()) {
TXM/trunk/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/repository/SQLKnowledgeRepository.java (revision 3404)
148 148
			return true;
149 149
		}
150 150
		catch (Exception e) {
151
			System.out.println("Fail to get SQL connection with " + accessProperties + ", error=" + e);
151
			Log.warning(NLS.bind("Fail to get SQL connection with the {0} properties, error={1}", accessProperties, e));
152 152
		}
153 153
		isConnected = false;
154 154
		return false;
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/BuildAFMetadataMacro.groovy (revision 3404)
79 79
	
80 80
	lineRules.put("Type de notice", "Notice sujet");
81 81
	
82
	dateColumnsSelection.add("Date de diffusion");
83
	datePattern = "dd/MM/yyyy"
84
	
82 85
	columnsToCopy.put("Identifiant de la notice", ["id"] as String[])
83 86
	
84 87
	dateColumnsSelection.add("Date de diffusion");
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xml/pager.groovy (revision 3404)
315 315
							if (parser.getAttributeValue(null,"id") != null) {
316 316
								pagedWriter.writeElement("h3", parser.getAttributeValue(null,"id"))
317 317
							}
318
							
318 319
							if (enableCollapsibles && parser.getAttributeCount() > 2) {
319
								pagedWriter.writeStartElement("button", ["class":"collapsible", "onclick":"onCollapsibleClicked(this)"])
320
								pagedWriter.writeStartElement("button");
321
								pagedWriter.writeAttribute("class", "collapsible");
322
								pagedWriter.writeAttribute("onclick", "onCollapsibleClicked(this)");
320 323
								pagedWriter.writeCharacters("➕");
321 324
								pagedWriter.writeEndElement()
325
								pagedWriter.writeCharacters("\n")
322 326
							}
323 327
							pagedWriter.writeStartElement("table");
324
							if (enableCollapsibles && parser.getAttributeCount() > 2) pagedWriter.writeAttribute("class", "collapsiblecontent")
325 328
							for (int i = 0 ; i < parser.getAttributeCount() ; i++) {
326 329
								pagedWriter.writeStartElement("tr");
327 330
								pagedWriter.writeElement("td", parser.getAttributeLocalName(i));
328 331
								pagedWriter.writeElement("td", parser.getAttributeValue(i).toString());
329 332
								pagedWriter.writeEndElement();
330 333
							}
334
							if (enableCollapsibles && parser.getAttributeCount() > 2) {
335
								pagedWriter.writeAttribute("class", "transcription-table collapsiblecontent")
336
								pagedWriter.writeAttribute("style", "display:none;")
337
							} else {
338
								pagedWriter.writeAttribute("class", "transcription-table");
339
							}
340
							
331 341
							pagedWriter.writeEndElement() // table
332 342
							pagedWriter.writeEmptyElement("br")
333 343
							pagedWriter.writeCharacters("");
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/pager.groovy (revision 3404)
324 324
							writer.writeStartElement("table");
325 325
							if (enableCollapsibles && parser.getAttributeCount() > 2) {
326 326
								writer.writeAttribute("class", "transcription-table collapsiblecontent")
327
								writer.writeAttribute("style", "display:none;")
327 328
							} else {
328 329
								writer.writeAttribute("class", "transcription-table");
329 330
							}
......
509 510
								writer.writeStartElement("div");
510 511
								if (enableCollapsibles && metadataGroups.keySet().size() > 2) {
511 512
									writer.writeAttribute("class", "section-all-metadata collapsiblecontent")
513
									writer.writeAttribute("style", "display:none;")
512 514
								} else {
513 515
									writer.writeAttribute("class", "section-all-metadata");
514 516
								}
......
528 530
												writer.writeEndElement() // p
529 531
												writer.writeCharacters("\n")
530 532
											}
531
											writer.writeEndElement(); // p
533
											writer.writeEndElement(); // div
532 534
										} else { // 'metadata' and other groups
533 535
											writer.writeStartElement("ul")
534 536
											writer.writeAttribute("class", "section-"+groupName);
......
543 545
										}
544 546
									}
545 547
								}
546
								writer.writeEndElement(); // p
548
								writer.writeEndElement(); // div
547 549
								writer.writeCharacters("\n")
548 550
								writer.writeEmptyElement("hr")
549 551
							}
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/transcriber/TranscriberTokenizer.groovy (revision 3404)
178 178
			for (def word : words) {
179 179
				wordcount++;
180 180
				writer.writeStartElement(word_element_to_create);
181
				writeWordAttributes();// id
181
				writeWordAttributes(false);// id
182 182
				writer.writeCharacters(word);
183 183
				writer.writeEndElement();
184 184
				writer.writeCharacters("\n");
......
192 192
	/* (non-Javadoc)
193 193
	 * @see filters.Tokeniser.SimpleTokenizerXml#writeWordAttributes()
194 194
	 */
195
	protected writeWordAttributes() {
196
		super.writeWordAttributes()
195
	protected writeWordAttributes(boolean fromParser) {
196
		super.writeWordAttributes(fromParser)
197 197
		
198 198
		if (!retokenizedWordProperties.containsKey("audio")) writer.writeAttribute("audio", audio);
199 199
		if (!retokenizedWordProperties.containsKey("event")) writer.writeAttribute("event", event);
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/xtz/XTZDefaultPagerStep.groovy (revision 3404)
374 374
									pagedWriter.writeElement("h3", attributes["id"])
375 375
								}
376 376
							
377
								if (enableCollapsibles && attributes.keySet().size() > 2) {
378
									pagedWriter.writeStartElement("button", ["class":"collapsible", "onclick":"onCollapsibleClicked(this)"])
379
									pagedWriter.writeCharacters("➕");
380
									pagedWriter.writeEndElement()
381
									
382
									pagedWriter.writeStartElement("div", ["class":"collapsiblecontent"])
383
								}
377
							if (enableCollapsibles && parser.getAttributeCount() > 2) {
378
								pagedWriter.writeStartElement("button");
379
								pagedWriter.writeAttribute("class", "collapsible");
380
								pagedWriter.writeAttribute("onclick", "onCollapsibleClicked(this)");
381
								pagedWriter.writeCharacters("➕");
382
								pagedWriter.writeEndElement()
383
								pagedWriter.writeCharacters("\n")
384
							}
385
							pagedWriter.writeStartElement("table");
386
							if (enableCollapsibles && parser.getAttributeCount() > 2) {
387
								pagedWriter.writeAttribute("class", "collapsiblecontent")
388
								pagedWriter.writeAttribute("style", "display:none;")
389
							} else {
390
								pagedWriter.writeAttribute("class", "metadata");
391
							}
384 392
							
385
								pagedWriter.writeStartElement("table", ["class":"metadata"]);
386
							
387 393
								for (String k : attributes.keySet()) {
388 394
									if (k == "id") continue;
389 395
									if (k == "rend") continue;
......
395 401
									pagedWriter.writeEndElement() //tr
396 402
								}
397 403
								pagedWriter.writeEndElement() // table
398
								if (enableCollapsibles && attributes.keySet().size() > 2) {
399
									pagedWriter.writeEndElement() // div@class=collapsiblecontent
400
								}
404
								
401 405
								pagedWriter.writeEndElement() // p
402 406
								pagedWriter.writeCharacters("\n")
403 407
								break;
TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/editors/EditionPanel.java (revision 3404)
276 276
	public Object evaluate(String code) {
277 277
		
278 278
		if (Log.getLevel().intValue() <= Level.FINEST.intValue()) System.out.println(code);
279
		
279 280
		try {
280 281
			if (getBrowser() == null) return null;
281 282
			return getBrowser().evaluate(code);
......
295 296
			return getBrowser().execute(code);
296 297
		}
297 298
		catch (Exception e) {
298
			String error = e.getMessage();
299 299
			Log.severe("Browser execute error: " + e);
300 300
			Log.printStackTrace(e);
301 301
		}
......
812 812
	public void setURL(String url) {
813 813
		
814 814
		if (!this.browser.isDisposed()) {
815
			super.setURL(URLUtils.encodeURL(url));
815
			if ("webkit".equals(this.browser.getBrowserType())) {
816
				super.setURL(URLUtils.encodeURL(url));
817
			} else {
818
				super.setURL(url);
819
			}
816 820
		}
817 821
	}
818 822
	
......
1147 1151
	// this.currentEdition = edition;
1148 1152
	// }
1149 1153
	
1150
	static String SCRIPT01 = "var html = \"\";" + //$NON-NLS-1$
1154
	static String SCRIPT01 = 
1155
			"var html = \"\";" + //$NON-NLS-1$
1151 1156
			"if (typeof window.getSelection != \"undefined\") {" + // modern Web browsers //$NON-NLS-1$
1152
			"var sel = window.getSelection();" + //$NON-NLS-1$
1153
			"if (sel.rangeCount) {" + //$NON-NLS-1$
1154
			"var container = document.createElement(\"div\");" + //$NON-NLS-1$
1155
			"for (var i = 0, len = sel.rangeCount; i < len; ++i) {" + //$NON-NLS-1$
1156
			"container.appendChild(sel.getRangeAt(i).cloneContents());" + //$NON-NLS-1$
1157
			"}" + //$NON-NLS-1$
1158
			"html = container.innerHTML;" + //$NON-NLS-1$
1159
			"}" + //$NON-NLS-1$
1157
				"var sel = window.getSelection();" + //$NON-NLS-1$
1158
				"if (sel.rangeCount) {" + //$NON-NLS-1$
1159
					"var container = document.createElement(\"div\");" + //$NON-NLS-1$
1160
					"for (var i = 0, len = sel.rangeCount; i < len; ++i) {" + //$NON-NLS-1$
1161
						"container.appendChild(sel.getRangeAt(i).cloneContents());" + //$NON-NLS-1$
1162
					"}" + //$NON-NLS-1$
1163
					"html = container.innerHTML;" + //$NON-NLS-1$
1164
				"}" + //$NON-NLS-1$
1160 1165
			"} else if (typeof document.selection != \"undefined\") {" + // for IE < 11 //$NON-NLS-1$
1161
			"if (document.selection.type == \"Text\") {" + //$NON-NLS-1$
1162
			"html = document.selection.createRange().htmlText;" + //$NON-NLS-1$
1166
				"if (document.selection.type == \"Text\") {" + //$NON-NLS-1$
1167
					"html = document.selection.createRange().htmlText;" + //$NON-NLS-1$
1168
				"}" + //$NON-NLS-1$
1163 1169
			"}" + //$NON-NLS-1$
1164
			"}" + //$NON-NLS-1$
1165 1170
			"return html"; //$NON-NLS-1$
1166 1171
	
1167 1172
	public String getTextSelectionDOM() {
......
1429 1434
					
1430 1435
					@Override
1431 1436
					public boolean isEmpty() {
1432
						
1437
						if (EditionPanel.this.isDisposed()) return true;
1433 1438
						return EditionPanel.this.getTextSelection().length() == 0;
1434 1439
					}
1435 1440
					
1436 1441
					@Override
1437 1442
					public String getText() {
1438
						
1443
						if (EditionPanel.this.isDisposed()) return null;
1439 1444
						return EditionPanel.this.getTextSelection();
1440 1445
					}
1441 1446
					
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/SourceDirectoryPage.java (revision 3404)
9 9
import org.eclipse.swt.SWT;
10 10
import org.eclipse.swt.events.KeyEvent;
11 11
import org.eclipse.swt.events.KeyListener;
12
import org.eclipse.swt.events.ModifyEvent;
13
import org.eclipse.swt.events.ModifyListener;
14 12
import org.eclipse.swt.events.SelectionEvent;
15 13
import org.eclipse.swt.events.SelectionListener;
16
import org.eclipse.swt.graphics.Color;
17
import org.eclipse.swt.graphics.Device;
18 14
import org.eclipse.swt.layout.GridData;
19 15
import org.eclipse.swt.layout.GridLayout;
20 16
import org.eclipse.swt.widgets.Button;
21 17
import org.eclipse.swt.widgets.Composite;
22 18
import org.eclipse.swt.widgets.DirectoryDialog;
23
import org.eclipse.swt.widgets.Display;
24 19
import org.eclipse.swt.widgets.Label;
25 20
import org.eclipse.swt.widgets.Text;
26 21
import org.txm.Toolbox;
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/corpuswizard/ImportWizard.java (revision 3404)
6 6
import java.util.Locale;
7 7

  
8 8
import org.eclipse.core.resources.IProject;
9
import org.eclipse.core.resources.IWorkspace;
10 9
import org.eclipse.core.resources.ResourcesPlugin;
11
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
12
import org.eclipse.jface.dialogs.MessageDialog;
13 10
import org.eclipse.jface.viewers.IStructuredSelection;
14 11
import org.eclipse.jface.wizard.Wizard;
15 12
import org.eclipse.osgi.util.NLS;
......
18 15
import org.txm.Toolbox;
19 16
import org.txm.core.engines.Engine;
20 17
import org.txm.core.engines.EngineType;
21
import org.txm.core.preferences.TBXPreferences;
22
import org.txm.core.results.TXMResult;
23 18
import org.txm.objects.BaseOldParameters;
24
import org.txm.objects.EditionDefinition;
25 19
import org.txm.objects.Project;
26 20
import org.txm.rcp.messages.TXMUIMessages;
27 21
import org.txm.utils.LogMonitor;
28 22
import org.txm.utils.io.FileCopy;
29 23
import org.txm.utils.logger.Log;
30
import org.w3c.dom.Element;
31
import org.w3c.dom.NodeList;
32 24

  
33 25
public class ImportWizard extends Wizard implements INewWizard {
34 26
	
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties (revision 3404)
24 24

  
25 25
SourceDirectoryPage_0  = Select source directory
26 26
SourceDirectoryPage_1  = Sources
27
SourceDirectoryPage_10 = Corpus name
27
SourceDirectoryPage_10 = Corpus identifier
28 28
SourceDirectoryPage_11 = The ''{0}'' corpus will be replaced.
29 29
SourceDirectoryPage_12 = The ''{0}'' corpus import will be resumed or restarted.
30 30
SourceDirectoryPage_13 = The ''{0}'' corpus will be created.
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties (revision 3404)
18 18

  
19 19
SourceDirectoryPage_1 = Sources
20 20

  
21
SourceDirectoryPage_10 = Nom du corpus
21
SourceDirectoryPage_10 = Identifiant du corpus
22 22

  
23 23
SourceDirectoryPage_11 = Le corpus ''{0}'' sera remplacé.
24 24

  
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/utils/URLUtils.java (revision 3404)
3 3
import java.net.MalformedURLException;
4 4
import java.net.URL;
5 5
import java.net.URLEncoder;
6

  
6 7
import org.apache.commons.lang.StringUtils;
7 8

  
8 9
public class URLUtils {
9 10
	
11
	@SuppressWarnings("deprecation")
10 12
	public static String encodeURL(String url) {
11 13
		StringBuilder buffer = new StringBuilder();
12 14
		int begin = url.indexOf(":/");
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/commands/OpenBrowser.java (revision 3404)
48 48
import org.txm.rcp.editors.TXMBrowserEditor;
49 49
import org.txm.rcp.messages.TXMUIMessages;
50 50
import org.txm.rcp.swt.dialog.LastOpened;
51
import org.txm.rcp.utils.URLUtils;
52 51
import org.txm.utils.logger.Log;
53 52

  
54
// TODO: Auto-generated Javadoc
55 53
/**
56 54
 * Open the internal browser of TXM with a file @ author mdecorde.
57 55
 */
58
@SuppressWarnings("restriction")
59 56
public class OpenBrowser extends AbstractHandler {
60 57
	
61 58
	/** The Constant ID. */
......
186 183
			} else {
187 184
				url = new URL(filepath);
188 185
				
189
				url = URLUtils.encodeURL(url);
186
				//url = URLUtils.encodeURL(url);
190 187
			}
191 188
			
192 189
			
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/InfosSection.java (revision 3404)
2 2

  
3 3
import org.eclipse.osgi.util.NLS;
4 4
import org.eclipse.swt.SWT;
5
import org.eclipse.swt.graphics.Color;
6
import org.eclipse.swt.graphics.Device;
7 5
import org.eclipse.swt.widgets.Composite;
8
import org.eclipse.swt.widgets.Display;
9 6
import org.eclipse.swt.widgets.Label;
10 7
import org.eclipse.swt.widgets.Text;
11 8
import org.eclipse.ui.forms.events.ExpansionAdapter;
......
14 11
import org.eclipse.ui.forms.widgets.ScrolledForm;
15 12
import org.eclipse.ui.forms.widgets.TableWrapData;
16 13
import org.eclipse.ui.forms.widgets.TableWrapLayout;
17
import org.txm.objects.CorpusBuild;
18 14
import org.txm.objects.Project;
19 15
import org.txm.rcp.editors.imports.ImportFormEditor;
20 16
import org.txm.rcp.messages.TXMUIMessages;
21
import org.txm.utils.logger.Log;
22
import org.w3c.dom.Element;
23 17

  
24 18
public class InfosSection extends ImportEditorSection {
25 19
	
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 3404)
275 275
			Class<? extends ImportEditorSection> clazz = ImportModuleCustomization.getAdditionalSection(importName);
276 276
			
277 277
			try {
278
				Constructor<? extends ImportEditorSection> c = clazz.getConstructor(FormToolkit.class, ScrolledForm.class, Composite.class, int.class);
279
				additionalSection = c.newInstance(toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
278
				Constructor<? extends ImportEditorSection> c = clazz.getConstructor(ImportFormEditor.class, FormToolkit.class, ScrolledForm.class, Composite.class, int.class);
279
				additionalSection = c.newInstance(editor, toolkit, form, form.getBody(), ExpandableComposite.TITLE_BAR | ExpandableComposite.TWISTIE);
280 280
				return additionalSection.getSectionSize();
281 281
			}
282 282
			catch (Exception e) {
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/TXMBrowserEditor.java (revision 3404)
40 40
import org.eclipse.swt.widgets.Menu;
41 41
import org.eclipse.ui.internal.browser.BrowserViewer;
42 42
import org.eclipse.ui.internal.browser.WebBrowserEditor;
43
import org.eclipse.ui.part.Page;
44 43
import org.txm.rcp.messages.TXMUIMessages;
45 44

  
46 45
/**
......
50 49
 * 
51 50
 * @author mdecorde.
52 51
 */
53
@SuppressWarnings("restriction")
54 52
public class TXMBrowserEditor extends WebBrowserEditor {
55 53
	
56 54
	/** The Constant ID. */
57 55
	public final static String ID = TXMBrowserEditor.class.getName(); //$NON-NLS-1$
58 56

  
59
	private ProgressListener progresslistener;
60
	
61 57
	/**
62
	 * Instantiates a new txm browser.
58
	 * Instantiates a new TXM browser.
63 59
	 */
64 60
	public TXMBrowserEditor() {
65 61
		
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 3404)
312 312
		}
313 313
		else {
314 314
			return (NLS.bind(TXMUIMessages.prettyVersionP0P1,
315
					version.getMajor() + "." + version.getMinor() + "." + version.getMicro(), "update " + txm_date + " - installer " + build_date));
315
					version.getMajor() + "." + version.getMinor() + "." + version.getMicro(), "install " + build_date + " - update " + txm_date));
316 316
		}
317 317
	}
318 318
	
TXM/trunk/org.txm.core/src/java/org/txm/metadatas/Metadatas.java (revision 3404)
228 228
		for (int i = 1; i < headers.size(); i++) {
229 229
			if (headers.get(i).length() == 0) {
230 230
				//headers.set(i, "noname");
231
				System.out.println("Warning: the " + (i + 1) + "th column name is empty");
231
				Log.finer("Warning: the " + (i + 1) + "th column name is empty and will be ignored.");
232 232
				continue;
233 233
			}
234 234
			// if(!headers[i].equals("id"))// the first
......
265 265
			}
266 266
			// write the other attributes
267 267
			for (int j : indexes) {
268
				if (headers.get(j).equals("id")) {
268
				if (headers.get(j).equals("id") || headers.get(j).length() == 0) {
269 269
					continue;
270 270
				}
271 271
				writer.writeStartElement("entry");
TXM/trunk/org.txm.core/res/org/txm/js/collapsible.js (revision 3404)
10 10
	node.textContent="➕"
11 11
    } else {
12 12
      content.style.display = "block";
13
node.textContent="➖"
13
      node.textContent="➖"
14 14
    }
15 15
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/URSAnnotationReIndexer.java (revision 3404)
8 8
import java.util.Comparator;
9 9
import java.util.List;
10 10

  
11
import org.eclipse.osgi.util.NLS;
11 12
import org.txm.Toolbox;
12 13
import org.txm.searchengine.cqp.AbstractCqiClient;
13 14
import org.txm.searchengine.cqp.CQPSearchEngine;
......
65 66
		for (int i = 0; i < corpusSize; i++) {
66 67
			int idx = text.indexOf(strs[i], isearch);
67 68
			if (idx < 0) {
68
				System.out.println("Error: cannot find word='" + strs[i] + "' (word with position in CQP corpus=" + positions[i] + ") in text with current carret=" + isearch + ". Aborting.");
69
				Log.finer("Error: cannot find word='" + strs[i] + "' (word with position in CQP corpus=" + positions[i] + ") in text with current carret=" + isearch + ". Aborting.");
69 70
				
70
				System.out.println("Current text slice is (-20, +20 characters): ");
71
				System.out.println("* before: " + text.substring(Math.max(0, isearch - 20), Math.min(isearch + 20, isearch)));
72
				System.out.println("* after: " + text.substring(isearch, Math.min(isearch + 20, text.length() - 1)));
71
				Log.finer("Current text slice is (-20, +20 characters): ");
72
				Log.finer("* before: " + text.substring(Math.max(0, isearch - 20), Math.min(isearch + 20, isearch)));
73
				Log.finer("* after: " + text.substring(isearch, Math.min(isearch + 20, text.length() - 1)));
73 74
				
74 75
				return false;
75 76
			}
......
77 78
			isearch = idx + strs[i].length();
78 79
		}
79 80
		
80
		if (debug) System.out.println(Arrays.toString(positions));
81
		if (debug) System.out.println(Arrays.toString(positionsCorrespondances));
81
		if (debug) Log.finer(Arrays.toString(positions));
82
		if (debug) Log.finer(Arrays.toString(positionsCorrespondances));
82 83
		
83 84
		isearch = 0;
84 85
		ArrayList<Unite> unites = analecCorpus.getToutesUnites();
85
		if (debug) System.out.println("units not-sorted: ");
86
		if (debug) Log.finer("units not-sorted: ");
86 87
		if (debug) printUnits(unites);
87 88
		Collections.sort(unites, new Comparator<Unite>() {
88 89
			
......
93 94
				else return d;
94 95
			}
95 96
		});
96
		if (debug) System.out.println("units sorted: ");
97
		if (debug) Log.finer("units sorted: ");
97 98
		if (debug) printUnits(unites);
98 99
		
99 100
		int iunite = 0;
100 101
		for (Unite unite : unites) {
101
			if (debug) System.out.println("Updating ");
102
			if (debug) Log.finer("Updating ");
102 103
			if (debug) printUnite(unite);
103 104
			int start = unite.getDeb();
104 105
			int end = unite.getFin();
......
108 109
			int i = 0; // or not : unites are sorted by start position, we don't need to browse all words \o/
109 110
			for (; i < positionsCorrespondances.length; i++) {
110 111
				if (startFound && endFound) break; // no need to go further
111
				if (debug) System.out.println("i=" + i + " positionsCorrespondances[i]=" + positionsCorrespondances[i]);
112
				if (debug) Log.finer("i=" + i + " positionsCorrespondances[i]=" + positionsCorrespondances[i]);
112 113
				if (!startFound && start < positionsCorrespondances[i]) {
113 114
					unite.setDeb(i - 1);
114 115
					startFound = true;
......
130 131
			
131 132
			if (!(startFound && endFound)) {
132 133
				String s = "Error: cannot find words positions for unite of type=" + unite.getType() + " and unit carret positions=[" + start + ", " + end + "]. Aborting";
133
				System.out.println(s);
134
				Log.finer(s);
134 135
				
135
				System.out.println("5 last found units are: ");
136
				Log.finer("5 last found units are: ");
136 137
				for (int j = 4; j >= 0; j--) {
137 138
					if (iunite - j >= 0) {
138 139
						printUnite(unites.get(iunite - j));
......
143 144
			// if (i > 0) i--; // restart at previous word
144 145
			iunite++;
145 146
		}
146
		if (debug) System.out.println("units updated: ");
147
		if (debug) Log.finer("units updated: ");
147 148
		if (debug) printUnits(unites);
148 149
		return true;
149 150
	}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/imports/DOMURSAnnotationsImporter.java (revision 3404)
7 7
import javax.xml.stream.XMLInputFactory;
8 8

  
9 9
import org.eclipse.core.runtime.IProgressMonitor;
10
import org.eclipse.osgi.util.NLS;
10 11
import org.txm.importer.PersonalNamespaceContext;
11 12
import org.txm.searchengine.cqp.AbstractCqiClient;
12 13
import org.txm.searchengine.cqp.CQPSearchEngine;
13 14
import org.txm.searchengine.cqp.corpus.MainCorpus;
15
import org.txm.utils.logger.Log;
14 16
import org.txm.utils.xml.DomUtils;
15 17
import org.w3c.dom.Document;
16 18
import org.w3c.dom.Element;
......
30 32
	protected static PersonalNamespaceContext Nscontext = new PersonalNamespaceContext();
31 33

  
32 34
	public DOMURSAnnotationsImporter(IProgressMonitor monitor, File outputDirectory, MainCorpus mainCorpus, Corpus analecCorpus, Vue analecVue) {
35
		
33 36
		this.annotationsDirectory = outputDirectory;
34 37
		this.mainCorpus = mainCorpus;
35 38
		this.analecCorpus = analecCorpus;
......
38 41
	}
39 42

  
40 43
	public boolean process() throws Exception {
44
		
41 45
		if (!annotationsDirectory.exists()) return false;
42 46
		if (!annotationsDirectory.isDirectory()) return false;
43 47

  
......
48 52
			}
49 53
		});
50 54

  
51
		if (ursFiles == null) {
52
			System.out.println("No XML files found in "+annotationsDirectory);
55
		if (ursFiles == null || ursFiles.length == 0) {
56
			Log.warning("No XML files found in "+annotationsDirectory);
53 57
			return false;
54 58
		}
55
		if (ursFiles.length == 0) {
56
			System.out.println("No XML files found in "+annotationsDirectory);
57
			return false;
58
		}
59 59

  
60 60
		factory = XMLInputFactory.newInstance();
61 61

  
62 62
		for (File xmlAnalec : ursFiles) {
63
			
63 64
			String textid = xmlAnalec.getName().substring(0, xmlAnalec.getName().length() - 8);
64
			System.out.println("Processing text: "+textid);
65

  
65
			Log.info("Processing text: "+textid);
66 66
			processText(textid, xmlAnalec);
67 67
		}
68 68

  
......
157 157
			String id = fsElement.getAttribute("id");
158 158

  
159 159
			if (elementProperties.containsKey(id)) {
160
				System.out.println("Warning: duplicated fsElement id: "+id);
160
				Log.warning(NLS.bind("Warning: duplicated fsElement id: {0}.", id));
161 161
			} else {
162 162
				HashMap<String, String> properties = new HashMap<String, String>();
163 163
				elementProperties.put(id, properties);
......
166 166
					Element fElement = (Element)fElements.item(iChild2);
167 167
					String name = fElement.getAttribute("name");
168 168
					if (properties.containsKey(name)) {
169
						System.out.println("Warning: duplicated fElement name: "+name+" in "+id+" fsElement.");
169
						Log.warning(NLS.bind("Warning: duplicated fElement name: {0} in {1} fsElement.", name, id));
170 170
					} else {
171 171
						properties.put(name, fElement.getTextContent().trim());
172 172
					}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/imports/URSAnnotationsImporter.java (revision 3404)
16 16
import javax.xml.stream.XMLStreamReader;
17 17

  
18 18
import org.eclipse.core.runtime.IProgressMonitor;
19
import org.eclipse.osgi.util.NLS;
19 20
import org.txm.annotation.urs.URSCorpora;
20 21
import org.txm.importer.PersonalNamespaceContext;
21 22
import org.txm.searchengine.cqp.AbstractCqiClient;
......
24 25
import org.txm.searchengine.cqp.corpus.Subcorpus;
25 26
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
26 27
import org.txm.utils.ConsoleProgressBar;
28
import org.txm.utils.logger.Log;
27 29

  
28 30
import visuAnalec.donnees.Corpus;
29 31
import visuAnalec.donnees.Structure;
......
61 63
	}
62 64
	
63 65
	public boolean process() throws Exception {
66
		
64 67
		if (!annotationsDirectory.exists()) {
65
			System.out.println("Error: annotationsDirectory does not exist: " + annotationsDirectory.getAbsolutePath());
68
			Log.warning(NLS.bind("Error: annotationsDirectory does not exist: {0}.", annotationsDirectory.getAbsolutePath()));
66 69
			return false;
67 70
		}
68 71
		if (!annotationsDirectory.isDirectory()) {
69
			System.out.println("Error: annotationsDirectory is not a directory: " + annotationsDirectory.getAbsolutePath());
72
			Log.warning(NLS.bind("Error: annotationsDirectory is not a directory: {0}.", annotationsDirectory.getAbsolutePath()));
70 73
			return false;
71 74
		}
72 75
		if (!aamFile.exists()) {
73
			System.out.println("Warning: aamFile does not exist: " + aamFile.getAbsolutePath());
76
			Log.warning(NLS.bind("Warning: aamFile does not exist: {0}.", aamFile.getAbsolutePath()));
74 77
		}
75 78
		else {
76 79
			
77 80
			if (!FichiersGlozz.importerModeleGlozz(analecCorpus, aamFile)) {
78
				System.out.println("Error while importing Glozz model: " + aamFile);
81
				Log.warning(NLS.bind("Error while importing Glozz model: {0}", aamFile));
79 82
				return false;
80 83
			}
81 84
		}
......
87 90
			}
88 91
		});
89 92
		
90
		if (ursFiles == null) {
91
			System.out.println("No XML files found in " + annotationsDirectory);
93
		if (ursFiles == null || ursFiles.length == 0) {
94
			Log.warning(NLS.bind("No XML files found in {0}.", annotationsDirectory));
92 95
			return false;
93 96
		}
94
		if (ursFiles.length == 0) {
95
			System.out.println("No XML files found in " + annotationsDirectory);
96
			return false;
97
		}
98 97
		Arrays.sort(ursFiles);
99 98
		
100 99
		factory = XMLInputFactory.newInstance();
......
102 101
		
103 102
		List<Integer> all_result_summary = Arrays.asList(0, 0, 0, 0, 0, 0, 0, 0);
104 103
		
105
		if (monitor != null) monitor.subTask("Processing " + ursFiles.length + " texts...");
104
		if (monitor != null) monitor.subTask(NLS.bind("Processing {0} text(s)...", ursFiles.length));
106 105
		for (File xmlTXMFile : ursFiles) {
107 106
			String textid = xmlTXMFile.getName().substring(0, xmlTXMFile.getName().length() - 8);
108
			System.out.println("Processing text: " + textid);
107
			Log.warning(NLS.bind("Processing text: {0}.", textid));
109 108
			if (cqpTextIds.contains(textid)) {
110
				if (monitor != null) monitor.subTask("Processing " + textid + " text...");
109
				if (monitor != null) monitor.subTask(NLS.bind("Processing the {0} text...", textid));
111 110
				// N unit, N unit error, N unit no match error, N unit too much match error, N Relation, N Relation error, N Schema, N Schema error
112 111
				List<Integer> result_summary = processText(textid, xmlTXMFile);
113 112
				
114
				System.out.println(textid + " import report: ");
115
				System.out.println(" N Units added: " + result_summary.get(0));
116
				System.out.println(" N Units error: " + result_summary.get(1));
117
				System.out.println(" N Units no match error: " + result_summary.get(2));
118
				System.out.println(" N Units too much match error: " + result_summary.get(3));
119
				System.out.println(" N Relations added: " + result_summary.get(4));
120
				System.out.println(" N Relations error: " + result_summary.get(5));
121
				System.out.println(" N Schemas added: " + result_summary.get(6));
122
				System.out.println(" N Schemas error: " + result_summary.get(7));
113
				Log.info(textid + " import report: ");
114
				Log.info(" N Units added: " + result_summary.get(0));
115
				Log.info(" N Units error: " + result_summary.get(1));
116
				Log.info(" N Units no match error: " + result_summary.get(2));
117
				Log.info(" N Units too much match error: " + result_summary.get(3));
118
				Log.info(" N Relations added: " + result_summary.get(4));
119
				Log.info(" N Relations error: " + result_summary.get(5));
120
				Log.info(" N Schemas added: " + result_summary.get(6));
121
				Log.info(" N Schemas error: " + result_summary.get(7));
123 122
				
124
				for (int i = 0; i < all_result_summary.size(); i++)
123
				for (int i = 0; i < all_result_summary.size(); i++) {
125 124
					all_result_summary.set(i, all_result_summary.get(i) + result_summary.get(i));
126
				
125
				}
127 126
			}
128 127
			else {
129
				System.out.println("Warning: cannot found text with ID=" + textid + " in current CQP corpus.");
128
				Log.warning(NLS.bind("Warning: cannot found text with ID={0} in current CQP corpus.", textid));
130 129
			}
131 130
			
132 131
			if (monitor != null && monitor.isCanceled()) {
......
139 138
			vue.retablirVueParDefaut();
140 139
		}
141 140
		
142
		System.out.println("Final import report: ");
143
		System.out.println(" N Units added: " + all_result_summary.get(0));
144
		System.out.println(" N Units error: " + all_result_summary.get(1));
145
		System.out.println(" N Units no match error: " + all_result_summary.get(2));
146
		System.out.println(" N Units too much match error: " + all_result_summary.get(3));
147
		System.out.println(" N Relations added: " + all_result_summary.get(4));
148
		System.out.println(" N Relations error: " + all_result_summary.get(5));
149
		System.out.println(" N Schemas added: " + all_result_summary.get(6));
150
		System.out.println(" N Schemas error: " + all_result_summary.get(7));
141
		Log.info("Final import report: ");
142
		Log.info(" N Units added: " + all_result_summary.get(0));
143
		Log.info(" N Units error: " + all_result_summary.get(1));
144
		Log.info(" N Units no match error: " + all_result_summary.get(2));
145
		Log.info(" N Units too much match error: " + all_result_summary.get(3));
146
		Log.info(" N Relations added: " + all_result_summary.get(4));
147
		Log.info(" N Relations error: " + all_result_summary.get(5));
148
		Log.info(" N Schemas added: " + all_result_summary.get(6));
149
		Log.info(" N Schemas error: " + all_result_summary.get(7));
151 150
		
152 151
		return true;
153 152
	}
......
237 236
				if (start < 0) {
238 237
					nUnitsError++;
239 238
					if (start == -1) {
240
						System.out.println("WARNING: no position found word id = " + deb);
239
						Log.warning(NLS.bind("WARNING: no position found word id = {0}.", deb));
241 240
						nUnitsNoMatchError++;
242 241
					}
243 242
					else {
244
						System.out.println("WARNING: too many positions found for word id = " + deb);
243
						Log.warning(NLS.bind("WARNING: too many positions found for word id = {0}.", deb));
245 244
						nUnitsTooMuchMatchError++;
246 245
					}
247 246
				}
248 247
				else if (end < 0) {
249 248
					nUnitsError++;
250 249
					if (end == -1) {
251
						System.out.println("WARNING: no position found word id = " + fin);
250
						Log.warning(NLS.bind("WARNING: no position found word id = {0}.", fin));
252 251
						nUnitsNoMatchError++;
253 252
					}
254 253
					else {
255
						System.out.println("WARNING: too many positions found for word id = " + fin);
254
						Log.warning(NLS.bind("WARNING: too many positions found for word id = {0}.", fin));
256 255
						nUnitsTooMuchMatchError++;
257 256
					}
258 257
				}
......
273 272
				}
274 273
			}
275 274
			else {
276
				System.out.println("Warning no properties found for element id=" + id + " and ana=" + ana);
275
				Log.warning(NLS.bind("Warning no properties found for element id={0} and ana={1}.", id, ana));
277 276
			}
278 277
		}
279 278
		cpb.done();
......
312 311
						nRelationsAdded++;
313 312
					}
314 313
					else {
315
						System.out.println("ERROR: relation element not found " + Arrays.toString(wordsref));
314
						Log.warning(NLS.bind("ERROR: relation element not found {0}.", Arrays.toString(wordsref)));
316 315
						nRelationsError++;
317 316
					}
318 317
				}
......
321 320
				}
322 321
			}
323 322
			else {
324
				System.out.println("Warning no properties found for element id=" + id);
323
				Log.warning(NLS.bind("Warning no properties found for element id={0}", id));
325 324
			}
326 325
		}
327 326
		cpb.done();
......
347 346
							schema.ajouter(unite);
348 347
						}
349 348
						else {
350
							System.out.println("Warning: missing unit id: " + unitid);
349
							Log.warning(NLS.bind("Warning: missing unit id: {0}.", unitid));
351 350
							nSchemaError++;
352 351
						}
353 352
					}
......
363 362
					nSchemaAdded++;
364 363
				}
365 364
				catch (Exception e) {
366
					System.out.println("Error while creating schema with id=" + id);
365
					Log.warning(NLS.bind("Error while creating schema with id={0}", id));
367 366
				}
368 367
			}
369 368
			else {
370
				System.out.println("Warning no properties found for element id=" + id);
369
				Log.warning(NLS.bind("Warning no properties found for element id={0}.", id));
371 370
			}
372 371
		}
373 372
		cpb.done();
......
392 391
		int processMode = 0; // 0 nothing, 1 elements 2 properties
393 392
		
394 393
		if (!goToStandOff(parser)) {
395
			System.out.println("Error: cannot find the 'standOff' element in " + xmlTXMFile);
394
			Log.warning(NLS.bind("Error: cannot find the 'standOff' element in {0}.", xmlTXMFile));
396 395
			return false;
397 396
		}
398 397
		String localname = null;
......
408 407
							processMode = 1;
409 408
						}
410 409
						else {
411
							System.out.println("Warning found " + localname + " without 'type' and 'n' attribute");
410
							Log.warning(NLS.bind("Warning found {0} without 'type' and 'n' attribute", localname));
412 411
							processMode = 0;
413 412
						}
414 413
					}
......
442 441
					else if (processMode == 2) {
443 442
						if (localname.equals("fs")) {
444 443
							currentAna = parser.getAttributeValue(null, "id");
445
							if (elementProperties.get(currentAna) != null) System.out.println("WARNING: duplicated element properties: " + currentAna);
444
							if (elementProperties.get(currentAna) != null) Log.warning(NLS.bind("WARNING: duplicated element properties: {0}.", currentAna));
446 445
							elementProperties.put(currentAna, new HashMap<String, String>());
447 446
						}
448 447
						else if (localname.equals("f")) {
......
517 516
	private void registerUnite(String id, String ana, String type, String from, String to) {
518 517
		String[] data = { ana.substring(1), type, from.substring(5), to.substring(5) };
519 518
		if (unites.containsKey(id)) {
520
			System.out.println("Warning: duplicated Unite id: " + id);
519
			Log.warning(NLS.bind("Warning: duplicated Unite id: {0}.", id));
521 520
		}
522 521
		else {
523 522
			unites.put(id, data);
......
529 528
	private void registerRelation(String id, String ana, String type, String target) {
530 529
		String[] data = { ana.substring(1), type, target };
531 530
		if (relations.containsKey(id)) {
532
			System.out.println("Warning: duplicated Relation id: " + id);
531
			Log.warning(NLS.bind("Warning: duplicated Relation id: {0}.", id));
533 532
		}
534 533
		else {
535 534
			relations.put(id, data);
......
542 541
		String[] data = { ana.substring(1), type, target };
543 542
		// System.out.println("R schema: "+id+" : "+Arrays.toString(data));
544 543
		if (schemas.containsKey(id)) {
545
			System.out.println("Warning: duplicated Schema id: " + id);
544
			Log.warning(NLS.bind("Warning: duplicated Schema id: {0}.", id));
546 545
		}
547 546
		else {
548 547
			schemas.put(id, data);
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/SaveVue.java (revision 3404)
10 10
import org.txm.annotation.urs.Messages;
11 11
import org.txm.rcp.views.corpora.CorporaView;
12 12
import org.txm.searchengine.cqp.corpus.MainCorpus;
13
import org.txm.utils.logger.Log;
13 14

  
14 15
import visuAnalec.donnees.Corpus;
15 16
import visuAnalec.fichiers.FichiersJava;
......
29 30

  
30 31
		Object first = CorporaView.getFirstSelectedObject();
31 32
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
32
			System.out.println(NLS.bind(Messages.SaveVue_0, first));
33
			Log.warning(NLS.bind(Messages.SaveVue_0, first));
33 34
			return null;
34 35
		}
35 36
		
......
38 39

  
39 40
		File binaryCorpusDirectory = mainCorpus.getProjectDirectory();
40 41
		File fichierVue = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getID()+".ecv"); //$NON-NLS-1$ //$NON-NLS-2$
41
		System.out.println(NLS.bind(Messages.SaveVue_3, corpus, fichierVue));
42
		Log.info(NLS.bind(Messages.SaveVue_3, corpus, fichierVue));
42 43

  
43 44
		if (!FichiersJava.enregistrerCorpus(corpus, fichierVue)) {
44
			System.out.println(Messages.SaveVue_5);
45
			Log.warning(Messages.SaveVue_5);
45 46
			return null;
46 47
		}
47 48

  
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/SaveStructure.java (revision 3404)
10 10
import org.txm.annotation.urs.Messages;
11 11
import org.txm.rcp.views.corpora.CorporaView;
12 12
import org.txm.searchengine.cqp.corpus.MainCorpus;
13
import org.txm.utils.logger.Log;
13 14

  
14 15
import visuAnalec.donnees.Corpus;
15 16
import visuAnalec.fichiers.FichiersJava;
......
17 18
public class SaveStructure  extends AbstractHandler {
18 19

  
19 20
	/** The ID. */
20
	public static String ID = "org.txm.annotation.urs.commands.LoadAnnotationStructure"; //$NON-NLS-1$
21
	public static String ID = SaveStructure.class.getSimpleName();
21 22
	/** The selection. */
22 23

  
23 24
	/* (non-Javadoc)
......
28 29

  
29 30
		Object first = CorporaView.getFirstSelectedObject();
30 31
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
31
			System.out.println(NLS.bind(Messages.SaveStructure_0, first));
32
			Log.warning(NLS.bind(Messages.SaveStructure_0, first));
32 33
			return null;
33 34
		}
34 35
		
......
41 42

  
42 43
		File binaryCorpusDirectory = mainCorpus.getProjectDirectory();
43 44
		File fichierStructure = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getID()+".ecs"); //$NON-NLS-1$ //$NON-NLS-2$
44
		System.out.println(NLS.bind(Messages.SaveStructure_3, corpus, fichierStructure));
45
		Log.info(NLS.bind(Messages.SaveStructure_3, corpus, fichierStructure));
45 46

  
46 47
		if (!FichiersJava.enregistrerStructure(corpus, fichierStructure)) {
47
			System.out.println(Messages.SaveStructure_5);
48
			Log.warning(Messages.SaveStructure_5);
48 49
			return false;
49 50
		}
50 51

  
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/SaveCorpus.java (revision 3404)
16 16
import org.txm.rcp.TXMWindows;
17 17
import org.txm.rcp.views.corpora.CorporaView;
18 18
import org.txm.searchengine.cqp.corpus.MainCorpus;
19
import org.txm.utils.logger.Log;
19 20

  
20 21
import visuAnalec.donnees.Corpus;
21 22
import visuAnalec.fichiers.FichiersJava;
......
35 36

  
36 37
		Object first = CorporaView.getFirstSelectedObject();
37 38
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
38
			System.out.println(NLS.bind(Messages.SaveCorpus_0, first));
39
			Log.warning(NLS.bind(Messages.SaveCorpus_0, first));
39 40
			return null;
40 41
		}
41 42
		final MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.CQPCorpus)first).getMainCorpus();
......
48 49
		File binaryCorpusDirectory = mainCorpus.getProjectDirectory();
49 50
		File fichierCorpus = new File(binaryCorpusDirectory, "/analec/"+mainCorpus.getID()+".ec"); //$NON-NLS-1$ //$NON-NLS-2$
50 51
		Corpus corpus = URSCorpora.getCorpus(mainCorpus);
51
		System.out.println(NLS.bind(Messages.SaveCorpus_3, fichierCorpus));
52
		Log.info(NLS.bind(Messages.SaveCorpus_3, fichierCorpus));
52 53
		if (!URSCorpora.saveCorpus(mainCorpus)) {
53
			System.out.println(Messages.SaveCorpus_5);
54
			Log.warning(Messages.SaveCorpus_5);
54 55
			return false;
55 56
		}
56 57

  
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/LoadVue.java (revision 3404)
14 14
import org.txm.annotation.urs.Messages;
15 15
import org.txm.rcp.views.corpora.CorporaView;
16 16
import org.txm.searchengine.cqp.corpus.MainCorpus;
17
import org.txm.utils.logger.Log;
17 18

  
18 19
import visuAnalec.donnees.Corpus;
19 20
import visuAnalec.fichiers.FichiersJava;
......
34 35
		
35 36
		Object first = CorporaView.getFirstSelectedObject();
36 37
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
37
			System.out.println(NLS.bind(Messages.LoadVue_0, first));
38
			Log.warning(NLS.bind(Messages.LoadVue_0, first));
38 39
			return null;
39 40
		}
40 41
		
......
45 46
	}
46 47
	
47 48
	public boolean load(MainCorpus mainCorpus) {
48
		System.out.println(NLS.bind(Messages.LoadVue_1, mainCorpus.getName()));
49
		Log.info(NLS.bind(Messages.LoadVue_1, mainCorpus.getName()));
49 50
		Vue vue = URSCorpora.getVue(mainCorpus);
50 51
		if (!FichiersJava.ouvrirVue(vue)) {
51
			System.out.println(Messages.LoadVue_2);
52
			Log.warning(Messages.LoadVue_2);
52 53
			return false;
53 54
		}
54 55
		
55
		System.out.println(Messages.LoadVue_3);
56
		Log.info(Messages.LoadVue_3);
56 57
		return true;
57 58
	}
58 59
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/LoadStructure.java (revision 3404)
11 11
import org.txm.annotation.urs.Messages;
12 12
import org.txm.rcp.views.corpora.CorporaView;
13 13
import org.txm.searchengine.cqp.corpus.MainCorpus;
14
import org.txm.utils.logger.Log;
14 15

  
15 16
import visuAnalec.donnees.Corpus;
16 17
import visuAnalec.donnees.VisuStructure;
......
31 32
		
32 33
		Object first = CorporaView.getFirstSelectedObject();
33 34
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
34
			System.out.println(NLS.bind(Messages.LoadStructure_0, first));
35
			Log.warning(NLS.bind(Messages.LoadStructure_0, first));
35 36
			return null;
36 37
		}
37 38
		
......
47 48
	}
48 49
	
49 50
	public static boolean load(Corpus corpus) {
50
		System.out.println(NLS.bind(Messages.LoadStructure_1, corpus));
51
		Log.info(NLS.bind(Messages.LoadStructure_1, corpus));
51 52
		if (!FichiersJava.ouvrirStructure(corpus)) {
52
			System.out.println(Messages.LoadStructure_2);
53
			Log.warning(Messages.LoadStructure_2);
53 54
			return false;
54 55
		}
55
		System.out.println(Messages.LoadStructure_3);
56
		Log.info(Messages.LoadStructure_3);
56 57
		return true;
57 58
	}
58 59
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/OpenDemocratTools.java (revision 3404)
8 8
import org.eclipse.core.commands.ExecutionException;
9 9
import org.eclipse.jface.viewers.StructuredSelection;
10 10
import org.eclipse.jface.viewers.TreeViewer;
11
import org.eclipse.osgi.util.NLS;
11 12
import org.eclipse.ui.IWorkbenchPage;
12 13
import org.eclipse.ui.PartInitException;
13 14
import org.eclipse.ui.PlatformUI;
......
59 60
			}
60 61
			return false;
61 62
		} catch (PartInitException e1) {
62
			System.out.println("Part initialisation error: "+e1.getLocalizedMessage());
63
			Log.warning(NLS.bind("Part initialisation error: {0}.", e1.getLocalizedMessage()));
63 64
			Log.printStackTrace(e1);
64 65
		}
65 66
		return false;
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/RestoreAnnotations.java (revision 3404)
39 39

  
40 40
		Object first = CorporaView.getFirstSelectedObject();
41 41
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
42
			System.out.println(NLS.bind(Messages.SaveCorpus_0, first));
42
			Log.warning(NLS.bind(Messages.SaveCorpus_0, first));
43 43
			return null;
44 44
		}
45 45
		final MainCorpus mainCorpus = ((org.txm.searchengine.cqp.corpus.CQPCorpus)first).getMainCorpus();
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/SaveStructureAsGlozzModel.java (revision 3404)
8 8
import org.txm.annotation.urs.Messages;
9 9
import org.txm.rcp.views.corpora.CorporaView;
10 10
import org.txm.searchengine.cqp.corpus.MainCorpus;
11
import org.txm.utils.logger.Log;
11 12

  
12 13
import visuAnalec.donnees.Corpus;
13 14
import visuAnalec.fichiers.FichiersGlozz;
......
22 23

  
23 24
		Object first = CorporaView.getFirstSelectedObject();
24 25
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
25
			System.out.println(NLS.bind(Messages.SaveStructureAsGlozzModel_0, first));
26
			Log.warning(NLS.bind(Messages.SaveStructureAsGlozzModel_0, first));
26 27
			return null;
27 28
		}
28 29
		
......
35 36
//			return null;
36 37
//		}
37 38
		
38
		System.out.println(NLS.bind(Messages.SaveStructureAsGlozzModel_1, corpus));
39
		Log.info(NLS.bind(Messages.SaveStructureAsGlozzModel_1, corpus));
39 40

  
40 41
		if (!FichiersGlozz.exporterModeleGlozz(corpus.getStructure())) {
41
			System.out.println(Messages.SaveStructureAsGlozzModel_2);
42
			Log.warning(Messages.SaveStructureAsGlozzModel_2);
42 43
			return null;
43 44
		}
44 45

  
45
		System.out.println(Messages.SaveStructureAsGlozzModel_3);
46
		Log.info(Messages.SaveStructureAsGlozzModel_3);
46 47
		return null;
47 48
	}
48 49
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/LoadStructureFromGlozz.java (revision 3404)
12 12
import org.txm.rcp.swt.widget.parameters.ParametersDialog;
13 13
import org.txm.rcp.views.corpora.CorporaView;
14 14
import org.txm.searchengine.cqp.corpus.MainCorpus;
15
import org.txm.utils.logger.Log;
15 16

  
16 17
import visuAnalec.donnees.Corpus;
17 18
import visuAnalec.fichiers.FichiersGlozz;
......
29 30
		
30 31
		Object first = CorporaView.getFirstSelectedObject();
31 32
		if (!(first instanceof org.txm.searchengine.cqp.corpus.CQPCorpus)) {
32
			System.out.println(NLS.bind(Messages.LoadStructureFromGlozz_0, first));
33
			Log.warning(NLS.bind(Messages.LoadStructureFromGlozz_0, first));
33 34
			return null;
34 35
		}
35 36
		
......
43 44

  
44 45
		if (!ParametersDialog.open(this)) return null;
45 46

  
46
		System.out.println(NLS.bind(Messages.LoadStructureFromGlozz_1, mainCorpus));
47
		Log.info(NLS.bind(Messages.LoadStructureFromGlozz_1, mainCorpus));
47 48
		
48 49
		// END OF PARAMETERS
49 50
		load(aamfile, corpus);
......
52 53
	
53 54
	public static boolean load(File aamfile, Corpus corpus) {
54 55
		if (!(aamfile.exists() && aamfile.exists() && aamfile.exists())) {
55
			System.out.println(Messages.LoadStructureFromGlozz_2);
56
			Log.warning(Messages.LoadStructureFromGlozz_2);
56 57
			return false;
57 58
		}
58 59
		
59 60
		File fichierModele = aamfile;
60 61
		if (!FichiersGlozz.importerModeleGlozz(corpus, fichierModele)) {
61
			System.out.println(Messages.LoadStructureFromGlozz_3);
62
			Log.warning(Messages.LoadStructureFromGlozz_3);
62 63
			return false;
63 64
		}
64 65
		
65
		System.out.println(Messages.LoadStructureFromGlozz_4);
66
		Log.info(Messages.LoadStructureFromGlozz_4);
66 67
		return true;
67 68
	}
68 69
}
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitConcordanceToolbar.java (revision 3404)
594 594
			
595 595
		}
596 596
		else {
597
			System.out.println("Creation aborted."); //$NON-NLS-1$
597
			Log.info("Creation aborted.");
598 598
		}
599 599
	}
600 600
	
TXM/trunk/org.txm.analec.rcp/src/org/txm/annotation/urs/toolbar/UnitToolbar.java (revision 3404)
141 141
			maxCorpusPosition = maincorpus.getSize();
142 142
		}
143 143
		catch (Exception e) {
144
			System.out.println(NLS.bind(Messages.UnitToolbar_3, maincorpus, e.getLocalizedMessage()));
144
			Log.warning(NLS.bind(Messages.UnitToolbar_3, maincorpus, e.getLocalizedMessage()));
145 145
			Log.printStackTrace(e);
146 146
		}
147 147
		analecCorpus.addEventListener(this);
......
320 320
			
321 321
			@Override
322 322
			public void mouseDoubleClick(MouseEvent e) {
323
				if (debug) System.out.println("DOUBLE CLICK"); //$NON-NLS-1$
323
				if (debug) Log.finer("DOUBLE CLICK"); //$NON-NLS-1$
324 324
				dblClick = true;
325 325
				
326 326
				EditionPanel panel = editor.getEditionPanel(0);
......
344 344
			
345 345
			@Override
346 346
			public void mouseDown(MouseEvent e) {
347
				if (debug) System.out.println("MOUSE DOWN"); //$NON-NLS-1$
347
				if (debug) Log.finer("MOUSE DOWN"); //$NON-NLS-1$
348 348
				dblClick = false;
349 349
				t = e.time;
350 350
				x = e.x;
......
357 357
					dblClick = false;
358 358
					return; // stop right now ! :-o
359 359
				}
360
				if (debug) System.out.println("MOUSE UP"); //$NON-NLS-1$
360
				if (debug) Log.finer("MOUSE UP"); //$NON-NLS-1$
361 361
				EditionPanel panel = editor.getEditionPanel(0);
362 362
				if (panel == null) return;
363 363
				
......
374 374
				// filter click that are not a left simple click (no drag)
375 375
				// System.out.println("click count="+e.count+" button="+e.button+" time="+e.time+" diff="+(e.time-t)+" dist="+(Math.abs(e.x - x) + Math.abs(e.y - y)));
376 376
				if (e.count > 1) {
377
					if (debug) System.out.println(" DOUBLE CLICK"); //$NON-NLS-1$
377
					if (debug) Log.finer(" DOUBLE CLICK"); //$NON-NLS-1$
378 378
					// System.out.println("not a simple click");
379 379
					return;
380 380
				}
......
388 388
					String[] ids = panel.getWordSelection(); // may be null
389 389
					
390 390
					if (fixingAnnotationLimits == 3) { // fixing limit with a mouse drag an drop
391
						if (debug) System.out.println(" EDITING ANNOTATION POSITION mode=" + fixingAnnotationLimits); //$NON-NLS-1$
391
						if (debug) Log.finer(" EDITING ANNOTATION POSITION mode=" + fixingAnnotationLimits); //$NON-NLS-1$
392 392
						onFixingAnnotationLimits(ids);
393 393
						return;
394 394
					}
......
402 402
				}
403 403
				
404 404
				if (e.button != 1) {
405
					if (debug) System.out.println(" NO LEFT"); //$NON-NLS-1$
405
					if (debug) Log.finer(" NO LEFT"); //$NON-NLS-1$
406 406
					// System.out.println("not a left click");
407 407
					return;
408 408
				}
409 409
				if ((e.time - t) > 200) {
410
					if (debug) System.out.println(" LONG"); //$NON-NLS-1$
410
					if (debug) Log.finer(" LONG"); //$NON-NLS-1$
411 411
					// System.out.println("not a short click");
412 412
					return;
413 413
				}
......
415 415
				String[] ids = panel.getWordSelection(); // may be null
416 416
				
417 417
				if (fixingAnnotationLimits > 0) {
418
					if (debug) System.out.println(" EDITING ANNOTATION POSITION mode=" + fixingAnnotationLimits); //$NON-NLS-1$
418
					if (debug) Log.finer(" EDITING ANNOTATION POSITION mode=" + fixingAnnotationLimits); //$NON-NLS-1$
419 419
					onFixingAnnotationLimits(ids);
420 420
					return;
421 421
				}
422 422
				
423 423
				if (ids == null) { // clear selection
... Ce différentiel a été tronqué car il excède la taille maximale pouvant être affichée.

Formats disponibles : Unified diff