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 (-31 / +37 lines)
Lines 51-56 Link Here
51
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
51
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
52
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion;
52
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion;
53
import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
53
import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
54
import org.eclipse.mylar.internal.bugzilla.core.internal.BugReportElement;
54
import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
55
import org.eclipse.mylar.internal.bugzilla.core.internal.NewBugParser;
55
import org.eclipse.mylar.internal.bugzilla.core.internal.OfflineReportsFile;
56
import org.eclipse.mylar.internal.bugzilla.core.internal.OfflineReportsFile;
56
import org.eclipse.mylar.internal.bugzilla.core.internal.RepositoryConfiguration;
57
import org.eclipse.mylar.internal.bugzilla.core.internal.RepositoryConfiguration;
Lines 67-73 Link Here
67
 * @author Rob Elves (attachments)
68
 * @author Rob Elves (attachments)
68
 */
69
 */
69
public class BugzillaRepositoryUtil {
70
public class BugzillaRepositoryUtil {
70
71
	
71
	private static final String VALUE_CONTENTTYPEMETHOD_MANUAL = "manual";
72
	private static final String VALUE_CONTENTTYPEMETHOD_MANUAL = "manual";
72
73
73
	private static final String VALUE_ISPATCH = "1";
74
	private static final String VALUE_ISPATCH = "1";
Lines 280-286 Link Here
280
						"Unable to connect to Bugzilla server.\n"
281
						"Unable to connect to Bugzilla server.\n"
281
								+ "Bug report will be created offline and saved for submission later.")) {
282
								+ "Bug report will be created offline and saved for submission later.")) {
282
					nbm.setConnected(false);
283
					nbm.setConnected(false);
283
					setupProdConfigAttributes(serverUrl, nbm);
284
					setupBugAttributes(serverUrl, nbm);
284
				} else
285
				} else
285
					throw new Exception("Bug report will not be created.");
286
					throw new Exception("Bug report will not be created.");
286
			} else
287
			} else
Lines 297-373 Link Here
297
	}
298
	}
298
299
299
	/**
300
	/**
300
	 * Method to get attributes from ProductConfiguration if unable to connect
301
	 * Adds bug attributes to new bug model and sets defaults
301
	 * to Bugzilla server
302
	 * 
303
	 * @param model -
304
	 *            the NewBugModel to store the attributes
305
	 */
302
	 */
306
	public static void setupProdConfigAttributes(String serverUrl, NewBugModel model) {
303
	public static void setupBugAttributes(String serverUrl, NewBugModel model) {
307
304
308
		HashMap<String, Attribute> attributes = new HashMap<String, Attribute>();
305
		HashMap<String, Attribute> attributes = new HashMap<String, Attribute>();
309
306
310
		Attribute a = new Attribute("Severity");
307
		Attribute a = new Attribute(BugReportElement.BUG_SEVERITY.toString());
311
		a.setParameterName("bug_severity");
308
		a.setParameterName(BugReportElement.BUG_SEVERITY.getKeyString());
312
		List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities();
309
		List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities();
313
		for (String option : optionValues) {
310
		for (String option : optionValues) {
314
			a.addOptionValue(option, option);
311
			a.addOptionValue(option, option);
315
		}
312
		}
316
		attributes.put("severites", a);
313
		a.setValue(optionValues.get((optionValues.size() / 2)));
314
		attributes.put(a.getName(), a);
317
315
318
		a = new Attribute("OS");
316
		a = new Attribute(BugReportElement.OP_SYS.toString());
319
		a.setParameterName("op_sys");
317
		a.setParameterName(BugReportElement.OP_SYS.getKeyString());
320
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs();
318
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs();
321
		for (String option : optionValues) {
319
		for (String option : optionValues) {
322
			a.addOptionValue(option, option);
320
			a.addOptionValue(option, option);
323
		}
321
		}
324
		attributes.put("OSs", a);
322
		attributes.put(a.getName(), a);
325
323
326
		a = new Attribute("Platform");
324
		a = new Attribute(BugReportElement.REP_PLATFORM.toString());
327
		a.setParameterName("rep_platform");
325
		a.setParameterName(BugReportElement.REP_PLATFORM.getKeyString());
328
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms();
326
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms();
329
		for (String option : optionValues) {
327
		for (String option : optionValues) {
330
			a.addOptionValue(option, option);
328
			a.addOptionValue(option, option);
331
		}
329
		}
332
		attributes.put("platforms", a);
330
		attributes.put(a.getName(), a);
333
331
334
		a = new Attribute("Version");
332
		a = new Attribute(BugReportElement.VERSION.toString());
335
		a.setParameterName("version");
333
		a.setParameterName(BugReportElement.VERSION.getKeyString());
336
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct());
334
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct());
337
		for (String option : optionValues) {
335
		for (String option : optionValues) {
338
			a.addOptionValue(option, option);
336
			a.addOptionValue(option, option);
339
		}
337
		}
