Révision 550

tmp/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 550)
8 8
import java.util.ArrayList;
9 9
import java.util.Date;
10 10
import java.util.HashMap;
11
import java.util.List;
11 12
import java.util.UUID;
12 13
import java.util.concurrent.Semaphore;
13 14
import java.util.regex.Pattern;
14 15

  
16
import org.apache.commons.lang.StringUtils;
15 17
import org.eclipse.core.runtime.IProgressMonitor;
16 18
import org.osgi.framework.FrameworkUtil;
17 19
import org.osgi.service.prefs.BackingStoreException;
......
231 233
	}
232 234

  
233 235
	/**
236
	 * sets the value of the specified key in parameters, local result node or
237
	 * default preferences nodes.
238
	 * 
239
	 * @param key
240
	 * @return
241
	 */
242
	public void setParameterValue(String key, Object value) {
243
		TXMPreferences.putLocal(this, key, value);
244
	}
245
	
246
	/**
247
	 * sets the value of the specified key in parameters, local result node or
248
	 * default preferences nodes.
249
	 * 
250
	 * @param key
251
	 * @return
252
	 */
253
	public void setParameterValue(String key, List<?> values) {
254
		TXMPreferences.putLocal(this, key, StringUtils.join(values, UNDERSCORE));
255
	}
256
	
257
	/**
234 258
	 * Gets the value of the specified key in parameters, local result node or
235 259
	 * default preferences nodes.
236 260
	 * 
......
297 321
	}
298 322

  
299 323
	/**
300
	 * Copies the parameters stored in the Java class members : the pXXXXX named members to the local preferences node.
324
	 * Copies the parameters stored in the @Parameter Java class members : the pXXXXX named members to the local preferences node.
301 325
	 * Commands must define this method to persist their parameters.
302 326
	 * Just returns <b>true</b> if you don't want to bother with this.
303 327
	 * 
......
305 329
	 */
306 330
	public abstract boolean saveParameters();
307 331

  
332
	/**
333
	 * Initialize the @Parameter class members objects
334
	 * 
335
	 * @param parameters
336
	 * @return
337
	 */
308 338
	public abstract boolean setParameters(TXMParameters parameters);
339
	
340
	/**
341
	 * Initialize the @Parameter class members objects using values persisted in the Preference Store
342
	 * @return
343
	 */
309 344
	public abstract boolean loadParameters();
310 345

  
311 346
	
tmp/org.txm.core/src/java/org/txm/objects/Alignement.java (revision 550)
1 1
package org.txm.objects;
2 2

  
3
import org.txm.core.results.TXMParameters;
3 4

  
5

  
4 6
/**
5 7
 * not used ?
6 8
 * deprecated ?
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 550)
959 959
				if (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) {
960 960
					//updateResultFromEditor();
961 961
					concordance.setQuery(queryWidget.getQuery());
962
					//compute(true);
962
					compute(true);
963 963
				}
964 964
			}
965 965

  
tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 550)
86 86
	protected List<Line> lines;
87 87
	/** The n lines. */
88 88
	protected int nLines;
89
	
89

  
90 90
	/** The keyword analysis properties */
91 91
	@Parameter
92 92
	protected List<Property> pAnalysisKeywordProperties;
......
153 153
		if (corpus != null) {
154 154
			setCQLSeparator(corpus.getCQLLimitQuery());
155 155
		}
156
		
157
		this.pTopIndex = this.getIntParameterValue(ConcordancePreferences.TOP_INDEX);
158
		this.pNLinesPerPage = this.getIntParameterValue(ConcordancePreferences.N_LINE_PER_PAGE);
159

  
160
		this.pLeftContextSize = this.getIntParameterValue(ConcordancePreferences.LEFT_CONTEXT_SIZE);
161
		this.pRightContextSize = this.getIntParameterValue(ConcordancePreferences.RIGHT_CONTEXT_SIZE);
