Révision 1099

tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GSERunner.java (revision 1099)
57 57
		// check if script root dir was changed
58 58
		if (defaultScriptRootDir.equals(scriptRootDir) && defaultGSE != null) {
59 59
			try {
60
				defaultGSE.getGroovyClassLoader().addURL(new URL("file://"+script.getParent()));
60
				defaultGSE.getGroovyClassLoader().addURL(script.getParentFile().toURI().toURL());
61 61
			} catch (MalformedURLException e) {
62 62
				// TODO Auto-generated catch block
63 63
				e.printStackTrace();
......
161 161
	 * @param clazz
162 162
	 * @param args
163 163
	 * @return
164
	 * @throws MalformedURLException 
164 165
	 * @throws ResourceException
165 166
	 * @throws ScriptException
166 167
	 */
167 168
	@SuppressWarnings("rawtypes")
169
	public Object run(File script, Binding binding) throws MalformedURLException, ResourceException, ScriptException {
170
		return super.run(script.toURI().toURL().toString(), binding);
171
	}
172
	
173
	/**
174
	 * 
175
	 * Simplify the call a Groovy script within a Groovy script and allow to send named and typed arguments
176
	 * 
177
	 * @param clazz
178
	 * @param args
179
	 * @return
180
	 * @throws ResourceException
181
	 * @throws ScriptException
182
	 */
183
	@SuppressWarnings("rawtypes")
168 184
	public Object run(Class clazz, Map args) throws ResourceException, ScriptException {
169 185
		return run(clazz.getCanonicalName().replace(".", "/")+".groovy", new Binding(args));
170 186
	}
tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java (revision 1099)
86 86

  
87 87
			ExecTimer.start();
88 88
			Log.info("Start of Groovy import script" + mainScript.getAbsolutePath()); //$NON-NLS-1$
89
			gse.run(mainScript.getAbsolutePath(), binding); // run the groovy import script
89
			gse.run(mainScript.toURI().toURL().toString(), binding); // run the groovy import script
90 90
			System.out.println("\nEnd of Groovy import script: "+ExecTimer.stop()); //$NON-NLS-1$
91 91
			monitor.worked(90);
92 92

  
tmp/org.txm.core/src/java/org/txm/objects/Edition.java (revision 1099)
63 63

  
64 64
	@Parameter(key=TBXPreferences.NAMES)
65 65
	ArrayList<String> pPageNames = new ArrayList<String>();
66
	
66 67
	@Parameter(key="pages_wordids")
67 68
	ArrayList<String> pPageFirstWordIds = new ArrayList<String>();
68 69

  
......
356 357
		if (wordids != null && wordids.length() > 0) {
357 358
			pPageFirstWordIds = new ArrayList<>(Arrays.asList(wordids.split("\t")));
358 359
		}
360
		
361
		pages.clear();
362
		for (int i = 0 ; i < pPageNames.size() && i < pPageFirstWordIds.size() ; i++) {
363
			pages.add(new Page(this, pPageNames.get(i), pPageFirstWordIds.get(i)));
364
		}
365
		
359 366
		return true;
360 367
	}
361 368

  
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 1099)
78 78
	private HashMap<String, Alignement> links = new HashMap<String, Alignement>();
79 79

  
80 80
	@Parameter(key=TBXPreferences.DEFAULT_EDITION)
81
	private String pDefaultEditionName = null;
81
	private String pDefaultEditionName;
82 82

  
83 83
	/** The encoding. */
84 84
	@Parameter(key=TBXPreferences.ENCODING)
tmp/org.txm.core/src/java/org/txm/objects/Page.java (revision 1099)
65 65
		this.edition = edition;
66 66
		this.name = name;
67 67
		this.firstWordId = wordid;
68
		this.htmlfile = new File(edition.getHtmlDir(), name+".html");
68 69
	}
69 70
	
