Révision 840

tmp/org.txm.core/src/java/org/txm/core/preferences/package.html (revision 840)
1
Core preferences: contains the low level preferences and the TXMPreferences utility class to access preferences
1
<html><body>Core preferences: contains the low level preferences and the TXMPreferences utility class to access preferences</body></html>
2

  
tmp/org.txm.core/src/java/org/txm/core/results/package.html (revision 840)
1
abtract classes to use TXM commands
1
<html>
2
<body>abtract classes to use TXM commands</body>
3
</html>
tmp/org.txm.core/src/java/org/txm/core/messages/package.html (revision 840)
1
Core message keys : contains the low level shared messages
1
<html>
2
<body>
3
Core message keys : contains the low level shared messages
4
</body>
5
</html>
tmp/org.txm.core/src/java/org/txm/core/messages/TXMCoreMessages.java (revision 840)
32 32
	public static String common_query;
33 33
	public static String common_rows;
34 34
	public static String common_structure;
35
	public static String common_strucutralUnit;
35
	public static String common_structuralUnit;
36 36
	public static String common_units;
37 37
	public static String common_frequency;
38 38

  
tmp/org.txm.core/src/java/org/txm/objects/Partition.java (revision 840)
29 29

  
30 30

  
31 31

  
32
// TODO: Auto-generated Javadoc
33 32
/**
34
 * The Class Partition.
33
 * Partition abstract representation
35 34
 */