162

  
163
		this.pLimitCQL = this.getStringParameterValue(ConcordancePreferences.LIMITCQL);
164

  
165
		try {
166
			String propertyNames = this.getStringParameterValue(ConcordancePreferences.KEYWORD_VIEW_PROPERTIES);
167
			this.pViewKeywordProperties = Property.stringToProperties(corpus, propertyNames);
168
			this.availableKeywordViewProperties = new ArrayList<Property>(corpus.getOrderedProperties());
169
			this.availableKeywordViewProperties.removeAll(pViewKeywordProperties);
170

  
171
			propertyNames = this.getStringParameterValue(ConcordancePreferences.LEFT_VIEW_PROPERTIES);
172
			this.pViewLeftProperties = Property.stringToProperties(corpus, propertyNames);
173
			this.availableLeftViewProperties = new ArrayList<Property>(corpus.getOrderedProperties());
174
			this.availableLeftViewProperties.removeAll(pViewLeftProperties);
175

  
176
			propertyNames = this.getStringParameterValue(ConcordancePreferences.RIGHT_VIEW_PROPERTIES);
177
			this.pViewRightProperties = Property.stringToProperties(corpus, propertyNames);
178
			this.availableRightViewProperties = new ArrayList<Property>(corpus.getOrderedProperties());
179
			this.availableRightViewProperties.removeAll(pViewRightProperties);
180

  
181
			propertyNames = this.getStringParameterValue(ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES);
182
			this.pAnalysisKeywordProperties = Property.stringToProperties(corpus, propertyNames);
183
			this.availableKeywordSortProperties = new ArrayList<Property>(corpus.getOrderedProperties());
184
			this.availableKeywordSortProperties.removeAll(pAnalysisKeywordProperties);
185

  
186
			propertyNames = this.getStringParameterValue(ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES);
187
			this.pAnalysisLeftProperties = Property.stringToProperties(corpus, propertyNames);
188
			this.availableLeftSortProperties = new ArrayList<Property>(corpus.getOrderedProperties());
189
			this.availableLeftSortProperties.removeAll(pAnalysisLeftProperties);
190

  
191
			propertyNames = this.getStringParameterValue(ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES);
192
			this.pAnalysisRightProperties = Property.stringToProperties(corpus, propertyNames);
193
			this.availableRightSortProperties = new ArrayList<Property>(corpus.getOrderedProperties());
194
			this.availableRightSortProperties.removeAll(pAnalysisRightProperties);
195

  
196
			String refPropertyNames = this.getStringParameterValue(ConcordancePreferences.VIEW_REFERENCEPATTERN);
197
			if ("*".equals(refPropertyNames)) {
198
				Property refProperty = corpus.getProperty("ref");
199
				if (refProperty == null) {
200
					StructuralUnitProperty sup_textid = corpus.getTextIdStructuralUnitProperty();
201
					this.pViewRefPattern = new ReferencePattern(sup_textid);
202
				} else {
203
					this.pViewRefPattern = new ReferencePattern(refProperty);
204
				}
205
			} else {
206
				this.pViewRefPattern = ReferencePattern.stringToReferencePattern(corpus, refPropertyNames);
207
			}
208
			
209
			refPropertyNames = this.getStringParameterValue(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN);
210
			if ("*".equals(refPropertyNames)) {
211
				Property refProperty = corpus.getProperty("ref");
212
				if (refProperty == null) {
213
					StructuralUnitProperty sup_textid = corpus.getTextIdStructuralUnitProperty();
214
					this.pAnalysisRefPattern = new ReferencePattern(sup_textid);
215
				} else {
216
					this.pAnalysisRefPattern = new ReferencePattern(refProperty);
217
				}
218
			} else {
219
				this.pAnalysisRefPattern = ReferencePattern.stringToReferencePattern(corpus, refPropertyNames);
220
			}
221
		} catch (CqiClientException e) {
222
			// TODO Auto-generated catch block
223
			e.printStackTrace();
224
		}
