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 (-98 / +149 lines)
Lines 22-31 Link Here
22
import java.net.URL;
22
import java.net.URL;
23
import java.net.URLConnection;
23
import java.net.URLConnection;
24
import java.net.URLEncoder;
24
import java.net.URLEncoder;
25
import java.security.KeyManagementException;
26
import java.security.NoSuchAlgorithmException;
27
import java.util.ArrayList;
25
import java.util.ArrayList;
28
import java.util.HashMap;
26
import java.util.HashMap;
27
import java.util.LinkedHashMap;
29
import java.util.List;
28
import java.util.List;
30
29
31
import javax.security.auth.login.LoginException;
30
import javax.security.auth.login.LoginException;
Lines 51-57 Link Here
51
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion;
50
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion;
52
import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
51
import org.eclipse.mylar.internal.bugzilla.core.internal.BugParser;
53
import org.eclipse.mylar.internal.bugzilla.core.internal.BugReportElement;
52
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.OfflineReportsFile;
53
import org.eclipse.mylar.internal.bugzilla.core.internal.OfflineReportsFile;
56
import org.eclipse.mylar.internal.bugzilla.core.internal.RepositoryConfiguration;
54
import org.eclipse.mylar.internal.bugzilla.core.internal.RepositoryConfiguration;
57
import org.eclipse.mylar.internal.bugzilla.core.internal.ServerConfigurationFactory;
55
import org.eclipse.mylar.internal.bugzilla.core.internal.ServerConfigurationFactory;
Lines 69-74 Link Here
69
 */
67
 */
70
public class BugzillaRepositoryUtil {
68
public class BugzillaRepositoryUtil {
71
69
70
	private static final String BUG_STATUS_NEW = "NEW";
71
72
	private static final String ATTACHMENT_DOWNLOAD_FAILED = "Attachment download FAILED.";
72
	private static final String ATTACHMENT_DOWNLOAD_FAILED = "Attachment download FAILED.";
73
	
73
	
74
	private static final String VALUE_CONTENTTYPEMETHOD_MANUAL = "manual";
74
	private static final String VALUE_CONTENTTYPEMETHOD_MANUAL = "manual";
Lines 229-336 Link Here
229
229
230
	}
230
	}
231
231
232
	/**
232
	// /**
233
	 * Get the attribute values for a new bug
233
	// * Get the attribute values for a new bug
234
	 * 
234
	// *
235
	 * @param nbm
235
	// * @param nbm
236
	 *            A reference to a NewBugModel to store all of the data
236
	// * A reference to a NewBugModel to store all of the data
237
	 * @throws Exception
237
	// * @throws Exception
238
	 */
238
	// */
239
	public static void setupNewBugAttributes(String serverUrl, NewBugModel nbm, boolean getProd) throws Exception {
239
	// public static void setupNewBugAttributes(String serverUrl, NewBugModel
240
		BufferedReader in = null;
240
	// nbm, boolean getProd) throws Exception {
241
		try {
241
	// BufferedReader in = null;
242
			// create a new input stream for getting the bug
242
	// try {
243
			String prodname = URLEncoder.encode(nbm.getProduct(), BugzillaPlugin.ENCODING_UTF_8);
243
	// // create a new input stream for getting the bug
244
244
	// String prodname = URLEncoder.encode(nbm.getProduct(),
245
			TaskRepository repository = MylarTaskListPlugin.getRepositoryManager().getRepository(
245
	// BugzillaPlugin.ENCODING_UTF_8);
246
					BugzillaPlugin.REPOSITORY_KIND, serverUrl);
246
	//
247
247
	// TaskRepository repository =
248
			if (repository == null) {
248
	// MylarTaskListPlugin.getRepositoryManager().getRepository(
249
				throw new LoginException("Repository configuration error.");
249
	// BugzillaPlugin.REPOSITORY_KIND, serverUrl);
250
			}
250
	//
251
			if (repository.getUserName() == null || repository.getUserName().trim().equals("")
251
	// if (repository == null) {
252
					|| repository.getPassword() == null) {
252
	// throw new LoginException("Repository configuration error.");
253
				throw new LoginException("Login credentials missing.");
253
	// }
254
			}
254
	// if (repository.getUserName() == null ||
255
255
	// repository.getUserName().trim().equals("")
256
			String url = repository.getUrl() + "/enter_bug.cgi";
256
	// || repository.getPassword() == null) {
257
257
	// throw new LoginException("Login credentials missing.");
258
			// use the proper url if we dont know the product yet
258
	// }
259
			if (!getProd)
259
	//
260
				url += "?product=" + prodname + "&";
260
	// String url = repository.getUrl() + "/enter_bug.cgi";
261
			else
261
	//
262
				url += "?";
262
	// // use the proper url if we dont know the product yet
263
263
	// if (!getProd)
264
			url += POST_ARGS_LOGIN + URLEncoder.encode(repository.getUserName(), BugzillaPlugin.ENCODING_UTF_8)
264
	// url += "?product=" + prodname + "&";
265
					+ POST_ARGS_PASSWORD + URLEncoder.encode(repository.getPassword(), BugzillaPlugin.ENCODING_UTF_8);
265
	// else
266
266
	// url += "?";
267
			URL bugUrl = new URL(url);
267
	//
268
			URLConnection cntx = BugzillaPlugin.getDefault().getUrlConnection(bugUrl);
268
	// url += POST_ARGS_LOGIN + URLEncoder.encode(repository.getUserName(),
269
			if (cntx != null) {
269
	// BugzillaPlugin.ENCODING_UTF_8)
270
				InputStream input = cntx.getInputStream();
270
	// + POST_ARGS_PASSWORD + URLEncoder.encode(repository.getPassword(),
271
				if (input != null) {
271
	// BugzillaPlugin.ENCODING_UTF_8);
272
					in = new BufferedReader(new InputStreamReader(input));
272
	//
273
273
	// URL bugUrl = new URL(url);
274
					new NewBugParser(in).parseBugAttributes(nbm, getProd);
274
	// URLConnection cntx =
275
				}
275
	// BugzillaPlugin.getDefault().getUrlConnection(bugUrl);
276
			}
276
	// if (cntx != null) {
277
277
	// InputStream input = cntx.getInputStream();
278
		} catch (Exception e) {
278
	// if (input != null) {
279
279
	// in = new BufferedReader(new InputStreamReader(input));
280
			if (e instanceof KeyManagementException || e instanceof NoSuchAlgorithmException
280
	//
281
					|| e instanceof IOException) {
281
	// new NewBugParser(in).parseBugAttributes(nbm, getProd);
282
				if (MessageDialog.openQuestion(null, "Bugzilla Connect Error",
282
	// }
283
						"Unable to connect to Bugzilla server.\n"
283
	// }
284
								+ "Bug report will be created offline and saved for submission later.")) {
284
	//
285
					nbm.setConnected(false);
285
	// } catch (Exception e) {
286
					setupBugAttributes(serverUrl, nbm);
286
	//
287
				} else
287
	// if (e instanceof KeyManagementException || e instanceof
288
					throw new Exception("Bug report will not be created.");
288
	// NoSuchAlgorithmException
289
			} else
289
	// || e instanceof IOException) {
290
				throw e;
290
	// if (MessageDialog.openQuestion(null, "Bugzilla Connect Error",
291
		} finally {
291
	// "Unable to connect to Bugzilla server.\n"
292
			try {
292
	// + "Bug report will be created offline and saved for submission later."))
293
				if (in != null)
293
	// {
294
					in.close();
294
	// nbm.setConnected(false);
295
			} catch (IOException e) {
295
	// setupBugAttributes(serverUrl, nbm);
296
				BugzillaPlugin.log(new Status(IStatus.ERROR, IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
296
	// } else
297
						"Problem closing the stream", e));
297
	// throw new Exception("Bug report will not be created.");
298
			}
298
	// } else
299
		}
299
	// throw e;
300
	}
