Révision 3295
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/ImporterCorpusOkapiMacro.groovy (revision 3295) | ||
---|---|---|
37 | 37 |
|
38 | 38 |
String parentCorpusName = parentCorpus.getCqpId() |
39 | 39 |
|
40 |
if (parentCorpusName.startsWith("AF-VOIX-OFF-")) { |
|
40 |
if (parentCorpusName.startsWith("AF-VOIX-OFF-") || parentCorpusName.startsWith("AFNOTICES") || parentCorpusName.startsWith("AF-NOTICES") || parentCorpusName.startsWith("AF-PLAN")) {
|
|
41 | 41 |
|
42 |
} else if (parentCorpusName.startsWith("AFNOTICES") || parentCorpusName.startsWith("AF-NOTICES")) { |
|
43 |
|
|
44 | 42 |
} else { |
45 |
monitorShowError("Erreur: le corpus n'est pas un corpus d'AF-VOIX-OFF ni AFNOTICE") |
|
43 |
monitorShowError("Erreur: le corpus n'est pas un corpus d'AF-VOIX-OFF, ni AF-NOTICE, ni AF-PLAN, ni AFNOTICE")
|
|
46 | 44 |
return false |
47 | 45 |
} |
48 | 46 |
|
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/ListerIdentifiantsSujetsMacro.groovy (revision 3295) | ||
---|---|---|
24 | 24 |
def finalValues = [] |
25 | 25 |
def ids = null |
26 | 26 |
|
27 |
if (parentCorpusName.startsWith("AF-VOIX-OFF-") || parentCorpusName.startsWith("AF-NOTICES")) {
|
|
27 |
if (parentCorpusName.startsWith("AF-VOIX-OFF-") || parentCorpusName.startsWith("AF-NOTICES") || parentCorpusName.startsWith("AF-PLAN") {
|
|
28 | 28 |
|
29 | 29 |
struct_prop = corpus.getStructuralUnit("div").getProperty("id") |
30 | 30 |
values = struct_prop.getValues(corpus) |
... | ... | |
34 | 34 |
} |
35 | 35 |
} |
36 | 36 |
|
37 |
} else if (parentCorpusName.startsWith("AFNOTICES")) { |
|
38 |
|
|
39 |
struct_prop = corpus.getStructuralUnit("notice").getProperty("identifiantdelanotice") |
|
40 |
def values = struct_prop.getValues(corpus) |
|
41 |
|
|
42 |
def struct_prop2 = corpus.getStructuralUnit("notice").getProperty("typedenotice") |
|
43 |
def qr = corpus.query(new CQLQuery("<notice_typedenotice=\"Notice sujet\">[]"), "TMP", false) |
|
44 |
int[] positions = qr.getStarts() |
|
45 |
int[] strucs = CQPSearchEngine.getCqiClient().cpos2Struc(struct_prop2.getQualifiedName(), positions) |
|
46 |
String sujetsIDS = CQPSearchEngine.getCqiClient().struc2Str(struct_prop.getQualifiedName(), strucs) |
|
47 |
for (String id : values) { |
|
48 |
int idx = sujetsIDS.indexOf(id) |
|
49 |
if (idx > 0) { |
|
50 |
finalValues << id // this id is actually in the sujetsIDS |
|
51 |
} |
|
52 |
} |
|
53 |
|
|
37 | 54 |
} else { |
38 |
monitorShowError("Erreur: le corpus n'est pas un corpus d'AF-VOIX-OFF ni AFNOTICE") |
|
55 |
monitorShowError("Erreur: le corpus n'est pas un corpus d'AF-VOIX-OFF, ni AF-NOTICE, ni AF-PLAN, ni AFNOTICE")
|
|
39 | 56 |
return false |
40 | 57 |
} |
41 | 58 |
|
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/ExporterSousCorpusSujetsDansOkapiMacro.groovy (revision 3295) | ||
---|---|---|
32 | 32 |
def finalValues = [] |
33 | 33 |
def ids = null |
34 | 34 |
|
35 |
if (parentCorpusName.startsWith("AF-VOIX-OFF-")) { |
|
35 |
if (parentCorpusName.startsWith("AF-VOIX-OFF-") || parentCorpusName.startsWith("AFNOTICES") || parentCorpusName.startsWith("AF-NOTICES") || parentCorpusName.startsWith("AF-PLAN")) {
|
|
36 | 36 |
ids = gse.run(ListerIdentifiantsSujetsMacro, ["args":[:], "corpusViewSelection":corpusViewSelection, "monitor":monitor]) |
37 |
} else if (parentCorpusName.startsWith("AFNOTICES") || parentCorpusName.startsWith("AF-NOTICES")) { |
|
38 |
ids = gse.run(ListerIdentifiantsSujetsMacro, ["args":[:], "corpusViewSelection":corpusViewSelection, "monitor":monitor]) |
|
39 | 37 |
} else { |
40 |
monitorShowError("Erreur : le corpus n'est pas un corpus d'AF-VOIX-OFF ni AF-NOTICES")
|
|
38 |
monitorShowError("Erreur: le corpus n'est pas un corpus d'AF-VOIX-OFF, ni AF-NOTICE, ni AF-PLAN, ni AFNOTICE")
|
|
41 | 39 |
return false |
42 | 40 |
} |
43 | 41 |
|
TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/InstallerEtMettreAJourOutilsMacro.groovy (revision 3295) | ||
---|---|---|
1 | 1 |
import org.txm.Toolbox |
2 | 2 |
import org.txm.utils.ConsoleProgressBar |
3 | 3 |
import org.txm.utils.io.IOUtils |
4 |
import org.txm.rcp.views.fileexplorer.MacroExplorer |
|
4 | 5 |
|
5 | 6 |
def groovyUserDirectory = new File(Toolbox.getTxmHomePath() + "/scripts/groovy/user/org/txm/macro/projects/antract"); |
6 | 7 |
|
... | ... | |
13 | 14 |
return; |
14 | 15 |
} |
15 | 16 |
|
16 |
String svn = "http://forge.cbp.ens-lyon.fr/svn/txm/TXM/main/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/"
|
|
17 |
String svn = "http://forge.cbp.ens-lyon.fr/svn/txm/TXM/trunk/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/"
|
|
17 | 18 |
try { |
18 | 19 |
macros = IOUtils.getText(new URL(svn+"manifest"), "UTF-8") |
19 | 20 |
macros = macros.split("\n") |
... | ... | |
39 | 40 |
println "\nErreur lors de la récupération de $f: $e" |
40 | 41 |
} |
41 | 42 |
} |
42 |
println "\nAntract tools updated \\o/" |
|
43 | 43 |
|
44 |
monitor.syncExec(new Runnable() { |
|
45 |
public void run() { |
|
46 |
MacroExplorer.refresh(); |
|
47 |
|
|
48 |
println "\nAntract tools have been updated." |
|
49 |
} |
|
50 |
}); |
|
51 |
|
|
52 |
|
|
44 | 53 |
def monitorShowError(String message) { |
45 | 54 |
monitor.syncExec(new Runnable() { |
46 | 55 |
public void run() { |
Formats disponibles : Unified diff