<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Domino Document Locking Class 1.3</title>
	<atom:link href="http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/feed/" rel="self" type="application/rss+xml" />
	<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/</link>
	<description>Things about family, life, coding, and more</description>
	<lastBuildDate>Mon, 16 Jan 2012 03:20:01 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Berkeley Roberts</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6729</link>
		<dc:creator>Berkeley Roberts</dc:creator>
		<pubDate>Mon, 24 Jan 2011 18:53:36 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6729</guid>
		<description>Chad
We have implemented this on our web application and it works great.
Clients are delighted.
Thanks for your help.</description>
		<content:encoded><![CDATA[<p>Chad<br />
We have implemented this on our web application and it works great.<br />
Clients are delighted.<br />
Thanks for your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ChadSmiley</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6706</link>
		<dc:creator>ChadSmiley</dc:creator>
		<pubDate>Mon, 27 Dec 2010 04:00:31 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6706</guid>
		<description>Sorry I don&#039;t have a working example to show, but based on how things are done using the agents you need to access the document functions instead of the UI.</description>
		<content:encoded><![CDATA[<p>Sorry I don&#8217;t have a working example to show, but based on how things are done using the agents you need to access the document functions instead of the UI.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berkeley Roberts</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6697</link>
		<dc:creator>Berkeley Roberts</dc:creator>
		<pubDate>Tue, 14 Dec 2010 20:53:48 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6697</guid>
		<description>Never mind. We got that one figured out.
Now we need to figure out how to apply it to our web application. Any suggestions or examples would be appreciated. It seems that Michael Sobczak&#039;s domain has lapsed.</description>
		<content:encoded><![CDATA[<p>Never mind. We got that one figured out.<br />
Now we need to figure out how to apply it to our web application. Any suggestions or examples would be appreciated. It seems that Michael Sobczak&#8217;s domain has lapsed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Berkeley Roberts</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6695</link>
		<dc:creator>Berkeley Roberts</dc:creator>
		<pubDate>Tue, 14 Dec 2010 19:43:29 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6695</guid>
		<description>Hello, Chad.
I am hoping that your development will help me solve a long-standing request from my clients to have some kind of lock-for-edit in our web application.
I want to try it out, but when I paste the class into a new LotusScript library I get three errors:

Option Public
Public Sub new ( inDoc As Variant )
(give an unexpected New, Expected: Identifier message)

Public Function IsUIDocumentLocked ( uiDoc As NotesUIDocument ) As Boolean
Public Function Lock ( ) As Boolean
End Function
(give Unexpected: Lock  , Expected:Identifier)

Public Function LockDocument ( doc As NotesDocument ) As Boolean
Public Function UnLock ( ) As Boolean
End Function
(give Unexpected: UnLock  , Expected:Identifier)

I am sure that I am doing something wrong here. Your help would be appreciated.
Thanks</description>
		<content:encoded><![CDATA[<p>Hello, Chad.<br />
I am hoping that your development will help me solve a long-standing request from my clients to have some kind of lock-for-edit in our web application.<br />
I want to try it out, but when I paste the class into a new LotusScript library I get three errors:</p>
<p>Option Public<br />
Public Sub new ( inDoc As Variant )<br />
(give an unexpected New, Expected: Identifier message)</p>
<p>Public Function IsUIDocumentLocked ( uiDoc As NotesUIDocument ) As Boolean<br />
Public Function Lock ( ) As Boolean<br />
End Function<br />
(give Unexpected: Lock  , Expected:Identifier)</p>
<p>Public Function LockDocument ( doc As NotesDocument ) As Boolean<br />
Public Function UnLock ( ) As Boolean<br />
End Function<br />
(give Unexpected: UnLock  , Expected:Identifier)</p>
<p>I am sure that I am doing something wrong here. Your help would be appreciated.<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asha Rao</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6568</link>
		<dc:creator>Asha Rao</dc:creator>
		<pubDate>Fri, 13 Aug 2010 07:25:41 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6568</guid>
		<description>Hi Chad . Thanks . 

This is if others face this issue of the same user opening two instances of the same document. I used environment variables and set an environment variable using the document id I have the following code in the QueryOpen
Dim session As New NotesSession
		Dim latestNumber As String
		
		latestNumber = session.GetEnvironmentString(source.Document.UniversalID)
		
		If latestNumber =&quot;&quot; Then
			
			Call session.SetEnvironmentVar( Cstr(source.Document.UniversalID), Cstr(source.Document.UniversalID) )
		Else
			Msgbox &quot;Another instance of this document is already open &quot;
			Continue = False
		End If</description>
		<content:encoded><![CDATA[<p>Hi Chad . Thanks . </p>
<p>This is if others face this issue of the same user opening two instances of the same document. I used environment variables and set an environment variable using the document id I have the following code in the QueryOpen<br />
Dim session As New NotesSession<br />
		Dim latestNumber As String</p>
<p>		latestNumber = session.GetEnvironmentString(source.Document.UniversalID)</p>
<p>		If latestNumber =&#8221;" Then</p>
<p>			Call session.SetEnvironmentVar( Cstr(source.Document.UniversalID), Cstr(source.Document.UniversalID) )<br />
		Else<br />
			Msgbox &#8220;Another instance of this document is already open &#8221;<br />
			Continue = False<br />
		End If</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ChadSmiley</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6511</link>
		<dc:creator>ChadSmiley</dc:creator>
		<pubDate>Thu, 29 Apr 2010 22:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6511</guid>
		<description>As I was review the code, this jumped out at me:

Call pDoc.RemoveItem( &quot;$WritersDate&quot; )
Call pDoc.RemoveItem( &quot;$Writers&quot; )

Why not check the time of the $WritersDate, and see if it is the current time, or relatively close, if it is then it is the current document.  I no longer have a Domino server to do any testing, but that is the first idea that came :-)</description>
		<content:encoded><![CDATA[<p>As I was review the code, this jumped out at me:</p>
<p>Call pDoc.RemoveItem( &#8220;$WritersDate&#8221; )<br />
Call pDoc.RemoveItem( &#8220;$Writers&#8221; )</p>
<p>Why not check the time of the $WritersDate, and see if it is the current time, or relatively close, if it is then it is the current document.  I no longer have a Domino server to do any testing, but that is the first idea that came <img src='http://chadsmiley.com/chadsmiley/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asha Rao</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6510</link>
		<dc:creator>Asha Rao</dc:creator>
		<pubDate>Thu, 29 Apr 2010 18:13:47 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6510</guid>
		<description>Hello Chad 

The locking feature has helped me a lot. How I used it is 

In the querymodechange event I used

Sub Querymodechange(Source As Notesuidocument, Continue As Variant)
      If source.EditMode Then 
            Dim locker As New DominoDocumentLocking( source ) 
            Call locker.LockUIDocument( source ) 
            
      End If 
End Sub

and in the Queryclose event I used 

Sub Queryclose(Source As Notesuidocument, Continue As Variant)
      If source.EditMode Then 
            Dim locker As New DominoDocumentLocking( source ) 
            
            Call locker.UnLockUIDocument( source )           
      End If 
End Sub

When one document is locked by a user and another user tries to edit the same document the code works fine. 

Here is one problem I am facing

When the same user opens two instances of the same document then it allows both the instances of the document to get into the edit mode and then when you save the documents there is a replication conflict

I have tried checking using the following code in the query open 

      Dim locker As New DominoDocumentLocking( source ) 
      Dim islocked As Boolean
      islocked =locker.IsUIDocumentLockedByCurrentUser ( Source)
            If islocked = True Then
            
            Msgbox &quot;Another copy of this document is already open&quot;
            Continue = False
            
      End If      

this works in the query open but not in the Querymodechange it returns True in both the cases and I cannot check if it is the first instance that is being sent into the edit mode

Please suggest what i need to do</description>
		<content:encoded><![CDATA[<p>Hello Chad </p>
<p>The locking feature has helped me a lot. How I used it is </p>
<p>In the querymodechange event I used</p>
<p>Sub Querymodechange(Source As Notesuidocument, Continue As Variant)<br />
      If source.EditMode Then<br />
            Dim locker As New DominoDocumentLocking( source )<br />
            Call locker.LockUIDocument( source ) </p>
<p>      End If<br />
End Sub</p>
<p>and in the Queryclose event I used </p>
<p>Sub Queryclose(Source As Notesuidocument, Continue As Variant)<br />
      If source.EditMode Then<br />
            Dim locker As New DominoDocumentLocking( source ) </p>
<p>            Call locker.UnLockUIDocument( source )<br />
      End If<br />
End Sub</p>
<p>When one document is locked by a user and another user tries to edit the same document the code works fine. </p>
<p>Here is one problem I am facing</p>
<p>When the same user opens two instances of the same document then it allows both the instances of the document to get into the edit mode and then when you save the documents there is a replication conflict</p>
<p>I have tried checking using the following code in the query open </p>
<p>      Dim locker As New DominoDocumentLocking( source )<br />
      Dim islocked As Boolean<br />
      islocked =locker.IsUIDocumentLockedByCurrentUser ( Source)<br />
            If islocked = True Then</p>
<p>            Msgbox &#8220;Another copy of this document is already open&#8221;<br />
            Continue = False</p>
<p>      End If      </p>
<p>this works in the query open but not in the Querymodechange it returns True in both the cases and I cannot check if it is the first instance that is being sent into the edit mode</p>
<p>Please suggest what i need to do</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Only managers can unlock documents locked by other users &#8211; Solved &#171; ChadSmiley Blog</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-6424</link>
		<dc:creator>Only managers can unlock documents locked by other users &#8211; Solved &#171; ChadSmiley Blog</dc:creator>
		<pubDate>Fri, 09 Apr 2010 04:51:33 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-6424</guid>
		<description>[...] true if you using standard Lotus features, I have been using Toolbar Functions and a LotusScript Document Locking Class to work with Lotus&#039; document locking.   Filed under: Domino Leave a comment     Comments (0) [...]</description>
		<content:encoded><![CDATA[<p>[...] true if you using standard Lotus features, I have been using Toolbar Functions and a LotusScript Document Locking Class to work with Lotus&#39; document locking.   Filed under: Domino Leave a comment     Comments (0) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Schelfhout</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-2605</link>
		<dc:creator>Chad Schelfhout</dc:creator>
		<pubDate>Tue, 09 Jun 2009 06:47:00 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-2605</guid>
		<description>Bojana, it all depends on what you need done.  Is this a UI or backend usage. For the most basic usage you would need to call LockUIDocument and UnLockUIDocument  if you where need to lock a UI document.</description>
		<content:encoded><![CDATA[<p>Bojana, it all depends on what you need done.  Is this a UI or backend usage. For the most basic usage you would need to call LockUIDocument and UnLockUIDocument  if you where need to lock a UI document.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bojana</title>
		<link>http://chadsmiley.com/chadsmiley/2006/09/domino-document-locking-class-1-3/comment-page-1/#comment-2601</link>
		<dc:creator>Bojana</dc:creator>
		<pubDate>Mon, 01 Jun 2009 01:19:00 +0000</pubDate>
		<guid isPermaLink="false">http://chadsmiley.com.previewdns.com/chadsmiley/?p=1432#comment-2601</guid>
		<description>Chad I need a help,  &lt;br  /&gt; &lt;br  /&gt;I paste code &#039;Domino Document Locking&#039; in script library. &lt;br  /&gt;Where and how I can call function from this class. &lt;br  /&gt;Thank&#039;s Bojana &lt;br  /&gt; &lt;br  /&gt; &lt;br  /&gt;</description>
		<content:encoded><![CDATA[<p>Chad I need a help,  </p>
<p>I paste code &#8216;Domino Document Locking&#8217; in script library. <br />Where and how I can call function from this class. <br />Thank&#8217;s Bojana </p>
<p></p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: chadsmiley.com @ 2012-02-08 14:00:22 -->
