results.jsp 24.6 KB
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 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" %>
<%@ page pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=utf-8" %>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
<%@ page import="pt.keep.metarepository.core.configuration.ConfigurationManager" %>
<%@ page import="pt.keep.metarepository.modules.webui.configuration.Constants" %>
<%@ page import="pt.keep.metarepository.core.localization.*" %>
<%@ page import="pt.keep.metarepository.core.database.connection.*" %>
<%@ page import="pt.keep.metarepository.core.web.io.*" %>
<%@ page import="pt.keep.metarepository.core.util.data.*" %>
<%@ page import="pt.keep.metarepository.core.database.orm.interfaces.*" %>
<%@ page import="pt.keep.metarepository.core.database.orm.entities.*" %>
<%@ page import="pt.keep.metarepository.modules.webui.io.session.*" %>
<%@ page import="pt.keep.metarepository.modules.webui.io.filters.*" %>
<%@ page import="pt.keep.metarepository.modules.webui.transform.*" %>
<%@ page import="pt.keep.metarepository.core.util.data.ColumnOrder"%>
<%@ page import="pt.keep.metarepository.core.database.sql.OrderType"%>
<%@ page import="pt.keep.metarepository.modules.webui.util.WebuiUtils"%>
<%@ page import="org.apache.log4j.*"%>
<%@ taglib uri="keep/tags/KeepTags.tld" prefix="KEEP" %>
<% String lang = LocalizationFetcher.getLocaleString(request,response); %>
<html xmlns="http://www.w3.org/1999/xhtml" lang="<%=lang%>" xml:lang="<%=lang%>">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<jsp:include page="./metatags.jsp"></jsp:include>
	<title><KEEP:lang lang='<%=lang %>' key="webui.general.rcaap.title" /></title>
	
	<link rel="icon" href="favicon.ico" type="image/x-icon" />
	<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
	<link rel="alternate" type="application/rss+xml" title="RCAAP RSS" href="<KEEP:url url='/rss.xml' />" />
	
	<link rel="search" type="application/opensearchdescription+xml" href="opensearch.xml" title="RCAAP Search" />
	<link rel="stylesheet" href="_css/init.css" type="text/css" media="screen,projection" />
	<link rel="stylesheet" href="_css/results.css" type="text/css" media="screen,projection" />
	
	<!--[if IE]>
	<link rel="stylesheet" href="_css/results_ie.css" type="text/css" media="screen,projection" />
	<![endif]-->

	<link rel="stylesheet" href="_css/results_<%=lang %>.css" type="text/css" media="screen,projection" />

	<script type="text/javascript" src="_js/utils.js"></script>
	<script type="text/javascript">
		var txtMoreOptions = '<KEEP:lang lang='<%=lang %>' key="webui.results.see.more.items" />';
		var txtHideOptions = '<KEEP:lang lang='<%=lang %>' key="webui.results.see.few.items" />';
	</script>
