Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2010-11-25 21:08:49 +0000
committerfbecker2010-11-25 21:08:49 +0000
commit27c93bf9056f8ba54c45f6ce2659eee533b61d27 (patch)
tree8a81dfe29dc6cd0f9a4bfe77ff8959ad0ad07b07 /org.eclipse.mylyn.bugzilla.core
parent1395fa251249e31a2f4e6a4978486b218f3a8872 (diff)
downloadorg.eclipse.mylyn.tasks-27c93bf9056f8ba54c45f6ce2659eee533b61d27.tar.gz
org.eclipse.mylyn.tasks-27c93bf9056f8ba54c45f6ce2659eee533b61d27.tar.xz
org.eclipse.mylyn.tasks-27c93bf9056f8ba54c45f6ce2659eee533b61d27.zip
ASSIGNED - bug 329164: Bugzilla 4.0 - New Default Status Workflow
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329164
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.core')
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java142
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaOperation.java12
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java11
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java5
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java4
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java166
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxConfigurationContentHandler.java8
7 files changed, 77 insertions, 271 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
index 2505c0545..4b76763c6 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaClient.java
@@ -226,7 +226,7 @@ public class BugzillaClient {
CustomTransitionManager validTransitions = new CustomTransitionManager();
String transitionsFileName = configParameters.get(IBugzillaConstants.BUGZILLA_DESCRIPTOR_FILE);
- if (transitionsFileName != null && !transitionsFileName.equals("")) { //$NON-NLS-1$
+ if (transitionsFileName != null && !transitionsFileName.equals("")) {
if (!validTransitions.parse(transitionsFileName)) {
throw new CoreException(new Status(IStatus.WARNING, BugzillaCorePlugin.ID_PLUGIN,
"Invalide Transition File Content")); //$NON-NLS-1$
@@ -452,8 +452,10 @@ public class BugzillaClient {
try {
BufferedReader in = new BufferedReader(new InputStreamReader(inputStream, getCharacterEncoding()));
HtmlStreamTokenizer tokenizer = new HtmlStreamTokenizer(in, null);
+ String body = ""; //$NON-NLS-1$
try {
for (Token token = tokenizer.nextToken(); token.getType() != Token.EOF; token = tokenizer.nextToken()) {
+ body += token.toString();
if (token.getType() == Token.TAG && ((HtmlTag) (token.getValue())).getTagType() == Tag.TD
&& !((HtmlTag) (token.getValue())).isEndTag()) {
HtmlTag ta = ((HtmlTag) token.getValue());
@@ -610,6 +612,7 @@ public class BugzillaClient {
for (BugzillaAttribute element : reportElements1) {
BugzillaTaskDataHandler.createAttribute(existingReport, element);
}
+ String useParam = taskRepository.getProperty(IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE);
BugzillaUtil.addAttributeIfUsed(BugzillaAttribute.TARGET_MILESTONE,
IBugzillaConstants.BUGZILLA_PARAM_USETARGETMILESTONE, taskRepository, existingReport, true);
for (BugzillaAttribute element : reportElements2) {
@@ -1189,13 +1192,6 @@ public class BugzillaClient {
private NameValuePair[] getPairsForNew(TaskData taskData) {
Map<String, NameValuePair> fields = new HashMap<String, NameValuePair>();
- BugzillaVersion bugzillaVersion = null;
- if (repositoryConfiguration != null) {
- bugzillaVersion = repositoryConfiguration.getInstallVersion();
- } else {
- bugzillaVersion = BugzillaVersion.MIN_VERSION;
- }
-
// go through all of the attributes and add them to
// the bug post
Collection<TaskAttribute> attributes = new ArrayList<TaskAttribute>(taskData.getRoot().getAttributes().values());
@@ -1209,16 +1205,6 @@ public class BugzillaClient {
continue;
}
String id = a.getId();
- if (id.equals(BugzillaAttribute.BUG_STATUS.getKey())
- && bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) >= 0) {
- TaskAttribute attributeOperation = taskData.getRoot().getMappedAttribute(TaskAttribute.OPERATION);
- value = attributeOperation.getValue().toUpperCase();
- if (!"{START}".equals(value)) { //$NON-NLS-1$
- fields.put(id, new NameValuePair(id, value != null ? value : "")); //$NON-NLS-1$
- } else {
- continue;
- }
- }
if (id.equals(BugzillaAttribute.NEWCC.getKey())) {
TaskAttribute b = taskData.getRoot().createAttribute(BugzillaAttribute.CC.getKey());
b.getMetaData()
@@ -1253,6 +1239,13 @@ public class BugzillaClient {
TaskAttribute descAttribute = taskData.getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION);
if (descAttribute != null && !descAttribute.getValue().equals("")) { //$NON-NLS-1$
+ BugzillaVersion bugzillaVersion = null;
+ if (repositoryConfiguration != null) {
+ bugzillaVersion = repositoryConfiguration.getInstallVersion();
+ } else {
+ bugzillaVersion = BugzillaVersion.MIN_VERSION;
+ }
+
if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_2_18) == 0) {
fields.put(KEY_COMMENT,
new NameValuePair(KEY_COMMENT, formatTextToLineWrap(descAttribute.getValue(), true)));
@@ -1465,64 +1458,67 @@ public class BugzillaClient {
} else {
String inputAttributeId = originalOperation.getMetaData().getValue(
TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID);
- String selOp = attributeOperation.getValue().toUpperCase();
- if (selOp.equals("NONE")) { //$NON-NLS-1$
- selOp = attributeStatus.getValue();
- }
- if (selOp.equals("ACCEPT")) { //$NON-NLS-1$
- selOp = "ASSIGNED"; //$NON-NLS-1$
- }
- if (selOp.equals("RESOLVE")) { //$NON-NLS-1$
- selOp = "RESOLVED"; //$NON-NLS-1$
- }
- if (selOp.equals("VERIFY")) { //$NON-NLS-1$
- selOp = "VERIFIED"; //$NON-NLS-1$
- }
- if (selOp.equals("CLOSE")) { //$NON-NLS-1$
- selOp = "CLOSED"; //$NON-NLS-1$
- }
- if (selOp.equals("REOPEN")) { //$NON-NLS-1$
- selOp = "REOPENED"; //$NON-NLS-1$
- }
- if (selOp.equals("MARKNEW")) { //$NON-NLS-1$
- selOp = "NEW"; //$NON-NLS-1$
- }
- if (selOp.equals("DUPLICATE")) { //$NON-NLS-1$
- if (repositoryConfiguration != null) {
- selOp = repositoryConfiguration.getDuplicateStatus();
- } else {
+ if (originalOperation == null) {
+ fields.put(fieldName, new NameValuePair(fieldName, attributeStatus.getValue()));
+ } else {
+ String selOp = attributeOperation.getValue().toUpperCase();
+ if (selOp.equals("NONE")) { //$NON-NLS-1$
+ selOp = attributeStatus.getValue();
+ }
+ if (selOp.equals("ACCEPT")) { //$NON-NLS-1$
+ selOp = "ASSIGNED"; //$NON-NLS-1$
+ }
+ if (selOp.equals("RESOLVE")) { //$NON-NLS-1$
selOp = "RESOLVED"; //$NON-NLS-1$
}
- String knob = BugzillaAttribute.RESOLUTION.getKey();
- fields.put(knob, new NameValuePair(knob, "DUPLICATE")); //$NON-NLS-1$
- }
-
- fields.put(fieldName, new NameValuePair(fieldName, selOp));
- if (inputAttributeId != null && !inputAttributeId.equals("")) { //$NON-NLS-1$
- TaskAttribute inputAttribute = attributeOperation.getTaskData()
- .getRoot()
- .getAttribute(inputAttributeId);
- if (inputAttribute != null) {
- if (inputAttribute.getOptions().size() > 0) {
- String sel = inputAttribute.getValue();
- String knob = inputAttribute.getId();
- if (knob.equals(BugzillaOperation.resolve.getInputId())) {
- knob = BugzillaAttribute.RESOLUTION.getKey();
- }
- fields.put(knob, new NameValuePair(knob, inputAttribute.getOption(sel)));
+ if (selOp.equals("VERIFY")) { //$NON-NLS-1$
+ selOp = "VERIFIED"; //$NON-NLS-1$
+ }
+ if (selOp.equals("CLOSE")) { //$NON-NLS-1$
+ selOp = "CLOSED"; //$NON-NLS-1$
+ }
+ if (selOp.equals("REOPEN")) { //$NON-NLS-1$
+ selOp = "REOPENED"; //$NON-NLS-1$
+ }
+ if (selOp.equals("MARKNEW")) { //$NON-NLS-1$
+ selOp = "NEW"; //$NON-NLS-1$
+ }
+ if (selOp.equals("DUPLICATE")) { //$NON-NLS-1$
+ if (repositoryConfiguration != null) {
+ selOp = repositoryConfiguration.getDuplicateStatus();
} else {
- String sel = inputAttribute.getValue();
- String knob = attributeOperation.getValue();
- if (knob.equals(BugzillaOperation.duplicate.toString())) {
- knob = inputAttributeId;
- }
- if (knob.equals(BugzillaOperation.reassign.toString())) {
- knob = BugzillaAttribute.ASSIGNED_TO.getKey();
- }
- fields.put(knob, new NameValuePair(knob, sel));
+ selOp = "RESOLVED"; //$NON-NLS-1$
}
+ String knob = BugzillaAttribute.RESOLUTION.getKey();
+ fields.put(knob, new NameValuePair(knob, "DUPLICATE")); //$NON-NLS-1$
}
+ fields.put(fieldName, new NameValuePair(fieldName, selOp));
+ if (inputAttributeId != null && !inputAttributeId.equals("")) { //$NON-NLS-1$
+ TaskAttribute inputAttribute = attributeOperation.getTaskData()
+ .getRoot()
+ .getAttribute(inputAttributeId);
+ if (inputAttribute != null) {
+ if (inputAttribute.getOptions().size() > 0) {
+ String sel = inputAttribute.getValue();
+ String knob = inputAttribute.getId();
+ if (knob.equals(BugzillaOperation.resolve.getInputId())) {
+ knob = BugzillaAttribute.RESOLUTION.getKey();
+ }
+ fields.put(knob, new NameValuePair(knob, inputAttribute.getOption(sel)));
+ } else {
+ String sel = inputAttribute.getValue();
+ String knob = attributeOperation.getValue();
+ if (knob.equals(BugzillaOperation.duplicate.toString())) {
+ knob = inputAttributeId;
+ }
+ if (knob.equals(BugzillaOperation.reassign.toString())) {
+ knob = BugzillaAttribute.ASSIGNED_TO.getKey();
+ }
+ fields.put(knob, new NameValuePair(knob, sel));
+ }
+ }
+ }
}
}
}
@@ -1800,7 +1796,7 @@ public class BugzillaClient {
throw new CoreException(new BugzillaStatus(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN,
IBugzillaConstants.REPOSITORY_STATUS_SUSPICIOUS_ACTION,
- repositoryUrl.toString(), "unknown reason because Bugzilla < 4.0 was used")); //$NON-NLS-1$
+ repositoryUrl.toString(), "unknown reason because Bugzilla < 4.0 was used"));
}
}
@@ -1833,8 +1829,8 @@ public class BugzillaClient {
String result = title.trim();
if (result.length() == 0) {
- if (body.contains("Bugzilla/Bug.pm line")) { //$NON-NLS-1$
- result = "Bugzilla/Bug.pm line"; //$NON-NLS-1$
+ if (body.contains("Bugzilla/Bug.pm line")) {
+ result = "Bugzilla/Bug.pm line";
}
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaOperation.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaOperation.java
index bec49d635..5ee58d4d0 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaOperation.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaOperation.java
@@ -55,18 +55,6 @@ public class BugzillaOperation extends AbstractBugzillaOperation {
public static final BugzillaOperation reassignbycomponent = new BugzillaOperation(
Messages.BugzillaOperation_Reassign_to_default_assignee, "reassignbycomponent"); //$NON-NLS-1$
- // Bugzilla 4.0
- public static final BugzillaOperation unconfirmed = new BugzillaOperation("unconfirm", "unconfirmed"); //$NON-NLS-1$
-
- public static final BugzillaOperation confirmed = new BugzillaOperation("confirm", "confirmed"); //$NON-NLS-1$
-
- public static final BugzillaOperation in_progress = new BugzillaOperation("in progress", "in_progress"); //$NON-NLS-1$
-
- public static final BugzillaOperation verify_with_resolution = new BugzillaOperation(
- "verify", "resolutionInput", TaskAttribute.TYPE_SINGLE_SELECT, "verify"); //$NON-NLS-1$ //$NON-NLS-2$
-
- public static final BugzillaOperation new_default = new BugzillaOperation("default", "{Start}"); //$NON-NLS-1$
-
private final String value;
BugzillaOperation(String label) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
index 8a55ac06e..77613b526 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
@@ -474,16 +474,7 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
attributeStatus.putOption(option, option);
}
- BugzillaVersion bugzillaVersion = repositoryConfiguration.getInstallVersion();
- if (bugzillaVersion == null) {
- bugzillaVersion = BugzillaVersion.MIN_VERSION;
- }
- if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
- attributeStatus.setValue(repositoryConfiguration.getStartStatus());
- } else {
- attributeStatus.setValue(IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.START.toString());
- repositoryConfiguration.addValidOperations(taskData);
- }
+ attributeStatus.setValue(repositoryConfiguration.getStartStatus());
createAttribute(taskData, BugzillaAttribute.SHORT_DESC);
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java
index 0f05bb931..a98c501ed 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaVersion.java
@@ -38,9 +38,7 @@ public class BugzillaVersion implements Comparable<BugzillaVersion>, Serializabl
public final static BugzillaVersion BUGZILLA_3_6 = new BugzillaVersion("3.6"); //$NON-NLS-1$
- public final static BugzillaVersion BUGZILLA_4_0 = new BugzillaVersion("4.0"); //$NON-NLS-1$
-
- public final static BugzillaVersion MAX_VERSION = BUGZILLA_4_0;
+ public final static BugzillaVersion MAX_VERSION = new BugzillaVersion("3.6"); //$NON-NLS-1$
private final int major;
@@ -59,7 +57,6 @@ public class BugzillaVersion implements Comparable<BugzillaVersion>, Serializabl
rc = false;
plus = false;
} else {
- version = version.toUpperCase();
rc = version.contains("RC"); //$NON-NLS-1$
plus = version.contains("+"); //$NON-NLS-1$
if (plus) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java
index 379be9610..370342620 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/IBugzillaConstants.java
@@ -212,10 +212,6 @@ public interface IBugzillaConstants {
UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, CLOSED, SCHEDULED;
}
- public static enum BUGZILLA_REPORT_STATUS_4_0 {
- START, UNCONFIRMED, CONFIRMED, IN_PROGRESS, RESOLVED, VERIFIED;
- }
-
public static enum BUGZILLA_RESOLUTION_2_0 {
FIXED, INVALID, WONTFIX, LATER, REMIND, WORKSFORME;
}
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
index 971a02d67..2b64d7bb7 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/RepositoryConfiguration.java
@@ -25,7 +25,6 @@ import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0;
import org.eclipse.mylyn.internal.bugzilla.core.service.BugzillaXmlRpcClient;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
@@ -262,15 +261,6 @@ public class RepositoryConfiguration implements Serializable {
}
}
- public void addUnconfirmedAllowed(String product, Boolean unconfirmedAllowed) {
- ProductEntry entry = products.get(product);
- if (entry == null) {
- entry = new ProductEntry(product);
- products.put(product, entry);
- }
- entry.setUnconfirmedAllowed(unconfirmedAllowed);
- }
-
/**
* Container for product information: name, components.
*/
@@ -289,8 +279,6 @@ public class RepositoryConfiguration implements Serializable {
String defaultMilestone = null;
- Boolean unconfirmedAllowed = false;
-
ProductEntry(String name) {
this.productName = name;
}
@@ -330,14 +318,6 @@ public class RepositoryConfiguration implements Serializable {
public void setDefaultMilestone(String defaultMilestone) {
this.defaultMilestone = defaultMilestone;
}
-
- public Boolean getUnconfirmedAllowed() {
- return unconfirmedAllowed;
- }
-
- public void setUnconfirmedAllowed(Boolean unconfirmedAllowed) {
- this.unconfirmedAllowed = unconfirmedAllowed;
- }
}
public List<String> getOpenStatusValues() {
@@ -394,9 +374,7 @@ public class RepositoryConfiguration implements Serializable {
validTransitions = new CustomTransitionManager();
}
if (xmlClient == null) {
- if (!validTransitions.parse(fileName)) {
- validTransitions = null;
- }
+ validTransitions.parse(fileName);
} else {
validTransitions.parse(monitor, xmlClient);
}
@@ -648,104 +626,6 @@ public class RepositoryConfiguration implements Serializable {
}
public void addValidOperations(TaskData bugReport) {
- BugzillaVersion bugzillaVersion = getInstallVersion();
- if (bugzillaVersion == null) {
- bugzillaVersion = BugzillaVersion.MIN_VERSION;
- }
- if (bugzillaVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0) {
- addValidOperationsBefore4(bugReport);
- } else {
- addValidOperationsAfter4(bugReport);
- }
- }
-
- public void addValidOperationsAfter4(TaskData bugReport) {
- TaskAttribute attributeStatus = bugReport.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- BUGZILLA_REPORT_STATUS_4_0 status = BUGZILLA_REPORT_STATUS_4_0.UNCONFIRMED;
- if (attributeStatus != null) {
- try {
- status = BUGZILLA_REPORT_STATUS_4_0.valueOf(attributeStatus.getValue());
- } catch (RuntimeException e) {
- status = BUGZILLA_REPORT_STATUS_4_0.UNCONFIRMED;
- }
- }
- if (validTransitions != null && attributeStatus != null && validTransitions.isValid()) {
- //Handle custom operations. Currently only tuned for transitions based on default status names
- addOperation(bugReport, BugzillaOperation.none);
- for (AbstractBugzillaOperation b : validTransitions.getValidTransitions(attributeStatus.getValue())) {
- //Special case: the CLOSED status needs a Resolution input.
- //This happens automatically if current status is RESOLVED, else we need to supply one
- if (b.toString().equals(BugzillaOperation.close.toString())) {
- if (attributeStatus.getValue().equals("RESOLVED") && b.getInputId() != null) { //$NON-NLS-1$
- //Do not add close with resolution operation if status is RESOLVED
- continue;
- } else if (!attributeStatus.getValue().equals("RESOLVED") && b.getInputId() == null) { //$NON-NLS-1$
- //Do not add normal 'close' operation if status is not currently RESOLVED
- continue;
- }
- }
- addOperation(bugReport, b);
- }
- } else {
- TaskAttribute everConfirmed = bugReport.getRoot().getAttribute(BugzillaAttribute.EVERCONFIRMED.getKey());
- TaskAttribute product = bugReport.getRoot().getMappedAttribute(TaskAttribute.PRODUCT);
- Boolean unconfirmedAllowed = products.get(product.getValue()).getUnconfirmedAllowed();
-
- switch (status) {
- case START:
- addOperation(bugReport, BugzillaOperation.new_default);
- addOperation(bugReport, BugzillaOperation.unconfirmed);
- addOperation(bugReport, BugzillaOperation.confirmed);
- addOperation(bugReport, BugzillaOperation.in_progress);
- TaskAttribute unconfirmedAttribute = bugReport.getRoot().getAttribute(
- TaskAttribute.PREFIX_OPERATION + BugzillaOperation.unconfirmed.toString());
- unconfirmedAttribute.getMetaData().putValue(TaskAttribute.META_UNCONFIRMED_ALLOWED,
- unconfirmedAllowed.toString());
- TaskAttribute operationAttribute = bugReport.getRoot().getAttribute(TaskAttribute.OPERATION);
- TaskOperation.applyTo(operationAttribute, BugzillaOperation.new_default.toString(),
- IBugzillaConstants.BUGZILLA_REPORT_STATUS_4_0.START.toString());
- break;
- case UNCONFIRMED:
- addOperation(bugReport, BugzillaOperation.none);
- addOperation(bugReport, BugzillaOperation.confirmed);
- addOperation(bugReport, BugzillaOperation.in_progress);
- addOperation(bugReport, BugzillaOperation.resolve);
- break;
- case CONFIRMED:
- addOperation(bugReport, BugzillaOperation.none);
- addOperation(bugReport, BugzillaOperation.in_progress);
- addOperation(bugReport, BugzillaOperation.resolve);
- break;
- case IN_PROGRESS:
- addOperation(bugReport, BugzillaOperation.none);
- addOperation(bugReport, BugzillaOperation.confirmed);
- addOperation(bugReport, BugzillaOperation.resolve);
- break;
- case RESOLVED:
- addOperation(bugReport, BugzillaOperation.none);
- if (everConfirmed == null && unconfirmedAllowed) {
- addOperation(bugReport, BugzillaOperation.unconfirmed);
- } else {
- addOperation(bugReport, BugzillaOperation.confirmed);
- }
- addOperation(bugReport, BugzillaOperation.verify_with_resolution);
- break;
- case VERIFIED:
- addOperation(bugReport, BugzillaOperation.none);
- if (everConfirmed == null && unconfirmedAllowed) {
- addOperation(bugReport, BugzillaOperation.unconfirmed);
- } else {
- addOperation(bugReport, BugzillaOperation.confirmed);
- }
- addOperation(bugReport, BugzillaOperation.resolve);
- break;
- }
- addOperation(bugReport, BugzillaOperation.duplicate);
- }
-
- }
-
- public void addValidOperationsBefore4(TaskData bugReport) {
TaskAttribute attributeStatus = bugReport.getRoot().getMappedAttribute(TaskAttribute.STATUS);
BUGZILLA_REPORT_STATUS status = BUGZILLA_REPORT_STATUS.NEW;
@@ -936,23 +816,6 @@ public class RepositoryConfiguration implements Serializable {
if (getResolutions().size() > 0) {
attrResolvedInput.setValue(getResolutions().get(0));
}
- } else if (op.toString().equals(BugzillaOperation.verify_with_resolution.toString()) && op.getInputId() != null) {
- TaskAttribute attributeResolution = bugReport.getRoot().getMappedAttribute(TaskAttribute.RESOLUTION);
- String oldResolutionValue = attributeResolution.getValue();
- attribute = bugReport.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + op.toString());
- TaskOperation.applyTo(attribute, op.toString(), op.getLabel());
- TaskAttribute attrResolvedInput = attribute.getTaskData().getRoot().createAttribute(op.getInputId());
- attrResolvedInput.getMetaData().setType(op.getInputType());
- attribute.getMetaData().putValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, op.getInputId());
- for (String resolution : getResolutions()) {
- // DUPLICATE and MOVED have special meanings so do not show as resolution
- if (resolution.compareTo("DUPLICATE") != 0 && resolution.compareTo("MOVED") != 0) { //$NON-NLS-1$ //$NON-NLS-2$
- attrResolvedInput.putOption(resolution, resolution);
- }
- }
- if (getResolutions().size() > 0) {
- attrResolvedInput.setValue(oldResolutionValue);
- }
} else if (op.toString() == BugzillaOperation.duplicate.toString()) {
attribute = bugReport.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + op.toString());
@@ -965,17 +828,9 @@ public class RepositoryConfiguration implements Serializable {
attrInput.getMetaData().defaults().setReadOnly(false).setType(op.getInputType());
attribute.getMetaData().putValue(TaskAttribute.META_ASSOCIATED_ATTRIBUTE_ID, op.getInputId());
}
- } else if (op.toString() == BugzillaOperation.new_default.toString()) {
- attribute = bugReport.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + op.toString());
- TaskOperation.applyTo(attribute, op.toString(), op.getLabel(), "Let Bugzilla set the Status"); //$NON-NLS-1$
} else {
attribute = bugReport.getRoot().createAttribute(TaskAttribute.PREFIX_OPERATION + op.toString());
- if (bugReport.isNew()) {
- TaskOperation.applyTo(attribute, op.toString(), op.getLabel(),
- "if you are not shure if you allowed to set this state\nplease use the default for submitting new tasks!"); //$NON-NLS-1$
- } else {
- TaskOperation.applyTo(attribute, op.toString(), op.getLabel(), ""); //$NON-NLS-1$
- }
+ TaskOperation.applyTo(attribute, op.toString(), op.getLabel());
if (op.getInputId() != null) {
TaskAttribute attrInput = bugReport.getRoot().createAttribute(op.getInputId());
attrInput.getMetaData().defaults().setReadOnly(false).setType(op.getInputType());
@@ -1115,15 +970,11 @@ public class RepositoryConfiguration implements Serializable {
}
public String getDuplicateStatus() {
- return validTransitions == null ? "RESOLVED" : validTransitions.getDuplicateStatus(); //$NON-NLS-1$
+ return validTransitions.getDuplicateStatus();
}
public String getStartStatus() {
- if (validTransitions == null) {
- return version.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_4_0) < 0 ? "NEW" : "CONFIRMED"; //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- return validTransitions.getStartStatus();
- }
+ return (validTransitions == null) ? "NEW" : validTransitions.getStartStatus(); //$NON-NLS-1$
}
public String getDefaultMilestones(String product) {
@@ -1135,15 +986,6 @@ public class RepositoryConfiguration implements Serializable {
}
}
- public Boolean getUnconfirmedAllowed(String product) {
- ProductEntry entry = products.get(product);
- if (entry != null) {
- return entry.getUnconfirmedAllowed();
- } else {
- return null;
- }
- }
-
public void setDefaultMilestone(String product, String defaultMilestone) {
ProductEntry entry = products.get(product);
if (entry == null) {
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxConfigurationContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxConfigurationContentHandler.java
index ed2a2be95..50191adfe 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxConfigurationContentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxConfigurationContentHandler.java
@@ -103,8 +103,6 @@ public class SaxConfigurationContentHandler extends DefaultHandler {
private static final String ELEMENT_MULTIPLICABLE = "multiplicable"; //$NON-NLS-1$
- private static final String ELEMENT_ALLOWS_UNCONFIRMED = "allows_unconfirmed"; //$NON-NLS-1$
-
private static final int EXPECTING_ROOT = 0;
private static final int IN_INSTALL_VERSION = 1 << 1;
@@ -443,10 +441,6 @@ public class SaxConfigurationContentHandler extends DefaultHandler {
currentSpecifically_requestable = characters.toString();
} else if (localName.equals(ELEMENT_MULTIPLICABLE)) {
currentMultiplicable = characters.toString();
- } else if (localName.equals(ELEMENT_ALLOWS_UNCONFIRMED)) {
- String value = characters.toString();
- Boolean boolValue = value.equals("0") ? false : true; //$NON-NLS-1$
- configuration.addUnconfirmedAllowed(currentProduct, boolValue);
} else if (localName.equals(ELEMENT_FLAG_TYPES)) {
state = state & ~IN_FLAG_TYPES;
} else if (localName.equals(ELEMENT_FLAG_TYPE)) {
@@ -524,6 +518,8 @@ public class SaxConfigurationContentHandler extends DefaultHandler {
flagComponentList.put(currentComponent, flagsForComponent);
}
flagsForComponent.add(compURI.replace("flags.cgi?id=", "flag.cgi?id=")); //$NON-NLS-1$ //$NON-NLS-2$
+ int i = 0;
+ i++;
}
}
break;

Back to the top