Revision 479 tmp/org.txm.groovy.core/src/groovy/org/txm/macro/edition/EditionUpdaterMacro.groovy

EditionUpdaterMacro.groovy (revision 479)
1 1
package org.txm.macro.edition
2 2
// STANDARD DECLARATIONS
3 3

  
4
import org.kohsuke.args4j.*
4 5
import groovy.transform.Field
5

  
6
import javax.xml.parsers.*
7
import javax.xml.transform.*
8

  
9
import org.kohsuke.args4j.*
10
import org.txm.Toolbox
11
import org.txm.importer.*
6
import org.txm.rcpapplication.swt.widget.parameters.*
12 7
import org.txm.objects.*
13
import org.txm.rcp.commands.*
14
import org.txm.rcp.swt.widget.parameters.*
15
import org.txm.searchengine.cqp.corpus.*
16
import org.txm.utils.io.FileCopy;
8
import org.txm.searchengine.cqp.corpus.*;
17 9
import org.w3c.dom.*
10
import org.txm.importer.*
11
import org.txm.Toolbox
12
import java.io.*
18 13

  
14
import org.w3c.dom.Document;
15
import org.xml.sax.SAXException;
16
import org.txm.rcpapplication.commands.*
17
import javax.xml.parsers.*;
18
import javax.xml.transform.*;
19
import javax.xml.transform.dom.DOMSource;
20
import javax.xml.transform.stream.StreamResult;
21
import org.txm.utils.io.FileCopy
22

  
19 23
try { println "ARGS=$args";} catch(Exception e) {args = [:]}
20 24

  
21 25
def corpus = null
......
169 173
def htmlFiles = []
170 174
for (File f : txmDirectory.listFiles()) {
171 175
	String name = f.getName()
172
	String txtname = name.substring(0, name.indexOf("."));
176
	String txtname = name.substring(0, name.lastIndexOf("."));
173 177
	File rez = new File(HTMLCorpusDirectory, txtname+".html")
174 178

  
175 179
	if (!f.isDirectory() && !f.isHidden() && name.endsWith(".xml") && !name.equals("import.xml")) {
......
194 198
applier2.setParam("cssname", corpusName)
195 199
for (File f : htmlFiles) {
196 200
	String name = f.getName()
197
	String txtname = name.substring(0, name.indexOf("."));
201
	String txtname = name.substring(0, name.lastIndexOf("."));
198 202
	File rez = new File(defaultEditionDirectory, txtname+"-pages.html")
199 203
	
200 204
	if (debug) println " file $f >> $rez"

Also available in: Unified diff