300
	// } finally {
301
	// try {
302
	// if (in != null)
303
	// in.close();
304
	// } catch (IOException e) {
305
	// BugzillaPlugin.log(new Status(IStatus.ERROR,
306
	// IBugzillaConstants.PLUGIN_ID, IStatus.ERROR,
307
	//						"Problem closing the stream", e));
308
	//			}
309
	//		}
310
	//	}
301
311
302
	/**
312
	/**
303
	 * Adds bug attributes to new bug model and sets defaults
313
	 * Adds bug attributes to new bug model and sets defaults
304
	 */
314
	 */
305
	public static void setupBugAttributes(String serverUrl, NewBugModel model) {
315
	public static void setupBugAttributes(String serverUrl, NewBugModel model) {
306
316
307
		HashMap<String, Attribute> attributes = new HashMap<String, Attribute>();
317
//		// order is important
308
318
//		BugReportElement[] newBugElements = { BugReportElement.PRODUCT,
309
		Attribute a = new Attribute(BugReportElement.BUG_SEVERITY.toString());
319
//				BugReportElement.BUG_STATUS,
310
		a.setParameterName(BugReportElement.BUG_SEVERITY.getKeyString());
320
//				BugReportElement.VERSION,				
311
		List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities();
321
//				BugReportElement.COMPONENT,
312
		for (String option : optionValues) {
322
//				BugReportElement.TARGET_MILESTONE,
313
			a.addOptionValue(option, option);
323
//				BugReportElement.REP_PLATFORM,				
314
		}
324
//				BugReportElement.OP_SYS,
315
		a.setValue(optionValues.get((optionValues.size() / 2)));
325
//				BugReportElement.PRIORITY,
316
		attributes.put(a.getName(), a);
326
//				BugReportElement.BUG_SEVERITY,
327
//				BugReportElement.ASSIGNED_TO,
328
//// NOT USED	BugReportElement.CC,
329
//				BugReportElement.BUG_FILE_LOC,
330
// //NOT USED		BugReportElement.SHORT_DESC,
331
// //NOT USED		BugReportElement.LONG_DESC
332
//		};
333
334
				
335
		
336
		
337
		HashMap<String, Attribute> attributes = new LinkedHashMap<String, Attribute>();
317
338
318
		a = new Attribute(BugReportElement.OP_SYS.toString());
339
		Attribute a = new Attribute(BugReportElement.PRODUCT.toString());
319
		a.setParameterName(BugReportElement.OP_SYS.getKeyString());
340
		a.setParameterName(BugReportElement.PRODUCT.getKeyString());
320
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs();
341
		List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getProducts();
321
		for (String option : optionValues) {
342
		for (String option : optionValues) {
322
			a.addOptionValue(option, option);
343
			a.addOptionValue(option, option);
323
		}
344
		}
345
		a.setValue(model.getProduct());
324
		attributes.put(a.getName(), a);
346
		attributes.put(a.getName(), a);
325
347
		
326
		a = new Attribute(BugReportElement.REP_PLATFORM.toString());
348
		
327
		a.setParameterName(BugReportElement.REP_PLATFORM.getKeyString());
349
		a = new Attribute(BugReportElement.BUG_STATUS.toString());
328
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms();
350
		a.setParameterName(BugReportElement.BUG_STATUS.getKeyString());
351
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getStatusValues();
329
		for (String option : optionValues) {
352
		for (String option : optionValues) {
330
			a.addOptionValue(option, option);
353
			a.addOptionValue(option, option);
331
		}
354
		}
355
		a.setValue(BUG_STATUS_NEW);
332
		attributes.put(a.getName(), a);
356
		attributes.put(a.getName(), a);
333
357
		
334
		a = new Attribute(BugReportElement.VERSION.toString());
358
		a = new Attribute(BugReportElement.VERSION.toString());
335
		a.setParameterName(BugReportElement.VERSION.getKeyString());
359
		a.setParameterName(BugReportElement.VERSION.getKeyString());
336
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct());
360
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct());
Lines 339-345 Link Here
339
		}
363
		}
340
		a.setValue(optionValues.get(optionValues.size() - 1));
364
		a.setValue(optionValues.get(optionValues.size() - 1));
341
		attributes.put(a.getName(), a);
365
		attributes.put(a.getName(), a);
342
366
		
343
		a = new Attribute(BugReportElement.COMPONENT.toString());
367
		a = new Attribute(BugReportElement.COMPONENT.toString());
344
		a.setParameterName(BugReportElement.COMPONENT.getKeyString());
368
		a.setParameterName(BugReportElement.COMPONENT.getKeyString());
345
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct());
369
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct());
Lines 347-352 Link Here
347
			a.addOptionValue(option, option);
371
			a.addOptionValue(option, option);
348
		}
372
		}
349
		attributes.put(a.getName(), a);
373
		attributes.put(a.getName(), a);
374
		
375
		a = new Attribute(BugReportElement.REP_PLATFORM.toString());
376
		a.setParameterName(BugReportElement.REP_PLATFORM.getKeyString());
