<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>www.cubetoon.com - christian's braindump about Lotus Notes/Domino development and administration &#187; Development</title>
	<atom:link href="http://www.cubetoon.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cubetoon.com</link>
	<description>christian's braindump about Lotus Notes/Domino development and administration</description>
	<lastBuildDate>Wed, 01 Sep 2010 20:25:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc/3.0/</creativeCommons:license>		<item>
		<title>Migrate in-line styles to css with XPages editor</title>
		<link>http://www.cubetoon.com/2010/migrate-in-line-styles-to-css-with-xpages-editor/</link>
		<comments>http://www.cubetoon.com/2010/migrate-in-line-styles-to-css-with-xpages-editor/#comments</comments>
		<pubDate>Fri, 13 Aug 2010 09:11:26 +0000</pubDate>
		<dc:creator>cubetoon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[XPages]]></category>

		<guid isPermaLink="false">http://www.cubetoon.com/?p=331</guid>
		<description><![CDATA[There is a nice little option/feature on the Style tab of the Properties view in the XPages editor. It allows for the export of style parameter that had previously been defined manually in the code, to be migrated into a css file and automatically applied to the selected control. I like that!]]></description>
			<content:encoded><![CDATA[<p>There is a nice little option/feature on the Style tab of the Properties view in the XPages editor. It allows for the export of style parameter that had previously been defined manually in the code, to be migrated into a css file and automatically applied to the selected control. I like that!<br />
<a href="http://www.cubetoon.com/wp-content/uploads/2010/08/StyleMigration.jpg"><img class="alignnone size-medium wp-image-332" title="Style Migration" src="http://www.cubetoon.com/wp-content/uploads/2010/08/StyleMigration-270x300.jpg" alt="Style Migration" width="270" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubetoon.com/2010/migrate-in-line-styles-to-css-with-xpages-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Truncated documents in server replica</title>
		<link>http://www.cubetoon.com/2010/truncated-documents-in-server-replica/</link>
		<comments>http://www.cubetoon.com/2010/truncated-documents-in-server-replica/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 22:48:35 +0000</pubDate>
		<dc:creator>cubetoon</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Lotus Domino]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[Replication]]></category>

		<guid isPermaLink="false">http://www.cubetoon.com/?p=295</guid>
		<description><![CDATA[This morning I was stumbling upon a very interesting issue in Lotus Notes/Domino that involved truncated documents on a server replica. This is an issue as the database on the server is the only one, besides a number of local replicas on laptops. A bit of research on the web unveiled that Almar Diel has encountered a similar [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I was stumbling upon a very interesting issue in Lotus Notes/Domino that involved truncated documents on a server replica. This is an issue as the database on the server is the only one, besides a number of local replicas on laptops.</p>
<p>A bit of research on the web unveiled that <a title="Unexpected truncated documents" href="http://www.domino-weblog.nl/weblogs/domblog.nsf/d6plinks/SHAD-7TNFXA" target="_blank">Almar Diel</a> has encountered a similar problem, which pointed me towards the right solution.</p>
<p>In order to get the full documents back onto the server replica I had to find the laptop that was holding the replica with the corrupt replication formula as this had to be cleared out as described in workaround option 2 of this IBM <a title="Advanced Replication Settings Saved Incorrectly After Signing Database" href="http://www-01.ibm.com/support/docview.wss?uid=swg21165053" target="_blank">technote</a>.</p>
<p>This will ensure that all documents replicated from now on would not be appearing as truncated documents anymore on the server. In order to fix the existing truncated documents though, I had to remove the documents from the server replica without leaving deletion stubs. This can easily be achieved in utilising Julian Robichaux&#8217; stub-less delete function documented <a title="Performing a Stubless Delete Using LotusScript" href="http://www.nsftools.com/tips/APITips.htm#stublessdelete" target="_blank">here</a>. Clearing out the replication history of the local database and issuing a new replication did make the documents re-appearing on the server replica in there entirety.</p>
<p>Thanks to Almar and Julian for documenting your solutions!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubetoon.com/2010/truncated-documents-in-server-replica/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Applying form formulas to document links</title>
		<link>http://www.cubetoon.com/2008/applying-form-formulas-to-document-links/</link>
		<comments>http://www.cubetoon.com/2008/applying-form-formulas-to-document-links/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 03:49:50 +0000</pubDate>
		<dc:creator>cubetoon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Lotusscript]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.cubetoon.com/2008/applying-form-formulas-to-document-links/</guid>
		<description><![CDATA[Since I first discovered the nature of document links I was always wondering about the purpose of each individual attribute. Why would I possibly need a view attribute when I just intended to link to a unique document within a specific database defined via the replicaid? Just wait and see what interesting thought IBM (or [...]]]></description>
			<content:encoded><![CDATA[<p>Since I first discovered the nature of document links I was always wondering about the purpose of each individual attribute. Why would I possibly need a view attribute when I just intended to link to a unique document within a specific database defined via the replicaid? Just wait and see what interesting thought IBM (or probably IRIS) has put into the definition of a document link and how they implemented it.</p>
<p>Imagine an application having different form formulas in different views. ViewA is having a form formula that opens the document with FormA, ViewB&#8217;s form formula is enforcing the document to be opened using FormB. If a document link is created and sent out to an user the document link created from within ViewA will open the document using FormA whereas the link created from within ViewB will open the document using FormB. Even when creating the document links after the document has been opened the view information is retained and contained within the document link. This is a pretty smart behaviour that totally makes sense. If UserA is sending out a link to UserB it is only reasonable that both are having the same results on the screen.</p>
<p>In order to fully understand this behaviour we need to look into the background design of a document link. As described above there are 6 attributes in the doclink element: document, anchor, view, database, server and description. In order to successfully link to any document within a database only the document element containing the universal ID of the document is required*. Each of the document links in above example did have another element defined, the universal ID of the view to be used when opening the document from a link. Having this additional information attached to the document link enforces the document to consider the form formula of the defined view when opening.</p>
<p>How does this apply to the day-to-day application design? Well, it depends. I guess it could be anything from not at all to massively! First of all it is worth mentioning that each linked document requires a view definition in order to determine whether an alternative form should be used or not. Wait, this sounds different to previous paragraph! Alright, the definition of the view can be done directly in including the universal ID of the view or indirectly by omitting this element. Omitting the view element forces the document link to evaluate the form formula (if existent) from the default view of the database. This is an important fact to note as each background function attaching a document link is checking for the existence of a default view during runtime prior to perfoming an action. This includes methods like NotesRichTextItem.AppendDocLink or the @MailSend function with [IncludeDocLink] option. Once called without a default view being defined within an application the error &#8220;Couldn&#8217;t get default View id for database&#8221; will be raised.</p>
<p>All the facts above are getting really importantÂ though when you start creating or manipulating document items using the NotesDXLImporter class. To come back to the subject of <a target="_blank" href="http://www.cubetoon.com/2008/notes-rich-text-manipulation-using-dxl/" title="Notes rich text manipulation using DXL">this post</a>, you could indirectly apply a form formula to a document link in defining a hidden view, that doesn&#8217;t need to display any documents but defines a different form than the form that has been used to create a document. You could then utlise Domino XML (DXL) to send out a document link defining this special view to be used for the form definition. Unfortunately the view events of this hidden view are not triggered when using the document link. Although the alternative form could contain a form event to count access via link or run any special processing. The sky is the limit &#8230;</p>
<p>* Note that the Domino Document Type Definition (DTD) is solely defining the document element compulsory. This is true if the linked document resides within the same database. If the link is being sent out though it requires at least the database element to be defined as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubetoon.com/2008/applying-form-formulas-to-document-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notes rich text manipulation using DXL</title>
		<link>http://www.cubetoon.com/2008/notes-rich-text-manipulation-using-dxl/</link>
		<comments>http://www.cubetoon.com/2008/notes-rich-text-manipulation-using-dxl/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 08:49:57 +0000</pubDate>
		<dc:creator>cubetoon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Lotusscript]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.cubetoon.com/2008/notes-rich-text-manipulation-using-dxl/</guid>
		<description><![CDATA[The NotesDXLExporter and NotesDXLImport Lotus script classes are very powerful when dealing with Lotus Notes rich text content that requires some tampering here and then. What is happening? The example above is showing a template that can be used to create individualised email messages for each recipient. There are a number of placeholders starting with [...]]]></description>
			<content:encoded><![CDATA[<p>The NotesDXLExporter and NotesDXLImport Lotus script classes are very powerful when dealing with Lotus Notes rich text content that requires some tampering here and then.</p>
<p><img src="http://www.cubetoon.com/wp-content/uploads/2008/08/dxlsource.JPG" alt="DXL Source Document" /></p>
<p>What is happening? The example above is showing a template that can be used to create individualised email messages for each recipient.<span id="more-148"></span><br />
There are a number of placeholders starting with ## and an upper case description that are later replaced with meaningful content similar to mail merge. So far there is nothing new. Everything could also be achieved utilising the various text manipulation methods of the NotesRichTextItem class. However, this piece of code goes a step further end even allows the manipulation of the three action hotpots at the bottom of the message at runtime.</p>
<p><img src="http://www.cubetoon.com/wp-content/uploads/2008/08/dxlscriptsource.JPG" alt="DXL Lotusscript Source" /></p>
<p>The resulting message contains the first name, a document link, the manipulated action hot spots and a customised signature. Selecting the first action hotspot opens a dialogue displaying a message and the title of the database. Also shown below is the resulting script code of the first action hotspot.</p>
<p><img src="http://www.cubetoon.com/wp-content/uploads/2008/08/dxloutput.JPG" alt="DXL Output Document" /></p>
<p><img src="http://www.cubetoon.com/wp-content/uploads/2008/08/dxlscriptoutput.JPG" alt="DXL Lotusscript Output" /></p>
<p>There are a number of subsequent actions that have to be performed to achieve above result:</p>
<ol>
<li>The rich text item containing the template information is first separated into a temporary document. This keeps the resulting DXL (Domino XML) code tiny and clean end ensures that there are no other interfering items from the source document.</li>
<li>The bare temp document, which only exists is in memory is subsequently exported using the NotesDXLExporter class. The result is stored in a string variable containing the DXL data.</li>
<li>Now a simple search/replace is used to find the ## placeholders and to convert them to the expected output. In order to insert a document link at the ##DOCLINK position an additional XML node element is inserted.</li>
<li>The manipulated DXL source solely contains the description of a notes document holding our manipulated rich text content. It is now imported back into a notes document. The import method of the NotesDXLImporter requires a destination database to be specified. As in step 1 the imported document is only temporary but also requires to be removed after the process. The cache.ndk, existing on each client appears to be a really good candidate to store these document temporary.</li>
<li>Once the manipulated rich text item is imported back it can be appended to the document that is sent out to the recipient.</li>
<li>The final step is the removal of the temporary document previously stored in the cache.ndk. With -Default- set to manager in the ACL there is no need to worry about deletion rights. Although careful consideration should be taken in cases where the temporary stored rich text content is of confidential nature.</li>
</ol>
<p>Only very few Lotus script code is required to implement the steps described above. Please note that, for the clarity of the example, no special error handling code is displayed and the source document is defined via the document unique ID.<br />
<code><br />
Sub SendManipulatedRichText<br />
' The document unique id of the document containing the source rtitem<br />
Const SOURCEDOC="9056AF7C51E7A4E7CC2574AC001B5D6A"</code></p>
<p align="left">&#8216; Declarations<br />
Dim session As New NotesSession<br />
Dim db As NotesDatabase<br />
Dim dbTemp As NotesDatabase<br />
Dim docSource As NotesDocument<br />
Dim docTemp As NotesDocument<br />
Dim newDoc As NotesDocument<br />
Dim importer As NotesDXLImporter<br />
Dim exporter As NotesDXLExporter<br />
Dim rtitem As NotesRichTextItem<br />
Dim rtitemTemp As NotesRichTextItem<br />
Dim sOutput As String<br />
Dim sActionCode1 As String</p>
<p align="left">&#8216; Get hold of the source rich text item in the current database<br />
Set db = session.CurrentDatabase<br />
Set docSource = db.GetDocumentByUNID(SOURCEDOC)<br />
If docSource Is Nothing Then Error 1120, &#8220;Unable to access source document&#8221;<br />
Set rtitem = docSource.GetFirstItem (&#8220;Body&#8221;)<br />
If rtitem Is Nothing Then Error 1130, &#8220;Source item not found&#8221;</p>
<p align="left">&#8216; STEP 1 Create temporary document to store the items for export<br />
&#8216; the document used for exporting must &#8216;live&#8217; in the same database as the re-imported document<br />
Set dbTemp = session.GetDatabase(&#8220;&#8221;,&#8221;cache.ndk&#8221;,False)<br />
If dbTemp Is Nothing Then Error 1110, &#8220;Unable to open temp database&#8221;<br />
Set docTemp = dbTemp.CreateDocument<br />
Set rtitemTemp = docTemp.CreateRichTextItem (&#8220;Body&#8221;)<br />
Call rtitemTemp.AppendRTItem (rtitem)<br />
rtitemTemp.Update &#8216; rtitem.Update required to write changes to the in memory item</p>
<p align="left">&#8216; STEP 2 Create DXL Exporter object and export temporary document including all items to a string<br />
Set exporter = session.CreateDXLExporter<br />
sOutput = exporter.Export (docTemp)</p>
<p align="left">&#8216; Clean up temporary objects used for exporting &#8211; will be reused for importing<br />
Delete rtitemTemp<br />
Delete docTemp</p>
<p align="left">&#8216; STEP 3 Do the string manipulation<br />
sActionCode1 = |dim s as new NotesSession| + Chr(10)<br />
sActionCode1 = sActionCode1 + |Messagebox &#8220;This code has been inserted into action 1&#8243;,64,s.CurrentDatabase.Title|<br />
&#8216; add additional code for remaining actions<br />
sOutput = Replace(sOutput,&#8221;##FIRSTNAME&#8221;,&#8221;Klabautermann&#8221;)<br />
sOutput = Replace(sOutput,&#8221;&#8216;##ACTION1&#8243;,sActionCode1)<br />
sOutput = Replace(sOutput,&#8221;##SMARTLINK1&#8243;,&#8221;Smart link&#8221;)<br />
sOutput = Replace(sOutput,&#8221;##DOCLINK&#8221;,|&lt;doclink document=&#8217;| + docSource.UniversalID + |&#8217; database=&#8217;| + docSource.ParentDatabase.ReplicaID + |&#8217; description=&#8217;| + docSource.Subject(0) + |&#8217; /&gt;|)<br />
sOutput = Replace(sOutput,&#8221;##SIGNATURE&#8221;,Session.CommonUserName)</p>
<p align="left">&#8216; STEP 4 Reimport string to a temporary document<br />
Set importer = session.CreateDXLImporter<br />
Call importer.Import (sOutput,dbTemp)<br />
Set docTemp = dbTemp.GetDocumentByID (importer.GetFirstImportedNoteId)<br />
Set rtitemTemp = docTemp.GetFirstItem(&#8220;Body&#8221;)</p>
<p align="left">&#8216; STEP 5 Create mail document, append imported rtitem and send to recipient<br />
Set newDoc = New NotesDocument (db)<br />
newDoc.form = &#8220;Memo&#8221;<br />
newDoc.Subject = &#8220;RT Manipulation Demo&#8221;<br />
newDoc.sendTo=&#8221;Christian Petters&#8221;<br />
Set rtitem = newdoc.CreateRichTextItem(&#8220;Body&#8221;)<br />
Call rtitem.AppendRTItem (rtitemTemp)<br />
newDoc.Send False</p>
<p align="left">&#8216; STEP 6 Remove temporary document from cache.ndk<br />
docTemp.Remove (True)<br />
End Sub</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubetoon.com/2008/notes-rich-text-manipulation-using-dxl/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Prepopulating rich text content for new documents</title>
		<link>http://www.cubetoon.com/2008/prepopulating-rich-text-content-for-new-documents/</link>
		<comments>http://www.cubetoon.com/2008/prepopulating-rich-text-content-for-new-documents/#comments</comments>
		<pubDate>Fri, 08 Aug 2008 03:35:28 +0000</pubDate>
		<dc:creator>cubetoon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Lotus Notes]]></category>
		<category><![CDATA[Lotusscript]]></category>

		<guid isPermaLink="false">http://www.cubetoon.com/2008/prepopulating-rich-text-content-for-new-documents/</guid>
		<description><![CDATA[Since I have finished my last big administration project I am now back into Development for a short wile. One requirement for anÂ application I am currently buildingÂ was the ability to prepopulate the content ofÂ a rich text field with true rich text content for new documents. &#8216;True&#8217; rich text content in this context implies that the [...]]]></description>
			<content:encoded><![CDATA[<p>Since I have finished my last big administration project I am now back into Development for a short wile.</p>
<p>One requirement for anÂ application I am currently buildingÂ was the ability to prepopulate the content ofÂ a rich text field with true rich text content for new documents. &#8216;True&#8217; rich text content in this context implies that the default value consisted of aÂ number of tables and pre-formated text.</p>
<p>As the default content of the rich text element could be changing and the user want to have the ability to alter it without the need to challenge a Domino Designer (in this case a person doing design changes inÂ Domino applications) I decided toÂ store it inÂ aÂ profile document.</p>
<p>ResponsibleÂ to move the content from the template to the new document is the Onload event of the form. The advantage of the solution provided below is, that the document itself does not have to be saved at any time. Hence the user can decide at any point in time to just close and cancel the creation of the document.</p>
<p>Please note that the name of the form (FSample) has to be set to the form field of the (in memory) document as the document itself has not been saved at this point of the time but is requested to be re-opened for editing two lines below.</p>
<p><code>Sub Onload(Source As Notesuidocument)<br />
Â Set s = New NotesSession<br />
Â Set db = s.CurrentDatabase<br />
Â Set uiws = New NotesUIWorkspace<br />
Â Set doc = source.Document<br />
Â sItemName="rtAbout"<br />
Â Set docProfile = db.GetProfileDocument ("FProfile")<br />
Â If Not doc Is Nothing And Not docProfile Is Nothing Then<br />
Â  If Not doc.HasItem(sItemName) And docProfile.HasItem (sItemName) Then<br />
Â  Set rtitem1 = docProfile.GetFirstItem (sItemName)<br />
Â  Call doc.CopyItem (rtitem1,sItemName)<br />
Â  doc.form="FSample"<br />
Â  source.Close<br />
Â  CallÂ uiws.EditDocument(True, doc, , , , True)<br />
Â  Delete source<br />
Â  End If<br />
Â End If<br />
End Sub</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cubetoon.com/2008/prepopulating-rich-text-content-for-new-documents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