36 35
public class Partition extends TxmObject {
37 36

  
tmp/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TSResult.java (revision 840)
41 41
import ims.tiger.query.internalapi.InternalCorpusQueryManager;
42 42

  
43 43
import java.io.File;
44
import java.io.FileNotFoundException;
45 44
import java.io.IOException;
46
import java.io.UnsupportedEncodingException;
47 45
import java.util.ArrayList;
48
import java.util.Arrays;
49 46
import java.util.List;
50 47

  
51
import javax.xml.parsers.ParserConfigurationException;
52 48
import javax.xml.transform.TransformerException;
53 49

  
54 50
import org.txm.core.messages.TXMCoreMessages;
55
import org.txm.core.preferences.TBXPreferences;
56
import org.txm.core.preferences.TXMPreferences;
57
import org.txm.export.ts.ConcordanceBlocks;
58
import org.txm.export.ts.MatchInject;
59
import org.txm.export.ts.PunctInject;
60 51
import org.txm.importer.ApplyXsl2;
61
import org.txm.utils.logger.Log;
62
import org.txm.utils.xml.DomUtils;
63
import org.w3c.dom.Document;
64
import org.xml.sax.SAXException;
65 52

  
66 53
// TODO: Auto-generated Javadoc
67 54
/**
......
277 264
		return toXml(outfile, xmlFile, xslFile, false, 30, new ArrayList<String>(), new ArrayList<String>());
278 265
	}
279 266

  
280
	public static String CONCSIMPLE = "concordance_simple"; //$NON-NLS-1$
281
	public static String CONCMOTPIVOT = "concordance_mot-pivot"; //$NON-NLS-1$
282
	public static String CONCBLOCKS = "concordance_blocks"; //$NON-NLS-1$
283
	public static String[] EXPORTMETHODS = {CONCSIMPLE, CONCMOTPIVOT, CONCBLOCKS};
284
	public boolean toConcordance(File csvFile, String method, int cx, List<String> list, List<String> list2, boolean punct) throws Exception
285
	{
286
		if (!Arrays.asList(EXPORTMETHODS).contains(method)) {
287
			Log.severe(TXMCoreMessages.TSResult_7+method+TXMCoreMessages.TSResult_8+Arrays.toString(EXPORTMETHODS));
288
			return false;
289
		}
267
	//TODO move this code somewhere
268
//	public static String CONCSIMPLE = "concordance_simple"; //$NON-NLS-1$
269
//	public static String CONCMOTPIVOT = "concordance_mot-pivot"; //$NON-NLS-1$
270
//	public static String CONCBLOCKS = "concordance_blocks"; //$NON-NLS-1$
271
//	public static String[] EXPORTMETHODS = {CONCSIMPLE, CONCMOTPIVOT, CONCBLOCKS};
272
//	public boolean toConcordance(File csvFile, String method, int cx, List<String> list, List<String> list2, boolean punct) throws Exception
273
//	{
274
//		if (!Arrays.asList(EXPORTMETHODS).contains(method)) {
275
//			Log.severe(TXMCoreMessages.TSResult_7+method+TXMCoreMessages.TSResult_8+Arrays.toString(EXPORTMETHODS));
276
//			return false;
277
//		}
278
//
279
//		File xmlFile = File.createTempFile(csvFile.getName(), "EXPORTBRUT.xml", csvFile.getParentFile()); //$NON-NLS-1$
280
//		boolean rez = false;
281
//		if (punct) { 
282
//			// export match
283
//			//System.out.println("save matches in "+xmlFile);
284
//			this.toXml(xmlFile, false, true, false, false, true, false, 0);
285
//			//FileCopy.copy(xmlFile, new File(xmlFile.getParentFile(), "EXPORTBRUT.xml"));
286
//			// merge with TigerXMLPOSPNC
287
//			File tmp = File.createTempFile("txm", "AFTERMINJECT.xml", xmlFile.getParentFile()); //$NON-NLS-1$ //$NON-NLS-2$
288
//			File tigerXml = new File(tsCorpus.tsmanager.getRegistryPath(), "TigerPnc.xml"); //$NON-NLS-1$
289
//			//System.out.println("TIGER XML: "+tigerXml);
290
//			if (!tigerXml.exists()) {
291
//				System.out.println(TXMCoreMessages.TSResult_13+tigerXml.getAbsolutePath());
292
//				return false;
293
//			}
294
//			//System.out.println("Match inject: in "+tmp);
295
//			new MatchInject().script(tigerXml, xmlFile, tmp);
296
//			xmlFile.delete();
297
//			tmp.renameTo(xmlFile);
298
//			//FileCopy.copy(xmlFile, new File(xmlFile.getParentFile(), "AFTERMINJECT.xml"));
299
//		} else {
300
//			this.toXml(xmlFile); // export match + corpus
301
//			//FileCopy.copy(xmlFile, new File(xmlFile.getParentFile(), "FULLEXPORT.xml"));
302
//		}
303
//
304
//		if (!xmlFile.exists()) { System.out.println(TXMCoreMessages.TSResult_14); return false;}
305
//
306
//		if (method.equals("concordance_blocks")) { //$NON-NLS-1$
307
//			ConcordanceBlocks builder = new ConcordanceBlocks();
308
//			rez = builder.process(xmlFile, csvFile, cx, list, list2);
309
//		} else { // XSL method
310
//			File xslDir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "xsl"); //$NON-NLS-1$
311
//			File xslFile = new File(xslDir, method+".xsl"); //$NON-NLS-1$
312
//			if (!xslFile.exists()) {
313
//				Log.severe(TXMCoreMessages.TSResult_7+xslFile);
314
//				return false;
315
//			}
316
//
317
//			rez = toXml(csvFile, xmlFile, xslFile, punct, cx, list, list2);
318
//		}
319
//		xmlFile.delete(); // no more needed
320
//		return rez;
321
//	}
290 322

  
291
		File xmlFile = File.createTempFile(csvFile.getName(), "EXPORTBRUT.xml", csvFile.getParentFile()); //$NON-NLS-1$
292
		boolean rez = false;
293
		if (punct) { 
294
			// export match
295
			//System.out.println("save matches in "+xmlFile);
296
			this.toXml(xmlFile, false, true, false, false, true, false, 0);
297
			//FileCopy.copy(xmlFile, new File(xmlFile.getParentFile(), "EXPORTBRUT.xml"));
298
			// merge with TigerXMLPOSPNC
299
			File tmp = File.createTempFile("txm", "AFTERMINJECT.xml", xmlFile.getParentFile()); //$NON-NLS-1$ //$NON-NLS-2$
300
			File tigerXml = new File(tsCorpus.tsmanager.getRegistryPath(), "TigerPnc.xml"); //$NON-NLS-1$
301
			//System.out.println("TIGER XML: "+tigerXml);
302
			if (!tigerXml.exists()) {
303
				System.out.println(TXMCoreMessages.TSResult_13+tigerXml.getAbsolutePath());
304
				return false;
305
			}
306
			//System.out.println("Match inject: in "+tmp);
307
			new MatchInject().script(tigerXml, xmlFile, tmp);
308
			xmlFile.delete();
309
			tmp.renameTo(xmlFile);
310
			//FileCopy.copy(xmlFile, new File(xmlFile.getParentFile(), "AFTERMINJECT.xml"));
311
		} else {
312
			this.toXml(xmlFile); // export match + corpus
313
			//FileCopy.copy(xmlFile, new File(xmlFile.getParentFile(), "FULLEXPORT.xml"));
314
		}
315

  
316
		if (!xmlFile.exists()) { System.out.println(TXMCoreMessages.TSResult_14); return false;}
317

  
318
		if (method.equals("concordance_blocks")) { //$NON-NLS-1$
319
			ConcordanceBlocks builder = new ConcordanceBlocks();
320
			rez = builder.process(xmlFile, csvFile, cx, list, list2);
321
		} else { // XSL method
322
			File xslDir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE), "xsl"); //$NON-NLS-1$
323
			File xslFile = new File(xslDir, method+".xsl"); //$NON-NLS-1$
324
			if (!xslFile.exists()) {
325
				Log.severe(TXMCoreMessages.TSResult_7+xslFile);
326
				return false;
327
			}
328

  
329
			rez = toXml(csvFile, xmlFile, xslFile, punct, cx, list, list2);
330
		}
331
		xmlFile.delete(); // no more needed
332
		return rez;
333
	}
334

  
335 323
	public boolean toXml(File outfile) throws ExportException, ExportStopException
336 324
	{
337 325
		toXml(outfile, true, true);
......
362 350
		return toXml(outfile, includeNonMatch, includeMatch, includeXmlHeader, includeXMLSentenceStructure, includeXMLMatchInformation, refineSchema, referSchema);
363 351
	}
364 352

  
365
	@Deprecated
366
	private void injectPunct(File xmlfile)
367
	{
368
		System.out.println(TXMCoreMessages.TSResult_18);
369
		String corpus = this.tsCorpus.id.toUpperCase();
370
		try {
371
			Document dom = DomUtils.load(xmlfile);
372
			//System.out.println("Getting words of "+corpus);
373
			Object words = PunctInject.getWords(corpus, ""); //$NON-NLS-1$
353
//	@Deprecated
354
//	private void injectPunct(File xmlfile)
355
//	{
356
//		System.out.println(TXMCoreMessages.TSResult_18);
357
//		String corpus = this.tsCorpus.id.toUpperCase();
358
//		try {
359
//			Document dom = DomUtils.load(xmlfile);
360
//			//System.out.println("Getting words of "+corpus);
361
//			Object words = PunctInject.getWords(corpus, ""); //$NON-NLS-1$
362
//
363
//			//			int i = 0;
364
//			//			for(String[] word : (ArrayList<String[]>)words)
365
//			//			{
366
//			//				if(i++ % 10 == 0) System.out.println();
367
//			//				System.out.print("[\""+word[0]+"\", \""+word[1].replace("\"", "\\\"")+"\"], ");
368
//			//			}
369
//			File outfile = File.createTempFile("punct", ".xml", xmlfile.getParentFile()); //$NON-NLS-1$ //$NON-NLS-2$
370
//			//System.out.println("Processing "+xmlfile+" to "+outfile);
371
//			Document doc = (Document) new PunctInject().process(dom, words);
372
//			//System.out.println("Saving file");
373
//			DomUtils.save(doc, outfile);
374
//
375
//			//			FileCopy.copy(outfile, new File(outfile.getParentFile(), "afterinject.xml"));
376
//
377
//			xmlfile.delete();
378
//			outfile.renameTo(xmlfile);
379
//		} catch (UnsupportedEncodingException e) {
380
//			// TODO Auto-generated catch block
381
//			org.txm.utils.logger.Log.printStackTrace(e);
382
//		} catch (FileNotFoundException e) {
383
//			// TODO Auto-generated catch block
384
//			org.txm.utils.logger.Log.printStackTrace(e);
385
//		} catch (ParserConfigurationException e) {
386
//			// TODO Auto-generated catch block
387
//			org.txm.utils.logger.Log.printStackTrace(e);
388
//		} catch (SAXException e) {
389
//			// TODO Auto-generated catch block
390
//			org.txm.utils.logger.Log.printStackTrace(e);
391
//		} catch (IOException e) {
392
//			// TODO Auto-generated catch block
393
//			org.txm.utils.logger.Log.printStackTrace(e);
394
//		}
395
//
396
//
397
//	}
374 398

  
375
			//			int i = 0;
376
			//			for(String[] word : (ArrayList<String[]>)words)
377
			//			{
378
			//				if(i++ % 10 == 0) System.out.println();
379
			//				System.out.print("[\""+word[0]+"\", \""+word[1].replace("\"", "\\\"")+"\"], ");
380
			//			}
381
			File outfile = File.createTempFile("punct", ".xml", xmlfile.getParentFile()); //$NON-NLS-1$ //$NON-NLS-2$
382
			//System.out.println("Processing "+xmlfile+" to "+outfile);
383
			Document doc = (Document) new PunctInject().process(dom, words);
384
			//System.out.println("Saving file");
385
			DomUtils.save(doc, outfile);
386

  
387
			//			FileCopy.copy(outfile, new File(outfile.getParentFile(), "afterinject.xml"));
388

  
389
			xmlfile.delete();
390
			outfile.renameTo(xmlfile);
391
		} catch (UnsupportedEncodingException e) {
392
			// TODO Auto-generated catch block
393
			org.txm.utils.logger.Log.printStackTrace(e);
394
		} catch (FileNotFoundException e) {
395
			// TODO Auto-generated catch block
396
			org.txm.utils.logger.Log.printStackTrace(e);
397
		} catch (ParserConfigurationException e) {
398
			// TODO Auto-generated catch block
399
			org.txm.utils.logger.Log.printStackTrace(e);
400
		} catch (SAXException e) {
401
			// TODO Auto-generated catch block
402
			org.txm.utils.logger.Log.printStackTrace(e);
403
		} catch (IOException e) {
404
			// TODO Auto-generated catch block
405
			org.txm.utils.logger.Log.printStackTrace(e);
406
		}
407

  
408

  
409
	}
410

  
411 399
	public boolean toXml(File outFile, File xmlFile, File xslFile, boolean punct, int cxsize, List<String> list, List<String> list2) throws ExportException, ExportStopException, IOException, TransformerException
412 400
	{
413 401
		ApplyXsl2 xslProc = new ApplyXsl2(xslFile);
tmp/org.txm.tigersearch.rcp/src/org/txm/test/DrawTSSVG.java (revision 840)
3 3
import java.io.File;
4 4
import java.util.Arrays;
5 5

  
6
import org.txm.searchengine.ts.*;
6
import org.txm.searchengine.ts.TSCorpus;
7
import org.txm.searchengine.ts.TSCorpusManager;
8
import org.txm.searchengine.ts.TSMatch;
9
import org.txm.searchengine.ts.TSResult;
7 10
import org.txm.utils.ExecTimer;
8 11

  
9 12
public class DrawTSSVG {
......
71 74
			//		result.getMatch(i).toSVGFile(new File("/home/mdecorde/Bureau/tigerexports/match_"+i+".svg"))
72 75
			//	}
73 76
			//
74
				System.out.println("SIMPLE NO PNC");
75
				System.out.println(result.toConcordance(new File(registrydir, "export1.csv"), "concordance_simple", 30, Arrays.asList("cat"), Arrays.asList("pos"), false));
76
				System.out.println("MOT-PIVOT NO PNC");
77
				System.out.println(result.toConcordance(new File(registrydir, "export2.csv"), "concordance_mot-pivot", 30, Arrays.asList("cat"), Arrays.asList("pos"), false));
78
				System.out.println("BLOCKS NO PNC");
79
				System.out.println(result.toConcordance(new File(registrydir, "export3.csv"), "concordance_blocks", 30, Arrays.asList("cat"), Arrays.asList("pos"), false));
77
//				System.out.println("SIMPLE NO PNC");
78
//				System.out.println(result.toConcordance(new File(registrydir, "export1.csv"), "concordance_simple", 30, Arrays.asList("cat"), Arrays.asList("pos"), false));
79
//				System.out.println("MOT-PIVOT NO PNC");
80
//				System.out.println(result.toConcordance(new File(registrydir, "export2.csv"), "concordance_mot-pivot", 30, Arrays.asList("cat"), Arrays.asList("pos"), false));
81
//				System.out.println("BLOCKS NO PNC");
82
//				System.out.println(result.toConcordance(new File(registrydir, "export3.csv"), "concordance_blocks", 30, Arrays.asList("cat"), Arrays.asList("pos"), false));
80 83
			
81 84
			//	System.out.println( "SIMPLE + PNC"
82 85
			//	System.out.println( result.toConcordance(new File("/home/mdecorde/Bureau/tigerexports/export12.csv"), "concordance_simple", 30, ["cat"], ["pos"], true);
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java (revision 840)
36 36

  
37 37
// TODO: Auto-generated Javadoc
38 38
/**
39
 * A Part is related to a {@link Partition} and mirror a CQP subcorpus.
39
 * A Part is related to the {@link Partition} and is a CQP subcorpus.
40 40
 *
41 41
 * @author jmague
42 42
 */
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 840)
55 55
import org.w3c.dom.NodeList;
56 56

  
57 57
/**
58
 * A partition on a corpus.
58
 * A partition on a corpus. The partition is composed of {@link Part}s
59
 * 
60
 * The parts order depends on the Partition creation method used. 
59 61
 *
60 62
 * @author mdecorde
61 63
 * @author sjacquot 
......
67 69
	/** The Constant serialVersionUID. */
