home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / searchmain.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  5.1 KB  |  179 lines

  1. <HTML>
  2. <HEAD>
  3.     <TITLE>Search</TITLE>
  4. </HEAD>
  5. <BODY bgcolor="999999" link="blue" vlink="#669966" leftmargin=1 topmargin=0 background="bg30.gif" text="Black">
  6. <table border="0" cellspacing="0" cellpadding="0" bgcolor="White">
  7. <tr>
  8.     <td width=10> </td>
  9.     <td valign="top" height="175" width=100%>
  10.  
  11.  
  12. <!--- Check whether the index collection 'cfdocumentation' exists ---->
  13.     <!--- Get all collection names. --->
  14.  
  15.  
  16.  
  17.  
  18.     <CFREGISTRY ACTION=GETALL Branch="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\Collections" 
  19.         Type="KEY"
  20.         Name="Collections">
  21.  
  22.     <CFSET CollectionFound = 'No'>
  23.     <CFLOOP QUERY="Collections">
  24.         <CFIF Collections.Entry IS 'cfdocumentation'>
  25.             <CFSET CollectionFound = 'Yes'>
  26.         </CFIF>
  27.     </CFLOOP>
  28.  
  29.     <CFIF CollectionFound IS 'No'>
  30.  
  31.         <!--- Create the collection --->
  32.         
  33.         <CFREGISTRY ACTION=GET Branch="HKEY_LOCAL_MACHINE\SOFTWARE\Allaire\ColdFusion\CurrentVersion\Collections"
  34.             ENTRY="RootDirectory"
  35.             TYPE="STRING"
  36.             VARIABLE="CFRootDir">
  37.         <CFIF Server.OS.Name IS NOT "UNIX">
  38.             <CFSET CollectionPath="#CFRootDir#\Verity\Collections\">
  39.         <CFELSE>
  40.             <CFSET CollectionPath="#CFRootDir#/verity/collections/">
  41.         </CFIF>
  42.  
  43.         <CFCOLLECTION Action="CREATE"
  44.             COLLECTION="cfdocumentation" 
  45.             PATH="#CollectionPath#"
  46.             LANGUAGE="english">
  47.     </CFIF> 
  48.  
  49.  
  50. <!--- Check whether the index is properly built ---->
  51. <CFSEARCH 
  52.         NAME="CheckSearch" 
  53.         COLLECTION="cfdocumentation" 
  54.         CRITERIA = ""
  55.         MAXROWS = "1">
  56.  
  57. <CFIF CheckSearch.RecordCount IS 0 >
  58.  
  59. <!--- Empty Index. Indexing needed first. --->
  60.  
  61.     <FONT FACE="Arial, Helvetica" SIZE="-1"><b>Index Allaire Documentation</b></FONT><BR>
  62.     You need to index the Allaire documentation before using it for the first time.
  63.     This process may take a minute or two.<br>
  64.  
  65.     <form action="reindexalldocuments.cfm?RequestTimeout=300" method="POST" target="main">
  66.         <CFIF ParameterExists(SearchString)>
  67.             <INPUT TYPE="hidden" NAME="SearchString" VALUE="<CFOUTPUT>#SearchString#</CFOUTPUT>">
  68.         </CFIF>
  69.         <INPUT TYPE="submit" VALUE="Index">
  70.     </FORM>
  71.     
  72. <CFELSE>
  73.  
  74.     
  75. <!--- Run the search if any --->
  76. <CFIF ParameterExists(SearchString)> 
  77.     
  78.     <CFSEARCH 
  79.         NAME="Search1" 
  80.         COLLECTION="cfdocumentation" 
  81.         CRITERIA = "#ReplaceList(SearchString,'<,>,=','\<,\>,\=')#">
  82.  
  83.         <TABLE CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
  84.         <TR><TD HEIGHT="10"></TD></TR>
  85.         <TR>
  86.             <TD><FONT SIZE="-2" FACE="Arial, Helvetica"><B>Title</B> (<CFOUTPUT>#Search1.RecordCount#</CFOUTPUT> Documents) </FONT></TD>
  87.             <TD><FONT SIZE="-2" FACE="Arial, Helvetica"><B>Book</B></FONT></TD>
  88.         </TR>
  89.         <TR>
  90.             <TD COLSPAN=3><HR SIZE="1"></TD>
  91.         </TR>
  92.         <CFIF Search1.RecordCount IS 0>
  93.         <TR>
  94.             <TD COLSPAN=3><FONT SIZE="-2" FACE="Arial, Helvetica">No documents found. Modify your criteria and try again.</FONT></TD>
  95.         </TR>
  96.         </CFIF>
  97.     
  98. <CFOUTPUT QUERY="Search1">
  99.  
  100.             <!--- Show the search results.--->
  101.  
  102.             <CFSET DisplayDocument = 'Yes'>
  103.             <CFIF ParameterExists(SearchAll) >
  104.             </CFIF>
  105.  
  106.     
  107.     <CFIF DisplayDocument = 'Yes'>
  108.         <TR> 
  109.             <TD NOWRAP><FONT SIZE="-2" FACE="Arial, Helvetica"><A TARGET="opener" HREF="#Search1.URL#">
  110.                 <CFIF Search1.TITLE IS NOT "">
  111.                     #HTMLEditFormat(Search1.TITLE)#
  112.                 <CFELSE>
  113.                     Unknown Title (#HTMLEditFormat(Search1.URL)#)
  114.                 </CFIF></A></FONT></TD>
  115.                 
  116.             <TD NOWRAP><FONT SIZE="-2" FACE="Arial, Helvetica">
  117.             
  118.             <!--- #Search1.URL# --->
  119.                 
  120.                   <CFIF Left(Search1.URL, 27) IS "allaire_support/newfeatures">New Features in CF 4.0
  121.                     <CFELSEIF Left(Search1.URL, 28) IS "allaire_support/releasenotes">Release Notes
  122.                     <CFELSEIF Left(Search1.URL, 23) IS "allaire_support/support">Allaire Technical Support
  123.                     <CFELSEIF Left(Search1.URL, 15) IS "Getting_Started">Getting Started
  124.                     <CFELSEIF Left(Search1.URL, 13) IS "CFML_Language">CFML Reference
  125.                     <CFELSEIF Left(Search1.URL, 10) IS "Developing">Developing Web Applications with CF
  126.                     <CFELSEIF Left(Search1.URL, 13) IS "Administering">Administering the CF Application Server
  127.                     <CFELSEIF Left(Search1.URL, 8) IS "Advanced">Advanced CF Development
  128.                     <CFELSE>Unknown Book
  129.                 </CFIF>
  130.                 </FONT></TD>
  131.                     </TR>
  132.     </CFIF>
  133.     
  134. </CFOUTPUT>
  135.         <TR><TD COLSPAN=3><HR SIZE="1"></TD></TR>
  136.         </TABLE>
  137.     </CFIF>
  138. <!--    <FONT FACE="Arial, geneva, Helvetica" SIZE=-1><br>
  139.  
  140.         Other information can go here. Maybe Allaire contact information:<br>
  141.         Links to Website, 
  142.         Links to training 
  143.         Phone numbers for sales and training 
  144.         Links to front pages of book titles<br>
  145.         <br>
  146.         <br>
  147.         <br>
  148.         <br>
  149.     </font> -->
  150. <!---     
  151.     <FONT FACE="Arial, Helvetica" SIZE=-1><b>Search Allaire Documentation</b></font>
  152.     <form action="searchmain.cfm?RequestTimeout=300" method="POST" target="main" name="Search">
  153.     
  154. <CFOUTPUT>
  155.     <INPUT TYPE=text NAME=SearchString SIZE=20
  156. <CFIF ParameterExists(SearchString)>VALUE="#SearchString#"</CFIF>>
  157.     <INPUT TYPE=SUBMIT NAME=search1 VALUE="Search"> 
  158. </CFOUTPUT>
  159.     </FORM> --->
  160. <!--- 
  161.     <BR>
  162. <FONT FACE="Arial, Helvetica" SIZE=-1><b>Reindex Allaire Documentation</b></FONT><br>    
  163. <FORM action="reindexalldocuments.cfm">
  164. <INPUT TYPE="submit" VALUE="Reindex">
  165. </form> --->
  166.  
  167.     
  168. </CFIF>
  169.  
  170. </td>
  171. </tr>
  172. </table>
  173.     </td>
  174. </tr>
  175. </table>
  176.  
  177. </BODY>
  178. </HTML>
  179.