blob: 058b3417e4e9fcaf45f951d280aa9ba50bdb1448 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2005, 2007 IBM Corporation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
IBM Corporation - initial implementation
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:param name="searchTitleText"/>
<xsl:param name="label1Text"/>
<xsl:param name="label2Text"/>
<xsl:param name="label3Text"/>
<xsl:param name="lable4Text"/>
<xsl:param name="searchButtonText"/>
<xsl:template match="/Search">
<xsl:variable name="webAppName"><xsl:value-of select="@webAppName"/></xsl:variable>
<html>
<head>
<title><xsl:value-of select="$searchTitleText"/></title>
<link rel="StyleSheet" href="./../css/default.css" type="text/css"/>
<script type="text/javascript" language="JavaScript">
var webAppName= '<xsl:value-of select="$webAppName"/>';
function createRequest() {
try {
request = new XMLHttpRequest();
} catch (tryMs) {
try {
request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (otherMs) {
try {
request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed) {
request = null;
}
}
}
}
function doSearch() {
var searchString = document.searchForm.searchInput.value;
var resultsPerPage = document.searchForm.searchScopeSizePerPage.value;
var url="\/" + webAppName + "\/SearchServlet?searchString=" + escape(searchString) + "&amp;hitsPerPage=" + resultsPerPage;
createRequest();
request.open("GET", url, true);
request.onreadystatechange = updatePage;
request.send(null);
}
function updatePage() {
if (request.readyState == 4) {
var rDiv = document.getElementById("container");
if (rDiv != null)
rDiv.parentNode.removeChild(rDiv);
rDiv = document.createElement("div");
rDiv.setAttribute("id", "container");
rDiv.innerHTML = request.responseText;
var resultsContainer = document.getElementById("results");
resultsContainer.appendChild(rDiv);
}
}
function getPrevNextPage(url) {
createRequest();
request.open("GET", url, true);
request.onreadystatechange = updatePage;
request.send(null);
}
</script>
</head>
<body bgcolor="#FFFFFF">
<form id="searchForm" name="searchForm" action="javascript:doSearch();" >
<table border="0" cellspacing="0" cellpadding="0" align="left">
<tr>
<td>
<input ucfirst="false" trim="true" value="" name="searchString" type="text" id="searchInput"/>
</td>
<td>
<input value="Search" caption="" style="vertical-align:middle" id="searchButton" type="button" onClick="doSearch(); return false;"/>
</td>
<td>
<select name="searchScopeSizePerPage" id="searchScopeSizePerPage" onClick="doSearch(); return false;">
<option selected="selected" value="10">10</option>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
</select>
</td>
</tr>
</table>
</form>
<br/><br/>
<div id="results"></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>