View | Details | Raw Unified | Return to bug 288347 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/mylyn/internal/jira/core/JiraTaskDataHandler.java (-2 / +7 lines)
Lines 938-945 Link Here
938
				} else {
938
				} else {
939
					String operationId = getOperationId(taskData);
939
					String operationId = getOperationId(taskData);
940
					String newComment = getNewComment(taskData);
940
					String newComment = getNewComment(taskData);
941
					// do normal workflow all the time
941
942
					if (!JiraRepositoryConnector.isClosed(issue)
942
					// if only comment was modified do not do the workflow
943
					// otherwise do the whole workflow
944
					if (changedAttributes != null && changedAttributes.size() == 1
945
							&& changedAttributes.iterator().next().getId().equals(TaskAttribute.COMMENT_NEW)) {
946
						client.addCommentToIssue(issue, newComment, monitor);
947
					} else if (!JiraRepositoryConnector.isClosed(issue)
943
							&& taskData.getRoot().getMappedAttribute(IJiraConstants.ATTRIBUTE_READ_ONLY) == null) {
948
							&& taskData.getRoot().getMappedAttribute(IJiraConstants.ATTRIBUTE_READ_ONLY) == null) {
944
						client.updateIssue(issue, newComment, monitor);
949
						client.updateIssue(issue, newComment, monitor);
945
					} else if (newComment.length() > 0) {
950
					} else if (newComment.length() > 0) {
(-)src/org/eclipse/mylyn/internal/jira/core/JiraCorePlugin.java (+11 lines)
Lines 28-33 Link Here
28
import org.eclipse.mylyn.tasks.core.TaskRepository;
28
import org.eclipse.mylyn.tasks.core.TaskRepository;
29
import org.eclipse.osgi.util.NLS;
29
import org.eclipse.osgi.util.NLS;
30
import org.osgi.framework.BundleContext;
30
import org.osgi.framework.BundleContext;
31
import org.osgi.framework.Constants;
31
32
32
/**
33
/**
33
 * @author Brock Janiczak
34
 * @author Brock Janiczak
Lines 44-49 Link Here
44
45
45
	public final static String LABEL = NLS.bind(Messages.JiraCorePlugin_JIRA_description, "3.4"); //$NON-NLS-1$
46
	public final static String LABEL = NLS.bind(Messages.JiraCorePlugin_JIRA_description, "3.4"); //$NON-NLS-1$
46
47
48
	public static final String PRODUCT_NAME = "Atlassian Connector for Eclipse";
49
47
	private static boolean initialized;
50
	private static boolean initialized;
48
51
49
	/**
52
	/**
Lines 127-130 Link Here
127
		}
130
		}
128
	}
131
	}
129
132
133
	public String getVersion() {
134
		Object version = getBundle().getHeaders().get(Constants.BUNDLE_VERSION);
135
		return version == null ? "0.0.0" : version.toString(); //$NON-NLS-1$
136
	}
137
138
	public String getUserAgent() {
139
		return JiraCorePlugin.PRODUCT_NAME + "/" + getVersion(); //$NON-NLS-1$
140
	}
130
}
141
}
(-)src/org/eclipse/mylyn/internal/jira/core/service/web/JiraWebSession.java (+3 lines)
Lines 30-35 Link Here
30
import org.apache.commons.httpclient.cookie.CookiePolicy;
30
import org.apache.commons.httpclient.cookie.CookiePolicy;
31
import org.apache.commons.httpclient.methods.GetMethod;
31
import org.apache.commons.httpclient.methods.GetMethod;
32
import org.apache.commons.httpclient.methods.PostMethod;
32
import org.apache.commons.httpclient.methods.PostMethod;
33
import org.apache.commons.httpclient.params.HttpMethodParams;
33
import org.eclipse.core.runtime.IProgressMonitor;
34
import org.eclipse.core.runtime.IProgressMonitor;
34
import org.eclipse.core.runtime.IStatus;
35
import org.eclipse.core.runtime.IStatus;
35
import org.eclipse.core.runtime.MultiStatus;
36
import org.eclipse.core.runtime.MultiStatus;
Lines 103-108 Link Here
103
				lock(monitor);
104
				lock(monitor);
104
				if (httpClient == null) {
105
				if (httpClient == null) {
105
					httpClient = new HttpClient(WebUtil.getConnectionManager());
106
					httpClient = new HttpClient(WebUtil.getConnectionManager());
107
					httpClient.getParams().setParameter(HttpMethodParams.USER_AGENT,
108
							JiraCorePlugin.getDefault().getUserAgent());
106
				}
109
				}
107
				if (doLogin) {
110
				if (doLogin) {
108
					hostConfiguration = login(httpClient, monitor);
111
					hostConfiguration = login(httpClient, monitor);
(-)src/org/eclipse/mylyn/internal/jira/core/service/soap/JiraSoapServiceLocator.java (-4 / +7 lines)
Lines 19-31 Link Here
19
package org.eclipse.mylyn.internal.jira.core.service.soap;
19
package org.eclipse.mylyn.internal.jira.core.service.soap;
20
20
21
import java.util.Hashtable;
21
import java.util.Hashtable;
22
import java.util.Map;
23
22
24
import javax.xml.rpc.Call;
23
import javax.xml.rpc.Call;
25
import javax.xml.rpc.ServiceException;
24
import javax.xml.rpc.ServiceException;
26
25
27
import org.apache.axis.transport.http.HTTPConstants;
26
import org.apache.axis.transport.http.HTTPConstants;
28
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
27
import org.eclipse.mylyn.commons.net.AbstractWebLocation;
28
import org.eclipse.mylyn.internal.jira.core.JiraCorePlugin;
29
import org.eclipse.mylyn.internal.jira.core.wsdl.soap.JiraSoapServiceServiceLocator;
29
import org.eclipse.mylyn.internal.jira.core.wsdl.soap.JiraSoapServiceServiceLocator;
30
import org.eclipse.mylyn.internal.provisional.commons.soap.SoapHttpSender;
30
import org.eclipse.mylyn.internal.provisional.commons.soap.SoapHttpSender;
31
31
Lines 72-83 Link Here
72
//			call.setProperty(JiraHttpSender.PROXY, proxy);
72
//			call.setProperty(JiraHttpSender.PROXY, proxy);
73
//		}
73
//		}
74
		call.setProperty(SoapHttpSender.LOCATION, location);
74
		call.setProperty(SoapHttpSender.LOCATION, location);
75
		call.setProperty(SoapHttpSender.USER_AGENT, "JiraConnector Apache Axis/1.4"); //$NON-NLS-1$
75
76
		Hashtable<String, String> headers = new Hashtable<String, String>();
77
78
		// set user agent
79
		headers.put(HTTPConstants.HEADER_USER_AGENT, JiraCorePlugin.getDefault().getUserAgent());
76
80
77
		// some servers break with a 411 Length Required when chunked encoding
81
		// some servers break with a 411 Length Required when chunked encoding
78
		// is used
82
		// is used
79
		Map<String, Boolean> headers = new Hashtable<String, Boolean>();
83
		headers.put(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED, Boolean.FALSE.toString());
80
		headers.put(HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED, Boolean.FALSE);
81
		call.setProperty(HTTPConstants.REQUEST_HEADERS, headers);
84
		call.setProperty(HTTPConstants.REQUEST_HEADERS, headers);
82
		return call;
85
		return call;
83
	}
86
	}

Return to bug 288347