Statistics
| Revision:

root / tmp / org.txm.groovy.core / src / groovy / org / txm / scripts / importer / xtz / xtzLoader.groovy @ 2126

History | View | Annotate | Download (1.8 kB)

1 321 mdecorde
// Copyright © 2010-2013 ENS de Lyon.
2 321 mdecorde
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
3 321 mdecorde
// Lyon 2, University of Franche-Comté, University of Nice
4 321 mdecorde
// Sophia Antipolis, University of Paris 3.
5 321 mdecorde
//
6 321 mdecorde
// The TXM platform is free software: you can redistribute it
7 321 mdecorde
// and/or modify it under the terms of the GNU General Public
8 321 mdecorde
// License as published by the Free Software Foundation,
9 321 mdecorde
// either version 2 of the License, or (at your option) any
10 321 mdecorde
// later version.
11 321 mdecorde
//
12 321 mdecorde
// The TXM platform is distributed in the hope that it will be
13 321 mdecorde
// useful, but WITHOUT ANY WARRANTY; without even the implied
14 321 mdecorde
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 321 mdecorde
// PURPOSE. See the GNU General Public License for more
16 321 mdecorde
// details.
17 321 mdecorde
//
18 321 mdecorde
// You should have received a copy of the GNU General
19 321 mdecorde
// Public License along with the TXM platform. If not, see
20 321 mdecorde
// http://www.gnu.org/licenses.
21 321 mdecorde
//
22 321 mdecorde
//
23 321 mdecorde
//
24 321 mdecorde
// $LastChangedDate: 2015-06-03 15:04:53 +0200 (mer., 03 juin 2015) $
25 321 mdecorde
// $LastChangedRevision: 2984 $
26 321 mdecorde
// $LastChangedBy: mdecorde $
27 321 mdecorde
//
28 986 mdecorde
package org.txm.scripts.importer.xtz;
29 321 mdecorde
30 321 mdecorde
import javax.xml.stream.*
31 321 mdecorde
32 321 mdecorde
import org.txm.*
33 321 mdecorde
import org.txm.metadatas.*
34 321 mdecorde
import org.txm.objects.*
35 1000 mdecorde
import org.txm.importer.scripts.xmltxm.*
36 321 mdecorde
import org.txm.tokenizer.TokenizerClasses
37 321 mdecorde
import org.txm.utils.*
38 321 mdecorde
import org.txm.utils.i18n.*
39 1000 mdecorde
import org.txm.importer.xtz.*
40 321 mdecorde
41 321 mdecorde
String userDir = System.getProperty("user.home");
42 321 mdecorde
43 321 mdecorde
def MONITOR;
44 1137 mdecorde
Project project;
45 321 mdecorde
46 1137 mdecorde
try {project=projectBinding;MONITOR=monitor} catch (Exception)
47 1137 mdecorde
{        }
48 1137 mdecorde
if (project == null) { println "no project set. Aborting"; return; }
49 321 mdecorde
50 1137 mdecorde
XTZImport i = new XTZImport(project);
51 479 mdecorde
/*
52 479 mdecorde
 * To customize the XTZ import, replace the importer, compiler, annotater or pager objects before calling process()
53 479 mdecorde
                i.importer = new XTZImporter(i)
54 479 mdecorde
                i.compiler = new XTZCompiler(i)
55 479 mdecorde
                i.annotater = new TTAnnotater(i);
56 479 mdecorde
                i.pager = new XTZPager(i)
57 479 mdecorde
 */
58 321 mdecorde
i.process();
59 1137 mdecorde
readyToLoad = i.isSuccessful && project.save()