String addToMapUrl = iMapViewer.readAddToMapUrl();
if (addToMapUrl == null || "".equals(addToMapUrl)) {
return;
}
String resourceKey = "catalog.rest.addToMap";
ResourceLink link = this.makeLink(addToMapUrl, ResourceLink.TAG_ADDTOMAP,
resourceKey);
link.setTarget(iMapViewer.readTarget());
record.getResourceLinks().add(link);
return;
}
// maybe url is already an add to map url? if so no modigications are required
if ((resourceUrl.toLowerCase().startsWith("http:") || resourceUrl
.toLowerCase().startsWith("https:"))
&& resourceUrl.toLowerCase().contains("resources=map")) {
} else {
// set up an ArcGIS soap service for the viewer
if (serviceType.equals("ags")) {
resourceUrl = Val.chkStr(resourceIdentifier.guessAgsMapServerSoapUrl(resourceUrl));
}
// set up an ArcIMS service for the viewer
int nIdx = resourceUrl.toLowerCase().indexOf(
"/servlet/com.esri.esrimap.esrimap?servicename=");
if (nIdx > 0) {
resourceUrl = resourceUrl.substring(0, nIdx) + "/"
+ resourceUrl.substring(nIdx + 46);
}
// set up an OGC service for the viewer
if (serviceType.equalsIgnoreCase("wms")
|| serviceType.equalsIgnoreCase("wfs")
|| serviceType.equalsIgnoreCase("wcs")) {
nIdx = resourceUrl.toLowerCase().indexOf("?");
if (nIdx > 0) {
resourceUrl = resourceUrl.substring(0, nIdx);
}
}
}
// TODO: explanation?
resourceUrl = resourceUrl.replaceAll("/$", "")
+ (serviceName.length() > 0 ? "/" + serviceName : "");
resourceUrl = Val.chkStr(resourceUrl);
if (resourceUrl.length() > 0) {
String url = viewerUrl + "?resources=map:" + serviceType + "@"
+ resourceUrl;
String resourceKey = "catalog.rest.addToMap";
ResourceLink link = this.makeLink(url, ResourceLink.TAG_ADDTOMAP,
resourceKey);
record.getResourceLinks().add(link);
}
String url = "";