Revision 105
Added by Matt Jones over 24 years ago
src/edu/ucsb/nceas/metacat/MetaCatServlet.java | ||
---|---|---|
394 | 394 |
boolean valid = gxv.validateString(valtext); |
395 | 395 |
|
396 | 396 |
// set content type and other response header fields first |
397 |
response.setContentType("text/plain"); |
|
397 |
response.setContentType("text/html"); |
|
398 |
out.println("<html>"); |
|
399 |
out.println("<head><link rel=\"stylesheet\" type=\"text/css\" " + |
|
400 |
"href=\"/xmltodb/rowcol.css\" /></head>"); |
|
401 |
out.println("<body class=\"emlbody\">"); |
|
398 | 402 |
|
399 | 403 |
if (valid) { |
400 | 404 |
out.println("The input XML is VALID!"); |
401 | 405 |
} else { |
402 |
out.println("The input XML is NOT VALID\n" + gxv.returnErrors()); |
|
406 |
out.println("The input XML is NOT VALID<br />\n<pre>\n" |
|
407 |
+ gxv.returnErrors() + "\n</pre>\n"); |
|
403 | 408 |
//response.setContentType("text/xml"); |
404 | 409 |
//out.println(valtext); |
405 | 410 |
} |
411 |
out.println("</body></html>"); |
|
406 | 412 |
} catch (NullPointerException npe2) { |
407 | 413 |
// set content type and other response header fields first |
408 | 414 |
response.setContentType("text/html"); |
MetaCatServlet.java | ||
---|---|---|
394 | 394 |
boolean valid = gxv.validateString(valtext); |
395 | 395 |
|
396 | 396 |
// set content type and other response header fields first |
397 |
response.setContentType("text/plain"); |
|
397 |
response.setContentType("text/html"); |
|
398 |
out.println("<html>"); |
|
399 |
out.println("<head><link rel=\"stylesheet\" type=\"text/css\" " + |
|
400 |
"href=\"/xmltodb/rowcol.css\" /></head>"); |
|
401 |
out.println("<body class=\"emlbody\">"); |
|
398 | 402 |
|
399 | 403 |
if (valid) { |
400 | 404 |
out.println("The input XML is VALID!"); |
401 | 405 |
} else { |
402 |
out.println("The input XML is NOT VALID\n" + gxv.returnErrors()); |
|
406 |
out.println("The input XML is NOT VALID<br />\n<pre>\n" |
|
407 |
+ gxv.returnErrors() + "\n</pre>\n"); |
|
403 | 408 |
//response.setContentType("text/xml"); |
404 | 409 |
//out.println(valtext); |
405 | 410 |
} |
411 |
out.println("</body></html>"); |
|
406 | 412 |
} catch (NullPointerException npe2) { |
407 | 413 |
// set content type and other response header fields first |
408 | 414 |
response.setContentType("text/html"); |
lib/resultset.xsl | ||
---|---|---|
24 | 24 |
</head> |
25 | 25 |
<body class="emlbody"> |
26 | 26 |
<center> |
27 |
<h1>Query Results</h1> |
|
28 |
<h3>for querystring <xsl:value-of select="resultset/query"/> |
|
29 |
</h3> |
|
27 |
<b>Query Results</b> |
|
28 |
for query <xsl:value-of select="resultset/query"/> |
|
30 | 29 |
</center> |
31 | 30 |
|
32 | 31 |
<form action="/servlets/MetaCatServlet" method="POST"> |
lib/contents.html | ||
---|---|---|
17 | 17 |
<title>MetaCat</title> |
18 | 18 |
</head> |
19 | 19 |
<body bgcolor="white"> |
20 |
<b>MetaCat Query</b> |
|
21 |
<p> |
|
22 |
Simple database query against MetaCat<br> |
|
20 |
<table width="100%"> |
|
21 |
<tr><td colspan="2"> |
|
22 |
<b>MetaCat Query</b> -- a simple database query against MetaCat |
|
23 |
</td></tr> |
|
24 |
<tr><td width="40%" valign="top"> |
|
23 | 25 |
<form action="/servlets/MetaCatServlet" target="right" method="POST"> |
24 | 26 |
<input type="hidden" name="action" value="query"> |
25 | 27 |
<input type="text" name="query" value="NCEAS%" size="15"> |
26 |
<input type="submit" value="Run query"> |
|
27 |
<br /> |
|
28 |
<input type="submit" value="Run query"><br /> |
|
28 | 29 |
Format: |
29 | 30 |
<input type="radio" name="qformat" value="xml">XML |
30 | 31 |
<input type="radio" name="qformat" value="html" checked>HTML |
31 | 32 |
</form> |
32 |
<p> |
|
33 |
<a href="loadxml.html" target="right">Load an XML Document</a> |
|
34 |
<br /><a href="validate.html" target="right">Validate an XML Document</a> |
|
35 |
<br /><a href="docs/" target="top">Browse the API for the Servlet</a> |
|
36 |
</td> |
|
37 |
<td valign="top"> |
|
38 |
<font size="-1"> |
|
33 | 39 |
For the test database, some valid values for the search that produce document |
34 | 40 |
results include "Value1" and "lakename" and maybe "122W" |
35 |
</p> |
|
36 |
<p><a href="loadxml.html" target="right">Load an XML Document</a> |
|
37 |
</p> |
|
38 |
<p><a href="validate.html" target="right">Validate an XML Document</a> |
|
39 |
</p> |
|
40 | 41 |
<p> |
41 | 42 |
To view results that are XML formatted in this demo, it is easiest to use |
42 | 43 |
Internet Explorer 5. Although Netscape browsers will allow you to |
43 | 44 |
download XML documents, only IE5 will display XML at this time. |
44 |
<p><a href="docs/" target="top">Browse the API for the Servlet</a> |
|
45 |
</p> |
|
45 |
</font> |
|
46 |
</td> |
|
47 |
</tr> |
|
48 |
</table> |
|
46 | 49 |
</body> |
47 | 50 |
</html> |
lib/style/resultset.xsl | ||
---|---|---|
24 | 24 |
</head> |
25 | 25 |
<body class="emlbody"> |
26 | 26 |
<center> |
27 |
<h1>Query Results</h1> |
|
28 |
<h3>for querystring <xsl:value-of select="resultset/query"/> |
|
29 |
</h3> |
|
27 |
<b>Query Results</b> |
|
28 |
for query <xsl:value-of select="resultset/query"/> |
|
30 | 29 |
</center> |
31 | 30 |
|
32 | 31 |
<form action="/servlets/MetaCatServlet" method="POST"> |
lib/index.html | ||
---|---|---|
15 | 15 |
<HEAD> |
16 | 16 |
<TITLE>MetaCat</TITLE> |
17 | 17 |
</HEAD> |
18 |
<FRAMESET ROWS="*" FRAMEBORDER=0 BORDER=0>
|
|
18 |
<FRAMESET COLS="*" FRAMEBORDER=0 BORDER=0>
|
|
19 | 19 |
|
20 |
<FRAMESET COLS="250,*" FRAMEBORDER=0 BORDER=0>
|
|
20 |
<FRAMESET ROWS="165,*" FRAMEBORDER=0 BORDER=0>
|
|
21 | 21 |
|
22 | 22 |
<FRAME SRC="contents.html" BORDER=0 NAME="left"> |
23 | 23 |
|
resultset.xsl | ||
---|---|---|
24 | 24 |
</head> |
25 | 25 |
<body class="emlbody"> |
26 | 26 |
<center> |
27 |
<h1>Query Results</h1> |
|
28 |
<h3>for querystring <xsl:value-of select="resultset/query"/> |
|
29 |
</h3> |
|
27 |
<b>Query Results</b> |
|
28 |
for query <xsl:value-of select="resultset/query"/> |
|
30 | 29 |
</center> |
31 | 30 |
|
32 | 31 |
<form action="/servlets/MetaCatServlet" method="POST"> |
contents.html | ||
---|---|---|
17 | 17 |
<title>MetaCat</title> |
18 | 18 |
</head> |
19 | 19 |
<body bgcolor="white"> |
20 |
<b>MetaCat Query</b> |
|
21 |
<p> |
|
22 |
Simple database query against MetaCat<br> |
|
20 |
<table width="100%"> |
|
21 |
<tr><td colspan="2"> |
|
22 |
<b>MetaCat Query</b> -- a simple database query against MetaCat |
|
23 |
</td></tr> |
|
24 |
<tr><td width="40%" valign="top"> |
|
23 | 25 |
<form action="/servlets/MetaCatServlet" target="right" method="POST"> |
24 | 26 |
<input type="hidden" name="action" value="query"> |
25 | 27 |
<input type="text" name="query" value="NCEAS%" size="15"> |
26 |
<input type="submit" value="Run query"> |
|
27 |
<br /> |
|
28 |
<input type="submit" value="Run query"><br /> |
|
28 | 29 |
Format: |
29 | 30 |
<input type="radio" name="qformat" value="xml">XML |
30 | 31 |
<input type="radio" name="qformat" value="html" checked>HTML |
31 | 32 |
</form> |
32 |
<p> |
|
33 |
<a href="loadxml.html" target="right">Load an XML Document</a> |
|
34 |
<br /><a href="validate.html" target="right">Validate an XML Document</a> |
|
35 |
<br /><a href="docs/" target="top">Browse the API for the Servlet</a> |
|
36 |
</td> |
|
37 |
<td valign="top"> |
|
38 |
<font size="-1"> |
|
33 | 39 |
For the test database, some valid values for the search that produce document |
34 | 40 |
results include "Value1" and "lakename" and maybe "122W" |
35 |
</p> |
|
36 |
<p><a href="loadxml.html" target="right">Load an XML Document</a> |
|
37 |
</p> |
|
38 |
<p><a href="validate.html" target="right">Validate an XML Document</a> |
|
39 |
</p> |
|
40 | 41 |
<p> |
41 | 42 |
To view results that are XML formatted in this demo, it is easiest to use |
42 | 43 |
Internet Explorer 5. Although Netscape browsers will allow you to |
43 | 44 |
download XML documents, only IE5 will display XML at this time. |
44 |
<p><a href="docs/" target="top">Browse the API for the Servlet</a> |
|
45 |
</p> |
|
45 |
</font> |
|
46 |
</td> |
|
47 |
</tr> |
|
48 |
</table> |
|
46 | 49 |
</body> |
47 | 50 |
</html> |
index.html | ||
---|---|---|
15 | 15 |
<HEAD> |
16 | 16 |
<TITLE>MetaCat</TITLE> |
17 | 17 |
</HEAD> |
18 |
<FRAMESET ROWS="*" FRAMEBORDER=0 BORDER=0>
|
|
18 |
<FRAMESET COLS="*" FRAMEBORDER=0 BORDER=0>
|
|
19 | 19 |
|
20 |
<FRAMESET COLS="250,*" FRAMEBORDER=0 BORDER=0>
|
|
20 |
<FRAMESET ROWS="165,*" FRAMEBORDER=0 BORDER=0>
|
|
21 | 21 |
|
22 | 22 |
<FRAME SRC="contents.html" BORDER=0 NAME="left"> |
23 | 23 |
|
Also available in: Unified diff
minor formatting and display update