Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / macro / xml / XMLStatisticsMacro.groovy @ 499

History | View | Annotate | Download (1.2 kB)

1
package org.txm.macro.xml
2

    
3
import org.txm.scripts.*
4
import org.kohsuke.args4j.*
5
import groovy.transform.Field
6
import org.txm.rcp.swt.widget.parameters.*
7

    
8
@Field @Option(name="inputDirectory", usage="Dossier qui contient les fichiers à parser", widget="Folder", required=true, def="src")
9
File inputDirectory;
10

    
11
@Field @Option(name="tsvFile", usage="FichierTSV résultat", widget="File", required=true, def="file.tsv")
12
File tsvFile;
13

    
14
@Field @Option(name="usePaths", usage="FichierTSV résultat", widget="Boolean", required=true, def="false")
15
def usePaths = true
16
@Field @Option(name="useAttributes", usage="FichierTSV résultat", widget="Boolean", required=true, def="false")
17
def useAttributes = true
18
@Field @Option(name="useAttributeValues", usage="FichierTSV résultat", widget="Boolean", required=true, def="false")
19
def useAttributeValues = true
20

    
21
if (!ParametersDialog.open(this)) return;
22

    
23
tsvFile = tsvFile.getAbsoluteFile()
24
println "Input directory: "+inputDirectory
25
println "TSV file: "+tsvFile
26
println "use paths $usePaths"
27
println "use attributes $useAttributes"
28
println "use attributes values $useAttributeValues"
29

    
30
XMLStatistics.processDirectory(inputDirectory, tsvFile, ".xml", usePaths, useAttributes, useAttributeValues);