Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcsalter2005-07-20 04:22:42 +0000
committercsalter2005-07-20 04:22:42 +0000
commit22e4644512dff51caa1c1d57fad894ab209b8fb0 (patch)
tree24214f58f0f7753f81925a4a61f4a87a7426d702 /bundles/org.eclipse.wst.xml.core
parentf0d4c504ac8d12921368dadeef962a7dbb5308db (diff)
downloadwebtools.sourceediting-22e4644512dff51caa1c1d57fad894ab209b8fb0.tar.gz
webtools.sourceediting-22e4644512dff51caa1c1d57fad894ab209b8fb0.tar.xz
webtools.sourceediting-22e4644512dff51caa1c1d57fad894ab209b8fb0.zip
[103768] update resolver to distinguish between physical and logical resolution results
Diffstat (limited to 'bundles/org.eclipse.wst.xml.core')
-rw-r--r--bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java55
1 files changed, 9 insertions, 46 deletions
diff --git a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
index 4cab7b6405..83a36c51ed 100644
--- a/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
+++ b/bundles/org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/modelquery/XMLCatalogIdResolver.java
@@ -16,7 +16,10 @@ import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin
import org.eclipse.wst.sse.core.internal.util.URIResolver;
-
+// TODO cs : remove this class and utilize the common URIResolver directly
+// We need to update some of the ModelQuery related code to pass the 'baseLocation' thru
+// and then there'll be node need for this class.
+//
public class XMLCatalogIdResolver implements org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver {
protected String resourceLocation;
@@ -58,51 +61,11 @@ public class XMLCatalogIdResolver implements org.eclipse.wst.common.uriresolver.
base = getResourceLocation();
}
- result = URIResolverPlugin.createResolver().resolve(base, publicId, systemId);
- /*
- // first see if we can map the publicId to an alternative systemId
- // note: should probably verify the mappedSystemId before ignoring the
- // systemId
- ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
- try {
- String mappedSystemId = xmlCatalog.resolvePublic(publicId, systemId);
- if (mappedSystemId != null) {
- result = mappedSystemId;
- }
- }
- catch (MalformedURLException e) {
- Logger.logException("error resolving from catalog: ", e);
- }
- catch (IOException e) {
- Logger.logException("error resolving from catalog: ", e);
-
- }
-
- // normalize the systemId
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100481
- //boolean normalized = false;
-
- // account for Web Projects and others where *any* string may legally
- // resolve somehow
- if (this.uriresolver != null && systemId != null) {
- // check the provided URIResolver
- String resolvedValue = this.uriresolver.getLocationByURI(systemId, base);
- if (resolvedValue != null && resolvedValue.length() > 0) {
- result = resolvedValue;
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100481
- //normalized = true;
- }
- }
-
-// https://bugs.eclipse.org/bugs/show_bug.cgi?id=100481
-// if (!normalized) {
-// // no URIResolver available; ask the URIHelper directly
-// result = URIHelper.normalize(result, base, null);
-// normalized = true;
-// }
- */
+ result = URIResolverPlugin.createResolver().resolve(base, publicId, systemId);
return result;
}
-
-
+
+ public String resolvePhysicalLocation(String baseLocation, String publicId, String logicalLocation) {
+ return URIResolverPlugin.createResolver().resolvePhysicalLocation(baseLocation, publicId, logicalLocation);
+ }
}

Back to the top