Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 136219 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java (-50 / +54 lines)
Lines 62-68 Link Here
62
import org.eclipse.swt.widgets.Display;
62
import org.eclipse.swt.widgets.Display;
63
import org.eclipse.ui.PlatformUI;
63
import org.eclipse.ui.PlatformUI;
64
64
65
66
/**
65
/**
67
 * @author Mik Kersten (some rewriting)
66
 * @author Mik Kersten (some rewriting)
68
 * @author Rob Elves (attachments)
67
 * @author Rob Elves (attachments)
Lines 99-105 Link Here
99
98
100
	public static final char PREF_DELIM_REPOSITORY = ':';
99
	public static final char PREF_DELIM_REPOSITORY = ':';
101
100
102
	public static final String POST_ARGS_SHOW_BUG = "/show_bug.cgi?id=";
101
	public static final String POST_ARGS_SHOW_BUG = "/show_bug.cgi?id=";//ctype=xml&
103
102
104
	public static final String POST_ARGS_ATTACHMENT_DOWNLOAD = "/attachment.cgi?id=";
103
	public static final String POST_ARGS_ATTACHMENT_DOWNLOAD = "/attachment.cgi?id=";
105
104
Lines 142-152 Link Here
142
				if (input != null) {
141
				if (input != null) {
143
					in = new BufferedReader(new InputStreamReader(input));
142
					in = new BufferedReader(new InputStreamReader(input));
144
143
145
					// get the actual bug fron the server and return it
144
					// BugReportFactory reportFactory =
146
					BugReport bug = BugParser.parseBug(in, id, repository.getUrl(), !repository.getVersion().equals(
145
					// BugReportFactory.getInstance();
147
							BugzillaServerVersion.SERVER_216.toString()), repository.getUserName(), repository
146
					// BugReport bugReport = reportFactory.readReport(in, id,
147
					// repository, connection.getContentType());
148
					// get the actual bug from the server and return it
149
					BugReport bugReport = BugParser.parseBug(in, id, repository.getUrl(), !repository.getVersion()
150
							.equals(BugzillaServerVersion.SERVER_216.toString()), repository.getUserName(), repository
148
							.getPassword(), connection.getContentType());
151
							.getPassword(), connection.getContentType());
149
					return bug;
152
					return bugReport;
150
				}
153
				}
151
			}
154
			}
152
			// TODO handle the error
155
			// TODO handle the error
Lines 213-224 Link Here
213
216
214
		return BugzillaPlugin.getDefault().getProductConfiguration(repository.getUrl()).getProducts();
217
		return BugzillaPlugin.getDefault().getProductConfiguration(repository.getUrl()).getProducts();
215
218
216
//		BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, new NullProgressMonitor());
219
		// BugzillaQueryPageParser parser = new
217
//		if (!parser.wasSuccessful()) {
220
		// BugzillaQueryPageParser(repository, new NullProgressMonitor());
218
//			throw new RuntimeException("Couldn't get products");
221
		// if (!parser.wasSuccessful()) {
219
//		} else {
222
		// throw new RuntimeException("Couldn't get products");
220
//			return Arrays.asList(parser.getProductValues());
223
		// } else {
221
//		}
224
		// return Arrays.asList(parser.getProductValues());
225
		// }
222
226
223
	}
227
	}
224
228
Lines 303-363 Link Here
303
307
304
		HashMap<String, Attribute> attributes = new HashMap<String, Attribute>();
308
		HashMap<String, Attribute> attributes = new HashMap<String, Attribute>();
305
309
306
		// ATTRIBUTE: Severity
307
		Attribute a = new Attribute("Severity");
310
		Attribute a = new Attribute("Severity");
308
		a.setParameterName("bug_severity");
311
		a.setParameterName("bug_severity");
309
		// get optionValues from ProductConfiguration
310
		List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities();
312
		List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities();
311
		// add option values from ProductConfiguration to Attribute optionValues
313
		for (String option : optionValues) {
312
		for (String option: optionValues) {
313
			a.addOptionValue(option, option);
314
			a.addOptionValue(option, option);
314
		}
315
		}
315
		// add Attribute to model
316
		attributes.put("severites", a);
316
		attributes.put("severites", a);
317
317
318
		// ATTRIBUTE: OS
319
		a = new Attribute("OS");
318
		a = new Attribute("OS");
320
		a.setParameterName("op_sys");
319
		a.setParameterName("op_sys");
321
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs();
320
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs();
322
		for (String option: optionValues) {
321
		for (String option : optionValues) {
323
			a.addOptionValue(option, option);
322
			a.addOptionValue(option, option);
324
		}
323
		}
325
		attributes.put("OSs", a);
324
		attributes.put("OSs", a);
326
325
327
		// ATTRIBUTE: Platform
328
		a = new Attribute("Platform");
326
		a = new Attribute("Platform");
329
		a.setParameterName("rep_platform");
327
		a.setParameterName("rep_platform");
330
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms();
328
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms();
331
		for (String option: optionValues) {
329
		for (String option : optionValues) {
332
			a.addOptionValue(option, option);
330
			a.addOptionValue(option, option);
333
		}
331
		}
334
		attributes.put("platforms", a);
332
		attributes.put("platforms", a);
335
333
336
		// ATTRIBUTE: Version
337
		a = new Attribute("Version");
334
		a = new Attribute("Version");
338
		a.setParameterName("version");
335
		a.setParameterName("version");
339
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct());
336
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct());
340
		for (String option: optionValues) {
337
		for (String option : optionValues) {
341
			a.addOptionValue(option, option);
338
			a.addOptionValue(option, option);
342
		}
339
		}
343
		attributes.put("versions", a);
340
		attributes.put("versions", a);
344
341
345
		// ATTRIBUTE: Component
342
346
		a = new Attribute("Component");
343
		a = new Attribute("Component");
347
		a.setParameterName("component");
344
		a.setParameterName("component");
348
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct());
345
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct());
349
		for (String option: optionValues) {
346
		for (String option : optionValues) {
350
			a.addOptionValue(option, option);
347
			a.addOptionValue(option, option);
351
		}
348
		}
352
		attributes.put("components", a);
349
		attributes.put("components", a);
353
350
354
		// ATTRIBUTE: Priority
351
	
355
		a = new Attribute("Priority");
352
		a = new Attribute("Priority");
356
		a.setParameterName("bug_severity");
353
		a.setParameterName("priority");
357
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPriorities();
354
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPriorities();
358
		for (String option: optionValues) {
355
		for (String option : optionValues) {
359
			a.addOptionValue(option, option);
356
			a.addOptionValue(option, option);
360
		}
357
		}
358
		attributes.put("priorities", a);
359
		
360
361
		a = new Attribute("Product");
362
		a.setParameterName("product");
363
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getProducts();
364
		for (String option : optionValues) {
365
			a.addOptionValue(option, option);
366
		}
367
		attributes.put("products", a);
361
368
362
		// set NBM Attributes (after all Attributes have been created, and added
369
		// set NBM Attributes (after all Attributes have been created, and added
363
		// to attributes map)
370
		// to attributes map)
Lines 387-399 Link Here
387
	}
394
	}
388
395
389
	static String queryOptionsToString(List<String> array) {
396
	static String queryOptionsToString(List<String> array) {
390
		
397
391
		StringBuffer buffer = new StringBuffer();
398
		StringBuffer buffer = new StringBuffer();
392
		for (String string : array) {
399
		for (String string : array) {
393
			buffer.append(string);
400
			buffer.append(string);
394
			buffer.append("!");
401
			buffer.append("!");
395
		}
402
		}
396
		
403
397
		return buffer.toString();
404
		return buffer.toString();
398
	}
405
	}
399
406
Lines 437-448 Link Here
437
			IOException {
444
			IOException {
438
445
439
		String repositoryUrl = repository.getUrl();
446
		String repositoryUrl = repository.getUrl();
440
//		BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, monitor);
447
		// BugzillaQueryPageParser parser = new
441
//		if (!parser.wasSuccessful())
448
		// BugzillaQueryPageParser(repository, monitor);
442
//			return;
449
		// if (!parser.wasSuccessful())
443
		
450
		// return;
444
		RepositoryConfiguration config = ServerConfigurationFactory.getInstance().getConfiguration(
451
445
				repositoryUrl);
452
		RepositoryConfiguration config = ServerConfigurationFactory.getInstance().getConfiguration(repositoryUrl);
446
453
447
		// get the preferences store so that we can change the data in it
454
		// get the preferences store so that we can change the data in it
448
		IPreferenceStore prefs = BugzillaPlugin.getDefault().getPreferenceStore();
455
		IPreferenceStore prefs = BugzillaPlugin.getDefault().getPreferenceStore();
Lines 479-485 Link Here
479
				queryOptionsToString(config.getProducts()));
486
				queryOptionsToString(config.getProducts()));
480
		monitor.worked(1);
487
		monitor.worked(1);
481
488
482
		
483
		prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl,
489
		prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl,
484
				queryOptionsToString(config.getComponents()));
490
				queryOptionsToString(config.getComponents()));
485
		monitor.worked(1);
491
		monitor.worked(1);
Lines 487-513 Link Here
487
		prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl,
493
		prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl,
488
				queryOptionsToString(config.getVersions()));
494
				queryOptionsToString(config.getVersions()));
489
		monitor.worked(1);
495
		monitor.worked(1);
490
		
496
491
		prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl,
497
		prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl,
492
				queryOptionsToString(config.getTargetMilestones()));
498
				queryOptionsToString(config.getTargetMilestones()));
493
		monitor.worked(1);
499
		monitor.worked(1);
494
		
500
495
		for (String product: config.getProducts()) {
501
		for (String product : config.getProducts()) {
496
			prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY+product,
502
			prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl
497
					queryOptionsToString(config.getComponents(product)));
503
					+ PREF_DELIM_REPOSITORY + product, queryOptionsToString(config.getComponents(product)));
498
			monitor.worked(1);
504
			monitor.worked(1);
499
505
500
			prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY+product,
506
			prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl
501
					queryOptionsToString(config.getVersions(product)));
507
					+ PREF_DELIM_REPOSITORY + product, queryOptionsToString(config.getVersions(product)));
502
			monitor.worked(1);
508
			monitor.worked(1);
503
			
509
504
			prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY+product,
510
			prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl
505
					queryOptionsToString(config.getTargetMilestones(product)));
511
					+ PREF_DELIM_REPOSITORY + product, queryOptionsToString(config.getTargetMilestones(product)));
506
			monitor.worked(1);
512
			monitor.worked(1);
507
		}
513
		}
508
		
509
514
510
		
511
	}
515
	}
512
516
513
	public static boolean downloadAttachment(TaskRepository repository, int id, File destinationFile, boolean overwrite)
517
	public static boolean downloadAttachment(TaskRepository repository, int id, File destinationFile, boolean overwrite)
Lines 613-619 Link Here
613
			}
617
			}
614
618
615
			postMethod.setRequestEntity(new MultipartRequestEntity(parts.toArray(new Part[1]), postMethod.getParams()));
619
			postMethod.setRequestEntity(new MultipartRequestEntity(parts.toArray(new Part[1]), postMethod.getParams()));
616
 
620
617
			client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
621
			client.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
618
			int status = client.executeMethod(postMethod);
622
			int status = client.executeMethod(postMethod);
619
			if (status == HttpStatus.SC_OK) {
623
			if (status == HttpStatus.SC_OK) {
(-)src/org/eclipse/mylar/internal/bugzilla/core/BugzillaReportSubmitForm.java (-16 / +38 lines)
Lines 52-57 Link Here
52
 */
