Revision 1000 tmp/org.txm.groovy.core/src/groovy/org/txm/scripts/importer/doc/docLoader.groovy

docLoader.groovy (revision 1000)
29 29

  
30 30
import org.txm.scripts.importer.*;
31 31
import javax.xml.stream.XMLStreamReader;
32
import org.txm.scripts.importer.ApplyXsl2;
33
import org.txm.scripts.importer.ValidateXml;
32
import org.txm.importer.ApplyXsl2;
33
import org.txm.importer.ValidateXml;
34 34
import org.txm.scripts.importer.xml.importer;
35 35
import org.txm.scripts.importer.xml.compiler;
36 36
import org.txm.objects.*;
......
40 40
import org.txm.*;
41 41
import org.txm.core.preferences.TBXPreferences
42 42
import org.txm.core.engines.*;
43
import org.txm.scripts.importer.xmltxm.*;
43
import org.txm.importer.scripts.xmltxm.*;
44 44
import org.txm.utils.i18n.*;
45 45
import org.txm.metadatas.*;
46 46
import javax.xml.stream.*;
47 47
import org.w3c.dom.Element;
48 48
import org.txm.utils.xml.DomUtils;
49
import org.txm.sw.RemoveTag;
50
import org.txm.doc.*;
49
import org.txm.scripts.importer.RemoveTag;
50
import org.txm.scripts.doc.*;
51 51

  
52 52
String userDir = System.getProperty("user.home");
53 53

  
......
99 99
String paginationElement = "pb";
100 100
boolean normalizeMetadata = true;
101 101

  
102
File allmetadatasfile = Metadatas.findMetadataFile(srcDir);
102
File allMetadataFile = Metadatas.findMetadataFile(srcDir);
103 103

  
104 104
if (txmDir.listFiles() == null) {
105 105
	println "No file to process"
......
142 142
println txmDir.listFiles()
143 143
File docfiles = new File(binDir, "docfiles");
144 144
docfiles.mkdir()
145

  
145 146
for (File infile : txmDir.listFiles()) {
146 147
	if (infile.isDirectory()) {
147 148
		File unzipDir = new File(docfiles, infile.getName())
......
205 206
if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
206 207
if (MONITOR != null) MONITOR.worked(20, "READ METADATA")
207 208
Metadatas metadatas; // text metadata
208
//println "Trying to read metadata from: "+allmetadatasfile
209
if (allmetadatasfile.exists()) {
210
	File copy = new File(binDir, allmetadatasfile.getName())
211
	if (!FileCopy.copy(allmetadatasfile, copy)) {
212
		println "Error: could not create a copy of the $allmetadatasfile file "+allmetadatasfile.getAbsoluteFile();
209
//println "Trying to read metadata from: "+allMetadataFile
210
if (allMetadataFile.exists()) {
211
	File copy = new File(binDir, allMetadataFile.getName())
212
	if (!FileCopy.copy(allMetadataFile, copy)) {
213
		println "Error: could not create a copy of the $allMetadataFile file "+allMetadataFile.getAbsoluteFile();
213 214
		return;
214 215
	}
215 216
	metadatas = new Metadatas(copy, Toolbox.getMetadataEncoding(), 
216 217
		Toolbox.getMetadataColumnSeparator(), 
217 218
		Toolbox.getMetadataTextSeparator(), 1)
218 219
} else {
219
	println "no $allmetadatasfile metadata file found."
220
	println "no $allMetadataFile metadata file found."
220 221
}
221 222

  
222 223
for (File infile : txmDir.listFiles()) {
......
238 239
if (metadatas != null) {
239 240
	if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
240 241
	if (MONITOR != null) MONITOR.worked(20, "INJECTING METADATA")
241
	println "-- INJECTING METADATA - from csv file: "+allmetadatasfile
242
	println "-- INJECTING METADATA - from csv file: "+allMetadataFile
242 243
	
243 244
	println("Injecting metadata: "+metadatas.getHeadersList()+" in texts of directory "+new File(binDir,"txm"))
244 245
	for (File infile : txmDir.listFiles()) {

Also available in: Unified diff