home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 139 / dpcs0999.iso / Web / CFserver / data1.cab / Documentation / cfmlsyntaxcheck.cfm < prev    next >
Encoding:
Text File  |  1999-04-12  |  8.4 KB  |  257 lines

  1. <!--- Restrict to local server --->
  2. <CFSET isAllowedToExecute = (CGI.REMOTE_ADDR IS "127.0.0.1")>
  3.  
  4. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  5.  
  6. <HTML>
  7. <HEAD>
  8.     <TITLE>CFML 4.0 Syntax Checker</TITLE>
  9.  
  10. <script language="Javascript">
  11.  
  12. var DocRemote = 0;
  13.  
  14. function makeRemote(){
  15.  
  16.     if(DocRemote){
  17.         if(DocRemote.closed){
  18.             DocRemote = 0;
  19.             makeRemote();
  20.         }else{
  21.             DocRemote.focus();
  22.         }
  23.     }else{
  24.         DocRemote = window.open('search.cfm', 
  25.                         'Search', 
  26.                         'scrollbars,resizable,width=510,height=300');
  27.         }
  28. }
  29.  
  30. </script>
  31.  
  32. <script language="JavaScript1.1">
  33.  
  34.     blank = new Image();
  35.     blank.src = 'images/mouseovers/blank.gif';
  36.     
  37.     imgBack = new Image();
  38.     imgBack.src = 'images/mouseovers/back.gif';
  39.  
  40.     imgSearch = new Image();
  41.     imgSearch.src = 'images/mouseovers/search.gif';
  42.  
  43.     imgTop = new Image();
  44.     imgTop.src = 'images/mouseovers/toplevel.gif';
  45.  
  46.     imgUp = new Image();
  47.     imgUp.src = 'images/mouseovers/uplevel.gif';
  48.  
  49.     imgNext = new Image();
  50.     imgNext.src = 'images/mouseovers/next.gif';
  51.  
  52. </script>
  53. </HEAD>
  54.  
  55. <body background="images/bgblue.gif" bgcolor="#99CC99" text="#333333" vlink="#669966">
  56. <basefont size=2 face="Arial, Helvetica">
  57. <center>
  58. <table width="600" border="0" cellspacing="0" cellpadding="2" bgcolor="#000066">
  59. <tr><td><a name="top"></a>
  60.  
  61. <table border="0" cellspacing="0" cellpadding="0" bgcolor="white" width=600>
  62.  
  63. <tr>  <!--- 7 cols. Col 7 = color only --->
  64. <td width=50 nowrap bgcolor="000066"></td>
  65. <td width=25 nowrap bgcolor="000066"></td>
  66. <td width=25 nowrap bgcolor="000066"></td>
  67. <td width=425 nowrap bgcolor="000066"></td>
  68. <td width=50 nowrap bgcolor="000066"></td>
  69. <td width=13 nowrap bgcolor="000066"></td>
  70. <td width=2 nowrap rowspan=99 bgcolor=336633> </td>
  71. </tr>
  72.  
  73. <tr>
  74. <td colspan=1> </td>
  75. <td colspan=5 height=25 align=right valign="top">
  76.    <!--- Navbar --->
  77.        <table border="0" cellspacing="0" cellpadding="0">
  78.     <tr>
  79.         <td valign=top>
  80.             <img src="images/mouseovers/blank.gif" name="DescText" width=157 height=33 border=0><br>
  81.         </td>
  82.         <td valign=top>
  83.             <a href="main.htm" OnMouseOut="DescText.src=blank.src" OnMouseOver="DescText.src=imgBack.src"><img src="images/navwidgets/back.gif" width=80 height=33 border=0></a><br>
  84.         </td>
  85.         <td>
  86.             <a href="javascript: makeRemote();" OnMouseOut="DescText.src=blank.src" OnMouseOver="DescText.src=imgSearch.src"><img src="images/navwidgets/search.gif" width=39 height=33 border=0></a><br>
  87.         </td>
  88.         <td>
  89.             <a href="main.htm" OnMouseOut="DescText.src=blank.src" OnMouseOver="DescText.src=imgUp.src"><img src="images/navwidgets/up.gif" width=41 height=33 border=0></a><br>
  90.         </td>
  91.         <td>
  92.            <img src="images/navwidgets/next.gif" width=40 height=33 border=0><br>
  93.         </td>
  94.     </tr>
  95.     </table>
  96.  
  97. </td>
  98. </tr>
  99.  
  100. <tr>
  101. <td height=75 bgcolor=ffFFff colspan=5> </td>
  102. <td rowspan=99 bgcolor=339933> </td> <!--- Col 6 = color only  (Col 7 is color only too) --->
  103. </tr>
  104. <!-- End of header content. Page content displays below. -->
  105.  
  106. <tr>
  107.     <td bgcolor=ffFFff> </td>
  108.     <td bgcolor=ffFFff> </td>
  109.     <td align="right" bgcolor=ffFFff colspan=2><img src="images/welcomecover/allaire.gif" width="177" height="25" hspace="25" border="0" alt="allaire">
  110.  
  111. <br>
  112. <br>
  113.  
  114. </td>
  115. <td bgcolor=ffFFff> </td>  
  116. </tr> 
  117. <tr>
  118.     <td colspan=1 bgcolor=ffFFff> </td>
  119.     <td colspan=3 bgcolor=ffFFff>
  120.     <font face="Arial Black, Helvetica" size="+2">CFML 4.0 Syntax Checker</font>
  121.     </td>
  122.         <td bgcolor=ffFFff> </td>
  123. </tr>
  124. <!--- Put some space between heading and body --->
  125. <tr><td height=8 bgcolor=ffFFff colspan=5> </td></tr>
  126.  
  127. <tr>
  128.     <td colspan=3 bgcolor=ffFFff> </td>
  129.     <td bgcolor=ffFFff>
  130.       <font face="Arial, Helvetica">
  131. <p>Version 4.0 of the Cold Fusion Application Server features
  132. stricter enforcement of CFML syntax rules. Strict checking can
  133. uncover hidden bugs and other types of undesirable behaviors in
  134. your CFML templates. Allaire recommends that you always use the
  135. strictest possible level of CFML template validation.</p>
  136.  
  137. <p>In rare cases, the more relaxed validation mechanisms used by
  138. previous versions of Cold Fusion may have allowed you to use
  139. syntactically incorrect CFML constructs. The CFML Syntax Checker
  140. is a simple application that can aid you in the process of
  141. discovering which of your CFML templates may not conform to the
  142. rules CFML 4.0.</p>
  143.  
  144. <p>Use the form below to specify the directory where your CFML
  145. templates are located. If you have some legacy DBML code, you may
  146. want to change the file search filter to <em>*.?fm</em> so that
  147. both <em>*.dbm</em> and <em>*.cfm</em> files are checked. If you
  148. do not want to look for CFML templates in nested sub-directories,
  149. you should uncheck the Recurse checkbox. (<strong>Note:</strong>
  150. Don't forget to check your custom tag templates. They reside in
  151. the CustomTags directory under the root of your Cold Fusion
  152. installation.)</p>
  153.  
  154. <p>The syntax checker will return a list of the templates that
  155. failed the syntax checks and the error message that each failed
  156. template generated.</p>
  157. <p><b>Note:</b> running the syntax checker against large directories can take time and, in some cases, the browser may timeout. Currently, reducing the size of template directories is the only workaround, but an option to direct the checker output to a file is under development for a future release.</p>
  158.  
  159. <CFIF not isAllowedToExecute>
  160.     <p>In order to prevent unauthorized execution of time-consuming operations on your server the
  161.     CFML Syntax Checker may only be used from the local server IP <B>127.0.0.1</B>. If you are
  162.     working on the server use this IP reference to link to the CFML Syntax Checker."</p>
  163. </CFIF>
  164.  
  165. </font>
  166.  
  167. <cfif isAllowedToExecute>
  168.  
  169.     <!--- Establish common parameter set --->
  170.     <cfif isDefined("url.execute")>
  171.         <cfparam name=directory default=#form.directory#>
  172.         <cfparam name=filter default=#form.filter#>
  173.         <cfif isDefined("form.recurse")>
  174.             <cfset recurse = true>
  175.         <cfelse>
  176.             <cfset recurse = false>
  177.         </cfif>    
  178.     <cfelse>
  179.         <cfparam name=directory default="">
  180.         <cfparam name=filter default="*.cfm">
  181.         <cfparam name=recurse default=true>
  182.     </cfif>
  183.     
  184.     <!--- Display processing form --->
  185.     <hr>
  186.     <form action="cfmlsyntaxcheck.cfm?execute=yes&requestTimeout=1800" method="POST">
  187.     <table>
  188.     <cfoutput>
  189.     <tr><td><font face="Arial, Helvetica">Directory:</font></td><td><input type="Text" name="Directory" value="#directory#" size="80"></td></tr>
  190.     <tr><td><font face="Arial, Helvetica">Filter:</font></td><td><input type="Text" name="Filter" value="#filter#" size="12"></td></tr>
  191.     <tr><td><font face="Arial, Helvetica">Recurse:</font></td><td><input type="Checkbox" name="Recurse" <cfif recurse>checked</cfif>></td></tr>
  192.     </cfoutput>
  193.     </table>
  194.     <input type="reset">
  195.     <input type="Submit" name="Submit" value="Check Syntax">
  196.     </form>
  197.     <hr>
  198.      <font face="Arial, Helvetica">
  199.     <!--- Display result set --->
  200.     <cfif isDefined("url.execute")>
  201.     
  202.         <hr><p><h2>Syntax Check Results</h2><p>
  203.         
  204.         <cf_syntaxcheck
  205.             directory=#directory#
  206.             filter=#filter#
  207.             recurse=#recurse#
  208.             resultquery=resultQuery>
  209.     
  210.         <cfif resultQuery.recordCount gt 0>
  211.         
  212.             <CFOUTPUT QUERY=resultQuery>
  213.                 <hr color="ff0000">
  214.                 Template Path: <b>#TemplatePath#</b><p>
  215.                 #ErrorMessage#
  216.             </CFOUTPUT>
  217.         
  218.         <cfelse>
  219.         
  220.             <b>All templates comply with CFML 4.0 syntax rules!</b>    
  221.         
  222.         </cfif>
  223.     </cfif>
  224.     </font>
  225.  
  226. </cfif>
  227. </td>
  228. <td bgcolor=ffFFff> </td>  
  229. </tr>
  230.  
  231. <!---  begin footer --->    
  232. <tr><td height=100 colspan=5 bgcolor=ffFFff> </td></tr>
  233. <tr>
  234.     <td colspan=4 align=right bgcolor=ffFFff>
  235.       <a href="main.htm"><img src="images/navwidgets/lowerback.gif" WIDTH=50 HEIGHT=31 border=0 alt="Back"></a><a href="main.htm"><img src="images/navwidgets/lowertop.gif" alt="Up Level" WIDTH=41 HEIGHT=31 border=0></a><img src="images/navwidgets/lowernext.gif" alt="Next" WIDTH=50 HEIGHT=31 border=0><br>
  236.     </td>
  237.     <td bgcolor=ffFFff> </td>
  238. </tr>
  239. <tr><td height=120 colspan=5 bgcolor=ffFFff> </td></tr>
  240. <tr>
  241.     <td colspan=5 height=29 valign=top>
  242.     <font size="-2" face="Arial, Helvetica">
  243.         <p>
  244.         <a href="http://www.allaire.com"><img src="images/navwidgets/allaireblue.gif" width=230 border=0 hspace=0 vspace=0 height=29 align="left" alt="allaire"></a>
  245.               <a href="mailto:allairedoc@allaire.com">AllaireDoc@allaire.com</a><br>
  246.               Copyright © 1998, Allaire Corporation.   All rights reserved.<br>
  247.     </font>
  248.     </td>
  249. </tr>
  250.  
  251. </table>
  252.     </td>
  253. </tr>
  254. </table>
  255. </BODY>
  256. </HTML>
  257.