Révision 1710
| tmp/org.txm.core/src/java/org/txm/Toolbox.java (revision 1710) | ||
|---|---|---|
| 239 | 239 |
if (monitor != null) {
|
| 240 | 240 |
monitor.subTask("Loading extensions (pre-installation)...");
|
| 241 | 241 |
} |
| 242 |
pluginsPreinstallation(); |
|
| 242 |
pluginsPreinstallation(monitor);
|
|
| 243 | 243 |
} catch(Exception e) {
|
| 244 | 244 |
System.out.println("Error while pre-installing plugins: " + e.getLocalizedMessage());
|
| 245 | 245 |
} |
| 246 | 246 |
|
| 247 |
if (monitor != null && monitor.isCanceled()) return false; |
|
| 248 |
|
|
| 247 | 249 |
try {
|
| 248 | 250 |
// initialize workspace : list of corpus loaded in TXM |
| 249 | 251 |
// copy shared files if needed |
| 250 | 252 |
state = startWorkspace(monitor); |
| 251 |
|
|
| 253 |
if (monitor != null && monitor.isCanceled()) return false; |
|
| 254 |
|
|
| 252 | 255 |
Log.fine("Initializing logger...");
|
| 253 | 256 |
Log.setLevel(Level.parse(getPreference(TBXPreferences.LOG_LEVEL))); |
| 254 | 257 |
Log.setPrintInConsole(TBXPreferences.getInstance().getBoolean(TBXPreferences.ADD_TECH_LOGS)); |
| ... | ... | |
| 267 | 270 |
|
| 268 | 271 |
try {
|
| 269 | 272 |
startEnginesManagers(monitor); |
| 273 |
if (monitor != null && monitor.isCanceled()) return false; |
|
| 270 | 274 |
} catch (Exception e) {
|
| 271 | 275 |
Log.severe("Error while starting engines.");
|
| 272 | 276 |
e.printStackTrace(); |
| ... | ... | |
| 280 | 284 |
if (monitor != null) {
|
| 281 | 285 |
monitor.subTask("Loading plug-in post-installation extensions...");
|
| 282 | 286 |
} |
| 283 |
pluginsPostinstallation(); |
|
| 287 |
pluginsPostinstallation(monitor); |
|
| 288 |
if (monitor != null && monitor.isCanceled()) return false; |
|
| 284 | 289 |
} catch(Exception e) {
|
| 285 | 290 |
Log.severe("Error while loading plugins post-installation.");
|
| 286 | 291 |
e.printStackTrace(); |
| ... | ... | |
| 372 | 377 |
|
| 373 | 378 |
/** |
| 374 | 379 |
* Allow to install a TXM extension AFTER the Toolbox is initialized |
| 380 |
* @param monitor |
|
| 375 | 381 |
*/ |
| 376 |
private static void pluginsPostinstallation() {
|
|
| 382 |
private static void pluginsPostinstallation(IProgressMonitor monitor) {
|
|
| 377 | 383 |
|
| 378 | 384 |
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(PostInstallationStep.EXTENSION_ID); |
| 379 | 385 |
|
| ... | ... | |
| 381 | 387 |
Log.fine(Arrays.toString(config)); |
| 382 | 388 |
|
| 383 | 389 |
for (IConfigurationElement e : config) {
|
| 390 |
if (monitor != null && monitor.isCanceled()) return; |
|
| 384 | 391 |
try {
|
| 385 | 392 |
Log.fine(NLS.bind(TXMCoreMessages.evaluatingExtensionColonP0FromP1, e.getName(), e.getContributor().getName())); |
| 386 | 393 |
|
| ... | ... | |
| 409 | 416 |
/** |
| 410 | 417 |
* Allow to install a TXM extension BEFORE the Toolbox is initialized |
| 411 | 418 |
*/ |
| 412 |
private static void pluginsPreinstallation() {
|
|
| 419 |
private static void pluginsPreinstallation(IProgressMonitor monitor) {
|
|
| 413 | 420 |
|
| 414 | 421 |
IConfigurationElement[] config = Platform.getExtensionRegistry().getConfigurationElementsFor(PostInstallationStep.EXTENSION_ID); |
| 415 | 422 |
Log.fine(TXMCoreMessages.loadingExtensions); |
| 416 | 423 |
Log.fine(Arrays.toString(config)); |
| 417 | 424 |
|
| 418 | 425 |
for (IConfigurationElement e : config) {
|
| 426 |
if (monitor != null && monitor.isCanceled()) return; |
|
| 419 | 427 |
try {
|
| 420 | 428 |
Log.fine(NLS.bind(TXMCoreMessages.evaluatingExtensionColonP0FromP1, e.getName(), e.getContributor().getName())); |
| 421 | 429 |
|
| tmp/org.txm.core/src/java/org/txm/objects/BaseOldParameters.java (revision 1710) | ||
|---|---|---|
| 16 | 16 |
|
| 17 | 17 |
import javax.xml.parsers.ParserConfigurationException; |
| 18 | 18 |
|
| 19 |
import org.eclipse.osgi.util.NLS; |
|
| 19 | 20 |
import org.txm.utils.logger.Log; |
| 20 | 21 |
import org.txm.utils.xml.DomUtils; |
| 21 | 22 |
import org.w3c.dom.Document; |
| ... | ... | |
| 491 | 492 |
} |
| 492 | 493 |
} |
| 493 | 494 |
|
| 494 |
System.out.println("Warning param.xml has no corpus defined: "+paramFile);
|
|
| 495 |
System.out.println(NLS.bind("Warning no corpus element defined in the {0} file.",paramFile));
|
|
| 495 | 496 |
return null; |
| 496 | 497 |
} |
| 497 | 498 |
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/TXMUIMessages.java (revision 1710) | ||
|---|---|---|
| 28 | 28 |
public static String aWordWithItsProperty; |
| 29 | 29 |
public static String abort; |
| 30 | 30 |
public static String abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists; |
| 31 |
public static String abortingLoadingOfPOACorpusWithTheSameCQPIDAlreadyExists; |
|
| 31 | 32 |
public static String aboutTXM; |
| 32 | 33 |
public static String activateProxyService; |
| 33 | 34 |
public static String addAWord; |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties (revision 1710) | ||
|---|---|---|
| 28 | 28 |
|
| 29 | 29 |
abort = Abort |
| 30 | 30 |
|
| 31 |
abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists = Aborting loading of {0}. A corpus with the same name already exists.
|
|
| 31 |
abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists = A corpus with the same name {1} already exists. Aborting loading of {0}.
|
|
| 32 |
|
|
| 33 |
abortingLoadingOfPOACorpusWithTheSameCQPIDAlreadyExists = A corpus with the same CQP MainCorpus identifier {1} already exists. Aborting loading of {0}.
|
|
| 32 | 34 |
|
| 33 | 35 |
aboutTXM = About TXM… |
| 34 | 36 |
|
| ... | ... | |
| 849 | 851 |
|
| 850 | 852 |
startJobColonLoadInstallPreferences = Startup: loading installation preferences |
| 851 | 853 |
|
| 852 |
startingUpP0 = Starting TXM {0}…
|
|
| 854 |
startingUpP0 = Starting TXM {0} ({1})…
|
|
| 853 | 855 |
|
| 854 | 856 |
startingUpdateFetch = Starting updates retrieval |
| 855 | 857 |
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages_fr.properties (revision 1710) | ||
|---|---|---|
| 547 | 547 |
|
| 548 | 548 |
loadingTheCorpusInThePlatform = Chargement du corpus dans la plateforme |
| 549 | 549 |
|
| 550 |
loadingTheP0BinaryCorpusAsATXM079Corpus = Chargement du corpus binaire 0.7.9 {0}...
|
|
| 550 |
loadingTheP0BinaryCorpusAsATXM079Corpus = Chargement du corpus binaire au format 0.7.9 {0}...
|
|
| 551 | 551 |
|
| 552 |
loadingTheP0BinaryCorpusAsATXM080Corpus = Chargement du corpus binaire 0.8.0 {0}...
|
|
| 552 |
loadingTheP0BinaryCorpusAsATXM080Corpus = Chargement du corpus binaire au format 0.8.0 {0}...
|
|
| 553 | 553 |
|
| 554 | 554 |
loadingViews = Chargement des vues |
| 555 | 555 |
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load080BinaryCorpus.java (revision 1710) | ||
|---|---|---|
| 79 | 79 |
if (replace) {
|
| 80 | 80 |
p.delete(); |
| 81 | 81 |
} else {
|
| 82 |
System.out.println("Aborting loading of "+zipFile+". A corpus with the same name already exists.");
|
|
| 82 |
System.out.println(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, zipFile, basedirname.toUpperCase()));
|
|
| 83 | 83 |
return null; |
| 84 | 84 |
} |
| 85 | 85 |
} |
| ... | ... | |
| 89 | 89 |
if (replace) {
|
| 90 | 90 |
DeleteDir.deleteDirectory(corpusDirectory); |
| 91 | 91 |
} else {
|
| 92 |
System.out.println("Aborting loading of "+zipFile+". A directory with the same name already exists: "+corpusDirectory);
|
|
| 92 |
System.out.println(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, zipFile, corpusDirectory));
|
|
| 93 | 93 |
return null; |
| 94 | 94 |
} |
| 95 | 95 |
|
| ... | ... | |
| 117 | 117 |
String mainCorpusName = mainCorpusDirs[0].getName(); |
| 118 | 118 |
p = Toolbox.workspace.getProject(mainCorpusName); |
| 119 | 119 |
if (p != null) {
|
| 120 |
Log.severe(NLS.bind("Aborting loading of {0}. A corpus with the same {1} CQP MainCorpus name already exists.", corpusDirectory, mainCorpusName));
|
|
| 120 |
Log.severe(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameCQPIDAlreadyExists, corpusDirectory, mainCorpusName));
|
|
| 121 | 121 |
DeleteDir.deleteDirectory(corpusDirectory); // clean files |
| 122 | 122 |
return null; |
| 123 | 123 |
} |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java (revision 1710) | ||
|---|---|---|
| 94 | 94 |
|
| 95 | 95 |
if (directory.exists()) {
|
| 96 | 96 |
LastOpened.set(ID, directory); |
| 97 |
return loadBinaryCorpusFromCorporaDirectory(directory, true, true, false); |
|
| 97 |
JobHandler job = loadBinaryCorpusFromCorporaDirectory(directory, true, true, false); |
|
| 98 |
if (job != null) {
|
|
| 99 |
try {
|
|
| 100 |
job.join(); |
|
| 101 |
} catch (InterruptedException e) {
|
|
| 102 |
// TODO Auto-generated catch block |
|
| 103 |
e.printStackTrace(); |
|
| 104 |
} |
|
| 105 |
} |
|
| 98 | 106 |
} |
| 99 | 107 |
} |
| 100 | 108 |
return null; |
| ... | ... | |
| 179 | 187 |
@Override |
| 180 | 188 |
public void run() {
|
| 181 | 189 |
RestartTXM.reloadViews(); |
| 182 |
System.err.println(TXMUIMessages.info_txmIsReady); |
|
| 183 | 190 |
StatusLine.setMessage(TXMUIMessages.info_txmIsReady); |
| 184 | 191 |
} |
| 185 | 192 |
}); |
| ... | ... | |
| 324 | 331 |
|
| 325 | 332 |
Project project = Toolbox.workspace.getProject(corpusDirectory.getName().toUpperCase()); |
| 326 | 333 |
if (project != null) {
|
| 327 |
Log.warning("A corpus named "+corpusDirectory.getName().toUpperCase()+" is already exists, abandoning the loading of "+corpusDirectory);
|
|
| 334 |
Log.warning("A corpus named "+corpusDirectory.getName().toUpperCase()+" already exists, abandoning the loading of "+corpusDirectory);
|
|
| 328 | 335 |
continue; |
| 329 | 336 |
} |
| 330 | 337 |
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/Load079BinaryCorpus.java (revision 1710) | ||
|---|---|---|
| 81 | 81 |
if (replace) {
|
| 82 | 82 |
p.delete(); |
| 83 | 83 |
} else {
|
| 84 |
System.out.println(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, zipFile)); |
|
| 84 |
System.out.println(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, zipFile, basedirname.toUpperCase()));
|
|
| 85 | 85 |
return null; |
| 86 | 86 |
} |
| 87 | 87 |
|
| ... | ... | |
| 92 | 92 |
DeleteDir.deleteDirectory(corpusDirectory); |
| 93 | 93 |
} else {
|
| 94 | 94 |
if (corpusDirectory.exists()) {
|
| 95 |
System.out.println("Aborting loading of "+zipFile+". A directory with the same name already exists: "+corpusDirectory);
|
|
| 95 |
System.out.println(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, zipFile, corpusDirectory));
|
|
| 96 | 96 |
return null; |
| 97 | 97 |
} |
| 98 | 98 |
} |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorpus.java (revision 1710) | ||
|---|---|---|
| 123 | 123 |
} |
| 124 | 124 |
} |
| 125 | 125 |
|
| 126 |
return loadBinaryCorpusArchive(zipFile); |
|
| 126 |
JobHandler job = loadBinaryCorpusArchive(zipFile); |
|
| 127 |
return job; |
|
| 127 | 128 |
} |
| 128 | 129 |
|
| 129 | 130 |
/** |
| ... | ... | |
| 135 | 136 |
* 4- load the binary corpus directory |
| 136 | 137 |
* 5- restart TXM engines |
| 137 | 138 |
*/ |
| 138 |
public static boolean loadBinaryCorpusArchive(final File zipFile) throws ExecutionException {
|
|
| 139 |
public static JobHandler loadBinaryCorpusArchive(final File zipFile) throws ExecutionException {
|
|
| 139 | 140 |
|
| 140 | 141 |
String filename = zipFile.getName(); |
| 141 | 142 |
final File corporaDir = Toolbox.workspace.getLocation(); |
| ... | ... | |
| 144 | 145 |
if (!filename.endsWith(".txm") && !filename.endsWith(".zip")) { //$NON-NLS-1$ //$NON-NLS-2$
|
| 145 | 146 |
System.out.println(TXMUIMessages.aBinaryCorpusIsATXMFileExtensionTxmOrZip); |
| 146 | 147 |
System.out.println(NLS.bind(TXMUIMessages.thisFileIsNotATXMFileColonP0, zipFile)); |
| 147 |
return false;
|
|
| 148 |
return null;
|
|
| 148 | 149 |
} |
| 149 | 150 |
|
| 150 | 151 |
if (!zipFile.canRead()) {
|
| 151 | 152 |
System.out.println(NLS.bind(TXMUIMessages.cannotReadTheFileP0, zipFile)); |
| 152 |
return false;
|
|
| 153 |
return null;
|
|
| 153 | 154 |
} |
| 154 | 155 |
|
| 155 |
// try {
|
|
| 156 |
// SearchEnginesManager.getCQPSearchEngine().stop(); |
|
| 157 |
// } catch (Exception e1) {
|
|
| 158 |
// // TODO Auto-generated catch block |
|
| 159 |
// e1.printStackTrace(); |
|
| 160 |
// } |
|
| 161 |
|
|
| 162 | 156 |
//build binary dir path |
| 163 | 157 |
String basedirname = Zip.getRoot(zipFile).toUpperCase(); |
| 164 | 158 |
|
| ... | ... | |
| 187 | 181 |
} |
| 188 | 182 |
|
| 189 | 183 |
if (corpusdir.exists()) {
|
| 190 |
// System.out.println("Error: previous binary corpus directory was not deleted: "+corpusdir);
|
|
| 191 |
// try {
|
|
| 192 |
// SearchEnginesManager.getCQPSearchEngine().start(null); |
|
| 193 |
// } catch (Exception e) {
|
|
| 194 |
// // TODO Auto-generated catch block |
|
| 195 |
// e.printStackTrace(); |
|
| 196 |
// } |
|
| 197 |
return false; |
|
| 184 |
return null; |
|
| 198 | 185 |
} |
| 199 | 186 |
} else {
|
| 200 |
// try {
|
|
| 201 |
// SearchEnginesManager.getCQPSearchEngine().start(null); |
|
| 202 |
// } catch (Exception e) {
|
|
| 203 |
// // TODO Auto-generated catch block |
|
| 204 |
// e.printStackTrace(); |
|
| 205 |
// } |
|
| 206 |
return false; // abandon |
|
| 187 |
return null; // abandon |
|
| 207 | 188 |
} |
| 208 | 189 |
} |
| 209 | 190 |
|
| ... | ... | |
| 219 | 200 |
@Override |
| 220 | 201 |
public void run() {
|
| 221 | 202 |
|
| 222 |
// try {
|
|
| 223 |
// SearchEnginesManager.getCQPSearchEngine().start(); |
|
| 224 |
// } catch (Exception e) {
|
|
| 225 |
// e.printStackTrace(); |
|
| 226 |
// } |
|
| 227 |
|
|
| 228 | 203 |
if (newProject2 != null) {
|
| 229 | 204 |
newProject2.compute(); |
| 230 | 205 |
RestartTXM.reloadViews(); |
| 231 | 206 |
//System.out.println("Select newly loaded corpus: "+base2.getCorpora().values());
|
| 232 | 207 |
CorporaView.select(newProject2.getChildren(MainCorpus.class)); |
| 233 |
System.err.println(TXMUIMessages.info_txmIsReady); |
|
| 234 | 208 |
StatusLine.setMessage(TXMUIMessages.info_txmIsReady); |
| 235 | 209 |
} else {
|
| 236 | 210 |
System.out.println("Error: no project loaded.");
|
| ... | ... | |
| 248 | 222 |
org.txm.utils.logger.Log.printStackTrace(e); |
| 249 | 223 |
} |
| 250 | 224 |
|
| 251 |
return true;
|
|
| 225 |
return jobhandler;
|
|
| 252 | 226 |
} |
| 253 | 227 |
|
| 254 | 228 |
/** |
| ... | ... | |
| 281 | 255 |
Log.warning(NLS.bind("Failed to load the {0} corpus.", zipFile));
|
| 282 | 256 |
return null; |
| 283 | 257 |
} |
| 284 |
|
|
| 285 |
// final Project newProject2 = project; |
|
| 286 |
// jobhandler.syncExec(new Runnable() {
|
|
| 287 |
// @Override |
|
| 288 |
// public void run() {
|
|
| 289 |
// |
|
| 290 |
// SearchEngine engine = SearchEnginesManager.getCQPSearchEngine(); |
|
| 291 |
// if (!engine.isRunning()) {
|
|
| 292 |
// try {
|
|
| 293 |
// engine.start(monitor); |
|
| 294 |
// } catch (Exception e) {
|
|
| 295 |
// // TODO Auto-generated catch block |
|
| 296 |
// e.printStackTrace(); |
|
| 297 |
// } |
|
| 298 |
// } |
|
| 299 |
// |
|
| 300 |
// RestartTXM.reloadViews(); |
|
| 301 |
// //System.out.println("Select newly loaded corpus: "+base2.getCorpora().values());
|
|
| 302 |
// CorporaView.select(newProject2.getChildren(MainCorpus.class)); |
|
| 303 |
// System.err.println(TXMUIMessages.info_txmIsReady); |
|
| 304 |
// StatusLine.setMessage(TXMUIMessages.info_txmIsReady); |
|
| 305 |
// } |
|
| 306 |
// }); |
|
| 307 | 258 |
} catch (ThreadDeath td) {
|
| 308 | 259 |
return null; |
| 309 | 260 |
} catch (Exception e2) {
|
| ... | ... | |
| 349 | 300 |
// Toolbox.workspace.save(); |
| 350 | 301 |
|
| 351 | 302 |
// test with project name |
| 352 |
Project p = Toolbox.workspace.getProject(corpusDirectory.getName().toUpperCase().toUpperCase());
|
|
| 303 |
Project p = Toolbox.workspace.getProject(corpusDirectory.getName().toUpperCase()); |
|
| 353 | 304 |
if (p != null) {
|
| 354 |
Log.warning(NLS.bind("Aborting loading of {0}. A corpus with the same name already exists.", corpusDirectory));
|
|
| 305 |
Log.warning(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameNameAlreadyExists, corpusDirectory, corpusDirectory.getName().toUpperCase()));
|
|
| 355 | 306 |
return null; |
| 356 | 307 |
} |
| 357 | 308 |
|
| ... | ... | |
| 362 | 313 |
String mainCorpusName = mainCorpusDirs[0].getName(); |
| 363 | 314 |
p = Toolbox.workspace.getProject(mainCorpusName); |
| 364 | 315 |
if (p != null) {
|
| 365 |
Log.warning(NLS.bind("Aborting loading of {0}. A corpus with the same {1} CQP MainCorpus name already exists.", corpusDirectory, mainCorpusName));
|
|
| 316 |
Log.warning(NLS.bind(TXMUIMessages.abortingLoadingOfPOACorpusWithTheSameCQPIDAlreadyExists, corpusDirectory, mainCorpusName));
|
|
| 366 | 317 |
return null; |
| 367 | 318 |
} |
| 368 | 319 |
} |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 1710) | ||
|---|---|---|
| 333 | 333 |
// build the properties given to the Toolbox |
| 334 | 334 |
String version = Activator.getDefault().getBundle().getVersion().toString(); // "0.7.7.201412160925"; |
| 335 | 335 |
version = version.replaceAll("(.\\..\\..)\\.(....)(..)(..)(..)(..)", "$1 ($2-$3-$4 $5h$6)"); //$NON-NLS-1$ //$NON-NLS-2$
|
| 336 |
System.out.print(NLS.bind(TXMUIMessages.startingUpP0, version)); |
|
| 337 | 336 |
DateFormat formatter = TXMResult.PRETTY_LOCALIZED_TIME_FORMAT; |
| 338 | 337 |
|
| 339 |
System.out.println(NLS.bind(" ({0})", formatter.format(new Date(Activator.getDefault().getBundle().getLastModified()))));
|
|
| 338 |
System.out.println(NLS.bind(TXMUIMessages.startingUpP0, version, formatter.format(new Date(Activator.getDefault().getBundle().getLastModified()))));
|
|
| 340 | 339 |
} |
| 341 | 340 |
|
| 342 | 341 |
private void setPreferencesConfiguration() {
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/results/DeleteObject.java (revision 1710) | ||
|---|---|---|
| 201 | 201 |
if (allObjectDeleted.size() > 0) {
|
| 202 | 202 |
|
| 203 | 203 |
if (shouldRestartToolbox) {
|
| 204 |
// org.txm.Toolbox.restartWorkspace(null); |
|
| 205 |
// Toolbox.getEngineManager(EngineType.SEARCH).restartEngines(); |
|
| 206 |
|
|
| 207 |
Log.info(TXMUIMessages.info_txmIsReady); |
|
| 208 | 204 |
StatusLine.setMessage(TXMUIMessages.info_txmIsReady); |
| 209 | 205 |
} |
| 210 | 206 |
|
| tmp/org.txm.setups/shared/debian/usr/bin/TXM (revision 1710) | ||
|---|---|---|
| 141 | 141 |
exit 1 |
| 142 | 142 |
fi |
| 143 | 143 |
else |
| 144 |
echo "TXM: already up to date.";
|
|
| 144 |
echo "TXM: already up to date." |
|
| 145 | 145 |
fi |
| 146 | 146 |
|
| 147 | 147 |
) 1>&3 2>&4 |
| 148 | 148 |
|
| 149 | 149 |
# don't exec TXM if problem occurs |
| 150 | 150 |
if [ $? != 0 ]; then |
| 151 |
echo "TXM: An error occurred. Aborting$LOGFILESMSG";
|
|
| 151 |
echo "TXM: An error occurred. Aborting$LOGFILESMSG" |
|
| 152 | 152 |
exit 1 ; |
| 153 | 153 |
fi |
| 154 | 154 |
|
| tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java (revision 1710) | ||
|---|---|---|
| 831 | 831 |
protected boolean _load(Element e) {
|
| 832 | 832 |
//System.out.println("*** Load corpus: "+name);
|
| 833 | 833 |
if (e == null) {
|
| 834 |
System.out.println(TXMCoreMessages.warningColonCantLoadCorpus+this+TXMCoreMessages.informationsFromWorkspaceSelfElementNull); |
|
| 834 |
Log.warning(TXMCoreMessages.warningColonCantLoadCorpus+this); |
|
| 835 |
Log.warning(TXMCoreMessages.informationsFromWorkspaceSelfElementNull); |
|
| 835 | 836 |
return false; |
| 836 | 837 |
} |
| 837 | 838 |
|
| tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 1710) | ||
|---|---|---|
| 630 | 630 |
|
| 631 | 631 |
@Override |
| 632 | 632 |
public boolean canCompute() throws Exception {
|
| 633 |
return true;
|
|
| 633 |
return this.pID != null && this.pID.length() > 0;
|
|
| 634 | 634 |
} |
| 635 | 635 |
|
| 636 | 636 |
@Override |
| ... | ... | |
| 640 | 640 |
Log.warning("** TXM can't load MainCorpus when CQP search engine is not ready.");
|
| 641 | 641 |
return false; |
| 642 | 642 |
} |
| 643 |
|
|
| 644 |
if (this.pID == null || this.pID.length() == 0) {
|
|
| 645 |
Log.severe("** TXM can't load this MainCorpus: no CQP ID set.");
|
|
| 646 |
return false; |
|
| 647 |
} |
|
| 643 | 648 |
|
| 644 | 649 |
HashMap<String, MainCorpus> corpora = CorpusManager.getCorpusManager().getCorpora(); |
| 645 | 650 |
if (corpora.get(this.pID) != null && corpora.get(this.pID) != this) {
|
| ... | ... | |
| 652 | 657 |
this.registryFile = new File(getProjectDirectory(), "registry/"+getID().toLowerCase()); |
| 653 | 658 |
|
| 654 | 659 |
try {
|
| 655 |
|
|
| 656 | 660 |
try {
|
| 657 | 661 |
PatchCwbRegistry.patch(this.registryFile, this.dataDirectory); |
| 658 | 662 |
} catch (IOException e) {
|
| 659 |
Log.severe(TXMCoreMessages.bind("Error while updating registry file {0}.", this.registryFile));
|
|
| 663 |
Log.severe(TXMCoreMessages.bind("Error while updating the {0} registry file .", this.registryFile));
|
|
| 660 | 664 |
Log.printStackTrace(e); |
| 661 | 665 |
return false; |
| 662 | 666 |
} |
| tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java (revision 1710) | ||
|---|---|---|
| 73 | 73 |
state = false; |
| 74 | 74 |
// test if must-have properties for CWB are set |
| 75 | 75 |
|
| 76 |
// String reg_path = ""; // new way that concats registry of loaded corpus |
|
| 77 |
// String path_separator = System.getProperty("path.separator");
|
|
| 78 |
// File wl = Toolbox.workspace.getLocation(); |
|
| 79 |
// if (wl == null) {
|
|
| 80 |
// Log.severe("Error: Toolbox is not correctly initialized. Aborting CQP engine start...");
|
|
| 81 |
// return false; |
|
| 82 |
// } |
|
| 83 |
// for (File binDir : wl.listFiles(IOUtils.HIDDENFILE_FILTER)) {
|
|
| 84 |
// if (!binDir.isDirectory()) continue; |
|
| 85 |
// if (binDir.getName().startsWith(".")) continue;
|
|
| 86 |
// if (binDir.getName().startsWith("~")) continue;
|
|
| 87 |
// |
|
| 88 |
// File registryDir = new File(binDir, "registry"); |
|
| 89 |
// if (!registryDir.isDirectory()) continue; |
|
| 90 |
// |
|
| 91 |
// File[] files = registryDir.listFiles(IOUtils.HIDDENFILE_FILTER); |
|
| 92 |
// if (files != null && files.length > 0) {
|
|
| 93 |
// reg_path += path_separator + registryDir.getAbsolutePath(); |
|
| 94 |
// for (File registryFile : files) {
|
|
| 95 |
// if (registryFile.isHidden()) continue; |
|
| 96 |
// if (registryFile.isDirectory()) continue; |
|
| 97 |
// |
|
| 98 |
// File dataDirectory = new File(binDir, "data/"+registryFile.getName().toUpperCase()); |
|
| 99 |
// if (!dataDirectory.exists())dataDirectory = new File(binDir, "data"); // eventual old corpus |
|
| 100 |
// try {
|
|
| 101 |
// PatchCwbRegistry.patch(registryFile, dataDirectory); |
|
| 102 |
// } catch (IOException e) {
|
|
| 103 |
// Log.severe(TXMCoreMessages.bind("Error while updating registry file {0}.", registryFile));
|
|
| 104 |
// Log.printStackTrace(e); |
|
| 105 |
// return false; |
|
| 106 |
// } |
|
| 107 |
// } |
|
| 108 |
// } |
|
| 109 |
// } |
|
| 110 |
// if (reg_path.length() > 0) reg_path = reg_path.substring(path_separator.length()); // remove first path_separator |
|
| 111 |
// reg_path = reg_path.replace("\\\\", "//"); // fix the UNC paths for mingw
|
|
| 112 |
// |
|
| 113 | 76 |
String init_path = CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PATH_TO_INIT_FILE); |
| 114 | 77 |
if (init_path.length() > 0 && !new File(init_path).exists()) {
|
| 115 | 78 |
Log.warning(TXMCoreMessages.bind("Warning: the given CQP init file path can not be found in {0}.", init_path));
|
| ... | ... | |
| 391 | 354 |
e.printStackTrace(); |
| 392 | 355 |
System.out.println(Log.toString(e)); |
| 393 | 356 |
} |
| 394 |
} |
|
| 395 |
// Mac, Linux |
|
| 396 |
else {
|
|
| 357 |
} else { // Mac, Linux
|
|
| 397 | 358 |
String cmd = "kill `ps aux | grep cqpserver | awk '/-P "+CQPLibPreferences.getInstance().getString(CQPLibPreferences.CQI_SERVER_PORT)+"/ {print $2}'`"; // //$NON-NLS-1$ //$NON-NLS-2$
|
| 398 | 359 |
try {
|
| 399 | 360 |
//Process p = Runtime.getRuntime().exec("killall -9 cqpserver"); //$NON-NLS-1$
|
| tmp/org.txm.chartsengine.jfreechart.rcp/src/org/txm/chartsengine/jfreechart/rcp/handlers/OpenJFCChartPropertiesEditor.java (revision 1710) | ||
|---|---|---|
| 69 | 69 |
}); |
| 70 | 70 |
} |
| 71 | 71 |
else {
|
| 72 |
Log.severe("OpenJFCChartPropertiesEditor.execute(): Can not open chart properties interface for the current chart engine."); //$NON-NLS-1$
|
|
| 72 |
Log.warning("Can not open chart properties interface for the current chart engine."); //$NON-NLS-1$
|
|
| 73 | 73 |
} |
| 74 | 74 |
|
| 75 | 75 |
return null; |
| tmp/org.txm.rcp.feature/win/TXM.bat (revision 1710) | ||
|---|---|---|
| 71 | 71 |
:run |
| 72 | 72 |
|
| 73 | 73 |
set _JAVA_OPTIONS=-Duser.home="%USERHOME%" |
| 74 |
echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%"echo running "%installdir%TXM.exe" -log -run --launcher.ini "%DOTTXM%TXM.ini" -consolelog -clean -debug -console -noexit -data "%TXMHOME%corpora" -user "%DOTTXM%user" -install "%installdir%\"
|
|
| 75 |
REM "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" -data "%DOTTXM%corpora" -user "%DOTTXM%user" -install "%installdir%" |
|
| 74 |
echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%"
|
|
| 75 |
REM "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -data "%DOTTXM%corpora" -user "%DOTTXM%user" -install "%installdir%"
|
|
| 76 | 76 |
"%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -data "%TXMHOME%corpora" -user "%DOTTXM%user" -install "%installdir%\" |
Formats disponibles : Unified diff