<?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>Lotushints &#187; Lotus Domino</title>
	<atom:link href="http://www.lotushints.com/category/lotus-domino/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lotushints.com</link>
	<description>Lotus Notes tips &#38; tricks you always hoped you will not need</description>
	<lastBuildDate>Wed, 14 Jul 2010 06:00:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Sametime 8.5 rant</title>
		<link>http://www.lotushints.com/2010/01/sametime-8-5-rant/</link>
		<comments>http://www.lotushints.com/2010/01/sametime-8-5-rant/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 06:00:05 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Sametime]]></category>
		<category><![CDATA[Upgrades]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=474</guid>
		<description><![CDATA[As upgrading to Domino 8.5.1 went so fine, it is time to upgrade our only Sametime server. Yes. Only Sametime server. We are a company of 80 and there is really no need for something more. Specially as we use WebEx as a meeting and conferencing software. Thanks to Lars Berntrop-Bos and the news of [...]]]></description>
			<content:encoded><![CDATA[<p>As <a href="/2009/12/upgrading-to-8-5-1/">upgrading to Domino 8.5.1 went so fine</a>, it is time to upgrade our only Sametime server. Yes. Only Sametime server. We are a company of 80 and there is really no need for something more. Specially as we use WebEx as a meeting and conferencing software.</p>
<p><span id="more-474"></span></p>
<p>Thanks to <a href="http://www.bleedyellow.com/blogs/ScriptLars" target="_blank">Lars Berntrop-Bos</a> and the news of Domino 8.5.1 I went to download it from IBM partner site. During the download I remembered that the <a href="/2008/10/upgrading-domino-running-sametime-to-802-on-linux-platform/">last time I did a Domino upgrade on Linux</a>, our Sametime stopped working as upgrade overridden / deleted some Sametime files and folders. Hence, for the reasons specified in previous upgrade article, I decided to also download newest Sametime 8.5.</p>
<p>In the past, installing Sametime was almost a piece of cake. You installed Domino server, installed Sametime, did some configuration voodoo and you were done. Now, I am presented with 7 or 8 binaries to download. What on earth is System Console Server? Why do I need separate install for 7 other things that were mostly included in one binary in previous release? Why do I need WebSphere Application Server? And I am not even starting on DB2.</p>
<p>Thankfully, uncle Google led me to this <a href="http://www.iminstant.com/iminstant/iminstant.nsf/d6plinks/CTYR-7YYKS7" target="_blank">blog</a>, where all possible options are described in detail. Now, apparently, to run all new and shiny features, you need at least two servers. Most likely because mixing Domino and Websphere Application Server is not a good idea if not impossible. If you are willing to sacrifice all new and cool meeting and conferencing features, you can keep your one dedicated server and run Sametime 8.5 Classic.</p>
<p>My real question is, what was IBM thinking? I get that separating each and every major feature of Sametime may mean better performance, but I really cannot see smaller companies (up to 150 employees) sacrificing at least one additional server for the sake of running a simple messaging and meeting application. Specially not those (like the one I work at) that already use other meeting and conferencing software. How can I go to my boss and tell him that we need Sametime for meeting and collaboration, when it takes more resources than existing implementation of competitive software? Also, integrating WAS as a framework? Really?</p>
<p>Phew&#8230; now with that off my chest, I am off to prepare a plan of upgrading&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2010/01/sametime-8-5-rant/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Upgrading to 8.5.1</title>
		<link>http://www.lotushints.com/2009/12/upgrading-to-8-5-1/</link>
		<comments>http://www.lotushints.com/2009/12/upgrading-to-8-5-1/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 06:00:41 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Upgrades]]></category>
		<category><![CDATA[Domino 8.5.1]]></category>
		<category><![CDATA[upgrade]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=461</guid>
		<description><![CDATA[Come end of last week, we started upgrading our servers to release 8.5.1. I did test upgrade of our development server couple of days back and find it incredibly easy. All test servers were installed in some 15 minutes. Without a glitch. Yeay for us and let&#8217;s go upgrade our production servers. First in line [...]]]></description>
			<content:encoded><![CDATA[<p>Come end of last week, we started upgrading our servers to release 8.5.1. I did test upgrade of our development server couple of days back and find it incredibly easy. All test servers were installed in some 15 minutes. Without a glitch. Yeay for us and let&#8217;s go upgrade our production servers.</p>
<p><span id="more-461"></span></p>
<p>First in line were our internal servers. It took my colleague a significant amount (and by significant, I mean up to 5 times what was our worst case prediction) of time to upgrade.  Upgrade went without a glitch. Problem was, that one server couldn&#8217;t start up JVM anymore and both internal servers were now failing to log people in. First was solved by copying JVM from one of our 8.5.1 servers. Second, was a tedious task of finding an option to disable SSO using AD instead of Notes Address Book.</p>
<p>With that sorted and running for several days, it was time to start upgrading remaining servers. One of them runs on 64 bits, btw. Install went fine, quick and did not enable SSO with AD.  Hurrah! Other servers (32-bit ones) were not as kind. All failed to work after starting for the first time. Seemed to be some problem with java controller. Disabled it and ran the server. Failed. I then performed an upgrade again, at which point, install program started bitching as windows service for Domino Server was already of the same version. Ignoring that, I ran the server again. Nope, service shut down with erra again. I then disabled java controller at start up and started the server, only to quit it as soon as it was fully operational. Why? To enable java controller. After performing that task, I started the service, again, and then it finally worked. Yipi!</p>
<p>The only server remaining on 8.0.2 is our Sametime server, which runs on Linux. As far as I know, 8.5.1 is still not out for RHEL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/12/upgrading-to-8-5-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lotus Notes 8.5.1</title>
		<link>http://www.lotushints.com/2009/10/lotus-notes-8-5-1/</link>
		<comments>http://www.lotushints.com/2009/10/lotus-notes-8-5-1/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 06:00:47 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[LotusScript]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=444</guid>
		<description><![CDATA[With the abundance of posts out there, I thought I would chip in my 5 cents worth. Yes, I know I am a bit late. Release 8.5.1 is for LotusScript developer everything he could ever hope for. Specially if you are into OO programming. Finally you don&#8217;t have to check your old classes what parameters [...]]]></description>
			<content:encoded><![CDATA[<p>With the abundance of posts out there, I thought I would chip in my 5 cents worth. Yes, I know I am a bit late.</p>
<p>Release 8.5.1 is for LotusScript developer everything he could ever hope for. Specially if you are into OO programming. Finally you don&#8217;t have to check your old classes what parameters they take, you can easily locate them by going to class definition and helper works. Now, you have really no excuse to start OO development in LotusScript.</p>
<p>On the other hand, 8.5.1 introduced some strange bugs. My colleague found an interesting bug while editing forms. For some reason, formula wasn&#8217;t saved when the document was. I think he solved it by removing formula completely and then re-pasting it back. Another funny thing is code formatting. Still not working properly. Hope to see it solved in 8.5.2.</p>
<p>Don&#8217;t get me wrong. I take 8.5.1 over any release any day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/10/lotus-notes-8-5-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What not to do in multi-domain evnironment</title>
		<link>http://www.lotushints.com/2009/09/what-not-to-do-in-multi-domain-evnironment/</link>
		<comments>http://www.lotushints.com/2009/09/what-not-to-do-in-multi-domain-evnironment/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 07:00:25 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Sametime]]></category>
		<category><![CDATA[names.nsf]]></category>
		<category><![CDATA[user id]]></category>
		<category><![CDATA[username]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=432</guid>
		<description><![CDATA[There is one thing you oughtn&#8217;t do in multi-domain environment. Ever. We did it, as it was needed to successfully connect Cisco Click-to-call plug-in for Sametime with Cisco Presence server. What is it? Don&#8217;t change UserId in names.nsf database. OK. So I am not entirely truthful. You can do that, but make sure you add [...]]]></description>
			<content:encoded><![CDATA[<p>There is one thing you oughtn&#8217;t do in multi-domain environment. Ever. We did it, as it was needed to successfully connect Cisco Click-to-call plug-in for Sametime with Cisco Presence server.</p>
<p><span id="more-432"></span></p>
<h3><strong>What is it? </strong></h3>
<p>Don&#8217;t change UserId in names.nsf database. OK. So I am not entirely truthful. You can do that, but make sure you add previous UserId to Username field.  But if you don&#8217;t, in best case, you can expect angry calls from your users, as e-mails from alternative domains will not be delivered to them. That&#8217;s your best case. Worst case is, no one will know and you will lose customers. Lucky for us, we had best case scenario.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/09/what-not-to-do-in-multi-domain-evnironment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>System time is not in sync with Domino time</title>
		<link>http://www.lotushints.com/2009/06/system-time-is-not-in-sync-with-domino-time/</link>
		<comments>http://www.lotushints.com/2009/06/system-time-is-not-in-sync-with-domino-time/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 07:00:42 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Upgrades]]></category>
		<category><![CDATA[ini parameters]]></category>
		<category><![CDATA[SERVER_DISABLE_TIMESYNC]]></category>
		<category><![CDATA[SERVER_TIMESYNC_INTERVAL]]></category>
		<category><![CDATA[system]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=378</guid>
		<description><![CDATA[A funny thing happened to our servers on multiple occasions. Server system time was not equal to Domino server time. Some times they were even as much as 5 minutes apart. After contacting IBM support and filling that standard questionnaire, they provided us with a link to knowledge-base article containing a solution. To summarize an [...]]]></description>
			<content:encoded><![CDATA[<p>A funny thing happened to our servers on multiple occasions. Server system time was not equal to Domino server time. Some times they were even as much as 5 minutes apart.</p>
<p><span id="more-378"></span></p>
<p>After contacting IBM support and filling that standard questionnaire, they provided us with a link to <a href="http://www.ibm.com/support/docview.wss?rs=899&amp;uid=swg21327441" target="_blank">knowledge-base article</a> containing a solution.</p>
<p>To summarize an article&#8230;</p>
<p>1) If you are running 8.0.2, install fix-pack 1 immediately. This will solve the issue.</p>
<p>2) If you are running inferior versions, you can use SERVER_TIMESYNC_INTERVAL ini file parameter. Values are:</p>
<ul>
<li>SERVER_TIMESYNC_INTERVAL = 1      &#8211; every 5min (default)</li>
<li>SERVER_TIMESYNC_INTERVAL = 2      &#8211; every 1min</li>
<li>SERVER_TIMESYNC_INTERVAL = 3      &#8211; every 60min</li>
<li>SERVER_DISABLE_TIMESYNC = 1            &#8211; disable polling</li>
</ul>
<p>Remember to restart the server after applying this setting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/06/system-time-is-not-in-sync-with-domino-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Design patterns &#8211; Part 10: Builder pattern</title>
		<link>http://www.lotushints.com/2009/05/design-patterns-part-10-builder-pattern/</link>
		<comments>http://www.lotushints.com/2009/05/design-patterns-part-10-builder-pattern/#comments</comments>
		<pubDate>Mon, 18 May 2009 06:00:47 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Basic]]></category>
		<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Code optimization]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[absract factory]]></category>
		<category><![CDATA[builder]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[object-oriented]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=349</guid>
		<description><![CDATA[In part 10 of Design pattern series we will take look at Builder design pattern. Albeit much similarity, this pattern it is not to be mistaken with Abstract factory pattern. As Abstract Factory emphasizes a family of products and returns the product immediately, Builder focuses on constructing complex object step by step, returning product in [...]]]></description>
			<content:encoded><![CDATA[<p>In part 10 of <a href="/category/design-patterns/">Design pattern series</a> we will take look at Builder design pattern. Albeit much similarity, this pattern it is not to be mistaken with Abstract factory pattern. As Abstract Factory emphasizes a family of products and returns the product immediately, Builder focuses on constructing complex object step by step, returning product in final step.</p>
<blockquote><p>The intention of the <strong>The Builder pattern</strong> is to abstract steps of construction of objects so that different implementations of these steps can construct different representations of objects.</p></blockquote>
<p><span id="more-349"></span></p>
<p><strong>Huh?</strong></p>
<p>The best way to explain how builder pattern works is to look at the example. Imagine you have to build product presentation for a company that sells built PCs. For clarity&#8217;s sake, let&#8217;s pretend that they sell only two types of computers. One for basic office needs, running Linux OS and one for pro gaming needs running Windows.</p>
<p><strong>Let&#8217;s go!</strong></p>
<p>First, you need a product class. This class will be able to store product type, add components and display itself when needed. This allows you to build product with as many components as needed.</p>
<pre>Class CBuilderProduct
	Private m_strProductName As String
	Private m_strLParts List As String

	Sub New (productName As String)
		m_strProductName = productName
	End Sub

	Sub Add (part As String, desc As String)
		m_strLParts (part) = desc
	End Sub

	Sub Show ()
		Dim strDisplay As String

		strDisplay = "Product: " &amp; m_strProductName
		Forall part In m_strLParts
			strDisplay = strDisplay &amp; Chr(13) &amp;_
                      Listtag (part) &amp; ": " &amp; part
		End Forall
		Messagebox strDisplay
	End Sub
End Class</pre>
<p>Next, you need a builder class. This is an abstract class, only specifying methods and variables used by end product classes that inherit from it.</p>
<pre>Class CBuilder
	Private m_Product As CBuilderProduct

	Property Get Product As CBuilderProduct
		Set Product = m_Product
	End Property

	Sub AddOS()
	End Sub

	Sub AddPC()
	End Sub
End Class</pre>
<p>Now, you are ready to create real product classes. In our case, this classes will represent Basic and Pro products.</p>
<pre>Class CBuilderProductBasic As CBuilder
   Sub New()
      Set m_Product = New CBuilderProduct ("Basic Package")
   End Sub

   Sub AddOS()
      Call m_Product.Add ("Operating system", "Fedora Core 10")
   End Sub

   Sub AddPC()
      Call m_Product.Add ("Computer", "Basic home computer")
   End Sub
End Class

Class CBuilderProductPro As CBuilder
   Sub New()
      Set m_Product = New CBuilderProduct ("Pro Package")
   End Sub

   Sub AddOS()
      Call m_Product.Add ("Operating system", "Windows 7")
   End Sub

   Sub AddPC()
      Call m_Product.Add ("Computer", "Pro gaming computer")
   End Sub
End Class</pre>
<p>You are almost done. But first, you need a catalogue (or shop) class. This class will actually contain algorithm for building desired products. Beware that<em> builder</em> parameter of <em>Create </em>method must be of type <em>Variant </em>(it should be <em>CBuilder</em>) or you will get an error while compiling your code that will use this design pattern!</p>
<pre>Class CBuilderCatalog
	Sub Create (builder As Variant)
		Call builder.AddPC()
		Call builder.AddOS()
	End Sub
End Class</pre>
<p>To test the code, I wrote a simple agent that simply outputs two message boxes. One for each product.</p>
<pre>Sub Initialize
	Dim builder As CBuilder
	Dim shop As CBuilderCatalog

	Set shop = New CBuilderCatalog ()

	Set builder = New CBuilderProductBasic ()
	Call shop.Create (builder)
	Call builder.Product.Show()

	Set builder = New CBuilderProductPro ()
	Call shop.Create (builder)
	Call builder.Product.Show()
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/05/design-patterns-part-10-builder-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Certificate expiration in Lotus Domino on May 18th 2009</title>
		<link>http://www.lotushints.com/2009/05/security-certificate-expiration-in-lotus-domino-on-may-18th-2009/</link>
		<comments>http://www.lotushints.com/2009/05/security-certificate-expiration-in-lotus-domino-on-may-18th-2009/#comments</comments>
		<pubDate>Thu, 07 May 2009 05:08:06 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Installation]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Certificate]]></category>
		<category><![CDATA[Java applet]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=344</guid>
		<description><![CDATA[Got this e-mail from IBM Notes &#38; Domino team todayand thought it worthy of sharing with public&#8230; What is happening The certificate for some Java applets in Lotus Domino 6.5.x, Domino 7.0.x, Domino 8.0.x, and Domino 8.5 have an expiration date of May 18, 2009. Starting May 19th, Web users will see a dialog with [...]]]></description>
			<content:encoded><![CDATA[<p>Got this e-mail from IBM Notes &amp; Domino team todayand thought it worthy of sharing with public&#8230;</p>
<blockquote><p><strong>What is  happening</strong><br />
The certificate for some Java applets in Lotus Domino 6.5.x,  Domino 7.0.x, Domino 8.0.x, and Domino 8.5 have an expiration date of May 18,  2009. Starting May 19th, Web users will see a dialog with a message similar to  one of the following when loading a Web page that contains a Java applet from  the Domino server:</p>
<p>&#8220;The digital signature was generated with a trusted  certificate but has expired or is not yet valid.&#8221;<br />
&#8220;The security certificate  has expired or is not yet valid.&#8221;</p>
<p>This issue can occur even if IBM is set  up as a trusted publisher in the browser.</p>
<p><strong>What does this  mean</strong><br />
Please be assured that this message does <span style="text-decoration: underline;">not</span> mean security  has been compromised. It simply reflects the expiration of the signature  originally provided in the security certificate used with certain Domino  applets. You can find an explanation in the following technote:</p>
<p>Title:  &#8220;Security certificate expiration messages generated from Domino applets (May 18,  2009)&#8221;<br />
URL: <a href="http://www.ibm.com/support/docview.wss?rs=899&amp;uid=swg21381298">http://www.ibm.com/support/docview.wss?rs=899&amp;uid=swg21381298</a></p>
<p><strong>Action  needed to resolve</strong><br />
To resolve the situation, you have three options: (1)  Instruct users to &#8220;Always Trust&#8221; content from IBM, (2) if using Domino 7.x,  upgrade to Domino 7.0.4, or (3) download and apply fixes. IBM recommends that  you replace the affected Jar files (option 3) as described in the following  download document for any supported release of Domino:</p>
<p>Title: &#8220;Download  re-signed Java applets for Lotus Domino (May 18, 2009)&#8221;<br />
URL: <a href="http://www.ibm.com/support/docview.wss?rs=899&amp;uid=swg24022981">http://www.ibm.com/support/docview.wss?rs=899&amp;uid=swg24022981</a></p>
<p>Alternatively,  an interim fix will be posted to <a href="http://www.ibm.com/support/fixcentral/">Fix Central</a> for the latest  Modification and Fix Pack levels by May 8th. These include Domino 6.5.6 FP3,  7.0.3 FP1, 7.0.4, 8.0.2 FP1, and 8.5.0. If you&#8217;re not running one of these  releases, access the download document above, which provides fixes for all  supported release levels.</p>
<p><strong>General Self-Help Resources</strong><br />
Here are  links to other ways that you can access IBM Lotus Notes &amp; Domino self-help  support information on the Web:<br />
1. <a href="http://www.ibm.com/software/support/einfo.html">My Support</a> (<span style="color: #0000ff;"><a href="http://www.ibm.com/software/support/einfo.html">http://www.ibm.com/software/support/einfo.html</a></span>)<br />
2.  <a href="http://www.ibm.com/software/lotus/support/clickaway/">Lotus Support is  just a click away</a> (<span style="color: #0000ff;"><a href="http://www.ibm.com/software/lotus/support/clickaway/">http://www.ibm.com/software/lotus/support/clickaway/</a></span>);  learn more about Lotus Software Self-Assist Options.<br />
3. <a href="http://www.ibm.com/software/support/gcnews.html">IBM Software Support Site  design update</a> (<span style="color: #0000ff;"><a href="http://www.ibm.com/software/support/gcnews.html">http://www.ibm.com/software/support/gcnews.html</a></span>)<br />
4.  <a href="http://www.lotus.com/ldd/dominowiki.nsf">New Lotus Notes Domino  Wiki</a><strong> </strong>(<span style="color: #0000ff;"><a href="http://www.lotus.com/ldd/dominowiki.nsf">http://www.lotus.com/ldd/dominowiki.nsf</a></span>)<br />
5.  Fix Central (<a href="http://www.ibm.com/support/fixcentral/">http://www.ibm.com/support/fixcentral/</a>)</p>
<p>Sincerely,</p>
<p>The  IBM Lotus Notes &amp; Domino Team</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/05/security-certificate-expiration-in-lotus-domino-on-may-18th-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design patterns &#8211; Part 9: Mediator pattern</title>
		<link>http://www.lotushints.com/2009/04/design-patterns-part-9-mediator-pattern/</link>
		<comments>http://www.lotushints.com/2009/04/design-patterns-part-9-mediator-pattern/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 08:00:28 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Code optimization]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[mediator]]></category>
		<category><![CDATA[object-oriented]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=320</guid>
		<description><![CDATA[This week, I present to you not much used, but quite useful Mediator pattern. Mediator pattern provides a unified interface to set of interfaces in a subsystem. Or, to simplify&#8230; Mediator pattern is mediator for communication between several classes. Example Now, the easiest way to explain this pattern is via example. Example itself is borrowed [...]]]></description>
			<content:encoded><![CDATA[<p>This week, I present to you not much used, but quite useful Mediator pattern.</p>
<blockquote><p><strong>Mediator pattern</strong> provides a unified interface to set of interfaces in a subsystem.</p></blockquote>
<p>Or, to simplify&#8230; Mediator pattern is mediator for communication between several classes.</p>
<p><span id="more-320"></span></p>
<p><strong>Example</strong></p>
<p>Now, the easiest way to explain this pattern is via example. Example itself is borrowed from <a href="http://www.dofactory.com/Patterns/PatternMediator.aspx" target="_blank">dofactory page</a>, but modified to fit LotusScript. It is about a simple support chat room. This chat room has several users of two types: admins and customers. I will call them participants. These participants can communicate amongst each other, presuming, they know user ids.</p>
<p>First, we need a chatroom template class, as we might end up with more than one chat room. Chat room will need to register participants and to be able to deliver messages to them.</p>
<pre>Class CChatroomTemplate
   Sub Register (participant As CParticipant)
   End Sub

   Sub Send (strFrom As String, strTo As String, strMsg As String)
   End Sub
End Class</pre>
<p>As participants need instance of chatroom class and chatroom needs list of participant class instances, we need to create chatroom and participant class frameworks and only then put code into it. Participants need to be able to send and receive messages. Finished classes are displayed below.</p>
<pre>Class CSupportChat As CChatroomTemplate
   m_LMembers List As CParticipant

   Sub Register(participant As CParticipant)
      If (Not Iselement (m_LMembers (participant.UserId))) Then
         Set m_LMembers (participant.UserId) = participant
      End If
      Set participant.Chatroom = Me
   End Sub

   Sub Send (strFrom As String, strTo As String, strMsg As String)
      Dim participant As CParticipant

      If (Not Iselement (m_LMembers (strTo))) Then Exit Sub
      Set participant = m_LMembers (strTo)
      Call participant.Receive (strFrom, strMsg)
   End Sub
End Class

Class CParticipant
   m_chatroom As CSupportChat
   m_strUserId As String

   Property Set Chatroom As CSupportChat
      Set m_chatroom = Chatroom
   End Property

   Property Get UserId As String
      UserId = m_strUserId
   End Property

   Property Set UserId As String
      m_strUserId = UserId
   End Property

   Sub new (strUserId As String)
      m_strUserId = strUserId
   End Sub

   Sub Send (strTo As String, strMsg As String)
      Call m_chatroom.Send (m_strUserId, strTo, strMsg)
   End Sub

   Sub Receive (strFrom As String, strMsg As String)
      Messagebox strFrom &amp; " to " &amp; m_strUserId &amp; ": " &amp; strMsg
   End Sub
End Class</pre>
<p>Now that base classes are set, it is time to create real participant classes. In our case, we need one for admins and one for regular users.</p>
<pre>Class CAdmin As CParticipant
   Sub new (strUserId As String)
   End Sub

   Sub Receive (strFrom As String, strMsg As String)
      Messagebox "Admin message"
      Call CParticipant..Receive (strFrom, strMsg)
   End Sub
End Class

Class CUser As CParticipant
   Sub new (strUserId As String)
   End Sub

   Sub Receive (strFrom As String, strMsg As String)
      Messagebox "User message"
      Call CParticipant..Receive (strFrom, strMsg)
   End Sub
End Class</pre>
<p><strong>Testing the code</strong></p>
<p>For testing purposes, I put it all in agent, created four users (of which one is admin) and sent 3 messages to admin and admin responded to first one. The code is below.</p>
<pre>Sub Initialize
   Dim chatroom As CSupportChat
   Dim user1 As CParticipant
   Dim user2 As CParticipant
   Dim user3 As CParticipant
   Dim user4 As CParticipant

   Set chatroom = New CSupportChat()
   Set user1 = New CUser ("User 1")
   Set user2 = New CUser ("User 2")
   Set user3 = New CUser ("User 3")
   Set user4 = New CAdmin ("Admin 1")

   Call chatroom.Register (user1)
   Call chatroom.Register (user2)
   Call chatroom.Register (user3)
   Call chatroom.Register (user4)

   Call user1.Send ("Admin 1", "Help?")
   Call user4.Send ("User 1", "What's wrong?")
   Call user2.Send ("Admin 1", "My server just crashed!!!")
   Call user3.Send ("Admin 1", "Network died!")
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/04/design-patterns-part-9-mediator-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design patterns &#8211; Part 8: State pattern</title>
		<link>http://www.lotushints.com/2009/03/design-patterns-part-8-state-pattern/</link>
		<comments>http://www.lotushints.com/2009/03/design-patterns-part-8-state-pattern/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 08:00:35 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Code optimization]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[object-oriented]]></category>
		<category><![CDATA[state]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=234</guid>
		<description><![CDATA[State pattern is probably most used in review cycles. The definition says: State pattern allows an object to appear as it can change its class by altering its behaviour and state. What are you talking about? Well, imagine you are in need to build a bug tracking database.  Bug reports in basics have four states. [...]]]></description>
			<content:encoded><![CDATA[<p>State pattern is probably most used in review cycles. The definition says:</p>
<blockquote><p><strong>State pattern</strong> allows an object to appear as it can change its class by altering its behaviour and state.</p></blockquote>
<p><strong>What are you talking about?</strong></p>
<p>Well, imagine you are in need to build a bug tracking database.  Bug reports in basics have four states. First they are <strong>unassigned</strong> until someone is solving them. When they are taken over, they become <strong>assigned</strong>, specifying that someone is already working on them. After bug fix has been produced, it is a good practice to <strong>send </strong>it<strong> to testing</strong>. Then it is up to QA to confirm that bug fix is <strong>complete </strong>or whether it is not.</p>
<p><span id="more-234"></span></p>
<p><strong>Show me the code!</strong></p>
<p>Example will be based on simple bug report specified above. However, I will skip actual action implementation as it varies based on application needs. Instead, I will use message box to print out the action report.</p>
<p>So, now, first what you need is a state abstract class that will implement all methods needed for transition between states (in our case: unassigned, assigned, send to testing and complete).</p>
<pre>Class CState
	Sub TakeOver()
	End Sub

	Sub SendToTesting()
	End Sub

	Sub Complete()
	End Sub
End Class</pre>
<p>Then, what you need is a context class that will be used when changing state of a bug report.</p>
<pre>Class CStateBugReport
   stateUnassigned As CState
   stateAssigned As CState
   stateReadyForTesting As CState
   stateCompleted As CState
   stateCurrent As CState

   Sub New
      Set stateUnassigned = New CStateUnassigned (Me)
      Set stateAssigned = New CStateAssigned (Me)
      Set stateReadyForTesting = New CStateSentToTesting (Me)
      Set stateCompleted = New CStateCompleted (Me)

      Set stateCurrent = stateUnassignedb
   End Sub

   Sub Assign()
      Call stateCurrent.TakeOver()
   End Sub

   Sub SendToTesting()
      Call stateCurrent.SendToTesting()
   End Sub

   Sub Complete()
      Call stateCurrent.Complete()
   End Sub

   Function GetAssignedState() As CState
      Set GetAssignedState = stateAssigned
   End Function

   Function GetReadyForTestingState() As CState
      Set GetReadyForTestingState = stateReadyForTesting
   End Function

   Function GetCompletedState() As CState
      Set GetCompletedState = stateCompleted
   End Function

   Sub SetState( state As CState )
      Set Me.stateCurrent = state
   End Sub
End Class</pre>
<p>And now, we need to implement all four states classes.</p>
<pre>Class CStateUnassigned As CState
   bugReport As CStateBugReport

   Sub New (bugReport As CStateBugReport)
      Set Me.bugReport = bugReport
   End Sub

   Sub TakeOver ()
      Messagebox "Took over!"
      Call Me.bugReport.SetState (Me.bugReport.GetAssignedState())
   End Sub

   Sub SendToTesting()
      Messagebox "Unassigned reports cannot be sent to testing"
   End Sub

   Sub Complete()
      Messagebox "Unassigned reports cannot be completed"
   End Sub
End Class

Class CStateAssigned As CState
   bugReport As CStateBugReport

   Sub New (bugReport As CStateBugReport)
      Set Me.bugReport = bugReport
   End Sub

   Sub TakeOver ()
      Messagebox "Report already assigned"
   End Sub

   Sub SendToTesting()
      Messagebox "Sent to testing!"
      Call Me.bugReport.SetState
         (Me.bugReport.GetReadyForTestingState())
   End Sub

   Sub Complete()
      Messagebox "Untested reports cannot be completed"
   End Sub
End Class

Class CStateSentToTesting As CState
   bugReport As CStateBugReport

   Sub New (bugReport As CStateBugReport)
      Set Me.bugReport = bugReport
   End Sub

   Sub TakeOver ()
      Messagebox "Report already assigned"
   End Sub

   Sub SendToTesting()
      Messagebox "Report already in testing"
   End Sub

   Sub Complete()
      Messagebox "Complete!"
      Call Me.bugReport.SetState (Me.bugReport.GetCompletedState())
   End Sub
End Class

Class CStateCompleted As CState
   bugReport As CStateBugReport

   Sub New (bugReport As CStateBugReport)
      Set Me.bugReport = bugReport
   End Sub

   Sub TakeOver ()
      Messagebox "Report already completed"
   End Sub

   Sub SendToTesting()
      Messagebox "Report already completed"
   End Sub

   Sub Complete()
      Messagebox "Report already completed"
   End Sub
End Class</pre>
<p>This is all there is to it. To test it, I wrote a simple agent that goes through states and in each new state also tests wrong transitions (e.g. from unassigned to complete etc.).</p>
<pre>Sub Initialize
	Dim bugReport As New CStateBugReport()

	Call bugReport.SendToTesting()
	Call bugReport.Complete()

	Call bugReport.Assign()
	Call bugReport.Assign()
	Call bugReport.Complete()

	Call bugReport.SendToTesting()
	Call bugReport.Assign()
	Call bugReport.SendToTesting()

	Call bugReport.Complete()
	Call bugReport.Assign()
	Call bugReport.SendToTesting()
	Call bugReport.Complete()
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/03/design-patterns-part-8-state-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Design patterns &#8211; Part 7: Template method pattern</title>
		<link>http://www.lotushints.com/2009/02/design-patterns-part-7-template-method-pattern/</link>
		<comments>http://www.lotushints.com/2009/02/design-patterns-part-7-template-method-pattern/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 08:00:35 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Code optimization]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[object-oriented]]></category>
		<category><![CDATA[template method]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=200</guid>
		<description><![CDATA[In this article, I would like to present you a design pattern that is not so common, but for sure, I wish, that in the past I would have used it. It would certainly make my life much easier. So, what is this Template method pattern all about? The Template Method Pattern defines the skeleton [...]]]></description>
			<content:encoded><![CDATA[<p>In this article, I would like to present you a design pattern that is not so common, but for sure, I wish, that in the past I would have used it. It would certainly make my life much easier. So, what is this Template method pattern all about?</p>
<blockquote><p><strong>The Template Method Pattern</strong> defines the skeleton of a an algorithm in one method. Some steps are deferred to subclasses, which are allowed to alter certain algorithm steps without changing the skeleton of an algorithm.</p></blockquote>
<p><span id="more-200"></span></p>
<p><strong>Say what?</strong></p>
<p>Well, to simplify the definition, let&#8217;s look at an example. Imagine you have several product types. Your assigned task was to build a product catalogue on the web. All product types will use tables for representation, however not all products can be displayed the same. This is a perfect task for Template method pattern.</p>
<p><strong>But why?</strong></p>
<p>Think about it. Your catalogue needs to be displayed differently for each product, meaning you need to get different sets of product for each display. I agree, you could have written multiple agents, or just use multiple methods in an agent, but think about maintainability. And on top of it all, to display each product type, your algorithm is the same. First you need to do some <strong>initialization</strong>, then you need to <strong>select</strong> desired products. Next step is to <strong>process</strong> document set to create a display. In the end, all you need to do is <strong>print</strong> the results and <strong>terminate</strong> (or perform a clean up). Steps <strong>select</strong> and <strong>process</strong> are product type dependant. All other steps of the algorithm are common.</p>
<p><strong>Example</strong></p>
<p>For example let&#8217;s pretend that we have two types of products: regular classroom courses and e-courses. Regular classroom courses (or just courses) are scheduled courses, while e-courses are actually a 1 month subscription to some content (like video, PDF, etc.).</p>
<p>First, we need to create some storage classes: CProduct and CPrice, that will store information about products. This is more efficient than just have a collection of NotesDocuments.</p>
<pre>Class CPrice
	Public strDesc As String
	Public dPrice As Double
End Class

Class CProduct
	m_strName As String
	m_strType As String
	Public m_Price() As CPrice

	Property Get Label As String
		Label = Me.m_strName
	End Property

	Property Get MyType As String
		MyType = Me.m_strType
	End Property

	Sub New (strName As String, strType As String)
		Me.m_strName = strName
		Me.m_strType = strType
		Redim Me.m_Price (0)
	End Sub

	Sub AddPrice (strDesc As String, dPrice As Double)
		Dim nIndex As Integer

		nIndex = 0
		If (Not Me.m_Price (0) Is Nothing) Then
                     nIndex = Ubound (Me.m_Price) + 1
              End If

		Redim Preserve Me.m_price (nIndex)
		Set Me.m_price (nIndex) = New CPrice
		Me.m_Price (nIndex).strDesc = strDesc
		Me.m_Price (nIndex).dPrice = dPrice
	End Sub
End Class</pre>
<p>Class CPrice contains a description of price (subscription or schedule date) and the price itself. Class CProduct defines a product. Each product can have multiple prices.</p>
<p>Now, to our abstract class that will define the algorithm and required methods.</p>
<pre>Class CTemplateProduct
	m_strHtml As String
	m_products() As CProduct

	Sub Initialize()
		Redim m_products (0)
	End Sub

	Sub Select()
	End Sub

	Sub Process()
	End Sub

	Sub Print()
		Print m_strHtml
	End Sub

	Sub Terminate()
		Erase m_products
	End Sub

	Sub Run()
		Call Me.Initialize()
		Call Me.Select()
		Call Me.Process()
		Call Me.Print()
		Call Me.Terminate()
	End Sub
End Class</pre>
<p>As you can see, methods Initialize, Print and Terminate are already implemented.<br />
Next, we need to create classes for each product type. These classes will inherit from the abstract class.</p>
<pre>Class CTemplateCourse As CTemplateProduct
   Sub Select()
      Redim Preserve Me.m_products (1)
      Set Me.m_products (0) =
         New CProduct ("Course 1", "Lecture")

      Call Me.m_products (0).AddPrice ("Feb 3rd, 2009", 1000.0)

      Set Me.m_products (1) =
         New CProduct ("Exam 1", "Lecture &amp; exam")

      Call Me.m_products (1).AddPrice ("Feb 20th, 2009", 2000.0)
   End Sub

   Sub Process()
      Dim n As Integer
      Dim nPrice As Integer
      Dim nLBound As Integer
      Dim nUBound As Integer
      Me.m_strHtml = {&lt;table border="0"&gt;}

      For n = Lbound (Me.m_products) To Ubound (Me.m_products)
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;tbody&gt;&lt;tr&gt;}
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;td colspan="2"&gt;}
         Me.m_strHtml = Me.m_strHtml &amp; _
         Me.m_products (n).Label &amp; { - }

         Me.m_strHtml = Me.m_strHtml &amp; _
         Me.m_products (n).MyType &amp; {&lt;/td&gt;}

         Me.m_strHtml = Me.m_strHtml &amp; {&lt;/tr&gt;}
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;tr&gt;}

         nLBound = Lbound(Me.m_products (n).m_Price)
         nUBound = Ubound (Me.m_products (n).m_Price)
         For nPrice = nLBound To nUBound
            Me.m_strHtml = Me.m_strHtml &amp; {&lt;td&gt;}
            Me.m_strHtml = Me.m_strHtml &amp; _
            Me.m_products (n).m_Price (nPrice).strDesc 

            Me.m_strHtml = Me.m_strHtml &amp; {&lt;/td&gt;}
            Me.m_strHtml = Me.m_strHtml &amp; {&lt;td&gt;}
            Me.m_strHtml = Me.m_strHtml &amp; _
            Me.m_products (n).m_Price (nPrice).dPrice
            Me.m_strHtml = Me.m_strHtml &amp; {&lt;/td&gt;}
         Next
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;/tr&gt;}
      Next

      Me.m_strHtml = Me.m_strHtml &amp; {&lt;/tbody&gt;}
   End Sub
End Class

Class CTemplateECourse As CTemplateProduct
   Sub Select()
      Redim Preserve Me.m_products (1)
      Set Me.m_products (0) =
         New CProduct ("E-Course 1", "eBook")
      Call Me.m_products (0).AddPrice ("1 month", 100.0)

      Set Me.m_products (1) =
         New CProduct ("E-Course 2", "ePresentation")

      Call Me.m_products (1).AddPrice ("1 month", 200.0)
   End Sub

   Sub Process()
      Dim n As Integer
      Dim nPrice As Integer
      Dim nLBound As Integer
      Dim nUBound As Integer

      Me.m_strHtml = {&lt;table border="0"&gt;}

      For n = Lbound (Me.m_products) To Ubound (Me.m_products)
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;tbody&gt;&lt;tr&gt;}
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;td&gt;} &amp;_
         Me.m_products (n).Label &amp; {&lt;/td&gt;}
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;td&gt;} &amp; _
         Me.m_products (n).MyType &amp; {&lt;/td&gt;}

         nLBound = Lbound(Me.m_products (n).m_Price)
         nUBound = Ubound (Me.m_products (n).m_Price)
         For nPrice = nLBound To nUBound
            Me.m_strHtml = Me.m_strHtml &amp; {&lt;td&gt;} &amp; _
            Me.m_products (n).m_Price (nPrice).strDesc

            Me.m_strHtml = Me.m_strHtml &amp; {&lt;br/&gt;} &amp; _
            Me.m_products (n).m_Price (nPrice).dPrice &amp; {&lt;/td&gt;}
         Next
         Me.m_strHtml = Me.m_strHtml &amp; {&lt;/tr&gt;}
      Next

      Me.m_strHtml = Me.m_strHtml &amp; {&lt;/tbody&gt;&lt;/table&gt;}
   End Sub
End Class</pre>
<p>As you can no doubt see, I have simplified the Select method (this is due to me being to lazy to actually create a form, a view and some 6 documents). Also, method Process creates different HTML for each product type.</p>
<p>Interesting thing, this is about it.<br />
All you have to do is some code that will use this. Here is my test agent, that should be run via browser.</p>
<pre>Sub Initialize
	Dim course As CTemplateProduct
	Dim eCourse As CTemplateProduct

	Set course = New CTemplateCourse ()
	Call course.Run()

	Set eCourse = New CTemplateECourse()
	Call eCourse.Run()
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/02/design-patterns-part-7-template-method-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
