Révision 2986

tmp/org.txm.core/src/java/org/txm/objects/BaseOldParameters.java (revision 2986)
389 389
		texts.appendChild(text);
390 390
		
391 391
		Element source = texts.getOwnerDocument().createElement("source");//$NON-NLS-1$
392
		source.setAttribute("file", sourceFile.getAbsolutePath());//$NON-NLS-1$
392
		source.setAttribute("file", "" + sourceFile);//$NON-NLS-1$
393 393
		source.setAttribute("type", ".xml");//$NON-NLS-1$ //$NON-NLS-2$
394 394
		text.appendChild(source);
395 395
		text.appendChild(texts.getOwnerDocument().createElement("editions"));//$NON-NLS-1$
tmp/org.txm.core/src/java/org/txm/objects/Text.java (revision 2986)
94 94
	 * Retro compatiblity to load Editions from a XML Element
95 95
	 */
96 96
	protected boolean _load(Element e) {
97
		Element src = (Element) e
98
				.getElementsByTagName("source").item(0); //$NON-NLS-1$
97
		Element src = (Element) e.getElementsByTagName("source").item(0); //$NON-NLS-1$
99 98
		pSource = new File(src.getAttribute("file")); //$NON-NLS-1$
100 99
		// sourcetype = src.getAttribute("type"); //$NON-NLS-1$
101 100
		try {
tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java (revision 2986)
349 349
				// texts.put(t.getName(), t);
350 350
				// textnames.add(t.getName());
351 351
				// }
352
				if (this.getID() != null && this.getID().length() > 0) {
353
					try {
354
						for (Edition ed : t.getEditions()) {
355
							ed.saveParameter("corpus", this.getID());
356
						}
357
					}
358
					catch (Exception e1) {
359
						// TODO Auto-generated catch block
360
						e1.printStackTrace();
361
					}
362
				}
352 363
			}
353 364
		}
354 365
		
......
781 792
				Text text = this.getProject().getText(id);
782 793
				if (text != null) {
783 794
					Edition biblioEdition = new Edition(text);
795
					try {
796
						if (this.getID() != null && this.getID().length() > 0) {
797
							biblioEdition.saveParameter("corpus", this.getID());
798
						}
799
					}
800
					catch (Exception e) {
801
						e.printStackTrace();
802
					}
784 803
					biblioEdition.setIndex(url);
785 804
				}
786 805
			}
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 2986)
331 331
		
332 332
		if (defaultHtmlDir == null) {
333 333
			File binDir = getText().getProject().getProjectDirectory();
334
			defaultHtmlDir = new File(binDir, "HTML/" + getText().getProject().getName() + "/" + getName()); //$NON-NLS-1$ //$NON-NLS-2$
334
			
335
			// if the edition is not stored in the default corpus which usually has the same name as the project name
336
			String corpus = this.getStringParameterValue("corpus");
337
			if (corpus == null || corpus.length() == 0) {
338
				corpus = getText().getProject().getName();
339
			}
340
			
341
			defaultHtmlDir = new File(binDir, "HTML/" + corpus + "/" + getName()); //$NON-NLS-1$ //$NON-NLS-2$
335 342
		}
336 343
		return defaultHtmlDir;
337 344
	}
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/dialogs/ExportCorpusDialog.java (revision 2986)
85 85
	@Override
86 86
	protected void configureShell(Shell newShell) {
87 87
		super.configureShell(newShell);
88
		newShell.setText(NLS.bind("Exporting {0}...", corpus.getName()));
88
		newShell.setText(NLS.bind("Exporting {0}...", corpus.getProject().getName().toUpperCase()));
89 89
		newShell.setMinimumSize(400, 300);
90 90
	}
91 91
	
......
106 106
		if (previousPath == null || previousPath.length() == 0) {
107 107
			previousPath = System.getProperty("user.home"); //
108 108
		}
109
		textField.setText(previousPath + "/" + corpus.getName() + "-" + Toolbox.dateformat.format(Calendar.getInstance().getTime()) + ".txm"); //$NON-NLS-1$
109
		textField.setText(previousPath + "/" + corpus.getProject().getName().toUpperCase() + "-" + Toolbox.dateformat.format(Calendar.getInstance().getTime()) + ".txm"); //$NON-NLS-1$
110 110
		
111 111
		selectButton = new Button(comp, SWT.PUSH);
112 112
		selectButton.setText("...");
tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/ImportAlignedEditionMacro.groovy (revision 2986)
115 115
	}
116 116
	dest_edition = new Edition(dest_text)
117 117
	dest_edition.setName(destination_edition_name)
118
	dest_edition.saveParameter("corpus", destination_corpus.getID())
118 119
	dest_edition.pPageNames = src_edition.pPageNames // replace with getter&setter when published in TXM 0.8.1
119 120
	dest_edition.pPageFirstWordIds = src_edition.pPageFirstWordIds
120 121
	dest_edition.compute(false)
tmp/org.txm.groovy.core/src/groovy/org/txm/macro/r/Index2barplotMacro.groovy (revision 2986)
17 17
String prop = "none"
18 18
if (sel instanceof Index) {
19 19
	println "Sending Index data to R..."
20
	((Index)sel).asRMatrix()
21
	symbol = "t("+((Index)sel).getSymbol()+'$data)'
20
	symbol = ((Index)sel).asRMatrix()
21
	symbol = "t("+symbol+'$data)'
22 22
	prop = ((Index)sel).getProperties().toString()
23 23
} else {
24 24
	println "Selection is not an Index. Aborting."
tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/tmx/tmxLoader.groovy (revision 2986)
158 158
			def ed = new pager(txmFile, outdir, txtname, NoSpaceBefore, NoSpaceAfter, wordsPerPage, basename, page_element,splitTUs);
159 159
			Edition edition = new Edition(t);
160 160
			edition.setName("default");
161
			edition.saveParameter("corpus", txmCorpusDir.getName());
161 162
			edition.setIndex(outdir.getAbsolutePath());
162 163
			for (i = 0 ; i < ed.getPageFiles().size();) {
163 164
				File f = ed.getPageFiles().get(i);

Formats disponibles : Unified diff