340
		attributes.put("versions", a);
338
		a.setValue(optionValues.get(optionValues.size() - 1));
339
		attributes.put(a.getName(), a);
341
340
342
341
343
		a = new Attribute("Component");
342
		a = new Attribute(BugReportElement.COMPONENT.toString());
344
		a.setParameterName("component");
343
		a.setParameterName(BugReportElement.COMPONENT.getKeyString());
345
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct());
344
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct());
346
		for (String option : optionValues) {
345
		for (String option : optionValues) {
347
			a.addOptionValue(option, option);
346
			a.addOptionValue(option, option);
348
		}
347
		}
349
		attributes.put("components", a);
348
		attributes.put(a.getName(), a);
350
349
351
	
350
	
352
		a = new Attribute("Priority");
351
		a = new Attribute(BugReportElement.PRIORITY.toString());
353
		a.setParameterName("priority");
352
		a.setParameterName(BugReportElement.PRIORITY.getKeyString());
354
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPriorities();
353
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPriorities();
355
		for (String option : optionValues) {
354
		for (String option : optionValues) {
356
			a.addOptionValue(option, option);
355
			a.addOptionValue(option, option);
357
		}
356
		}
358
		attributes.put("priorities", a);
357
		a.setValue(optionValues.get((optionValues.size() / 2)));
358
		attributes.put(a.getName(), a);
359
		
359
		
360
360
361
		a = new Attribute("Product");
361
		a = new Attribute(BugReportElement.PRODUCT.toString());
362
		a.setParameterName("product");
362
		a.setParameterName(BugReportElement.PRODUCT.getKeyString());
363
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getProducts();
363
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getProducts();
364
		for (String option : optionValues) {
364
		for (String option : optionValues) {
365
			a.addOptionValue(option, option);
365
			a.addOptionValue(option, option);
366
		}
366
		}
367
		attributes.put("products", a);
367
		attributes.put(a.getName(), a);
368
		
369
		a = new Attribute(BugReportElement.BUG_STATUS.toString());
370
		a.setParameterName(BugReportElement.BUG_STATUS.getKeyString());
371
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getStatusValues();
372
		for (String option : optionValues) {
373
			a.addOptionValue(option, option);
374
		}
375
		attributes.put(a.getName(), a);
368
376
369
		// set NBM Attributes (after all Attributes have been created, and added
370
		// to attributes map)
371
		model.attributes = attributes;
377
		model.attributes = attributes;
372
	}
378
	}
