Project

General

Profile

« Previous | Next » 

Revision 2699

Added by harris over 18 years ago

Continued work -- now the user can get info on all layers servered by the wms, including the metacat docs.

View differences:

metacat_spatialresolver.jsp
35 35
    System.out.println("**************** metacat_spatialresolver.jsp*****************\n");
36 36
    
37 37

  
38
     String _request = request.getParameter("REQUEST");
39
     _request = (_request!=null)? _request.trim() : "";
38
    String _request = request.getParameter("REQUEST");
39
    _request = (_request!=null)? _request.trim() : "";
40 40
  
41
  	System.out.println("uri: " + request.getRequestURI());
42
	  System.out.println("request string: " + request.getQueryString());
41
  	System.out.println("uri: >>" + request.getRequestURI());
42
	  System.out.println("request string: >>" + request.getQueryString()+" \n");
43 43
					   
44 44
					   
45
	//URLConnection _conn = new URLConnection("http://geonumericsolutions.com");
46
	URL url = new URL("http://nebulous.msi.ucsb.edu:8080/geoserver/wms?"+request.getQueryString());
45
	// connect to the metacat spatial option, request the info using the wms getFeatureId call
46
  // parse the response for the url to the metacat document and then redirect there. The query 
47
  // should look like
48
  // VERSION=1.1.1&REQUEST=GetFeatureInfo&SRS=EPSG:4326&BBOX=-143.09099999999998,19.856,-96.79899999999999,43.002&WIDTH=600&HEIGHT=300&LAYERS=topp:RIVERS&FORMAT=text/html&FEATURE_COUNT=1&QUERY_LAYERS=topp:RIVERS&X=328&Y=218
49
  
50
  if ( request.getQueryString().indexOf("metacat_testdata") > -1 ) { 
51
  URL url = new URL("http://nebulous.msi.ucsb.edu:8080/geoserver/wms?"+request.getQueryString());
47 52
	URLConnection c = url.openConnection();
48 53
	BufferedReader in = new BufferedReader(
49 54
                                new InputStreamReader(
......
64 69
				response.setHeader("Location",newLocn);
65 70
			}
66 71
        in.close();
67
	
72
	} else {
73
    System.out.println(" -- not a metacat query");
74
    String _url = "http://sulphur.homelinux.com:9999/geoserver/wms?"+ request.getQueryString();
75
    
76
    System.out.println("redirecting to: " + _url);
77
    response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
78
    response.setHeader("Location",_url);
68 79
  
80
  }
81
  
69 82
%>
70 83

  
71 84
<html>

Also available in: Unified diff