Révision 1205

tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/RCPPreferences.java (revision 1205)
54 54
	/** The Constant RIGHT_CONTEXT_SIZE_DEFAULT. */
55 55
	public static final int RIGHT_CONTEXT_SIZE_DEFAULT = 15;
56 56

  
57
	public static final String UPDATESITE = "update_site"; //$NON-NLS-1$
57 58
	
58 59
	@Override
59 60
	public void initializeDefaultPreferences() {
tmp/org.txm.rcp/src/main/java/org/txm/rcp/preferences/DebugPreferencePage.java (revision 1205)
1 1
package org.txm.rcp.preferences;
2 2

  
3 3
import org.eclipse.jface.preference.BooleanFieldEditor;
4
import org.eclipse.jface.preference.StringFieldEditor;
4 5
import org.eclipse.ui.IWorkbench;
5
import org.eclipse.ui.preferences.ScopedPreferenceStore;
6 6
import org.txm.core.preferences.TBXPreferences;
7 7
import org.txm.rcp.messages.TXMUIMessages;
8 8
import org.txm.rcp.views.corpora.CorporaView;
......
20 20
	public void createFieldEditors() {
21 21
		// Show all result nodes in Corpora view
22 22
		addField(new BooleanFieldEditor(TBXPreferences.SHOW_ALL_RESULT_NODES, TXMUIMessages.preferences_advanced_showAllResultNodesInCorporaView, getFieldEditorParent()));
23
		addField(new StringFieldEditor(TBXPreferences.UPDATESITE, "Update site addres", getFieldEditorParent()));
23 24
	}
24 25
	
25 26
	
tmp/org.txm.rcp/src/main/java/org/txm/rcp/p2/plugins/InstallPluginHandler.java (revision 1205)
13 13
import org.eclipse.equinox.p2.ui.LoadMetadataRepositoryJob;
14 14
import org.eclipse.equinox.p2.ui.ProvisioningUI;
15 15
import org.eclipse.jface.wizard.WizardDialog;
16
import org.txm.core.preferences.TBXPreferences;
16 17
import org.txm.core.preferences.TXMPreferences;
17 18
import org.txm.rcp.preferences.RCPPreferences;
18 19
import org.txm.utils.logger.Log;
......
63 64
			
64 65
			Version v = Activator.getDefault().getBundle().getVersion();
65 66
			String version =  ""+v.getMajor()+"."+v.getMinor()+"."+v.getMicro();
66
			String uriBase = TXMUpdateHandler.UPDATESITE+"/"+version+"/ext";
67
			String uriBase = TBXPreferences.getInstance().getString(TBXPreferences.UPDATESITE)+"/"+version+"/ext";
67 68
			
68 69
			strategy.addLocation(new URI(uriBase+"/stable")); //$NON-NLS-1$
69 70
			
tmp/org.txm.rcp/src/main/java/org/txm/rcp/p2/plugins/TXMUpdateHandler.java (revision 1205)
42 42
import org.eclipse.ui.PlatformUI;
43 43
import org.eclipse.ui.statushandlers.StatusManager;
44 44
import org.osgi.framework.Version;
45
import org.txm.core.preferences.TBXPreferences;
45 46
import org.txm.core.preferences.TXMPreferences;
46 47
import org.txm.rcp.Activator;
47 48
import org.txm.rcp.TxmPreferences;
......
54 55

  
55 56
public class TXMUpdateHandler extends UpdateHandler {
56 57

  
57
	public static final String UPDATESITE = "http://textometrie.ens-lyon.fr/dist"; //
58
	//public static final String UPDATESITE = "http://textometrie.ens-lyon.fr/dist"; //
58 59
	// "file:"+System.getProperty("user.home")+"/TEMP/updates"; // LOCAL TEST ONLY
59 60
	public static final String ID = "org.txm.rcp.p2.plugins.TXMUpdateHandler";
60 61

  
......
96 97
			}
97 98

  
98 99
			// this is the default repository
99
			URL baseURL = new URL(UPDATESITE+"/index.html");
100
			URL baseURL = new URL(TBXPreferences.getInstance().getString(TBXPreferences.UPDATESITE)+"/index.html");
100 101
			try {
101 102
				InputStream s = baseURL.openStream();
102 103
				s.close();
103 104
			} catch(Exception e) {
104
				System.out.println("Update site is not reachable: "+UPDATESITE+", aborting.");
105
				System.out.println("Update site is not reachable: "+baseURL+", aborting.");
105 106
				return false;
106 107
			}
107 108

  
......
196 197
	public static void addDefaultUpdateSites(IProvisioningAgent agent) {
197 198
		Version v = Activator.getDefault().getBundle().getVersion();
198 199
		String version =  ""+v.getMajor()+"."+v.getMinor()+"."+v.getMicro();
199
		String uriBase = UPDATESITE+"/"+version+"/main";
200
		String uriBase = TBXPreferences.getInstance().getString(TBXPreferences.UPDATESITE)+"/"+version+"/ext";
200 201
		String uriDefault = uriBase+"/stable";
201 202
		try {
202 203
			URI repoUriDefault = new URI(uriDefault);
......
263 264
	public static void addDefaultPluginSites(IProvisioningAgent agent) {
264 265
		Version v = Activator.getDefault().getBundle().getVersion();
265 266
		String version =  ""+v.getMajor()+"."+v.getMinor()+"."+v.getMicro();
266
		String uriBase = UPDATESITE+"/"+version+"/ext";
267
		String uriBase = TBXPreferences.getInstance().getString(TBXPreferences.UPDATESITE)+"/"+version+"/ext";
267 268

  
268 269
		String uriDefault = uriBase+"/stable";
269 270
		try {
tmp/org.txm.rcp/META-INF/MANIFEST.MF (revision 1205)
36 36
 org.txm.annotation.core;visibility:=reexport,
37 37
 org.eclipse.ui.views;bundle-version="3.9.0";visibility:=reexport,
38 38
 org.txm.groovy.core;visibility:=reexport,
39
 org.txm.treetagger.core;visibility:=reexport
39
 org.txm.treetagger.core;visibility:=reexport,
40
 org.eclipse.equinox.p2.discovery.compatibility;bundle-version="1.0.201"
40 41
Export-Package: junit.extensions,
41 42
 junit.framework,
42 43
 junit.runner,
tmp/org.txm.treetagger.files.feature/feature.xml (revision 1205)
6 6
      provider-name="Textometrie.org">
7 7

  
8 8
   <description>
9
      Install TreeTagger for TXM.&lt;br/&gt;
10
See http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger for more informations about TreeTagger.
9
      FR and EN TreeTagger models / Modèles FR et EN de TreeTagger
11 10
   </description>
12 11

  
13 12
   <copyright url="http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/">
tmp/org.txm.ahc.core/META-INF/MANIFEST.MF (revision 1205)
10 10
Bundle-ManifestVersion: 2
11 11
Bundle-SymbolicName: org.txm.ahc.core;singleton:=true
12 12
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
13

  
tmp/org.txm.treetagger.binaries.feature/feature.xml (revision 1205)
6 6
      provider-name="Textometrie.org">
7 7

  
8 8
   <description url="http://www.example.com/description">
9
      [Enter Feature Description here.]
9
      Install TreeTagger / Installation TreeTagger
10 10
   </description>
11 11

  
12
   <copyright url="http://www.example.com/copyright">
13
      [Enter Copyright Description here.]
12
   <copyright url="http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/">
13
      See: http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/
14 14
   </copyright>
15 15

  
16
   <license url="http://www.example.com/license">
17
      [Enter License Description here.]
16
   <license url="http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/Tagger-Licence">
17
      ** TreeTagger License **
18

  
19
1. The Institut fuer maschinelle Sprachverarbeitung, Universitaet
20
   Stuttgart, subsequently called ``the licenser&apos;&apos;, grants you (the
21
   licensee) the rights to use the TreeTagger software subsequently
22
   called ``the system&apos;&apos; for evaluation, research and teaching
23
   purposes. **Any other usage of the system (in particular for
24
   commercial purposes) is forbidden**.
25

  
26
2. The licensee has no right to give or sell the system to third
27
   parties without written permission from the licenser.
28

  
29
3. The licenser has no obligation to maintain the system.
30
   Nevertheless the licensee is encouraged to report to the licenser
31
   any problems with or suggestions for improvement of the system.
32

  
33
4. The licenser has no obligation to make new releases available to the
34
   licensee, but where such updates are supplied they shall be governed by
35
   the terms of this agreement.
36

  
37
      NO WARRANTY
38

  
39
5. BECAUSE THE SYSTEM IS LICENSED FREE OF CHARGE, WE PROVIDE
40
ABSOLUTELY NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE
41
LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE LICENSER PROVIDES THE
42
SYSTEM &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
43
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
44
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK
45
AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH THE LICENSEE.
46
SHOULD THE SYSTEM PROVE DEFECTIVE, THE LICENSEE ASSUMES THE COST OF
47
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
48

  
49
6. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL THE LICENSER BE
50
LIABLE TO THE LICENSEE FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST
51
MONIES, OR OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
52
OUT OF THE USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS
53
OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD
54
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAM)
55
THE PROGRAM, EVEN IF THE LICENSEE HAS BEEN ADVISED OF THE POSSIBILITY
56
OF SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
57

  
58

  
59
Contact Adress:
60

  
61
Helmut Schmid
62
Institut fuer maschinelle Sprachverarbeitung (IMS) 
63
Universitaet Stuttgart
64
Azenbergstr. 12
65
D-70174 Stuttgart, Germany
66

  
67
Helmut.Schmid@ims.uni-stuttgart.de
18 68
   </license>
19 69

  
20 70
   <plugin
......
24 74
         download-size="0"
25 75
         install-size="0"
26 76
         version="0.0.0"
27
         fragment="true"
28
         unpack="false"/>
77
         fragment="true"/>
29 78

  
30 79
   <plugin
31 80
         id="org.txm.treetagger.core.macosx"
......
34 83
         download-size="0"
35 84
         install-size="0"
36 85
         version="0.0.0"
37
         fragment="true"
38
         unpack="false"/>
86
         fragment="true"/>
39 87

  
40 88
   <plugin
41 89
         id="org.txm.treetagger.core.win32"
......
44 92
         download-size="0"
45 93
         install-size="0"
46 94
         version="0.0.0"
47
         fragment="true"
48
         unpack="false"/>
95
         fragment="true"/>
49 96

  
50 97
</feature>
tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotationInjectionFromTTOutput.groovy (revision 1205)
172 172
	 * Builds the link parsers.
173 173
	 * I need to know what groups exists to build a parser per taxonomy and go to the first link element
174 174
	 */
175
	private void buildLinkParsers()
176
	{
175
	private void buildLinkParsers() {
177 176
		// link group of the standoff file
178 177
		links = findGrpLink();
179 178
		linkparsers = new HashMap<String, XMLStreamReader>();
......
191 190
				if (event == XMLStreamConstants.START_ELEMENT) {
192 191
					if (anaparser.getLocalName().equals("linkGrp")) { // position the parser to the right group
193 192
						String targetsvalue = anaparser.getAttributeValue(0)
194
						if (targetsvalue.equals(link))
193
						if (targetsvalue.equals(link)) {
195 194
							break; // next element is a link start tag
195
						}
196 196
					}
197 197
				}
198 198
			}
......
205 205
	 * @param link the link
206 206
	 * @return the next ana
207 207
	 */
208
	private String getNextAnaValue(String link, String wordId)
209
	{
208
	private String getNextAnaValue(String link, String wordId) {
210 209
		anaparser = linkparsers.get(link);
211 210
		def m;
212 211
		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
tmp/org.txm.rcp.feature/feature.xml (revision 1205)
250 250
      <import plugin="org.txm.chartsengine.core" version="1.0.0" match="greaterOrEqual"/>
251 251
      <import plugin="org.txm.groovy.core"/>
252 252
      <import plugin="org.txm.treetagger.core"/>
253
      <import plugin="org.txm.treetagger.rcp"/>
253 254
      <import plugin="javax.persistence" version="2.1.0" match="greaterOrEqual"/>
254 255
      <import plugin="org.eclipse.persistence.jpa" version="2.6.0" match="greaterOrEqual"/>
255 256
      <import plugin="org.eclipse.persistence.jpa.jpql" version="2.6.0" match="greaterOrEqual"/>
tmp/org.txm.core/src/java/org/txm/Toolbox.java (revision 1205)
558 558

  
559 559
	private static boolean startWorkspace(IProgressMonitor monitor) {
560 560
		
561
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
562
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
563
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
564
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
565
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
566
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
567
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
568
//		System.out.println("STARRTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT");
561 569
		String txmhomedir = getPreference(TBXPreferences.USER_TXM_HOME);
562 570
		if (txmhomedir == null || txmhomedir.length() == 0) {
563 571
			state = false;
tmp/org.txm.core/src/java/org/txm/core/preferences/TBXPreferences.java (revision 1205)
62 62
	 * To show or not all nodes in some views, eg. in CorporaView tree.
63 63
	 */
64 64
	public static final String SHOW_ALL_RESULT_NODES = "show_all_result_nodes"; //$NON-NLS-1$
65
	public static final String UPDATESITE = "update_site"; //$NON-NLS-1$
65 66
	
66 67
	
67 68
	/**
......
171 172
		
172 173
		preferences.putBoolean(SHOW_ALL_RESULT_NODES, false);
173 174
		preferences.putBoolean(AUTO_PERSISTENCE_ENABLED, false);
175
		
176
		if (Toolbox.getTxmHomePath().endsWith("-dev")) {
177
			preferences.put(UPDATESITE, "file:///"+System.getProperty("user.home")+"/workspace047/TXMReleasePlugins.site");
178
		} else {
179
			preferences.put(UPDATESITE, "http://textometrie.ens-lyon.fr/dist");
180
		}
174 181
	}
175 182
}
tmp/org.txm.core/src/java/org/txm/importer/scripts/xmltxm/AnnotationInjection.groovy (revision 1205)
186 186
	 * Builds the link parsers.
187 187
	 * I need to know what groups exists to build a parser per taxonomy and go to the first link element
188 188
	 */
189
	private void buildLinkParsers()
190
	{
189
	private void buildLinkParsers() {
190
		
191 191
		// link group of the standoff file
192 192
		links = findGrpLink();
193 193
		linkparsers = new LinkedHashMap<String, XMLStreamReader>();
......
205 205
				if (event == XMLStreamConstants.START_ELEMENT) {
206 206
					if (anaparser.getLocalName().equals("linkGrp")) { // position the parser to the right group
207 207
						String targetsvalue = anaparser.getAttributeValue(0)
208
						if (targetsvalue.equals(link))
208
						if (targetsvalue.equals(link)) {
209 209
							break; // next element is a link start tag
210
						}
210 211
					}
211 212
				}
212 213
			}
......
219 220
	 * @param link the link
220 221
	 * @return the next ana
221 222
	 */
222
	private String getNextAnaValue(String link, String wordId)
223
	{
223
	private String getNextAnaValue(String link, String wordId) {
224 224
		anaparser = linkparsers.get(link);
225 225
		def m;
226 226
		for (int event = anaparser.next(); event != XMLStreamConstants.END_DOCUMENT; event = anaparser.next()) {
......
274 274
	HashMap<String, String> anaValues = new HashMap<String, String>();
275 275
	boolean flagSourceDesc = false, flagW = false, flagAna = false;
276 276
	String type = null, resp = null, anaValue= "";
277
	protected void processStartElement()
278
	{
277
	protected void processStartElement() {
278
		
279 279
		if (localname.equals("taxonomy")) {
280 280
			String taxo = parser.getAttributeValue(0) // taxonomy type
281 281
			presentTaxonomies.add(taxo);
......
311 311
	protected void processCharacters() {
312 312
		if (flagAna) anaValue += parser.getText();
313 313
		else super.processCharacters(); // FORM CONTENT LOST !!!!!!!!!!!!!
314
	};
314
	}
315 315

  
316 316
	boolean applicationWritten = false;
317 317
	boolean taxonomiesWritten = false;
tmp/org.txm.textsbalance.rcp/src/org/txm/textsbalance/rcp/editors/TextsBalanceEditor.java (revision 1205)
27 27
	/**
28 28
	 * Group by words.
29 29
	 */
30
	protected Button groupByWords;
30
	protected Button countWordsButton;
31 31

  
32 32

  
33 33
	
......
66 66
		
67 67
		Group group = new Group(parametersArea, SWT.NONE);
68 68
		
69
		group.setText("Group by");
69
		group.setText("Count");
70 70
		group.setLayout(new RowLayout());
71 71
		
72 72
		this.groupByTexts = new Button(group, SWT.RADIO);
73
		this.groupByTexts.setText("text"); //$NON-NLS-1$
73
		this.groupByTexts.setText("texts"); //$NON-NLS-1$
74 74
		this.groupByTexts.setSelection(this.getResult().isGroupByTexts());	
75 75
		
76
		this.groupByWords = new Button(group, SWT.RADIO);
77
		this.groupByWords.setText("word"); //$NON-NLS-1$
78
		this.groupByWords.setSelection(!groupByTexts.getSelection());
76
		this.countWordsButton = new Button(group, SWT.RADIO);
77
		this.countWordsButton.setText("words"); //$NON-NLS-1$
78
		this.countWordsButton.setSelection(!groupByTexts.getSelection());
79 79

  
80 80
		
81 81
		// Structural units and properties combo viewers
......
89 89

  
90 90
		//supCombo.addSelectionListener(listener);
91 91
		groupByTexts.addSelectionListener(new ComputeSelectionListener(this));
92
		groupByWords.addSelectionListener(new ComputeSelectionListener(this));
93

  
92
		countWordsButton.addSelectionListener(new ComputeSelectionListener(this));
94 93
	}
95 94

  
96

  
97

  
98

  
99 95
	@Override
100 96
	public void updateEditorFromChart(boolean update) {
101 97
		// nothing to do
102 98
	}
103

  
104

  
105 99
}
tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java (revision 1205)
62 62
	 * Group by texts or not.
63 63
	 */
64 64
	@Parameter(key=TextsBalancePreferences.GROUP_BY_TEXTS)
65
	protected boolean groupByTexts;
65
	protected boolean countTexts;
66 66
	
67 67

  
68 68
	/**
......
102 102
	 * @param method
103 103
	 * @param su
104 104
	 * @param suPropertyName
105
	 * @param groupByTexts
105
	 * @param countTexts
106 106
	 */
107 107
	public void setParameters(StructuralUnit su, StructuralUnitProperty sup) {
108 108
		this.structuralUnit = su;
......
122 122
	 * @param method
123 123
	 * @param structuralUnit
124 124
	 * @param suPropertyName
125
	 * @param groupByTexts
125
	 * @param countTexts
126 126
	 * @throws CqiClientException
127 127
	 */
128 128
	protected boolean _compute() {
129 129
		
130
		this.subTask("Computing balance with metadata propertyName = " + this.structuralUnitProperty + ", structural unit = " + this.structuralUnit.getName() + " and groupByTexts = " + this.groupByTexts); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
130
		this.subTask("Computing balance with metadata propertyName = " + this.structuralUnitProperty + ", structural unit = " + this.structuralUnit.getName() + " and groupByTexts = " + this.countTexts); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
131 131
		try {
132 132
			this.dataset = new HashMap<Integer, Comparable[]>();
133 133
			
......
139 139
			if (this.method == 1) {
140 140
				for (String value : this.values) {
141 141
					int v = 0;
142
					if (this.groupByTexts) {
142
					if (this.countTexts) {
143 143
						QueryResult r = this.getCorpus().query(new CQLQuery("<"+p.getFullName()+"=\""+value+"\">[]"), "tmp", false);
144 144
						v = r.getNMatch();
145 145
						r.drop();
......
191 191
				//System.out.println( " with values: "+Arrays.toString(inter_values));
192 192
				HashMap<String, Integer> interUniq = new HashMap<String, Integer>();
193 193

  
194
				if (this.groupByTexts) {
194
				if (this.countTexts) {
195 195
					for (String o : interValues) {
196 196
						if (!interUniq.containsKey(o)) {
197 197
							interUniq.put(o, 0);
......
336 336

  
337 337
	@Override
338 338
	public String getSimpleName() {
339
		return 	this.structuralUnit.getName() + "@" + this.structuralUnitProperty + " (group by texts = " + this.groupByTexts + ")";
339
		return 	this.structuralUnit.getName() + "@" + this.structuralUnitProperty + " (group by texts = " + this.countTexts + ")";
340 340
	}
341 341

  
342 342
	@Override
......
374 374
	 * @return the groupByTexts
375 375
	 */
376 376
	public boolean groupingByTexts() {
377
		return groupByTexts;
377
		return countTexts;
378 378
	}
379 379

  
380 380

  
......
399 399
	 * @return the groupByTexts
400 400
	 */
401 401
	public boolean isGroupByTexts() {
402
		return groupByTexts;
402
		return countTexts;
403 403
	}
404 404

  
405 405

  
406 406
	/**
407
	 * @param groupByTexts the groupByTexts to set
407
	 * @param countTexts the groupByTexts to set
408 408
	 */
409
	public void setGroupByTexts(boolean groupByTexts) {
410
		this.groupByTexts = groupByTexts;
409
	public void setDoCountTexts(boolean countTexts) {
410
		this.countTexts = countTexts;
411 411
	}
412 412

  
413 413

  

Formats disponibles : Unified diff