52
 */
53
public class BugzillaReportSubmitForm {
53
public class BugzillaReportSubmitForm {
54
54
55
	private static final String KEY_BUG_FILE_LOC = "bug_file_loc";
56
57
	private static final String KEY_PRODUCT = "product";
58
55
	private static final String VAL_TRUE = "true";
59
	private static final String VAL_TRUE = "true";
56
60
57
	private static final String KEY_REMOVECC = "removecc";
61
	private static final String KEY_REMOVECC = "removecc";
Lines 250-261 Link Here
250
			}
254
			}
251
		}
255
		}
252
256
257
		form.add(KEY_BUG_FILE_LOC, "");
258
		
259
		// specify the product
260
		form.add(KEY_PRODUCT, model.getProduct());
261
253
		// add the summary to the bug post
262
		// add the summary to the bug post
254
		form.add("short_desc", model.getSummary());
263
		form.add("short_desc", model.getSummary());
255
		
264
256
		BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository.getVersion());
265
		BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository
266
				.getVersion());
257
		if (bugzillaServerVersion != null && bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) {
267
		if (bugzillaServerVersion != null && bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) {
258
//		if (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString())) {
268
			// if
269
			// (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString()))
270
			// {
259
			form.add("bug_status", "NEW");
271
			form.add("bug_status", "NEW");
260
		}
272
		}
