Statistics
| Revision:

root / tmp / org.txm.core / src / groovy / org / txm / importer / graal / qgraalLoader.groovy @ 187

History | View | Annotate | Download (4.1 kB)

1
// TODO: Auto-generated Javadoc
2
/* (non-Javadoc)
3
 * @see groovy.lang.Script#run()
4
 */
5
// Copyright © 2010-2013 ENS de Lyon.
6
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
7
// Lyon 2, University of Franche-Comté, University of Nice
8
// Sophia Antipolis, University of Paris 3.
9
// 
10
// The TXM platform is free software: you can redistribute it
11
// and/or modify it under the terms of the GNU General Public
12
// License as published by the Free Software Foundation,
13
// either version 2 of the License, or (at your option) any
14
// later version.
15
// 
16
// The TXM platform is distributed in the hope that it will be
17
// useful, but WITHOUT ANY WARRANTY; without even the implied
18
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19
// PURPOSE. See the GNU General Public License for more
20
// details.
21
// 
22
// You should have received a copy of the GNU General
23
// Public License along with the TXM platform. If not, see
24
// http://www.gnu.org/licenses.
25
// 
26
// 
27
// 
28
// $LastChangedDate: 2013-08-29 14:23:55 +0200 (jeu., 29 août 2013) $
29
// $LastChangedRevision: 2519 $
30
// $LastChangedBy: nilskredens $ 
31
//
32
package org.txm.importer.graal
33

    
34
//
35
//import org.txm.importer.graal.BuildGraalGSP;
36
//import org.txm.importer.graal.ImportInCWB;
37
//
38
//import org.txm.importer.cwb.CwbEncode
39
//import org.txm.importer.cwb.CwbMakeAll
40
//import org.txm.importer.cwb.PatchCwbRegistry;
41
//import org.txm.objects.*;
42
//import org.txm.utils.*;
43
//String userDir = System.getProperty("user.home");
44
//
45
//String rootDir;
46
//try{rootDir = rootDirBinding;}//srcDir the selected directoy in TXM RCP via the Binding 
47
//catch(Exception)
48
//{        println "DEV MODE";//exception means we debug
49
//        if(!org.txm.Toolbox.isInitialized())
50
//        {
51
//                rootDir = userDir+"/xml/qgraal/";
52
//                org.txm.Toolbox.workspace = new Workspace(new File(userDir,"TXM/workspaces/default.xml"));
53
//                org.txm.Toolbox.setParam(org.txm.Toolbox.INSTALL_DIR,new File(userDir,"TXM"));
54
//        }
55
//}
56
//
57
//String pathToCwbBinaries = org.txm.Toolbox.getParam(org.txm.Toolbox.INSTALL_DIR)+"/cwb/bin/";//chemin vers executable cqp de l'installation
58
//
59
//        //2- create GSP & import to WTC
60
//        println "EDITION"
61
//        def edition = new BuildGraalGSP(rootDir,//rootdir
62
//        pathToCwbBinaries// cwb utils dir
63
//        ,"qgraal_cm_2009-07-d",        "qgraal_frmod_2009-07-w",//infile1 , infile2
64
//        "qgraalcm","qgraalfrmod"); //outfile1 & outfile2
65
//        edition.start();
66
//        
67
//        println "COMPILATION"
68
//        def compiler = new ImportInCWB(rootDir,//rootdir
69
//        pathToCwbBinaries// cwb utils dir
70
//        ,"qgraal_cm_2009-07-d",        "qgraal_frmod_2009-07-w",//infile1 , infile2
71
//        "qgraalcm","qgraalfrmod"); //outfile1 & outfile2
72
//        compiler.start();
73
//
74
//        //THIS IS AN OLD SCRIPT WE HAVE TO MOVE SOMES FILES
75
//        new File(rootDir,"txm").deleteDir()
76
//        new File(rootDir,"txm").mkdir()
77
//        new File(rootDir,"HTML").deleteDir()
78
//        new File(rootDir,"HTML").mkdir()
79
//        //txm : copy src
80
//        FileCopy.copy(new File(rootDir+"/src","qgraal_cm_2009-07-d.xml"),new File(rootDir+"/txm","qgraal.xml"))
81
//        
82
//        //HTML : get from/cour
83
//        for(File f : new File(rootDir+"/imported/form/cour").listFiles())
84
//        {
85
//                String name = f.getName();
86
//                String pageid= name.substring(15,name.length()-4);
87
//                String newfilename = "qgraal_"+pageid+".html";
88
//                println newfilename
89
//                FileCopy.copy(f,new File(rootDir+"/HTML/multi",newfilename));
90
//        }
91
//        
92
//        //data
93
//        new File(rootDir,"data/qgraalcm").renameTo(new File(rootDir,"dataCM"));
94
//        new File(rootDir,"data").deleteDir();
95
//        new File(rootDir,"dataCM").renameTo(new File(rootDir,"data"));
96
//        
97
//        //registry
98
//        File registryfiletopatch = new File(rootDir+"/registry",qgraalcm);
99
//        File cwbindex = new File(rootDir,"data");
100
//        try {
101
//                PatchCwbRegistry.patch(registryfiletopatch, cwbindex);
102
//        } catch (IOException e) {org.txm.utils.logger.Log.printStackTrace(e);}
103
//        
104
//        // copy reg
105
//        try {
106
//                FileCopy.copy(registryfiletopatch, new File(registrypath,"qgraalcm"));
107
//        } catch (IOException e) {org.txm.utils.logger.Log.printStackTrace(e);}
108
//        
109
//        
110
//        Workspace w = org.txm.Toolbox.workspace;
111
//        Project p = w.getProject("default")
112
//        p.removeBase("qgraal")
113
//        Base b = p.addBase("qgraal");
114
//        b.addDirectory(new File(rootDir,"txm"));
115
//
116
//