377
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms();
378
		for (String option : optionValues) {
379
			a.addOptionValue(option, option);
380
		}
381
		attributes.put(a.getName(), a);
382
383
		a = new Attribute(BugReportElement.OP_SYS.toString());
384
		a.setParameterName(BugReportElement.OP_SYS.getKeyString());
385
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs();
386
		for (String option : optionValues) {
387
			a.addOptionValue(option, option);
388
		}
389
		attributes.put(a.getName(), a);
350
390
351
		a = new Attribute(BugReportElement.PRIORITY.toString());
391
		a = new Attribute(BugReportElement.PRIORITY.toString());
352
		a.setParameterName(BugReportElement.PRIORITY.getKeyString());
392
		a.setParameterName(BugReportElement.PRIORITY.getKeyString());
Lines 357-378 Link Here
357
		a.setValue(optionValues.get((optionValues.size() / 2)));
397
		a.setValue(optionValues.get((optionValues.size() / 2)));
358
		attributes.put(a.getName(), a);
398
		attributes.put(a.getName(), a);
359
399
360
		a = new Attribute(BugReportElement.PRODUCT.toString());
400
		a = new Attribute(BugReportElement.BUG_SEVERITY.toString());
361
		a.setParameterName(BugReportElement.PRODUCT.getKeyString());
401
		a.setParameterName(BugReportElement.BUG_SEVERITY.getKeyString());
362
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getProducts();
402
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities();
363
		for (String option : optionValues) {
403
		for (String option : optionValues) {
364
			a.addOptionValue(option, option);
404
			a.addOptionValue(option, option);
365
		}
405
		}
406
		a.setValue(optionValues.get((optionValues.size() / 2)));
366
		attributes.put(a.getName(), a);
407
		attributes.put(a.getName(), a);
367
408
		
368
		a = new Attribute(BugReportElement.BUG_STATUS.toString());
409
		a = new Attribute(BugReportElement.TARGET_MILESTONE.toString());
369
		a.setParameterName(BugReportElement.BUG_STATUS.getKeyString());
410
		a.setParameterName(BugReportElement.TARGET_MILESTONE.getKeyString());
370
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getStatusValues();
411
		optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getTargetMilestones(model.getProduct());
371
		for (String option : optionValues) {
412
		for (String option : optionValues) {
372
			a.addOptionValue(option, option);
413
			a.addOptionValue(option, option);
373
		}
414
		}
374
		attributes.put(a.getName(), a);
415
		attributes.put(a.getName(), a);
375
416
417
		a = new Attribute(BugReportElement.ASSIGNED_TO.toString());
418
		a.setParameterName(BugReportElement.ASSIGNED_TO.getKeyString());
419
		a.setValue("");
420
		attributes.put(a.getName(), a);
421
		
422
		a = new Attribute(BugReportElement.BUG_FILE_LOC.toString());
423
		a.setParameterName(BugReportElement.BUG_FILE_LOC.getKeyString());
424
		a.setValue("http://");
425
		attributes.put(a.getName(), a);
426
		
376
		model.attributes = attributes;
427
		model.attributes = attributes;
377
	}
428
	}
378
429
(-)src/org/eclipse/mylar/internal/bugzilla/core/NewBugModel.java (-2 / +3 lines)
Lines 13-21 Link Here
13
import java.io.Serializable;
13
import java.io.Serializable;
14
import java.util.ArrayList;
14
import java.util.ArrayList;
15
import java.util.Date;
15
import java.util.Date;
16
import java.util.HashMap;
17
import java.util.Iterator;
16
import java.util.Iterator;
17
import java.util.LinkedHashMap;
18
import java.util.List;
18
import java.util.List;
19
import java.util.Map;
19
20
20
import org.eclipse.mylar.bugzilla.core.Attribute;
21
import org.eclipse.mylar.bugzilla.core.Attribute;
21
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
22
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
Lines 44-50 Link Here
44
	protected String product;
45
	protected String product;
45
46
46
	/** A list of the attributes that can be changed for the new bug */
47
	/** A list of the attributes that can be changed for the new bug */
47
	public HashMap<String, Attribute> attributes = new HashMap<String, Attribute>();
48
	public Map<String, Attribute> attributes = new LinkedHashMap<String, Attribute>();
48
49
49
	/** The summary for the bug */
50
	/** The summary for the bug */
50
	protected String summary = "";
51
	protected String summary = "";
(-)src/org/eclipse/mylar/internal/bugzilla/core/BugzillaReportSubmitForm.java (-124 / +140 lines)
Lines 34-42 Link Here
34
import org.eclipse.core.runtime.Status;
34
import org.eclipse.core.runtime.Status;
35
import org.eclipse.mylar.bugzilla.core.Attribute;
35
import org.eclipse.mylar.bugzilla.core.Attribute;
36
import org.eclipse.mylar.bugzilla.core.BugReport;
36
import org.eclipse.mylar.bugzilla.core.BugReport;
37
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
38
import org.eclipse.mylar.bugzilla.core.Operation;
37
import org.eclipse.mylar.bugzilla.core.Operation;
39
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion;
38
import org.eclipse.mylar.internal.bugzilla.core.IBugzillaConstants.BugzillaServerVersion;
39
import org.eclipse.mylar.internal.bugzilla.core.internal.BugReportElement;
40
import org.eclipse.mylar.internal.bugzilla.core.internal.HtmlStreamTokenizer;
40
import org.eclipse.mylar.internal.bugzilla.core.internal.HtmlStreamTokenizer;
41
import org.eclipse.mylar.internal.bugzilla.core.internal.HtmlTag;
41
import org.eclipse.mylar.internal.bugzilla.core.internal.HtmlTag;
42
import org.eclipse.mylar.internal.bugzilla.core.internal.HtmlStreamTokenizer.Token;
42
import org.eclipse.mylar.internal.bugzilla.core.internal.HtmlStreamTokenizer.Token;
Lines 47-60 Link Here
47
 * 
47
 * 
48
 * @author Shawn Minto
48
 * @author Shawn Minto
49
 * @author Mik Kersten (hardening of prototype)
49
 * @author Mik Kersten (hardening of prototype)
50
 * @author Rob Elves
50
 * 
51
 * 
51
 * Class to handle the positing of a bug
52
 * Class to handle the positing of a bug
52
 */
53
 */
