Revision 433
Added by berkley over 24 years ago
src/edu/ucsb/nceas/metacat/marine/marineServlet.java | ||
---|---|---|
49 | 49 |
response.setContentType("text/html"); |
50 | 50 |
trans.transformXMLDocument(resultdoc, "-//NCEAS//marineresultset//EN", |
51 | 51 |
"-//W3C//HTML//EN", out); |
52 |
util.returnConnection(conn);
|
|
52 |
util.returnConnection(conn); |
|
53 | 53 |
util.closeConnections(); |
54 | 54 |
} |
55 | 55 |
catch(Exception e) |
... | ... | |
100 | 100 |
} |
101 | 101 |
return query.toString(); |
102 | 102 |
} |
103 |
|
|
104 |
/** |
|
105 |
* decodes the mouse click information coming from the client. |
|
106 |
* @param params the parameters from the CGI |
|
107 |
* @return action the action to be performed or "error" if an error was |
|
108 |
* generated |
|
109 |
*/ |
|
110 |
protected String decodeMouseAction(Hashtable params) |
|
111 |
{ |
|
112 |
// Determine what type of request the user made |
|
113 |
// if the action parameter is set, use it as a default |
|
114 |
// but if the ypos param is set, calculate the action needed |
|
115 |
String action=null; |
|
116 |
long ypos = 0; |
|
117 |
try { |
|
118 |
ypos = (new Long(((String[])params.get("ypos"))[0]).longValue()); |
|
119 |
//System.out.println("<P>YPOS IS " + ypos); |
|
120 |
if (ypos <= 13) { |
|
121 |
action = "getabstract"; |
|
122 |
} else if (ypos > 13 && ypos <= 25) { |
|
123 |
action = "getdocument"; |
|
124 |
} else if (ypos > 25) { |
|
125 |
action = "getdatadoc"; |
|
126 |
} |
|
127 |
return action; |
|
128 |
} catch (Exception npe) { |
|
129 |
// |
|
130 |
// MBJ -- NOTE that this should be handled more gracefully with |
|
131 |
// the new exception infrastructure -- this "error" return |
|
132 |
// value is inappropriate |
|
133 |
//out.println("<P>Caught exception looking for Y value."); |
|
134 |
return "error"; |
|
135 |
} |
|
136 |
} |
|
103 | 137 |
} |
104 | 138 |
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
|
|
114 |
|
|
115 |
|
|
116 |
|
|
117 |
|
|
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
Also available in: Unified diff
no message