225 156
	}
226 157

  
227 158

  
......
1132 1063
		this.pAnalysisRefPattern = refAnalysePattern;
1133 1064
		this.pLeftContextSize = leftContextSize;
1134 1065
		this.pRightContextSize = rightContextSize;
1135
		
1066

  
1136 1067
		this.dirty = true;
1137 1068
	}
1138 1069

  
......
1616 1547
	public void setTopIndex(int i) {
1617 1548
		pTopIndex = i;
1618 1549
	}
1550

  
1551
	@Override
1552
	public boolean saveParameters() {
1553

  
1554
		this.setParameterValue(ConcordancePreferences.TOP_INDEX, this.pTopIndex);
1555
		this.setParameterValue(ConcordancePreferences.N_LINE_PER_PAGE, this.pNLinesPerPage);
1556

  
1557
		this.setParameterValue(ConcordancePreferences.LEFT_CONTEXT_SIZE, this.pLeftContextSize);
1558
		this.setParameterValue(ConcordancePreferences.RIGHT_CONTEXT_SIZE, this.pRightContextSize);
1559

  
1560
		this.setParameterValue(ConcordancePreferences.LIMITCQL, this.pLimitCQL);
1561

  
1562
		this.setParameterValue(ConcordancePreferences.KEYWORD_VIEW_PROPERTIES, this.pViewKeywordProperties);
1563

  
1564
		this.setParameterValue(ConcordancePreferences.LEFT_VIEW_PROPERTIES, this.pViewLeftProperties);
1565

  
1566
		this.setParameterValue(ConcordancePreferences.RIGHT_VIEW_PROPERTIES, this.pViewRightProperties);
1567

  
1568
		this.setParameterValue(ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES, this.pAnalysisKeywordProperties);
1569

  
1570
		this.setParameterValue(ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES, this.pAnalysisLeftProperties);
1571

  
1572
		this.setParameterValue(ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES, this.pAnalysisRightProperties);
1573

  
1574
		this.setParameterValue(ConcordancePreferences.VIEW_REFERENCEPATTERN, this.pViewRefPattern);
1575

  
1576
		this.setParameterValue(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN, pAnalysisRefPattern);
1577

  
1578
		return true;
1579
	}
1580

  
1581

  
1582
	@Override
