-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.jsp_backup
219 lines (189 loc) · 6.69 KB
/
index.jsp_backup
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
<%@ page import="java.util.*" %>
<jsp:useBean id="PubCloudGenerator" class="org.icapture.tag.PubMed.PubMedCloudGeneratorBean" scope="session" />
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META http-equiv="Content-Style-Type" content="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
</HEAD>
<TITLE>PubCloud</TITLE>
<BODY>
<!-- -------------------------------- Title --------------------------------- -->
<TABLE cellpadding="5" border="0" width="415">
<TR>
<TD><H1>PubCloud</H1></TD>
<TD><SPAN class="fine_print">Publication (<A HREF="http://www.cs.bell-labs.com/cm/cs/who/pfps/temp/web/www2007.org/posters/poster1046.pdf" TARGET="BLANK">PDF</A>) (<A HREF="http://www2007.org/htmlposters/poster1046/" TARGET="BLANK">HTML</A>)</SPAN></TD>
<TD><SPAN class="fine_print"><A HREF="legend.html" TARGET="_blank" ONCLICK="window.open('legend.html', 'PubCloud Legend', 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=no, scrollbars=no, width=258,height=200'); return false">Cloud Legend</A></SPAN></TD>
</TR>
</TABLE>
<!-- ------------------------------------------------------------------------ -->
<FORM method="GET">
<!-- Required for query generation: PubMed Query and Cloud Type -->
<TABLE cellpadding="5" width="850" >
<TR><TD>
<TABLE border="0" width="800">
<TR><TD>
<SPAN class="option_title">PubMed Query: <INPUT TYPE="text" NAME="query" SIZE="100"></SPAN>
</TD></TR>
</TABLE>
</TD></TR>
<TR><TD>
<TABLE border="0" width="500">
<TR>
<TD>
<SPAN class="option_title">Cloud Type: </SPAN>
</TD>
<TD>
<SPAN class="option_text"><INPUT TYPE="radio" NAME="type" VALUE="abstract" CHECKED> Abstracts</SPAN>
</TD>
<TD>
<SPAN class="option_text"><INPUT TYPE="radio" NAME="type" VALUE="author"> Authors</SPAN>
</TD>
<TD>
<SPAN class="option_text"><INPUT TYPE="radio" NAME="type" VALUE="mesh_term"> MeSH Terms</SPAN>
</TD>
</TR>
</TABLE>
</TD></TR>
</TABLE>
<!-- ---------------------------------------------------------- -->
<BR>
<!-- ------------------- Control Panel ------------------------ -->
<TABLE cellpadding="5" width="850" STYLE="border-style:dashed; border-width:thin; border-color:blue">
<TR>
<TD>
<SPAN class="option_panel_title">Control Panel</SPAN>
</TD>
</TR>
<TR>
<TD>
<SPAN class="option_title">Date Range: </SPAN>
</TD>
<TD>
<TABLE cellpadding="5" border="0" width="650">
<TR>
<TD>
<SPAN class="option_text">From <INPUT TYPE="text" NAME="startYear" SIZE="5"> to <INPUT TYPE="text" NAME="endYear" SIZE="5"> (Default: no range)</SPAN>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR>
<TD>
<SPAN class="option_title">Search Option: </SPAN>
</TD>
<TD>
<TABLE cellpadding="5" border="0" width="650">
<TR>
<TD>
<SPAN class="option_text"><INPUT TYPE="radio" NAME="option" VALUE="random" CHECKED> Randomly choose <INPUT TYPE="text" NAME="percent" SIZE="5" VALUE="10">% articles (Default: 10%)</SPAN>
</TD>
</TR>
<TR>
<TD>
<SPAN class="option_text"><INPUT TYPE="radio" NAME="option" VALUE="most_recent"> Most recent <INPUT TYPE="text" NAME="recent" SIZE="5" VALUE="100"> articles (Default: 100 articles)</SPAN>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<!-- --------------------------------------------------------------- -->
<!-- ------------------------ Buttons ------------------------------ -->
<TABLE cellpadding="5" border="0" width="415">
<TR>
<TD>
<INPUT TYPE="submit" VALUE="Generate Cloud">
<INPUT TYPE="reset" VALUE="Reset">
</TD>
</TR>
</TABLE>
<!-- --------------------------------------------------------------_ -->
</FORM>
<%
String query = request.getParameter("query");
String startYear = request.getParameter("startYear");
String endYear = request.getParameter("endYear");
String type = request.getParameter("type");
String option = request.getParameter("option");
String percent = request.getParameter("percent");
String recent = request.getParameter("recent");
int percentValue = 10;
int recentValue = 100;
try {
percentValue = Integer.parseInt(percent);
recentValue = Integer.parseInt(recent);
}
catch (Exception e) {
}
if (query == null) {
//out.println("Await keyword search!");
}
else if (query == "") {
out.println("<FONT COLOR=\"red\"><B>ERROR:</B> You have not entered a PubMed query</FONT><BR>");
}
else if ( (option.equals("random")) && ((percentValue <= 0) || (percentValue > 100)) ) {
out.println("<FONT COLOR=\"red\"><B>ERROR:</B> You have specified an invalid % value</FONT><BR>");
out.println(percentValue + "% selected");
}
else if ( (option.equals("most_recent")) && (recentValue <= 0) ) {
out.println("<FONT COLOR=\"red\"><B>ERROR:</B> You have specified an invalid number of articles</FONT><BR>");
out.println(recentValue + " articles selected");
}
else {
String prevQuery = "";
String newQuery = prevQuery + " " + query;
/************ Session Code ***************/
/*
HttpSession tsession = request.getSession();
String pQuery = tsession.getAttribute("pQuery");
String nQuery = pQuery + " " + query;
tsession.setAttribute("pQuery", nQuery);
*/
/*****************************************/
if (startYear.equals("")) {
startYear = "--";
}
if (endYear.equals("")) {
endYear = "--";
}
out.println("<SPAN class=\"option_text\">");
out.println("Query: <SPAN class=\"key\">" + query + "</SPAN><br>");
out.println("Cloud Type: <SPAN class=\"key\">" + type + "</SPAN><BR>");
out.println("From <SPAN class=\"key\">" + startYear + "</SPAN> to <SPAN class=\"key\">" + endYear + "</SPAN><BR>");
out.println("</SPAN>");
int optionValue = 10;
if (option.equals("random")) {
if (! percent.equals("")) {
optionValue = Integer.parseInt(percent);
}
else {
optionValue = 10;
}
}
else if (option.equals("most_recent")) {
if (! recent.equals("")) {
optionValue = Integer.parseInt(recent);
}
else {
optionValue = 100;
}
}
boolean checkCloud = false;
checkCloud = PubCloudGenerator.mainBuildCloud(newQuery, startYear, endYear, type, option, optionValue);
// make a split search string for later use
String keywordSplitSearchString = newQuery.replace(" ", "+");
out.println("<TABLE border=\"0\"><TR><TD><BR><CENTER>");
String cloudHTML = "";
if (checkCloud == true) {
cloudHTML = PubCloudGenerator.generateHtmlCloud();
}
out.println(cloudHTML);
out.println("</CENTER></TD></TR></TABLE>");
}
%>
<BR>
<SPAN class="fine_print">Comments or questions, please contact: <I><A HREF="mailto:[email protected]">Byron Kuo</A></I>. Copyright (c) 2006</SPAN>
</BODY>
</HTML>