%
' ********** SET VARIABLES **********
' *** Setting the Form Logo:
' FormLogo = "is2logo.gif"
'
' *** Setting the Form's background pattern.
' FormBG = "background = " & chr(34) & "is2bkgnd.gif" & chr(34)
FormBG = "bgcolor = " & chr(34) & "#FFFFFF" & chr(34)
' *** Modifying the Form's Search Scope.
if Request.Form("FormScope") <> "" then
FormScope = Request.Form("FormScope")
elseif Request.QueryString("FormScope") <> "" then
FormScope = Request.QueryString("FormScope")
else
FormScope = "/"
end if
' *** Modifying the Number of Returned Query Results.
if Request.Form("PageSize") <> "" then
PageSize = Request.Form("PageSize")
elseif Request.QueryString("PageSize") <> "" then
PageSize = Request.QueryString("PageSize")
else
PageSize = 10
end if
' *** Setting the Locale.
if Request.Form("SiteLocale") <> "" then
SiteLocale = Request.Form("SiteLocale")
elseif Request.QueryString("SiteLocale") <> "" then
SiteLocale = Request.QueryString("SiteLocale")
else
SiteLocale = "EN-US"
end if
' *** Setting the Catalog to search.
if Request.Form("SearchCatalog") <> "" then
SearchCatalog = Request.Form("SearchCatalog")
elseif Request.QueryString("SearchCatalog") <> "" then
SearchCatalog = Request.QueryString("SearchCatalog")
else
SearchCatalog = "MOH"
end if
' *** Setting the Title
if Request.Form("Title") <> "" then
Title = Request.Form("Title")
elseif Request.QueryString("Title") <> "" then
Title = Request.QueryString("Title")
else
Title = "MOH"
end if
' ********** END QUICK CUSTOMIZATION SECTIONS ***********
%>
<%=Title%>
<%
' Set Initial Conditions
NewQuery = FALSE
UseSavedQuery = FALSE
SearchString = ""
QueryForm = Request.ServerVariables("PATH_INFO")
' Did the user press a SUBMIT button to execute the form? If so get the form variables.
if Request.ServerVariables("REQUEST_METHOD") = "POST" or Request.QueryString("METHOD") = "POST" then
if Request.Form("SearchString") <> "" then
SearchString = Request.Form("SearchString")
else
SearchString = Request.QueryString("SearchString")
end if
if Request.Form("FreeText") <> "" then
FreeText = Request.Form("FreeText")
else
FreeText = Request.QueryString("FreeText")
end if
FMMod = Request.Form("FMMod")
FMModDate = Request.Form("FMModDate")
DocAuthorRestriction = Request.Form("DocAuthorRestriction")
FSRest = Request.Form("FSRest")
FSRestVal = Request.Form("FSRestVal")
FSRestOther = Request.Form("FSRestOther")
if Request.Form("SortBy") <> "" then
SortBy = Request.Form("SortBy")
else
SortBy = "Rank[d],DocTitle"
end if
' NOTE: this will be true only if the button is actually pushed.
if Request.Form("Action") = "Go" or Request.QueryString("Action") = "Go" then
NewQuery = TRUE
RankBase=1000
end if
end if
if Request.ServerVariables("REQUEST_METHOD") = "GET" and Request.QueryString("METHOD") <> "POST" then
SearchString = Request.QueryString("qu")
FreeText = Request.QueryString("FreeText")
FormScope = Request.QueryString("sc")
RankBase = Request.QueryString("RankBase")
FMMod = Request.QueryString("FMMod")
FMModDate = Request.QueryString("FMModDate")
DocAuthorRestriction = Request.QueryString("DocAuthorRestriction")
FSRest = Request.QueryString("FSRest")
FSRestVal = Request.QueryString("FSRestVal")
FSRestOther = Request.QueryString("FSRestOther")
if Request.QueryString("SortBy") <> "" then
SortBy = Request.QueryString("SortBy")
else
SortBy = "Rank[d],DocTitle"
end if
if Request.QueryString("pg") <> "" then
NextPageNumber = Request.QueryString("pg")
NewQuery = FALSE
UseSavedQuery = TRUE
else
NewQuery = SearchString <> ""
end if
end if
%>
>
SITE SEARCH
<%
if NewQuery then
set Session("Query") = nothing
set Session("Recordset") = nothing
NextRecordNumber = 1
' Remove any leading and ending quotes from SearchString
SrchStrLen = len(SearchString)
if left(SearchString, 1) = chr(34) then
SrchStrLen = SrchStrLen-1
SearchString = right(SearchString, SrchStrLen)
end if
if right(SearchString, 1) = chr(34) then
SrchStrLen = SrchStrLen-1
SearchString = left(SearchString, SrchStrLen)
end if
' Remove any unwanted file types from results
CompSearch = SearchString
ExcludeFiles = " & NOT #filename *.aas & NOT #filename *.reg & NOT #filename *.mdb & NOT #filename *.vmt & NOT #filename *.fla & NOT #filename *.apj & NOT #filename *.png & NOT #filename *.css & NOT #filename *.dwt & NOT #filename *.chm"
if FreeText = "on" then
CompSearch = "$contents " & chr(34) & CompSearch & chr(34) & ExcludeFiles
else
CompSearch = CompSearch & ExcludeFiles
end if
if FMMod <> "" AND FMMod <> "any" then
if FMMod <> "since" then
CompSearch = "(@Write > " + FMMod + ") " + " & " + CompSearch
else
CompSearch = "(@Write > " + FMModDate + ") " + " & " + CompSearch
end if
end if
if FSRest = "" then
FSRest = ">"
end if
if FSRestVal = "" then
FSRestVal = "any"
end if
if FSRestVal <> "any" then
if FSRestVal <> "other" then
CompSearch = "(@Size " + FSRest + FSRestVal + ") " + " & " + CompSearch
else
CompSearch = "(@Size " + FSRest + FSRestOther + ") " + " & " + CompSearch
end if
end if
if DocAuthorRestriction <> "" then
CompSearch = "(@DocAuthor " + DocAuthorRestriction + ") " + " & " + CompSearch
end if
set Q = Server.CreateObject("ixsso.Query")
set util = Server.CreateObject("ixsso.Util")
Q.CATALOG= SearchCatalog
Q.Query = CompSearch
Q.SortBy = SortBy
Q.Columns = "DocTitle, vpath, filename, size, write, characterization, rank"
Q.MaxRecords = 300
if FormScope <> "/" then
util.AddScopeToQuery Q, FormScope, "deep"
end if
if SiteLocale<>"" then
Q.LocaleID = util.ISOToLocaleID(SiteLocale)
end if
set RS = Q.CreateRecordSet("nonsequential")
RS.PageSize = PageSize
ActiveQuery = TRUE
elseif UseSavedQuery then
if IsObject( Session("Query") ) And IsObject( Session("RecordSet") ) then
set Q = Session("Query")
set RS = Session("RecordSet")
if RS.RecordCount <> -1 and NextPageNumber <> -1 then
RS.AbsolutePage = NextPageNumber
NextRecordNumber = RS.AbsolutePosition
end if
ActiveQuery = TRUE
else
Response.Write "ERROR - No saved query"
end if
end if
if ActiveQuery then
if not RS.EOF then
%>
<%
LastRecordOnPage = NextRecordNumber + RS.PageSize - 1
CurrentPage = RS.AbsolutePage
if RS.RecordCount <> -1 AND RS.RecordCount < LastRecordOnPage then
LastRecordOnPage = RS.RecordCount
end if
Response.Write "
Documents " & NextRecordNumber & " to " & LastRecordOnPage
if RS.RecordCount <> -1 then
Response.Write " of " & RS.RecordCount
end if
Response.Write " matching the above query.
"
' & chr(34) & ""
'Response.Write SearchString & "" & chr(34) & "."
%>
<% if Not RS.EOF and NextRecordNumber <= LastRecordOnPage then%>
<% end if %>
<% ' Set Variable for Table Class default Display
TheClass="normal"
%>
<% Do While Not RS.EOF and NextRecordNumber <= LastRecordOnPage
if TheClass = "normal" then
TheClass="normalalt"
else
TheClass="normal"
end if
' This is the detail portion for Title, Abstract, URL, Size, and
' Modification Date.
' If there is a title, display it, otherwise display the filename.
%>
<% ' Set Variables for Display
RankBase=10
NormRank = RS("rank")/RankBase
%>
<%
else ' NOT RS.EOF
if NextRecordNumber = 1 then
Response.Write "
No documents matched the query
"
else
Response.Write "
No more documents in the query
"
end if
end if ' NOT RS.EOF
if NOT Q.OutOfDate then
' If the index is current, display the fact %>
The index is up to date.
<%end if
if Q.QueryIncomplete then
' If the query was not executed because it needed to enumerate to
' resolve the query instead of using the index, but AllowEnumeration
' was FALSE, let the user know %>
The query is too expensive to complete.
<%end if
if Q.QueryTimedOut then
' If the query took too long to execute (for example, if too much work
' was required to resolve the query), let the user know %>
The query took too long to complete.
<%end if%>
<%
' This is the "previous" button.
' This retrieves the previous page of documents for the query.
%>
<%SaveQuery = FALSE%>
<%if CurrentPage > 1 and RS.RecordCount <> -1 then %>
<%SaveQuery = TRUE%>
<%end if%>
<%
' This is the "next" button for unsorted queries.
' This retrieves the next page of documents for the query.
if Not RS.EOF then%>
<%SaveQuery = TRUE%>
<%end if%>
<% ' Display the page number %>
Page <%=CurrentPage%>
<%if RS.PageCount <> -1 then
Response.Write " of " & RS.PageCount
end if %>
<%
' If either of the previous or back buttons were displayed, save the query
' and the recordset in session variables.
if SaveQuery then
set Session("Query") = Q
set Session("RecordSet") = RS
else
RS.close
Set RS = Nothing
Set Q = Nothing
set Session("Query") = Nothing
set Session("RecordSet") = Nothing
end if
%>
<% end if %>