<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Falling Dominos &#187; parenting</title>
	<atom:link href="http://codepress.net/b/category/parenting/feed/" rel="self" type="application/rss+xml" />
	<link>http://codepress.net/b</link>
	<description>Let&#039;s keep Lotus Notes development relevant</description>
	<lastBuildDate>Fri, 19 Feb 2010 02:36:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>LotusScript AmazonS3Helper Class</title>
		<link>http://codepress.net/b/2008/01/14/lotusscript-amazons3helper-class/</link>
		<comments>http://codepress.net/b/2008/01/14/lotusscript-amazons3helper-class/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 04:54:05 +0000</pubDate>
		<dc:creator>Tom ONeil</dc:creator>
				<category><![CDATA[lotus]]></category>
		<category><![CDATA[parenting]]></category>

		<guid isPermaLink="false">http://codepress.net/b/2008/01/14/lotusscript-amazons3helper-class/</guid>
		<description><![CDATA[I&#8217;ve refactored my AmazonS3 example by creating a AmazonS3Helper class. The AmazonS3Helper class builds the datestamp and signature you need for every call.
I have taken this code:

Function FormatDateToISO8601(aDate As NotesDateTime) As String
	' Thanks to Joel Litton http://www.joelitton.net/A559B2/home.nsf/d6plinks/JLIN-5UU4B2
	Dim dtLocal As NotesDateTime
	Dim dtGMT As NotesDateTime
	Set dtGMT = New NotesDateTime( Left$(aDate.GMTTime, 22) )
	FormatDateToISO8601= Format$(dtGMT.LSLocalTime, "yyyy-mm-ddThh:nn:ss.000Z")
End Function

Sub Initialize

	Const mysecretkey [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve refactored my AmazonS3 example by creating a AmazonS3Helper class. The AmazonS3Helper class builds the datestamp and signature you need for every call.</p>
<p>I have taken this code:</p>
<pre><code>
Function FormatDateToISO8601(aDate As NotesDateTime) As String
	' Thanks to Joel Litton http://www.joelitton.net/A559B2/home.nsf/d6plinks/JLIN-5UU4B2
	Dim dtLocal As NotesDateTime
	Dim dtGMT As NotesDateTime
	Set dtGMT = New NotesDateTime( Left$(aDate.GMTTime, 22) )
	FormatDateToISO8601= Format$(dtGMT.LSLocalTime, "yyyy-mm-ddThh:nn:ss.000Z")
End Function

Sub Initialize

	Const mysecretkey = PUT YOUR SECRET KEY HERE
	Const myAccessKey = PUT YOUR ACCESS KEY HERE
	Dim myS3 As New AmazonS3_n3()
	Dim mydate As New XSD_DATETIME
	Dim mykey As New XSD_STRING
	Dim mysig As New XSD_STRING

	Dim dateTime As New NotesDateTime( "" )
	Dim hmacbuilder As String
	Dim formattedDate As String
	Call dateTime.SetNow

	Dim mybuckets As ListAllMyBucketsResult_n3
	formattedDate = FormatDateToISO8601(dateTime)
	Call mydate.setValueFromString(formattedDate)
	Call mykey.setValueFromString(myaccesskey)
	HMACBuilder = "AmazonS3ListAllMyBuckets" + formattedDate
	Call mysig.setValueFromString(HMAC_SHA1_B64(mysecretkey,HMACBuilder))
	Set mybuckets =  myS3.ListAllMyBuckets(mykey,mydate,mysig)

End Sub

</code></pre>
<p>and turned it into this:</p>
<pre><code>
	Dim myS3 As New AmazonS3_n3()
	Dim S3Helper As AmazonS3Helper

	Dim mybuckets As ListAllMyBucketsResult_n3
	Set S3Helper = New AmazonS3Helper("ListAllMyBuckets")
	Set mybuckets =  myS3.ListAllMyBuckets(S3Helper.key,S3Helper.DateStamp,S3Helper.Signature)
</code></pre>
<p>The class takes one parameter in the constructor: the AmazonS3 function you wish to call. In the case above, I sent it &#8220;ListAllMyBuckets.&#8221; The class then generates the key, datestamp, and signature needed for the call. You can also make a &#8220;Regenerate&#8221; call to regenerate the values using the current date and time.</p>
<p>You could also set a new function name with the &#8220;S3Function&#8221; property. Setting the S3Function property also calls the &#8220;regenerate&#8221; function mentioned previously.</p>
<p>Example:</p>
<pre><code>
	Dim myS3 As New AmazonS3_n3()
	Dim S3Helper As AmazonS3Helper

	Dim mybuckets As ListAllMyBucketsResult_n3
	Set S3Helper = New AmazonS3Helper("ListAllMyBuckets")
	Set mybuckets =  myS3.ListAllMyBuckets(S3Helper.key,S3Helper.DateStamp,S3Helper.Signature)

	Dim mybucket As CreateBucketResult_n3
	Dim acl As New  AccessControlList_n3()
	S3Helper.S3Function = "CreateBucket"
	Set mybucket = myS3.CreateBucket("testLotus", acl,S3Helper.key,S3Helper.DateStamp,S3Helper.Signature)
</code></pre>
<p>The library requires the <a href="http://codepress.net/b/2008/01/14/libhmac_sha1/">HMAC_SHA1 script library</a> found on this site and the AmazonS3 <a href="http://codepress.net/b/2007/12/17/amazon-s3-in-notes-8/">WSDL&#8217;d script library</a>.</p>
<p>Download the AmazonS3Helper script library here: <a href='http://codepress.net/b/wp-content/uploads/2008/01/amazons3helper.lss' title='AmazonS3Helper'>AmazonS3Helper</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codepress.net/b/2008/01/14/lotusscript-amazons3helper-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sunday&#8230;</title>
		<link>http://codepress.net/b/2007/12/16/sunday/</link>
		<comments>http://codepress.net/b/2007/12/16/sunday/#comments</comments>
		<pubDate>Sun, 16 Dec 2007 16:01:47 +0000</pubDate>
		<dc:creator>Tom ONeil</dc:creator>
				<category><![CDATA[parenting]]></category>

		<guid isPermaLink="false">http://codepress.net/b/2007/12/16/sunday/</guid>
		<description><![CDATA[A hillarious question is asked at ParentDish (a parents blog):
When is it time to let your kid start wiping independently?
]]></description>
			<content:encoded><![CDATA[<p>A hillarious question is asked at ParentDish (a parents blog):</p>
<p><a href="http://www.parentdish.com/2007/12/16/when-is-it-time-to-let-your-kid-start-wiping-independently/" target="_blank">When is it time to let your kid start wiping independently?</a></p>
]]></content:encoded>
			<wfw:commentRss>http://codepress.net/b/2007/12/16/sunday/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