53
public class BugzillaReportSubmitForm {
54
public class BugzillaReportSubmitForm {
54
55
55
	private static final String KEY_BUG_FILE_LOC = "bug_file_loc";
56
	// private static final String KEY_BUG_FILE_LOC = "bug_file_loc";
56
57
57
	private static final String KEY_PRODUCT = "product";
58
	// private static final String KEY_PRODUCT = "product";
58
59
59
	private static final String VAL_TRUE = "true";
60
	private static final String VAL_TRUE = "true";
60
61
Lines 96-116 Link Here
96
97
97
	private static final String KEY_ASSIGNED_TO = "Assigned To";
98
	private static final String KEY_ASSIGNED_TO = "Assigned To";
98
99
99
	private static final String KEY_ASSIGN_TO = "Assign To";
100
	// private static final String KEY_ASSIGN_TO = "Assign To";
100
101
	//
101
	private static final String KEY_URL = "URL";
102
	// private static final String KEY_URL = "URL";
102
103
	//
103
	private static final String KEY_PRIORITY = "Priority";
104
	// private static final String KEY_PRIORITY = "Priority";
104
105
	//
105
	private static final String KEY_COMPONENT = "Component";
106
	// private static final String KEY_COMPONENT = "Component";
106
107
	//
107
	private static final String KEY_PLATFORM = "Platform";
108
	// private static final String KEY_PLATFORM = "Platform";
108
109
	//
109
	private static final String KEY_SEVERITY = "Severity";
110
	// private static final String KEY_SEVERITY = "Severity";
110
111
	//
111
	private static final String KEY_VERSION = "Version";
112
	// private static final String KEY_VERSION = "Version";
112
113
	//
113
	private static final String KEY_OS = "OS";
114
	// private static final String KEY_OS = "OS";
114
115
115
	public static final String FORM_POSTFIX_218 = " Submitted";
116
	public static final String FORM_POSTFIX_218 = " Submitted";
116
117
Lines 140-208 Link Here
140
141
141
	private String error = null;
142
	private String error = null;
142
143
143
	/**
144
	// /**
144
	 * TODO: get rid of this?
145
	// * TODO: get rid of this?
145
	 */
146
	// */
146
	public static BugzillaReportSubmitForm makeNewBugPost(TaskRepository repository, IBugzillaBug bug) {
147
	// public static BugzillaReportSubmitForm makeNewBugPost(TaskRepository
147
		BugzillaReportSubmitForm bugzillaReportSubmitForm = new BugzillaReportSubmitForm();
148
	// repository, IBugzillaBug bug) {
148
		bugzillaReportSubmitForm.setPrefix(BugzillaReportSubmitForm.FORM_PREFIX_BUG_218);
149
	// BugzillaReportSubmitForm bugzillaReportSubmitForm = new
149
		bugzillaReportSubmitForm.setPrefix2(BugzillaReportSubmitForm.FORM_PREFIX_BUG_220);
150
	// BugzillaReportSubmitForm();
150
151
	// bugzillaReportSubmitForm.setPrefix(BugzillaReportSubmitForm.FORM_PREFIX_BUG_218);
151
		bugzillaReportSubmitForm.setPostfix(BugzillaReportSubmitForm.FORM_POSTFIX_216);
152
	// bugzillaReportSubmitForm.setPrefix2(BugzillaReportSubmitForm.FORM_PREFIX_BUG_220);
152
		bugzillaReportSubmitForm.setPostfix2(BugzillaReportSubmitForm.FORM_POSTFIX_218);
153
	//
153
154
	// bugzillaReportSubmitForm.setPostfix(BugzillaReportSubmitForm.FORM_POSTFIX_216);
154
		// go through all of the attributes and add them to the bug post
155
	// bugzillaReportSubmitForm.setPostfix2(BugzillaReportSubmitForm.FORM_POSTFIX_218);
155
		Iterator<Attribute> itr = bug.getAttributes().iterator();
156
	//
156
		while (itr.hasNext()) {
157
	// // go through all of the attributes and add them to the bug post
157
			Attribute a = itr.next();
158
	// Iterator<Attribute> itr = bug.getAttributes().iterator();
158
			if (a != null && a.getParameterName() != null && a.getParameterName().compareTo("") != 0 && !a.isHidden()) {
159
	// while (itr.hasNext()) {
159
				String key = a.getName();
160
	// Attribute a = itr.next();
160
				String value = null;
161
	// if (a != null && a.getParameterName() != null &&
161
162
	// a.getParameterName().compareTo("") != 0 && !a.isHidden()) {
162
				// get the values from the attribute
163
	// String key = a.getName();
163
				if (key.equalsIgnoreCase(KEY_OS)) {
164
	// String value = null;
164
					value = a.getValue();
165
	//
165
				} else if (key.equalsIgnoreCase(KEY_VERSION)) {
166
	// // get the values from the attribute
166
					value = a.getValue();
167
	// if (key.equalsIgnoreCase(KEY_OS)) {
167
				} else if (key.equalsIgnoreCase(KEY_SEVERITY)) {
168
	// value = a.getValue();
168
					value = a.getValue();
169
	// } else if (key.equalsIgnoreCase(KEY_VERSION)) {
169
				} else if (key.equalsIgnoreCase(KEY_PLATFORM)) {
170
	// value = a.getValue();
170
					value = a.getValue();
171
	// } else if (key.equalsIgnoreCase(KEY_SEVERITY)) {
171
				} else if (key.equalsIgnoreCase(KEY_COMPONENT)) {
172
	// value = a.getValue();
172
					value = a.getValue();
173
	// } else if (key.equalsIgnoreCase(KEY_PLATFORM)) {
173
				} else if (key.equalsIgnoreCase(KEY_PRIORITY)) {
174
	// value = a.getValue();
174
					value = a.getValue();
175
	// } else if (key.equalsIgnoreCase(KEY_COMPONENT)) {
175
				} else if (key.equalsIgnoreCase(KEY_URL)) {
176
	// value = a.getValue();
176
					value = a.getValue();
177
	// } else if (key.equalsIgnoreCase(KEY_PRIORITY)) {
177
				} else if (key.equalsIgnoreCase(KEY_ASSIGN_TO) || key.equalsIgnoreCase(KEY_ASSIGNED_TO)) {
178
	// value = a.getValue();
178
					value = a.getValue();
179
	// } else if (key.equalsIgnoreCase(KEY_URL)) {
179
				}
180
	// value = a.getValue();
180
181
	// } else if (key.equalsIgnoreCase(KEY_ASSIGN_TO) ||
181
				// add the attribute to the bug post
182
	// key.equalsIgnoreCase(KEY_ASSIGNED_TO)) {
182
				if (value == null)
183
	// value = a.getValue();
183
					value = "";
184
	// }
184
185
	//
185
				bugzillaReportSubmitForm.add(a.getParameterName(), value);
186
	// // add the attribute to the bug post
186
			} else if (a != null && a.getParameterName() != null && a.getParameterName().compareTo("") != 0
187
	// if (value == null)
187
					&& a.isHidden()) {
188
	// value = "";
188
				// we have a hidden attribute, add it to the posting
189
	//
189
				bugzillaReportSubmitForm.add(a.getParameterName(), a.getValue());
190
	// bugzillaReportSubmitForm.add(a.getParameterName(), value);
190
191
	// } else if (a != null && a.getParameterName() != null &&
191
			}
192
	// a.getParameterName().compareTo("") != 0
192
		}
193
	// && a.isHidden()) {
193
194
	// // we have a hidden attribute, add it to the posting
194
		setURL(bugzillaReportSubmitForm, repository, POST_BUG_CGI);
195
	// bugzillaReportSubmitForm.add(a.getParameterName(), a.getValue());
195
196
	//
196
		// add the summary to the bug post
197
	// }
197
		bugzillaReportSubmitForm.add(KEY_SHORT_DESC, bug.getSummary());
198
	// }
198
		bug.setDescription(formatTextToLineWrap(bug.getDescription(), repository));
199
	//
199
		if (bug.getDescription().length() != 0) {
200
	// setURL(bugzillaReportSubmitForm, repository, POST_BUG_CGI);
200
			bugzillaReportSubmitForm.add(KEY_COMMENT, bug.getDescription());
201
	//
201
		}
202
	// // add the summary to the bug post
202
		return bugzillaReportSubmitForm;
203
	// bugzillaReportSubmitForm.add(KEY_SHORT_DESC, bug.getSummary());
203
	}
204
	// bug.setDescription(formatTextToLineWrap(bug.getDescription(),
205
	// repository));
206
	// if (bug.getDescription().length() != 0) {
207
	// bugzillaReportSubmitForm.add(KEY_COMMENT, bug.getDescription());
208
	// }
209
	// return bugzillaReportSubmitForm;
210
	// }
204
211
205
	public static BugzillaReportSubmitForm makeNewBugPost2(TaskRepository repository, NewBugModel model) {
212
	public static BugzillaReportSubmitForm makeNewBugPost(TaskRepository repository, NewBugModel model) {
206
		BugzillaReportSubmitForm form = new BugzillaReportSubmitForm();
213
		BugzillaReportSubmitForm form = new BugzillaReportSubmitForm();
207
		form.setPrefix(BugzillaReportSubmitForm.FORM_PREFIX_BUG_218);
214
		form.setPrefix(BugzillaReportSubmitForm.FORM_PREFIX_BUG_218);
208
		form.setPrefix2(BugzillaReportSubmitForm.FORM_PREFIX_BUG_220);
215
		form.setPrefix2(BugzillaReportSubmitForm.FORM_PREFIX_BUG_220);
Lines 217-275 Link Here
217
		while (itr.hasNext()) {
224
		while (itr.hasNext()) {
218
			Attribute a = itr.next();
225
			Attribute a = itr.next();
219
			if (a != null && a.getParameterName() != null && a.getParameterName().compareTo("") != 0 && !a.isHidden()) {
226
			if (a != null && a.getParameterName() != null && a.getParameterName().compareTo("") != 0 && !a.isHidden()) {
220
				String key = a.getName();
227
				// String key = a.getName();
221
				String value = null;
228
				String value = null;
222
229
223
				// get the values from the attribute
230
				// // get the values from the attribute
224
				if (key.equalsIgnoreCase("OS")) {
231
				// if (key.equalsIgnoreCase("OS")) {
225
					value = a.getValue();
232
				// value = a.getValue();
226
				} else if (key.equalsIgnoreCase("Version")) {
233
				// } else if (key.equalsIgnoreCase("Version")) {
227
					value = a.getValue();
234
				// value = a.getValue();
228
				} else if (key.equalsIgnoreCase("Severity")) {
235
				// } else if (key.equalsIgnoreCase("Severity")) {
229
					value = a.getValue();
236
				// value = a.getValue();
230
				} else if (key.equalsIgnoreCase("Platform")) {
237
				// } else if (key.equalsIgnoreCase("Platform")) {
231
					value = a.getValue();
238
				// value = a.getValue();
232
				} else if (key.equalsIgnoreCase("Component")) {
239
				// } else if (key.equalsIgnoreCase("Component")) {
233
					value = a.getValue();
240
				// value = a.getValue();
234
				} else if (key.equalsIgnoreCase("Priority")) {
241
				// } else if (key.equalsIgnoreCase("Priority")) {
235
					value = a.getValue();
242
				// value = a.getValue();
236
				} else if (key.equalsIgnoreCase("Target Milestone")) {
243
				// } else if (key.equalsIgnoreCase("Target Milestone")) {
237
					value = a.getValue();
244
				// value = a.getValue();
238
				} else if (key.equalsIgnoreCase("URL")) {
245
				// } else if (key.equalsIgnoreCase("URL")) {
239
					value = a.getValue();
246
				// value = a.getValue();
240
				} else if (key.equalsIgnoreCase("Assign To") || key.equalsIgnoreCase("Assigned To")) {
247
				// } else if (key.equalsIgnoreCase("Assign To") ||
241
					value = a.getValue();
248
				// key.equalsIgnoreCase("Assigned To")) {
242
				}
249
				// value = a.getValue();
243
250
				// }
244
				// add the attribute to the bug post
251
				//
252
				// // add the attribute to the bug post
253
				// if (value == null)
254
				// value = "";
255
				//
256
				// form.add(a.getParameterName(), value);
257
				// } else if (a != null && a.getParameterName() != null &&
258
				// a.getParameterName().compareTo("") != 0
259
				// && a.isHidden()) {
260
				// // we have a hidden attribute, add it to the
261
				// // posting
262
				value = a.getValue();				
245
				if (value == null)
263
				if (value == null)
246
					value = "";
264
					continue;
247
248
				form.add(a.getParameterName(), value);
265
				form.add(a.getParameterName(), value);
249
			} else if (a != null && a.getParameterName() != null && a.getParameterName().compareTo("") != 0
250
					&& a.isHidden()) {
251
				// we have a hidden attribute, add it to the
252
				// posting
253
				form.add(a.getParameterName(), a.getValue());
254
			}
266
			}
255
		}
267
		}
256
268
257
		form.add(KEY_BUG_FILE_LOC, "");
269
		// form.add(KEY_BUG_FILE_LOC, "");
258
		
270
259
		// specify the product
271
		// specify the product
260
		form.add(KEY_PRODUCT, model.getProduct());
272
		form.add(BugReportElement.PRODUCT.getKeyString(), model.getProduct());
261
273
262
		// add the summary to the bug post
274
		// add the summary to the bug post
263
		form.add("short_desc", model.getSummary());
275
		form.add(BugReportElement.SHORT_DESC.getKeyString(), model.getSummary());
264
276
265
		BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository
277
		// BugzillaServerVersion bugzillaServerVersion =
266
				.getVersion());
278
		// IBugzillaConstants.BugzillaServerVersion.fromString(repository
267
		if (bugzillaServerVersion != null && bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) {
279
		// .getVersion());
268
			// if
280
		// if (bugzillaServerVersion != null &&
269
			// (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString()))
281
		// bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >=
270
			// {
282
		// 0) {
271
			form.add("bug_status", "NEW");
283
		// // if
272
		}
284
		// //
285
		// (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString()))
286
		// // {
287
		// form.add("bug_status", "NEW");
288
		// }
273
289
274
		String formattedDescription = formatTextToLineWrap(model.getDescription(), repository);
290
		String formattedDescription = formatTextToLineWrap(model.getDescription(), repository);
275
		model.setDescription(formattedDescription);
291
		model.setDescription(formattedDescription);
Lines 278-284 Link Here
278
			// add the new comment to the bug post if there
294
			// add the new comment to the bug post if there
279
			// is some text in
295
			// is some text in
280
			// it
296
			// it
281
			form.add("comment", model.getDescription());
297
			form.add(KEY_COMMENT, model.getDescription());
282
		}
298
		}
283
		return form;
299
		return form;
284
	}