1583
	public boolean loadParameters() {
1584

  
1585

  
1586
		try {
1587
			this.pTopIndex = this.getIntParameterValue(ConcordancePreferences.TOP_INDEX);
1588
			this.pNLinesPerPage = this.getIntParameterValue(ConcordancePreferences.N_LINE_PER_PAGE);
1589

  
1590
			this.pLeftContextSize = this.getIntParameterValue(ConcordancePreferences.LEFT_CONTEXT_SIZE);
1591
			this.pRightContextSize = this.getIntParameterValue(ConcordancePreferences.RIGHT_CONTEXT_SIZE);
1592

  
1593
			this.pLimitCQL = this.getStringParameterValue(ConcordancePreferences.LIMITCQL);
1594

  
1595
			String propertyNames = this.getStringParameterValue(ConcordancePreferences.KEYWORD_VIEW_PROPERTIES);
1596
			this.pViewKeywordProperties = Property.stringToProperties(getCorpus(), propertyNames);
1597
			this.availableKeywordViewProperties = new ArrayList<Property>(getCorpus().getOrderedProperties());
1598
			this.availableKeywordViewProperties.removeAll(pViewKeywordProperties);
1599

  
1600
			propertyNames = this.getStringParameterValue(ConcordancePreferences.LEFT_VIEW_PROPERTIES);
1601
			this.pViewLeftProperties = Property.stringToProperties(getCorpus(), propertyNames);
1602
			this.availableLeftViewProperties = new ArrayList<Property>(getCorpus().getOrderedProperties());
1603
			this.availableLeftViewProperties.removeAll(pViewLeftProperties);
1604

  
1605
			propertyNames = this.getStringParameterValue(ConcordancePreferences.RIGHT_VIEW_PROPERTIES);
1606
			this.pViewRightProperties = Property.stringToProperties(getCorpus(), propertyNames);
1607
			this.availableRightViewProperties = new ArrayList<Property>(getCorpus().getOrderedProperties());
1608
			this.availableRightViewProperties.removeAll(pViewRightProperties);
1609

  
1610
			propertyNames = this.getStringParameterValue(ConcordancePreferences.KEYWORD_ANALYSIS_PROPERTIES);
1611
			this.pAnalysisKeywordProperties = Property.stringToProperties(getCorpus(), propertyNames);
1612
			this.availableKeywordSortProperties = new ArrayList<Property>(getCorpus().getOrderedProperties());
1613
			this.availableKeywordSortProperties.removeAll(pAnalysisKeywordProperties);
1614

  
1615
			propertyNames = this.getStringParameterValue(ConcordancePreferences.LEFT_ANALYSIS_PROPERTIES);
1616
			this.pAnalysisLeftProperties = Property.stringToProperties(getCorpus(), propertyNames);
1617
			this.availableLeftSortProperties = new ArrayList<Property>(getCorpus().getOrderedProperties());
1618
			this.availableLeftSortProperties.removeAll(pAnalysisLeftProperties);
1619

  
1620
			propertyNames = this.getStringParameterValue(ConcordancePreferences.RIGHT_ANALYSIS_PROPERTIES);
1621
			this.pAnalysisRightProperties = Property.stringToProperties(getCorpus(), propertyNames);
1622
			this.availableRightSortProperties = new ArrayList<Property>(getCorpus().getOrderedProperties());
1623
			this.availableRightSortProperties.removeAll(pAnalysisRightProperties);
1624

  
1625
			String refPropertyNames = this.getStringParameterValue(ConcordancePreferences.VIEW_REFERENCEPATTERN);
1626
			if ("*".equals(refPropertyNames)) {
1627
				Property refProperty = getCorpus().getProperty("ref");
1628
				if (refProperty == null) {
1629
					StructuralUnitProperty sup_textid = getCorpus().getTextIdStructuralUnitProperty();
1630
					this.pViewRefPattern = new ReferencePattern(sup_textid);
1631
				} else {
1632
					this.pViewRefPattern = new ReferencePattern(refProperty);
1633
				}
1634
			} else {
1635
				this.pViewRefPattern = ReferencePattern.stringToReferencePattern(getCorpus(), refPropertyNames);
1636
			}
1637

  
1638
			refPropertyNames = this.getStringParameterValue(ConcordancePreferences.ANALYSIS_REFERENCEPATTERN);
1639
			if ("*".equals(refPropertyNames)) {
1640
				Property refProperty = getCorpus().getProperty("ref");
1641
				if (refProperty == null) {
1642
					StructuralUnitProperty sup_textid = getCorpus().getTextIdStructuralUnitProperty();
1643
					this.pAnalysisRefPattern = new ReferencePattern(sup_textid);
1644
				} else {
1645
					this.pAnalysisRefPattern = new ReferencePattern(refProperty);
1646
				}
1647
			} else {
1648
				this.pAnalysisRefPattern = ReferencePattern.stringToReferencePattern(getCorpus(), refPropertyNames);
1649
			}
1650
		} catch (CqiClientException e) {
1651
			// TODO Auto-generated catch block
1652
			e.printStackTrace();
1653
			return false;
1654
		}
1655

  
1656
		return true;
1657
	}
1619 1658
}
tmp/org.txm.rcp.feature/feature.xml (revision 550)
91 91
      <import plugin="org.txm.chartsengine.rcp"/>
92 92
      <import plugin="org.eclipse.core.expressions" version="3.4.600" match="greaterOrEqual"/>
