Revision 2019 tmp/org.txm.analec.rcp/src/org/txm/macro/urs/export/ExportAsMacro.groovy

ExportAsMacro.groovy (revision 2019)
18 18
import org.txm.searchengine.cqp.corpus.*
19 19
import org.txm.searchengine.cqp.corpus.query.CQLQuery
20 20
import org.txm.utils.io.FileCopy;
21
import org.txm.utils.io.IOUtils
21 22

  
22 23
import visuAnalec.elements.*
23 24

  
......
95 96
println registryFile.renameTo(registryFile2)
96 97
println txmFile.renameTo(txmFile2)
97 98

  
98
File importXMLFile = new File(newBinDirectory, "import.xml")
99
// patch name in settings
100
File projectPrefs = new File(newBinDirectory, ".settings/"+mainCorpus.getProject().getParametersNodePath())
101
File maincorpusPrefs = new File(newBinDirectory, ".settings/"+mainCorpus.getParametersNodePath())
102
IOUtils.write(projectPrefs, projectPrefs.getText().replace(name, new_name))
103
IOUtils.write(maincorpusPrefs, projectPrefs.getText().replace(name, new_name))
99 104

  
100 105
// patch registry
101 106
String oldcontent = registryFile2.getText();
......
105 110
	writer.write(content)
106 111
}
107 112

  
108
// patch import.xml
109 113

  
110 114

  
115

  
111 116
File zipFile = new File(newBinDirectory.getAbsolutePath()+".txm")
112 117
Zip.compress(newBinDirectory, zipFile, monitor)
113 118

  

Also available in: Unified diff