</head>
<%
try {
	Logger log = Logger.getRootLogger();
	ArchiveInterface arcInterface = new ArchiveInterface(getServletContext());
	List<Archive> tmp = arcInterface.findAllActive();
	//List<Archive> tmp = arcInterface.findAll();
	arcInterface.closeConnection();
	TreeMap<String,Archive> arcs = new TreeMap<String,Archive>();
	for (Archive arq : tmp) {
		arcs.put(arq.getId(),arq);
	}

	SearchParameters searchParameters = (SearchParameters) session.getAttribute(Constants.SESSION_SEARCH_PARAMS);
	SearchResults searchResults = (SearchResults) session.getAttribute(Constants.SESSION_RESULTS);
	FiltersResults filters = (FiltersResults) session.getAttribute(Constants.SESSION_FILTERS);
	
	// Documents
	List<DocumentTransform> documents = searchResults.getResults();

	// Set Display Configuration 
	int mini_mode = ConfigurationManager.getProperty("webui.results.filters.items.number.mini",5);
	int max_mode = ConfigurationManager.getProperty("webui.results.filters.items.number.full",5);
	
	// Filters
	FilterList authors = filters.getAuthors(max_mode,mini_mode);
	FilterList dates = filters.getDates(max_mode,mini_mode);
	FilterList types = filters.getTypes(max_mode,mini_mode);
	FilterList archives = filters.getRepositories(max_mode,mini_mode);
	FilterList subjects = filters.getSubjects(max_mode,mini_mode);
	
	// Pagination
	Pair<Integer,Integer> listedLimits = WebuiUtils.getPagesListedLimits(searchParameters.getPage(),searchResults.getMaxPages());
	int firstListed = listedLimits.getFirst();
	int lastListed = listedLimits.getSecond();

	FilterItem item;
%>
<body>
<div id="siteBox">
<div id="container">
	<jsp:include page="header.jsp" />
	<div class="floatBox">
		<div id="col1" class="floatLeft">
			<% if (searchResults.getTotal() == 1) { %>
			<h1 style="font-size: 0.7em;"><%=String.format(LocalizationManager.getMessage("webui.results.format.result",lang),searchResults.getTotal(),searchParameters.getPage(),searchResults.getMaxPages())%></h1>
			<% } else { %>
			<h1 style="font-size: 0.7em;"><%=String.format(LocalizationManager.getMessage("webui.results.format.results",lang),searchResults.getTotal(),searchParameters.getPage(),searchResults.getMaxPages())%></h1>
			<% } %>
			<div class="floatBox">
				<div class="floatLeft resultsInfo">
					<% if (searchParameters.getText() != null && !searchParameters.getText().equals("")) { %>
					<span class="smallTxt"><KEEP:lang lang='<%=lang %>' key="webui.results.search.by"/><strong> <%=searchParameters.getText() %></strong></span><br />
					<% } %>
					<span class="smallTxt"><KEEP:lang lang='<%=lang %>' key="webui.results.order.by"/>
						<% if (searchParameters.getOrderColumn() == ColumnOrder.RELEVANCE) { %>
						<strong><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.relevance" /></strong>
						<% } else if (searchParameters.getOrderColumn() == ColumnOrder.ISSUE_DATE) {%>
						<strong><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.date" /></strong>
						<% } else { %>
						<strong><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.views" /></strong>
						<% } %>
					</span>
				</div>
				<div class="floatRight">
					<form class="frmOrder" action="<KEEP:url url='/search' />" method="post">
						<input type="hidden" name="<%=Constants.REQUEST_FORMNAME %>" value="<%=SearchType.SORT.toString() %>" />
						<input type="hidden" name="<%=Constants.REQUEST_TEXT %>" value="<%=(searchParameters.getText() == null) ? "" : searchParameters.getText() %>" />
						<input type="hidden" name="<%=Constants.REQUEST_ACTUAL_PAGE %>" value="<%=searchParameters.getPage() %>" />
						<label for="selField">
							<span><KEEP:lang lang='<%=lang %>' key="webui.results.order.by"/>:</span>
							<select name="<%=Constants.REQUEST_ORDER_COLUMN %>" id="selField">
								<%--! if (searchParameters.getText() != null && !searchParameters.getText().equals("")) { --%>
									<% if (searchParameters.getOrderColumn() == ColumnOrder.RELEVANCE) { %>
										<option value="<%=ColumnOrder.RELEVANCE.toString()%>" selected="selected"><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.relevance" /></option>
									<% } else { %>
										<option value="<%=ColumnOrder.RELEVANCE.toString() %>"><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.relevance" /></option>
									<%-- } --%>
								<% } %>
								<% if (searchParameters.getOrderColumn() == ColumnOrder.ISSUE_DATE) { %>
									<option value="<%=ColumnOrder.ISSUE_DATE.toString() %>" selected="selected"><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.date" /></option>
								<% } else { %>
									<option value="<%=ColumnOrder.ISSUE_DATE.toString() %>"><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.date" /></option>
								<% } %>
								<%--
								<% if (searchParameters.getOrderColumn() == ColumnOrder.VIEWS) { %>
								<option value="<%=ColumnOrder.VIEWS.toString() %>" selected="selected"><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.view" /></option>
								<% } else { %>
								<option value="<%=ColumnOrder.VIEWS.toString() %>"><KEEP:lang lang='<%=lang %>' key="webui.results.presentation.order.views" /></option>
								<% } %>
								--%>
							</select>
						</label>
						<label for="selOrder">
							<span><KEEP:lang lang='<%=lang %>' key="webui.results.order.label" />:</span>
							<select name="<%=Constants.REQUEST_ORDER_TYPE %>" id="selOrder">
								<% if (searchParameters.getOrderType() == OrderType.ASC) { %>
								<option value="<%=OrderType.ASC.toString() %>" selected="selected"><KEEP:lang lang='<%=lang %>' key="webui.results.order.asc" /></option>
								<% } else { %>
								<option value="<%=OrderType.ASC.toString() %>"><KEEP:lang lang='<%=lang %>' key="webui.results.order.asc" /></option>
								<% } %>
								<% if (searchParameters.getOrderType() == OrderType.DESC) { %>
								<option value="<%=OrderType.DESC.toString() %>" selected="selected"><KEEP:lang lang='<%=lang %>' key="webui.results.order.desc" /></option>
								<% } else { %>
								<option value="<%=OrderType.DESC.toString() %>"><KEEP:lang lang='<%=lang %>' key="webui.results.order.desc" /></option>
								<% } %>
							</select>
						</label>
						<div class="btnBox floatLeft">
							<input type="submit" name="search" value="<KEEP:lang lang='<%=lang %>' key="webui.results.refresh" />" />
						</div>
					</form>
				</div>
			</div>
			<!-- PAGE NAVIGATION (TOP) //-->
			<div class="pagNavBox">
				<div class="floatLeft">
					<% if (searchParameters.getPage() > 1) { %>
					<span class="lnkFrst"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=1"><KEEP:lang lang='<%=lang %>' key="webui.results.first.page" /></a></span>
					<span class="lnkPrv"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=searchParameters.getPage()-1%>"><KEEP:lang lang='<%=lang %>' key="webui.results.previous.page" /></a></span>
					<% } else { %>
					<span class="lnkFrst off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.first.page" /></a></span>
					<span class="lnkPrv off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.previous.page" /></a></span>
					<% } %>
				</div>
				
				<div class="floatLeft pagLnkBox">
					<span class="pagesTxt"><KEEP:lang lang='<%=lang %>' key="webui.results.goto.page" />:</span>
					<% for (int i = firstListed;i <= lastListed;i++) { %>
					<% if (i == searchParameters.getPage()) { %>
					<span class="on"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=i %>" title="<KEEP:lang lang='<%=lang %>' key="webui.results.goto.page" /> <%=i %>"><%=i %></a></span>
					<% } else { %>
					<span><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=i %>" title="<KEEP:lang lang='<%=lang %>' key="webui.results.goto.page" /> <%=i %>"><%=i %></a></span>
					<% } } %>
				</div>
				
				<div class="floatLeft">
					<% if (searchParameters.getPage() < searchResults.getMaxPages()) { %>
					<span class="lnkNxt"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=searchParameters.getPage()+1%>"><KEEP:lang lang='<%=lang %>' key="webui.results.next.page" /></a></span>
					<span class="lnkLst"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=searchResults.getMaxPages()%>"><KEEP:lang lang='<%=lang %>' key="webui.results.last.page" /></a></span>
					<% } else { %>
					<span class="lnkNxt off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.next.page" /></a></span>
					<span class="lnkLst off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.last.page" /></a></span>
					<% } %>
				</div>

				<div class="floatRight">
					<a href="<KEEP:url url='/rss.xml' />?<%=searchParameters.buildSearchQuery()%>" class="rssLnk2"><KEEP:lang lang='<%=lang %>' key="webui.results.rss" /></a>
				</div>
			</div>
			<!-- LIST OF RESULTS //-->
			<div class="listBox">
			<% 	int it=1, value=0;
				for (DocumentTransform actual : documents) {
					value = searchParameters.getPage()==1?it:(it+((searchParameters.getPage()-1)*10));
					it++;
			%>
				<div class="sep"><hr /></div>
				<% Archive archive = arcs.get(actual.getArchive_id()); %>
				<div class="listItem">
					<h2>
						<% if(actual.getLink()!=null && !actual.getLink().equals("")){ %>
							<a target="_blank" href="<%=actual.getLink()%>" title="<%=value %>. <%=actual.getAllTitle(true) %>"><%=actual.getTitle()%></a>
						<% }else{ %>
							<%=actual.getTitle()%>
						<% } %>
						<% if(ConfigurationManager.getProperty("solr.show_score_in_results_page", false)){ %>
							<span style="font-size: 10px;color:#666">(Score:<%=actual.getScore() %>)</span>
						<% }%>	
					</h2>
					<em><%=actual.getAuthors() %></em>
					<p>
						<%=actual.getDescription() %>					
					</p>

					<div class="floatBox">
						<div class="info floatLeft">
							<strong><KEEP:lang lang='<%=lang %>' key="webui.results.item.date" />:</strong> <%=actual.getIssue_date()%>
							&nbsp;&nbsp;|&nbsp;&nbsp;
							<strong><KEEP:lang lang='<%=lang %>' key="webui.results.item.origin" />:</strong> <a target="_blank" href="<%=archive.getHomePage() %>"><%=archive.getName()%></a>
						</div>
						
						<div class="floatRight">
							<a href="<KEEP:url url='/detail.jsp' />?id=<%=actual.getId()%>" title="<%=value %>. <KEEP:lang lang='<%=lang %>' key="webui.results.item.more.info.about" /> <%=actual.getTitle()%>">
								<strong><KEEP:lang lang='<%=lang %>' key="webui.results.item.more.info" /></strong>
							</a>
						</div>
					
					</div>
				</div>
			<% } %>
			</div>
			<!-- LIST OF RESULTS : END //-->
			
			<!-- PAGE NAVIGATION (BOTTOM) //-->
			<div class="pagNavBox">
				<div class="floatLeft">
					<% if (searchParameters.getPage() > 1) { %>
					<span class="lnkFrst"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=1"><KEEP:lang lang='<%=lang %>' key="webui.results.first.page" /></a></span>
					<span class="lnkPrv"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=searchParameters.getPage()-1%>"><KEEP:lang lang='<%=lang %>' key="webui.results.previous.page" /></a></span>
					<% } else { %>
					<span class="lnkFrst off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.first.page" /></a></span>
					<span class="lnkPrv off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.previous.page" /></a></span>
					<% } %>
				</div>
				
				<div class="floatLeft pagLnkBox">
					<span class="pagesTxt"><KEEP:lang lang='<%=lang %>' key="webui.results.goto.page" />:</span>
					<% for (int i = firstListed;i <= lastListed;i++) { %>
					<% if (i == searchParameters.getPage()) { %>
					<span class="on"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=i %>" title="<KEEP:lang lang='<%=lang %>' key="webui.results.goto.page" /> <%=i %>"><%=i %></a></span>
					<% } else { %>
					<span><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=i %>" title="<KEEP:lang lang='<%=lang %>' key="webui.results.goto.page" /> <%=i %>"><%=i %></a></span>
					<% } } %>
				</div>
				
				<div class="floatLeft">
					<% if (searchParameters.getPage() < searchResults.getMaxPages()) { %>
					<span class="lnkNxt"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=searchParameters.getPage()+1%>"><KEEP:lang lang='<%=lang %>' key="webui.results.next.page" /></a></span>
					<span class="lnkLst"><a href="<KEEP:url url='/search' />?<%=Constants.REQUEST_FORMNAME%>=<%=SearchType.SORT.toString() %>&amp;<%=Constants.REQUEST_ACTUAL_PAGE %>=<%=searchResults.getMaxPages()%>"><KEEP:lang lang='<%=lang %>' key="webui.results.last.page" /></a></span>
					<% } else { %>
					<span class="lnkNxt off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.next.page" /></a></span>
					<span class="lnkLst off"><a><KEEP:lang lang='<%=lang %>' key="webui.results.last.page" /></a></span>
					<% } %>
				</div>

				<div class="floatRight">
					<a href="<KEEP:url url='/rss.xml' />?<%=searchParameters.buildSearchQuery()%>" class="rssLnk2"><KEEP:lang lang='<%=lang %>' key="webui.results.rss" /></a>
				</div>
			</div>
		</div>

		<!--	FILTERS	-->
		<div id="col2" class="floatRight">
			<div class="sepTop"><hr /></div>
			<form id="frmSearch" action="<KEEP:url url='/search' />" method="post">
			<input type="hidden" name="<%=Constants.REQUEST_FORMNAME %>" value="<%=SearchType.REFINE.toString() %>" />
			<input type="hidden" name="<%=Constants.REQUEST_ORDER_COLUMN %>" value="<%=searchParameters.getOrderColumn().toString() %>" />
			<input type="hidden" name="<%=Constants.REQUEST_ORDER_TYPE %>" value="<%=searchParameters.getOrderType().toString() %>" />
			<div id="titleSearchInfo">
				<h3><%=searchResults.getTotal() %> <KEEP:lang lang='<%=lang %>' key='webui.results.filters.results' /></h3>
				<p><KEEP:lang lang='<%=lang %>' key='webui.results.filters.results.below' /></p>
			</div>
			<!--	SEARCH PARAMS : TEXT	-->
			<div id="grp1" class="fldGroup">
				<h4><span><KEEP:lang lang='<%=lang %>' key='webui.results.filters.search.text.label' /></span></h4>
				<div id="flds1" class="flds">
					<label for="txt"><KEEP:lang lang='<%=lang %>' key='webui.results.filters.search.text.label' /></label>
					<input type="text" name="<%=Constants.REQUEST_TEXT %>" id="txt" value="<%=(searchParameters.getText() == null) ? "" : searchParameters.getText().replaceAll("\"","&quot;") %>" class="txtFld" />
				</div>
			</div>
			<div class="btnBox"><input type="submit" name="pesquisar" value="<KEEP:lang lang='<%=lang %>' key='webui.results.filters.refresh' />" /></div>
			<div id="titleNarrowSearch">
				<h3><KEEP:lang lang='<%=lang %>' key='webui.results.filters.refine.label' /></h3>
				<p><KEEP:lang lang='<%=lang %>' key='webui.results.filters.refine.label.below' /></p>
			</div>
			<!--	SEARCH PARAMS : AUTOR	-->
			<% if (!authors.isEmpty()) { %>
			<div id="grp2" class="fldGroup">
				<h4><span><KEEP:lang lang='<%=lang %>' key='webui.results.filters.refine.author.label' /></span></h4>
				<div id="flds2" class="flds">
				<% while (authors.next()) { %>
					<% if (!authors.reachedMini()) { %>
					<label for="a<%=authors.index() %>" title="<%=authors.item().getName()%> (<%=authors.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_AUTHOR %>" id="a<%=authors.index() %>" value="<%=StringEscapeUtils.escapeHtml(authors.item().getName()) %>" /><%=authors.item().getLimitedName() %> (<%=authors.item().getCount()%>)</label>
					<% } else { %>
					<label for="a<%=authors.index() %>" class="off" title="<%=authors.item().getName()%> (<%=authors.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_AUTHOR %>" id="a<%=authors.index() %>" value="<%=StringEscapeUtils.escapeHtml(authors.item().getName()) %>" /><%=authors.item().getLimitedName() %> (<%=authors.item().getCount()%>)</label>
					<% } %>
					<br />
				<% } %>
				</div>
			</div>
			<% } %>
			<!--	SEARCH PARAMS : DATE	-->
			<% if (!dates.isEmpty()) { %>
			<div id="grp3" class="fldGroup">
				<h4><span><KEEP:lang lang='<%=lang %>' key='webui.results.filters.refine.date.label' /></span></h4>
				<div id="flds3" class="flds">
				<% while (dates.next()) { %>
					<% if (!dates.reachedMini()) { %>
					<label for="b<%=dates.index() %>" title="<%=dates.item().getName()%> (<%=dates.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_DATE %>" id="b<%=dates.index() %>" value="<%=dates.item().getName() %>" /><%=dates.item().getLimitedName() %> (<%=dates.item().getCount()%>)</label><br />
					<% } else { %>
					<label for="b<%=dates.index() %>" class="off" title="<%=dates.item().getName()%> (<%=dates.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_DATE %>" id="b<%=dates.index() %>" value="<%=dates.item().getName() %>" /><%=dates.item().getLimitedName() %> (<%=dates.item().getCount()%>)</label><br />
					<% } %>
				<% } %>
				</div>
			</div>
			<% } %>
			<!-- SEARCH PARAMS : DOCUMENT TYPE -->
			<% if (!types.isEmpty()) { %>
			<div id="grp4" class="fldGroup">
				<h4><span><KEEP:lang lang='<%=lang %>' key='webui.results.filters.refine.doctype.label' /></span></h4>
				<div id="flds4" class="flds">
				<% while (types.next()) { %>
					<% if (!types.reachedMini()) { %>
					<label for="c<%=types.index() %>" title="<%=types.item().getTranslation("webui.doctype.")%> (<%=types.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_DOCTYPE %>" id="c<%=types.index() %>" value="<%=types.item().getName() %>" /><%=types.item().getLimitedTranslation("webui.doctype.") %> (<%=types.item().getCount()%>)</label><br />
					<% } else { %>
					<label for="c<%=types.index() %>" class="off" title="<%=types.item().getTranslation("webui.doctype.")%> (<%=types.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_DOCTYPE %>" id="c<%=types.index() %>" value="<%=types.item().getName() %>" /><%=types.item().getLimitedTranslation("webui.doctype.") %> (<%=types.item().getCount()%>)</label><br />
					<% } %>
				<% } %>
				</div>
			</div>
			<% } %>
			<!--	SEARCH PARAMS : ARCHIVE	-->
			<% if (!archives.isEmpty()) { %>
			<div id="grp5" class="fldGroup">
				<h4><span><KEEP:lang lang='<%=lang %>' key='webui.results.filters.refine.repository.label' /></span></h4>
				<div id="flds5" class="flds closed">
				<% while (archives.next()) { String name = arcs.get(archives.item().getName()).getName(); String mini = WebuiUtils.limit(name,Constants.MAX_FILTER_TEXT); %>
					<% if (!archives.reachedMini()) { %>
					<label for="d<%=archives.index() %>" title="<%=name%> (<%=archives.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_REPOSITORY %>" id="d<%=archives.index() %>" value="<%=archives.item().getName() %>" /><%=mini%> (<%=archives.item().getCount()%>)</label><br />
					<% } else { %>
					<label for="d<%=archives.index() %>" class="off" title="<%=name%> (<%=archives.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_REPOSITORY %>" id="d<%=archives.index() %>" value="<%=archives.item().getName() %>" /><%=mini %> (<%=archives.item().getCount()%>)</label><br />
					<% } %>
				<% } %>
				</div>
			</div>
			<% } %>
			<!--	SEARCH PARAMS : SUBJECT	-->
			<% if (!subjects.isEmpty()) { %>
			<div id="grp6" class="fldGroup">
				<h4><span><KEEP:lang lang='<%=lang %>' key='webui.results.filters.refine.subject.label' /></span></h4>
				<div id="flds6" class="flds closed">
				<% while (subjects.next()) { %>
					<% if (!subjects.reachedMini()) { %>
					<label for="e<%=subjects.index() %>" title="<%=subjects.item().getName()%> (<%=subjects.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_SUBJECT %>" id="e<%=subjects.index() %>" value="<%=subjects.item().getName() %>" /><%=subjects.item().getLimitedName() %> (<%=subjects.item().getCount()%>)</label><br />
					<% } else { %>
					<label for="e<%=subjects.index() %>" class="off" title="<%=subjects.item().getName()%> (<%=subjects.item().getCount()%>)"><input type="checkbox" name="<%=Constants.REQUEST_SUBJECT %>" id="e<%=subjects.index() %>" value="<%=subjects.item().getName() %>" /><%=subjects.item().getLimitedName() %> (<%=subjects.item().getCount()%>)</label><br />
					<% } %>
				<% } %>
				</div>
			</div>
			<% } %>
			<div class="btnBox"><input type="submit" name="pesquisar" value="<KEEP:lang lang='<%=lang %>' key='webui.results.filters.refresh' />" /></div>	
			</form>
			<div class="sepBot"><hr /></div>
		</div>
	</div>
	<br class="clear" />

    <jsp:include page="footer.jsp" />

</div>
</div>
	<script type="text/javascript" src="_js/results_init.js"></script>
	<noscript> 
	JS usado serve para formatar elementos, não tem conteúdos dinâmicos
	</noscript>
	<script type="text/javascript">
		var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
		document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
	</script>
	<noscript>
	Para o Google Analytics
	</noscript>
	<script type="text/javascript">
		try {
			var pageTracker = _gat._getTracker("UA-6710497-1");
			pageTracker._trackPageview();
		} catch(err) {}
	</script>
	<noscript>
	Para o Google Analytics
	</noscript>
</body>
<%
} catch (Exception e) { 
		//out.print(e.toString());
	response.sendRedirect("error.jsp");
}
%>
</html>