Révision 3825

TXM/trunk/bundles/org.txm.core/src/java/org/txm/core/messages/TXMCoreMessages.java (revision 3825)
100 100
	public static String corpusUpdateDoneInP0;
101 101
	
102 102
	public static String ToolboxStatesWorkspaceColonP0;
103

  
104
	public static String TXMWasNotCorrectlyClosedSeeTheP0ReportFile;
103 105
	
104 106
	public static String binaryDirectoryP0NotFound;
105 107
	
......
349 351
	
350 352
	public static String computingParentsOfP0;
351 353

  
354
	public static String ErrorToolboxIsNotCorrectlyInitializedAborting;
355

  
352 356
	public static String ErrorWhileComputingP1DbldotP1;
353 357

  
358
	public static String ErrorWhileStartingEngines;
359

  
360
	public static String ErrorWhileStartingEnginesOfTheP0EnginesManager;
361

  
362
	public static String ErrorWorkspaceNotUpdatedIsNull;
363

  
364
	public static String ExceptionWhileInstallingExtensionIsP0;
365

  
354 366
	public static String FailedToCallTheP0HyperlinkedCommandWithP1AndTheP2Parameters;
355 367

  
356 368
	public static String FailedToOpenTheP0Editor;
357 369

  
370
	public static String FailToInstallExtensionP0FilesInP1;
371

  
372
	public static String InitializingToolbox;
373

  
358 374
	public static String P0DblDotP1;
375

  
376
	public static String WarningWorkspaceCannotFoundTheRedistDirectoryP0;
359 377
	
360 378
	/**
361 379
	 * Binds the given message's substitution locations with the given string values.
TXM/trunk/bundles/org.txm.core/src/java/org/txm/core/messages/messages.properties (revision 3825)
73 73
errorDuringWorkspaceInitializationColonP0=** Failed to initialize workspace\: {0}.
74 74
errorLoadingWorkspaceFromFileColonP0=** Failed to read workspace from file {0}.
75 75
errorRegDirColon=** Error in the registry folder\: 
76
ErrorToolboxIsNotCorrectlyInitializedAborting=Error: Toolbox not correctly initialized. Aborting workspace initialization.
76 77
ErrorWhileComputingP1DbldotP1=** Error while computing {0}\: {1}.
78
ErrorWhileStartingEngines=Error while starting engines.
79
ErrorWhileStartingEnginesOfTheP0EnginesManager=Error while starting engines of the {0}  engines manager.
80
ErrorWorkspaceNotUpdatedIsNull=Error: workspace not updated (is null).
81
ExceptionWhileInstallingExtensionIsP0=Exception while installing extension: {0}.
77 82
errorWhileConnectingToSearchEngine=** Failed to connect to the search engine\: 
78 83
errorWhileGettingMetadatasFromBaseimportMetadatasColon=** Error while retrieving metadata of the corpus\: 
79 84
errorWhileImportingDataColonP0=
......
94 99
failedToImportLexicalTable=
95 100
failedToLoadBaseParametersFromTheP0File=** Failed to load the corpus parameters from the {0} file.
96 101
FailedToOpenTheP0Editor=** Failed to open editor {0}.
102
FailToInstallExtensionP0FilesInP1=Fail to install {0} files in {1}
97 103
failedToRestorePartition=** Failed to restore partition {0} of corpus {1}\: {2}
98 104
failedToRestoreSubcorpus=** Failed to restore subcorpus {0} of corpus {1}\: {2}
99 105
failedToStartMemCqiClientColon=** Failed to start CQP in memory mode.
......
113 119
initializationOfGroovyImportScriptRunner=Initialization of GroovyImportScriptRunner
114 120
initializingCorpora=Initializing corpora ({0}/{1})...
115 121
initializingToolbox=Initializing Toolbox...
122
InitializingToolbox=initializing Toolbox...
116 123
iOColon=IO\: 
117 124
isMissing=''{0}'' can not be found.
118 125
isNotAValidCQPIDForACorpusItMustBeInUppercaseCharacters=\ is not a valid CQP identifier for a corpus. It must be in uppercase characters.
......
156 163
theFocusIsEmptyOrNull=** The focus is empty or null.
157 164
theP0PartFocusDoesntBelongToPartitionP1=There is no {0} part in the {1} partition.
158 165
ToolboxStatesWorkspaceColonP0=\ Workspace\: {0}
166
TXMWasNotCorrectlyClosedSeeTheP0ReportFile=TXM was not correctly closed, see the report in the ''{0}'' file
159 167
tP0vP1fminP2fmaxP3=
160 168
txmDirectoryIsMissingColonP0=The ''txm'' folder {0} is missing
161 169
tXMNeedsFoldersColonP0P1P2AndP3=TXM needs the folders\: {0}, {1}, {2} and {3}.
......
165 173
warningColonCantLoadCorpus=Warning\: can not load the corpus 
166 174
warningColonDuplicateQueryEntryColonP0=Warning\: the {0} query is duplicated.
167 175
warningColonQueryFailedColonP0=Warning\: query {0} failed.
176
WarningWorkspaceCannotFoundTheRedistDirectoryP0=Warning: Workspace cannot found redist directory: {0}
168 177
wrongLoginOrPasswordOrPortColon=Wrong login, password, host or port in \: {0}, {1}, {2} ,{3}.
169 178
xmlValidationColonP0DoesNotExists=XML Validation\: {0} does not exists ?
170 179
xmlValidationColonP0IsADirectory=XML Validation\: {0} is a folder.
TXM/trunk/bundles/org.txm.core/src/java/org/txm/core/CorpusNature.java (revision 3825)
13 13
 */
