Révision 3460

TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/nov13/PrepareTranscriptionsMacro.groovy (revision 3460)
48 48
println "CONVERTING VOCAPIA FILES TO TRS FILES..."
49 49
File trsDirectory = new File(resultDirectory, "vocapia2trs")
50 50
trsDirectory.mkdir()
51
gse.runMacro(org.txm.macro.transcription.Vocapia2TranscriberMacro, ["vocapiaDirectory":vocapiaDirectory, "resultDirectory":trsDirectory, "additionalSpeakers": "UX1:UX1", "debug":debug])
51
gse.runMacro(org.txm.macro.transcription.Vocapia2TranscriberMacro, ["vocapiaFile":new File("this file does not exists"), "vocapiaDirectory":vocapiaDirectory, "resultDirectory":trsDirectory, "additionalSpeakers": "UX1:UX1", "debug":debug])
52 52

  
53

  
54 53
println "SPOTTING SECTION MARKS..."
55 54

  
56 55
trsFiles = trsDirectory.listFiles().findAll(){it.getName().toLowerCase().endsWith(".trs")}
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/transcription/Vocapia2TranscriberMacro.groovy (revision 3460)
5 5
import org.txm.utils.*
6 6
import org.txm.utils.logger.*
7 7

  
8
@Field @Option(name="vocapiaFile", usage="A single vocapia XML file", widget="FileOpen", required=false, def="")
8
@Field @Option(name="vocapiaFile", usage="A single vocapia XML file", widget="FileOpen", required=true, def="")
9 9
		File vocapiaFile;
10 10

  
11
@Field @Option(name="vocapiaDirectory", usage="A Vocapia XML files directory to process", widget="Folder", required=false, def="")
11
@Field @Option(name="vocapiaDirectory", usage="A Vocapia XML files directory to process", widget="Folder", required=true, def="")
12 12
		File vocapiaDirectory;
13 13

  
14
@Field @Option(name="resultDirectory", usage="The result directory", widget="Folder", required=false, def="")
14
@Field @Option(name="resultDirectory", usage="The result directory", widget="Folder", required=true, def="")
15 15
		File resultDirectory;
16 16
		
17
@Field @Option(name="additionalSpeakers", usage="The result directory", widget="String", required=false, def="")
17
@Field @Option(name="additionalSpeakers", usage="The result directory", widget="String", required=true, def="")
18 18
		def additionalSpeakers;
19 19
		additionalSpeakers
20 20
		
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchWindowAdvisor.java (revision 3460)
187 187
			}
188 188
		}
189 189
		
190
		AnnotationEnginesManager aem = (AnnotationEnginesManager) Toolbox.getEngineManager(EngineType.ANNOTATION);
191
		HashMap<CorpusBuild, ArrayList<AnnotationEngine>> notSaved = aem.getEnginesWithSaveNeededPerCorpus();
192
		
193
		StringBuilder mess = new StringBuilder();
194
		
190 195
		if (altered.size() > 0) {
191
			StringBuilder mess = new StringBuilder();
196
			
192 197
			mess.append(TXMUIMessages.SomeResultHaveBeenMannuallyModified);
193 198
			for (TXMResult result : altered) {
194 199
				mess.append("\n- "+result.getName()+ " ("+result.getResultType()+") : "+result.getSimpleDetails()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
195 200
			}
196
			mess.append("\n\n"+TXMUIMessages.YouReGoingToLostThoseModificationsIfNotAlreadyExportedContinue); //$NON-NLS-1$
197
			return MessageDialog.openConfirm(this.getWindowConfigurer().getWindow().getShell(), TXMUIMessages.SomeResultHaveBeenManuallyModified, mess.toString());
201
			mess.append("\n\n"+TXMUIMessages.YouReGoingToLostThoseModificationsIfNotAlreadyExportedContinue); //$NON-NLS-1$ //$NON-NLS-2$
202
			//return MessageDialog.openConfirm(this.getWindowConfigurer().getWindow().getShell(), TXMUIMessages.SomeResultHaveBeenManuallyModified, mess.toString());
198 203
		}
199 204
		
200
		AnnotationEnginesManager aem = (AnnotationEnginesManager) Toolbox.getEngineManager(EngineType.ANNOTATION);
201
		HashMap<CorpusBuild, ArrayList<AnnotationEngine>> notSaved = aem.getEnginesWithSaveNeededPerCorpus();
202 205
		if (notSaved.size() > 0) {
203
			StringBuilder mess = new StringBuilder();
204
			mess.append( TXMUIMessages.SomeAnnotationsAreNotSavedAndWillBeLostAfterTXMIsClosed);
206
			if (mess.length() > 0) mess.append("\n\n");
207
			mess.append(TXMUIMessages.SomeAnnotationsAreNotSavedAndWillBeLostAfterTXMIsClosed);
205 208
			for (CorpusBuild corpus : notSaved.keySet())  {
206 209
				mess.append("\n- "+corpus.getName()+": "+corpus.getSimpleDetails()); //$NON-NLS-1$ //$NON-NLS-2$
207 210
				for (AnnotationEngine a: notSaved.get(corpus)) {
......
209 212
				}
210 213
			}
211 214
			mess.append(TXMUIMessages.ContinueAndLostTheUnsavedAnnotations);
212
			if(!MessageDialog.openConfirm(this.getWindowConfigurer().getWindow().getShell(), TXMUIMessages.SomeAnnotationsAreNotSaved, mess.toString())) {
215
		}
216
		
217
		if (altered.size() > 0 || notSaved.size() > 0) {
218
			String title = "";
219
			if (altered.size() > 0) title += TXMUIMessages.SomeResultHaveBeenManuallyModified;
220
			if (notSaved.size() > 0) {
221
				if (title.length() > 0) title += " & ";
222
				title += TXMUIMessages.SomeAnnotationsAreNotSaved;
223
			}
224
			
225
			mess.append("\n\nContinue ?");
226
			
227
			if(!MessageDialog.openConfirm(this.getWindowConfigurer().getWindow().getShell(), title, mess.toString())) {
213 228
				return false;
214 229
			}
215 230
		}
216
		
217 231
		return true;
218 232
	}
219 233
}
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/swt/widget/parameters/ParametersDialog.java (revision 3460)
420 420
				
