<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
<channel>
<title>CodeStore.net comments on "Why Might Notes Consider a MIME Field To Be Rich Text?"</title>
<description>Replies to blog "Why Might Notes Consider a MIME Field To Be Rich Text?" on codestore.net.</description>
<link>http://www.codestore.net/</link>
<lastBuildDate>Thu, 05 Apr 2012 13:49:17 -0500</lastBuildDate>
<atom:link href="http://www.codestore.net/store.nsf/blog.xml?Open=20120131-0656" rel="self" type="application/rss+xml" />

<item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Thu, 05 Apr 2012 13:49:17 -0500</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>Yes, that should work.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=599EFED6966C103D862579D70067635D"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_599EFED6</link>
</item><item>
	<title>Reply from Pierre</title>
	<pubDate>Thu, 05 Apr 2012 11:54:28 -0500</pubDate>
	<author>Pierre</author>
	<description><![CDATA[ 
		<p>Do you mean the following will always work when first I call: session.setConvertMIME(false);</p>
		<p>Item item = document.getFirstItem("Body");</p>
		<p>and whatever I want with the item,</p>
		<p>then call session.setConvertMIME(true);</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=DEC0DCC98DCD8476862579D7005CE028"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_DEC0DCC9</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Wed, 01 Feb 2012 02:50:01 -0600</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>Interesting. I'd noticed a "null item" issue in some other code I'd written even though I'd used hasItem() before it, then had to add a (null!=item) clause. Put it down to just Notes being Notes. Thanks for explaining the probable cause though!</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=ABC25F390492EF3186257997003084A3"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_ABC25F39</link>
</item><item>
	<title>Reply from Richard Schwartz</title>
	<pubDate>Tue, 31 Jan 2012 13:03:09 -0600</pubDate>
	<author>Richard Schwartz</author>
	<description><![CDATA[ 
		<p>Hi Jake.  You should check (item != null) before you call getType().</p>
		<p>Even if you've got a hasItem call that you're not showing us, there is still an edge case where hasItem returns true but getFirstItem returns null.   Your final code has actually worked around this edge case, but it's worth pointing out.</p>
		<p>The problem occurs when the Body item in the document is a MIME Part but there is no actual content in it.  If you look at it, you will just see MIME headers and separators.  If this is the case, and convertMIME = true is in effect, the result is that hasItem sees the item, but getFirstItem forces the conversion to rich text and an optimization kicks in that deletes the item from the in-memory note!  </p>
		<p>Your fix does get around this problem by forcing convertMIME=false, but IMHO it's still best practice to check for null.  </p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=655A094DEE28CCE4862579960068A88C"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_655A094D</link>
</item><item>
	<title>Reply from Dragon Cotterill</title>
	<pubDate>Tue, 31 Jan 2012 09:28:54 -0600</pubDate>
	<author>Dragon Cotterill</author>
	<description><![CDATA[ 
		<p>Yes. I'm dealing with this sort of stuff day in, day out. The BES has to handle conversions all the time. More to the point, we have to handle the memory inside the 2gig limit imposed by the memory management of Domino (all hail 64 bit). So there are times when we have to do a juggling act. It's not nice. And there are times when it can all go horribly wrong.</p>
		<p>MIME vs RichText is one of my biggest headaches. Throw Notes Native Encryption into the mix and you can start to see why it gets to be a pain in the...</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=F7CDD21C480CB23486257996005508D9"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument&amp;r=F7CDD21C480CB23486257996005508D9#DOC_F7CDD21C</link>
</item><item>
	<title>Reply from Ben Langhinrichs</title>
	<pubDate>Tue, 31 Jan 2012 09:13:04 -0600</pubDate>
	<author>Ben Langhinrichs</author>
	<description><![CDATA[ 
		<p>It is easiest to understand when you know what Notes is doing under the covers. MIME is converted to rich text when the note is "opened", or loaded into memory. Sometimes the document object is instantiated without having to open the note, since the Java class is a wrapper around the actual backend, but as soon as you want to read any value or get any item, the backend has to load that note. If the ConvertMime is false, it will load the note without the conversion. If it is true, it will convert.</p>
		<p>The part that makes it less than obvious is the separate stages of a) getting the document and b) opening it. While it might seem silly, it saves enormous amounts of processing and memory in some situations.</p>
		<p>As with Dragon, welcome to my world.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=F7212EDBF55F0A0086257996005397F3"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument&amp;r=F7212EDBF55F0A0086257996005397F3#DOC_F7212EDB</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Tue, 31 Jan 2012 08:04:12 -0600</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>Ah. I think your hint might have helped my discover the cause. I was turning off ConvertMIME in the wrong place.</p>
		<p>I'll update the above post with the solution in a mo.</p>
		<p>Damn you Notes!</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=8CD6D5CA0DA8407786257996004D4A18"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_8CD6D5CA</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Tue, 31 Jan 2012 07:48:12 -0600</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>Hey, Dragon. Long time!</p>
		<p>Yeah, what's with convertmime? Do you need to toggle it off/on when reading fields as well as when setting them?</p>
		<p>Should the first code block above use it?</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=FF985B61613EBDEB86257996004BD171"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_FF985B61</link>
</item><item>
	<title>Reply from Dragon Cotterill</title>
	<pubDate>Tue, 31 Jan 2012 07:42:12 -0600</pubDate>
	<author>Dragon Cotterill</author>
	<description><![CDATA[ 
		<p>Meh. Welcome to my world.</p>
		<p>notesSession.ConvertMIME</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=EF16C9A55CD8D2D086257996004B4628"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_EF16C9A5</link>
</item><item>
	<title>Reply from Satourne</title>
	<pubDate>Tue, 31 Jan 2012 07:07:18 -0600</pubDate>
	<author>Satourne</author>
	<description><![CDATA[ 
		<p>Hi,</p>
		<p>For Lotusscript, i think it's .Type like  itemType% = notesItem.Type</p>
		<p>it's not .GetType() (JAVA)</p>
		<p>@+</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=BE33B5B94D1AB16A86257996004813B8"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20120131-0656?OpenDocument#DOC_BE33B5B9</link>
</item>

</channel>
</rss> 