68 70
	private static final long serialVersionUID = 4420732757687971253L;
69 71

  
70
	
71 72
	/** The parts. */
72 73
	private List<Part> parts;
73 74

  
tmp/org.txm.referencer.core/src/org/txm/referencer/core/messages/package.html (revision 840)
1
Core message keys : contains the low level shared messages
1
<html><body>Core message keys : contains the low level shared messages</body></html>
tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 840)
704 704
					String version = v.getMajor()+"."+v.getMinor()+"."+v.getMicro();
705 705
					if ("qualifier".equals(v.getQualifier())) {
706 706
						System.out.println("RUNNING TXM FROM ECLIPSE - DEV MODE ACTIVATED");
707
						version += "_dev";
707
						version += "-dev";
708 708
					}
709
					txmhomedir = new File(System.getProperty("user.home"), "TXM_"+version); //$NON-NLS-1$ //$NON-NLS-2$
709
					txmhomedir = new File(System.getProperty("user.home"), "TXM-"+version); //$NON-NLS-1$ //$NON-NLS-2$
710 710
				} else {
711 711
					txmhomedir = new File(TXMPreferences.getString(TBXPreferences.USER_TXM_HOME, TBXPreferences.PREFERENCES_NODE).trim());
712 712
				}
tmp/org.txm.setups/BuildLinux64bit.sh (revision 840)
49 49
# copy eclise arch dependent build
50 50
rsync -r  --exclude '.svn' "exportRCP/linux.gtk.${ARCHCODE}/TXM" "$APP/usr/lib"
51 51
if [ $? != 0 ]; then
52
	echo "** $APP: failed to get ${ARCH}bit binaries linux $ARCHCODE files"