14 14
public class CorpusNature implements IProjectNature {
15 15
	//
16
	public static final String NATURE_ID = "org.txm.core.CorpusNature";
16
	public static final String NATURE_ID = "org.txm.core.CorpusNature"; //$NON-NLS-1$
17 17
	
18 18
	/**
19 19
	 * the eclipse project pointing to the TXM corpus project
TXM/trunk/bundles/org.txm.core/src/java/org/txm/ToolboxApplication.java (revision 3825)
39 39
			
40 40
			
41 41
			
42
			String[] pargs = {"-application", "org.txm.core.Toolbox", "-data", "/home/mdecorde/workspace047/../runtime-rcpapplication.product", "-configuration", "file:/home/mdecorde/workspace047/.metadata/.plugins/org.eclipse.pde.core/rcpapplication.product/", "-dev", "file:/home/mdecorde/workspace047/.metadata/.plugins/org.eclipse.pde.core/rcpapplication.product/dev.properties", "-os", "linux", "-ws", "gtk", "-arch", "x86_64", "-nl", "fr_FR", "-consoleLog", "-run"};
42
			String[] pargs = {"-application", "org.txm.core.Toolbox", "-data", "/home/mdecorde/workspace047/../runtime-rcpapplication.product", "-configuration", "file:/home/mdecorde/workspace047/.metadata/.plugins/org.eclipse.pde.core/rcpapplication.product/", "-dev", "file:/home/mdecorde/workspace047/.metadata/.plugins/org.eclipse.pde.core/rcpapplication.product/dev.properties", "-os", "linux", "-ws", "gtk", "-arch", "x86_64", "-nl", "fr_FR", "-consoleLog", "-run"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ //$NON-NLS-9$ //$NON-NLS-10$ //$NON-NLS-11$ //$NON-NLS-12$ //$NON-NLS-13$ //$NON-NLS-14$ //$NON-NLS-15$ //$NON-NLS-16$ //$NON-NLS-17$ //$NON-NLS-18$
43 43
			EclipseStarter.main(pargs);
44 44
//			System.out.println("plugins: "+Arrays.toString(Platform.getPluginRegistry().getPluginDescriptors()));
45 45
//			System.out.println("ext pts: "+Arrays.toString(Platform.getPluginRegistry().getExtensionPoints()));
......
71 71
		started = true;
72 72
		while (goOn) {
73 73
			Thread.sleep(1000);
74
			System.out.println("T"+started);
74
			System.out.println("T"+started); //$NON-NLS-1$
75 75
		}
76 76
		started = false;
77 77
		return IApplicationContext.EXIT_ASYNC_RESULT;
TXM/trunk/bundles/org.txm.core/src/java/org/txm/Toolbox.java (revision 3825)
89 89
 */
90 90
public class Toolbox {
91 91
	
92
	public static final DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd");
92
	public static final DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$
93 93
	// public static final DateFormat shortUKDateformat = new SimpleDateFormat("dd-MM-yy");
94 94
	
95 95
	private static LinkedHashMap<EngineType, EnginesManager<?>> enginesManagers = new LinkedHashMap<>();
......
120 120
	}
121 121
	
122 122
	private static boolean fetchEnginesManagers() {
123
		Log.finest("Fetching engines managers...");
123
		Log.finest("Fetching engines managers..."); //$NON-NLS-1$
124 124
		enginesManagers.clear();
125 125
		// System.out.println("Contributions of "+EnginesManager.ENGINEMANAGER_EXTENSION_POINT_ID);
126 126
		// Platform.getExtensionRegistry().getExtensionPoints();
127 127
		IConfigurationElement[] contributions = RegistryFactory.getRegistry().getConfigurationElementsFor(EnginesManager.ENGINES_MANAGER_EXTENSION_POINT_ID);
128 128
		// System.out.println("contributions: "+Arrays.toString(contributions));
129 129
		
130
		Log.fine(contributions.length + " engines managers found.");
130
		Log.fine(contributions.length + " engines managers found."); //$NON-NLS-1$
131 131
		
132 132
		for (int i = 0; i < contributions.length; i++) {
133 133
			try {
134 134
				EnginesManager<?> enginesManager = (EnginesManager<?>) contributions[i].createExecutableExtension("class"); //$NON-NLS-1$
135 135
				
136
				Log.fine("Registering " + enginesManager.getEnginesDescription() + " engines manager...");
136
				Log.fine("Registering " + enginesManager.getEnginesDescription() + " engines manager..."); //$NON-NLS-1$ //$NON-NLS-2$
137 137
				addEngineManager(enginesManager);
138 138
				if (enginesManager.fetchEngines()) {
139
					Log.fine(NLS.bind("{0} {1} engine(s) loaded.", enginesManager.size(), EngineType.TAL));
139
					Log.fine(NLS.bind("{0} {1} engine(s) loaded.", enginesManager.size(), EngineType.TAL)); //$NON-NLS-1$
140 140
				}
141 141
				else {
142
					Log.fine("No engine found for " + enginesManager + ", installation failed.");
142
					Log.fine("No engine found for " + enginesManager + ", installation failed."); //$NON-NLS-1$ //$NON-NLS-2$
143 143
				}
144 144
			}
145 145
			catch (Throwable e) {
......
227 227
	 * @throws Exception
228 228
	 */
229 229
	public static boolean initialize(Class preferencesStore) throws Exception {
230
		return initialize(preferencesStore, new LogMonitor("initializing Toolbox"));
230
		return initialize(preferencesStore, new LogMonitor(TXMCoreMessages.InitializingToolbox));
231 231
	}
232 232
	
233 233
	/**
......
242 242
		initializing = true;
243 243
		
244 244
		try {
245
			Log.fine("Initializing logger...");
245
			Log.fine("Initializing logger..."); //$NON-NLS-1$
246 246
			Log.setLevel(Level.parse(getPreference(TBXPreferences.LOG_LEVEL)));
247 247
			Log.setPrintInConsole(TBXPreferences.getInstance().getBoolean(TBXPreferences.ADD_TECH_LOGS));
248 248
			Log.log_stacktrace_boolean = TBXPreferences.getInstance().getBoolean(TBXPreferences.LOG_STACKTRACE);
......
255 255
			}
256 256
		}
257 257
		catch (Exception e) {
258
			System.out.println("Error while initializing logger: " + e);
258
			System.out.println("Error while initializing logger: " + e); //$NON-NLS-1$
259 259
			e.printStackTrace();
260 260
		}
261 261
		
......
293 293
			if (monitor != null && monitor.isCanceled()) return false;
294 294
		}
295 295
		catch (Exception e) {
296
			Log.warning("Error while starting engines.");
296
			Log.warning(TXMCoreMessages.ErrorWhileStartingEngines);
297 297
			e.printStackTrace();
298 298
			initializing = false;
299 299
			throw e;
......
315 315
		// loads and recreate the existing projects, loadParameters() needs engines to be ready
316 316
		if (workspace != null) {
317 317
			workspace.loadProjectsFromProjectScopes(monitor);
318
			monitor.subTask("");
318
			monitor.subTask(""); //$NON-NLS-1$
319 319
		}
320 320
		else {
321
			System.out.println("Error: Toolbox not correctly initialized. Aborting workspace initialization.");
321
			System.out.println(TXMCoreMessages.ErrorToolboxIsNotCorrectlyInitializedAborting);
322 322
		}
323 323
		
324 324
		initializing = false;
325 325
		if (monitor != null) {
326
			monitor.setTaskName("");
326
			monitor.setTaskName(""); //$NON-NLS-1$
327 327
		}
328 328
		return checkState();
329 329
	}
......
376 376
				else if (split.length > 2) {
377 377
					String[] subsplit = new String[split.length - 1];
378 378
					System.arraycopy(split, 1, subsplit, 0, split.length - 1);
379
					setPreference(split[0], StringUtils.join(subsplit, "="));
379
					setPreference(split[0], StringUtils.join(subsplit, "=")); //$NON-NLS-1$
380 380
				}
381 381
				line = input.readLine();
382 382
			}
......
438 438
				}
439 439
			}
440 440
			catch (Exception ex) {
441
				Log.severe("Exception while installing " + e.getName() + ".");
441
				Log.severe(TXMCoreMessages.ExceptionWhileInstallingExtensionIsP0 + e.getName() + "."); //$NON-NLS-2$
442 442
				ex.printStackTrace();
443 443
			}
444 444
		}
......
476 476
				}
477 477
			}
478 478
			catch (Exception ex) {
479
				Log.severe("Exception while installing " + e.getName() + ".");
479
				Log.severe(TXMCoreMessages.ExceptionWhileInstallingExtensionIsP0 + e.getName() + "."); //$NON-NLS-2$
480 480
				ex.printStackTrace();
481 481
			}
482 482
		}
......
489 489
	 */
490 490
	private static void removeEngineManager(EnginesManager<?> enginesManager) {
491 491
		enginesManagers.remove(enginesManager.getEnginesType());
492
		Log.finest("Engines manager removed: " + enginesManager);
492
		Log.finest("Engines manager removed: " + enginesManager); //$NON-NLS-1$
493 493
	}
494 494
	
495 495
	/**
......
581 581
		
582 582
		fetchEnginesManagers();
583 583
		
584
		Log.finest("Starting engines of the " + enginesManagers.keySet().size() + " engines managers...");
584
		Log.finest("Starting engines of the {0}  engines managers..." + enginesManagers.keySet().size() + " engines managers..."); //$NON-NLS-1$ //$NON-NLS-2$
585 585
		
586 586
		boolean result = true;
587 587
		for (EngineType et : enginesManagers.keySet()) {
588 588
			EnginesManager<?> enginesManager = enginesManagers.get(et);
589 589
			try {
590
				Log.finest(enginesManager.getClass().getSimpleName() + ": starting " + enginesManager.getEngines().size() + " " + enginesManager.getEnginesDescription() + " engine(s)...");
590
				Log.finest(enginesManager.getClass().getSimpleName() + "{0} : starting {1} engine(s)..." + enginesManager.getEngines().size() + " " + enginesManager.getEnginesDescription() + " engine(s)..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
591 591
				result = enginesManager.startEngines(monitor) && result; // order is important
592 592
			}
593 593
			catch (Exception e) {
594
				Log.severe("Error while starting engines of the " + enginesManager.getEnginesDescription() + " engines manager.");
594
				Log.severe(TXMCoreMessages.ErrorWhileStartingEnginesOfTheP0EnginesManager + enginesManager.getEnginesDescription() + " engines manager."); //$NON-NLS-2$
595 595
				e.printStackTrace();
596 596
			}
597 597
		}
......
600 600
	
601 601
	public static boolean stopEnginesManagers() {
602 602
		
603
		Log.finest("Stopping engines of the " + enginesManagers.keySet().size() + " engines managers...");
603
		Log.finest("Stopping engines of the {0}  engines managers..." + enginesManagers.keySet().size() + " engines managers..."); //$NON-NLS-1$ //$NON-NLS-2$
604 604
		
605 605
		if (enginesManagers == null) return true;
606 606
		if (enginesManagers.size() == 0) return true;
......
610 610
		ets.addAll(enginesManagers.keySet());
611 611
		for (EngineType et : ets) {
612 612
			EnginesManager<?> enginesManager = enginesManagers.get(et);
613
			Log.finest(enginesManager.getClass().getSimpleName() + ": stopping " + enginesManager.getEngines().size() + " " + enginesManager.getEnginesDescription() + " engine(s)...");
613
			Log.finest(enginesManager.getClass().getSimpleName() + "{0} : stopping {1}  engine(s)..." + enginesManager.getEngines().size() + " " + enginesManager.getEnginesDescription() + " engine(s)..."); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
614 614
			result = result && enginesManager.stopEngines();
615 615
			removeEngineManager(enginesManager); // remove the engine manager anyway
616 616
		}
......
626 626
			return false;
627 627
		}
628 628
		
629
		Version currentVersion = BundleUtils.getBundleVersion("org.txm.core");
630
		Log.fine(TXMCoreMessages.bind("Current toolbox version: {0}.", currentVersion));
629
		Version currentVersion = BundleUtils.getBundleVersion("org.txm.core"); //$NON-NLS-1$
630
		Log.fine(TXMCoreMessages.bind("Current toolbox version: {0}.", currentVersion)); //$NON-NLS-1$
631 631
		String installedVersionString = getPreference(TBXPreferences.VERSION);
632 632
		if (installedVersionString.isEmpty()) {
633
			installedVersionString = "0.0.0";
633
			installedVersionString = "0.0.0"; //$NON-NLS-1$
634 634
		}
635 635
		Version installedVersion = new Version(installedVersionString);
636
		Log.fine(TXMCoreMessages.bind("Installed toolbox version: {0}.", installedVersion));
636
		Log.fine(TXMCoreMessages.bind("Installed toolbox version: {0}.", installedVersion)); //$NON-NLS-1$
637 637
		try {
638 638
			// System.out.println("Toolbox.startWorkspace(): workspace location = " + location);
639 639
			
640 640
			boolean doUpdateworkspace = currentVersion.compareTo(installedVersion) > 0;
641 641
			
642 642
			if (doUpdateworkspace) { // newer install
643
				Log.fine("Updating Toolbox workspace...");
643
				Log.fine("Updating Toolbox workspace..."); //$NON-NLS-1$
644 644
				
645 645
				// create or update the workspace & create TXM default.xml workspace file
646 646
				Toolbox.workspace = createOrUpdate(new File(txmhomedir));
647 647
				
648 648
				// test
649 649
				if (Toolbox.workspace == null) {
650
					Log.severe("Error: workspace not updated (is null).");
650
					Log.severe(TXMCoreMessages.ErrorWorkspaceNotUpdatedIsNull);
651 651
					return false;
652 652
				}
653 653
				setPreference(TBXPreferences.VERSION, currentVersion.toString());
......
670 670
				// updating extension files
671 671
				IConfigurationElement[] contributions = Platform.getExtensionRegistry().getConfigurationElementsFor(PostTXMHOMEInstallationStep.EXTENSION_ID);
672 672
				// System.out.println("contributions: "+Arrays.toString(contributions));
673
				Log.fine("Installing extensions (" + contributions.length + ")");
673
				Log.fine("Installing extensions ({0})" + contributions.length + ")"); //$NON-NLS-1$ //$NON-NLS-2$
674 674
				for (int i = 0; i < contributions.length; i++) {
675 675
					try {
676
						Log.fine(TXMCoreMessages.bind("Installing extentions: {0}...", contributions[i].getName()));
676
						Log.fine(TXMCoreMessages.bind("Installing extentions: {0}...", contributions[i].getName())); //$NON-NLS-1$
677 677
						PostTXMHOMEInstallationStep extp = (PostTXMHOMEInstallationStep) contributions[i].createExecutableExtension("class"); //$NON-NLS-1$
678 678
						
679 679
						if (!extp.install(workspace)) {
680
							Log.severe("Fail to install " + extp.getName() + " files in " + workspace.getLocation());
680
							Log.severe(TXMCoreMessages.FailToInstallExtensionP0FilesInP1 + extp.getName() + " files in " + workspace.getLocation()); //$NON-NLS-2$
681 681
						}
682 682
					}
683 683
					catch (CoreException e) {
......
784 784
			String path = getInstallDirectory();
785 785
			File installDirectory = new File(path);
786 786
			if (!installDirectory.exists()) {
787
				Log.warning("Error: Workspace cannot found install directory: " + installDirectory.getAbsolutePath());
787
				Log.warning("Error: Workspace cannot found install directory: " + installDirectory.getAbsolutePath()); //$NON-NLS-1$
788 788
				return null;
789 789
			}
790 790
			
791
			File redistDirectory = new File(installDirectory, "redist");
791
			File redistDirectory = new File(installDirectory, "redist"); //$NON-NLS-1$
792 792
			if (!redistDirectory.exists()) {
793
				Log.warning("Warning: Workspace cannot found redist directory: " + redistDirectory.getAbsolutePath());
793
				Log.warning(TXMCoreMessages.WarningWorkspaceCannotFoundTheRedistDirectoryP0 + redistDirectory.getAbsolutePath());
794 794
			}
795 795
			else {
796 796
				FileCopy.copyFiles(redistDirectory, txmhomedir);
......
827 827
	 * @param state
828 828
	 */
829 829
	public static void notifyEngines(TXMResult r, String state) {
830
		Log.fine("Toolbox.notifyEngines " + r + " -> " + state);
830
		Log.fine("Toolbox.notifyEngines {0} -> {1}" + r + " -> " + state); //$NON-NLS-1$ //$NON-NLS-2$
831 831
		for (EnginesManager<?> em : enginesManagers.values()) {
832 832
			if (em == null) continue;
833 833
			for (Engine e : em.getEngines().values()) {
......
851 851
		StringBuilder builder = new StringBuilder();
852 852
		
853 853
		IWorkspace rcpWorkspace = ResourcesPlugin.getWorkspace();
854
		IProject corporaDirectory = rcpWorkspace.getRoot().getProject("corpora");
854
		IProject corporaDirectory = rcpWorkspace.getRoot().getProject("corpora"); //$NON-NLS-1$
855 855
		
856 856
		if (!corporaDirectory.exists()) {
857
			builder.append("No 'corpora' not found in workspace.");
857
			builder.append("No 'corpora' not found in workspace."); //$NON-NLS-1$
858 858
			return;
859 859
		}
860 860
		IProject projects[] = rcpWorkspace.getRoot().getProjects();
......
867 867
			String s2 = corporaDirectory.getLocationURI().toString();
868 868
			
869 869
			if (!s1.startsWith(s2)) {
870
				builder.append("RCP Project: "+rcpProject.getName()+" not in the corpora.\n\n");
870
				builder.append("RCP Project: {0}  not in the corpora.\n\n"+rcpProject.getName()+" not in the corpora.\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
871 871
				continue;
872 872
			}
873 873
			
874 874
			org.txm.objects.Project project = Toolbox.workspace.getProject(rcpProject.getName().toUpperCase());
875 875
			
876 876
			if (project == null) {
877
				builder.append("Corpus Project: "+rcpProject.getName()+" not found.\n\n");
877
				builder.append("Corpus Project: {0}  not found.\n\n"+rcpProject.getName()+" not found.\n\n"); //$NON-NLS-1$ //$NON-NLS-2$
878 878
				continue;
879 879
			}
880 880
			
881 881
			CorpusBuild corpus = project.getCorpusBuild(project.getName().toUpperCase());
882 882
			if (corpus == null) {
883
				builder.append(" no CQP corpus with name: "+project.getName().toUpperCase());
884
				builder.append("  the import was not done or failed");
885
				builder.append("\n");
883
				builder.append(" no CQP corpus with name: {0}."+project.getName().toUpperCase()); //$NON-NLS-1$
884
				builder.append("\n  the import was not done or failed"); //$NON-NLS-1$
885
				builder.append("\n"); //$NON-NLS-1$
886 886
				continue;
887 887
			}
888 888
			
889 889
			List<?> errors = corpus.isBuildValid();
890 890
			if (errors != null && errors.size() > 0) {
891
				builder.append(" corpus built failed with file errors: "+errors);
892
				builder.append("  the import or update failed");
893
				builder.append("\n");
891
				builder.append(" corpus built failed with file errors: {0}"+errors); //$NON-NLS-1$
892
				builder.append("\n  the import or update failed"); //$NON-NLS-1$
893
				builder.append("\n"); //$NON-NLS-1$
894 894
			}
895 895
			
896 896
			String error = corpus.isReady();
897 897
			if (error != null && error.length() > 0) {
898
				builder.append(" corpus is not ready: "+error);
899
				builder.append("  the import or update failed");
900
				builder.append("\n");
898
				builder.append(" corpus is not ready: {0}"+error); //$NON-NLS-1$
899
				builder.append("\n  the import or update failed"); //$NON-NLS-1$
900
				builder.append("\n"); //$NON-NLS-1$
901 901
			}
902 902
	
903 903
			if (Log.getLevel().intValue() < Level.INFO.intValue()) { // print more details if log level is lower than INFO
904 904
				
905
				builder.append("Project: "+project.getName()+" at "+project.getProjectDirectory());
906
				builder.append("\n");
907
				builder.append(" creation: "+project.getCreationDate());
908
				builder.append("\n");
909
				builder.append(" update: "+project.getLastComputingDate());
910
				builder.append("\n");
911
				builder.append(" 'default' edition: "+project.getEditionDefinition("default"));
912
				builder.append("\n");
913
				builder.append(" 'facs' edition: "+project.getEditionDefinition("facs"));
914
				builder.append("\n");
915
				builder.append(" 'preferences': "+TXMPreferences.dumpToString(project.getParametersNodePath()));
916
				builder.append("\n");
905
				builder.append("Project: "+project.getName()+" at "+project.getProjectDirectory()); //$NON-NLS-1$ //$NON-NLS-2$
906
				builder.append("\n"); //$NON-NLS-1$
907
				builder.append(" creation: "+project.getCreationDate()); //$NON-NLS-1$
908
				builder.append("\n"); //$NON-NLS-1$
909
				builder.append(" update: "+project.getLastComputingDate()); //$NON-NLS-1$
910
				builder.append("\n"); //$NON-NLS-1$
911
				builder.append(" 'default' edition: "+project.getEditionDefinition("default")); //$NON-NLS-1$ //$NON-NLS-2$
912
				builder.append("\n"); //$NON-NLS-1$
913
				builder.append(" 'facs' edition: "+project.getEditionDefinition("facs")); //$NON-NLS-1$ //$NON-NLS-2$
914
				builder.append("\n"); //$NON-NLS-1$
915
				builder.append(" 'preferences': "+TXMPreferences.dumpToString(project.getParametersNodePath())); //$NON-NLS-1$
916
				builder.append("\n"); //$NON-NLS-1$
917 917
				
918
				builder.append(" Results: ");
919
				builder.append("\n");
918
				builder.append(" Results: "); //$NON-NLS-1$
919
				builder.append("\n"); //$NON-NLS-1$
920 920
				for (TXMResult result : project.getDeepChildren()) {
921
					builder.append("  "+result.getName()+" ("+result.getResultType()+"): "+result.getSimpleDetails());
922
					builder.append("\n");
923
					builder.append("  'preferences': "+TXMPreferences.dumpToString(result.getParametersNodePath()));
924
					builder.append("\n");
921
					builder.append("  "+result.getName()+" ("+result.getResultType()+"): "+result.getSimpleDetails()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
922
					builder.append("\n"); //$NON-NLS-1$
923
					builder.append("  'preferences': "+TXMPreferences.dumpToString(result.getParametersNodePath())); //$NON-NLS-1$
924
					builder.append("\n"); //$NON-NLS-1$
925 925
				}
926
				builder.append("\n");
926
				builder.append("\n"); //$NON-NLS-1$
927 927
			}
928 928
		}
929 929
		
930 930
		if (builder.length() > 0) {
931 931
			IOUtils.write(checkupResultFile, builder.toString());
932
			Log.warning(NLS.bind("TXM was not correctly closed, see the report in the ''{0}'' file", checkupResultFile.getAbsolutePath()));
932
			Log.warning(NLS.bind(TXMCoreMessages.TXMWasNotCorrectlyClosedSeeTheP0ReportFile, checkupResultFile.getAbsolutePath()));
933 933
		}
934 934
	}
935 935
}
TXM/trunk/bundles/org.txm.core/src/java/org/txm/PostInstallationStep.java (revision 3825)
14 14
	
15 15
	public void install()
16 16
	{
17
		System.out.println("Installing "+name+"...");
17
		System.out.println("Installing "+name+"..."); //$NON-NLS-1$ //$NON-NLS-2$
18 18
	}
19 19
	
20 20
	public void preInstall()
21 21
	{
22
		System.out.println("Pre-Installing "+name+"...");
22
		System.out.println("Pre-Installing "+name+"..."); //$NON-NLS-1$ //$NON-NLS-2$
23 23
	}
24 24
}
TXM/trunk/bundles/org.txm.core/src/java/org/txm/PostTXMHOMEInstallationStep.java (revision 3825)
30 30
		Version extcurrentVersion = BundleUtils.getBundleVersion(bundle_id);
31 31
		String extinstalledVersionString = Toolbox.getPreference(getName());
32 32
		if (extinstalledVersionString.isEmpty()) {
33
			extinstalledVersionString = "0.0.0";
33
			extinstalledVersionString = "0.0.0"; //$NON-NLS-1$
34 34
		}
35 35
		Version extinstalledVersion = new Version(extinstalledVersionString);
36
		Log.fine(TXMCoreMessages.bind("{0} installed version: {1}.", getName(), extinstalledVersion));
36
		Log.fine(TXMCoreMessages.bind("{0} installed version: {1}.", getName(), extinstalledVersion)); //$NON-NLS-1$
37 37
		//System.out.println("Toolbox.startWorkspace(): workspace location = " + location);
38 38
		boolean extDoUpdateworkspace = extcurrentVersion.compareTo(extinstalledVersion) > 0;
39 39
		if (needsReinstall(workspace) || extDoUpdateworkspace) { // || "org.txm.groovy.core".equals(bundle_id)
40
			Log.finer("Installing extension "+getName()+" reasons: workspace or extDoUpdateworkspace="+extDoUpdateworkspace);
40
			Log.finer("Installing extension "+getName()+" reasons: workspace or extDoUpdateworkspace="+extDoUpdateworkspace); //$NON-NLS-1$ //$NON-NLS-2$
41 41
			if (do_install(workspace)) {
42 42
				Toolbox.setPreference(getName(), extcurrentVersion.toString()); // SAVE the installed version
43 43
			}
44 44
		} else {
45
			Log.finer(" no need to re-install "+getName());
45
			Log.finer(" no need to re-install "+getName()); //$NON-NLS-1$
46 46
		}
47 47
		return true;
48 48
	}

Formats disponibles : Unified diff