<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
<channel>
<title>CodeStore.net comments on "Quick Domino Tip: Dual-Purpose Agents"</title>
<description>Replies to blog "Quick Domino Tip: Dual-Purpose Agents" on codestore.net.</description>
<link>http://www.codestore.net/</link>
<lastBuildDate>Thu, 09 Aug 2012 06:23:59 -0500</lastBuildDate>
<atom:link href="http://www.codestore.net/store.nsf/blog.xml?Open=20120808-0358" rel="self" type="application/rss+xml" />

<item>
	<title>Reply from Stephan H. Wissel</title>
	<pubDate>Thu, 09 Aug 2012 06:23:59 -0500</pubDate>
	<author>Stephan H. Wissel</author>
	<description><![CDATA[ 
		<p>I wasn't sure either, so I whipped up my favorite web agent:</p>
		<p>Option Public</p>
		<p>Option Declare</p>
		<p>Sub Initialize</p>
		<p>Dim s As New NotesSession</p>
		<p>Dim doc As NotesDocument</p>
		<p>Dim item As NotesItem</p>
		<p>Set doc = s.Documentcontext</p>
		<p>Print |&lt;style type="text/css"&gt;|</p>
		<p>Print |table {width : 100%; border : 0}|</p>
		<p>Print |.itemname {background-color : #FFFFCC}|</p>
		<p>Print |.itemvalue {background-color : #CCFFFF}|</p>
		<p>Print |&lt;/style&gt;|</p>
		<p>Print |&lt;table&gt;|</p>
		<p>Forall curIt In doc.Items</p>
		<p>Set item = curIt		</p>
		<p>Print |&lt;tr&gt;|</p>
		<p>Print |&lt;td class="itemname"&gt;|</p>
		<p>Print item.Name</p>
		<p>Print |&lt;/td&gt;&lt;td class="itemvalue"&gt;|</p>
		<p>Print item.Text</p>
		<p>Print |&lt;/td&gt;&lt;/tr&gt;|</p>
		<p>End ForAll</p>
		<p>Print |&lt;/table&gt;|</p>
		<p>End Sub</p>
		<p>:-)</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=6DBDA22BEADFC79386257A55003E9EAB"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument&amp;r=6DBDA22BEADFC79386257A55003E9EAB#DOC_6DBDA22B</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Thu, 09 Aug 2012 05:59:29 -0500</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>Interesting. Never knew that. Thanks Stephan!!</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=7AFF0AA55A85A2F086257A55003C60A5"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument#DOC_7AFF0AA5</link>
</item><item>
	<title>Reply from Stephan H. Wissel</title>
	<pubDate>Thu, 09 Aug 2012 05:56:04 -0500</pubDate>
	<author>Stephan H. Wissel</author>
	<description><![CDATA[ 
		<p>forgot to point out: 'X-Ajax' turns into 'HTTP_X_AJAX'. So it is capitalized and the dash turns into an underscore.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=75B9DBC63D439C7A86257A55003C1047"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument#DOC_75B9DBC6</link>
</item><item>
	<title>Reply from Stephan H. Wissel</title>
	<pubDate>Thu, 09 Aug 2012 05:53:07 -0500</pubDate>
	<author>Stephan H. Wissel</author>
	<description><![CDATA[ 
		<p>Hi Jake,</p>
		<p>you can use NotesSession.documentContext. It gives you access to the request document. The request document contains Notes items for everything in the header. As Thimo pointed out there is an item HTTP_X_REQUESTED_WITH and in your example there would be a HTTP_X_AJAX Notes item (and a HTTP_BLAH item when you add a 'bla' : 'blub' to your headers in the request.</p>
		<p>In a nutshell: HTTP headers turn into notes items with a HTTP_ prefix when you do ?OpenAgent</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=1B5C4CC380C3F8A886257A55003BCB50"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument#DOC_1B5C4CC3</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Wed, 08 Aug 2012 09:01:21 -0500</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>Good point. I hadn't thought of that. My Ajax was Dojo-driven, which looks like you can specify custom headers like so:</p>
		<p>dojo.xhrGet({</p>
		<p>url: 'agent?openagent',</p>
		<p>headers: {'X-Ajax': 'yes'}</p>
		<p>});</p>
		<p>But. How do you get a handle on the headers from the Java (or lotusscript for that matter) code?</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=D75B3E4B22F661CB86257A54004D070F"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument#DOC_D75B3E4B</link>
</item><item>
	<title>Reply from Thimo Jansen</title>
	<pubDate>Wed, 08 Aug 2012 08:30:18 -0500</pubDate>
	<author>Thimo Jansen</author>
	<description><![CDATA[ 
		<p>If you're using jQuery for the AJAX requests you can also look at the "HTTP_X_REQUESTED_WITH" header. It'll contain "XMLHttpRequest" for AJAX requests. So there won't be a need for URL parameters. I don't have experience with other JS frameworks, so YMMV.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=CBB5D47A477CF99886257A54004A2F38"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument#DOC_CBB5D47A</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Wed, 08 Aug 2012 07:51:52 -0500</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>There's a chance that the Query_String for the agent when acting as a WQS could be ?Open&seq=1 if the form was also opened using just the ?Open URL command.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=CCF1BC2EE10B357E86257A540046AA44"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument#DOC_CCF1BC2E</link>
</item><item>
	<title>Reply from Brian Miller</title>
	<pubDate>Wed, 08 Aug 2012 07:45:44 -0500</pubDate>
	<author>Brian Miller</author>
	<description><![CDATA[ 
		<p>Why can't you also test for "?Open"?  Is there a case when you'll run into that where you're not directly calling the agent?</p>
		<p>When I would call for a form or document, I try to do it in such a way that a query string command isn't even needed.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=938E6C4A40DB02AA86257A5400461A83"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120808-0358?OpenDocument#DOC_938E6C4A</link>
</item>

</channel>
</rss> 