421 421
				// set default value in the fields, not enough if args contains the value
422 422
				String value = defaultValues.getProperty(option.name());
423
				String value2 = ""+args.get(option.name());
423 424
				if (value != null) { // set the default value using the properties stored
424 425
					widget.setDefault(value);
426
				} else if (value2 != null) { // set the default value using the properties stored
427
					widget.setDefault(value2);
425 428
				}
426 429
			}
427 430
		}
......
484 487
	 */
485 488
	private void initializeMacroVariables() {
486 489
		// System.out.println("Initialize macro variables of "+fieldNames);
490
		
487 491
		if (bean == null) return;
488 492
		
489 493
		Class c = bean.getClass();
......
613 617
					// check names
614 618
					Class c = bean.getClass();
615 619
					Log.finest("Parsing options: " + parser.getOptions());
616
					for (OptionHandler opt : parser.getOptions()) {
620
					for (OptionHandler opt : parser.getOptions()) { // pre set variable using the defaultArgs binding
617 621
						try {
618 622
							if (opt.option instanceof NamedOptionDef) {
619 623
								NamedOptionDef option = (NamedOptionDef) opt.option;
......
637 641
						
638 642
						ArrayList missingParameters = dialog.getParametersToSet();
639 643
						ArrayList missingMandatoryParameters = dialog.getMandatoryParametersToSet();
644
						
645
						dialog.initializeMacroVariables(); // with args
640 646
						if (missingParameters.size() > 0) {
641 647
							Log.finer("The parameters dialog must be opened to fill parameters " + missingParameters + " and all mandatory fields: " + missingMandatoryParameters);
642 648
							retOpen = dialog.open() == ParametersDialog.OK;
......
644 650
						}
645 651
						else { // fields initialized by 'args'
646 652
							Log.finest("The parameters dialog dont need to be opened all mandatory fields are set: " + args);
647
							dialog.initializeMacroVariables(); // with args
648 653
							if (dialog.getNumberOfFields() > 0) dialog.saveParameters();
649 654
							retOpen = true;
650 655
							errorOpen = false;
TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/messages/messages.properties (revision 3460)
1232 1232
ClosingTheP0Corpus=Closing corpus 
1233 1233
CommonSourcesLangOfTreeTaggerModels=Sources lang (show only the TreeTagger common language)
1234 1234
CompilingP0Etc=Compiling {0}...
1235
ContinueAndLostTheUnsavedAnnotations=\n\nContinue and lost the unsaved annotations 
1235
ContinueAndLostTheUnsavedAnnotations=\n\nUnsaved annotations will be lost 
1236 1236
ConvertingEtc=Converting...
1237 1237
CopingFilesP0=Coping files: 
1238 1238
Copy=Copy
......
1284 1284
WorkspacePathCouldNotBeFound=Workspace path could not be found.
1285 1285
xmlTagNameThatEncodesWords=XML tag name that encodes words
1286 1286
YouNeedToSetAsManyPercentSPrintfMarksAsSelectedProperties=you need to set as many %s printf marks as selected properties.
1287
YouReGoingToLostThoseModificationsIfNotAlreadyExportedContinue=You're going to lost those modifications if not already exported. Continue?
1287
YouReGoingToLostThoseModificationsIfNotAlreadyExportedContinue=You're going to lost those modifications if not already exported.

Formats disponibles : Unified diff