// you’re reading...

CMS

Debugging PreExecute ASP – Reloaded

Gavin Cope already came up this year with his great article on how to debug classic ASP script which runs in Open Text Management Servers PreExecute Mode. Keith Bloom picked up the idea and improved it a fair bit,
so that you now are able to

  • see the Error files as html files in your browser
  • open an overview page with all logfiles which are existing in the folder.

Modifications

WriteToFile "C:Program FilesRedDotCMSASPPreExecutelogsPreExecuteErrors_" & Year(Now) & Month(Now) & Day(Now) & _
".html", " Date/Time: " & Now() & "" & _
" ASP Code: " & objASPError.ASPCode & "" & _
"ASP Description: " & objASPError.Description & "" & _
" Category: " & objASPError.Category & "" & _
" Column: " & objASPError.Column & "" & _
" Description: " & objASPError.Description & "" & _
" File: " & objASPError.File & "" & _
" Line: " & objASPError.Line & "" & _
" Number: " & objASPError.Number & "" & _
" Source: " & objASPError.Source & "" & _
"############################################################" & "", True

This replaces the line .07 in Gavins code sample and writes the data with HTML line-breaks into a .html file.
Make sure your Program Files path is set correct.
Next step is to create a default.asp file (so that you just have to browse to the folder) or
ErrorList.asp file inside of the log file folder with the following code:

<%
sDirectory = "CMS/ASP/PreExecute/logs/"
sPath = Server.MapPath(sDirectory)

Set fso = CreateObject("Scripting.FileSystemObject")
Set currentFolder = fso.GetFolder(sPath)
Set fileList = currentFolder.Files
%>
<html>
	<head>
		<title>Open Text Websolutions : PreExecuteErrors
	</head>
<body>
	<h1>List of files

	<ul>
		<% For Each file in fileList %>
		<li><a href="<%= sDirectory & file.Name %>"><%= file.Name %>

		<% Next %>
	</ul>
</body>
</html>
<%
Set fileList = Nothing
Set currentFolder = Nothing
Set fso = Nothing
%>

This should list all error files within your log folder.

Thank you

Again thank you guys for share this ASP solution with us and spending some time on publishing it. Hopefully there will be a day when the CMS runs entirely in .NET as fastest available development language and we can use this within Open Texts Web Solutions Management Server to make the CMS world a better place..
;-)

Share and Enjoy:
  • Print
  • email
  • Twitter
  • Digg
  • Reddit
  • StumbleUpon
  • Google Bookmarks
  • del.icio.us
  • MisterWong
  • Facebook
  • LinkedIn
Related posts:
  1. Debugging Pre-Executed (classic) ASP
  2. Import and export for different RedDot CMS versions
  3. Export RedDot CMS content to Excel
  4. 5 Template Tips – How to use HTML and CSS within RedDot CMS – Best practice for RedDot Consultants
  5. Webserver plugin / extension: Export RedDot CMS content – Parse published pages with wget

About the author:

Markus Giesen Markus Giesen is a 28 years young, flexible RedDot CMS developer/consultant, formerly based in the south of germany. He was travelling around the world to find and offer solutions for a better world (in a very web based meaning). He just found a way to do that as a new member of the Open Text Partner Areeba, located in Melbourne. In his freetime you will find him reading, snowboarding or travelling. You should follow him on Twitter!

Discussion

No comments for “Debugging PreExecute ASP – Reloaded”

Post a comment



Stay up to date! - Get notified about followup comments

If you don't feel the urge to comment but wish to stay in the loop:
Just enter your email and subscribe to new comments.

Subscribe without commenting

Recent Tweets