373
379
(-)src/org/eclipse/mylar/internal/bugzilla/core/internal/BugReportElement.java (+84 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2004 - 2006 University Of British Columbia and others.
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
6
 * http://www.eclipse.org/legal/epl-v10.html
7
 *
8
 * Contributors:
9
 *     University Of British Columbia - initial API and implementation
10
 *******************************************************************************/
11
12
package org.eclipse.mylar.internal.bugzilla.core.internal;
13
14
/**
15
 * Bugzilla XML element enum. Each enum has the field name
16
 * and associated xml element tag name.
17
 * 
18
 * @author Rob Elves
19
 */
20
public enum BugReportElement {
21
	
22
	// Format: ENUM ( "pretty name", "xml key" )
23
	
24
	BUGZILLA ("bugzilla", "bugzilla"),
25
	BUG ("bug","bug"),
26
	BUG_ID ("Bug", "bug_id"),
27
	CREATION_TS ("Creation Date", "creation_ts"),
28
	SHORT_DESC ("Summary", "short_desc"),
29
	DELTA_TS ("Last Modification", "delta_ts"),
30
	REPORTER_ACCESSIBLE ("reporter_accessible", "reporter_accessible"),
31
	CCLIST_ACCESSIBLE ("cclist_accessible", "cclist_accessible"),
32
	CLASSIFICATION_ID ("Classification ID", "classification_id"),
33
	CLASSIFICATION ("Classification", "classification"),
34
	PRODUCT ("Product", "product"),
35
	COMPONENT ("Component", "component"),
36
	VERSION ("Version", "version"),
37
	REP_PLATFORM ("Platform", "rep_platform"),
38
	OP_SYS ("OS", "op_sys"),
39
	BUG_STATUS ("Status", "bug_status"),
40
	PRIORITY ("Priority", "priority"),
41
	BUG_SEVERITY ("Severity", "bug_severity"),
42
	TARGET_MILESTONE ("Target Milestone", "target_milestone"), 
43
	EVERCONFIRMED ("everconfirmed", "everconfirmed"), 
44
	REPORTER ("Reporter", "reporter"), 
45
	ASSIGNED_TO ("Assigned To", "assigned_to"), 
46
	CC ("CC", "cc"), 
47
	LONG_DESC ("Description", "long_desc"),
48
	WHO ("who", "who"),
49
	BUG_WHEN ("bug_when", "bug_when"), 
50
	THETEXT ("thetext", "thetext"), 
51
	ATTACHMENT ("attachment", "attachment"), 
52
	ATTACHID ("attachid", "attachid"), 
53
	DATE ("Date", "date"), 
54
	DESC ("desc", "desc"), 
55
	FILENAME ("filename", "filename"), 
56
	TYPE ("type", "type"), 
57
	DATA ("data", "data"),
58
	UNKNOWN ("UNKNOWN", "UNKNOWN");
59
	
60
	private final String prettyName;
61
	private final String keyString;
62
63
	BugReportElement(String prettyName, String fieldName) {		
64
		this.prettyName = prettyName;
65
		keyString = fieldName;
66
	}
67
68
	public String getKeyString() {
69
		return keyString;
70
	}
71
72
	public String toString() {
73
		return prettyName;
74
	}
75
76
//	public BugReportElementTag fromString(String str) {
77
//		for (BugReportElementTag tag : BugReportElementTag.values()) {
78
//			if (tag.toString().equals(str)) {
79
//				return tag;
80
//			}
81
//		}
82
//		return UNKNOWN;
83
//	}
84
}
(-)src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugzillaWizardPage.java (-25 / +30 lines)
Lines 23-28 Link Here
23
import org.eclipse.mylar.bugzilla.core.Attribute;
23
import org.eclipse.mylar.bugzilla.core.Attribute;
24
import org.eclipse.mylar.bugzilla.core.BugReport;
24
import org.eclipse.mylar.bugzilla.core.BugReport;
25
import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
25
import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
26
import org.eclipse.mylar.internal.bugzilla.core.internal.BugReportElement;
26
import org.eclipse.mylar.internal.bugzilla.ui.editor.AbstractBugEditor;
27
import org.eclipse.mylar.internal.bugzilla.ui.editor.AbstractBugEditor;
27
import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
28
import org.eclipse.mylar.internal.core.util.MylarStatusHandler;
28
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.SWT;
Lines 49-55 Link Here
49
 * @author Mik Kersten (hardening of initial prototype)
50
 * @author Mik Kersten (hardening of initial prototype)
50
 */
51
 */
51
public abstract class AbstractBugzillaWizardPage extends WizardPage implements Listener {
52
public abstract class AbstractBugzillaWizardPage extends WizardPage implements Listener {
52
 
53
54
	private static final String KEY_OP_SYS = "op_sys";
55
53
	/** The instance of the workbench */
56
	/** The instance of the workbench */
54
	protected IWorkbench workbench;
57
	protected IWorkbench workbench;
55
58
Lines 253-259 Link Here
253
	 *            The event which occurred
256
	 *            The event which occurred
254
	 */
257
	 */
255
	public void handleEvent(Event e) {
258
	public void handleEvent(Event e) {
256
		boolean pageComplete = isPageComplete(); 
259
		boolean pageComplete = isPageComplete();
257
260
258
		// Initialize a variable with the no error status
261
		// Initialize a variable with the no error status
259
		Status status = new Status(IStatus.OK, "not_used", 0, "", null);
262
		Status status = new Status(IStatus.OK, "not_used", 0, "", null);
Lines 292-298 Link Here
292
			wizard.attributeCompleted = false;
295
			wizard.attributeCompleted = false;
293
			return false;
296
			return false;
294
		}
297
		}
295
		//saveDataToModel();
298
		// saveDataToModel();
296
		wizard.attributeCompleted = true;
299
		wizard.attributeCompleted = true;
297
		return true;
300
		return true;
298
	}
301
	}
Lines 307-313 Link Here
307
310
308
		nbm.setDescription(descriptionText.getText());
311
		nbm.setDescription(descriptionText.getText());
309
		nbm.setSummary(summaryText.getText());
312
		nbm.setSummary(summaryText.getText());
310
		
313
311
		// go through each of the attributes and sync their values with the
314
		// go through each of the attributes and sync their values with the
312
		// combo boxes
315
		// combo boxes
313
		for (Iterator<Attribute> it = nbm.getAttributes().iterator(); it.hasNext();) {
316
		for (Iterator<Attribute> it = nbm.getAttributes().iterator(); it.hasNext();) {
Lines 318-325 Link Here
318
			try {
321
			try {
319
				if (values == null)
322
				if (values == null)
320
					values = new HashMap<String, String>();
323
					values = new HashMap<String, String>();
321
				if (key.equals(BugReport.ATTRIBUTE_OS)) {					
324
				if (key.equals(BugReport.ATTRIBUTE_OS)) {
322
					String os = oSCombo.getItem(oSCombo.getSelectionIndex());					
325
					String os = oSCombo.getItem(oSCombo.getSelectionIndex());
323
					attribute.setValue(os);
326
					attribute.setValue(os);
324
				} else if (key.equals(BugReport.ATTRIBUTE_VERSION)) {
327
				} else if (key.equals(BugReport.ATTRIBUTE_VERSION)) {
325
					String version = versionCombo.getItem(versionCombo.getSelectionIndex());
328
					String version = versionCombo.getItem(versionCombo.getSelectionIndex());
Lines 354-360 Link Here
354
				MylarStatusHandler.fail(e, "could not set attribute: " + attribute, false);
357
				MylarStatusHandler.fail(e, "could not set attribute: " + attribute, false);
355
			}
358
			}
356
		}
359
		}
357
		//wizard.attributeCompleted = true;
360
		// wizard.attributeCompleted = true;
358
	}
361
	}
359
362
360
	@Override
363
	@Override
Lines 371-377 Link Here
371
		// whether the priority exists or not
374
		// whether the priority exists or not
372
		boolean priExist = false;
375
		boolean priExist = false;
373
		boolean mileExist = false;
376
		boolean mileExist = false;
374
		
377
375
		String url = null;
378
		String url = null;
376
379
377
		// get the model for the new bug
380
		// get the model for the new bug
Lines 409-415 Link Here
409
		// Add the product to the composite
412
		// Add the product to the composite
410
		newLayout(attributesComposite, 1, "Product", PROPERTY);
413
		newLayout(attributesComposite, 1, "Product", PROPERTY);
411
		newLayout(attributesComposite, 1, nbm.getProduct(), VALUE);
414
		newLayout(attributesComposite, 1, nbm.getProduct(), VALUE);
412
		
415
413
		// Populate Attributes
416
		// Populate Attributes
414
		for (Iterator<Attribute> it = nbm.getAttributes().iterator(); it.hasNext();) {
417
		for (Iterator<Attribute> it = nbm.getAttributes().iterator(); it.hasNext();) {
415
			Attribute attribute = it.next();
418
			Attribute attribute = it.next();
Lines 433-439 Link Here
433
			data.horizontalIndent = HORZ_INDENT;
436
			data.horizontalIndent = HORZ_INDENT;
434
			data.widthHint = 150;
437
			data.widthHint = 150;
435
			// create and populate the combo fields for the attributes
438
			// create and populate the combo fields for the attributes
436
			if (key.equals("op_sys")) {
439
			if (key.equals(KEY_OP_SYS)) {
437
				newLayout(attributesComposite, 1, name, PROPERTY);
440
				newLayout(attributesComposite, 1, name, PROPERTY);
438
				oSCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY);
441
				oSCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY);
439
442
Lines 498-504 Link Here
498
					index = 0;
501
					index = 0;
499
				platformCombo.select(index);
502
				platformCombo.select(index);
500
				platformCombo.addListener(SWT.Modify, this);
503
				platformCombo.addListener(SWT.Modify, this);
501
			} else if (key.equals(BugReport.KEY_MILESTONE)) {				
504
			} else if (key.equals(BugReport.KEY_MILESTONE)) {
502
				newLayout(attributesComposite, 1, name, PROPERTY);
505
				newLayout(attributesComposite, 1, name, PROPERTY);
503
				milestoneCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
506
				milestoneCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
504
						| SWT.READ_ONLY);
507
						| SWT.READ_ONLY);
Lines 559-581 Link Here
559
			newLayout(attributesComposite, 1, "", PROPERTY);
562
			newLayout(attributesComposite, 1, "", PROPERTY);
560
		}
