Révision 2861
tmp/org.txm.queryindex.rcp/src/org/txm/queryindex/core/functions/QueryIndex.java (revision 2861) | ||
---|---|---|
240 | 240 |
* @return true, if successful |
241 | 241 |
*/ |
242 | 242 |
@Override |
243 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
243 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
244 | 244 |
try { |
245 | 245 |
toTxt(outfile, 0, lines.size(), encoding, colseparator, txtseparator); |
246 | 246 |
} |
tmp/org.txm.properties.core/src/org/txm/properties/core/functions/Properties.java (revision 2861) | ||
---|---|---|
262 | 262 |
} |
263 | 263 |
|
264 | 264 |
@Override |
265 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
265 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
266 | 266 |
return toTxt(outfile, encoding, 100); |
267 | 267 |
} |
268 | 268 |
|
tmp/org.txm.index.core/src/org/txm/index/core/functions/___Lexicon2.java (revision 2861) | ||
---|---|---|
604 | 604 |
*/ |
605 | 605 |
@Override |
606 | 606 |
@Deprecated |
607 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
607 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
608 | 608 |
// NK: writer declared as class attribute to perform a clean if the operation is interrupted |
609 | 609 |
// OutputStreamWriter writer; |
610 | 610 |
try { |
tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java (revision 2861) | ||
---|---|---|
1117 | 1117 |
@Override |
1118 | 1118 |
// FIXME: should be in an exporter extension |
1119 | 1119 |
@Deprecated |
1120 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
1120 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
1121 | 1121 |
try { |
1122 | 1122 |
toTxt(outfile, 0, lines.size(), encoding, colseparator, txtseparator); |
1123 | 1123 |
} |
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 2861) | ||
---|---|---|
2023 | 2023 |
public String getValidFileName() { |
2024 | 2024 |
try { |
2025 | 2025 |
// return FILE_NAME_PATTERN.matcher(this.getCurrentName()).replaceAll(UNDERSCORE); |
2026 |
return this.getCurrentName().replaceAll("[¤€§µ£°().,;:/?§%\"'*+\\-}\\]\\[{#~&]", ""); |
|
2026 |
return this.getCurrentName().replaceAll("[¤€§µ£°().,;:/?§%\"'*+\\-}\\]\\[{#~&@<>]", "");
|
|
2027 | 2027 |
} |
2028 | 2028 |
catch (Exception e) { |
2029 | 2029 |
Log.printStackTrace(e); |
... | ... | |
2657 | 2657 |
|
2658 | 2658 |
|
2659 | 2659 |
|
2660 |
@Deprecated |
|
2660 |
|
|
2661 |
// |
|
2662 |
/** |
|
2663 |
* @Deprecated |
|
2664 |
* FIXME: SJ: should be moved in an exporter extension |
|
2665 |
* |
|
2666 |
* wrapper to ensure the result is ready to be computed (not computing, computed) |
|
2667 |
* |
|
2668 |
* @param outfile |
|
2669 |
* @param encoding |
|
2670 |
* @param colseparator |
|
2671 |
* @param txtseparator |
|
2672 |
* @return |
|
2673 |
* @throws Exception |
|
2674 |
*/ |
|
2675 |
public final boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
2676 |
if (isComputing()) { |
|
2677 |
Log.warning("The result is currently being computed. Please wait before exporting."); |
|
2678 |
return false; |
|
2679 |
} |
|
2680 |
if (!hasBeenComputedOnce()) { |
|
2681 |
Log.warning("The result was not computed. Please compute the result before exporting."); |
|
2682 |
return false; |
|
2683 |
} |
|
2684 |
return _toTxt(outfile, encoding, colseparator, txtseparator); |
|
2685 |
} |
|
2686 |
|
|
2687 |
/** |
|
2688 |
* @Deprecated |
|
2661 | 2689 |
// FIXME: SJ: should be moved in an exporter extension |
2662 |
public abstract boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception; |
|
2690 |
* |
|
2691 |
* TXMResults must implement this method to be exported. |
|
2692 |
* |
|
2693 |
* @param outfile |
|
2694 |
* @param encoding |
|
2695 |
* @param colseparator |
|
2696 |
* @param txtseparator |
|
2697 |
* @return |
|
2698 |
* @throws Exception |
|
2699 |
*/ |
|
2700 |
protected abstract boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception; |
|
2663 | 2701 |
|
2664 | 2702 |
|
2665 | 2703 |
|
tmp/org.txm.core/src/java/org/txm/objects/Text.java (revision 2861) | ||
---|---|---|
314 | 314 |
} |
315 | 315 |
|
316 | 316 |
@Override |
317 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
317 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
318 | 318 |
return false; |
319 | 319 |
} |
320 | 320 |
|
tmp/org.txm.core/src/java/org/txm/objects/SavedQuery.java (revision 2861) | ||
---|---|---|
183 | 183 |
} |
184 | 184 |
|
185 | 185 |
@Override |
186 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
186 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
187 | 187 |
return false; |
188 | 188 |
} |
189 | 189 |
|
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 2861) | ||
---|---|---|
440 | 440 |
} |
441 | 441 |
|
442 | 442 |
@Override |
443 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
443 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
444 | 444 |
return false; |
445 | 445 |
} |
446 | 446 |
|
tmp/org.txm.core/src/java/org/txm/objects/Workspace.java (revision 2861) | ||
---|---|---|
192 | 192 |
|
193 | 193 |
@Override |
194 | 194 |
@Deprecated |
195 |
public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception { |
|
195 |
public boolean _toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
|
|
196 | 196 |
return false; |
197 | 197 |
} |
198 | 198 |
|
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 2861) | ||
---|---|---|
965 | 965 |
} |
966 | 966 |
|
967 | 967 |
@Override |
968 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
968 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
969 | 969 |
return false; |
970 | 970 |
} |
971 | 971 |
|
tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java (revision 2861) | ||
---|---|---|
372 | 372 |
|
373 | 373 |
|
374 | 374 |
@Override |
375 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
375 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
376 | 376 |
PrintWriter writer = IOUtils.getWriter(outfile, encoding); |
377 | 377 |
for (int ipage = 0; ipage < nmatches; ipage++) { // run through all pages |
378 | 378 |
LinkedHashMap<Property, List<String>> page = getPageContent(ipage); |
tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java (revision 2861) | ||
---|---|---|
231 | 231 |
|
232 | 232 |
|
233 | 233 |
@Override |
234 |
public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception { |
|
234 |
public boolean _toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
|
|
235 | 235 |
// TODO Auto-generated method stub |
236 | 236 |
return false; |
237 | 237 |
} |
tmp/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java (revision 2861) | ||
---|---|---|
686 | 686 |
} |
687 | 687 |
|
688 | 688 |
@Override |
689 |
public boolean toTxt(File outfile, String encoding, String colseparator, |
|
689 |
public boolean _toTxt(File outfile, String encoding, String colseparator,
|
|
690 | 690 |
String txtseparator) throws Exception { |
691 | 691 |
return toTxt(outfile, encoding); |
692 | 692 |
} |
tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java (revision 2861) | ||
---|---|---|
312 | 312 |
|
313 | 313 |
|
314 | 314 |
@Override |
315 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
315 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
316 | 316 |
// TODO Auto-generated method stub |
317 | 317 |
return false; |
318 | 318 |
} |
tmp/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TIGERSearch.java (revision 2861) | ||
---|---|---|
186 | 186 |
} |
187 | 187 |
|
188 | 188 |
@Override |
189 |
public boolean toTxt(File outfile, String encoding, String colseparator, |
|
190 |
String txtseparator) throws Exception { |
|
189 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
191 | 190 |
return tsresult.toXml(outfile); |
192 | 191 |
} |
193 | 192 |
|
tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java (revision 2861) | ||
---|---|---|
224 | 224 |
} |
225 | 225 |
|
226 | 226 |
@Override |
227 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
227 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
228 | 228 |
// TODO Auto-generated method stub |
229 | 229 |
return false; |
230 | 230 |
} |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java (revision 2861) | ||
---|---|---|
162 | 162 |
|
163 | 163 |
@Override |
164 | 164 |
@Deprecated |
165 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
165 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
166 | 166 |
return this.toTxt(outfile, encoding, colseparator, txtseparator); |
167 | 167 |
} |
168 | 168 |
|
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 2861) | ||
---|---|---|
612 | 612 |
|
613 | 613 |
|
614 | 614 |
@Override |
615 |
public boolean toTxt(File output, String encoding, String colseparator, String txtseparator) throws Exception { |
|
615 |
public boolean _toTxt(File output, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
616 | 616 |
IOUtils.write(output, this.dumpPreferences()); |
617 | 617 |
return output.exists(); |
618 | 618 |
} |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 2861) | ||
---|---|---|
625 | 625 |
} |
626 | 626 |
|
627 | 627 |
@Override |
628 |
public boolean toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception { |
|
628 |
public boolean _toTxt(File arg0, String arg1, String arg2, String arg3) throws Exception {
|
|
629 | 629 |
// TODO Auto-generated method stub |
630 | 630 |
return true; |
631 | 631 |
} |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java (revision 2861) | ||
---|---|---|
591 | 591 |
|
592 | 592 |
@Override |
593 | 593 |
@Deprecated |
594 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
594 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
595 | 595 |
return false; |
596 | 596 |
} |
597 | 597 |
|
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/selection/Selection.java (revision 2861) | ||
---|---|---|
523 | 523 |
} |
524 | 524 |
|
525 | 525 |
@Override |
526 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
526 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
527 | 527 |
// TODO Auto-generated method stub |
528 | 528 |
return false; |
529 | 529 |
} |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/summary/Summary.java (revision 2861) | ||
---|---|---|
295 | 295 |
|
296 | 296 |
|
297 | 297 |
@Override |
298 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
298 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
299 | 299 |
|
300 | 300 |
return false; |
301 | 301 |
} |
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/preview/Preview.java (revision 2861) | ||
---|---|---|
124 | 124 |
} |
125 | 125 |
|
126 | 126 |
@Override |
127 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
127 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
128 | 128 |
// TODO Auto-generated method stub |
129 | 129 |
return false; |
130 | 130 |
} |
tmp/org.txm.referencer.core/src/org/txm/referencer/core/functions/Referencer.java (revision 2861) | ||
---|---|---|
518 | 518 |
} |
519 | 519 |
|
520 | 520 |
@Deprecated |
521 |
public boolean toTxt(File outfile, String encoding) { |
|
521 |
public boolean toTxt(File outfile, String encoding) throws Exception {
|
|
522 | 522 |
return toTxt(outfile, encoding, "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$ |
523 | 523 |
} |
524 | 524 |
|
525 | 525 |
@Override |
526 | 526 |
@Deprecated |
527 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
527 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
528 | 528 |
try { |
529 | 529 |
// NK: writer declared as class attribute to perform a clean if the operation is interrupted |
530 | 530 |
this.writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outfile), encoding)); |
tmp/org.txm.specificities.core/src/org/txm/functions/contrasts/Contrast.java (revision 2861) | ||
---|---|---|
97 | 97 |
* @throws StatException the stat exception |
98 | 98 |
* @throws IOException |
99 | 99 |
*/ |
100 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws StatException, IOException { |
|
100 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws StatException, IOException {
|
|
101 | 101 |
|
102 | 102 |
OutputStreamWriter writer; |
103 | 103 |
try { |
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java (revision 2861) | ||
---|---|---|
303 | 303 |
|
304 | 304 |
@Override |
305 | 305 |
@Deprecated |
306 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
306 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
307 | 307 |
// TODO Auto-generated method stub |
308 | 308 |
return false; |
309 | 309 |
} |
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java (revision 2861) | ||
---|---|---|
528 | 528 |
} |
529 | 529 |
|
530 | 530 |
@Override |
531 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
531 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
532 | 532 |
|
533 | 533 |
// NK: Declared as class attribute to perform a clean if the operation is |
534 | 534 |
// interrupted |
... | ... | |
558 | 558 |
txt += colseparator + "f_" + colname + colseparator + "score_" + colname; //$NON-NLS-1$ //$NON-NLS-2$ |
559 | 559 |
} |
560 | 560 |
writer.write(txt + "\n"); //$NON-NLS-1$ |
561 |
|
|
561 |
String[] typeNames = getTypeNames(); |
|
562 | 562 |
// write data |
563 | 563 |
for (int ii = 0; ii < frequencies.length; ii++) { |
564 |
txt = txtseparator + getTypeNames()[ii].replace(txtseparator, txtseparator + txtseparator)
|
|
564 |
txt = txtseparator + typeNames[ii].replace(txtseparator, txtseparator + txtseparator)
|
|
565 | 565 |
+ txtseparator; |
566 | 566 |
int somme = 0; |
567 | 567 |
String txtcols = ""; //$NON-NLS-1$ |
... | ... | |
577 | 577 |
} |
578 | 578 |
catch (IOException e) { |
579 | 579 |
org.txm.utils.logger.Log.printStackTrace(e); |
580 |
releaseSemaphore(); |
|
580 | 581 |
return false; |
581 | 582 |
} |
582 | 583 |
finally { |
... | ... | |
586 | 587 |
return true; |
587 | 588 |
} |
588 | 589 |
|
590 |
/** |
|
591 |
* release the R semaphore |
|
592 |
*/ |
|
593 |
public void resetComputingState() { |
|
594 |
super.resetComputingState(); |
|
595 |
releaseSemaphore(); |
|
596 |
} |
|
597 |
|
|
589 | 598 |
@Override |
590 | 599 |
public void clean() { |
591 | 600 |
try { |
tmp/org.txm.para.core/src/org/txm/para/core/functions/ParaBrowser.java (revision 2861) | ||
---|---|---|
255 | 255 |
|
256 | 256 |
|
257 | 257 |
@Override |
258 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
258 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
259 | 259 |
// TODO Auto-generated method stub |
260 | 260 |
return false; |
261 | 261 |
} |
tmp/org.txm.querycooccurrences.rcp/src/org/txm/functions/coocmatrix/QueryAutoCooccurrence.java (revision 2861) | ||
---|---|---|
253 | 253 |
} |
254 | 254 |
|
255 | 255 |
@Override |
256 |
public boolean toTxt(File outfile, String encoding, String colseparator, |
|
257 |
String txtseparator) throws Exception { |
|
256 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
258 | 257 |
return toGraphml(outfile); |
259 | 258 |
} |
260 | 259 |
|
tmp/org.txm.querycooccurrences.rcp/src/org/txm/functions/coocmatrix/QueryCooccurrence.java (revision 2861) | ||
---|---|---|
162 | 162 |
} |
163 | 163 |
|
164 | 164 |
@Override |
165 |
public boolean toTxt(File outfile, String encoding, String colseparator, |
|
166 |
String txtseparator) throws Exception { |
|
165 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
167 | 166 |
return false; |
168 | 167 |
} |
169 | 168 |
|
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 2861) | ||
---|---|---|
915 | 915 |
* @param outfile the outfile |
916 | 916 |
* @param encoding the encoding |
917 | 917 |
* @return true, if successful |
918 |
* @throws Exception |
|
918 | 919 |
*/ |
919 | 920 |
// FIXME: to move in an exporter extension |
920 | 921 |
@Deprecated |
921 |
public boolean toTxt(File outfile, String encoding) { |
|
922 |
public boolean toTxt(File outfile, String encoding) throws Exception {
|
|
922 | 923 |
return toTxt(outfile, encoding, "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$ |
923 | 924 |
} |
924 | 925 |
|
... | ... | |
934 | 935 |
@Override |
935 | 936 |
// FIXME: to move in an exporter extension |
936 | 937 |
@Deprecated |
937 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
938 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
938 | 939 |
acquireSemaphore(); |
939 | 940 |
boolean rez = r_ca.toTxt(outfile, encoding, colseparator, txtseparator); |
940 | 941 |
releaseSemaphore(); |
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/Eigenvalues.java (revision 2861) | ||
---|---|---|
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
@Override |
121 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
121 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
122 | 122 |
// TODO Auto-generated method stub |
123 | 123 |
return false; |
124 | 124 |
} |
tmp/org.txm.cooccurrence.chartsengine/src/org/txm/cooccurrence/functions/CooccurrenceGraph.java (revision 2861) | ||
---|---|---|
154 | 154 |
* @see org.txm.core.results.TXMResult#toTxt(java.io.File, java.lang.String, java.lang.String, java.lang.String) |
155 | 155 |
*/ |
156 | 156 |
@Override |
157 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
157 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception {
|
|
158 | 158 |
// TODO Auto-generated method stub |
159 | 159 |
return false; |
160 | 160 |
} |
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ExportResult.java (revision 2861) | ||
---|---|---|
52 | 52 |
import org.txm.rcp.messages.TXMUIMessages; |
53 | 53 |
import org.txm.rcp.swt.dialog.LastOpened; |
54 | 54 |
import org.txm.rcp.utils.JobHandler; |
55 |
import org.txm.utils.logger.Log; |
|
55 | 56 |
|
56 | 57 |
/** |
57 | 58 |
* Exports a result by calling the function toTxt(File f) then opens or not the result in the text editor according to the preferences. |
... | ... | |
107 | 108 |
outfile.createNewFile(); |
108 | 109 |
} |
109 | 110 |
catch (IOException e1) { |
110 |
System.err.println(NLS.bind(TXMUIMessages.exportColonCantCreateFileP0ColonP1, outfile, e1));
|
|
111 |
Log.warning(NLS.bind(TXMUIMessages.exportColonCantCreateFileP0ColonP1, outfile, e1));
|
|
111 | 112 |
} |
112 | 113 |
if (!outfile.canWrite()) { |
113 |
System.out.println(NLS.bind(TXMUIMessages.impossibleToReadP0, outfile));
|
|
114 |
Log.warning(NLS.bind(TXMUIMessages.impossibleToReadP0, outfile));
|
|
114 | 115 |
return null; |
115 | 116 |
} |
116 | 117 |
if (!outfile.isFile()) { |
117 |
System.out.println("Error: " + outfile + " is not a file"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
118 |
Log.warning("Error: " + outfile + " is not a file"); //$NON-NLS-1$ //$NON-NLS-2$
|
|
118 | 119 |
return null; |
119 | 120 |
} |
120 | 121 |
|
... | ... | |
140 | 141 |
TXMResult r = (TXMResult) s; |
141 | 142 |
|
142 | 143 |
// compute the result if needed |
143 |
if (!r.isAltered()) { |
|
144 |
if (!r.isAltered() && r.isDirty()) {
|
|
144 | 145 |
r.compute(this); |
145 | 146 |
} |
146 | 147 |
|
147 | 148 |
r.toTxt(outfile, encoding, colseparator, txtseparator); |
148 | 149 |
} |
149 | 150 |
else { |
150 |
System.out.println("Exported object is not a TXMResult result");
|
|
151 |
Log.warning("Exported object is not a TXMResult result");
|
|
151 | 152 |
return Status.CANCEL_STATUS; |
152 | 153 |
} |
153 | 154 |
|
... | ... | |
162 | 163 |
} |
163 | 164 |
}); |
164 | 165 |
} |
165 |
|
|
166 |
System.out.println(NLS.bind("", outfile.getAbsolutePath())); //$NON-NLS-1$ |
|
167 | 166 |
} |
168 | 167 |
else { |
169 |
System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, outfile.getAbsolutePath()));
|
|
168 |
Log.warning(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, outfile.getAbsolutePath()));
|
|
170 | 169 |
} |
171 | 170 |
} |
172 | 171 |
catch (ThreadDeath td) { |
172 |
TXMResult r = (TXMResult) s; |
|
173 |
r.resetComputingState(); |
|
173 | 174 |
return Status.CANCEL_STATUS; |
174 | 175 |
} |
175 | 176 |
catch (Exception e) { |
176 |
System.out.println(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, s, e));
|
|
177 |
Log.warning(NLS.bind(TXMUIMessages.failedToExportResultP0ColonP1, s, e));
|
|
177 | 178 |
org.txm.utils.logger.Log.printStackTrace(e); |
178 | 179 |
return Status.CANCEL_STATUS; |
179 | 180 |
} |
tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 2861) | ||
---|---|---|
1442 | 1442 |
* @param outfile the outfile |
1443 | 1443 |
* @param encoding the encoding |
1444 | 1444 |
* @return true, if successful |
1445 |
* @throws Exception |
|
1445 | 1446 |
*/ |
1446 |
public boolean toTxt(File outfile, String encoding) { |
|
1447 |
public boolean toTxt(File outfile, String encoding) throws Exception {
|
|
1447 | 1448 |
return toTxt(outfile, encoding, "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$ |
1448 | 1449 |
} |
1449 | 1450 |
|
... | ... | |
1457 | 1458 |
* @return true, if successful |
1458 | 1459 |
*/ |
1459 | 1460 |
@Override |
1460 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
1461 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
1461 | 1462 |
try { |
1462 | 1463 |
// NK: writer declared as class attribute to perform a clean if the operation is interrupted |
1463 | 1464 |
this.writer = new BufferedWriter(new OutputStreamWriter( |
tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 2861) | ||
---|---|---|
1553 | 1553 |
@Override |
1554 | 1554 |
@Deprecated |
1555 | 1555 |
// FIXME: should be moved in a exporter RCP extension |
1556 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws IOException { |
|
1556 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws IOException {
|
|
1557 | 1557 |
|
1558 | 1558 |
// NK: writer declared as class attribute to perform a clean if the operation is interrupted |
1559 | 1559 |
OutputStreamWriter writer = null; |
tmp/org.txm.ahc.core/src/org/txm/ahc/core/functions/AHC.java (revision 2861) | ||
---|---|---|
361 | 361 |
// FIXME: SJ: to extract to future exporter extension |
362 | 362 |
@Override |
363 | 363 |
@Deprecated |
364 |
public boolean toTxt(File outfile, String encoding, String colsep, String txtsep) { |
|
364 |
public boolean _toTxt(File outfile, String encoding, String colsep, String txtsep) {
|
|
365 | 365 |
return toTxt(outfile, encoding); |
366 | 366 |
} |
367 | 367 |
|
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ContextSubcorpus.java (revision 2861) | ||
---|---|---|
37 | 37 |
} |
38 | 38 |
|
39 | 39 |
@Override |
40 |
public boolean toTxt(File outfile, String encoding, String colseparator, |
|
40 |
public boolean _toTxt(File outfile, String encoding, String colseparator,
|
|
41 | 41 |
String txtseparator) throws Exception { |
42 | 42 |
return false; |
43 | 43 |
} |
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ValuesOfQuery.java (revision 2861) | ||
---|---|---|
174 | 174 |
} |
175 | 175 |
|
176 | 176 |
@Override |
177 |
public boolean toTxt(File outfile, String encoding, String colseparator, |
|
178 |
String txtseparator) throws Exception { |
|
177 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) throws Exception { |
|
179 | 178 |
// TODO Auto-generated method stub |
180 | 179 |
return false; |
181 | 180 |
} |
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpII.java (revision 2861) | ||
---|---|---|
353 | 353 |
* @return true, if successful |
354 | 354 |
*/ |
355 | 355 |
@Override |
356 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
356 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
357 | 357 |
try { |
358 | 358 |
toTxt(outfile, 0, lines.size(), encoding, colseparator, txtseparator); |
359 | 359 |
} |
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpI.java (revision 2861) | ||
---|---|---|
193 | 193 |
* @return true, if successful |
194 | 194 |
*/ |
195 | 195 |
@Override |
196 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
196 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
197 | 197 |
try { |
198 | 198 |
toTxt(outfile, 0, lines.size(), encoding, colseparator, txtseparator); |
199 | 199 |
} |
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 2861) | ||
---|---|---|
710 | 710 |
// } |
711 | 711 |
|
712 | 712 |
@Override |
713 |
public boolean toTxt(File outfile, String encoding, String colseparator, String txtseparator) { |
|
713 |
public boolean _toTxt(File outfile, String encoding, String colseparator, String txtseparator) {
|
|
714 | 714 |
return statsData.toTxt(outfile, encoding, colseparator, txtseparator); |
715 | 715 |
} |
716 | 716 |
|
Formats disponibles : Unified diff