261
273
Lines 273-281 Link Here
273
285
274
	/**
286
	/**
275
	 * TODO: refactor common stuff with new bug post
287
	 * TODO: refactor common stuff with new bug post
276
	 * @param removeCC 
288
	 * 
289
	 * @param removeCC
277
	 */
290
	 */
278
	public static BugzillaReportSubmitForm makeExistingBugPost(BugReport bug, TaskRepository repository, Set<String> removeCC) {
291
	public static BugzillaReportSubmitForm makeExistingBugPost(BugReport bug, TaskRepository repository,
292
			Set<String> removeCC) {
279
293
280
		BugzillaReportSubmitForm bugReportPostHandler = new BugzillaReportSubmitForm();
294
		BugzillaReportSubmitForm bugReportPostHandler = new BugzillaReportSubmitForm();
281
295
Lines 319-330 Link Here
319
		if (bug.getAttribute(BugReport.ATTR_SUMMARY) != null) {
333
		if (bug.getAttribute(BugReport.ATTR_SUMMARY) != null) {
320
			bugReportPostHandler.add(KEY_SHORT_DESC, bug.getAttribute(BugReport.ATTR_SUMMARY).getNewValue());
334
			bugReportPostHandler.add(KEY_SHORT_DESC, bug.getAttribute(BugReport.ATTR_SUMMARY).getNewValue());
321
		}
335
		}
322
		
336
323
		// add the new comment to the bug post if there is some text in it
337
		// add the new comment to the bug post if there is some text in it
324
		if (bug.getNewNewComment().length() != 0) {
338
		if (bug.getNewNewComment().length() != 0) {
325
			bugReportPostHandler.add(KEY_COMMENT, bug.getNewNewComment());
339
			bugReportPostHandler.add(KEY_COMMENT, bug.getNewNewComment());
326
		}
340
		}
327
		
341
328
		if (removeCC != null && removeCC.size() > 0) {
342
		if (removeCC != null && removeCC.size() > 0) {
329
			String[] s = new String[removeCC.size()];
343
			String[] s = new String[removeCC.size()];
330
			bugReportPostHandler.add(KEY_CC, toCommaSeparatedList(removeCC.toArray(s)));
344
			bugReportPostHandler.add(KEY_CC, toCommaSeparatedList(removeCC.toArray(s)));
Lines 344-350 Link Here
344
		}
358
		}
345
		return buffer.toString();
359
		return buffer.toString();
346
	}
360
	}
