<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="http://iqjam.net/iqjam/iqjam.nsf/rsstransform.xslt"?>
<rss version="2.0">
<channel>
	<language>en-us</language>
	<lastBuildDate>Fri, 10 Sep 2010 22:02:52 +0000</lastBuildDate>
	<title>IQJam by Elguji Software - How Do I Debug SSJS?</title>
	<description>An RSS feed generated by IQJam by Elguji Software</description>
	<link>http://iqjam.net/iqjam/iqjam.nsf</link>
	<image>
	    <title>IQJam by Elguji Software - How Do I Debug SSJS?</title>
	    <url>http://iqjam.net/iqjam/iqjam.nsf</url>
	    <link></link>
	</image>
	<item>
		<pubDate>Thu, 17 Sep 2009 16:04:08 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; David Leedy&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; &lt;p&gt;I don't know if I have a great answer to this yet.  I will say that:&lt;/p&gt;&lt;p&gt;print() is your friend!&lt;/p&gt;&lt;p&gt;Since print() writes to the Notes Log it's almost like debugging a server/web agent.&lt;/p&gt;&lt;p&gt;TaskJam has something in it to hook into OpenLog.  I've not tried that yet but that might be something to check out.&lt;/p&gt;&lt;p&gt;I've not heard of anything that will allow stepping through the code....&lt;/p&gt;&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#433AA27F827489BD802576340073BC73</link>
	</item>
	<item>
		<pubDate>Thu, 17 Sep 2009 16:12:28 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Bruce Elgort&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; Here's &lt;a href="http://taskjam.net"&gt;a link to TaskJam&lt;/a&gt; that David mentions.&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#7CCA9C1EE6F691BB8025763400747F80</link>
	</item>
	<item>
		<pubDate>Thu, 17 Sep 2009 17:24:03 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Paul Withers&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; I didn't know about print(). I've used OpenLog for XPages, using log.logEvent() to write out. It's the same principle as print() though.&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#F3ECFD41304BE37A80257634007B0D32</link>
	</item>
	<item>
		<pubDate>Thu, 17 Sep 2009 17:50:01 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Christopher Byrne&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; There is also article I found on how to use Visual Studio 8 to &lt;a href="http://blogs.msdn.com/kaevans/archive/2007/08/10/javascript-debugging-in-visual-studio-2008.aspx"&gt;debug on the server side in a hackish kind of way.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Not sure if would work in your case, but you never know.&lt;br /&gt;&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#54F0AB3C1425FEDC80257634007D6DEC</link>
	</item>
	<item>
		<pubDate>Thu, 17 Sep 2009 17:58:25 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Jeremy Hodge&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; What I've been doing when a bit of SSJS gives me fits is copy and paste the code into a computed text field, and then use the line use:&lt;br /&gt;&lt;br /&gt;return &amp;lt;insert meaningful text here&amp;gt;&lt;br /&gt;&lt;br /&gt;so if I want to know what the return result of a variable is, I'll return it and it displays it, or if I want to check to see how far a script gets, ill do something like&lt;br /&gt;&lt;br /&gt;return 'got this far!'&lt;br /&gt;&lt;br /&gt;etc...&lt;br /&gt;&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#C369C2DF9FF1649880257634007E32F2</link>
	</item>
	<item>
		<pubDate>Thu, 17 Sep 2009 17:58:59 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Bruce Elgort&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; For those who may not know SSJS stands for &amp;quot;Server Side Javascript&amp;quot;.&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#266660C6F60D59E080257634007E4049</link>
	</item>
	<item>
		<pubDate>Fri, 18 Sep 2009 09:44:07 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Peter Presnell&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; @Christopher.  I was actually based upon my experience with .Net (Visual Studio) that I was asking the question.  When I developed server-sided code with C# I could step through my code, set breakpoints inspect variables as with LotusScript debugger.  I could even change variables and change the code about to be executed allowing me to quickly debug my code.  It sounds like with XPages i am restricted to the old fashioned (e.g 1960s) style of debugging with manual debug statements that direct my output to the server log, agentlog, or back to a debug field on my xpage.  &lt;br /&gt;&lt;br /&gt;I Just wanted to check with all the experts that I wasnt missing something obvious - heavan knows debugging wouldn't be the only major item missing from the Xpage help documentation.&lt;br /&gt;&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#13A588C251526AB6802576350050F19F</link>
	</item>
	<item>
		<pubDate>Wed, 31 Mar 2010 23:13:56 +0000</pubDate>
		<title>re: How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; John Smart&lt;br /&gt;&lt;b&gt;Answer:&lt;/b&gt; &lt;div&gt;I'm too behind in my XPages project to think about how I can save time :-/ but when I get some breathing room I'm going to look at &lt;a href="http://www.openntf.org/Projects/pmt.nsf/ProjectLookup/Medusa"&gt;Medusa&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Until then, I took a technique I saw from Tommy Valand (emailing a stack trace) and changed/extended it to instead create and populate requestScope.debugOutput.  I create a computed field that is bound to requestScope.debugOutput (using JavaScript so that it's one way instead of binding to requestScope through EL), and then I use the following script library:&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;Debug = {&lt;br /&gt;    _log : function (msgType, msgSource, msg) {&lt;br /&gt;        var tmp = msgType;&lt;br /&gt;        if (msgSource) {&lt;br /&gt;            tmp += ' from ' + msgSource;&lt;br /&gt;        }&lt;br /&gt;        var newEntry = '&amp;lt;dt&amp;gt;' + @Now() + ' ' + tmp + ':&amp;lt;/dt&amp;gt;&amp;lt;dd&amp;gt;' + msg + '&amp;lt;/dd&amp;gt;';&lt;br /&gt;        if ( requestScope.debugOutput ) {&lt;br /&gt;            requestScope.debugOutput += newEntry;&lt;br /&gt;        } else {&lt;br /&gt;            requestScope.debugOutput = newEntry;&lt;br /&gt;        }&lt;br /&gt;    },&lt;br /&gt;    &lt;br /&gt;    exception : function (exception, source) {&lt;br /&gt;        var stringWriter = new java.io.StringWriter();&lt;br /&gt;        exception.printStackTrace( new java.io.PrintWriter( stringWriter ) );&lt;br /&gt;        this._log('Error', source, stringWriter.toString());&lt;br /&gt;    },&lt;br /&gt;    &lt;br /&gt;    message : function (msg, source) {&lt;br /&gt;        this._log('Print ', source, msg);&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt;&lt;/blockquote&gt;From within a custom control's combobox's onblur SSJS, I might do something like:&lt;br /&gt;&lt;blockquote&gt;var sHere = 'ccCustomControlName.comboBoxId.onblur';&lt;br /&gt;try {&lt;div&gt;     Debug.message('starting', sHere);&lt;br /&gt;    // do stuff&lt;br /&gt;     Debug.message('successful', 
sHere);&lt;br /&gt;} catch (e) {&lt;/div&gt;     Debug.exception(e, 
sHere);&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;Two caveats:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It appears that you can't use global variables that don't exist, so when you remove the Debug script library from your XPages, you also have to remove all the calls.  Even code like &amp;quot;if ( Debug ) { Debug.exception(e, sHere); }&amp;quot; will crash if Debug doesn't exist.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you're debugging partial refreshes then your display of requestScope.debugOutput must be within what you're refreshing.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt; &lt;/div&gt;&lt;br /&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm?#BEA5ECB70493F917802576F800173FEC</link>
	</item>
	<item>
		<pubDate>Thu, 17 Sep 2009 15:42:13 +0000</pubDate>
		<title>How Do I Debug SSJS?</title>
		<description>&lt;b&gt;Author:&lt;/b&gt; Peter Presnell&lt;br&gt;&lt;b&gt;Tags:&lt;/b&gt;  &lt;a href="http://iqjam.net/iqjam/iqjam.nsf/tags.xsp?tag=debug"&gt;debug&lt;/a&gt; &lt;br&gt;&lt;b&gt;Question:&lt;/b&gt; I have searched high and low but I have not found any documentation anywhere on how you debug SSJS.  Just looking for the standard things such as setting breakpoints, stepping through the code and inspecting variables....&lt;br&gt;</description>
		<link>http://iqjam.net/iqjam/iqjam.nsf/questions/20090917_How_Do_I_Debug_SSJS.htm</link>
	</item>
</channel></rss>