52
	echo "** $APP: failed to get ${ARCH}bit binaries Linux $ARCHCODE files"
53 53
	exit 1;
54 54
fi
55 55

  
56 56
echo " clean"
57 57
bash directoryCleaner.sh "$APP"
58 58
if [ $? != 0 ]; then
59
	echo "** $APP: failed to clean debian package $APP"
59
	echo "** $APP: failed to clean Debian package $APP"
60 60
	exit 1;
61 61
fi
62 62

  
63 63
# for multi installation: set the package version to txm-$VERSION
64
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/lib\/TXM/\/usr\/lib\/TXM-$VERSION/g" {} \;
65
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/bin\/TXM/\/usr\/bin\/TXM-$VERSION/g" {} \;
66
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM-$VERSION/g" {} \;
67
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/applications\/TXM.desktop/\/usr\/share\/applications\/TXM-$VERSION.desktop/g" {} \;
68
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/applications\/TXM debug.desktop/\/usr\/share\/applications\/TXM-$VERSION debug.desktop/g" {} \;
69
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/doc\/txm/\/usr\/share\/doc\/txm-$VERSION/g" {} \;
70
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/\/usr\/share\/lintiant\/overrides\/txm/\/usr\/share\/lintiant\/overrides\/txm-$VERSION/g" {} \;
71
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/\/usr\/lib\/TXM/\/usr\/lib\/TXM-$VERSION/g" {} \;
72
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXM\&/TXM-{VERSION}\&/g" {} \;
64
find "$APP/DEBIAN/preinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
65
find "$APP/DEBIAN/postinst" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
66
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/TXMVERSION/$VERSION/g" {} \;
73 67
find "$APP/DEBIAN/control" -type f -exec sed -i "s/Package: txm/Package: txm-${VERSION}/g" {} \;
74
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/\/usr\/lib\/TXM/\/usr\/lib\/TXM-$VERSION/g" {} \;
75
find "$APP/usr/bin/TXM" -type f -exec sed -i "s/\$HOME\/TXM/\$HOME\/TXM-$VERSION/g" {} \;
76 68
mv "$APP/usr/bin/TXM" "$APP/usr/bin/TXM-$VERSION"
77 69
mv "$APP/usr/lib/TXM" "$APP/usr/lib/TXM-$VERSION"
78 70
find "$APP/usr/share/applications/TXM.desktop" -type f -exec sed -i "s/\/usr\/share\/TXM/\/usr\/share\/TXM-$VERSION/g" {} \;
......
95 87

  
96 88
rm -f "${APP}_installer.deb"
97 89
mv $APP.deb ${APP}_installer.deb
98

  
tmp/org.txm.setups/shared/debian/DEBIAN/postinst (revision 840)
2 2
# Source debconf library.
3 3
#. /usr/share/debconf/confmodule
4 4

  
5
TXMINSTALLDIR="/usr/lib/TXM"
5
VERSION=-TXMVERSION
6
TXMINSTALLDIR="/usr/lib/TXM${VERSION}"
6 7

  
7 8
# create txm group
8 9
cat /etc/group | grep txm
tmp/org.txm.setups/shared/debian/DEBIAN/preinst (revision 840)
1 1
#!/bin/bash
2
VERSION=-TXMVERSION
2 3

  
3
if [ ! -d "/usr/lib/TXM" ]; then
4
	rm -rf "/usr/lib/TXM"