300
	}
Lines 442-448 Link Here
442
			// while(aString != null) {
458
			// while(aString != null) {
443
			// System.err.println(aString);
459
			// System.err.println(aString);
444
			// aString = in.readLine();
460
			// aString = in.readLine();
445
			//			 }
461
			// }
446
462
447
			boolean possibleFailure = true;
463
			boolean possibleFailure = true;
448
			error = "";
464
			error = "";
(-)src/org/eclipse/mylar/internal/bugzilla/core/internal/BugReportElement.java (+1 lines)
Lines 55-60 Link Here
55
	FILENAME ("filename", "filename"), 
55
	FILENAME ("filename", "filename"), 
56
	TYPE ("type", "type"), 
56
	TYPE ("type", "type"), 
57
	DATA ("data", "data"),
57
	DATA ("data", "data"),
58
	BUG_FILE_LOC ("URL", "bug_file_loc"),
58
	UNKNOWN ("UNKNOWN", "UNKNOWN");
59
	UNKNOWN ("UNKNOWN", "UNKNOWN");
59
	
60
	
60
	private final String prettyName;
61
	private final String prettyName;
(-)src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugWizard.java (-1 / +1 lines)
Lines 126-132 Link Here
126
			protected void execute(final IProgressMonitor monitor) throws CoreException {
126
			protected void execute(final IProgressMonitor monitor) throws CoreException {
127
				PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
127
				PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
128
					public void run() {
128
					public void run() {
129
						BugzillaReportSubmitForm form = BugzillaReportSubmitForm.makeNewBugPost2(repository, model);
129
						BugzillaReportSubmitForm form = BugzillaReportSubmitForm.makeNewBugPost(repository, model);
130
						try {
130
						try {
131
							id = form.submitReportToRepository();
131
							id = form.submitReportToRepository();
132
132
(-)src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugzillaWizardPage.java (-33 / +33 lines)
Lines 21-27 Link Here
21
import org.eclipse.jface.wizard.IWizardPage;
21
import org.eclipse.jface.wizard.IWizardPage;
22
import org.eclipse.jface.wizard.WizardPage;
22
import org.eclipse.jface.wizard.WizardPage;
23
import org.eclipse.mylar.bugzilla.core.Attribute;
23
import org.eclipse.mylar.bugzilla.core.Attribute;
24
import org.eclipse.mylar.bugzilla.core.BugReport;
25
import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
24
import org.eclipse.mylar.internal.bugzilla.core.NewBugModel;
26
import org.eclipse.mylar.internal.bugzilla.core.internal.BugReportElement;
25
import org.eclipse.mylar.internal.bugzilla.core.internal.BugReportElement;
27
import org.eclipse.mylar.internal.bugzilla.ui.editor.AbstractBugEditor;
26
import org.eclipse.mylar.internal.bugzilla.ui.editor.AbstractBugEditor;
Lines 51-58 Link Here
51
 */
50
 */
52
public abstract class AbstractBugzillaWizardPage extends WizardPage implements Listener {
51
public abstract class AbstractBugzillaWizardPage extends WizardPage implements Listener {
53
52
54
	private static final String KEY_OP_SYS = "op_sys";
55
56
	/** The instance of the workbench */
53
	/** The instance of the workbench */
57
	protected IWorkbench workbench;
54
	protected IWorkbench workbench;
58
55
Lines 321-353 Link Here
321
			try {
318
			try {
322
				if (values == null)
319
				if (values == null)
323
					values = new HashMap<String, String>();
320
					values = new HashMap<String, String>();
324
				if (key.equals(BugReport.ATTRIBUTE_OS)) {
321
				if (key.equals(BugReportElement.OP_SYS.toString())) {
325
					String os = oSCombo.getItem(oSCombo.getSelectionIndex());
322
					String os = oSCombo.getItem(oSCombo.getSelectionIndex());
326
					attribute.setValue(os);
323
					attribute.setValue(os);
327
				} else if (key.equals(BugReport.ATTRIBUTE_VERSION)) {
324
				} else if (key.equals(BugReportElement.VERSION.toString())) {
328
					String version = versionCombo.getItem(versionCombo.getSelectionIndex());
325
					String version = versionCombo.getItem(versionCombo.getSelectionIndex());
329
					attribute.setValue(version);
326
					attribute.setValue(version);
330
				} else if (key.equals(BugReport.ATTRIBUTE_SEVERITY)) {
327
				} else if (key.equals(BugReportElement.BUG_SEVERITY.toString())) {
331
					String severity = severityCombo.getItem(severityCombo.getSelectionIndex());
328
					String severity = severityCombo.getItem(severityCombo.getSelectionIndex());
332
					attribute.setValue(severity);
329
					attribute.setValue(severity);
333
				} else if (key.equals(BugReport.ATTRIBUTE_PLATFORM)) {
330
				} else if (key.equals(BugReportElement.REP_PLATFORM.toString())) {
334
					String platform = platformCombo.getItem(platformCombo.getSelectionIndex());
331
					String platform = platformCombo.getItem(platformCombo.getSelectionIndex());
335
					attribute.setValue(platform);
332
					attribute.setValue(platform);
336
				} else if (key.equals(BugReport.ATTRIBUTE_MILESTONE)) {
333
				} else if (key.equals(BugReportElement.TARGET_MILESTONE.toString())) {
337
					String milestone = milestoneCombo.getItem(milestoneCombo.getSelectionIndex());
334
					int index = milestoneCombo.getSelectionIndex();
338
					attribute.setValue(milestone);
335
					if(index >= 0) {
339
				} else if (key.equals(BugReport.ATTRIBUTE_COMPONENT)) {
336
						String milestone = milestoneCombo.getItem(milestoneCombo.getSelectionIndex());
337
						attribute.setValue(milestone);
338
					}
339
				} else if (key.equals(BugReportElement.COMPONENT.toString())) {
340
					String component = componentCombo.getItem(componentCombo.getSelectionIndex());
340
					String component = componentCombo.getItem(componentCombo.getSelectionIndex());
341
					attribute.setValue(component);
341
					attribute.setValue(component);
342
				} else if (key.equals(BugReport.ATTRIBUTE_PRIORITY)) {
342
				} else if (key.equals(BugReportElement.PRIORITY.toString())) {
343
					String priority = priorityCombo.getItem(priorityCombo.getSelectionIndex());
343
					String priority = priorityCombo.getItem(priorityCombo.getSelectionIndex());
344
					attribute.setValue(priority);
344
					attribute.setValue(priority);
345
				} else if (key.equals(BugReport.ATTRIBUTE_URL)) {
345
				} else if (key.equals(BugReportElement.BUG_FILE_LOC.toString())) {
346
					String url = urlText.getText();
346
					String url = urlText.getText();
347
					if (url.equalsIgnoreCase("http://"))
347
					if (url.equalsIgnoreCase("http://"))
348
						url = "";
348
						url = "";
349
					attribute.setValue(url);
349
					attribute.setValue(url);
350
				} else if (key.equals("Assign To")) {
350
				} else if (key.equals(BugReportElement.ASSIGNED_TO.toString())) {
351
					String assignTo = assignedToText.getText();
351
					String assignTo = assignedToText.getText();
352
					attribute.setValue(assignTo);
352
					attribute.setValue(assignTo);
353
				} else {
353
				} else {
Lines 436-442 Link Here
436
			data.horizontalIndent = HORZ_INDENT;
436
			data.horizontalIndent = HORZ_INDENT;
437
			data.widthHint = 150;
437
			data.widthHint = 150;
438
			// create and populate the combo fields for the attributes
438
			// create and populate the combo fields for the attributes
439
			if (key.equals(KEY_OP_SYS)) {
439
			if (key.equals(BugReportElement.OP_SYS.getKeyString())) {
440
				newLayout(attributesComposite, 1, name, PROPERTY);
440
				newLayout(attributesComposite, 1, name, PROPERTY);
441
				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);
442
442
Lines 451-457 Link Here
451
					index = 0;
451
					index = 0;
452
				oSCombo.select(index);
452
				oSCombo.select(index);
453
				oSCombo.addListener(SWT.Modify, this);
453
				oSCombo.addListener(SWT.Modify, this);
454
			} else if (key.equals("version")) {
454
			} else if (key.equals(BugReportElement.VERSION.getKeyString())) {
455
				newLayout(attributesComposite, 1, name, PROPERTY);
455
				newLayout(attributesComposite, 1, name, PROPERTY);
456
456
457
				versionCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
457
				versionCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
Lines 468-474 Link Here
468
					index = 0;
468
					index = 0;
469
				versionCombo.select(index);
469
				versionCombo.select(index);
470
				versionCombo.addListener(SWT.Modify, this);
470
				versionCombo.addListener(SWT.Modify, this);
471
			} else if (key.equals("bug_severity")) {
471
			} else if (key.equals(BugReportElement.BUG_SEVERITY.getKeyString())) {
472
				newLayout(attributesComposite, 1, name, PROPERTY);
472
				newLayout(attributesComposite, 1, name, PROPERTY);
473
				severityCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
473
				severityCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
474
						| SWT.READ_ONLY);
474
						| SWT.READ_ONLY);
Lines 485-491 Link Here
485
				severityCombo.select(index);
485
				severityCombo.select(index);
486
				severityCombo.addListener(SWT.Modify, this);
486
				severityCombo.addListener(SWT.Modify, this);
487
487
488
			} else if (key.equals("rep_platform")) {
488
			} else if (key.equals(BugReportElement.REP_PLATFORM.getKeyString())) {
489
				newLayout(attributesComposite, 1, name, PROPERTY);
489
				newLayout(attributesComposite, 1, name, PROPERTY);
490
				platformCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
490
				platformCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
491
						| SWT.READ_ONLY);
491
						| SWT.READ_ONLY);
Lines 501-507 Link Here
501
					index = 0;
501
					index = 0;
502
				platformCombo.select(index);
502
				platformCombo.select(index);
503
				platformCombo.addListener(SWT.Modify, this);
503
				platformCombo.addListener(SWT.Modify, this);
504
			} else if (key.equals(BugReport.KEY_MILESTONE)) {
504
			} else if (key.equals(BugReportElement.TARGET_MILESTONE.getKeyString())) {
505
				newLayout(attributesComposite, 1, name, PROPERTY);
505
				newLayout(attributesComposite, 1, name, PROPERTY);
506
				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
507
						| SWT.READ_ONLY);
507
						| SWT.READ_ONLY);
Lines 516-523 Link Here
516
					index = 0;
516
					index = 0;
517
				milestoneCombo.select(index);
517
				milestoneCombo.select(index);
518
				milestoneCombo.addListener(SWT.Modify, this);
518
				milestoneCombo.addListener(SWT.Modify, this);
519
				//if(s.isEmpty()) milestoneCombo.setEnabled(false);
519
				mileExist = true;
520
				mileExist = true;
520
			} else if (key.equals("component")) {
521
			} else if (key.equals(BugReportElement.COMPONENT.getKeyString())) {
521
				newLayout(attributesComposite, 1, name, PROPERTY);
522
				newLayout(attributesComposite, 1, name, PROPERTY);
522
				componentCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
523
				componentCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
523
						| SWT.READ_ONLY);
524
						| SWT.READ_ONLY);
Lines 533-539 Link Here
533
					index = 0;
534
					index = 0;
534
				componentCombo.select(index);
535
				componentCombo.select(index);
535
				componentCombo.addListener(SWT.Modify, this);
536
				componentCombo.addListener(SWT.Modify, this);
536
			} else if (key.equals("priority")) {
537
			} else if (key.equals(BugReportElement.PRIORITY.getKeyString())) {
537
				newLayout(attributesComposite, 1, name, PROPERTY);
538
				newLayout(attributesComposite, 1, name, PROPERTY);
538
				priorityCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
539
				priorityCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
539
						| SWT.READ_ONLY);
540
						| SWT.READ_ONLY);
Lines 550-556 Link Here
550
				priorityCombo.select(index);
551
				priorityCombo.select(index);
551
				priorityCombo.addListener(SWT.Modify, this);
552
				priorityCombo.addListener(SWT.Modify, this);
552
				priExist = true;
553
				priExist = true;
553
			} else if (key.equals("bug_file_loc")) {
554
			} else if (key.equals(BugReportElement.BUG_FILE_LOC.getKeyString())) {
554
				url = value;
555
				url = value;
555
			} else {
556
			} else {
556
				// do nothing if it isn't a standard value to change
557
				// do nothing if it isn't a standard value to change
Lines 569-592 Link Here
569
		textCompositeGD.grabExcessHorizontalSpace = true;
570
		textCompositeGD.grabExcessHorizontalSpace = true;
570
		textComposite.setLayoutData(textCompositeGD);
571
		textComposite.setLayoutData(textCompositeGD);
571
572
572
		GridData summaryTextData;
573
	
573
574
		GridData urlTextData;
574
		if (url != null) {
575
		if (url != null) {			
575
			// add the assigned to text field
576
			newLayout(textComposite, 1, BugReportElement.BUG_FILE_LOC.toString(), PROPERTY);
576
			newLayout(textComposite, 1, BugReport.ATTRIBUTE_URL, PROPERTY);
577
			urlText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
577
			urlText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
578
			summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
578
			urlTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
579
579
580
			summaryTextData.horizontalSpan = 2;
580
			urlTextData.horizontalSpan = 2;
581
			// summaryTextData.widthHint = 200;
581
			// summaryTextData.widthHint = 200;
582
			urlText.setLayoutData(summaryTextData);
582
			urlText.setLayoutData(urlTextData);
583
			urlText.setText(url);
583
			urlText.setText(url);
584
			urlText.addListener(SWT.FocusOut, this);
584
			urlText.addListener(SWT.FocusOut, this);
585
		}
585
		}
586
586
587
		newLayout(textComposite, 1, "Assigned To", PROPERTY);
587
		GridData summaryTextData;
588
		newLayout(textComposite, 1, BugReportElement.ASSIGNED_TO.toString(), PROPERTY);
588
		Label l = new Label(textComposite, SWT.NONE);
589
		Label l = new Label(textComposite, SWT.NONE);
589
		// l.setText(" ");
590
		l.setText("(if email is incorrect submit will not proceed)");
590
		l.setText("(if email is incorrect submit will not proceed)");
591
		summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
591
		summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
592
		summaryTextData.horizontalSpan = 1;
592
		summaryTextData.horizontalSpan = 1;
Lines 600-606 Link Here
600
		assignedToText.setText("");
600
		assignedToText.setText("");
601
601
602
		// add the summary text field
602
		// add the summary text field
603
		newLayout(textComposite, 1, "Summary", PROPERTY);
603
		newLayout(textComposite, 1, BugReportElement.SHORT_DESC.toString(), PROPERTY);
604
		summaryText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
604
		summaryText = new Text(textComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
605
		summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
605
		summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
606
606
(-)src/org/eclipse/mylar/bugzilla/tests/AllBugzillaTests.java (-6 / +6 lines)
Lines 20-26 Link Here
20
20
21
	public static Test suite() {
21
	public static Test suite() {
22
		TestSuite suite = new TestSuite("Test for org.eclipse.mylar.bugzilla.tests");
22
		TestSuite suite = new TestSuite("Test for org.eclipse.mylar.bugzilla.tests");
23
		// $JUnit-BEGIN$ 
23
		// $JUnit-BEGIN$
24
		suite.addTestSuite(BugzillaConfigurationTest.class);
24
		suite.addTestSuite(BugzillaConfigurationTest.class);
25
		suite.addTestSuite(BugzillaTaskHyperlinkDetectorTest.class);
25
		suite.addTestSuite(BugzillaTaskHyperlinkDetectorTest.class);
26
		suite.addTestSuite(ReportAttachmentTest.class);
26
		suite.addTestSuite(ReportAttachmentTest.class);
Lines 30-40 Link Here
30
		suite.addTestSuite(EncodingTest.class);
30
		suite.addTestSuite(EncodingTest.class);
31
		suite.addTestSuite(NewBugWizardTest.class);
31
		suite.addTestSuite(NewBugWizardTest.class);
32
		suite.addTestSuite(RegularExpressionMatchTest.class);
32
		suite.addTestSuite(RegularExpressionMatchTest.class);
33
		suite.addTestSuite(BugzillaNewBugParserTestCDT.class);
33
		// suite.addTestSuite(BugzillaNewBugParserTestCDT.class);
34
		suite.addTestSuite(BugzillaNewBugParserTestEquinox.class);
34
		// suite.addTestSuite(BugzillaNewBugParserTestEquinox.class);
35
		suite.addTestSuite(BugzillaNewBugParserTestGMT.class);
35
		// suite.addTestSuite(BugzillaNewBugParserTestGMT.class);
36
		suite.addTestSuite(BugzillaNewBugParserTestPlatform.class);
36
		// suite.addTestSuite(BugzillaNewBugParserTestPlatform.class);
37
		suite.addTestSuite(BugzillaNewBugParserTestVE.class);
37
		// suite.addTestSuite(BugzillaNewBugParserTestVE.class);
38
		suite.addTestSuite(BugzillaParserTestNoBug.class);
38
		suite.addTestSuite(BugzillaParserTestNoBug.class);
39
		suite.addTestSuite(BugzillaProductParserTest.class);
39
		suite.addTestSuite(BugzillaProductParserTest.class);
40
		// TODO: enable
40
		// TODO: enable

Return to bug 136219