347
	
361
348
	/**
362
	/**
349
	 * Add a value to be posted to the bug
363
	 * Add a value to be posted to the bug
350
	 * 
364
	 * 
Lines 425-443 Link Here
425
439
426
			String aString = in.readLine();
440
			String aString = in.readLine();
427
441
442
			// while(aString != null) {
443
			// System.err.println(aString);
444
			// aString = in.readLine();
445
			//			 }
446
428
			boolean possibleFailure = true;
447
			boolean possibleFailure = true;
429
			error = "";
448
			error = "";
430
449
431
			while (aString != null) {
450
			while (aString != null) {
432
				error += aString == null ? "" : aString + "\n";
451
				error += aString == null ? "" : aString + "\n";
433
452
434
				// // check if we have run into an error
453
				// check if we have run into an error
435
				
454
436
				
437
				if (result == null
455
				if (result == null
438
						&& (aString.toLowerCase().indexOf("check e-mail") != -1 || aString.toLowerCase().indexOf(
456
						&& (aString.toLowerCase().indexOf("check e-mail") != -1 || aString.toLowerCase().indexOf(
439
								"error") != -1)) {					
457
								"error") != -1)) {
440
					 throw new LoginException("Bugzilla login problem.");
458
					throw new LoginException("Bugzilla login problem.");
441
				} else if (aString.indexOf("Invalid Username Or Password") != -1) {
459
				} else if (aString.indexOf("Invalid Username Or Password") != -1) {
442
					throw new LoginException("Invalid Username or Password.");
460
					throw new LoginException("Invalid Username or Password.");
443
				} else if (aString.toLowerCase().matches(".*bug\\s+processed.*") // TODO:
461
				} else if (aString.toLowerCase().matches(".*bug\\s+processed.*") // TODO:
Lines 475-481 Link Here
475
					&& (prefix != null && prefix2 == null && postfix != null && postfix2 != null)) {
493
					&& (prefix != null && prefix2 == null && postfix != null && postfix2 != null)) {
476
				throw new PossibleBugzillaFailureException("Could not find bug number for new bug.");
494
				throw new PossibleBugzillaFailureException("Could not find bug number for new bug.");
477
			} else if (possibleFailure) {
495
			} else if (possibleFailure) {
478
				throw new PossibleBugzillaFailureException("Could not find indication that bug was processed successfully.  Message from Bugzilla was: ");
496
				throw new PossibleBugzillaFailureException(
497
						"Could not find indication that bug was processed successfully.  Message from Bugzilla was: ");
479
			}
498
			}
480
499
481
			// set the error to null if we dont think that there was one
500
			// set the error to null if we dont think that there was one
Lines 624-632 Link Here
624
	 * properly in bugzilla
643
	 * properly in bugzilla
625
	 */