4
if [ ! -d "/usr/lib/TXM${VERSION}" ]; then
5
	rm -rf "/usr/lib/TXM${VERSION}"
5 6
fi
6 7

  
7
if [ ! -d "/usr/share/doc/txm" ]; then
8
	rm -rf "/usr/share/doc/txm"
8
if [ ! -d "/usr/share/doc/txm${VERSION}" ]; then
9
	rm -rf "/usr/share/doc/txm${VERSION}"
9 10
fi
10 11

  
11
if [ ! -d "/usr/share/lintian/overrides/txm" ]; then
12
	rm -rf "/usr/share/lintian/overrides/txm"
12
if [ ! -d "/usr/share/lintian/overrides/txm${VERSION}" ]; then
13
	rm -rf "/usr/share/lintian/overrides/txm${VERSION}"
13 14
fi
14 15

  
15
if [ ! -d "/usr/share/TXM" ]; then
16
	rm -rf "/usr/share/TXM"
16
if [ ! -d "/usr/share/TXM${VERSION}" ]; then
17
	rm -rf "/usr/share/TXM${VERSION}"
17 18
fi
18 19

  
19
if [ ! -f "/usr/share/applications/TXM.desktop" ]; then
20
	rm "/usr/share/applications/TXM.desktop"
21
	rm "/usr/share/applications/TXM debug.desktop"
