<?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 "Documents Created Since Agent Last Ran - An Alternative"</title>
<description>Replies to blog "Documents Created Since Agent Last Ran - An Alternative" on codestore.net.</description>
<link>http://www.codestore.net/</link>
<lastBuildDate>Thu, 25 Jun 2009 01:25:49 -0500</lastBuildDate>
<atom:link href="http://www.codestore.net/store.nsf/blog.xml?Open=20090624" rel="self" type="application/rss+xml" />

<item>
	<title>Reply from Rob</title>
	<pubDate>Thu, 25 Jun 2009 01:25:49 -0500</pubDate>
	<author>Rob</author>
	<description><![CDATA[ 
		<p>Hi Jake,</p>
		<p>I'm looking at the designer help for version 8.5 but this is the same for the last two or three versions at least.</p>
		<p>Look in the AgentContext class for the SavedData method. It returns the agent document which preserves any data between agent runs. It seems like data saved to the profile documents but is cleared if you edit the agent.</p>
		<p>Here's how to get the agent document:</p>
		<p>Java</p>
		<p>Document agentDoc = agentContext.getSavedData();</p>
		<p>LotusScript</p>
		<p>Set notesDocument = notesSession.SavedData</p>
		<p>I think this "agent document" is used to track "unprocessed" documents. These documents are fetched with the Java method getUnprocessed Documents() and the LotusScript method agentContext.UnprocessedDocuments. This status is set to processed on an agent by agent basis by each agent calling, in Java, updateProcessedDoc() and in LotusScript, db.UpdateProcessedDoc.</p>
		<p>Now that I think about it, you could save the agent start time in a profile field. Then the agent would know when it was last started even after its been edited.</p>
		<p>Peace,</p>
		<p>Rob:-]</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=F25C6B9BF85C7B72862575E000235244"><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-20090624?OpenDocument#DOC_F25C6B9B</link>
</item><item>
	<title>Reply from Rob</title>
	<pubDate>Wed, 24 Jun 2009 16:45:45 -0500</pubDate>
	<author>Rob</author>
	<description><![CDATA[ 
		<p>Well, I'd take registration once over captcha on every comment.</p>
		<p>I forgot you don't require an email address to post, but if you required a user name and email address then that really is a registration. If you kept a list of poster email addresses that you've approved, either passively or actively, then the agent could approve any post with that email address.</p>
		<p>You could take it a step farther and send a validation message for any comments with email addresses that aren't in the white list. You don't even need passwords or user name. Just a thought.</p>
		<p>I don't have access to my Notes documentation here but the agent storage area I'm talking about is a place you can store data that stays with the agent. When you modify the agent the data gets deleted. This is where the agent keeps track of what documents it has processed. In Java and LotusScript you've got to make an agent call on each document that you process and it saves something, likely the UNID, to tell the agent that it's processed that document. (I think it's a target setting in the agent properties called something like "Unprocessed documents". But it's only automatic for @ formula agents.)</p>
		<p>I'll look this up tonight and post something more accurate. I've only used this feature a couple of times.</p>
		<p>Peace,</p>
		<p>Rob:-]</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=003E024C388754E7862575DF00778B7F"><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-20090624?OpenDocument#DOC_003E024C</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Wed, 24 Jun 2009 15:10:04 -0500</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>Rob. You want to have to register to post a comment? What are you, crazy!? Why would you want to see anything other than the easiest option possible? </p>
		<p>The only down-side to the current approach is that anybody can post using anybody else's name.</p>
		<p>What's this "agent storage area" of which you talk?? Tell me more.</p>
		<p>The Approved flag is either 1 or 0 and depends (mainly) on whether the blog to which it's a reply is older than 7 days. If so it's 0. If it's younger than a week (the time it seems to take spammers to be aware of a new entry) then it computes to 1 and things appear live.</p>
		<p>{Form="Post" & Approved=0} would be sufficient to find the posts I need to know about. But, unless I kept on top of them and deleted them, then the email I received would grow and grow with time.</p>
		<p>Jake</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=582DD9AADE724E3B862575DF006EC90D"><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-20090624?OpenDocument#DOC_582DD9AA</link>
</item><item>
	<title>Reply from Rob</title>
	<pubDate>Wed, 24 Jun 2009 11:22:55 -0500</pubDate>
	<author>Rob</author>
	<description><![CDATA[ 
		<p>I don't want no captchas!</p>
		<p>Didn't you have a discussion here some time back about other ways to detect automated SPAM bots? I recall hidden fields that the bots would fill in but humans wouldn't. (I'd like to talk about this more.)</p>
		<p>REGISTRATION</p>
		<p>The solution I'd prefer would be to have to register to post a comment. The registration would validate the email address by sending an email to the person registering that had a link they had to click.</p>
		<p>If you were very paranoid then the page that appears when the validation link is clicked would have captcha. This would require only one captcha per registration. I could live with that.</p>
		<p>I've used this very system on several projects.</p>
		<p>AGENT LAST RUN DATE/TIME</p>
		<p>I guess you're saying that the build-in agent last run date/time is the time when the agent last finished running, not when it started. (I've never paid any attention to that.) </p>
		<p>Instead why not store the current date/time first thing when the agent starts in the agent storage area (I forget what that's called.) (Well, you'd have to fetch the previous value, if any, first. Then store the new start time.)</p>
		<p>This would give you the agent last run start time very accurately. If the agent was "never run" then the variable would not be present. If it is present then that time would be when the agent started last.</p>
		<p>Frankly I avoid doing date-based searches when I can think of any other way. You have the "Approved" flag on the Post form. Does this get set true on every Post eventually? I'm wondering why your first query (Form="Post" & Approved=0) isn't sufficient. </p>
		<p>Or have I just gone off topic about how to do a better version of how to improve on "All new & modified documents"?</p>
		<p>Peace,</p>
		<p>Rob:-]</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=76CFC5AD4D5983EB862575DF0059FCD6"><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-20090624?OpenDocument#DOC_76CFC5AD</link>
</item><item>
	<title>Reply from Aaron Hardin</title>
	<pubDate>Wed, 24 Jun 2009 08:44:54 -0500</pubDate>
	<author>Aaron Hardin</author>
	<description><![CDATA[ 
		<p>Just thinking out loud, but to prevent the use of captchas, couldn't you setup another names.nsf for anyone that wants to make a comment and then authenticate their name?</p>
		<p>I know its more work but that would cut down on spammers.</p>
		<p>Just a thought.</p>
		<p>Great post by the way, I can see a lot of potential use. Thanks!!</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=BB39177F48A54163862575DF004B8554"><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-20090624?OpenDocument#DOC_BB39177F</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Wed, 24 Jun 2009 07:20:24 -0500</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>That's what it does Jorge (Approved="0"). Without the time stamp the email would grow and grow until I removed the non-live documents from the database and I wouldn't know if any had been posted since it last ran without comparing to the previous email.</p>
		<p>Matt: "I believe we're all going to have to move to captchas eventually"</p>
		<p>I really don't *want* to believe. It will be a cold day in hell when I add one on here. </p>
		<p>I'd prefer to think something equally as clever will come about before then which prevents spambots and doesn't require captchas. Captchas are evil!</p>
		<p>Jake</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=8F21F5C4038FDDCC862575DF0043C913"><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-20090624?OpenDocument#DOC_8F21F5C4</link>
</item><item>
	<title>Reply from Matt Cooper</title>
	<pubDate>Wed, 24 Jun 2009 07:13:08 -0500</pubDate>
	<author>Matt Cooper</author>
	<description><![CDATA[ 
		<p>Hi Jake,</p>
		<p>Good stuff.  I never really investigated the .HasRunSinceModified.  Very interesting.</p>
		<p>I know it's off topic, but for the spammers and their ways ... I just got hit slowly on a database that I hadn't looked over in a while (3 months).  I opened up the reports and found that a spammer had hit the contact form 90,000 times. (took me 2 hours to delete in Notes)  Luckily, using a little CSS trickery, the system only sends emails on valid contacts, (that is, those sent by humans.) so the customer never knew it was happening.</p>
		<p>However, I believe we're all going to have to move to captchas eventually.  Look on the bright side, you're helping computers read books.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=6722E6A5A4A1F0AC862575DF00431E9C"><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-20090624?OpenDocument#DOC_6722E6A5</link>
</item><item>
	<title>Reply from Jorge</title>
	<pubDate>Wed, 24 Jun 2009 07:02:43 -0500</pubDate>
	<author>Jorge</author>
	<description><![CDATA[ 
		<p>Why not have a field that acts as a flag to determine whether a post is live or not live on the site? You can then simply have your agent every 2 hours look for posts that are not live (flag=false), rather than having to worry about time stamps.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=5FFB92DD56078614862575DF00422AC2"><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-20090624?OpenDocument#DOC_5FFB92DD</link>
</item><item>
	<title>Reply from Nick Hopkins</title>
	<pubDate>Wed, 24 Jun 2009 06:39:56 -0500</pubDate>
	<author>Nick Hopkins</author>
	<description><![CDATA[ 
		<p>How funny. </p>
		<p>'Until last week every comment posted on this site triggered an individual email to me. '</p>
		<p>As you will know (because I told you) I've been using your blog template on one of my sites for a while.</p>
		<p>Because of the nature of my business I have administrator open all day on a terminal on Server Console.</p>
		<p>The regular message 'Unable to send mail to Jake Howlett.....Name not found in domino directory' used to drive me mad. - kept promising myself I'd investigate.</p>
		<p>Now I know why!</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=1EFA01F9B529523E862575DF004014CE"><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-20090624?OpenDocument#DOC_1EFA01F9</link>
</item><item>
	<title>Reply from Peter Leugner</title>
	<pubDate>Wed, 24 Jun 2009 06:04:06 -0500</pubDate>
	<author>Peter Leugner</author>
	<description><![CDATA[ 
		<p>Interesting Article about the topic:</p>
		<p>http://www-10.lotus.com/ldd/bpmpblog.nsf/dx/db.search-date-vs.-no-date?opendocument&comments</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=157B7E64608C2D2B862575DF003CCD27"><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-20090624?OpenDocument#DOC_157B7E64</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Wed, 24 Jun 2009 05:12:52 -0500</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>I was going to reply and say I don't know because I don't ever use that second option to .search(). Flaz beat me to it though.</p>
		<p>If you're looking for either new or modified docs then I guess it could be the lesser of two evils.</p>
		<p>Jake</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=85B37E2A7BBB6A71862575DF00381BC8"><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-20090624?OpenDocument#DOC_85B37E2A</link>
</item><item>
	<title>Reply from Flaz</title>
	<pubDate>Wed, 24 Jun 2009 05:09:26 -0500</pubDate>
	<author>Flaz</author>
	<description><![CDATA[ 
		<p>The NotesDateTime param in the Search method searches documents created OR modified since the specified date.</p>
		<p>So it's not what Jake was looking for...</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=6387DB58BF918486862575DF0037CB92"><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-20090624?OpenDocument#DOC_6387DB58</link>
</item><item>
	<title>Reply from Peter Leugner</title>
	<pubDate>Wed, 24 Jun 2009 04:43:58 -0500</pubDate>
	<author>Peter Leugner</author>
	<description><![CDATA[ 
		<p>Would it be more efficient to specify the cutoff date in the db.search instead of "nothing"? You could set it to agent.lastRun - 30 seconds.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=1D839851004E644F862575DF003576B7"><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-20090624?OpenDocument#DOC_1D839851</link>
</item>

</channel>
</rss> 