563
		}
561
564
562
		Composite textComposite = new Composite(attributesComposite, SWT.NONE);		
565
		Composite textComposite = new Composite(attributesComposite, SWT.NONE);
563
		textComposite.setLayout(new GridLayout(3, false));
566
		textComposite.setLayout(new GridLayout(3, false));
564
		GridData textCompositeGD = new GridData();
567
		GridData textCompositeGD = new GridData();
565
		textCompositeGD.horizontalSpan = 4;
568
		textCompositeGD.horizontalSpan = 4;
566
		textCompositeGD.grabExcessHorizontalSpace = true;
569
		textCompositeGD.grabExcessHorizontalSpace = true;
567
		textComposite.setLayoutData(textCompositeGD);
570
		textComposite.setLayoutData(textCompositeGD);
568
		
571
569
		GridData summaryTextData;
572
		GridData summaryTextData;
570
		
573
571
		if (url != null) {
574
		if (url != null) {
572
			// add the assigned to text field			
575
			// add the assigned to text field
573
			newLayout(textComposite, 1, BugReport.ATTRIBUTE_URL, PROPERTY);
576
			newLayout(textComposite, 1, BugReport.ATTRIBUTE_URL, PROPERTY);
574
			urlText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
577
			urlText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
575
			summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
578
			summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
576
579
577
			summaryTextData.horizontalSpan = 2;
580
			summaryTextData.horizontalSpan = 2;
578
//			summaryTextData.widthHint = 200;
581
			// summaryTextData.widthHint = 200;
579
			urlText.setLayoutData(summaryTextData);
582
			urlText.setLayoutData(summaryTextData);
580
			urlText.setText(url);
583
			urlText.setText(url);
581
			urlText.addListener(SWT.FocusOut, this);
584
			urlText.addListener(SWT.FocusOut, this);
Lines 583-589 Link Here
583
586
584
		newLayout(textComposite, 1, "Assigned To", PROPERTY);
587
		newLayout(textComposite, 1, "Assigned To", PROPERTY);
585
		Label l = new Label(textComposite, SWT.NONE);
588
		Label l = new Label(textComposite, SWT.NONE);
586
//		l.setText("                             ");
589
		// l.setText(" ");
587
		l.setText("(if email is incorrect submit will not proceed)");
590
		l.setText("(if email is incorrect submit will not proceed)");
588
		summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
591
		summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
589
		summaryTextData.horizontalSpan = 1;
592
		summaryTextData.horizontalSpan = 1;
Lines 595-601 Link Here
595
		summaryTextData.widthHint = 200;
598
		summaryTextData.widthHint = 200;
596
		assignedToText.setLayoutData(summaryTextData);
599
		assignedToText.setLayoutData(summaryTextData);
597
		assignedToText.setText("");
600
		assignedToText.setText("");
598
		
599
601
600
		// add the summary text field
602
		// add the summary text field
601
		newLayout(textComposite, 1, "Summary", PROPERTY);
603
		newLayout(textComposite, 1, "Summary", PROPERTY);
Lines 667-673 Link Here
667
	// */
669
	// */
668
	// public boolean offlineSelected() {
670
	// public boolean offlineSelected() {
669
	// return (offlineButton == null) ? false : offlineButton.getSelection();
671
	// return (offlineButton == null) ? false : offlineButton.getSelection();
670
	//	}
672
	// }
671
673
672
	/*
674
	/*
673
	 * The following are Bugzilla's: OS's All AIX Windows 95 Windows 98 Windows
675
	 * The following are Bugzilla's: OS's All AIX Windows 95 Windows 98 Windows
Lines 714-721 Link Here
714
716
715
			// Get OS Lookup Map
717
			// Get OS Lookup Map
716
			// Check that the result is in Values, if it is not, set it to other
718
			// Check that the result is in Values, if it is not, set it to other
717
			Attribute opSysAttribute = newBugModel.getAttribute(BugReport.ATTRIBUTE_OS);
719
			Attribute opSysAttribute = newBugModel.getAttribute(BugReportElement.OP_SYS.toString());
718
			Attribute platformAttribute = newBugModel.getAttribute(BugReport.ATTRIBUTE_PLATFORM);
720
			Attribute platformAttribute = newBugModel.getAttribute(BugReportElement.REP_PLATFORM.toString());
719
721
720
			String OS = Platform.getOS();
722
			String OS = Platform.getOS();
721
			String platform = Platform.getOSArch();
723
			String platform = Platform.getOSArch();
Lines 723-729 Link Here
723
			String bugzillaOS = null; // Bugzilla String for OS
725
			String bugzillaOS = null; // Bugzilla String for OS
724
			String bugzillaPlatform = null; // Bugzilla String for Platform
726
			String bugzillaPlatform = null; // Bugzilla String for Platform
725
727
726
			if (java2buzillaOSMap != null && java2buzillaOSMap.containsKey(OS) && opSysAttribute != null && opSysAttribute.getOptionValues() != null) {
728
			if (java2buzillaOSMap != null && java2buzillaOSMap.containsKey(OS) && opSysAttribute != null
729
					&& opSysAttribute.getOptionValues() != null) {
727
				bugzillaOS = java2buzillaOSMap.get(OS);
730
				bugzillaOS = java2buzillaOSMap.get(OS);
728
				if (opSysAttribute != null && !opSysAttribute.getOptionValues().values().contains(bugzillaOS)) {
731
				if (opSysAttribute != null && !opSysAttribute.getOptionValues().values().contains(bugzillaOS)) {
729
					// If the OS we found is not in the list of available
732
					// If the OS we found is not in the list of available
Lines 739-746 Link Here
739
742
740
			if (platform != null && java2buzillaPlatformMap.containsKey(platform)) {
743
			if (platform != null && java2buzillaPlatformMap.containsKey(platform)) {
741
				bugzillaPlatform = java2buzillaPlatformMap.get(platform);
744
				bugzillaPlatform = java2buzillaPlatformMap.get(platform);
742
				
745
743
				if (platformAttribute != null && !platformAttribute.getOptionValues().values().contains(bugzillaPlatform)) {
746
				if (platformAttribute != null
747
						&& !platformAttribute.getOptionValues().values().contains(bugzillaPlatform)) {
744
					// If the platform we found is not int the list of available
748
					// If the platform we found is not int the list of available
745
					// optinos, set the
749
					// optinos, set the
746
					// Bugzilla Platform to null, and juse use "other"
750
					// Bugzilla Platform to null, and juse use "other"
Lines 757-764 Link Here
757
				opSysAttribute.setValue(bugzillaOS);
761
				opSysAttribute.setValue(bugzillaOS);
758
			if (bugzillaPlatform != null && platformAttribute != null)
762
			if (bugzillaPlatform != null && platformAttribute != null)
759
				platformAttribute.setValue(bugzillaPlatform);
763
				platformAttribute.setValue(bugzillaPlatform);
764
760
		} catch (Exception e) {
765
		} catch (Exception e) {
761
			MylarStatusHandler.fail(e, "could not set platform options", false); 
766
			MylarStatusHandler.fail(e, "could not set platform options", false);
762
		}
767
		}
763
	}
768
	}
764
769
(-)src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java (-1 / +1 lines)
Lines 215-221 Link Here
215
//					BugzillaRepositoryUtil.setupNewBugAttributes(serverUrl, model, false);
215
//					BugzillaRepositoryUtil.setupNewBugAttributes(serverUrl, model, false);
216
//				} else {
216
//				} else {
217
				
217
				
218
					BugzillaRepositoryUtil.setupProdConfigAttributes(serverUrl, model);
218
					BugzillaRepositoryUtil.setupBugAttributes(serverUrl, model);
219
//				}
219
//				}
220
				model.setParsedAttributesStatus(true);
220
				model.setParsedAttributesStatus(true);
221
				if (prevProduct == null) {
221
				if (prevProduct == null) {

Return to bug 136219