644
	 */
626
	private static String formatTextToLineWrap(String origText, TaskRepository repository) {
645
	private static String formatTextToLineWrap(String origText, TaskRepository repository) {
627
		BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository.getVersion());
646
		BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository
647
				.getVersion());
628
		if (bugzillaServerVersion != null && bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) {
648
		if (bugzillaServerVersion != null && bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) {
629
//		if (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString())) {
649
			// if
650
			// (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString()))
651
			// {
630
			return origText;
652
			return origText;
631
		}
653
		}
632
654
(-)src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugzillaWizardPage.java (-4 / +5 lines)
Lines 725-731 Link Here
725
725
726
			if (java2buzillaOSMap != null && java2buzillaOSMap.containsKey(OS) && opSysAttribute != null && opSysAttribute.getOptionValues() != null) {
726
			if (java2buzillaOSMap != null && java2buzillaOSMap.containsKey(OS) && opSysAttribute != null && opSysAttribute.getOptionValues() != null) {
727
				bugzillaOS = java2buzillaOSMap.get(OS);
727
				bugzillaOS = java2buzillaOSMap.get(OS);
728
				if (!opSysAttribute.getOptionValues().values().contains(bugzillaOS)) {
728
				if (opSysAttribute != null && !opSysAttribute.getOptionValues().values().contains(bugzillaOS)) {
729
					// If the OS we found is not in the list of available
729
					// If the OS we found is not in the list of available
730
					// options, set bugzillaOS
730
					// options, set bugzillaOS
731
					// to null, and just use "other"
731
					// to null, and just use "other"
Lines 739-745 Link Here
739
739
740
			if (platform != null && java2buzillaPlatformMap.containsKey(platform)) {
740
			if (platform != null && java2buzillaPlatformMap.containsKey(platform)) {
741
				bugzillaPlatform = java2buzillaPlatformMap.get(platform);
741
				bugzillaPlatform = java2buzillaPlatformMap.get(platform);
742
				if (!platformAttribute.getOptionValues().values().contains(bugzillaPlatform)) {
742
				
743
				if (platformAttribute != null && !platformAttribute.getOptionValues().values().contains(bugzillaPlatform)) {
743
					// If the platform we found is not int the list of available
744
					// If the platform we found is not int the list of available
744
					// optinos, set the
745
					// optinos, set the
745
					// Bugzilla Platform to null, and juse use "other"
746
					// Bugzilla Platform to null, and juse use "other"
Lines 752-760 Link Here
752
			}
753
			}
753
754
754
			// Set the OS and the Platform in the model
755
			// Set the OS and the Platform in the model
755
			if (bugzillaOS != null)
756
			if (bugzillaOS != null && opSysAttribute != null)
756
				opSysAttribute.setValue(bugzillaOS);
757
				opSysAttribute.setValue(bugzillaOS);
757
			if (bugzillaPlatform != null)
758
			if (bugzillaPlatform != null && platformAttribute != null)
758
				platformAttribute.setValue(bugzillaPlatform);
759
				platformAttribute.setValue(bugzillaPlatform);
759
		} catch (Exception e) {
760
		} catch (Exception e) {
760
			MylarStatusHandler.fail(e, "could not set platform options", false); 
761
			MylarStatusHandler.fail(e, "could not set platform options", false); 
(-)src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java (-19 / +6 lines)
Lines 148-178 Link Here
148
		if (!bugWizard.model.hasParsedProducts()) {
148
		if (!bugWizard.model.hasParsedProducts()) {
149
			String repositoryUrl = repository.getUrl();
149
			String repositoryUrl = repository.getUrl();
150
			try {
150
			try {
151
				// ProductConfiguration productConfiguration =
152
				// BugzillaPlugin.getDefault().getProductConfiguration(repositoryUrl);
153
				String[] storedProducts = BugzillaRepositoryUtil.getQueryOptions(IBugzillaConstants.VALUES_PRODUCT,
151
				String[] storedProducts = BugzillaRepositoryUtil.getQueryOptions(IBugzillaConstants.VALUES_PRODUCT,
154
						repositoryUrl);
152
						repositoryUrl);
155
				if (storedProducts.length > 0) {
153
				if (storedProducts.length > 0) {
156
					// String[] storedProducts =
157
					// BugzillaPlugin.getDefault().getProductConfiguration(repositoryUrl).getProducts();
158
					products = Arrays.asList(storedProducts);
154
					products = Arrays.asList(storedProducts);
159
				} else {
155
				} else {
160
					products = BugzillaRepositoryUtil.getProductList(repository);
156
					products = BugzillaRepositoryUtil.getProductList(repository);
161
				}
157
				}
162
				// bugWizard.model.setConnected(true);
158
				bugWizard.model.setConnected(true);
163
				bugWizard.model.setParsedProductsStatus(true);
159
				bugWizard.model.setParsedProductsStatus(true);
164
				// } catch (IOException e) {
160
165
				// bugWizard.model.setConnected(false);
166
				//
167
				// if (e instanceof IOException) {
168
				// MessageDialog.openError(null, "Bugzilla Connect Error",
169
				// "Unable to connect to Bugzilla server.\n"
170
				// + "Product configuration will be read from the workspace.");
171
				//
172
				// products =
173
				// Arrays.asList(BugzillaPlugin.getDefault().getProductConfiguration(repositoryUrl).getProducts());
174
				// bugWizard.model.setParsedProductsStatus(true);
175
				// }
176
			} catch (Exception e) {
161
			} catch (Exception e) {
177
				bugWizard.model.setConnected(false);						
162
				bugWizard.model.setConnected(false);						
178
				PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
163
				PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
Lines 223-229 Link Here
223
208
224
		// try to get the attributes from the bugzilla server
209
		// try to get the attributes from the bugzilla server
225
		try {
210
		try {
226
			if (!model.hasParsedAttributes() || !prevProduct.equals(model.getProduct())) {
211
			//if (prevProduct != null && !prevProduct.equals(model.getProduct())) {
212
				//!model.hasParsedAttributes() || 
227
				String serverUrl = repository.getUrl();
213
				String serverUrl = repository.getUrl();
228
//				if (model.isConnected()) {
214
//				if (model.isConnected()) {
229
//					BugzillaRepositoryUtil.setupNewBugAttributes(serverUrl, model, false);
215
//					BugzillaRepositoryUtil.setupNewBugAttributes(serverUrl, model, false);
Lines 240-247 Link Here
240
					// will createControl again with new attributes in model
226
					// will createControl again with new attributes in model
241
					bugWizard.getAttributePage().setControl(null);
227
					bugWizard.getAttributePage().setControl(null);
242
				}
228
				}
243
			}
229
			//}
244
		} catch (final Exception e) {
230
		} catch (final Exception e) {
231
			e.printStackTrace();
245
			PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
232
			PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
246
				public void run() {
233
				public void run() {
247
					MessageDialog.openError(Display.getDefault().getActiveShell(), NEW_BUGZILLA_TASK_ERROR_TITLE, e
234
					MessageDialog.openError(Display.getDefault().getActiveShell(), NEW_BUGZILLA_TASK_ERROR_TITLE, e

Return to bug 136219