<% If false then usingAuthentiXStandard = false if (usingAuthentiXStandard) then Set AuthX = Server.CreateObject("AUTHXOCX.AuthXOCXCtrl.1") else Set AuthX = Server.CreateObject("AUTHXISP.AuthXOCXCtrl.1") 'protectedDomain = Request.ServerVariables("LOCAL_ADDR") protectedDomain = "taacenters.org" AuthX.SetVirtualDomain protectedDomain, Request.ServerVariables("SCRIPT_NAME") AuthX.SetVirtualDomainPassword("32taac#") end if %> <% currentUser = AuthX.CurrentUserName(protectedDomain, Request.ServerVariables("SCRIPT_NAME"), Request.ServerVariables("HTTP_AUTHXAUTHORIZATION")) %> <% If "" = currentUser Then %> An empty user name, protect this directory with AuthentiX and try again. <% Else %> Welcome, <%= currentUser %>, to the Trade Adjustment Assistance Centers' Document Library! <% End If %> <% End If %> <% '---- Initialize the search results FormScope = "/extranet/industryinformation" PageSize = 10 SiteLocale = "EN-US" %> <% ' Set Initial Conditions NewQuery = FALSE UseSavedQuery = FALSE SearchString = "" CompSearch = "" 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" then SearchString = Request.Form("SearchString") FreeText = Request.Form("FreeText") ' NOTE: this will be true only if the button is actually pushed. if Request.Form("Action") = "Go" then NewQuery = TRUE RankBase=1000 end if end if if Request.ServerVariables("REQUEST_METHOD") = "GET" then SearchString = Request.QueryString("qu") FreeText = Request.QueryString("FreeText") FormScope = Request.QueryString("sc") RankBase = Request.QueryString("RankBase") if Request.QueryString("pg") <> "" then NextPageNumber = Request.QueryString("pg") NewQuery = FALSE UseSavedQuery = TRUE else NewQuery = SearchString <> "" end if end if %>
Enter your query below: <% If false then %> <% end If %>
<% '----------------------------------------------------------- '---- Make sure the query string has a value '----------------------------------------------------------- If SearchString <> "" Then 'and Request.Form("Action") = "Go" Then 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 if FreeText = "on" then CompSearch = "$contents " & chr(34) & SearchString & chr(34) else CompSearch = SearchString & " " end if set Q = Server.CreateObject("ixsso.Query") set util = Server.CreateObject("ixsso.Util") '---- Restrict some directories and file extensions 'CompSearch = CompSearch & " and not #vpath *\_* " CompSearch = CompSearch & " and not #vpath *\|(_vti_*|,search*|,cgi-bin*|) " 'CompSearch = CompSearch & " and not #vpath *\|(_vti_*|,search*|,cgi-bin*|) " 'CompSearch = CompSearch & " and not #vpath *\_vti_* " 'CompSearch = CompSearch & " and not @vpath = """" " 'CompSearch = CompSearch & " and not #vpath *\vti_* " 'CompSearch = CompSearch & " and not #vpath *\search* " 'CompSearch = CompSearch & " and not #vpath *\cgi-bin* " 'CompSearch = CompSearch & " and not #vpath *temp* " 'CompSearch = CompSearch & " and not #filename index_old.htm " CompSearch = CompSearch & " and not #filename *.|(btr|,cnf|,css|,log|,mdb|,cnt|,class|,toc|,inc|,lck|,hlp|,asp|)" 'Response.Write "CompSearch: " & Compsearch & "
" Q.Query = CompSearch Q.SortBy = "rank[d]" Q.Columns = "DocTitle, vpath, filename, size, write, characterization, rank" Q.MaxRecords = 300 Q.Catalog = "taac_extranet" 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 '---- UseSavedQuery ------------- 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 Else '---- The search string was not filled in blEmptySearchString = True Response.Write "

Please specify at least one keyword.

" 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 query " & chr(34) & "" Response.Write SearchString & "" & chr(34) & ".

" %> <% '------------------------------------------------------ '---- Beginning of results display loop '------------------------------------------------------ if Not RS.EOF and NextRecordNumber <= LastRecordOnPage then%>

Tips for searching
value="on">Use Free-Text Query.
<% end if %> <% Do While Not RS.EOF and NextRecordNumber <= LastRecordOnPage ' This is the detail portion for Title, Abstract, URL, Size, and ' Modification Date. ' If there is a title, display it, otherwise display the filename. %> <% '---- Graphically indicate rank of document with list of stars (*'s). if NextRecordNumber = 1 then RankBase=RS("rank") end if if RankBase>1000 then RankBase=1000 elseif RankBase<1 then RankBase=1 end if NormRank = RS("rank")/RankBase if NormRank > 0.80 then stars = "rankbtn5.gif" elseif NormRank > 0.60 then stars = "rankbtn4.gif" elseif NormRank > 0.40 then stars = "rankbtn3.gif" elseif NormRank >.20 then stars = "rankbtn2.gif" else stars = "rankbtn1.gif" end if %> <% RS.MoveNext NextRecordNumber = NextRecordNumber+1 Loop %>
<%= NextRecordNumber%>. <%if VarType(RS("DocTitle")) = 1 or RS("DocTitle") = "" then%> " class="RecordTitle"><%= Server.HTMLEncode( RS("filename") )%> <%else%> " class="RecordTitle"><%= Server.HTMLEncode(RS("DocTitle"))%> <%end if%>

<% ' Construct the URL for hit highlighting WebHitsQuery = "CiWebHitsFile=" & Server.URLEncode( RS("vpath") ) WebHitsQuery = WebHitsQuery & "&CiRestriction=" & Server.URLEncode( Q.Query ) WebHitsQuery = WebHitsQuery & "&CiBeginHilite=" & Server.URLEncode( "" ) WebHitsQuery = WebHitsQuery & "&CiEndHilite=" & Server.URLEncode( "" ) WebHitsQuery = WebHitsQuery & "&CiUserParam3=" & QueryForm ' WebHitsQuery = WebHitsQuery & "&CiLocale=" & Q.LocaleID %> <%if VarType(RS("characterization")) = 8 and RS("characterization") <> "" then%> Abstract: <%= Server.HTMLEncode(RS("characterization"))%>
  <%end if%> <% If False then '------ hide this for now %>

" class="RecordStats" style="color:blue;">http://<%=Request("server_name")%><%=RS("vpath")%>
<%if RS("size") = "" then%>(size and time unknown)<%else%>size <%=RS("size")%> bytes - <%=RS("write")%> GMT<%end if%>
<% End If %>


<% '------------------------------------------------------ '---- End of results display loop '------------------------------------------------------ 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 false then '----------------- don't display this now 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%> <% end if '----------------- don't display this now %> <% '------------------------------------------------------ '---- 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%>
<% NextString = "Next " if RS.RecordCount <> -1 then NextSet = (RS.RecordCount - NextRecordNumber) + 1 if NextSet > RS.PageSize then NextSet = RS.PageSize end if NextString = NextString & NextSet & " documents" else NextString = NextString & " page of documents" end if %>
<% '------------------------------------------------------ '---- Display the page number '------------------------------------------------------ %> <%if RS.PageCount <> -1 and RS.PageCount <> 0 then Response.Write "Page " & CurrentPage & " 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 %>