20
if [ ! -f "/usr/share/applications/TXM${VERSION}.desktop" ]; then
21
	rm "/usr/share/applications/TXM${VERSION}.desktop"
22
	rm "/usr/share/applications/TXM${VERSION} debug.desktop"
22 23
fi
23 24

  
24
if [ ! -f "/usr/bin/TXM" ]; then
25
	rm "/usr/bin/TXM"
25
if [ ! -f "/usr/bin/TXM${VERSION}" ]; then
26
	rm "/usr/bin/TXM${VERSION}"
26 27
fi
27 28

  
28
echo "/usr/lib/TXM pre-installation done."
29
echo "/usr/lib/TXM${VERSION} pre-installation done."
tmp/org.txm.setups/shared/debian/usr/bin/TXM (revision 840)
1 1
# This script launches TXM in the right directory and with the right TXM.ini file
2 2
UBUNTU_MENUPROXY=0
3
VERSION=-TXMVERSION
3 4

  
4 5
echo "TXM: Preparing redirections in $HOME/TXM_PostInstallOutputLogs.txt and $HOME/TXM_PostInstallErrorLogs.txt files."
5 6

  
......
19 20

  
20 21
echo "TXM: Creating all necessary directories."
21 22

  
22
TXMHOME="$HOME/TXM"
23
TXMINSTALL="/usr/lib/TXM${VERSION}"
24
TXMHOME="$HOME/TXM${VERSION}"
25
DOTTXMHOME="$TXMHOME/.txm"
26

  
23 27
echo "TXMHOME='$TXMHOME'"
24 28
if [ ! -d "$TXMHOME" ]; then
25 29
	mkdir "$TXMHOME"
......
30 34
	exit 1
31 35
fi
32 36

  
33
DOTTXMHOME="$TXMHOME/.txm"
37

  
34 38
echo "DOTTXMHOME='$DOTTXMHOME'"
35 39
if [ ! -d "$DOTTXMHOME" ]; then
36 40
	mkdir "$DOTTXMHOME"
......
41 45
	exit 1
42 46
fi
43 47

  
44
echo "TXM: looking at the last TXM install date from the /usr/lib/TXM/STAMP file."
48
echo "TXM: looking at the last TXM install date from the /usr/lib/TXM${VERSION}/STAMP file."
45 49

  
46
if [ ! -r "/usr/lib/TXM/STAMP" ]; then
47
	zenity --info --text="TXM: Impossible to access '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
48
	echo "TXM: Impossible to access '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
50
if [ ! -r "$TXMINSTALL/STAMP" ]; then
51
	zenity --info --text="TXM: Impossible to access '$TXMINSTALL/STAMP' file. Aborting$LOGFILESMSG"
52
	echo "TXM: Impossible to access '$TXMINSTALL/STAMP' file. Aborting$LOGFILESMSG"
49 53
	exit 1
50 54
fi
51 55

  
52
STAMP=`stat -c %Y "/usr/lib/TXM/STAMP"`
56
STAMP=`stat -c %Y "$TXMINSTALL/STAMP"`
53 57

  
54 58
if [ $? != 0 ]; then
55
    zenity --info --text="TXM: Impossible to get status of '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
