Revision 1112

tmp/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java (revision 1112)
239 239
	}
240 240

  
241 241
	/**
242
	 * Creates a not computed cooccurrence from the uuid node.
243
	 * @param uuid
242
	 * Creates a not computed cooccurrence from a parameters node.
243
	 * @param parametersNodePath
244 244
	 */
245
	public Cooccurrence(String uuid)	{
246
		super(uuid);
245
	public Cooccurrence(String parametersNodePath)	{
246
		super(parametersNodePath);
247 247
	}
248 248

  
249 249

  
tmp/org.txm.index.rcp/src/org/txm/index/rcp/handlers/ComputeIndex.java (revision 1112)
57 57

  
58 58
		Index index = null;
59 59
		
60
		// From link: creating from UUID and preferences nodes
61
		String uuid = event.getParameter(TXMPreferences.RESULT_UUID);
62
		if (uuid != null && !uuid.isEmpty()) {
63
			index = new Index(uuid);
60
		// From link: creating from parameters node
61
		String parametersNodePath = event.getParameter(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
62
		if (parametersNodePath != null && !parametersNodePath.isEmpty()) {
63
			index = new Index(parametersNodePath);
64 64
		}
65 65
		// From view result node
66 66
		else	{
tmp/org.txm.index.core/src/org/txm/index/core/functions/___Lexicon2.java (revision 1112)
109 109
	}
110 110

  
111 111
	/**
112
	 * Creates a not computed lexicon from the specified uuid node name.
113
	 * @param uuid
112
	 * Creates a not computed lexicon from the specified parametersNodePath node name.
113
	 * @param parametersNodePath
114 114
	 */
115
	public ___Lexicon2(String uuid)	{
116
		super(uuid);
115
	public ___Lexicon2(String parametersNodePath)	{
116
		super(parametersNodePath);
117 117
	}
118 118
	
119
	/**
120
	 * 
121
	 * @param uuid
122
	 * @param parent
123
	 */
124
	public ___Lexicon2(String uuid, TXMResult parent)	{
125
		super(uuid, parent);
126
	}
127 119

  
128 120
	
129 121
	@Override
tmp/org.txm.index.core/src/org/txm/index/core/functions/Lexicon.java (revision 1112)
110 110
	}
111 111

  
112 112
	/**
113
	 * Creates a not computed lexicon from the specified uuid node name.
114
	 * @param uuid
113
	 * Creates a not computed lexicon from the specified parameters node.
114
	 * @param parametersNodePath
115 115
	 */
116
	public Lexicon(String uuid)	{
117
		this(uuid, null);
116
	public Lexicon(String parametersNodePath)	{
117
		this(parametersNodePath, null);
118 118
	}
119 119
	
120 120
	/**
121 121
	 * 
122
	 * @param uuid
122
	 * @param parametersNodePath
123 123
	 * @param parent
124 124
	 */
125
	public Lexicon(String uuid, TXMResult parent)	{
126
		super(uuid, parent);
125
	public Lexicon(String parametersNodePath, TXMResult parent)	{
126
		super(parametersNodePath, parent);
127 127
	}
128 128

  
129 129
	@Override
tmp/org.txm.index.core/src/org/txm/index/core/functions/Index.java (revision 1112)
158 158
	 * @param parent
159 159
	 */
160 160
	public Index(TXMResult parent) {
161
		this(null, parent);
161
		super(parent);
162 162
	}
163 163

  
164 164
	/**
165 165
	 * 
166
	 * @param uuid
166
	 * @param parametersNodePath
167 167
	 */
168
	public Index(String uuid)	{
169
		this(uuid, null);
168
	public Index(String parametersNodePath)	{
169
		super(parametersNodePath);
170 170
	}
171 171
	
172
	/**
173
	 * 
174
	 * @param uuid
175
	 * @param parent
176
	 */
177
	public Index(String uuid, TXMResult parent)	{
178
		super(uuid, parent);
179
	}
180 172

  
181

  
182 173
	@Override
183 174
	protected boolean _compute() throws Exception {
184 175
		lines.clear();
tmp/org.txm.referencer.core/src/org/txm/referencer/core/functions/Referencer.java (revision 1112)
154 154
	
155 155
	/**
156 156
	 * Creates a not computed referencer.
157
	 * @param uuid
157
	 * @param parametersNodePath
158 158
	 */
159
	public Referencer(String uuid) {
160
		super(uuid);
159
	public Referencer(String parametersNodePath) {
160
		super(parametersNodePath);
161 161
	}
162 162

  
163 163
	
tmp/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/RecodeCorpus.java (revision 1112)
114 114
//		String txmhome = Toolbox.getTxmHomePath();
115 115

  
116 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");
117
		project.getPreferencesScope().getNode("import").put(ImportKeys.MULTITHREAD, "false"); //too soon
118
		project.getPreferencesScope().getNode("import").putBoolean(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
119
		project.getPreferencesScope().getNode("import").put(ImportKeys.UPDATECORPUS, "true");
120 120

  
121 121
//		monitor.setTaskName("Updating corpus");
122 122
//		File scriptDir = new File(txmhome, "scripts/groovy/user/org/txm/scripts/importer/xtz");
tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyScriptedImportEngine.java (revision 1112)
76 76
			//System.out.println("script="+script);
77 77

  
78 78
			TokenizerClasses.reset();
79
			if (!TokenizerClasses.loadFromProject(project.getPreferences())) {
79
			if (!TokenizerClasses.loadFromProject(project.getPreferencesScope())) {
80 80
				Log.severe("Error: failed to load tokenizer parameters");
81 81
				monitor.done();
82 82
//				if (basedir.exists()) basedir.renameTo(errorBinDirectory);
tmp/org.txm.lexicaltable.core/src/org/txm/lexicaltable/core/functions/LexicalTable.java (revision 1112)
164 164

  
165 165

  
166 166

  
167
	public LexicalTable(String uuid)	{
168
		super(uuid);
167
	public LexicalTable(String parametersNodePath)	{
168
		super(parametersNodePath);
169 169
	}
170 170

  
171 171

  
tmp/org.txm.partition.core/src/org/txm/partition/core/functions/PartitionDimensions.java (revision 1112)
65 65

  
66 66
	/**
67 67
	 * Creates a not computed partition dimensions.
68
	 * @param UUID
68
	 * @param parametersNodePath
69 69
	 */
70
	public PartitionDimensions(String UUID) {
71
		super(UUID);
70
	public PartitionDimensions(String parametersNodePath) {
71
		super(parametersNodePath);
72 72
	}
73 73
	
74 74

  
tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java (revision 1112)
183 183

  
184 184
	/**
185 185
	 * 
186
	 * @param uuid
186
	 * @param parametersNodePath
187 187
	 */
188
	public Concordance(String uuid)	{
189
		super(uuid);
188
	public Concordance(String parametersNodePath)	{
189
		super(parametersNodePath);
190 190
	}
191 191
	
192 192

  
tmp/org.txm.ahc.core/src/org/txm/ahc/core/functions/AHC.java (revision 1112)
154 154
	 * @param numberOfClusters the n cluster
155 155
	 * @param display2D the display mode
156 156
	 */
157
	public AHC(String uuid)	{
158
		this(uuid, null);
157
	public AHC(String parametersNodePath)	{
158
		this(parametersNodePath, null);
159 159
	}
160 160
	
161 161
	/**
......
182 182
	 * @param numberOfClusters the n cluster
183 183
	 * @param display2D the display mode
184 184
	 */
185
	public AHC(String uuid, CA ca)	{
186
		super(uuid, ca);
185
	public AHC(String parametersNodePath, CA ca)	{
186
		super(parametersNodePath, ca);
187 187
	}
188 188

  
189 189
	@Override
tmp/org.txm.wordcloud.core/src/org/txm/wordcloud/core/functions/WordCloud.java (revision 1112)
63 63

  
64 64
	/**
65 65
	 * Creates a not computed words cloud
66
	 * @param uuid
66
	 * @param parametersNodePath
67 67
	 */
68
	public WordCloud(String uuid)	{
69
		super(uuid);
68
	public WordCloud(String parametersNodePath)	{
69
		super(parametersNodePath);
70 70
	}
71 71
	
72 72
		
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/Specificities.java (revision 1112)
146 146
	
147 147
	/**
148 148
	 * Creates a not computed Specificities.
149
	 * @param uuid
149
	 * @param parametersNodePath
150 150
	 */
151
	public Specificities(String uuid)	{
152
		this(uuid, null);
151
	public Specificities(String parametersNodePath)	{
152
		this(parametersNodePath, null);
153 153
	}
154 154
	
155 155
	/**
......
160 160
	 * @throws CqiClientException the cqi client exception
161 161
	 * @throws StatException the stat exception
162 162
	 */
163
	public Specificities(String uuid, LexicalTable parent) {
164
		super(uuid, parent);
163
	public Specificities(String parametersNodePath, LexicalTable parent) {
164
		super(parametersNodePath, parent);
165 165
	}
166 166
	
167 167
	
tmp/org.txm.specificities.core/src/org/txm/specificities/core/functions/SpecificitiesSelection.java (revision 1112)
58 58
	 */
59 59
	protected double[][] selectedSpecificitiesIndex;
60 60

  
61
	
62
	
61 63
	/**
62 64
	 * Creates an empty SpecificitiesSelection.
63 65
	 * @param parent
......
66 68
		super(parent);
67 69
	}
68 70

  
69
	public SpecificitiesSelection(String uuid)	{
70
		this(uuid, null);
71
	/**
72
	 * 
73
	 * @param parametersNodePath
74
	 */
75
	public SpecificitiesSelection(String parametersNodePath)	{
76
		this(parametersNodePath, null);
71 77
	}
72 78

  
73
	public SpecificitiesSelection(String uuid, Specificities parent)	{
74
		super(uuid, parent);
79
	/**
80
	 * 
81
	 * @param parametersNodePath
82
	 * @param parent
83
	 */
84
	public SpecificitiesSelection(String parametersNodePath, Specificities parent)	{
85
		super(parametersNodePath, parent);
75 86
	}
76 87

  
88
	// FIXME: SJ: why?!
89
	@Override
77 90
	public Specificities getParent() {
78 91
		return (Specificities)super.getParent();
79 92
	}
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/CA.java (revision 1112)
138 138
	 * @param lexicalTable the lexical table
139 139
	 * @throws StatException stat exception if the structure can not be created in R statistics engine.
140 140
	 */
141
	public CA(String uuid) {
142
		this(uuid, null);
141
	public CA(String parametersNodePath) {
142
		this(parametersNodePath, null);
143 143
	}
144 144
	
145 145
	/**
......
148 148
	 * @param lexicalTable the lexical table
149 149
	 * @throws StatException stat exception if the structure can not be created in R statistics engine.
150 150
	 */
151
	public CA(String uuid, LexicalTable lexicalTable) {
152
		super(uuid, lexicalTable);
151
	public CA(String parametersNodePath, LexicalTable lexicalTable) {
152
		super(parametersNodePath, lexicalTable);
153 153
	}
154 154

  
155 155
	@Override
tmp/org.txm.ca.core/src/org/txm/ca/core/functions/Eigenvalues.java (revision 1112)
28 28
	/**
29 29
	 * @param parent
30 30
	 */
31
	public Eigenvalues(String uuid) {
32
		this(uuid, null);
31
	public Eigenvalues(String parametersNodePath) {
32
		this(parametersNodePath, null);
33 33
	}
34 34

  
35 35
	/**
36 36
	 * @param parent
37 37
	 */
38
	public Eigenvalues(String uuid, TXMResult parent) {
39
		super(uuid, parent);
38
	public Eigenvalues(String parametersNodePath, TXMResult parent) {
39
		super(parametersNodePath, parent);
40 40
		this.setVisible(false);
41 41
	}
42 42

  
tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/UpdateCorpus.java (revision 1112)
47 47
			System.out.println("Can't update a corpus not imprted with XTZ import module.");
48 48
			return null;
49 49
		}
50
		project.getPreferences().getNode("import").put(ImportKeys.MULTITHREAD, "false"); //too soon
51
		project.getPreferences().getNode("import").putBoolean(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
52
		project.getPreferences().getNode("import").put(ImportKeys.UPDATECORPUS, "true");
50
		project.getPreferencesScope().getNode("import").put(ImportKeys.MULTITHREAD, "false"); //too soon
51
		project.getPreferencesScope().getNode("import").putBoolean(ImportKeys.DEBUG, Log.getLevel().intValue() < Level.WARNING.intValue()); // need debug for experimental stuff
52
		project.getPreferencesScope().getNode("import").put(ImportKeys.UPDATECORPUS, "true");
53 53
		
54 54
//		String txmhome = Toolbox.getTxmHomePath();
55 55
//		File scriptDir = new File(txmhome, "scripts/groovy/user/org/txm/scripts/importer/xtz");
tmp/org.txm.rcp/src/main/java/org/txm/rcp/views/debug/TXMResultDebugView.java (revision 1112)
104 104
		StringBuffer buffer = new StringBuffer();
105 105
		buffer.append("Class: " + this.currentResult.getClass() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
106 106
		buffer.append("UUID: " + this.currentResult.getUUID() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
107
		buffer.append("Node path: " + this.currentResult.getParametersNodePath() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
107 108
		buffer.append("Simple name: " + this.currentResult.getSimpleName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
108 109
		buffer.append("User name: " + this.currentResult.getUserName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
109 110
		buffer.append("Lazy name: " + this.currentResult.getLazyName() + "\n"); //$NON-NLS-1$ //$NON-NLS-2$
tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/BaseAbstractHandler.java (revision 1112)
200 200
		Command cmd = cmdService.getCommand(commandId);
201 201
		IHandlerService handlerService = (IHandlerService)window.getService(IHandlerService.class);
202 202
		
203
		// Redefine the command supported parameters, without that each command must define the parameter "result_uuid" in each plugin.xml...
203
		// Redefine the command supported parameters, without that each command must define the parameter "result_parameters_node_path" in each plugin.xml...
204 204
		if(resultUUID != null)	{
205 205
			Log.info("BaseAbstractHandler.executeCommand(): preparing the send of result UUID: " + resultUUID + ".");
206 206
			try {
......
218 218
					
219 219
					@Override
220 220
					public String getName() {
221
						return TXMPreferences.RESULT_UUID;
221
						return TXMPreferences.RESULT_PARAMETERS_NODE_PATH;
222 222
					}
223 223
					
224 224
					@Override
225 225
					public String getId() {
226
						return TXMPreferences.RESULT_UUID;
226
						return TXMPreferences.RESULT_PARAMETERS_NODE_PATH;
227 227
					}
228 228
				}};
229 229
				cmd.define(cmd.getName(), cmd.getDescription(), cmd.getCategory(), parameters);
......
232 232
				e.printStackTrace();
233 233
			}
234 234
			// pass the parameter value
235
			params = Collections.singletonMap(TXMPreferences.RESULT_UUID, resultUUID);
235
			params = Collections.singletonMap(TXMPreferences.RESULT_PARAMETERS_NODE_PATH, resultUUID);
236 236
		}
237 237
		
238 238
		// Call the command with parameters
......
272 272
	/**
273 273
	 * Executes a command handler specified by its id and activates/deactivates the "send selection context".
274 274
	 * @param commandId
275
	 * @param resultUUID
275
	 * @param resultParametersNodePath
276 276
	 */
277
	public static void executeSendToCommand(String commandId, String resultUUID) {
277
	public static void executeSendToCommand(String commandId, String resultParametersNodePath) {
278 278
		IContextService contextService = (IContextService) PlatformUI.getWorkbench().getAdapter(IContextService.class);
279 279
		IContextActivation activationToken = contextService.activateContext(SEND_SELECTION_TO_COMMAND_CONTEXT_ID);
280
		executeCommand(commandId, resultUUID);
280
		executeCommand(commandId, resultParametersNodePath);
281 281
		contextService.deactivateContext(activationToken);
282 282
	}
283 283
}
tmp/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java (revision 1112)
75 75
	
76 76
	/**
77 77
	 * 
78
	 * @param UUID
78
	 * @param parametersNodePath
79 79
	 */
80
	public InternalView(String UUID) {
81
		super(UUID);
80
	public InternalView(String parametersNodePath) {
81
		super(parametersNodePath);
82 82
	}
83 83

  
84 84
	
tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToMatchable.java (revision 1112)
70 70
				return null;
71 71
			}
72 72
			
73
			// create local result node, store in some parameters and call the linked command
74
			String uuid = TXMResult.createUUID();
75
			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, this.getResultParent(event).getUUID());
76
			TXMPreferences.put(uuid, TXMPreferences.MATCHES, matches.toString());
73
			// create a local result node in the project node, store in some parameters and call the linked command
74
			String resultParametersNodePath = this.getResultParent(event).getProject().getParametersNodeRootPath() + TXMResult.createUUID();
75
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.PARENT_UUID, this.getResultParent(event).getUUID());
76
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.MATCHES, matches.toString());
77 77
			
78
			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), uuid);
78
			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), resultParametersNodePath);
79 79
		}
80 80
		else	{
81 81
			this.logCanNotExecuteCommand(selection);
tmp/org.txm.links.rcp/src/org/txm/links/rcp/handlers/SendSelectionToQueryable.java (revision 1112)
80 80
				return null;
81 81
			}
82 82
			
83
			// create local result node, store in some parameters and call the linked command
84
			String uuid = TXMResult.createUUID();
85
			TXMPreferences.put(uuid, TXMPreferences.PARENT_UUID, this.getResultParent(event).getUUID());
86
			TXMPreferences.put(uuid, TXMPreferences.QUERY, query);
87
			TXMPreferences.put(uuid, TXMPreferences.QUERIES, queries);
83
			// create a local result node in the project node, store in some parameters and call the linked command
84
			String resultParametersNodePath = this.getResultParent(event).getProject().getParametersNodeRootPath() + TXMResult.createUUID();
85
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.PARENT_UUID, this.getResultParent(event).getUUID());
86
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.QUERY, query);
87
			TXMPreferences.put(resultParametersNodePath, TXMPreferences.QUERIES, queries);
88 88
			
89
			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), uuid);
89
			BaseAbstractHandler.executeSendToCommand(event.getCommand().getId(), resultParametersNodePath);
90 90
			
91 91
		}
92 92
		else	{
tmp/org.txm.links.rcp/src/org/txm/links/rcp/messages/Messages.java (revision 1112)
5 5

  
6 6
public class Messages extends NLS {
7 7
	
8
	private static final String BUNDLE_NAME = "org.txm.links.rcp.handlers.messages"; //$NON-NLS-1$
8
	private static final String BUNDLE_NAME = "org.txm.links.rcp.messages.messages"; //$NON-NLS-1$
9 9
	
10 10
	public static String link_error_no_match;
11 11
	public static String link_error_no_query;
tmp/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java (revision 1112)
75 75

  
76 76
	/**
77 77
	 * Creates a not computed texts balance.
78
	 * @param UUID
78
	 * @param parametersNodePath
79 79
	 */
80
	public TextsBalance(String UUID) {
81
		super(UUID);
80
	public TextsBalance(String parametersNodePath) {
81
		super(parametersNodePath);
82 82
	}
83 83

  
84 84
	
tmp/org.txm.chartsengine.core/src/org/txm/chartsengine/core/results/ChartResult.java (revision 1112)
111 111
	/**
112 112
	 * Creates a new ChartResult with no parent.
113 113
	 * If a local node exist with the parent_uuid, the parent will be retrieved and this result will be added to it. 
114
	 * @param uuid
114
	 * @param parametersNodePath
115 115
	 */
116
	public ChartResult(String uuid) {
117
		this(uuid, null);
116
	public ChartResult(String parametersNodePath) {
117
		this(parametersNodePath, null);
118 118
	}
119 119
	
120 120
	/**
......
122 122
	 * @param uuid
123 123
	 * @param parent
124 124
	 */
125
	public ChartResult(String uuid, TXMResult parent) {
126
		super(uuid, parent);
125
	public ChartResult(String parametersNodePath, TXMResult parent) {
126
		super(parametersNodePath, parent);
127 127
		this.chartsEngine = ChartsEngine.getCurrent();
128 128
		this.chartDirty = true;
129 129
		this.needsToResetView = false;
......
520 520
	 * @return
521 521
	 */
522 522
	public boolean isEmptyPreference(String key)	{
523
		return TXMPreferences.isEmpty(this.preferencesNodeQualifier, key);
523
		return TXMPreferences.isEmpty(this.commandPreferencesNodePath, key);
524 524
	}
525 525

  
526 526
	
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java (revision 1112)
76 76
		super(partition);
77 77
	}
78 78

  
79
	public CQPCorpus(String uuid) {
80
		super(uuid);
79
	/**
80
	 * 
81
	 * @param parametersNodePath
82
	 */
83
	public CQPCorpus(String parametersNodePath) {
84
		super(parametersNodePath);
81 85
	}
82 86

  
87
	
83 88
	public static String getNextQueryCounter() {
84 89
		QUERY_COUNTER++;
85 90
		return QUERY_COUNTER.toString();
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 1112)
71 71
	 * @throws CqiClientException
72 72
	 *             the cqi client exception
73 73
	 */
74
	public MainCorpus(Project project) throws InvalidCqpIdException,
75
	CqiClientException {
74
	public MainCorpus(Project project) throws InvalidCqpIdException, CqiClientException {
76 75
		super(project);
77 76
	}
78 77
	
......
99 98
	 * @throws CqiClientException
100 99
	 *             the cqi client exception
101 100
	 */
102
	public MainCorpus(String uuid) throws InvalidCqpIdException,
103
	CqiClientException {
104
		super(uuid);
101
	public MainCorpus(String parametersNodePath) throws InvalidCqpIdException, CqiClientException {
102
		super(parametersNodePath);
105 103
	}
106 104

  
105
	
107 106
	/**
108 107
	 * Check whether the ID is a valid CQP ID.
109 108
	 * 
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java (revision 1112)
65 65
	private SelectionResult selectionResult;
66 66
	protected QueryResult qresult;
67 67

  
68
	
69
	/**
70
	 * 
71
	 * @param corpus
72
	 */
68 73
	public Subcorpus(CQPCorpus corpus) {
69 74
		super(corpus);
70 75
	}
71 76

  
77
	/**
78
	 * 
79
	 * @param partition
80
	 */
72 81
	public Subcorpus(Partition partition) {
73 82
		super(partition);
74 83
	}
75 84

  
76
	public Subcorpus(String uuid) {
77
		super(uuid);
85
	/**
86
	 * 
87
	 * @param parametersNodePath
88
	 */
89
	public Subcorpus(String parametersNodePath) {
90
		super(parametersNodePath);
78 91
	}
79 92

  
80 93
	/**
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Part.java (revision 1112)
49 49
		this.userPersistable = false;
50 50
	}
51 51
	
52
	public Part(String uuid) {
53
		super(uuid); // build the subcorpus part
52
	public Part(String parametersNodePath) {
53
		super(parametersNodePath); // build the subcorpus part
54 54
		
55 55
		this.setVisible(false);
56 56
		this.persistable = true;
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Partition.java (revision 1112)
129 129

  
130 130
	/**
131 131
	 * 
132
	 * @param uuid
132
	 * @param parametersNodePath
133 133
	 */
134
	public Partition(String uuid)	{
135
		super(uuid);
134
	public Partition(String parametersNodePath)	{
135
		super(parametersNodePath);
136 136
	}
137 137
	
138 138
	/**
tmp/org.txm.core/src/java/org/txm/Toolbox.java (revision 1112)
45 45
import java.util.logging.Level;
46 46

  
47 47
import org.apache.commons.lang.StringUtils;
48
import org.eclipse.core.resources.IProject;
49
import org.eclipse.core.resources.IWorkspace;
50
import org.eclipse.core.resources.ProjectScope;
51
import org.eclipse.core.resources.ResourcesPlugin;
48 52
import org.eclipse.core.runtime.CoreException;
49 53
import org.eclipse.core.runtime.IConfigurationElement;
50 54
import org.eclipse.core.runtime.IProgressMonitor;
......
52 56
import org.eclipse.core.runtime.Platform;
53 57
import org.eclipse.core.runtime.RegistryFactory;
54 58
import org.eclipse.core.runtime.SafeRunner;
55
import org.eclipse.core.runtime.preferences.IPreferencesService;
59
import org.eclipse.core.runtime.preferences.IScopeContext;
56 60
import org.eclipse.osgi.util.NLS;
57 61
import org.osgi.framework.Bundle;
58 62
import org.osgi.framework.Version;
......
64 68
import org.txm.core.preferences.TBXPreferences;
65 69
import org.txm.core.preferences.TXMPreferences;
66 70
import org.txm.core.results.TXMResult;
71
import org.txm.objects.Project;
67 72
import org.txm.objects.Workspace;
68 73
import org.txm.utils.BundleUtils;
69 74
import org.txm.utils.DeleteDir;
......
275 280

  
276 281
		// FIXME: tmp persistence tests: Reload saved results
277 282
		//		if (TBXPreferences.getInstance().getBoolean(TBXPreferences.AUTO_PERSISTENCE_ENABLED)) {
278
		Log.info("Toolbox.initialize(): reloading persitent results...");
279
		ArrayList<String> resultsNodesQualifiers = TXMPreferences.getAllResultsNodesQualifiers();
280
		for (String nodeQualifier : resultsNodesQualifiers) {
283
		Log.severe("*** Toolbox.initialize(): reloading projects...");
284
		
285
		IWorkspace rcpWorkspace = ResourcesPlugin.getWorkspace();
286
		IProject projects[] = rcpWorkspace.getRoot().getProjects();
287
		
288
		Log.info("Toolbox.initialize(): " + projects.length + " project(s) found in workspace.");
289
		
290
		for (int i = 0; i < projects.length; i++) {
291
			
292
			//IScopeContext projectScope = new ProjectScope(projects[i]);
281 293

  
282
			// skip non-TXMResult preference node
283
			if (TXMPreferences.getString(TXMPreferences.BUNDLE_ID, nodeQualifier).isEmpty())	{
284
				continue;
285
			}
294
			//System.out.println("*************** Toolbox.initialize(): scope = " + projectScope.getName());
295
			
296
			ArrayList<String> resultNodePaths = TXMPreferences.getAllResultsNodePaths("project/" + projects[i].getName() + "/");
297
			
298
			Log.info("Toolbox.initialize(): loading project " + projects[i].getName() + "...");
299
			Log.info("Toolbox.initialize(): " + resultNodePaths.size() + " node(s) found in project " + projects[i].getName() + "...");
300
			
301
			
302
			for (String parametersNodePath : resultNodePaths) {
286 303

  
287
			try {
288
				Log.finest("Toolbox.initialize(): loading from result node qualifier " + nodeQualifier);
289
				Log.finest("Toolbox.initialize(): class = " + TXMPreferences.getString("class", nodeQualifier));
290
				Log.finest("Toolbox.initialize(): parent_uuid = " + TXMPreferences.getString(TXMPreferences.PARENT_UUID, nodeQualifier));
291
				Log.finest("Toolbox.initialize(): bundle_id = " + TXMPreferences.getString(TXMPreferences.BUNDLE_ID, nodeQualifier));
292
				Bundle bundle = Platform.getBundle(TXMPreferences.getString(TXMPreferences.BUNDLE_ID, nodeQualifier));
293
				if (bundle == null) {
294
					Log.finest("Warning: can not restore object with bundle name " + TXMPreferences.getString(TXMPreferences.BUNDLE_ID, nodeQualifier));
295
					continue;
304
				// skip non-TXMResult preference node
305
//				if (TXMPreferences.getString(TXMPreferences.BUNDLE_ID, nodeQualifier).isEmpty())	{
306
//					continue;
307
//				}
308

  
309
				try {
310

  
311
					Log.finest("Toolbox.initialize(): checking result type linked to node path " + parametersNodePath);
312

  
313
					
314
					String className = TXMPreferences.preferencesRootNode.node(parametersNodePath).get("class", ""); //$NON-NLS-1$
315
					
316
					if(!className.equals(Project.class.getName()))	{
317
						Log.finest("Toolbox.initialize(): not a project, result skipped (classame = " + className + ").");
318
						continue;
319
					}
320

  
321
					
322
					Log.finest("Toolbox.initialize(): loading from result node path " + parametersNodePath);
323
					//Log.finest("Toolbox.initialize(): class = " + TXMPreferences.getString("class", nodeQualifier));
324
					//TXMPreferences.dump();
325
					
326

  
327
					
328
					Log.finest("Toolbox.initialize(): class = " + className); //$NON-NLS-1$
329
//					Log.finest("Toolbox.initialize(): parent_uuid = " + TXMPreferences.getString(TXMPreferences.PARENT_UUID, nodeQualifier));
330
					Log.finest("Toolbox.initialize(): parent_uuid = " + TXMPreferences.preferencesRootNode.node(parametersNodePath).get(TXMPreferences.PARENT_UUID, "")); //$NON-NLS-1$
331
					String bundleId = TXMPreferences.preferencesRootNode.node(parametersNodePath).get(TXMPreferences.BUNDLE_ID, ""); //$NON-NLS-1$
332
					Log.finest("Toolbox.initialize(): bundle_id = " + bundleId); //$NON-NLS-1$
333
					Bundle bundle = Platform.getBundle(bundleId);
334
					if (bundle == null) {
335
						Log.finest("Warning: can not restore object with bundle name " + bundleId); //$NON-NLS-1$
336
						continue;
337
					}
338

  
339
					
340
					Log.info("Toolbox.initialize(): creating project " + projects[i].getName() + ".");
341
					Class<?> cl = bundle.loadClass(className);
342
					Constructor<?> cons = cl.getConstructor(String.class);
343
					TXMResult result = (TXMResult) cons.newInstance(parametersNodePath);
344
					
345
					// not an internal persistence (eg. corpus or partition)
346
					if (!result.isPersistable())	{
347
						result.setUserPersistable(true);	
348
					}
349
				} catch (Exception e) {
350
					// TODO Auto-generated catch block
351
					e.printStackTrace();
296 352
				}
297
				String className = TXMPreferences.getString("class", nodeQualifier); //$NON-NLS-1$
298
				Class<?> cl = bundle.loadClass(className);
299
				Constructor<?> cons = cl.getConstructor(String.class);
300
				TXMResult result = (TXMResult) cons.newInstance(nodeQualifier);
301
				// not an internal persistence (eg. corpus or partition)
302
				if (!result.isPersistable())	{
303
					result.setUserPersistable(true);	
304
				}
305
			} catch (Exception e) {
306
				// TODO Auto-generated catch block
307
				e.printStackTrace();
308 353
			}
354
			//		}
355

  
309 356
		}
310
		//		}
357
		
358
		
359
		
311 360

  
312 361

  
313 362

  
......
781 830
		} catch (Exception e) {
782 831
			Log.severe(NLS.bind(TXMCoreMessages.ApplicationWorkbenchAdvisor_40, e.getLocalizedMessage()));
783 832
			System.err.println(NLS.bind(TXMCoreMessages.ApplicationWorkbenchAdvisor_40, e.getLocalizedMessage()));
833
			e.printStackTrace();
784 834
			return null;
785 835
		}
786 836
	}
tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 1112)
10 10
import java.util.Arrays;
11 11
import java.util.Collections;
12 12
import java.util.HashMap;
13
import java.util.Iterator;
14 13
import java.util.Map;
15
import java.util.Set;
16 14

  
17 15
import org.eclipse.core.runtime.Platform;
18 16
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
19 17
import org.eclipse.core.runtime.preferences.DefaultScope;
20 18
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
21
import org.eclipse.core.runtime.preferences.IPreferencesService;
22 19
import org.eclipse.core.runtime.preferences.IScopeContext;
23 20
import org.eclipse.core.runtime.preferences.InstanceScope;
24 21
import org.osgi.framework.FrameworkUtil;
25 22
import org.osgi.service.prefs.BackingStoreException;
23
import org.osgi.service.prefs.Preferences;
26 24
import org.txm.core.results.TXMParameters;
27 25
import org.txm.core.results.TXMResult;
28 26
import org.txm.utils.logger.Log;
......
55 53
public abstract class TXMPreferences extends AbstractPreferenceInitializer {
56 54

  
57 55

  
56
	/**
57
	 * Scope used for storing the command preferences.
58
	 */
59
	//public static IScopeContext scope = InstanceScope.INSTANCE;
58 60

  
59
	// FIXME: here we must use a ProjectScope when we'll use IProject for TXM corpora 
60
	public static IScopeContext scope = InstanceScope.INSTANCE;
61

  
61
	
62
	public static IEclipsePreferences preferencesRootNode = Platform.getPreferencesService().getRootNode();
63
	
62 64
	/**
63 65
	 * Alternative nodes to look up when getting a preference.
64 66
	 */
......
86 88

  
87 89

  
88 90
	// essentially for Links and Persistence
91
	public final static String RESULT_PARAMETERS_NODE_PATH = "result_parameters_node_path"; //$NON-NLS-1$
89 92
	public final static String RESULT_UUID = "result_uuid"; //$NON-NLS-1$
90 93
	public final static String PARENT_UUID = "parent_uuid"; //$NON-NLS-1$
91 94
	public final static String BUNDLE_ID = "bundle_id"; //$NON-NLS-1$
......
166 169
	/**
167 170
	 * Preferences node qualifier of the instance. 
168 171
	 */
169
	protected String preferencesNode;
172
	protected String commandPreferencesNodeQualifier;
170 173
	
171 174
	/**
172 175
	 * Instances map.
......
181 184
	public TXMPreferences() {
182 185
		super();
183 186
		TXMPreferences.instances.put(this.getClass(), this);
184
		this.preferencesNode = FrameworkUtil.getBundle(this.getClass()).getSymbolicName();
185
		Log.info("TXMPreferences.TXMPreferences(): preferences node = " + this.preferencesNode);
187
		this.commandPreferencesNodeQualifier = FrameworkUtil.getBundle(this.getClass()).getSymbolicName();
188
		Log.finest("TXMPreferences.TXMPreferences(): initializing preferences for node = " + this.commandPreferencesNodeQualifier + " (" + this.getClass() +")");
186 189
	}
187 190

  
188 191

  
......
192 195
	 * @return
193 196
	 */
194 197
	public double getDouble(String key)	{
195
		return getDouble(key, this.preferencesNode);
198
		return getDouble(key, this.commandPreferencesNodeQualifier);
196 199
	}
197 200

  
198 201
	/**
......
201 204
	 * @return
202 205
	 */
203 206
	public boolean getBoolean(String key)	{
204
		return getBoolean(key, this.preferencesNode);
207
		return getBoolean(key, this.commandPreferencesNodeQualifier);
205 208
	}
206 209

  
207 210
	/**
......
210 213
	 * @return
211 214
	 */
212 215
	public int getInt(String key)	{
213
		return getInt(key, this.preferencesNode);
216
		return getInt(key, this.commandPreferencesNodeQualifier);
214 217
	}
215 218

  
216 219
	/**
......
219 222
	 * @return
220 223
	 */
221 224
	public long getLong(String key)	{
222
		return getLong(key, this.preferencesNode);
225
		return getLong(key, this.commandPreferencesNodeQualifier);
223 226
	}
224 227
	
225 228
	/**
......
228 231
	 * @return
229 232
	 */
230 233
	public String getString(String key)	{
231
		return getString(key, this.preferencesNode);
234
		return getString(key, this.commandPreferencesNodeQualifier);
232 235
	}
233 236
	
234 237

  
......
238 241
	 * @return
239 242
	 */
240 243
	public float getFloat(String key)	{
241
		return getFloat(key, this.preferencesNode);
244
		return getFloat(key, this.commandPreferencesNodeQualifier);
242 245
	}
243 246

  
244 247

  
......
247 250
	 * @return the preferencesNode
248 251
	 */
249 252
	public String getPreferencesNodeQualifier() {
250
		return preferencesNode;
253
		return commandPreferencesNodeQualifier;
251 254
	}
252 255

  
253 256
	
254 257
	
255 258
	
256
	/**
257
	 * Stores a pairs of key / value in a local node dedicated to the specified result. The node qualifier is generated by the <code>Object.toString()</code> method.
258
	 * 
259
	 * @param key
260
	 * @param pValue
261
	 */
262
	public static void remove(String key, String node)	{
263
		scope.getNode(node).remove(key);
264
	}
259
//	/**
260
//	 * Stores a pairs of key / value in a local node dedicated to the specified result. The node qualifier is generated by the <code>Object.toString()</code> method.
261
//	 * 
262
//	 * @param key
263
//	 * @param pValue
264
//	 */
265
//	public static void remove(String key, String node)	{
266
//		scope.getNode(node).remove(key);
267
//	}
265 268

  
266 269
	/**
267 270
	 * Saves all preferences and session results in the default app directory.
......
270 273
		
271 274
		Log.info("Saving preferences and session results.");
272 275
		
273
		IPreferencesService service = Platform.getPreferencesService();
274 276
		try {
275
			service.getRootNode().flush();
277
			preferencesRootNode.flush();
276 278
		} catch(Exception e) {
277 279
			Log.severe("Error while saving preferences and session results.");
278 280
			e.printStackTrace();
......
287 289
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
288 290
	 * Returns <code>false</code> if no value has been found for the specified key.
289 291
	 * @param commandParameters
290
	 * @param nodeQualifier
292
	 * @param nodePath
291 293
	 * @param result
292 294
	 * @param key
293 295
	 * @return
294 296
	 */
295
	public static Serializable getSerializable(String key, TXMParameters commandParameters, TXMResult result, String nodeQualifier)	{
297
	public static Serializable getSerializable(String key, TXMParameters commandParameters, TXMResult result, String nodePath)	{
296 298
		if(commandParameters != null && commandParameters.get(key) != null)	{
297 299
			return (Serializable) commandParameters.get(key);
298 300
		}
299
		return getSerializable(key, result, nodeQualifier);
301
		return getSerializable(key, result, nodePath);
300 302
	}
301 303

  
302 304

  
303 305
	public static Serializable getSerializable(String key, TXMParameters commandParameters, TXMResult result)	{
304
		return getSerializable(key, commandParameters, result, result.getPreferencesNodeQualifier());
306
		return getSerializable(key, commandParameters, result, result.getCommandPreferencesNodePath());
305 307
	}
306 308

  
307 309
	/**
......
310 312
	 * Otherwise try to get it from the specified node qualifier if exists.
311 313
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
312 314
	 * Returns defaultValue if no value has been found for the specified key.
313
	 * @param nodeQualifier
315
	 * @param nodePath
314 316
	 * @param result
315 317
	 * @param key
316 318
	 * @return
317 319
	 */
318
	public static Serializable getSerializable(String key, TXMResult result, String nodeQualifier, Serializable defaultValue)	{
320
	public static Serializable getSerializable(String key, TXMResult result, String nodePath, Serializable defaultValue)	{
319 321

  
320
		nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
322
		nodePath = findNodePath(nodePath, result, key);
321 323

  
322
		String data_default = DefaultScope.INSTANCE.getNode(nodeQualifier).get(key, "");
324
		String data_default = DefaultScope.INSTANCE.getNode(nodePath).get(key, "");
323 325
		if (data_default.length() == 0) {
324 326
			return null;
325 327
		}
......
330 332
			Log.printStackTrace(e);
331 333
		}
332 334

  
333
		String data_return = scope.getNode(nodeQualifier).get(key, "");
335
		String data_return = preferencesRootNode.node(nodePath).get(key, "");
334 336
		if (data_return.length() == 0) {
335 337
			return defaultValue;
336 338
		}
......
349 351
	 * Otherwise try to get it from the specified node qualifier if exists.
350 352
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
351 353
	 * Returns <code>false</code> if no value has been found for the specified key.
352
	 * @param nodeQualifier
354
	 * @param nodePath
353 355
	 * @param result
354 356
	 * @param key
355 357
	 * @return
356 358
	 */
357
	public static Serializable getSerializable(String key, TXMResult result, String nodeQualifier)	{
358
		return getSerializable(key, result, nodeQualifier, false);
359
	public static Serializable getSerializable(String key, TXMResult result, String nodePath)	{
360
		return getSerializable(key, result, nodePath, false);
359 361
	}
360 362

  
361 363
	/**
362 364
	 *
363
	 * @param nodeQualifier
365
	 * @param nodePath
364 366
	 * @param key
365 367
	 * @return
366 368
	 */
367
	public static Serializable getSerializable(String key, String nodeQualifier)	{
368
		return getSerializable(key, null, nodeQualifier);
369
	public static Serializable getSerializable(String key, String nodePath)	{
370
		return getSerializable(key, null, nodePath);
369 371
	}
370 372

  
371 373
	/**
......
386 388
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
387 389
	 * Returns <code>false</code> if no value has been found for the specified key.
388 390
	 * @param commandParameters
389
	 * @param nodeQualifier
391
	 * @param nodePath
390 392
	 * @param result
391 393
	 * @param key
392 394
	 * @return
393 395
	 */
394
	public static boolean getBoolean(String key, TXMParameters commandParameters, TXMResult result, String nodeQualifier)	{
396
	public static boolean getBoolean(String key, TXMParameters commandParameters, TXMResult result, String nodePath)	{
395 397
		if(commandParameters != null && commandParameters.get(key) != null)	{
396 398
			return (Boolean) commandParameters.get(key);
397 399
		}
398
		return getBoolean(key, result, nodeQualifier);
400
		return getBoolean(key, result, nodePath);
399 401
	}
400 402

  
401 403

  
402 404
	public static boolean getBoolean(String key, TXMParameters commandParameters, TXMResult result)	{
403
		return getBoolean(key, commandParameters, result, result.getPreferencesNodeQualifier());
405
		return getBoolean(key, commandParameters, result, result.getCommandPreferencesNodePath());
404 406
	}
405 407

  
406 408
	/**
......
409 411
	 * Otherwise try to get it from the specified node qualifier if exists.
410 412
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
411 413
	 * Returns defaultValue if no value has been found for the specified key.
412
	 * @param nodeQualifier
414
	 * @param nodePath
413 415
	 * @param result
414 416
	 * @param key
415 417
	 * @return
416 418
	 */
417
	public static boolean getBoolean(String key, TXMResult result, String nodeQualifier, boolean defaultValue)	{
419
	public static boolean getBoolean(String key, TXMResult result, String nodePath, boolean defaultValue)	{
418 420

  
419
		nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
421
		nodePath = findNodePath(nodePath, result, key);
420 422

  
421
		defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getBoolean(key, defaultValue);
422
		return scope.getNode(nodeQualifier).getBoolean(key, defaultValue);
423
		defaultValue = DefaultScope.INSTANCE.getNode(nodePath).getBoolean(key, defaultValue);
424
		return preferencesRootNode.node(nodePath).getBoolean(key, defaultValue);
423 425
	}
424 426

  
425 427
	/**
......
428 430
	 * Otherwise try to get it from the specified node qualifier if exists.
429 431
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
430 432
	 * Returns <code>false</code> if no value has been found for the specified key.
431
	 * @param nodeQualifier
433
	 * @param nodePath
432 434
	 * @param result
433 435
	 * @param key
434 436
	 * @return
435 437
	 */
436
	public static boolean getBoolean(String key, TXMResult result, String nodeQualifier)	{
437
		return getBoolean(key, result, nodeQualifier, false);
438
	public static boolean getBoolean(String key, TXMResult result, String nodePath)	{
439
		return getBoolean(key, result, nodePath, false);
438 440
	}
439 441

  
440 442
	/**
441 443
	 *
442
	 * @param nodeQualifier
444
	 * @param nodePath
443 445
	 * @param key
444 446
	 * @return
445 447
	 */
446
	public static boolean getBoolean(String key, String nodeQualifier)	{
447
		return getBoolean(key, null, nodeQualifier);
448
	public static boolean getBoolean(String key, String nodePath)	{
449
		return getBoolean(key, null, nodePath);
448 450
	}
449 451

  
450 452
	/**
......
463 465
	 * Try to cast and create a typed object from the String value of the key.
464 466
	 * @param commandParameters
465 467
	 * @param result
466
	 * @param nodeQualifier
468
	 * @param nodePath
467 469
	 * @param key
468 470
	 * @return
469 471
	 */
470 472
	//FIXME: does not work, need to test furthermore
471
	//	public static Object get(TXMResultParameters commandParameters, TXMResult result, String nodeQualifier, String key)	{
473
	//	public static Object get(TXMResultParameters commandParameters, TXMResult result, String nodePath, String key)	{
472 474
	//
473 475
	//
474 476
	//		if(commandParameters != null && commandParameters.get(key) != null)	{
475 477
	//			return commandParameters.get(key);
476 478
	//		}
477 479
	//
478
	//		nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
480
	//		nodePath = findNodeQualifier(nodePath, result, key);
479 481
	//
480
	//		String stringValue = getString(nodeQualifier, key);
482
	//		String stringValue = getString(nodePath, key);
481 483
	//
482 484
	//		try {
483 485
	//			// double
......
527 529

  
528 530

  
529 531

  
530
	/**
531
	 * Looks for the value of the specified <code>key</code> in the specified parameters and preference nodes.
532
	 * Returns the value of a key in the specified parameters if exists.
533
	 * Otherwise try to get it from the local result node if exists.
534
	 * Otherwise try to get it from the specified node qualifier if exists.
535
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
536
	 * Returns an empty <code>String</code> if no value has been found for the specified key.
537
	 * @param commandParameters
538
	 * @param nodeQualifier
539
	 * @param result
540
	 * @param key
541
	 * @return
542
	 */
543
	public static String getString(String key, TXMParameters commandParameters, TXMResult result, String nodeQualifier)	{
544
		if(commandParameters != null && commandParameters.get(key) != null)	{
545
			return (String) commandParameters.get(key);
546
		}
547
		return getString(key, result, nodeQualifier);
548
	}
532
//	/**
533
//	 * Looks for the value of the specified <code>key</code> in the specified parameters and preference nodes.
534
//	 * Returns the value of a key in the specified parameters if exists.
535
//	 * Otherwise try to get it from the local result node if exists.
536
//	 * Otherwise try to get it from the specified node qualifier if exists.
537
//	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
538
//	 * Returns an empty <code>String</code> if no value has been found for the specified key.
539
//	 * @param commandParameters
540
//	 * @param nodePath
541
//	 * @param result
542
//	 * @param key
543
//	 * @return
544
//	 */
545
//	public static String getString(String key, TXMParameters commandParameters, TXMResult result, String nodePath)	{
546
//		if(commandParameters != null && commandParameters.get(key) != null)	{
547
//			return (String) commandParameters.get(key);
548
//		}
549
//		return getString(key, result, nodePath);
550
//	}
551
//
552
//	public static String getString(String key, TXMParameters commandParameters, TXMResult result)	{
553
//		return getString(key, commandParameters, result, result.getCommandPreferencesNodePath());
554
//	}
549 555

  
550
	public static String getString(String key, TXMParameters commandParameters, TXMResult result)	{
551
		return getString(key, commandParameters, result, result.getPreferencesNodeQualifier());
552
	}
553 556

  
554

  
555 557
	/**
556 558
	 * Looks for the value of the specified <code>key</code> in preference nodes.
557 559
	 * Returns the value of the local result node if exists.
558 560
	 * Otherwise try to get it from the specified node qualifier if exists.
559 561
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
560 562
	 * Returns defaultValue if no value has been found for the specified key.
561
	 * @param nodeQualifier
563
	 * @param nodePath
562 564
	 * @param result
563 565
	 * @param key
564 566
	 * @return
565 567
	 */
566
	public static String getString(String key, TXMResult result, String nodeQualifier, String defaultValue) {
567
		nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
568
	public static String getString(String key, TXMResult result, String nodePath, String defaultValue) {
568 569

  
569
		defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).get(key, defaultValue);
570
		return scope.getNode(nodeQualifier).get(key, defaultValue);
570
//		if(result instanceof Project)	{
571
//			//TXMPreferences.dump();
572
//			return preferencesService.getRootNode().node(result.getParametersNodePath()).get(key, defaultValue);
573
//		}
574

  
575
		
576
//		if(result != null && result.getProject() != null && result.getProject().getPreferencesScope().getNode(result.getUUID()) != null)	{
577
//			return result.getProject().getPreferencesScope().getNode(result.getUUID()).get(key, defaultValue);
578
//		}
579

  
580
		nodePath = findNodePath(nodePath, result, key);
581

  
582
		//System.out.println("--- TXMPreferences.getString() node path = " + nodePath);
583
		
584
		
585
		defaultValue = DefaultScope.INSTANCE.getNode(nodePath).get(key, defaultValue);
586
		return preferencesRootNode.node(nodePath).get(key, defaultValue);
571 587
	}
572 588

  
573 589

  
......
577 593
	 * Otherwise try to get it from the specified node qualifier if exists.
578 594
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
579 595
	 * Returns an empty <code>String</code> if no value has been found for the specified key.
580
	 * @param nodeQualifier
596
	 * @param nodePath
581 597
	 * @param result
582 598
	 * @param key
583 599
	 * @return
584 600
	 */
585
	public static String getString(String key, TXMResult result, String nodeQualifier)	{
586
		return getString(key, result, nodeQualifier, "");
601
	public static String getString(String key, TXMResult result, String nodePath)	{
602
		return getString(key, result, nodePath, ""); //$NON-NLS-1$
587 603
	}
588 604

  
589 605

  
590 606
	/**
591 607
	 *
592
	 * @param nodeQualifier
608
	 * @param nodePath
593 609
	 * @param key
594 610
	 * @return
595 611
	 */
596
	public static String getString(String key, String nodeQualifier)	{
597
		return getString(key, null, nodeQualifier);
612
	public static String getString(String key, String nodePath)	{
613
		return getString(key, null, nodePath);
598 614
	}
599 615

  
600 616

  
......
619 635
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
620 636
	 * Returns 0 if no value has been found for the specified key.
621 637
	 * @param commandParameters
622
	 * @param nodeQualifier
638
	 * @param nodePath
623 639
	 * @param result
624 640
	 * @param key
625 641
	 * @return
626 642
	 */
627
	public static int getInt(String key, TXMParameters commandParameters, TXMResult result, String nodeQualifier)	{
643
	public static int getInt(String key, TXMParameters commandParameters, TXMResult result, String nodePath)	{
628 644
		if(commandParameters != null && commandParameters.get(key) != null)	{
629 645
			return (Integer) commandParameters.get(key);
630 646
		}
631
		return getInt(key, result, nodeQualifier);
647
		return getInt(key, result, nodePath);
632 648
	}
633 649

  
634 650

  
635 651
	public static int getInt(String key, TXMParameters commandParameters, TXMResult result)	{
636
		return getInt(key, commandParameters, result, result.getPreferencesNodeQualifier());
652
		return getInt(key, commandParameters, result, result.getCommandPreferencesNodePath());
637 653
	}
638 654

  
639 655
	/**
......
642 658
	 * Otherwise try to get it from the specified node qualifier if exists.
643 659
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
644 660
	 * Returns defaultValue if no value has been found for the specified key.
645
	 * @param nodeQualifier
661
	 * @param nodePath
646 662
	 * @param result
647 663
	 * @param key
648 664
	 * @return
649 665
	 */
650
	public static int getInt(String key, TXMResult result, String nodeQualifier)	{
651
		nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
666
	public static int getInt(String key, TXMResult result, String nodePath)	{
667
		nodePath = findNodePath(nodePath, result, key);
652 668

  
653
		Integer defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getInt(key, 0);
654
		return scope.getNode(nodeQualifier).getInt(key, defaultValue);
669
		int defaultValue = DefaultScope.INSTANCE.getNode(nodePath).getInt(key, 0);
670
		return preferencesRootNode.node(nodePath).getInt(key, defaultValue);
655 671

  
656 672
	}
657 673

  
658 674
	/**
659 675
	 *
660
	 * @param nodeQualifier
676
	 * @param nodePath
661 677
	 * @param key
662 678
	 * @return
663 679
	 */
664
	public static int getInt(String key, String nodeQualifier)	{
665
		return getInt(key, null, nodeQualifier);
680
	public static int getInt(String key, String nodePath)	{
681
		return getInt(key, null, nodePath);
666 682
	}
667 683

  
668 684
	/**
......
684 700
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
685 701
	 * Returns 0L if no value has been found for the specified key.
686 702
	 * @param commandParameters
687
	 * @param nodeQualifier
703
	 * @param nodePath
688 704
	 * @param result
689 705
	 * @param key
690 706
	 * @return
691 707
	 */
692
	public static long getLong(String key, TXMParameters commandParameters, TXMResult result, String nodeQualifier)	{
708
	public static long getLong(String key, TXMParameters commandParameters, TXMResult result, String nodePath)	{
693 709
		if(commandParameters != null && commandParameters.get(key) != null)	{
694 710
			return (Long) commandParameters.get(key);
695 711
		}
696
		return getLong(key, result, nodeQualifier);
712
		return getLong(key, result, nodePath);
697 713
	}
698 714

  
699 715
	public static long getLong(String key, TXMParameters commandParameters, TXMResult result)	{
700
		return getLong(key, commandParameters, result, result.getPreferencesNodeQualifier());
716
		return getLong(key, commandParameters, result, result.getCommandPreferencesNodePath());
701 717
	}
702 718

  
703 719

  
......
708 724
	 * Otherwise try to get it from the specified node qualifier if exists.
709 725
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
710 726
	 * Returns defaultValue if no value has been found for the specified key.
711
	 * @param nodeQualifier
727
	 * @param nodePath
712 728
	 * @param result
713 729
	 * @param key
714 730
	 * @param defaultValue
715 731
	 * @return
716 732
	 */
717
	public static long getLong(String key, TXMResult result, String nodeQualifier, long defaultValue)	{
718
		nodeQualifier = findNodeQualifier(nodeQualifier, result, key);
733
	public static long getLong(String key, TXMResult result, String nodePath, long defaultValue)	{
734
		nodePath = findNodePath(nodePath, result, key);
719 735

  
720
		defaultValue = DefaultScope.INSTANCE.getNode(nodeQualifier).getLong(key, defaultValue);
721
		return scope.getNode(nodeQualifier).getLong(key, defaultValue);
736
		defaultValue = DefaultScope.INSTANCE.getNode(nodePath).getLong(key, defaultValue);
737
		return preferencesRootNode.node(nodePath).getLong(key, defaultValue);
722 738

  
723 739
	}
724 740

  
......
728 744
	 * Otherwise try to get it from the specified node qualifier if exists.
729 745
	 * Otherwise try to get it from the specified alternative node qualifiers defined in the list <code>TXMPreferences.alternativeNodesQualifiers</code>.
730 746
	 * Returns 0L if no value has been found for the specified key.
731
	 * @param nodeQualifier
747
	 * @param nodePath
732 748
	 * @param result
733 749
	 * @param key
734 750
	 * @param defaultValue
735 751
	 * @return
736 752
	 */
737
	public static long getLong(String key, TXMResult result, String nodeQualifier)	{
738
		return getLong(key, result, nodeQualifier, 0L);
753
	public static long getLong(String key, TXMResult result, String nodePath)	{
754
		return getLong(key, result, nodePath, 0L);
739 755
	}
740 756

  
741 757
	/**
742 758
	 *
743
	 * @param nodeQualifier
759
	 * @param nodePath
744 760
	 * @param key
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff