Révision 1190

tmp/org.txm.tigersearch.rcp/src/org/txm/tigersearch/rcp/tester/TIGERSearchTester.java (revision 1190)
41 41
					return false;
42 42
				}
43 43
				MainCorpus corpus = (MainCorpus) receiver;
44

  
44
				if (corpus.getProjectDirectory() == null) return false;
45
				
45 46
				return new File(corpus.getProjectDirectory(), "tiger").exists();
46 47
			}
47 48
		}
tmp/org.txm.setups/shared/debian/DEBIAN/preinst (revision 1190)
1 1
#!/bin/bash
2 2
VERSION=-TXMVERSION
3 3

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

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

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

  
19
echo "removing /usr/share/TXM${VERSION}"
16 20
if [ ! -d "/usr/share/TXM${VERSION}" ]; then
17 21
	rm -rf "/usr/share/TXM${VERSION}"
18 22
fi
19 23

  
24
echo "removing /usr/share/applications/TXM${VERSION}.desktop"
20 25
if [ ! -f "/usr/share/applications/TXM${VERSION}.desktop" ]; then
21 26
	rm "/usr/share/applications/TXM${VERSION}.desktop"
22 27
	rm "/usr/share/applications/TXM${VERSION} debug.desktop"
23 28
fi
24 29

  
30
echo "removing /usr/bin/TXM${VERSION}"
25 31
if [ ! -f "/usr/bin/TXM${VERSION}" ]; then
26 32
	rm "/usr/bin/TXM${VERSION}"
27 33
fi
tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 1190)
1169 1169
	 * Deletes all non persistent results and saves the results to persist.
1170 1170
	 */
1171 1171
	public static void deleteAllNonPersistentResults() {
1172
		File logs = new File(System.getProperty("user.home"), "logs.txt");
1173
		PrintWriter w = null;
1172
//		File logs = new File(System.getProperty("user.home"), "logs.txt");
1173
//		PrintWriter w = null;
1174 1174
		try {
1175
			w = IOUtils.getWriter(logs);
1175
//			w = IOUtils.getWriter(logs);
1176 1176
			List<TXMResult> todo = Toolbox.workspace.getChildren();
1177 1177
			while (todo.size() > 0) {
1178 1178
				TXMResult r = null;
1179
				try {
1179
//				try {
1180 1180
					r = todo.remove(0);
1181 1181
					todo.addAll(0, r.getChildren());
1182
					w.println("Persisting? "+r);
1182
//					w.println("Persisting? "+r);
1183 1183
					if (r.mustBePersisted())	{ 
1184
						w.println(" YES");
1184
//						w.println(" YES");
1185 1185
						TXMPreferences.flush(r);
1186 1186
					}
1187 1187
					else {
1188
						w.println(" NO");
1188
//						w.println(" NO");
1189 1189
						Log.finest("TXMResult.deleteAllNonPersistentResults(): Deleting result " + r.getSimpleName() + " of type " + r.getClass().getSimpleName() + ".");
1190 1190
						TXMPreferences.delete(r);
1191 1191
					}
1192
				} catch (Exception e) {
1193
					w.println(" Error: "+e+" with "+r);
1194
				}
1195
				w.println(" OK: "+r);
1192
//				} catch (Exception e) {
1193
//					w.println(" Error: "+e+" with "+r);
1194
//				}
1195
//				w.println(" OK: "+r);
1196 1196
			}
1197
		} catch (UnsupportedEncodingException e1) {
1198
			// TODO Auto-generated catch block
1199
			e1.printStackTrace();
1200
		} catch (FileNotFoundException e1) {
1201
			// TODO Auto-generated catch block
1202
			e1.printStackTrace();
1203 1197
		} finally {
1204
			if (w != null) w.close();
1198
//			if (w != null) w.close();
1205 1199
		}
1206 1200
	}
1207 1201

  
......
1460 1454
	 * @param type
1461 1455
	 * @return
1462 1456
	 */
1463
	protected static List<TXMResult> getNodes(List<TXMResult> srcNodes, Class type, boolean onlyVisible) {
1457
	protected static List<TXMResult> getNodes(List<TXMResult> srcNodes, Class<? extends TXMResult> type, boolean onlyVisible) {
1464 1458
		List<TXMResult> nodes = new ArrayList<TXMResult>();
1465 1459
		for (TXMResult child : srcNodes) {
1466 1460
			try {
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 1190)
301 301
				return true;
302 302
			}
303 303
	
304
			if (monitor == null) {
304
			if (monitor == null || monitor.isCanceled()) {
305 305
				monitor = new LogMonitor("computing "+this);
306 306
			}
307 307
	
308 308
			Log.finest("RUNNING IMPORT MODULE WITH NAME = " + getImportModuleName());
309 309
			
310
			// This step could be done only if the compiler step if done and only if it modifying/deleteing the corpus builds
311
			for (CorpusBuild corpus : getCorpusBuilds()) {
312
				if (corpus != null) {
313
					corpus.deleteChildren(null); // remove all Corpus results
314
				}
315
			}
316
			
310 317
			boolean state = engine.build(this, monitor).isOK();
311 318
			if(state == true)	{
312 319
				this.needToBuild = false;
......
330 337
	private void initRCPStuffs() throws CoreException {
331 338
		IWorkspace rcpWorkspace = ResourcesPlugin.getWorkspace();
332 339
		if (this.rcpProject == null) {
333
			this.rcpProject = rcpWorkspace.getRoot().getProject(this.getName());
340
			String n = this.getName();
341
			this.rcpProject = rcpWorkspace.getRoot().getProject(n);
334 342
		}
335 343

  
336 344
		if (!rcpProject.exists()) {
......
1222 1230
	// FIXME: SJ: need to see if we need this, it doesn't seem.
1223 1231
	public boolean save() {
1224 1232
		try {
1233
			ProjectScope scope = this.getPreferencesScope();
1234
			scope.getNode("").flush();
1235
			
1225 1236
			autoSaveParametersFromAnnotations();
1226 1237
			saveParameters();
1238
			
1227 1239
			List<TXMResult> results = this.getDeepChildren();
1228 1240
			for (int i = 0; i < results.size(); i++) {
1229 1241
				TXMResult r = results.get(i);
tmp/org.txm.core/src/java/org/txm/importer/xtz/ImportModule.java (revision 1190)
12 12
import org.eclipse.core.runtime.IPath;
13 13
import org.eclipse.core.runtime.IProgressMonitor;
14 14
import org.txm.Toolbox;
15
import org.txm.core.results.TXMResult;
16
import org.txm.objects.CorpusBuild;
15 17
import org.txm.objects.Project;
16 18
import org.txm.stat.utils.LogMonitor;
17 19
import org.txm.utils.DeleteDir;
......
67 69

  
68 70
	public void init(Project p) {
69 71
		this.project = p;
72
		
70 73
		corpusName = project.getName();
71 74
		//this.debug = "true".equals(project.getKeyValueParameters().get(ImportKeys.DEBUG));
72 75
		
......
84 87
			File txmDir = new File(binaryDirectory, "txm");
85 88
			//DeleteDir.deleteDirectory(binaryDirectory);
86 89
			try {
87
				IPath path = p.getRCPProject().getFullPath();
88
				for (IResource r : p.getRCPProject().members()) {
89
					if (r.isHidden()) continue;
90
					r.delete(true, new LogMonitor("XTZ delete project content"));
91
				}
92
//				p.getRCPProject().getFolder("txm").delete(true, );
93
//				p.getRCPProject().getFolder("data").delete(true, new LogMonitor("XTZ delete project content"));
94
//				p.getRCPProject().getFolder("HTML").delete(true, new LogMonitor("XTZ delete project content"));
95
				
90
				p.getRCPProject().getFolder("HTML").delete(true, new LogMonitor("XTZ delete project content"));
91
				p.getRCPProject().getFolder("cqp").delete(true, new LogMonitor("XTZ delete project content"));
92
				p.getRCPProject().getFolder("data").delete(true, new LogMonitor("XTZ delete project content"));
93
				p.getRCPProject().getFolder("registry").delete(true, new LogMonitor("XTZ delete project content"));
94
				p.getRCPProject().getFolder("tokenized").delete(true, new LogMonitor("XTZ delete project content"));
95
				p.getRCPProject().getFolder("txm").delete(true, new LogMonitor("XTZ delete project content"));
96 96
			} catch (CoreException e) {
97 97
				// TODO Auto-generated catch block
98 98
				e.printStackTrace();
tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 1190)
49 49
import org.txm.core.results.TXMParameters;
50 50
import org.txm.core.results.TXMResult;
51 51
import org.txm.searchengine.cqp.AbstractCqiClient;
52
import org.txm.searchengine.cqp.CQPSearchEngine;
52 53
import org.txm.searchengine.cqp.MemCqiClient;
53 54
import org.txm.searchengine.cqp.Reference;
54 55
import org.txm.searchengine.cqp.ReferencePattern;
......
387 388
	@Override
388 389
	public void clean() {
389 390
		try {
390
			if (queryResult != null)	{
391
			if (queryResult != null && CQPSearchEngine.isInitialized())	{
391 392
				queryResult.drop();
392 393
			}
393 394
		} catch (Exception e) {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java (revision 1190)
41 41
			return null;
42 42
		}
43 43
		project.setDirty();
44
		project.setNeedToBuild();
44 45
		project.setDoMultiThread(false); //too soon
45 46
		project.setDoUpdate(true);
46 47
		
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java (revision 1190)
42 42
	 * @param toolkit2
43 43
	 * @param form2
44 44
	 * @param parent
45
	 * @param style
45
	 * @param stylesave
46
	 * 
46 47
	 * @param moduleParams
47 48
	 * @param scriptName temporary parameter to detect if import module is xtzLoader.groovy
48 49
	 */
......
270 271

  
271 272
				build = buildFacsEditionCheckButton.getSelection();
272 273

  
273
				edition_params = project.getEditionDefinition("facs");
274
				edition_params.setBuildEdition(build);
275
				edition_params.setImagesDirectory(images_directory);
274
				EditionDefinition edition_params2 = project.getEditionDefinition("facs");
275
				edition_params2.setBuildEdition(build);
276
				edition_params2.setImagesDirectory(images_directory);
276 277
			}
277 278
		}
278 279
		return true;
tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/CorpusPage.java (revision 1190)
974 974

  
975 975
		if (successfulSave) {
976 976
			try {
977
				project.saveParameters();
977
				project.save();
978 978
				//				DomUtils.save(params.root.getOwnerDocument(), paramFile);
979 979
			} catch (Exception e1) {
980 980
				org.txm.rcp.utils.Logger.printStackTrace(e1);

Formats disponibles : Unified diff