56
    echo "TXM: Impossible to get status of '/usr/lib/TXM/STAMP' file. Aborting$LOGFILESMSG"
59
    zenity --info --text="TXM: Impossible to get status of '$TXMINSTALL/STAMP' file. Aborting$LOGFILESMSG"
60
    echo "TXM: Impossible to get status of '$TXMINSTALL/STAMP' file. Aborting$LOGFILESMSG"
57 61
    exit 1
58 62
fi
59 63

  
60 64
echo "TXM: if .txm folder does not contain the $STAMP flag file, its a new install."
61
if [ ! -e "$HOME/TXM/.txm/$STAMP" ]; then
65
if [ ! -e "$DOTTXMHOME/$STAMP" ]; then
62 66

  
63 67
	echo "New TXM install: it's the first launch after the installation."
64 68
	if [ -f "/tmp/org.txm.rcpapplication.prefs" ]; then
......
84 88
	fi
85 89

  
86 90
	echo "TXM: Installing up to date TXM directories."
87
	rm -rf "$HOME/TXM/.txm"
88
	if [ -d "$HOME/TXM/.txm" ]; then
89
	    zenity --info --text="TXM: Failed to remove $HOME/TXM/.txm directory$LOGFILESMSG"
90
	    echo "TXM: Failed to remove $HOME/TXM/.txm directory$LOGFILESMSG"
91
	rm -rf "$DOTTXMHOME"
92
	if [ -d "$DOTTXMHOME" ]; then
93
	    zenity --info --text="TXM: Failed to remove $DOTTXMHOME directory$LOGFILESMSG"
94
	    echo "TXM: Failed to remove $DOTTXMHOME directory$LOGFILESMSG"
91 95
	    exit 1 ;
92 96
	fi
93 97

  
94
    mkdir "$HOME/TXM/.txm"
95
    if [ ! -d "$HOME/TXM/.txm" ]; then
98
    mkdir "$DOTTXMHOME"
99
    if [ ! -d "$DOTTXMHOME" ]; then
96 100
		echo "TXM: Impossible to access '$HOME/TXM/.txm' directory. Aborting$LOGFILESMSG"
97 101
		exit 1
98 102
    fi
99 103
    
100
	mkdir "$HOME/TXM/.txm/user"
101
	if [ ! -d "$HOME/TXM/.txm/user" ]; then
102
		echo "TXM: Impossible to access '$HOME/TXM/.txm/user' directory. Aborting$LOGFILESMSG"
104
	mkdir "$DOTTXMHOME/user"
105
	if [ ! -d "$DOTTXMHOME/user" ]; then
106
		echo "TXM: Impossible to access '$DOTTXMHOME/user' directory. Aborting$LOGFILESMSG"
103 107
		exit 1
104 108
    fi
105 109
    
106
	mkdir "$HOME/TXM/.txm/data"
107
    if [ ! -d "$HOME/TXM/.txm/data" ]; then
108
		echo "TXM: Impossible to access '$HOME/TXM/.txm/data' directory. Aborting$LOGFILESMSG"
110
	mkdir "$DOTTXMHOME/data"
111
    if [ ! -d "$DOTTXMHOME/data" ]; then
112
		echo "TXM: Impossible to access '$DOTTXMHOME/data' directory. Aborting$LOGFILESMSG"
109 113
		exit 1
110 114
    fi
111 115
    
112
    mkdir "$HOME/TXM/.txm/configuration"
113
    if [ ! -d "$HOME/TXM/.txm/configuration" ]; then
114
		echo "TXM: Impossible to access '$HOME/TXM/.txm/configuration' directory. Aborting$LOGFILESMSG"
116
    mkdir "$DOTTXMHOME/configuration"
117
    if [ ! -d "$DOTTXMHOME/configuration" ]; then
118
		echo "TXM: Impossible to access '$DOTTXMHOME/configuration' directory. Aborting$LOGFILESMSG"
115 119
		exit 1
116 120
    fi
117 121

  
118
    echo "TXM: getting '/usr/lib/TXM/TXM.ini' and setting write permissions to '$HOME/TXM/.txm/TXM.ini'"
119
    cp "/usr/lib/TXM/TXM.ini" "$HOME/TXM/.txm/TXM.ini" &&
120
    chmod +w "$HOME/TXM/.txm/TXM.ini"
122
    echo "TXM: getting '$TXMISNTALL/TXM.ini' and setting write permissions to '$DOTTXMHOME/TXM.ini'"
123
    cp "$TXMISNTALL/TXM.ini" "$DOTTXMHOME/TXM.ini" &&
124
    chmod +w "$DOTTXMHOME/TXM.ini"
121 125
	
122 126
    if [ $? != 0 ]; then
123 127
        zenity --info --text="TXM: Can't launch TXM: failed to set TXM.ini file$LOGFILESMSG"
......
125 129
        exit 1
126 130
    fi
127 131

  
128
    echo "TXM: creating the $HOME/TXM/.txm/$STAMP flag file."
129
    touch "$HOME/TXM/.txm/$STAMP"
132
    echo "TXM: creating the $DOTTXMHOME/$STAMP flag file."
133
    touch "$DOTTXMHOME/$STAMP"
130 134

  
131 135
    if [ $? != 0 ]; then
132
        zenity --info --text="TXMLaunch: Can't launch TXM: failed to create the $HOME/TXM/.txm/$STAMP install STAMP file$LOGFILESMSG"
133
		echo "TXM: Can't launch TXM: failed to create the $HOME/TXM/.txm/$STAMP install STAMP file$LOGFILESMSG"
136
        zenity --info --text="TXMLaunch: Can't launch TXM: failed to create the $DOTTXMHOME/$STAMP install STAMP file$LOGFILESMSG"
137
		echo "TXM: Can't launch TXM: failed to create the $DOTTXMHOME/$STAMP install STAMP file$LOGFILESMSG"
134 138
        exit 1
135 139
    fi
136 140
fi
......
146 150
## uncomment next lien to enable full debug
147 151
#DEBUGOPTIONS="-log -consolelog -clean -debug -console -noexit"
148 152

  
149
UBUNTU_MENUPROXY=0 exec /usr/lib/TXM/TXM -run --launcher.ini "$HOME/TXM/.txm/TXM.ini" $DEBUGOPTIONS -data "$HOME/TXM/.txm/data" -user "$HOME/TXM/.txm/user" -install "/usr/lib/TXM"
153
UBUNTU_MENUPROXY=0 exec "$TXMINSTALL/TXM" -run --launcher.ini "$DOTTXMHOME/TXM.ini" $DEBUGOPTIONS -data "$DOTTXMHOME/data" -user "$DOTTXMHOME/user" -install "$TXMINSTALL"
tmp/org.txm.synopticeditor.rcp/src/org/txm/edition/rcp/editors/SynopticEditionEditor.java (revision 840)
49 49
import org.eclipse.jface.viewers.ISelectionProvider;
50 50
import org.eclipse.jface.window.Window;
51 51
import org.eclipse.swt.SWT;
52
import org.eclipse.swt.browser.Browser;
53
import org.eclipse.swt.browser.BrowserFunction;
54 52
import org.eclipse.swt.events.KeyEvent;
55 53
import org.eclipse.swt.events.KeyListener;
56 54
import org.eclipse.swt.events.SelectionEvent;
......
59 57
import org.eclipse.swt.layout.GridLayout;
60 58
import org.eclipse.swt.widgets.Button;
61 59
import org.eclipse.swt.widgets.Composite;
62
import org.eclipse.swt.widgets.Group;
63 60
import org.eclipse.swt.widgets.Label;
64 61
import org.eclipse.swt.widgets.Shell;
65 62
import org.eclipse.swt.widgets.ToolItem;
......
73 70
import org.eclipse.ui.PlatformUI;
74 71
import org.eclipse.ui.commands.ICommandService;
75 72
import org.eclipse.ui.handlers.IHandlerService;
76
import org.txm.concordance.rcp.actions.BackToText;
77 73
import org.txm.edition.rcp.editors.ext.ToolbarButton;
78 74
import org.txm.edition.rcp.messages.SynopticEditionUIMessages;
79 75
import org.txm.objects.Edition;
......
81 77
import org.txm.rcp.IImageKeys;
82 78
import org.txm.rcp.editors.IEditionEditor;
83 79
import org.txm.rcp.editors.TXMEditor;
84
import org.txm.rcp.editors.TXMEditorToolBar;
85 80
import org.txm.rcp.swt.GLComposite;
86 81
import org.txm.searchengine.cqp.corpus.Corpus;
87 82
import org.txm.utils.logger.Log;
88 83
/**
89
 * Call the internal browser of RCP a Texte can be set to browse pages and
90
 * others texts of the same base 
84
 * Call the internal browser of RCP to display the Edition Pages of a Text
91 85
 * 
92 86
 * @author mdecorde.
93 87
 * 
94 88
 */
95
public class SynopticEditionEditor extends TXMEditor<Edition> implements IEditionEditor {
89
public class SynopticEditionEditor extends TXMEditor<Text> implements IEditionEditor {
96 90

  
97 91
	/** The Constant ID. */
98 92
	public final static String ID = SynopticEditionEditor.class.getName(); //$NON-NLS-1$

Formats disponibles : Unified diff