93 93
      <import plugin="org.txm.ca.core"/>
94
      <import plugin="org.eclipse.core.commands" version="3.6.100" match="greaterOrEqual"/>
94 95
      <import plugin="org.txm.utils"/>
95 96
      <import plugin="org.txm.libs.itext"/>
96 97
      <import plugin="org.txm.libs.jfreechart"/>
97 98
      <import plugin="org.txm.chartsengine.core"/>
98 99
      <import plugin="org.eclipse.core.resources"/>
99 100
      <import plugin="org.eclipse.swt"/>
101
      <import plugin="org.eclipse.e4.ui.workbench.renderers.swt"/>
100 102
      <import plugin="org.eclipse.swt" version="3.103.2" match="greaterOrEqual"/>
101 103
      <import plugin="org.eclipse.e4.ui.workbench" version="1.2.2" match="greaterOrEqual"/>
102 104
      <import plugin="org.txm.concordance.core"/>
......
107 109
      <import plugin="org.txm.searchengine.cqp.core"/>
108 110
      <import plugin="org.apache.xerces" version="2.9.0" match="greaterOrEqual"/>
109 111
      <import plugin="org.eclipse.jface"/>
110
      <import plugin="org.eclipse.ui.workbench"/>
111
      <import plugin="org.txm.index.rcp"/>
112
      <import plugin="org.txm.progression.rcp"/>
113
      <import plugin="org.txm.lexicaltable.rcp"/>
114 112
      <import plugin="org.txm.partition.core"/>
115 113
      <import plugin="org.txm.concordance.rcp"/>
116 114
      <import plugin="org.txm.synopticeditor.rcp"/>
......
160 158
      <import plugin="org.eclipse.equinox.p2.reconciler.dropins" version="1.1.200" match="greaterOrEqual"/>
161 159
      <import plugin="org.eclipse.ui.views.log" version="1.0.500" match="greaterOrEqual"/>
162 160
      <import plugin="org.txm.groovy.core"/>
163
      <import plugin="org.eclipse.core.commands" version="3.6.100" match="greaterOrEqual"/>
164 161
      <import plugin="org.eclipse.ui.workbench" version="3.106.2" match="greaterOrEqual"/>
165 162
      <import plugin="org.txm.statsengine.r.core"/>
166 163
      <import plugin="org.eclipse.jface.text" version="3.9.2" match="greaterOrEqual"/>
......
170 167
      <import plugin="org.eclipse.jface.databinding" version="1.6.200" match="greaterOrEqual"/>
171 168
      <import plugin="org.eclipse.core.net" version="1.2.200" match="greaterOrEqual"/>
172 169
      <import plugin="org.txm.specificities.core"/>
173
      <import plugin="org.txm.chartsengine.r.core"/>
174
      <import plugin="org.txm.textsbalance.core" version="1.0.0" match="greaterOrEqual"/>
170
      <import plugin="org.txm.lexicaltable.rcp"/>
175 171
      <import plugin="org.txm.lexicon.core"/>
176
      <import plugin="org.txm.wordcloud.core" version="1.0.0" match="greaterOrEqual"/>
172
      <import plugin="org.eclipse.core.runtime" version="3.6.0" match="compatible"/>
173
      <import plugin="org.eclipse.help" version="3.2.0" match="compatible"/>
174
      <import plugin="org.eclipse.jface" version="3.9.0" match="compatible"/>
175
      <import plugin="org.eclipse.swt" version="3.101.0" match="compatible"/>
176
      <import plugin="org.eclipse.jface.databinding" version="1.3.0" match="compatible"/>
177
      <import plugin="org.eclipse.core.databinding.property" version="1.2.0" match="compatible"/>
178
      <import plugin="org.eclipse.core.databinding.observable" version="1.2.0" match="compatible"/>
179
      <import plugin="org.eclipse.e4.core.services" version="1.0.0" match="greaterOrEqual"/>
