Révision 3841

TXM/trunk/bundles/org.txm.core/src/java/org/txm/core/results/TXMResult.java (revision 3841)
2 2

  
3 3
import java.io.BufferedReader;
4 4
import java.io.File;
5
import java.io.FileNotFoundException;
6 5
import java.io.IOException;
7 6
import java.io.StringBufferInputStream;
8 7
import java.io.StringReader;
9
import java.io.UnsupportedEncodingException;
10 8
import java.lang.reflect.Constructor;
11 9
import java.lang.reflect.Field;
12 10
import java.lang.reflect.InvocationTargetException;
13
import java.nio.file.Path;
14 11
import java.text.DateFormat;
15 12
import java.text.SimpleDateFormat;
16 13
import java.util.ArrayList;
17
import java.util.Arrays;
18 14
import java.util.Calendar;
19 15
import java.util.Date;
20 16
import java.util.HashMap;
......
240 236
		if (parent != null) {
241 237
			parent.addChild(this);
242 238
		}
239
		
240
		
243 241

  
244 242
		// new result
245 243
		if (parametersNodePath == null) {
......
278 276
		// retrieving parent from UUID/node path
279 277
		String parentNodePath = this.getStringParameterValue(TXMPreferences.PARENT_PARAMETERS_NODE_PATH);
280 278

  
279
		
280
		
281 281
		// System.out.println("TXMResult.TXMResult(): parent UUID = " + parentUUID);
282 282

  
283 283
		// search for parent only if UUID != "ROOT"
......
311 311
				}
312 312
				return;
313 313
			}
314
		}
314
		} 
315
		
316
//		else if (parent != null && !(parent.getParametersNodePath().equals(parentNodePath))) { // WHO IS RIGHT THE parent variable OR the parentnodepath preference ?
317
//			Log.warning("This result parents node path ("+parentNodePath+") differs from given parents node path: "+parent);
318
//			this.saveParameter(TXMPreferences.PARENT_PARAMETERS_NODE_PATH, parent.getParametersNodePath());
319
//		}
315 320

  
316 321
		// loads parameters from local result node, current command preferences or default command preferences
317 322
		try {
......
2267 2272
	/**
2268 2273
	 * import a result from a Properties map
2269 2274
	 * 
2275
	 * e.g corpus.importResult(concordanceParametersMap)
2276
	 * 
2270 2277
	 * @param allparameters the parameters file
2271 2278
	 * @return the created result
2272 2279
	 */
TXM/trunk/bundles/org.txm.core/src/java/org/txm/objects/Project.java (revision 3841)
520 520
		for (String resultNodePath : resultNodePaths) {
521 521
			
522 522
			try {
523
				//FIXME Move TXMResult initialization in the TXMResult.createResult(Preference node); parent and result node path are set before calling
523 524
				Preferences node = TXMPreferences.preferencesRootNode.node(resultNodePath);
524 525
				
525 526
				String className = node.get(TXMPreferences.CLASS, ""); //$NON-NLS-1$ //$NON-NLS-2$
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportCommand.java (revision 3841)
156 156
								
157 157
								Properties props = fileToProperties.get(parametersFile);
158 158
								String UUID = props.getProperty(TXMPreferences.RESULT_PARAMETERS_NODE_PATH);
159
								
160
//								String name = props.getProperty(TXMPreferences.LAZY_NAME);
161
//								String clazzName = props.getProperty(TXMPreferences.CLASS);
162
//								String username = props.getProperty(TXMPreferences.USER_NAME);
163
//								for (TXMResult r : defaultParentResult.getDeepChildren()) {
164
//									if (r.getClass().getName().equals(clazzName) && (r.getLazyName().equals(name) || r.getUserName().equals(username))) {
165
//										System.out.println("FOUND RESULT ? ="+r);
166
//										importedResult = r;
167
//										UUIDDependencies.put(UUID, r.getParametersNodePath());
168
//										break;
169
//									}
170
//								}
171
//								
172
//								if (importedResult != null) {
173
//									System.out.println("IMPORTED RESULT WAS ALREADY HERE");
174
//									break;
175
//								}
176
								
159
																
177 160
								String className = props.getProperty(TXMPreferences.CLASS, ""); //$NON-NLS-1$ //$NON-NLS-2$
178 161
								if (className == null || className.length() == 0) {
179 162
									Log.warning(NLS.bind("Warning: can not import object with no class name set with path={0}.", parametersFile)); //$NON-NLS-1$
......
217 200
								importedResult.loadParameters();
218 201
								
219 202
								oldUUIDToNewUUID.put(UUID, resultNodePath);
220
								
221
								//						if (r.importParameters(outfile)) {
222
								//							CorporaView.refreshObject(r);
223
								//							System.out.println(NLS.bind("Parameter imported from the {0} file.", outfile)); //$NON-NLS-1$
224
								//								
225
								//							this.syncExec(new Runnable() {
226
								//
227
								//								@Override
228
								//								public void run() {
229
								//									SWTEditorsUtils.refreshEditors(r);
230
								//								}
231
								//							});
232
								//						}
233 203
							}
234 204
							catch (ThreadDeath td) {
235 205
								if (importedResult != null) {
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/handlers/export/ImportResultParameter.java (revision 3841)
58 58
 * export a result of a result by calling the function toTxt(File f) then show
59 59
 * the result in the text editor @ author mdecorde.
60 60
 */
61
 @Deprecated
61 62
public class ImportResultParameter extends AbstractHandler {
62 63
	
63 64
	/**

Formats disponibles : Unified diff