<?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 Notes</title>
	<atom:link href="http://www.lotushints.com/tag/lotus-notes/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>Thu, 29 Dec 2011 09:47:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Domino URL cheat sheet</title>
		<link>http://www.lotushints.com/2010/10/domino-url-cheat-sheet/</link>
		<comments>http://www.lotushints.com/2010/10/domino-url-cheat-sheet/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 06:00:11 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Quick Tip]]></category>
		<category><![CDATA[ASP.net]]></category>
		<category><![CDATA[Cheatsheet]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=526</guid>
		<description><![CDATA[Lately I tried to integrate some C# application with Lotus Notes application data. Hence, I needed to display view contents in some way. Naturally I googled for solution on how to display view contents as JSON and came across Domino URL Cheat sheet. Even though I lately decided to go with XML display (mostly because [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I tried to integrate some C# application with Lotus Notes application data. Hence, I needed to display view contents in some way.</p>
<p>Naturally I googled for solution on how to display view contents as JSON and came across <a title="Domino URL Cheatsheet" href="http://www.ibm.com/developerworks/lotus/library/ls-Domino_URL_cheat_sheet/" target="_blank">Domino URL Cheat sheet</a>. Even though I lately decided to go with XML display (mostly because you have XMLDataSource in ASP.net), I still found it useful and with loads of great tips I might use in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2010/10/domino-url-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</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>Are Notes really built for Java?</title>
		<link>http://www.lotushints.com/2009/08/are-notes-really-built-for-java/</link>
		<comments>http://www.lotushints.com/2009/08/are-notes-really-built-for-java/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 06:00:36 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Upgrades]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=419</guid>
		<description><![CDATA[This is what I came to ask myself constantly this past few months. Lately, I&#8217;ve been noticing that vast majority of all erra on server is due to some java library error. For example, we experience an annoying issue, when at certain point, Notes decide that some Crypto library is missing and doesn&#8217;t load up [...]]]></description>
			<content:encoded><![CDATA[<p>This is what I came to ask myself constantly this past few months. Lately, I&#8217;ve been noticing that vast majority of all erra on server is due to some java library error. For example, we experience an annoying issue, when at certain point, Notes decide that some Crypto library is missing and doesn&#8217;t load up successfully. Not until you restart the server that is. IBMs suggestion was to reinstall the server, as apparently corresponding jar file got corrupted somewhere during upgrade (WTF?!). All fine and well, but this is a production server. A server that hosts thousand users daily. A server that quite frankly has no other issue but this one. There is definitely not going to be any reinstall taking place in near future.</p>
<p>Are Notes really built for Java? Because at this point it certainly fails to look so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/08/are-notes-really-built-for-java/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Notes rendering engine</title>
		<link>http://www.lotushints.com/2009/06/notes-rendering-engine/</link>
		<comments>http://www.lotushints.com/2009/06/notes-rendering-engine/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 07:00:11 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[rendering]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=372</guid>
		<description><![CDATA[About a year hence, it was time to refresh web design of my company&#8217;s web site. We decided to stick to new and improved web page standards and thus separate style and scripts from content. All well, but one simple thing. Our CMS never forced it&#8217;s users to use HTML in their code. We always [...]]]></description>
			<content:encoded><![CDATA[<p>About a year hence, it was time to refresh web design of my company&#8217;s web site. We decided to stick to new and improved web page standards and thus separate style and scripts from content. All well, but one simple thing. Our CMS never forced it&#8217;s users to use HTML in their code. We always relied on Notes rendering engine to render Notes documents body contents to what should be displayed on the web.</p>
<p>Not a good idea. I don&#8217;t know, when was the last time, someone at IBM took a look at their rendering engine, but this just isn&#8217;t it. Unordered lists don&#8217;t close, leading to a total mess of your layout. On numerous occasions, a div tag marked as pass through text got put to the bottom of contents and not at the spot where it was in the body field, leading to some more confusion. And what killed it for me was a sudden br tag flood in the HTML for no apparent reason. All 6 of them were gone when text was put in the same line as pass through text and appeared right after I put the text back in new line. And all of this appeared randomly, which amused me for a while.</p>
<p>So, I guess it is no wonder, why there are so many CMS application in Notes, where content needs to be entered as HTML. However, in my experience, you as a developer or admin of such system can be glad if a content editor knows how to use Lotus Notes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/06/notes-rendering-engine/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Design patterns &#8211; Part 11: Bridge pattern</title>
		<link>http://www.lotushints.com/2009/06/design-patterns-part-11-bridge-pattern/</link>
		<comments>http://www.lotushints.com/2009/06/design-patterns-part-11-bridge-pattern/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 07:00:38 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Code optimization]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[bridge]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[object-oriented]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=361</guid>
		<description><![CDATA[In part 11 of Design pattern series we will go into creating and using the Bridge design pattern. It is moderately used and uses encapsulation, inheritance and aggregation to separate responsibilities into other classes. The Bridge pattern decouples an abstraction from its implementation so that the two can vary independently. Usage The pattern is most [...]]]></description>
			<content:encoded><![CDATA[<p>In part 11 of <a href="../category/design-patterns/">Design pattern series</a> we will go into creating and using the Bridge design pattern. It is moderately used and uses encapsulation, inheritance and aggregation to separate responsibilities into other classes.</p>
<blockquote><p><strong>The Bridge pattern</strong> decouples an abstraction from its implementation so that the two can vary independently.</p></blockquote>
<p><span id="more-361"></span></p>
<p><strong>Usage</strong></p>
<p>The pattern is most useful, when both classes (implementation and abstraction) are assigned to different task handling. In our example, we will look at how to separate data and actions to build a list of products and navigate it.</p>
<p><strong>Data representation class</strong></p>
<p>This is an abstract class with only navigational methods specified. Data representation class must implement navigational logic in its methods and thus assures that no other class will change or handle any properties without data representation class knowledge.</p>
<p>Also, for needs of our example, we will also define a type that will contain product id, name and price.</p>
<pre>Type TBridgeData
   strId As String
   strName As String
   dPrice As Double
End Type

Class CBridgeDataObject
   Sub NextRecord ()
   End Sub

   Sub PrevRecord ()
   End Sub

   Sub AddRecord (strId As String, strName As String,_
   dPrice As Double)
   End Sub

   Sub RemoveRecord (strId As String )
   End Sub

   Sub ShowRecord ()
   End Sub

   Function ShowAllRecords () As String
   End Function
End Class</pre>
<p><strong>Product data class</strong></p>
<p>Class itself inherits from Data representation abstract class. Also, it contains all navigational logic as well as data handling.</p>
<p>Beware that for this example, I did not actually load the data from the database. Instead I created five (5) products in the class construct. In real life, you should have read the data from your database!</p>
<pre>Class CBridgeProductData As CBridgeDataObject
   Private m_nCurrent As Integer
   Private m_AProducts () As TBridgeData

   Sub New ()
      m_ncurrent = 0

      Redim m_AProducts(4)

      m_AProducts(0).strId = "PR-0001"
      m_AProducts(0).strName = "Product 1"
      m_AProducts(0).dPrice = 100.00

      m_AProducts(1).strId = "PR-0002"
      m_AProducts(1).strName = "Product 2"
      m_AProducts(1).dPrice = 1000.00

      m_AProducts(2).strId = "PR-0003"
      m_AProducts(2).strName = "Product 3"
      m_AProducts(2).dPrice = 150.00

      m_AProducts(3).strId = "PR-0004"
      m_AProducts(3).strName = "Product 4"
      m_AProducts(3).dPrice = 400.00

      m_AProducts(4).strId = "PR-0005"
      m_AProducts(4).strName = "Product 5"
      m_AProducts(4).dPrice = 330.00
   End Sub

   Sub NextRecord ()
      If (m_nCurrent < Ubound (m_AProducts)) Then
         m_nCurrent = m_nCurrent + 1
      End If
   End Sub

   Sub PrevRecord ()
      If (m_nCurrent > 0) Then
         m_nCurrent = m_nCurrent - 1
      End If
   End Sub

   Sub AddRecord (strId As String, strName As String,_
   dPrice As Double)
      Dim n As Integer

      n = Ubound (m_AProducts) + 1
      Redim Preserve m_AProducts (n)

      m_AProducts(n).strId = strId
      m_AProducts(n).strName = strName
      m_AProducts(n).dPrice = dPrice
   End Sub

   Sub RemoveRecord (strId As String)
      Dim n As Integer
      Dim m As Integer
      Dim nCount As Integer
      Dim nIndex As Integer

      m = 0
      nIndex = -1
      nCount = Ubound (m_AProducts)
      For n = 0 To nCount
         If (m_AProducts (n).strId <> strId) Then
            m_AProducts (m).strId = m_AProducts (n).strId
            m_AProducts (m).strName = m_AProducts (n).strName
            m_AProducts (m).dPrice = m_AProducts (n).dPrice
            m = m + 1
         Else
            nIndex = n
         End If
      Next

      Redim Preserve m_AProducts (nCount - 1)
      If (m_nCurrent > n) Then Call Me.PrevRecord ()
   End Sub

   Sub ShowRecord ()
      Dim strDisplay As String

      strDisplay = m_AProducts (m_nCurrent).strId &#038; { } &#038;_
      m_AProducts (m_nCurrent).strName &#038; { €} &#038;_
      m_AProducts (m_nCurrent).dPrice

      Messagebox strDisplay
   End Sub

   Function ShowAllRecords() As String
      Dim n As Integer
      Dim strDisplay As String

      strDisplay = ""
      For n = 0 To Ubound (m_AProducts)
         strDisplay = strDisplay &#038; Chr(13) &#038;_
         m_AProducts (n).strId &#038; { } &#038;_
         m_AProducts (n).strName &#038; { €} &#038;_
         m_AProducts (n).dPrice
      Next

      ShowAllRecords = strDisplay
   End Function
End Class</pre>
<p><strong>Product base class</strong></p>
<p>Now, that we have our data classes created, we need to build an abstraction class that will call actual navigation and display the list contents or item if necessary. As we might have multiple classes that should have same functionality, it is a must to create a base class first. This class will encapsulate Data representation abstract class.</p>
<pre>Class CBridgeProductBase
   Private m_DataObj As CBridgeDataObject
   Private m_strGroup As String

   Public Property Get Data
      Set Data = m_DataObj
   End Property

   Public Property Set Data
      Set m_DataObj = Data
   End Property

   Sub New (strGroup As String)
      m_strGroup = strGroup
   End Sub

   Sub Next ()
      Call m_DataObj.NextRecord ()
   End Sub

   Sub Prev ()
      Call m_DataObj.PrevRecord ()
   End Sub

   Sub Add (strId As String, strName As String, dPrice As Double)
      Call m_DataObj.AddRecord (strId, strName, dPrice)
   End Sub

   Sub Remove (strId As String)
      Call m_DataObj.RemoveRecord (strId)
   End Sub

   Sub Show ()
      Call m_DataObj.ShowRecord()
   End Sub

   Sub ShowAll ()
      Messagebox "Product group: " &#038; m_strGroup &#038; Chr (13) &#038;_
      m_DataObj.ShowAllRecords()
   End Sub
End Class</pre>
<p><strong>Concrete product class</strong></p>
<p>Concrete product class in our case, will only be used to alter presentation when ShowAll method is called. This is not a must.</p>
<pre>Class CBridgeProducts As CBridgeProductBase
   Sub New (strGroup As String)
   End Sub

   Sub ShowAll ()
      Messagebox "Displaying all products"
      Call CBridgeProductBase..ShowAll ()
   End Sub
End Class</pre>
<p><strong>Implementation</strong></p>
<p>For test purposes, I have created an agent that will:</p>
<ul>
<li>create product list</li>
<li>navigate forward and backward</li>
<li>add an item to the list</li>
<li>remove an item from the list</li>
<li>display single product or all products at any time,</li>
</ul>
<pre>Sub Initialize
   Dim products As CBridgeProducts
   Dim data As CBridgeProductData

   Set products = New CBridgeProducts ("product group 1")
   Set products.Data = New CBridgeProductData ()

   Call products.Show ()
   Call products.Next ()
   Call products.Show ()
   Call products.Prev ()
   Call products.Show ()
   Call products.ShowAll ()

   Call products.Add ("PR-0010", "New product", 1475.00)
   Call products.ShowAll ()
   Call products.Remove ("PR-0004")
   Call products.ShowAll ()
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/06/design-patterns-part-11-bridge-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>Banner animator v1.1</title>
		<link>http://www.lotushints.com/2009/03/banner-animator-v11/</link>
		<comments>http://www.lotushints.com/2009/03/banner-animator-v11/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 08:00:30 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Basic]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[animator]]></category>
		<category><![CDATA[banner]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=276</guid>
		<description><![CDATA[In order to display multiple banners in single spot (and to keep web site from becoming tacky), you will need some sort of client side script that will display first one banner, then the second one etc. This is called banner animator (or even ad animator). In this case, the functionality is written in JavaScript, [...]]]></description>
			<content:encoded><![CDATA[<p>In order to display multiple banners in single spot (and to keep web site from becoming tacky), you will need some sort of client side script that will display first one banner, then the second one etc. This is called banner animator (or even ad animator). In this case, the functionality is written in JavaScript, with some help of HTML (for element positioning) and CSS (for element appearance).<br />
<span id="more-276"></span><br />
<strong>What does that have to do with Lotus Notes?</strong></p>
<p>Absolutely nothing. The only connection to Lotus Notes is, when you integrate this functionality into your database. It is a simple and trivial solution. I needed to create a form that will represent one single banner. This form contains name, URL, image, sort order etc. Look-up view for obtaining sorted banner list was created and some web forms that are already in &#8220;production&#8221; had to be altered, for loading of JavaScript class etc.</p>
<p><strong>Prerequisites</strong></p>
<p>This functionality depends heavily on <a href="http://jquery.com/">jQuery library</a>. It can be obtained <a href="http://docs.jquery.com/Downloading_jQuery">here</a>. I recommend minified version if you plan on hosting it yourself or, you can use <a href="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js">Google Code link</a> to link it from Google.</p>
<p>Next you need to obtain the <em>adPlayer </em>library. It is located <a href="http://dl.getdropbox.com/u/599331/jslibs/adPlayer.js">here</a>. I would ask you to not link the library directly from this link, but download it to your server and link it from there.</p>
<p><strong>Getting started</strong></p>
<p>In order to implement this application, you will first need to make a small HTML adjustment in the place where you want banner animator to be implemented.</p>
<pre>&lt;ul id="adPlayer"&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad1.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad2.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad3.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="adPlayerNav"&gt;&lt;/div&gt;</pre>
<p>Obviously you should insert link of your desire. The same goes for image <em>src </em>and <em>alt</em> parameters. Also, number of <em>li</em> elements can vary.</p>
<p>Next, at the bottom of the page (where your JS libraries are loaded and on load events are set), you need to load both .js files  (<em>jQuery </em>and <em>AdPlayer</em>) , if you do not already have them. Next, add following (or if you already have onload event loader, just call loadPlayer() function).</p>
<pre>&lt;script type="text/javascript" language="javascript"&gt;
    $(document).ready(function() {
        loadPlayer();
    });
&lt;/script&gt;</pre>
<p><strong>Now add some style<br />
</strong></p>
<p>It is necessary to add styling to content thus far. CSS excerpt below will give you some idea as to how you can style things. Beware that #adPlayer height property must be set to height of a banner space. Also, some tweaking to .js file will have to be done, but nothing major (this will definitely be changed in future releases).</p>
<pre>/* layout */
#adPlayer { list-style: none; height: 220px; margin-left: 0;
margin-bottom: 0; overflow: hidden; padding: 0; }
#adPlayer li { margin: 0; padding: 0; }
#adPlayerNav { position: relative; top: -1em; right: 1em;
text-align: right; }
#adPlayerNav ul { list-style: none; margin: 0; padding: 0; }
#adPlayerNav li { display: inline; margin: 0 0 0 0.1em;
padding: 0; }
#adPlayerNav li.adPlay, #adPlayerNav li.adPause {
margin-left: 1em; }
#adPlayerNav li a { cursor: pointer; padding: 0 0.5em; }

/* typography */
#adPlayerNav li { font-size: 1.2em; }

/* color */
#adPlayerNav li { border: solid 1px rgb(213, 213, 217); }
#adPlayerNav li a { background-color: white; padding: 0.5em; }</pre>
<p>You now have fully functional banner animator.</p>
<p><strong>Optimization</strong></p>
<p>Loading 3+ 50K+ images in the middle of the page can never be a good thing. Thus, <em>adPlayer</em> library has a <strong>dynamic mode</strong> that can be used. This mode loads images after the page is loaded, which is a good thing. However, you cannot leave your banner space empty until then. A compromise solution is to load first banner in-line and all others after the document is loaded. Your HTML file must now look somewhat like this:</p>
<pre>...
&lt;ul id="adPlayer"&gt;
    &lt;li&gt;&lt;a href=""&gt;&lt;img src="images/ad1.jpg" /&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div id="adPlayerNav"&gt;&lt;/div&gt;
...
&lt;script type="text/javascript" language="javascript"&gt;
    $(document).ready(function() {
        loadPlayer( true );
        adplayer.add ("", "images/ad2.jpg", "");
        adplayer.add ("", "images/ad3.jpg", "");
        adplayer.generatePlayer();
    });
&lt;/script&gt;</pre>
<p>Loading <em>loadPlayer</em> method with <em>true </em>as parameter value will enable <strong>dynamic mode</strong>. Now you can add banners in desired sort order. First parameter is <em>link</em>, second image <em>src </em>and third image <em>alt</em>. After you are done, just call <em>generatePlayer</em> method.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/03/banner-animator-v11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom user sidebars in web applications</title>
		<link>http://www.lotushints.com/2009/03/custom-user-sidebars-in-web-applications/</link>
		<comments>http://www.lotushints.com/2009/03/custom-user-sidebars-in-web-applications/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 07:00:20 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[sidebars]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=217</guid>
		<description><![CDATA[When I was assigned to rebuild company&#8217;s web site for the second time in 7 or 8 years, I have decided that it is probably the time to implement some modularity to the database. First in line were sidebars. Why? Well, despite &#8220;awesome&#8221; notes rich text to HTML rendering, web content was always contained in [...]]]></description>
			<content:encoded><![CDATA[<p>When I was assigned to rebuild <a href="http://www.nil.com">company&#8217;s web site</a> for the second time in 7 or 8 years, I have decided that it is probably the time to implement some modularity to the database. First in line were sidebars. Why? Well, despite &#8220;awesome&#8221; notes rich text to HTML rendering, web content was always contained in rich text field on a document, making it very customizable. On the other hand, sidebars were always subforms that were then connected to the document via a field (user specified subforms name). This was customizable, but regular content editors did not have designer access to the database. Thus, all modifications were relayed to us, developers. And there were quite a bit of modifications. I will pitch you my idea of solution to this problem.</p>
<p><span id="more-217"></span></p>
<p><strong>First step</strong></p>
<p>In order to ensure that content editors could alter sidebars by itself, they had to be moved from design elements to documents. All fine and well. However, if you look at typical sidebar, it is assembled from multiple parts called widgets. This widgets can be e.g. adverts, link boxes, etc. Now, I wanted to achieve as much modularity as I could and there used to be quite a lot of sidebars, containing same widgets (not all, but some). So why force a user to create same thing multiple times? Thus, widgets came to be.</p>
<p><strong>Widgets</strong></p>
<p>Widget (in this case) is the smallest single component that can be displayed in a sidebar. This can be a simple image, or a complex linkbox. Widget in Notes database is a simple document containing descriptive name, short web name and a rich text field. This rich text field contains content for the widget. It can be pure notes content or it can be HTML, that CSS will change into something &#8220;edible&#8221;.</p>
<p>Simple, and easy. However, what you now don&#8217;t want, is for users to link multiple widgets into web content documents. For one, content of sidebars is usually content related, meaning that web pages on same topic will probably have same widgets. And it has to be user friendly if you want users to use it. So, you can&#8217;t expect users to be comfortable with a feature that gives them more work if they decide to change something. And here is where Sidebar documents come in handy.</p>
<p><strong>Sidebar documents</strong></p>
<p>Sidebar document is nothing else but a container of widgets. What I did was enabled user to choose widgets he wants in this sidebar and he/she can sort them however he/she sees it fit. Sidebar document also contains a rich text field that will contain content of specified widgets rich text fields.</p>
<p><strong>Subform</strong></p>
<p>Now, that I had sidebar documents created, there is one thing I could not avoid. I had to create a subform, which I can include on each web form there is. This subform includes a rich text item and some HTML. On the plus side, you now only need one subform for all sidebars.</p>
<p><strong>What does this bring me?</strong></p>
<p>Well, besides the fact that users will now be able to do their own sidebars and have an easy way to change it&#8217;s contents (which means less work for you), this organization also gives you one powerful feature. All computed values and hide formulas that you will specify in widgets will be recalculated once they are displayed as part of the document and displayed on web. Thus, you can i.e. add a computed value that computes from a field on web page form and will compute correctly when displayed on web page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/03/custom-user-sidebars-in-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling Java classes from LotusScript</title>
		<link>http://www.lotushints.com/2009/02/calling-java-classes-from-lotusscript/</link>
		<comments>http://www.lotushints.com/2009/02/calling-java-classes-from-lotusscript/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 08:00:19 +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 Notes]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[adapter]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[object-oriented]]></category>
		<category><![CDATA[user registration]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=210</guid>
		<description><![CDATA[Have you ever wondered how you could call already written and quite useful Java classes in your LotusScript code? To me, this moment was, when I was trying to implement other department&#8217;s code into my own. Unfortunately I wasn&#8217;t skilled enough in ways of object development, LS2J  and googling back then to actually figure out [...]]]></description>
			<content:encoded><![CDATA[<p><span>Have you ever wondered how you could call already written and quite useful Java classes in your <span>LotusScript</span> code? To me, this moment was, when I was trying to implement other department&#8217;s code into my own. Unfortunately I wasn&#8217;t skilled enough in ways of object development, LS2J  and googling back then to actually figure out that was possible. I remember thinking: &#8220;IBM implemented Java in Lotus Notes, they must have done some adaptor for it.&#8221;, but was unable to figure it out. Until couple of years back, when I got a </span><a href="http://www.randsinrepose.com/archives/2002/07/10/the_dark_underbelly_of_holy_shit.html">Holy shit!</a> moment, finding <a href="http://www.nsftools.com/blog/blog-11-2004#11-19-04">this blog post</a>.</p>
<p><span id="more-210"></span><strong>But why would I need that?</strong></p>
<p><span>As you can see from the above examples, you can implement Java functionality to your <span>LotusScript</span> code. This can be good if your Java programming skills aren&#8217;t that great or you already have some code in <span>LotusScript</span> and you wish to add functionality. For me, it would do fine in cases where I converted documents in a database to PDF on user request, or when I needed an agent to <span>login</span> user to notes via web in the background, or as I mentioned, when I needed to implement some functionality from other department in my already existing code. Instead, I re-wrote several agents into Java, which in the end didn&#8217;t prove to be that bad of a decision, but about that some other day.</span></p>
<p><strong>But how do I do that?</strong></p>
<p>There is a functionality called <strong>LS2J </strong><span>that does exactly that for you. If you will, you can imagine it as an adaptor for <span>LotusScript</span> that allows you to call Java classes. I will give you a small example. It is based on my user <span>login</span> class, although, there is really no code there to log in the user.</span></p>
<p><span>First you need to create/obtain a java library that does what you want. I named that library <span>jclass</span>:<span>UserLogin</span>.</span></p>
<pre><span>public class CUserLogin {
   String m_strUsername;
   String m_strPassword;

   public void Initialize(String strUsername, String strPassword) {
      if ((strUsername.length() == 0) ||
          (strPassword.length() == 0))
         return;

      m_strUsername = strUsername;
      m_strPassword = strPassword;
   }

   public boolean run() {
      // add code that will perform auto-login
      return true;
   }
}</span></pre>
<p><span>Then, I strongly suggest you create a <span>LotusScript</span> library, containing a class that will do actual Java to <span>LotusScript</span> conversion. Why? So you have to do it only once.</span><br />
My script library called class:UserLogin is depicted below.</p>
<pre><span><span>Uselsx</span> "*<span>javacon</span>"</span>
<span>Use "<span>jclass</span>:<span>UserLogin</span>"</span>

<span>Class <span>CUserLogin</span></span>
<span>	<span>loginObj</span> As <span>JavaObject</span></span>

<span>	Sub New (<span>strUsername</span> As String, <span>strPassword</span> As String)</span>
		Dim js As New JAVASESSION
<span>		Dim <span>loginClass</span> As JAVACLASS</span>

<span>		Set <span>loginClass</span> = <span>js</span>.<span>GetClass</span> ("<span>CUserLogin</span>")</span>
<span>		Set <span>loginObj</span> = <span>loginClass</span>.<span>CreateObject</span> ()</span>

<span>		Call <span>loginObj</span>.Initialize (<span>strUsername</span>, <span>strPassword</span>)</span>
	End Sub

	Function run() As Boolean
<span>		run = <span>loginObj</span>.run()</span>
	End Function
End Class</pre>
<p><span>And that is it. Now all you have to do, is use this script library in your code. Where you need it. I created a simple agent that will pop-up a window with text depicting <span>login</span> success.</span></p>
<pre><span>Use "class:<span>UserLogin</span>"</span>

Sub Initialize
<span>	Dim <span>userLogin</span> As <span>CUserLogin</span></span>

<span>	Set <span>userLogin</span> = New <span>CUserLogin</span> ("test", "test123")</span>
	If (userLogin.run()) Then
<span>		<span>Messagebox</span> "<span>Login</span> succeeded"</span>
	Else
<span>		<span>Messagebox</span> "<span>Login</span> failed!"</span>
	End If
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/02/calling-java-classes-from-lotusscript/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Design patterns &#8211; Part 6: Observer pattern</title>
		<link>http://www.lotushints.com/2009/02/design-patterns-part-6-observer-pattern/</link>
		<comments>http://www.lotushints.com/2009/02/design-patterns-part-6-observer-pattern/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 08:00:33 +0000</pubDate>
		<dc:creator>Vladimir Kocjancic</dc:creator>
				<category><![CDATA[Basic]]></category>
		<category><![CDATA[Best practices]]></category>
		<category><![CDATA[Code optimization]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Object-oriented development]]></category>
		<category><![CDATA[custom classes]]></category>
		<category><![CDATA[LotusScript]]></category>
		<category><![CDATA[object-oriented]]></category>
		<category><![CDATA[observer]]></category>

		<guid isPermaLink="false">http://www.lotushints.com/?p=183</guid>
		<description><![CDATA[One of the most used patterns is also a pattern that hears by the name Observer. What does it do? Well, imagine you have a stock portfolio and you need to notify your investors every time the value of their stock changes. First, your investors need to subscribe to the stock they would like to [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most used patterns is also a pattern that hears by the name Observer. What does it do? Well, imagine you have a stock portfolio and you need to notify your investors every time the value of their stock changes. First, your investors need to <strong>subscribe</strong> to the stock they would like to be notified about. Next, whenever new stock value is <strong>published</strong>, subscribers are notified. Much like RSS subscription. But what about definition:</p>
<blockquote><p><strong>The Observer pattern</strong> defines a one-to-many dependency between objects so that when one object changes state, all of its dependants are notified and updated automatically.</p></blockquote>
<p><span id="more-183"></span><br />
<strong>Fine, but what can I do with that?</strong></p>
<p>We will build an above mentioned example of a stock and it&#8217;s investors. First, you will need to create an observer abstract class:</p>
<pre>Class CObserver
	m_strName As String

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

	Sub New (strName As String)
		Me.m_strName = strNAme
	End Sub

	Sub Update()
	End Sub
End Class</pre>
<p>As you can see, it contains a name, which will be used as unique id, a constructor, where the name is set and subroutine called Update that will be called when new value of our stock will be set.</p>
<p>Now, that we have an observer, we can create a subject class that will be an abstract class used by our stock.</p>
<pre>Class CObserverSubject
	m_oList List As CObserver

	Sub Attach (observer As CObserver)
	  If (Not Iselement (m_oList (observer.ObserverName))) Then
	     Set m_oList (observer.ObserverName) = observer
	  End If
	End Sub

	Sub Detach (observer As CObserver)
	  If (Iselement (m_oList (observer.ObserverName))) Then
	     Erase m_oList (observer.ObserverName)
	  End If
	End Sub

	Sub Notify ()
		Forall observer In m_oList
			Call observer.Update()
		End Forall
	End Sub
End Class</pre>
<p>The class contains list of all investors (observers) and operations to add (Attach ()) or remove (Detach ()) them. There is also routine Notify, that will update each and every investor.</p>
<p>Framework is now set. Moving on to concrete classes. First, we will create a concrete subject class called ObserverStock.</p>
<pre>Class CObserverStock As CObserverSubject
	m_strName As String
	m_dValue As Double

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

	Property Get Value As Double
		Value = Me.m_dValue
	End Property

	Property Set Value As Double
		Me.m_dValue = Value
		Call Notify()
	End Property

	Sub New (strName As String, dValue As Double)
		Me.m_strName = strName
		Me.m_dValue = dValue
	End Sub
End Class</pre>
<p>The class inherits from ObserverSubject class. Also, it has a property for obtaining stock name and properties for obtaining and setting stock value. However, when setting stock value, not only value is set, but there is also a call to Notify method, specified in ObserverSubject class. This will notify all subscribers of new value.</p>
<p>The only thing missing now is observer concrete class called ObserverInvestors.</p>
<pre>Class CObserverInvestor As CObserver
	m_Stock As CObserverStock

	Property Get Stock As CObserverStock
		Set Stock = Me.m_Stock
	End Property

	Property Set Stock As CObserverStock
		Set Me.m_Stock = Stock
	End Property

	Sub New (strName As String)
	End Sub

	Sub Update()
		Messagebox Me.m_strName &amp; ": " &amp;_
		m_Stock.StockName &amp; " value is " &amp; m_Stock.Value
	End Sub
End Class</pre>
<p>And it is simple enough. It needs a constructor with name as parameter (due to his parent class), a property that ties stock to the class and Update () function that will ideally send an e-mail to investors, but in this case just pops up a message with investor and stock info.</p>
<p><strong>Usage of previous classes</strong></p>
<p>To use previously stated classes, I wrote an agent that will create a stock, add three investors to it, and change value. Then, last observer will be removed from notification list and value will be updated again. When running this agent, you should first get three pop up messages and then only two.</p>
<pre>Sub Initialize
	Dim observer As CObserverInvestor
	Dim stock As CObserverStock

	Set stock = New CObserverStock ("MyStock", 120.0)

	Set observer = New CObserverInvestor ("Investor 1")
	Set observer.Stock = stock
	Call stock.Attach (observer)

	Set observer = New CObserverInvestor ("Investor 2")
	Set observer.Stock = stock
	Call stock.Attach (observer)

	Set observer = New CObserverInvestor ("Investor 3")
	Set observer.Stock = stock
	Call stock.Attach (observer)

	stock.Value = 100.0

	Call stock.Detach (observer)
	stock.Value = 102.5
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lotushints.com/2009/02/design-patterns-part-6-observer-pattern/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