180
      <import plugin="org.eclipse.e4.core.contexts" version="1.0.0" match="greaterOrEqual"/>
181
      <import plugin="org.eclipse.e4.core.di" version="1.1.0" match="greaterOrEqual"/>
182
      <import plugin="org.eclipse.e4.ui.workbench.swt" version="0.9.1" match="greaterOrEqual"/>
183
      <import plugin="org.eclipse.e4.ui.di" version="0.9.0" match="greaterOrEqual"/>
184
      <import plugin="org.eclipse.e4.ui.model.workbench" version="0.9.1" match="greaterOrEqual"/>
185
      <import plugin="org.eclipse.e4.ui.css.swt.theme" version="0.9.0" match="greaterOrEqual"/>
186
      <import plugin="org.eclipse.e4.ui.bindings" version="0.9.0" match="greaterOrEqual"/>
187
      <import plugin="org.eclipse.e4.ui.css.swt" version="0.9.1" match="greaterOrEqual"/>
188
      <import plugin="org.eclipse.e4.ui.css.core" version="0.9.0" match="greaterOrEqual"/>
189
      <import plugin="org.eclipse.e4.ui.workbench3" version="0.12.0" match="greaterOrEqual"/>
190
      <import plugin="org.eclipse.e4.ui.workbench.addons.swt" version="0.10.0" match="greaterOrEqual"/>
191
      <import plugin="org.eclipse.emf.ecore" version="2.7.0" match="greaterOrEqual"/>
192
      <import plugin="com.ibm.icu"/>
193
      <import plugin="javax.annotation"/>
194
      <import plugin="javax.inject"/>
195
      <import plugin="org.eclipse.e4.core.commands"/>
196
      <import plugin="org.eclipse.e4.ui.services"/>
197
      <import plugin="org.eclipse.emf.common"/>
198
      <import plugin="javax.xml"/>
177 199
   </requires>
178 200

  
179 201
   <plugin
......
534 556
         id="javax.persistence"
535 557
         download-size="0"
536 558
         install-size="0"
537
         version="0.0.0"
559
         version="2.1.0.v201304241213"
538 560
         unpack="false"/>
539 561

  
540 562
   <plugin
541 563
         id="org.txm.specificities.rcp"
542 564
         download-size="0"
543 565
         install-size="0"
544
         version="0.0.0"
566
         version="1.0.0.qualifier"
545 567
         unpack="false"/>
546 568

  
547 569
   <plugin
......
562 584
         id="org.txm.wordcloud.core"
563 585
         download-size="0"
564 586
         install-size="0"
565
         version="0.0.0"
587
         version="1.0.0.qualifier"
566 588
         unpack="false"/>
567 589

  
568 590
   <plugin
569 591
         id="org.txm.wordcloud.rcp"
570 592
         download-size="0"
571 593
         install-size="0"
594
         version="1.0.0.qualifier"
595
         unpack="false"/>
596

  
597
   <plugin
598
         id="org.eclipse.ui.workbench"
599
         download-size="0"
600
         install-size="0"
572 601
         version="0.0.0"
573 602
         unpack="false"/>
574 603

  
tmp/org.txm.cah.core/src/org/txm/cah/core/functions/AHC.java (revision 550)
134 134
	}
135 135

  
136 136

  
137
	public void loadParameters() {
137
	public boolean loadParameters() {
138 138
		this.setParameters(
139 139
				this.getBooleanParameterValue(AHCPreferences.COLUMNS_COMPUTING),
140 140
				this.getStringParameterValue(AHCPreferences.METRIC),
141 141
				this.getIntParameterValue(AHCPreferences.N_CLUSTERS),
142 142
				this.getStringParameterValue(AHCPreferences.METHOD)
143 143
				);
144
		return true;
144 145
	}
145 146

  
146 147
	

Formats disponibles : Unified diff