37 |
37 |
import java.text.Collator;
|
38 |
38 |
import java.text.DateFormat;
|
39 |
39 |
import java.text.SimpleDateFormat;
|
40 |
|
import java.util.ArrayList;
|
41 |
40 |
import java.util.Arrays;
|
42 |
|
import java.util.HashMap;
|
43 |
41 |
import java.util.LinkedHashMap;
|
44 |
42 |
import java.util.Locale;
|
45 |
43 |
import java.util.logging.Level;
|
... | ... | |
90 |
88 |
/** The state. */
|
91 |
89 |
private static boolean state = false;
|
92 |
90 |
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
|
91 |
/** Root of all TXMResults and manages the corpus */
|
97 |
92 |
public static Workspace workspace;
|
98 |
93 |
|
99 |
94 |
/**
|
... | ... | |
134 |
129 |
|
135 |
130 |
}
|
136 |
131 |
else {
|
137 |
|
Log.severe("No engine found for " + enginesManager + ", installation failed.");
|
|
132 |
Log.warning("No engine found for " + enginesManager + ", installation failed.");
|
138 |
133 |
}
|
139 |
134 |
} catch(Throwable e) {
|
140 |
135 |
e.printStackTrace();
|
... | ... | |
163 |
158 |
TBXPreferences.getInstance().put(key, value);
|
164 |
159 |
}
|
165 |
160 |
|
166 |
|
|
167 |
161 |
/**
|
168 |
162 |
* Gets the manager of the specified engine type.
|
169 |
163 |
* @param engineType
|
... | ... | |
233 |
227 |
public static boolean initialize(Class preferencesStore, IProgressMonitor monitor) throws Exception {
|
234 |
228 |
initializing = true;
|
235 |
229 |
if (monitor != null) {
|
236 |
|
monitor.setTaskName("Initializing Toolbox...");
|
|
230 |
monitor.setTaskName(TXMCoreMessages.initializingToolbox);
|
237 |
231 |
}
|
238 |
232 |
try {
|
239 |
233 |
if (monitor != null) {
|
240 |
|
monitor.subTask("Loading extensions (pre-installation)...");
|
|
234 |
monitor.subTask(TXMCoreMessages.loadingExtensionPreInstallation);
|
241 |
235 |
}
|
242 |
236 |
pluginsPreinstallation(monitor);
|
243 |
237 |
} catch(Exception e) {
|
244 |
|
System.out.println("Error while pre-installing plugins: " + e.getLocalizedMessage());
|
|
238 |
Log.warning(NLS.bind(TXMCoreMessages.errorWhilePreInstallingPluginsP0, e.getLocalizedMessage()));
|
245 |
239 |
}
|
246 |
240 |
|
247 |
241 |
if (monitor != null && monitor.isCanceled()) return false;
|
... | ... | |
272 |
266 |
startEnginesManagers(monitor);
|
273 |
267 |
if (monitor != null && monitor.isCanceled()) return false;
|
274 |
268 |
} catch (Exception e) {
|
275 |
|
Log.severe("Error while starting engines.");
|
|
269 |
Log.warning("Error while starting engines.");
|
276 |
270 |
e.printStackTrace();
|
277 |
271 |
initializing = false;
|
278 |
272 |
throw e;
|
... | ... | |
282 |
276 |
|
283 |
277 |
try {
|
284 |
278 |
if (monitor != null) {
|
285 |
|
monitor.subTask("Loading plug-in post-installation extensions...");
|
|
279 |
monitor.subTask(TXMCoreMessages.loadingExtensionPostInstallation);
|
|
280 |
|
286 |
281 |
}
|
287 |
282 |
pluginsPostinstallation(monitor);
|
288 |
283 |
if (monitor != null && monitor.isCanceled()) return false;
|
289 |
284 |
} catch(Exception e) {
|
290 |
|
Log.severe("Error while loading plugins post-installation.");
|
291 |
|
e.printStackTrace();
|
|
285 |
Log.warning(NLS.bind(TXMCoreMessages.errorWhilePostInstallingPluginsP0, e.getLocalizedMessage()));
|
292 |
286 |
}
|
293 |
287 |
|
294 |
288 |
// loads and recreate the existing projects, loadParameters() needs engines to be ready
|
295 |
289 |
if (workspace != null) {
|
296 |
290 |
if (monitor != null) {
|
297 |
|
monitor.setTaskName("Initializing corpora...");
|
|
291 |
monitor.setTaskName(TXMCoreMessages.initializingCorpora);
|
298 |
292 |
monitor.subTask("");
|
299 |
293 |
}
|
300 |
294 |
workspace.loadProjectsFromProjectScopes();
|
... | ... | |
645 |
639 |
}
|
646 |
640 |
}
|
647 |
641 |
} catch (Exception e) {
|
648 |
|
Log.severe(NLS.bind(TXMCoreMessages.errorDuringWorkspaceInitializationColonP0, txmhomedir));
|
649 |
|
Log.severe(NLS.bind(TXMCoreMessages.errorColonP0, Log.toString(e)));
|
|
642 |
Log.warning(NLS.bind(TXMCoreMessages.errorDuringWorkspaceInitializationColonP0, txmhomedir));
|
|
643 |
Log.warning(NLS.bind(TXMCoreMessages.errorColonP0, Log.toString(e)));
|
650 |
644 |
Log.printStackTrace(e);
|
651 |
645 |
state = false;
|
652 |
646 |
}
|
... | ... | |
736 |
730 |
String path = Toolbox.getPreference(TBXPreferences.INSTALL_DIR);
|
737 |
731 |
File installDirectory = new File(path);
|
738 |
732 |
if (!installDirectory.exists()) {
|
739 |
|
Log.severe("Error: Workspace cannot found install directory: "+installDirectory.getAbsolutePath());
|
|
733 |
Log.warning("Error: Workspace cannot found install directory: "+installDirectory.getAbsolutePath());
|
740 |
734 |
return null;
|
741 |
735 |
}
|
742 |
736 |
|
... | ... | |
756 |
750 |
|
757 |
751 |
return workspace;
|
758 |
752 |
} catch (Exception e) {
|
759 |
|
Log.severe(NLS.bind(TXMCoreMessages.failedToCopyTXMFilesFromTXMINSTALLDIRToTXMHOMEColonP0, e.getLocalizedMessage()));
|
|
753 |
Log.warning(NLS.bind(TXMCoreMessages.failedToCopyTXMFilesFromTXMINSTALLDIRToTXMHOMEColonP0, e.getLocalizedMessage()));
|
760 |
754 |
e.printStackTrace();
|
761 |
755 |
return null;
|
762 |
756 |
}
|