70 71
	/**
tmp/org.txm.rcp/plugin.xml (revision 1099)
2116 2116
            </command>
2117 2117

  
2118 2118
      </menuContribution>
2119
      <menuContribution
2120
            locationURI="popup:org.txm.rcp.views.BasesView">
2121
         <separator
2122
               name="org.txm.rcp.separator1">
2123
         </separator>
2124
         <command
2125
               commandId="org.txm.rcp.handlers.results.DeleteObject"
2126
               icon="icons/functions/Delete.png"
2127
               label="%command.label.65"
2128
               style="push"
2129
               tooltip="%command.tooltip.33">
2130
            <visibleWhen
2131
                  checkEnabled="false">
2132
               <or>
2133
                  <reference
2134
                        definitionId="OnePartitionSelected">
2135
                  </reference>
2136
                  <reference
2137
                        definitionId="OneSubCorpusSelected">
2138
                  </reference>
2139
                  <reference
2140
                        definitionId="OneBaseSelected">
2141
                  </reference>
2142
                  <reference
2143
                        definitionId="OneIndexSelected">
2144
                  </reference>
2145
                  <reference
2146
                        definitionId="OneLexiconSelected">
2147
                  </reference>
2148
                  <reference
2149
                        definitionId="OneConcordanceSelected">
2150
                  </reference>
2151
                  <reference
2152
                        definitionId="OneCASelected">
2153
                  </reference>
2154
                  <reference
2155
                        definitionId="OneSpecificitiesResultSelected">
2156
                  </reference>
2157
                  <reference
2158
                        definitionId="OneMainCorpusSelected">
2159
                  </reference>
2160
               </or>
2161
            </visibleWhen>
2162
         </command>
2163
        
2164
      </menuContribution>
2165 2119

  
2166 2120
      <menuContribution
2167 2121
            locationURI="popup:org.txm.rcp.editors.SVGGraphicEditor">
......
2541 2495
         name="%extension.name.3"
2542 2496
         point="org.eclipse.ui.commands">
2543 2497
      <command
2544
            defaultHandler="org.txm.rcp.commands.workspace.AddProject"
2545
            id="org.txm.rcp.commands.workspace.AddProject"
2546
            name="%command.name.11">
2547
      </command>
2548
      <command
2549
            defaultHandler="org.txm.rcp.commands.workspace.RemoveProject"
2550
            id="org.txm.rcp.commands.workspace.RemoveProject"
2551
            name="%command.name.12">
2552
      </command>
2553
      <command
2554
            defaultHandler="org.txm.rcp.commands.workspace.LoadBinaryCorpus"
2555
            id="org.txm.rcp.commands.workspace.LoadBinaryCorpus"
2556
            name="%command.name.13">
2557
      </command>
2558
      <command
2559 2498
            defaultHandler="org.txm.rcp.commands.workspace.LoadBinaryCorporaDirectory"
2560 2499
            id="org.txm.rcp.commands.workspace.LoadBinaryCorporaDirectory"
2561 2500
            name="%command.name.5">
2562 2501
      </command>
2563 2502
      <command
2564
            defaultHandler="org.txm.rcp.commands.workspace.RemoveBase"
2565
            id="org.txm.rcp.commands.workspace.RemoveBase"
2566
            name="%command.name.14">
2567
      </command>
2568
      <command
2569
            defaultHandler="org.txm.rcp.commands.workspace.AddText"
2570
            id="org.txm.rcp.commands.workspace.AddText"
2571
            name="%command.name.15">
2572
      </command>
2573
      <command
2574
            defaultHandler="org.txm.rcp.commands.workspace.RemoveText"
2575
            id="org.txm.rcp.commands.workspace.RemoveText"
2576
            name="%command.name.16">
2577
      </command>
2578
      <command
2579
            defaultHandler="org.txm.rcp.commands.workspace.BuildCorpus"
2580
            id="org.txm.rcp.commands.workspace"
2581
            name="%command.name.17">
2582
      </command>
2583
      <command
2584 2503
            defaultHandler="org.txm.rcp.commands.queryview.Copy"
2585 2504
            id="org.txm.rcp.commands.queryview.Copy"
2586 2505
            name="%command.name.55">
......
2598 2517
      <command
2599 2518
            defaultHandler="org.txm.rcp.handlers.results.CloneTXMResult"
2600 2519
            id="CloneTXMResult"
2601
            name="%command.name.7">
2520
            name="Clone">
2602 2521
      </command>
2603 2522
      <command
2604 2523
            defaultHandler="org.txm.rcp.views.debug.RefreshDebugView"
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java (revision 1099)
29 29

  
30 30
import java.io.File;
31 31

  
32
import org.txm.core.results.Parameter;
33
import org.txm.core.results.TXMParameters;
34
import org.txm.core.results.TXMResult;
35 32
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
36
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
37
import org.w3c.dom.Element;
38 33

  
39 34
/**
40 35
 * A Part is related to the {@link Partition} and is a CQP this.
......
43 38
 */
44 39
public class Part extends Subcorpus {
45 40

  
46
	@Parameter(key="subcorpus_uuid")
47
	String pSubCorpusUUID;
48
	
49
	Subcorpus subcorpus; // la part fait référence à un sous-corpus
50

  
51 41
	/** The number of texts composing this part. */
52 42
	private int nTexts = -1;
53 43

  
......
57 47
		this.setVisible(false);
58 48
		this.persistable = true;
59 49
		this.userPersistable = false;
60
		this.subcorpus = (Subcorpus) TXMResult.getResult(pSubCorpusUUID);
61 50
	}
62 51
	
63 52
	public Part(String uuid) {
......
66 55
		this.setVisible(false);
67 56
		this.persistable = true;
68 57
		this.userPersistable = false;
69
		this.subcorpus = (Subcorpus) TXMResult.getResult(pSubCorpusUUID);
70 58
	}
71 59
	
72 60
	public Partition getParent() {
......
101 89
	public String getResultype() {
102 90
		return "Part";
103 91
	}
104

  
105
	public Subcorpus getSubCorpus() {
106
		return subcorpus;
107
	}
108 92
}
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/CQLQuery.java (revision 1099)
368 368
	
369 369
	@Override
370 370
	public boolean equals(Object obj) {
371
		if (obj == null) return false;
371 372
		if (!(obj instanceof CQLQuery)) {
372 373
			return false;
373 374
		}
375
		if (this.queryString == null) return false;
376
		
374 377
		return this.queryString.equals(((CQLQuery) obj).queryString);
375 378
	}
376 379

  
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java (revision 1099)
498 498
	@Override
499 499
	public boolean saveParameters() throws Exception {
500 500
		if (pQuery != null) {
501
			this.setParameter(TBXPreferences.QUERY, pQuery.getQueryString());
501
			this.saveParameter(TBXPreferences.QUERY, pQuery.getQueryString());
502 502
		}
503 503
		return true;
504 504
	}

Formats disponibles : Unified diff