Revision 1094

tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeValuesOfQuery.java (revision 1094)
52 52
import org.txm.rcp.swt.widget.AssistedQueryWidget;
53 53
import org.txm.rcp.utils.JobHandler;
54 54
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
55
import org.txm.searchengine.cqp.corpus.Corpus;
55
import org.txm.searchengine.cqp.corpus.CQPCorpus;
56 56
import org.txm.searchengine.cqp.corpus.Property;
57 57
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
58 58
import org.txm.utils.logger.Log;
......
78 78
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
79 79

  
80 80
		Object s = selection.getFirstElement();
81
		if (!(s instanceof Corpus)) return null;
81
		if (!(s instanceof CQPCorpus)) return null;
82 82

  
83
		final Corpus corpus = (Corpus) s;
83
		final CQPCorpus corpus = (CQPCorpus) s;
84 84
		
85 85
		CustomDialog dialog = new CustomDialog(HandlerUtil.getActiveShell(event), corpus);
86 86
		if (dialog.open() == Dialog.CANCEL) return null;
......
117 117
	
118 118
	class CustomDialog extends Dialog {
119 119

  
120
		Corpus corpus;
120
		CQPCorpus corpus;
121 121
		Text lemmaField;
122 122
		Spinner spinner;
123 123
		AssistedQueryWidget w;
......
125 125
		String lemmaproperty = "frlemma";
126 126
		String q = "[frpos=\"N.*|ADJ|V.*\"  & frlemma!=\"@card@|être|avoir|faire|pouvoir|devoir|vouloir|falloir|aller|dire|savoir|c'.+|s'.+\"]";
127 127
		
128
		protected CustomDialog(Shell parentShell, Corpus corpus) {
128
		protected CustomDialog(Shell parentShell, CQPCorpus corpus) {
129 129
			super(parentShell);
130 130
			this.corpus = corpus;
131 131
		}
tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeExpII.java (revision 1094)
44 44
import org.txm.rcp.JobsTimer;
45 45
import org.txm.rcp.swt.dialog.LastOpened;
46 46
import org.txm.rcp.utils.JobHandler;
47
import org.txm.searchengine.cqp.corpus.Corpus;
47
import org.txm.searchengine.cqp.corpus.CQPCorpus;
48 48
import org.txm.utils.logger.Log;
49 49

  
50 50
/**
......
68 68
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
69 69

  
70 70
		Object s = selection.getFirstElement();
71
		if (!(s instanceof Corpus)) return null;
71
		if (!(s instanceof CQPCorpus)) return null;
72 72
		
73
		final Corpus corpus = (Corpus) s;
73
		final CQPCorpus corpus = (CQPCorpus) s;
74 74
		System.out.println("Select lemma queries property file");
75 75
		final File queriesFiles = getPropFile(event);
76 76
		if (queriesFiles == null) return Status.CANCEL_STATUS;
tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/CreateContextSubcorpus.java (revision 1094)
49 49
import org.txm.rcp.swt.dialog.LastOpened;
50 50
import org.txm.rcp.utils.JobHandler;
51 51
import org.txm.rcp.views.corpora.CorporaView;
52
import org.txm.searchengine.cqp.corpus.Corpus;
52
import org.txm.searchengine.cqp.corpus.CQPCorpus;
53 53
import org.txm.searchengine.cqp.corpus.Subcorpus;
54 54
import org.txm.utils.logger.Log;
55 55

  
......
74 74
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
75 75

  
76 76
		Object s = selection.getFirstElement();
77
		if (!(s instanceof Corpus)) return null;
77
		if (!(s instanceof CQPCorpus)) return null;
78 78

  
79 79
	
80
		final Corpus corpus = (Corpus) s;
80
		final CQPCorpus corpus = (CQPCorpus) s;
81 81
		IInputValidator validator = new IInputValidator() {
82 82
			@Override
83 83
			public String isValid(String newText) {
tmp/org.txm.cql2lsa.rcp/src/org/txm/rcp/commands/function/ComputeExpI.java (revision 1094)
53 53
import org.txm.rcp.JobsTimer;
54 54
import org.txm.rcp.swt.dialog.LastOpened;
55 55
import org.txm.rcp.utils.JobHandler;
56
import org.txm.searchengine.cqp.corpus.Corpus;
56
import org.txm.searchengine.cqp.corpus.CQPCorpus;
57 57
import org.txm.utils.logger.Log;
58 58
// TODO: Auto-generated Javadoc
59 59
/**
......
77 77
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
78 78

  
79 79
		Object s = selection.getFirstElement();
80
		if (s instanceof Corpus) {
81
			Corpus corpus = (Corpus) s;
80
		if (s instanceof CQPCorpus) {
81
			CQPCorpus corpus = (CQPCorpus) s;
82 82
			try {
83 83
				File propFile = null;
84 84
				if (LastOpened.getFile(ID) != null)
......
105 105
		return null;
106 106
	}
107 107

  
108
	public static void compute(final Corpus corpus, final File propFile) {
108
	public static void compute(final CQPCorpus corpus, final File propFile) {
109 109
		final String title = "Compute QueryIndexOfText with "+corpus +" corpus properties file: "+propFile;
110 110
		JobHandler jobhandler = new JobHandler(title) {
111 111
			@Override
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpI.java (revision 1094)
28 28
import org.txm.rcp.IImageKeys;
29 29
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
30 30
import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
31
import org.txm.searchengine.cqp.corpus.Corpus;
31
import org.txm.searchengine.cqp.corpus.CQPCorpus;
32 32
import org.txm.searchengine.cqp.corpus.QueryResult;
33 33
import org.txm.searchengine.cqp.corpus.query.Match;
34 34
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
......
37 37
import org.txm.utils.logger.Log;
38 38

  
39 39
public class ExpI extends TXMResult implements IAdaptable {
40
	Corpus corpus;
40
	CQPCorpus corpus;
41 41
	List<String> texts;
42 42
	int[] textBoundaries;
43 43

  
......
46 46
	/** The writer. */
47 47
	private OutputStreamWriter writer;
48 48

  
49
	public ExpI(Corpus corpus) throws CqiClientException, IOException, CqiServerError, InvalidCqpIdException {
49
	public ExpI(CQPCorpus corpus) throws CqiClientException, IOException, CqiServerError, InvalidCqpIdException {
50 50
		super(corpus);
51 51
		this.corpus = corpus;
52 52
		//System.out.println("get text ids");
53
		texts = corpus.getTextsID();
53
		texts = corpus.getProject().getTextsID();
54 54
		//System.out.println( "init texts: "+texts);
55 55
		//System.out.println("get text limits: "+texts.size());
56 56
		textBoundaries = corpus.getTextEndLimits(); 
......
73 73
		return corpus;
74 74
	}
75 75

  
76
	public Corpus getCorpus() {
76
	public CQPCorpus getCorpus() {
77 77
		return corpus;
78 78
	}
79 79

  
......
326 326

  
327 327
		return tmp;
328 328
	}
329
	
330
	@Override
331
	public boolean delete() {
332
		if (corpus != null) return corpus.removeResult(this);
333
		return false;
334
	}
335 329

  
336 330
	@Override
337 331
	public String[] getExportTXTExtensions() {
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ContextSubcorpus.java (revision 1094)
15 15
import org.txm.searchengine.cqp.MemCqiClient;
16 16
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
17 17
import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
18
import org.txm.searchengine.cqp.corpus.Corpus;
18
import org.txm.searchengine.cqp.corpus.CQPCorpus;
19 19
import org.txm.searchengine.cqp.corpus.QueryResult;
20 20
import org.txm.searchengine.cqp.corpus.Subcorpus;
21 21
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
......
26 26
	protected ArrayList<QueryResult> results = new ArrayList<QueryResult>();
27 27
	protected HashMap<String, String> keywordQueriestoName = new HashMap<String, String>();
28 28

  
29
	protected Corpus corpus;
29
	protected CQPCorpus corpus;
30 30
	protected File keywordsFile;
31 31
	protected  int contextSize;
32 32

  
33
	public ContextSubcorpus(Corpus corpus, File keywordsFile, int contextSize) {
33
	public ContextSubcorpus(CQPCorpus corpus, File keywordsFile, int contextSize) {
34 34
		super(corpus);
35 35
		this.corpus = corpus;
36 36
		this.keywordsFile = keywordsFile;
......
49 49
	}
50 50

  
51 51
	@Override
52
	public boolean delete() {
53
		return false;
54
	}
55

  
56
	@Override
57 52
	public TXMResult getParent() {
58 53
		return corpus;
59 54
	}
60 55

  
61
	public Subcorpus getSubcorpus() throws InvalidCqpIdException {
56
	public Subcorpus getSubcorpus() throws Exception {
62 57
		if (results.size() > 0) {
63 58
			String name = keywordsFile.getName();
64 59
			int idx = name.indexOf(".");
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ValuesOfQuery.java (revision 1094)
16 16
import org.txm.searchengine.cqp.CQPSearchEngine;
17 17
import org.txm.searchengine.cqp.MemCqiClient;
18 18
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
19
import org.txm.searchengine.cqp.corpus.Corpus;
19
import org.txm.searchengine.cqp.corpus.CQPCorpus;
20 20
import org.txm.searchengine.cqp.corpus.Property;
21 21
import org.txm.searchengine.cqp.corpus.QueryResult;
22 22
import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
......
32 32
 */
33 33
public class ValuesOfQuery extends TXMResult {
34 34

  
35
	Corpus corpus;
35
	CQPCorpus corpus;
36 36
	CQLQuery query;
37 37
	Property prop;
38 38
	int fmin;
39 39

  
40
	public ValuesOfQuery(Corpus corpus, CQLQuery query, Property prop, int fmin)  {
40
	public ValuesOfQuery(CQPCorpus corpus, CQLQuery query, Property prop, int fmin)  {
41 41
		super(corpus);
42 42
		this.corpus = corpus;
43 43
		this.query = query;
......
182 182
	}
183 183

  
184 184
	@Override
185
	public boolean delete() {
186
		// TODO Auto-generated method stub
187
		return false;
188
	}
189

  
190
	@Override
191 185
	public TXMResult getParent() {
192 186
		return corpus;
193 187
	}
tmp/org.txm.cql2lsa.rcp/src/org/txm/functions/cql2lsa/ExpII.java (revision 1094)
31 31
import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
32 32
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
33 33
import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
34
import org.txm.searchengine.cqp.corpus.Corpus;
34
import org.txm.searchengine.cqp.corpus.CQPCorpus;
35 35
import org.txm.searchengine.cqp.corpus.QueryResult;
36 36
import org.txm.searchengine.cqp.corpus.query.Match;
37 37
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
......
40 40
import org.txm.utils.logger.Log;
41 41

  
42 42
public class ExpII extends TXMResult implements IAdaptable {
43
	Corpus corpus;
43
	CQPCorpus corpus;
44 44
	List<String> texts;
45 45
	int[] textBoundaries;
46 46

  
......
49 49
	/** The writer. */
50 50
	private OutputStreamWriter writer;
51 51

  
52
	public ExpII(Corpus corpus) throws CqiClientException, IOException, CqiServerError, InvalidCqpIdException {
52
	public ExpII(CQPCorpus corpus) throws CqiClientException, IOException, CqiServerError, InvalidCqpIdException {
53 53
		super(corpus);
54 54
		this.corpus = corpus;
55
		texts = corpus.getTextsID();
55
		texts = corpus.getProject().getTextsID();
56 56
		textBoundaries = corpus.getTextEndLimits(); 
57 57

  
58 58
	}
......
99 99
		return corpus;
100 100
	}
101 101

  
102
	public Corpus getCorpus() {
102
	public CQPCorpus getCorpus() {
103 103
		return corpus;
104 104
	}
105 105

  
......
489 489
	}
490 490

  
491 491
	@Override
492
	public boolean delete() {
493
		if (corpus != null) return corpus.removeResult(this);
494
		return false;
495
	}
496

  
497
	@Override
498 492
	public String[] getExportTXTExtensions() {
499 493
		return new String[]{"*.csv"};
500 494
	}
tmp/org.txm.index.rcp/src/org/txm/index/rcp/editors/IndexEditor.java (revision 1094)
69 69
import org.txm.rcp.views.QueriesView;
70 70
import org.txm.searchengine.core.Query;
71 71
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
72
import org.txm.searchengine.cqp.corpus.Corpus;
72
import org.txm.searchengine.cqp.corpus.CQPCorpus;
73 73
import org.txm.searchengine.cqp.corpus.Property;
74 74
import org.txm.searchengine.cqp.corpus.WordProperty;
75 75
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
......
394 394
		viewer.getTable().setHeaderVisible(true);
395 395
		viewer.getTable().addKeyListener(new TableKeyListener(viewer));
396 396

  
397
		String fontName = index.getCorpus().getFont();
397
		String fontName = index.getCorpus().getProject().getFont();
398 398
		if (fontName != null && fontName.length() > 0) {
399 399
			Font old = viewer.getTable().getFont();
400 400
			FontData fD = old.getFontData()[0];
......
613 613
	 *
614 614
	 * @return the corpus
615 615
	 */
616
	public Corpus getCorpus() {
616
	public CQPCorpus getCorpus() {
617 617
		return index.getCorpus();
618 618
	}
619 619

  
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeLexicon.java (revision 1094)
10 10
import org.txm.rcp.editors.TXMEditor;
11 11
import org.txm.rcp.handlers.BaseAbstractHandler;
12 12
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
13
import org.txm.searchengine.cqp.corpus.Corpus;
13
import org.txm.searchengine.cqp.corpus.CQPCorpus;
14 14
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
15 15

  
16 16

  
......
36 36
		Index index = null;
37 37
		
38 38
		// New Lexicon from Corpus
39
		if (selection instanceof Corpus)	{
40
			Corpus corpus = (Corpus) selection;
39
		if (selection instanceof CQPCorpus)	{
40
			CQPCorpus corpus = (CQPCorpus) selection;
41 41
			index = new Index(corpus);
42 42
			index.setLexiconMode(true);
43 43
			try {
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java (revision 1094)
34 34
import org.txm.index.rcp.editors.IndexEditor;
35 35
import org.txm.rcp.editors.TXMEditor;
36 36
import org.txm.rcp.handlers.BaseAbstractHandler;
37
import org.txm.searchengine.cqp.corpus.Corpus;
37
import org.txm.searchengine.cqp.corpus.CQPCorpus;
38 38
import org.txm.searchengine.cqp.corpus.Partition;
39 39

  
40 40
/**
......
67 67
			Object selection = this.getCorporaViewSelectedObject(event);
68 68
			
69 69
			// New editor from corpus
70
			if (selection instanceof Corpus) {
71
				index = new Index((Corpus) selection);
70
			if (selection instanceof CQPCorpus) {
71
				index = new Index((CQPCorpus) selection);
72 72
			}
73 73
			// New editor from partition
74 74
			else if (selection instanceof Partition) {
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java (revision 1094)
36 36
import org.txm.index.core.functions.Index;
37 37
import org.txm.links.rcp.handlers.SendSelectionToQueryable;
38 38
import org.txm.rcp.editors.TXMEditor;
39
import org.txm.searchengine.cqp.corpus.Corpus;
39
import org.txm.searchengine.cqp.corpus.CQPCorpus;
40 40
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
41 41

  
42 42
/**
......
71 71
	@Override
72 72
	public TXMResult getResultParent(ExecutionEvent event) {
73 73
		TXMEditor editor = (TXMEditor) HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getActivePart();
74
		return Corpus.getFirstParentCorpus(editor.getResult());
74
		return CQPCorpus.getFirstParentCorpus(editor.getResult());
75 75
	}
76 76

  
77 77

  
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/CreateSubCorpus.java (revision 1094)
47 47
import org.txm.rcp.views.corpora.CorporaView;
48 48
import org.txm.searchengine.cqp.CQPSearchEngine;
49 49
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
50
import org.txm.searchengine.cqp.corpus.Corpus;
50
import org.txm.searchengine.cqp.corpus.CQPCorpus;
51 51
import org.txm.searchengine.cqp.corpus.Subcorpus;
52 52
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
53 53
import org.txm.utils.logger.Log;
......
74 74
		}
75 75
		Object firstElement = selection.getFirstElement();
76 76
		
77
		if (!(firstElement instanceof Corpus)) {
77
		if (!(firstElement instanceof CQPCorpus)) {
78 78
			System.out.println(TXMUIMessages.CreateSubCorpus_3+firstElement);
79 79
			return null;
80 80
		}
81 81
		
82
		final Corpus corpus = (Corpus) firstElement;
82
		final CQPCorpus corpus = (CQPCorpus) firstElement;
83 83
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event)
84 84
				.getShell();
85 85
		final CreateSubcorpusDialog d = new CreateSubcorpusDialog(shell, corpus);
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/CreatePartition.java (revision 1094)
44 44
import org.txm.rcp.messages.TXMUIMessages;
45 45
import org.txm.rcp.utils.JobHandler;
46 46
import org.txm.rcp.views.corpora.CorporaView;
47
import org.txm.searchengine.cqp.corpus.Corpus;
47
import org.txm.searchengine.cqp.corpus.CQPCorpus;
48 48
import org.txm.searchengine.cqp.corpus.Partition;
49 49
import org.txm.utils.logger.Log;
50 50

  
......
72 72
	public Object execute(ExecutionEvent event) throws ExecutionException {
73 73
		selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event);
74 74

  
75
		final Corpus corpus = (Corpus) selection.getFirstElement();
75
		final CQPCorpus corpus = (CQPCorpus) selection.getFirstElement();
76 76
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
77 77
		final CreatePartitionDialog d = new CreatePartitionDialog(shell, corpus);
78 78
		int code = d.open();
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/OpenBiblio.java (revision 1094)
42 42
import org.txm.rcp.editors.TXMBrowser;
43 43
import org.txm.rcp.messages.TXMUIMessages;
44 44
import org.txm.rcp.swt.dialog.ComboDialog;
45
import org.txm.searchengine.cqp.corpus.Corpus;
45
import org.txm.searchengine.cqp.corpus.CQPCorpus;
46 46
/**
47 47
 * Open a text edition from: a main corpus : the first text of the maincorpus a
48 48
 * sub-corpus : the first text of the subcorpus a partition : the user must
......
73 73

  
74 74
		Shell shell = HandlerUtil.getActiveWorkbenchWindowChecked(event).getShell();
75 75

  
76
		if (selection.getFirstElement() instanceof Corpus) {
77
			Corpus corpus = (Corpus) selection.getFirstElement();
76
		if (selection.getFirstElement() instanceof CQPCorpus) {
77
			CQPCorpus corpus = (CQPCorpus) selection.getFirstElement();
78 78

  
79
			textids = new ArrayList<String>(corpus.getTextsID());
79
			textids = new ArrayList<String>(corpus.getProject().getTextsID());
80 80
			if (textids.size() == 0)
81 81
			{
82 82
				System.out.println(NLS.bind(TXMUIMessages.OpenBiblio_1, corpus.getName()));
......
105 105
	 * @param textid the textid
106 106
	 * @return the object
107 107
	 */
108
	public Object openBiblio(Corpus corpus, String textid ) {
108
	public Object openBiblio(CQPCorpus corpus, String textid ) {
109 109

  
110
		Text text = corpus.getMainCorpus().getText(textid);
110
		Text text = corpus.getProject().getText(textid);
111 111
		if (text == null) {
112 112
			System.out.println(NLS.bind(TXMUIMessages.OpenBiblio_7, textid, corpus.getName()));
113 113
			return null;
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/handlers/base/ComputeIntersection.java (revision 1094)
14 14
import org.txm.Toolbox;
15 15
import org.txm.searchengine.cqp.AbstractCqiClient;
16 16
import org.txm.searchengine.cqp.CQPSearchEngine;
17
import org.txm.searchengine.cqp.corpus.Corpus;
17
import org.txm.searchengine.cqp.corpus.CQPCorpus;
18 18
import org.txm.searchengine.cqp.corpus.CqpObject;
19 19
import org.txm.searchengine.cqp.corpus.MainCorpus;
20 20
import org.txm.searchengine.cqp.corpus.Subcorpus;
......
56 56
		MainCorpus ancestor = subcorpora.get(0).getMainCorpus();
57 57
		String id1 = subcorpora.get(0).getQualifiedCqpId();
58 58
		String id2 = subcorpora.get(1).getQualifiedCqpId();
59
		String cqpid = CqpObject.subcorpusNamePrefix + Corpus.getNextSubcorpusCounter();
59
		String cqpid = CqpObject.subcorpusNamePrefix + CQPCorpus.getNextSubcorpusCounter();
60 60
		String command = "inter";
61 61
		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
62 62

  
tmp/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/adapters/CorpusAdapterFactory.java (revision 1094)
13 13
import org.txm.rcp.IImageKeys;
14 14
import org.txm.rcp.adapters.TXMResultAdapter;
15 15
import org.txm.rcp.adapters.TXMResultAdapterFactory;
16
import org.txm.searchengine.cqp.corpus.Corpus;
16
import org.txm.searchengine.cqp.corpus.CQPCorpus;
17 17
import org.txm.searchengine.cqp.corpus.CorpusManager;
18 18
import org.txm.searchengine.cqp.corpus.Partition;
19 19
import org.txm.searchengine.cqp.corpus.Subcorpus;
......
31 31

  
32 32
	@Override
33 33
	public Object getAdapter(Object adaptableObject, Class adapterType) {
34
		if(adapterType == IWorkbenchAdapter.class && adaptableObject instanceof Corpus)	{
34
		if(adapterType == IWorkbenchAdapter.class && adaptableObject instanceof CQPCorpus)	{
35 35
			return new TXMResultAdapter() {
36 36
				@Override
37 37
				public Object[] getChildren(Object corpus) {
38
					ArrayList<TXMResult> allChildren = ((Corpus) corpus).getChildren();
38
					ArrayList<TXMResult> allChildren = ((CQPCorpus) corpus).getChildren();
39 39

  
40 40
					ArrayList partitions = new ArrayList();
41 41
					ArrayList subcorporas = new ArrayList();
......
52 52
							partitions.add(element);
53 53
						}
54 54
						// corpus
55
						else if(element instanceof Corpus)	{
55
						else if(element instanceof CQPCorpus)	{
56 56
							subcorporas.add(element);
57 57
						}
58 58
						// results
......
81 81
				public ImageDescriptor getImageDescriptor(Object object) {
82 82
					return AbstractUIPlugin.imageDescriptorFromPlugin(Application.PLUGIN_ID, IImageKeys.CORPUS);
83 83
				}
84

  
85

  
86
				@Override
87
				public Object getParent(Object corpus) {
88
					if (corpus instanceof Subcorpus) {
89
						return ((Subcorpus) corpus).getMotherSubcorpus();
90
					}
91
					else {
92
						return CorpusManager.getCorpusManager();
93
					}
94
				}
95 84
			};
96 85
		}
97 86
		return null;
tmp/org.txm.searchengine.cqp.rcp/plugin.xml (revision 1094)
259 259
   <extension
260 260
         point="org.eclipse.core.runtime.adapters">
261 261
      <factory
262
            adaptableType="org.txm.searchengine.cqp.corpus.Corpus"
262
            adaptableType="org.txm.searchengine.cqp.corpus.CQPCorpus"
263 263
            class="org.txm.searchengine.cqp.rcp.adapters.CorpusAdapterFactory">
264 264
         <adapter
265 265
               type="org.eclipse.ui.model.IWorkbenchAdapter">
......
302 302
                  ifEmpty="false"
303 303
                  operator="and">
304 304
               <instanceof
305
                     value="org.txm.searchengine.cqp.corpus.Corpus">
305
                     value="org.txm.searchengine.cqp.corpus.CQPCorpus">
306 306
               </instanceof>
307 307
            </iterate>
308 308
         </with>
tmp/org.txm.statsengine.r.rcp/src/org/txm/statsengine/r/rcp/views/RVariablesView.java (revision 1094)
65 65
import org.txm.rcp.commands.R.CopySelection;
66 66
import org.txm.rcp.handlers.files.EditFile;
67 67
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
68
import org.txm.searchengine.cqp.corpus.Corpus;
68
import org.txm.searchengine.cqp.corpus.CQPCorpus;
69 69
import org.txm.searchengine.cqp.corpus.CorpusManager;
70 70
import org.txm.searchengine.cqp.corpus.MainCorpus;
71 71
import org.txm.searchengine.cqp.corpus.Partition;
......
344 344
		 */
345 345
		@Override
346 346
		public final Image getImage(Object element) {
347
			if (element instanceof Corpus)
347
			if (element instanceof CQPCorpus)
348 348
				return IImageKeys.getImage(IImageKeys.CORPUS);
349 349
			else if (element instanceof Partition)
350 350
				return IImageKeys.getImage(IImageKeys.PARTITION);
......
424 424
				return partition;
425 425
			}
426 426
			
427
			Corpus corpus = null;
427
			CQPCorpus corpus = null;
428 428
			try {
429 429
				Method getname = element.getClass().getMethod("getCorpus"); //$NON-NLS-1$
430
				corpus = (Corpus)getname.invoke(element);
430
				corpus = (CQPCorpus)getname.invoke(element);
431 431
			} catch (Exception e) {}
432 432
			
433 433
			return corpus;
tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/editors/imports/sections/AnnotationSection.java (revision 1094)
13 13
import org.eclipse.ui.forms.widgets.TableWrapData;
14 14
import org.eclipse.ui.forms.widgets.TableWrapLayout;
15 15
import org.txm.annotation.kr.core.KRAnnotationEngine;
16
import org.txm.objects.BaseParameters;
16
import org.txm.objects.Project;
17 17
import org.txm.rcp.editors.imports.sections.ImportEditorSection;
18 18

  
19 19
public class AnnotationSection extends ImportEditorSection {
......
53 53
	}
54 54

  
55 55
	@Override
56
	public void update(BaseParameters params) {
56
	public void update(Project project) {
57 57
		if (this.section.isDisposed()) return;
58
		if (params == null) return;
59
		List<String> values = KRAnnotationEngine.getKnowledgeRepositoryNames(params);
58
		if (project == null) return;
60 59
		
61
		String value = params.getCorpusName()+DEFAULTNAMESUFFIX;
62
		if (values.size() > 0) {
63
			value = values.get(0);
64
		}
65
		nameText.setText(value);
60
//		List<String> values = KRAnnotationEngine.getKnowledgeRepositoryNames(project);
61
//		
62
//		String value = project.getName()+DEFAULTNAMESUFFIX;
63
//		if (values.size() > 0) {
64
//			value = values.get(0);
65
//		}
66
//		nameText.setText(value);
66 67
	}
67 68

  
68 69
	@Override
69
	public boolean save(BaseParameters params) {
70
	public boolean save(Project project) {
70 71
		if (!this.section.isDisposed()) {
71 72
			String value = nameText.getText();
72 73
						
tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java (revision 1094)
59 59
import org.txm.rcp.swt.provider.SimpleLabelProvider;
60 60
import org.txm.rcp.utils.JobHandler;
61 61
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
62
import org.txm.searchengine.cqp.corpus.Corpus;
62
import org.txm.searchengine.cqp.corpus.CQPCorpus;
63 63
import org.txm.searchengine.cqp.corpus.query.Match;
64 64
import org.txm.utils.logger.Log;
65 65

  
......
104 104

  
105 105
	protected Concordance concordance;
106 106

  
107
	private Corpus corpus;
107
	private CQPCorpus corpus;
108 108

  
109 109
	private ConcordanceAnnotations annotations = null;
110 110
	private Button addTypedValueLink;
tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java (revision 1094)
68 68
import org.txm.rcp.utils.JobHandler;
69 69
import org.txm.rcp.views.corpora.CorporaView;
70 70
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
71
import org.txm.searchengine.cqp.corpus.Corpus;
71
import org.txm.searchengine.cqp.corpus.CQPCorpus;
72 72
import org.txm.searchengine.cqp.corpus.query.Match;
73 73
import org.txm.utils.AsciiUtils;
74 74
import org.txm.utils.logger.Log;
......
117 117

  
118 118
	protected Concordance concordance;
119 119

  
120
	private Corpus corpus;
120
	private CQPCorpus corpus;
121 121

  
122 122
	private ConcordanceAnnotations annotations = null;
123 123

  
......
191 191
		annotations = new ConcordanceAnnotations(concordance);
192 192
		corpus = concordance.getCorpus();
193 193

  
194
		Corpus corpus = editor.getCorpus();
194
		CQPCorpus corpus = editor.getCorpus();
195 195

  
196 196
		this.annotManager = KRAnnotationEngine.getAnnotationManager(corpus);
197 197

  
tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java (revision 1094)
61 61
import org.txm.rcp.swt.provider.SimpleLabelProvider;
62 62
import org.txm.rcp.utils.JobHandler;
63 63
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
64
import org.txm.searchengine.cqp.corpus.Corpus;
64
import org.txm.searchengine.cqp.corpus.CQPCorpus;
65 65
import org.txm.searchengine.cqp.corpus.WordProperty;
66 66
import org.txm.searchengine.cqp.corpus.query.Match;
67 67
import org.txm.utils.AsciiUtils;
......
111 111
	protected TypedValue value_to_add;
112 112

  
113 113
	protected Concordance concordance;
114
	private Corpus corpus;
114
	private CQPCorpus corpus;
115 115
	private TableViewerColumn annotationColumnViewer;
116 116

  
117 117
	public String getName() {
tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/RecodeCorpus.java (revision 1094)
24 24
import org.txm.annotation.kr.core.conversion.CorpusRuledConvertion;
25 25
import org.txm.core.preferences.TBXPreferences;
26 26
import org.txm.importer.ImportKeys;
27
import org.txm.objects.BaseParameters;
27
import org.txm.objects.Project;
28 28
import org.txm.rcp.commands.CloseEditorsUsing;
29 29
import org.txm.rcp.handlers.scripts.ExecuteImportScript;
30 30
import org.txm.rcp.swt.widget.parameters.ParametersDialog;
......
87 87

  
88 88
	public static JobHandler recode(final MainCorpus corpus, CorpusRuledConvertion crc, String oldType, String newType, IProgressMonitor monitor) throws IOException, CqiClientException, XMLStreamException {
89 89

  
90
		Project project = corpus.getProject();
91
		if (!"xtz".equals(project.getImportModuleName())) {
92
			System.out.println("Corpus "+corpus+" was imported with XTZ import module");
93
			return null;
94
		}
95
		
90 96
		Property p1 = corpus.getProperty(oldType);
91 97
		if (p1 == null) {
92 98
			System.out.println("Corpus "+corpus+" has not property "+oldType);
......
105 111
		monitor.worked(1);
106 112
		
107 113
		// update corpus indexes and edition
108
		String txmhome = Toolbox.getTxmHomePath();
114
//		String txmhome = Toolbox.getTxmHomePath();
109 115

  
110
		BaseParameters params = corpus.getProject().getProjectParameters();
111
		params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
112
		params.getKeyValueParameters().put(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
113
		params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "true");
116
		
117
		project.getPreferences().getNode("import").put(ImportKeys.MULTITHREAD, "false"); //too soon
118
		project.getPreferences().getNode("import").putBoolean(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
119
		project.getPreferences().getNode("import").put(ImportKeys.UPDATECORPUS, "true");
114 120

  
115
		monitor.setTaskName("Updating corpus");
116
		File scriptDir = new File(txmhome, "scripts/groovy/user/org/txm/scripts/importer/xtz");
117
		File script = new File(scriptDir, "xtzLoader.groovy");
118
		System.out.println("Updating corpus "+corpus+" using "+params.paramFile);
119
		JobHandler ret = ExecuteImportScript.executeScript(script.getAbsolutePath(), params);
121
//		monitor.setTaskName("Updating corpus");
122
//		File scriptDir = new File(txmhome, "scripts/groovy/user/org/txm/scripts/importer/xtz");
123
//		File script = new File(scriptDir, "xtzLoader.groovy");
124
		System.out.println("Updating corpus "+corpus+" using "+project);
125
		JobHandler ret = ExecuteImportScript.executeScript(project);
120 126
		Display.getDefault().syncExec(new Runnable() {
121 127
			@Override
122 128
			public void run() {CloseEditorsUsing.corpus(corpus);}
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java (revision 1094)
46 46
import org.txm.index.core.functions.Lexicon;
47 47
import org.txm.lexicaltable.core.functions.LexicalTable;
48 48
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
49
import org.txm.searchengine.cqp.corpus.Corpus;
49
import org.txm.searchengine.cqp.corpus.CQPCorpus;
50 50
import org.txm.searchengine.cqp.corpus.Partition;
51 51
import org.txm.searchengine.cqp.corpus.Property;
52 52
import org.txm.specificities.core.messages.SpecificitiesCoreMessages;
......
112 112
	private Lexicon subLexicon;
113 113

  
114 114
	/** The corpus. */
115
	private Corpus corpus = null;
115
	private CQPCorpus corpus = null;
116 116

  
117 117
	/** The sub corpus. */
118
	private Corpus subCorpus = null;
118
	private CQPCorpus subCorpus = null;
119 119

  
120 120

  
121 121
	
......
430 430
				return lexicalTable.getColNames().asStringsArray();
431 431
			}
432 432
			catch (Exception e) {
433
				return ((Partition)this.lexicalTable.getParent()).getPartShortNames().toArray(new String[0]);
433
				return ((Partition)this.lexicalTable.getParent()).getPartNames().toArray(new String[0]);
434 434
			}
435 435
		} else if (this.subCorpus != null) {
436 436
			return new String[] { this.subCorpus.getName(), this.corpus.getName() + " \\ " + this.subCorpus.getName() }; //$NON-NLS-1$
tmp/org.txm.lexicaltable.rcp/src/org/txm/lexicaltable/rcp/editors/LexicalTableEditor.java (revision 1094)
66 66
import org.txm.rcp.swt.widget.structures.PropertiesComboViewer;
67 67
import org.txm.rcp.views.QueriesView;
68 68
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
69
import org.txm.searchengine.cqp.corpus.Corpus;
69
import org.txm.searchengine.cqp.corpus.CQPCorpus;
70 70
import org.txm.statsengine.core.StatException;
71 71
import org.txm.statsengine.core.data.Vector;
72 72
import org.txm.statsengine.r.rcp.views.RVariablesView;
......
175 175
			// unit property
176 176
			new Label(mainParametersArea, SWT.NONE).setText(TXMCoreMessages.common_property);
177 177
			this.unitPropertyComboViewer = new PropertiesComboViewer(mainParametersArea, this, true,
178
					Corpus.getFirstParentCorpus(this.getResult()).getOrderedProperties(),
178
					CQPCorpus.getFirstParentCorpus(this.getResult()).getOrderedProperties(),
179 179
					this.getResult().getProperty(), false);
180 180

  
181 181
			// Extended parameters
......
603 603
	 *
604 604
	 * @return the corpus
605 605
	 */
606
	public Corpus getCorpus() {
606
	public CQPCorpus getCorpus() {
607 607
		return null;
608 608
	}
609 609

  
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/statsengine/data/ILexicalTable.java (revision 1094)
32 32

  
33 33
import org.rosuda.REngine.REXPMismatchException;
34 34
import org.txm.core.results.TXMResult;
35
import org.txm.searchengine.cqp.corpus.Corpus;
35
import org.txm.searchengine.cqp.corpus.CQPCorpus;
36 36
import org.txm.searchengine.cqp.corpus.Partition;
37 37
import org.txm.searchengine.cqp.corpus.Property;
38 38
import org.txm.statsengine.core.StatException;
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 1094)
20 20
import org.txm.lexicaltable.core.statsengine.data.ILexicalTable;
21 21
import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
22 22
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
23
import org.txm.searchengine.cqp.corpus.Corpus;
23
import org.txm.searchengine.cqp.corpus.CQPCorpus;
24 24
import org.txm.searchengine.cqp.corpus.Partition;
25 25
import org.txm.searchengine.cqp.corpus.Property;
26 26
import org.txm.searchengine.cqp.corpus.Subcorpus;
......
79 79
	 * @param analysisProperty
80 80
	 * @param itable
81 81
	 */
82
	public LexicalTable(Corpus corpus, Property analysisProperty, ILexicalTable itable) {
82
	public LexicalTable(CQPCorpus corpus, Property analysisProperty, ILexicalTable itable) {
83 83
		super(corpus);
84 84
		this.property = analysisProperty;
85 85
		this.statsData = itable;
......
234 234
				}
235 235
			}
236 236
		}
237
		this.statsData = new LexicalTableImpl(mat, filteredForms.toArray(new String[]{}), partition.getPartShortNames().toArray(new String[] {}));
237
		this.statsData = new LexicalTableImpl(mat, filteredForms.toArray(new String[]{}), partition.getPartNames().toArray(new String[] {}));
238 238

  
239 239
	}
240 240

  
......
346 346
			this.subTask("Computing from Subcorpus.");
347 347

  
348 348
			Subcorpus subcorpus = (Subcorpus) this.parent;
349
			Corpus parentCorpus = subcorpus.getMotherCorpus();
349
			CQPCorpus parentCorpus = subcorpus.getMainCorpus();
350 350
			Lexicon l1 = new Lexicon(parentCorpus);
351 351
			l1.setProperty(property);
352 352
			l1.compute(this.monitor);
......
507 507
	 * 
508 508
	 * @return the corpus
509 509
	 */
510
	public Corpus getCorpus() {
511
		return Corpus.getFirstParentCorpus(this);
510
	public CQPCorpus getCorpus() {
511
		return CQPCorpus.getFirstParentCorpus(this);
512 512
	}
513 513

  
514 514
	
tmp/org.txm.core.tests/src/org/txm/rcp/commands/tests/TestImports.java (revision 1094)
43 43
import org.eclipse.swt.widgets.Shell;
44 44
import org.eclipse.ui.handlers.HandlerUtil;
45 45
import org.txm.Toolbox;
46
import org.txm.core.preferences.TBXPreferences;
47
import org.txm.objects.BaseParameters;
46
import org.txm.objects.Project;
48 47
import org.txm.rcp.JobsTimer;
49 48
import org.txm.rcp.handlers.scripts.ExecuteImportScript;
50 49
import org.txm.rcp.swt.dialog.LastOpened;
......
145 144
									scripts.get(filename));
146 145

  
147 146
							if (source.exists()) {
148
								final BaseParameters params = new BaseParameters(
149
										new File(source, "import.xml"));
150
								params.load();
151
								params.rootDir = source.getAbsolutePath(); // fix
152
																			// source
153
																			// dir
154
								params.saveToElement();
155 147
								
156
								this.acquireSemaphore();
157
								boolean returnSave = params.save();
158
								this.releaseSemaphore();
159
								
160
								if (!returnSave) {
161
									System.out
162
											.println("ERROR: could not save import configuration: "
163
													+ params.paramFile);
164
									continue;
165
								}
148
								Project project = new Project(Toolbox.workspace, "TEST-"+source.getName().substring(0, 3).toUpperCase());
149
								project.setSourceDirectory(source.getAbsolutePath());
150
								project.setImportModuleName(filename);//$NON-NLS-1$
166 151
								System.out.println("USING ROOT DIR : "
167
										+ params.rootDir);
152
										+ project.getSrcdir());
168 153
								this.syncExec(new Runnable() {
169 154
									public void run() {
170
										new ExecuteImportScript()
171
												.executeScript(script
172
														.getAbsolutePath(),
173
														params.paramFile);
155
										
156
										try {
157
											project.compute();
158
											
159
											new ExecuteImportScript()
160
											.executeScript(project);
161
										} catch (Exception e) {
162
											// TODO Auto-generated catch block
163
											e.printStackTrace();
164
										}
174 165
									}
175 166
								});
176 167
							} else {
......
188 179
						return Status.CANCEL_STATUS;
189 180
					}
190 181

  
191
					String date = BaseParameters.dateformat.format(new java.util.Date());
182
					String date = Toolbox.dateformat.format(new java.util.Date());
192 183
					File zipFile = new File(outDir.getParentFile(),
193 184
							"TESTS_imports_" + date + ".zip");
194 185
					File zipFile2 = new File(outDir.getParentFile(),
tmp/org.txm.core.tests/src/org/txm/rcp/commands/tests/TestImportLangs.java (revision 1094)
22 22
import org.eclipse.ui.handlers.HandlerUtil;
23 23
import org.txm.Toolbox;
24 24
import org.txm.core.preferences.TBXPreferences;
25
import org.txm.objects.BaseParameters;
25
import org.txm.objects.Project;
26 26
import org.txm.rcp.JobsTimer;
27 27
import org.txm.rcp.handlers.scripts.ExecuteImportScript;
28 28
import org.txm.rcp.utils.JobHandler;
......
104 104
		return null;
105 105
	}
106 106

  
107
	protected boolean importXMLCorpus(JobHandler jobhandler, File sourcesdir, File scriptsdir) throws ParserConfigurationException, SAXException, IOException {
107
	protected boolean importXMLCorpus(JobHandler jobhandler, File sourcesdir, File scriptsdir) throws Exception {
108 108
		final File source = new File(sourcesdir, "XMLLANGTEST");
109 109
		source.mkdirs();
110 110
		File oneTextFile = new File(source, "file.xml");
111 111
		IOUtils.write(oneTextFile, "<text>This corpus works fine. That's all.</text>");
112 112
		final File script = new File(scriptsdir, scripts.get("xml"));
113 113

  
114
		File paramFile = new File(source, "import.xml");
115
		BaseParameters.createEmptyParams(paramFile, "XMLLANGTEST");
116
		final BaseParameters params = new BaseParameters(paramFile);
117
		params.load();
118
		params.rootDir = source.getAbsolutePath();
119
		params.setAnnotationLang("en");
120
		params.setDoAnnotation(true); //$NON-NLS-1$
121
		params.saveToElement();
114
		final Project project = new Project(Toolbox.workspace, "TESTXML");
115
		project.setSourceDirectory(source.getAbsolutePath());
116
		project.setLang("en");
117
		project.setAnnotate(true); //$NON-NLS-1$
118
		project.setImportModuleName("xml");//$NON-NLS-1$
119
		project.compute();
122 120

  
123
		jobhandler.acquireSemaphore();
124
		boolean returnSave = params.save();
125
		jobhandler.releaseSemaphore();
126

  
127
		if (!returnSave) {
128
			System.out
129
			.println("ERROR: could not save import configuration: "
130
					+ params.paramFile);
131
			return false;
132
		}
133
		System.out.println("USING ROOT DIR : "+ params.rootDir);
121
		System.out.println("USING ROOT DIR : "+ project.getSrcdir());
134 122
		jobhandler.syncExec(new Runnable() {
135 123
			public void run() {
136 124
				new ExecuteImportScript();
137 125
				JobHandler job = ExecuteImportScript
138
						.executeScript(script
139
								.getAbsolutePath(),
140
								params);
126
						.executeScript(project);
141 127
				try {
142 128
					job.join();
143 129
				} catch (InterruptedException e) {
......
148 134
		});
149 135
		return true;	}
150 136

  
151
	protected boolean importTXTCorpus(JobHandler jobhandler, File sourcesdir, File scriptsdir) throws ParserConfigurationException, SAXException, IOException {
137
	protected boolean importTXTCorpus(JobHandler jobhandler, File sourcesdir, File scriptsdir) throws Exception {
152 138
		final File source = new File(sourcesdir, "TXTLANGTEST");
153 139
		source.mkdirs();
154 140
		File oneTextFile = new File(source, "file.txt");
......
156 142
		
157 143
		final File script = new File(scriptsdir, scripts.get("txt"));
158 144

  
159
		File paramFile = new File(source, "import.xml");
160
		BaseParameters.createEmptyParams(paramFile, "TXTLANGTEST");
161
		final BaseParameters params = new BaseParameters(paramFile);
162
		params.load();
163
		params.rootDir = source.getAbsolutePath();
164
		params.setAnnotationLang("fr");
165
		params.setDoAnnotation(true); //$NON-NLS-1$
166
		params.saveToElement();
167

  
168
		jobhandler.acquireSemaphore();
169
		boolean returnSave = params.save();
170
		jobhandler.releaseSemaphore();
171

  
172
		if (!returnSave) {
173
			System.out
174
			.println("ERROR: could not save import configuration: "
175
					+ params.paramFile);
176
			return false;
177
		}
178
		System.out.println("USING ROOT DIR : "+ params.rootDir);
145
		final Project project = new Project(Toolbox.workspace, "TESTTXT");
146
		project.setSourceDirectory(source.getAbsolutePath());
147
		project.setLang("fr");
148
		project.setAnnotate(true); //$NON-NLS-1$
149
		project.setImportModuleName("txt");//$NON-NLS-1$
150
		project.compute();
151
		
152
		System.out.println("USING ROOT DIR : "+ project.getSrcdir());
179 153
		jobhandler.syncExec(new Runnable() {
180 154
			public void run() {
181 155
				new ExecuteImportScript();
182 156
				JobHandler job = ExecuteImportScript
183
						.executeScript(script
184
								.getAbsolutePath(),
185
								params);
157
						.executeScript(project);
186 158
				try {
187 159
					job.join();
188 160
				} catch (InterruptedException e) {
tmp/org.txm.querycooccurrences.rcp/src/org/txm/links/coocmatrix/toCA.java (revision 1094)
4 4
import org.txm.functions.coocmatrix.QueryCooccurrence;
5 5
import org.txm.lexicaltable.core.functions.LexicalTable;
6 6
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
7
import org.txm.searchengine.cqp.corpus.Corpus;
7
import org.txm.searchengine.cqp.corpus.CQPCorpus;
8 8
import org.txm.searchengine.cqp.corpus.Property;
9 9
import org.txm.statsengine.core.StatException;
10 10

  
......
17 17
	 * @throws CqiClientException 
18 18
	 */
19 19
	public static CA link(QueryCooccurrence coocs) throws StatException, CqiClientException {
20
		Corpus corpus = coocs.getCorpus();
20
		CQPCorpus corpus = coocs.getCorpus();
21 21
		Property analysisProperty = null;
22 22
		try {
23 23
			analysisProperty = coocs.getCorpus().getProperty("word"); //$NON-NLS-1$
tmp/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryCooccurrence.java (revision 1094)
67 67
import org.txm.rcp.views.corpora.CorporaView;
68 68
import org.txm.searchengine.cqp.CQPSearchEngine;
69 69
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
70
import org.txm.searchengine.cqp.corpus.Corpus;
70
import org.txm.searchengine.cqp.corpus.CQPCorpus;
71 71
import org.txm.searchengine.cqp.corpus.StructuralUnit;
72 72
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
73 73
import org.txm.statsengine.r.rcp.views.RVariablesView;
......
100 100
				try {
101 101
					JobsTimer.start();
102 102

  
103
					if (!(element instanceof Corpus)) {
103
					if (!(element instanceof CQPCorpus)) {
104 104
						System.out.println(TXMUIMessages.ComputeCooccurrences_1+ element);
105 105
						return Status.CANCEL_STATUS;
106 106
					}
107
					Corpus corpus = ((Corpus)element);
107
					CQPCorpus corpus = ((CQPCorpus)element);
108 108

  
109 109
					final CoocMatrixDialog dialog = new ComputeQueryCooccurrence.CoocMatrixDialog(shell, corpus);
110 110
					syncExec(new Runnable() {
......
151 151
	}
152 152

  
153 153

  
154
	private QueryCooccurrence computeCooc(Shell shell, Corpus corpus, CoocMatrixDialog dialog) throws IOException {
154
	private QueryCooccurrence computeCooc(Shell shell, CQPCorpus corpus, CoocMatrixDialog dialog) throws IOException {
155 155
		ArrayList<CQLQuery> queries1 = new ArrayList<CQLQuery>();
156 156
		ArrayList<String> names1 = new ArrayList<String>();
157 157
		ArrayList<CQLQuery> queries2 = new ArrayList<CQLQuery>();
......
203 203
	}
204 204

  
205 205
	public class CoocMatrixDialog extends Dialog {
206
		Corpus corpus;
206
		CQPCorpus corpus;
207 207

  
208 208
		org.eclipse.swt.widgets.List propsCombo;
209 209
		Spinner distSpinner;
......
222 222

  
223 223

  
224 224

  
225
		public CoocMatrixDialog(Shell parentShell, Corpus corpus) {
225
		public CoocMatrixDialog(Shell parentShell, CQPCorpus corpus) {
226 226
			super(parentShell);
227 227
			this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
228 228
			this.corpus = corpus;
tmp/org.txm.querycooccurrences.rcp/src/org/txm/rcp/commands/function/ComputeQueryAutoCooccurrence.java (revision 1094)
64 64
import org.txm.rcp.views.corpora.CorporaView;
65 65
import org.txm.searchengine.cqp.CQPSearchEngine;
66 66
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
67
import org.txm.searchengine.cqp.corpus.Corpus;
67
import org.txm.searchengine.cqp.corpus.CQPCorpus;
68 68
import org.txm.searchengine.cqp.corpus.StructuralUnit;
69 69
import org.txm.searchengine.cqp.corpus.query.CQLQuery;
70 70
import org.txm.stat.utils.ConsoleProgressBar;
......
103 103
						return Status.CANCEL_STATUS;
104 104
					}
105 105
					QueryIndex qi = ((QueryIndex)element);
106
					Corpus corpus = qi.getCorpus();
106
					CQPCorpus corpus = qi.getCorpus();
107 107
					
108 108
					final CoocMatrixDialog dialog = new ComputeQueryAutoCooccurrence.CoocMatrixDialog(shell, corpus);
109 109
					syncExec(new Runnable() {
......
150 150
	}
151 151

  
152 152

  
153
	private QueryAutoCooccurrence computeCooc(Shell shell, Corpus corpus, QueryIndex element, CoocMatrixDialog dialog) {
153
	private QueryAutoCooccurrence computeCooc(Shell shell, CQPCorpus corpus, QueryIndex element, CoocMatrixDialog dialog) {
154 154
		ArrayList<CQLQuery> queries = new ArrayList<CQLQuery>();
155 155
		ArrayList<String> names = new ArrayList<String>();
156 156

  
......
194 194
	}
195 195

  
196 196
	public class CoocMatrixDialog extends Dialog {
197
		Corpus corpus;
197
		CQPCorpus corpus;
198 198

  
199 199
		org.eclipse.swt.widgets.List propsCombo;
200 200
		Spinner distSpinner;
......
209 209

  
210 210
		private Button orientedButton;
211 211

  
212
		public CoocMatrixDialog(Shell parentShell, Corpus corpus) {
212
		public CoocMatrixDialog(Shell parentShell, CQPCorpus corpus) {
213 213
			super(parentShell);
214 214
			this.setShellStyle(this.getShellStyle() | SWT.RESIZE);
215 215
			this.corpus = corpus;
tmp/org.txm.querycooccurrences.rcp/src/org/txm/functions/coocmatrix/QueryAutoCooccurrence.java (revision 1094)
15 15
import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
16 16
import org.txm.rcp.IImageKeys;
17 17
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
18
import org.txm.searchengine.cqp.corpus.Corpus;
18
import org.txm.searchengine.cqp.corpus.CQPCorpus;
19 19
import org.txm.searchengine.cqp.corpus.Partition;
20 20
import org.txm.searchengine.cqp.corpus.Property;
21 21
import org.txm.searchengine.cqp.corpus.QueryResult;
......
27 27

  
28 28
public class QueryAutoCooccurrence extends TXMResult implements ICAComputable, IAdaptable {
29 29
	
30
	protected Corpus corpus;
30
	protected CQPCorpus corpus;
31 31
	protected int[][] coocs;
32 32
	protected ArrayList<CQLQuery> queries;
33 33
	protected ArrayList<String> names;
......
44 44
	protected int minCooc;
45 45
	protected boolean oriented = false;
46 46

  
47
	public QueryAutoCooccurrence(Corpus corpus) {
47
	public QueryAutoCooccurrence(CQPCorpus corpus) {
48 48
		super(corpus);
49 49
	}
50 50
	
......
109 109
		return corpus.getName()+ " d="+dist+ " min="+minCooc;
110 110
	}
111 111

  
112
	public Corpus getParent() {
112
	public CQPCorpus getParent() {
113 113
		return corpus;
114 114
	}
115 115

  
......
197 197
		return outfile.exists();
198 198
	}
199 199

  
200
	public Corpus getCorpus() {
200
	public CQPCorpus getCorpus() {
201 201
		return corpus;
202 202
	}
203 203

  
......
243 243

  
244 244
	@Override
245 245
	public CA toCA() throws StatException, CqiClientException {
246
		Corpus corpus = this.getCorpus();
246
		CQPCorpus corpus = this.getCorpus();
247 247
		Property analysisProperty = null;
248 248
		try {
249 249
			analysisProperty = this.getCorpus().getProperty("word"); //$NON-NLS-1$
......
264 264
		return null;
265 265
	}
266 266

  
267
	@Override
268
	public boolean delete() {
269
		return corpus.removeResult(this);
270
	}
271

  
272 267
	/** The WordCloud adapter. */
273 268
	private static IWorkbenchAdapter coocMatrixAdapter = new IWorkbenchAdapter() {
274 269

  
tmp/org.txm.querycooccurrences.rcp/src/org/txm/functions/coocmatrix/QueryCooccurrence.java (revision 1094)
15 15
import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
16 16
import org.txm.rcp.IImageKeys;
17 17
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
18
import org.txm.searchengine.cqp.corpus.Corpus;
18
import org.txm.searchengine.cqp.corpus.CQPCorpus;
19 19
import org.txm.searchengine.cqp.corpus.Partition;
20 20
import org.txm.searchengine.cqp.corpus.Property;
21 21
import org.txm.searchengine.cqp.corpus.QueryResult;
......
27 27

  
28 28
public class QueryCooccurrence extends TXMResult implements ICAComputable, IAdaptable {
29 29
	
30
	protected Corpus corpus;
30
	protected CQPCorpus corpus;
31 31
	protected int[][] coocs;
32 32
	protected ArrayList<CQLQuery> queries1;
33 33
	protected ArrayList<String> names1;
......
45 45
	protected int nEdges = 0;
46 46
	protected int minCooc;
47 47
	
48
	public QueryCooccurrence(Corpus corpus, 
48
	public QueryCooccurrence(CQPCorpus corpus, 
49 49
			ArrayList<CQLQuery> queries1, ArrayList<String> names1, 
50 50
			ArrayList<CQLQuery> queries2, ArrayList<String> names2, 
51 51
			int dist, int minCooc, String struct) throws CqiClientException, RWorkspaceException {
......
129 129
		rw.eval("colnames("+symbol+") <- cooclabels");
130 130
	}
131 131

  
132
	public Corpus getCorpus() {
132
	public CQPCorpus getCorpus() {
133 133
		return corpus;
134 134
	}
135 135
	
......
175 175

  
176 176
	@Override
177 177
	public CA toCA() throws StatException, CqiClientException {
178
		Corpus corpus = this.getCorpus();
178
		CQPCorpus corpus = this.getCorpus();
179 179
		Property analysisProperty = null;
180 180
		try {
181 181
			analysisProperty = this.getCorpus().getProperty("word"); //$NON-NLS-1$
......
196 196
		return null;
197 197
	}
198 198

  
199
	@Override
200
	public boolean delete() {
201
		return corpus.removeResult(this);
202
	}
203

  
204 199
	public String[] getExportTXTExtensions() {
205 200
		return new String[]{"*.txt"};
206 201
	}
tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Apply.java (revision 1094)
20 20
import org.txm.rcp.swt.widget.parameters.ParametersDialog;
21 21
import org.txm.rcp.utils.JobHandler;
22 22
import org.txm.importer.xmltxm.Annotate;
23
import org.txm.searchengine.cqp.corpus.Corpus;
23
import org.txm.searchengine.cqp.corpus.CQPCorpus;
24 24
import org.txm.searchengine.cqp.corpus.MainCorpus;
25 25

  
26 26
/**
......
43 43
	 * 
44 44
	 */
45 45
	public Object execute(ExecutionEvent event) throws ExecutionException {
46
		Corpus corpus = null;
46
		CQPCorpus corpus = null;
47 47
		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
48 48
		
49 49
		ISelection isel = window.getActivePage().getSelection();
50 50
		if (isel instanceof IStructuredSelection) {
51 51
			IStructuredSelection sel = (IStructuredSelection)isel;
52 52
			Object first = sel.getFirstElement();
53
			if (first instanceof Corpus) {
54
				corpus = (Corpus)first;
53
			if (first instanceof CQPCorpus) {
54
				corpus = (CQPCorpus)first;
55 55
				if (ParametersDialog.open(this)) {
56 56
					apply(corpus, model, new String[]{posProperty, lemmaProperty}, options.split("  "));
57 57
					return corpus;
......
63 63
		return null;
64 64
	}
65 65
	
66
	public static void apply(Corpus corpus, final File model, final String[] properties, final String[] options) {
66
	public static void apply(CQPCorpus corpus, final File model, final String[] properties, final String[] options) {
67 67
		final MainCorpus mainCorpus = corpus.getMainCorpus();
68 68
		final File corpusBinaryDirectory = mainCorpus.getProjectDirectory();
69 69
		final File txmDirectory = new File(corpusBinaryDirectory, "txm/"+mainCorpus.getName());
tmp/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/LemmaProjection.java (revision 1094)
28 28
import org.txm.rcp.swt.widget.parameters.ParametersDialog;
29 29
import org.txm.rcp.utils.JobHandler;
30 30
import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
31
import org.txm.searchengine.cqp.corpus.Corpus;
31
import org.txm.searchengine.cqp.corpus.CQPCorpus;
32 32
import org.txm.searchengine.cqp.corpus.MainCorpus;
33 33
import org.txm.searchengine.cqp.corpus.Property;
34 34
import org.txm.stat.utils.ConsoleProgressBar;
......
62 62
	 * 
63 63
	 */
64 64
	public Object execute(ExecutionEvent event) throws ExecutionException {
65
		Corpus corpus = null;
65
		CQPCorpus corpus = null;
66 66
		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
67 67

  
68 68
		ISelection isel = window.getActivePage().getSelection();
69 69
		if (isel instanceof IStructuredSelection) {
70 70
			IStructuredSelection sel = (IStructuredSelection)isel;
71 71
			Object first = sel.getFirstElement();
72
			if (first instanceof Corpus) {
73
				corpus = (Corpus)first;
72
			if (first instanceof CQPCorpus) {
73
				corpus = (CQPCorpus)first;
74 74
				if (ParametersDialog.open(this)) {
75 75
					LinkedHashSet<String> formAsLemmaPosSet = new LinkedHashSet<String>();
76 76
					formAsLemmaPosSet.addAll(Arrays.asList(formAsLemmaPosList.split(",")));
......
90 90
		return null;
91 91
	}
92 92

  
93
	public static void apply(final Corpus corpus, final File dictionary, final File extrarules, final String posproperty, 
93
	public static void apply(final CQPCorpus corpus, final File dictionary, final File extrarules, final String posproperty, 
94 94
			final String targetproperty, final LinkedHashSet<String> formAsLemmaPosList, final LinkedHashSet<String> sourceprioritylist) {
95 95
		final MainCorpus mainCorpus = corpus.getMainCorpus();
96 96
		final File corpusBinaryDirectory = mainCorpus.getProjectDirectory();
......
252 252
					cpb.done();
253 253
					monitor.worked(50);
254 254

  
255
					// update corpus
256
					// update corpus indexes and edition
257
					//					String txmhome = Toolbox.getTxmHomePath();
258
					//
259
					//					BaseParameters params = corpus.getProject().getProjectParameters();
260
					//					params.getKeyValueParameters().put(ImportKeys.MULTITHREAD, "false"); //too soon
261
					//					params.getKeyValueParameters().put(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
262
					//					params.getKeyValueParameters().put(ImportKeys.UPDATECORPUS, "true");
263
					//
264
					//					monitor.setTaskName("Updating corpus");
265
					//					File scriptDir = new File(txmhome, "scripts/import");
266
					//					File script = new File(scriptDir, "xtzLoader.groovy");
267
					//					System.out.println("Updating corpus "+corpus+" using "+params.paramFile);
268
					//					boolean ret = ExecuteImportScript.executeScript(script.getAbsolutePath(), params);
269
					//					if (!ret) {
270
					//						System.out.println("Error during corpus re-import, check the XML-TXM files. Previous version can be restored from "+previousXMLTXMDirectory);
271
					//						return Status.CANCEL_STATUS;
272
					//					}
273
					//					Display.getDefault().syncExec(new Runnable() {
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff