diff options
author | relves | 2010-01-13 18:47:34 +0000 |
---|---|---|
committer | relves | 2010-01-13 18:47:34 +0000 |
commit | 3e13040fd37f746159f29d1c15cff4d7f0464687 (patch) | |
tree | 35810a3058b5f8902c5052b9c49947339edc6fda /org.eclipse.mylyn.oslc.core | |
parent | 84a4262f7cc706e0c5fa0718fba638617fa30e90 (diff) | |
download | org.eclipse.mylyn.tasks-3e13040fd37f746159f29d1c15cff4d7f0464687.tar.gz org.eclipse.mylyn.tasks-3e13040fd37f746159f29d1c15cff4d7f0464687.tar.xz org.eclipse.mylyn.tasks-3e13040fd37f746159f29d1c15cff4d7f0464687.zip |
NEW - bug 299531: update service discovery to use rdf:about from ServiceProviderCatalog
https://bugs.eclipse.org/bugs/show_bug.cgi?id=299531
Diffstat (limited to 'org.eclipse.mylyn.oslc.core')
2 files changed, 9 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java index 43e2213e9..2c637067f 100644 --- a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java +++ b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/IOslcCoreConstants.java @@ -79,6 +79,8 @@ public interface IOslcCoreConstants { public static final String ATTRIBUTE_HINTHEIGHT = "hintHeight"; //$NON-NLS-1$ + public static final String ATTRIBUTE_ABOUT = "about"; //$NON-NLS-1$ + // Http header keys public static final String HEADER_ETAG = "ETag"; //$NON-NLS-1$ diff --git a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java index bb5f8d5fc..be0c3cdcf 100644 --- a/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java +++ b/org.eclipse.mylyn.oslc.core/src/org/eclipse/mylyn/internal/oslc/core/client/AbstractOslcClient.java @@ -149,13 +149,13 @@ public abstract class AbstractOslcClient { Iterator<?> itr = doc.getDescendants(new ElementFilter(IOslcCoreConstants.ELEMENT_SERVICE_PROVIDER_CATALOG)); while (itr.hasNext()) { Element element = (Element) itr.next(); - if (element.getParent() != doc.getRootElement()) { - Attribute attrResource = element.getAttribute(IOslcCoreConstants.ATTRIBUTE_RESOURCE, + if (element != doc.getRootElement()) { + Attribute attrAbout = element.getAttribute(IOslcCoreConstants.ATTRIBUTE_ABOUT, IOslcCoreConstants.NAMESPACE_RDF); String title = element.getChild(IOslcCoreConstants.ELEMENT_TITLE, IOslcCoreConstants.NAMESPACE_DC) .getText(); - if (attrResource != null && attrResource.getValue().length() > 0) { - providers.add(new OslcServiceProviderCatalog(title, attrResource.getValue())); + if (attrAbout != null && attrAbout.getValue().length() > 0) { + providers.add(new OslcServiceProviderCatalog(title, attrAbout.getValue())); } } } @@ -230,7 +230,8 @@ public abstract class AbstractOslcClient { config.setDescription(element.getText()); } - itr = doc.getDescendants(new ElementFilter(IOslcCoreConstants.ELEMENT_CREATIONDIALOG)); + itr = doc.getDescendants(new ElementFilter(IOslcCoreConstants.ELEMENT_CREATIONDIALOG, + IOslcCoreConstants.NAMESPACE_OSLC_CM_1_0)); while (itr.hasNext()) { boolean isDefault = false; Element element = (Element) itr.next(); @@ -401,7 +402,7 @@ public abstract class AbstractOslcClient { protected GetMethod createGetMethod(String requestPath) { GetMethod method = new GetMethod(getRequestPath(requestPath)); - method.setFollowRedirects(false); + method.setFollowRedirects(true); method.setDoAuthentication(true); // application/xml is returned by oslc servers by default //method.setRequestHeader("Accept", "application/xml"); |