<?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"
	>

<channel>
	<title>Tomblog</title>
	<atom:link href="http://tomblog.insomniacminds.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tomblog.insomniacminds.com</link>
	<description>Rantings of an Insomniac Mind</description>
	<pubDate>Tue, 05 Aug 2008 22:18:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>SharePoint Tricks: Content By Query for Single Web</title>
		<link>http://tomblog.insomniacminds.com/2008/08/05/sharepoint-tricks-content-by-query-for-single-web/</link>
		<comments>http://tomblog.insomniacminds.com/2008/08/05/sharepoint-tricks-content-by-query-for-single-web/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 22:06:11 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[SharePoint]]></category>

		<category><![CDATA[Content by Query]]></category>

		<category><![CDATA[Recursive]]></category>

		<category><![CDATA[Single]]></category>

		<category><![CDATA[Tricks]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/?p=92</guid>
		<description><![CDATA[Quick little trick tonight for all you SharePoint configurators out there. Ever needed to use the Content by Query Webpart and query for just a single site? Yes? Well, then you probably &#8216;ve noticed there is no such option when configuring the webpart&#8230; right?
Wrong! There is a way to enable single site quering, and it&#8217;s actually [...]]]></description>
			<content:encoded><![CDATA[<p>Quick little trick tonight for all you SharePoint configurators out there. Ever needed to use the Content by Query Webpart and query for just a single site? Yes? Well, then you probably &#8216;ve noticed there is no such option when configuring the webpart&#8230; right?</p>
<div id="attachment_94" class="wp-caption alignnone" style="width: 276px"><img class="size-full wp-image-94 " title="Content by Query Source Options" src="http://tomblog.insomniacminds.com/wp-content/uploads/2008/08/st_cbqsw.png" alt="Content by Query Source Options" width="266" height="263" /><p class="wp-caption-text">Content by Query Source Options</p></div>
<p>Wrong! There is a way to enable single site quering, and it&#8217;s actually not that hard. First thing you have to do is export your webpart to a file. Open your .webpart file and add (or replace the old one with) this little property:</p>
<p><code>&lt;property name="WebsOverride" type="string"&gt;&amp;lt;Webs /;&amp;gt;&lt;/property&gt;<br />
</code><br />
This property will, as its name suggests, override the webs property of the sitedataquery. By default the content by query webpart will fill this in with SiteCollection or Recursive. But if you don&#8217;t want this, just overwrite it with this (empty) Webs value.<br />
After adjusting your file, upload it back to your page, and add an instance of your new webpart. And there you have it, single site goodness. <img src='http://tomblog.insomniacminds.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Hope it helps! Good night.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/08/05/sharepoint-tricks-content-by-query-for-single-web/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SharePoint Internals: Clearing Configuration Cache Caveat</title>
		<link>http://tomblog.insomniacminds.com/2008/07/30/sharepoint-internals-clearing-configuration-cache-caveat/</link>
		<comments>http://tomblog.insomniacminds.com/2008/07/30/sharepoint-internals-clearing-configuration-cache-caveat/#comments</comments>
		<pubDate>Wed, 30 Jul 2008 20:46:28 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[SharePoint]]></category>

		<category><![CDATA[Cache]]></category>

		<category><![CDATA[Internals]]></category>

		<category><![CDATA[Jobdefinition]]></category>

		<category><![CDATA[Registry]]></category>

		<category><![CDATA[Timerjob]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/?p=86</guid>
		<description><![CDATA[I&#8217;m pretty sure most of you have heard of the SharePoint Cache. This is a directory full of cached objects, nicely wrapped in XML. Sometimes however this cache can become corrupted. A great example of this occurs when developing SPJobDefinitions (TimerJobs for SharePoint). These definitions use this cache, so everytime you deploy new versions of [...]]]></description>
			<content:encoded><![CDATA[<div class="mceTemp">I&#8217;m pretty sure most of you have heard of the SharePoint Cache. This is a directory full of cached objects, nicely wrapped in XML. Sometimes however this cache can become corrupted. A great example of this occurs when developing SPJobDefinitions (TimerJobs for SharePoint). These definitions use this cache, so everytime you deploy new versions of the assemblies, you&#8217;ll have to clear the cache. More info about this:</div>
<ul>
<li><a href="http://support.microsoft.com/kb/939308">KB939308</a></li>
<li><a href="http://blogs.msdn.com/josrod/archive/2007/12/12/clear-the-sharepoint-configuration-cache-for-timer-job-and-psconfig-errors.aspx">Clear the SharePoint Configuration Cache for Timer Job and PSCONFIG errors </a></li>
<li><a href="http://jopx.blogspot.com/2008/01/clearing-sharepoint-configuration-cache.html">Clearing the SharePoint configuration cache</a></li>
</ul>
<p>Clearing the cache, means deleting all the XML files. But what if you delete the entire directory? Well, it gets messy.. <img src='http://tomblog.insomniacminds.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> SharePoint TimerJobs just stop working all together. And to top it off, you get these nice error messages:</p>
<blockquote><p>SPTimerStore.InitializeTimer: SPConfigurationDatabase.RefreshCache returned SPConstants.InvalidRowVersion <br />
The timer service could not initialize its configuration, please check the configuration database.  Will retry later.</p></blockquote>
<p>Great! :p</p>
<p>So what happened? The directory in question is: <strong>C:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\&lt;guid&gt;\</strong>. So the name of the directory is some kind of identifier. Looks pretty innocent, huh..  it isn&#8217;t!<br />
When this happened to me earlier on today, I wasn&#8217;t really feeling at ease. The timerjobs didn&#8217;t want to run, and no one seemed to know what this guid was. After a few hours of reverse engineering however, I found discovered this was actually the config DB ID. Nice! But where can I find it? Luckily it was not hard to find out. You&#8217;ll have to open up the registry and go to: <strong>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0\Secure\ConfigDB</strong>. </p>
<div class="mceTemp">
<div id="attachment_90" class="wp-caption alignnone" style="width: 278px"><a href="http://tomblog.insomniacminds.com/wp-content/uploads/2008/07/si_cc_1.png"><img class="size-medium wp-image-90" title="The config DB registry key" src="http://tomblog.insomniacminds.com/wp-content/uploads/2008/07/si_cc_1-300x200.png" alt="The config DB registry key." width="268" height="190" /></a><p class="wp-caption-text">The config DB registry key.</p></div>
</div>
<p>In this key, you&#8217;ll find the config DB id. Now all you have to do, is create a directory with this guid and restart the SharePoint Timer service. And you&#8217;ll see your XML files reappearing, and soon after your timerjobs restarting. Phuw, that was a close one.. <img src='http://tomblog.insomniacminds.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>&#8217;till next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/07/30/sharepoint-internals-clearing-configuration-cache-caveat/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SharePoint Branding Issues: Edit In Datasheet View</title>
		<link>http://tomblog.insomniacminds.com/2008/07/23/sharepoint-branding-issues-edit-in-datasheet-view/</link>
		<comments>http://tomblog.insomniacminds.com/2008/07/23/sharepoint-branding-issues-edit-in-datasheet-view/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 00:06:38 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[Branding]]></category>

		<category><![CDATA[SharePoint]]></category>

		<category><![CDATA[core.js]]></category>

		<category><![CDATA[Datasheet]]></category>

		<category><![CDATA[Issues]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Master Pages]]></category>

		<category><![CDATA[View]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/?p=81</guid>
		<description><![CDATA[For a couple of weeks now, I&#8217;ve got some reports about crashing datasheet views when using custom master pages. As a reminder, the datasheet view is a view you can select when browsing within a list. It&#8217;ll enable you to view and edit the list in an excell-like format. Quite handy for bulk changes.
So, what [...]]]></description>
			<content:encoded><![CDATA[<p>For a couple of weeks now, I&#8217;ve got some reports about crashing datasheet views when using custom master pages. As a reminder, the datasheet view is a view you can select when browsing within a list. It&#8217;ll enable you to view and edit the list in an excell-like format. Quite handy for bulk changes.</p>
<p>So, what is happening? I noticed the page was going into an infinite loop. When debugging I stumbled upon the GC-functions. Those functions are located in core.js and control the resizing of the datasheet view control. After carefull reviewing, I noticed the document.documentElement.scrollHeight was growing and growing. It seemed that my custom master page let the scroll height go out of it bounds.</p>
<p>To fix this, I simply bound the scroll height to the client height. To accomplish this, you look for</p>
<p><code>var lGCWindowHeight=document.documentElement.scrollHeight;<br />
</code><br />
in core.js and replace it with</p>
<p><code>var lGCWindowHeight=(document.documentElement.scrollHeight>document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.documentElement.scrollHeight;<br />
</code><br />
This seemed to solve the problem and stopped the browser from crashing.</p>
<p>But why was this happenning? My best bet is the use of a specific doctype in my masterpage. In quirks mode, IE includes top and bottom borders and padding widths when calculating the offsetheight. Standard mode only defines the content height as offsetheight. I&#8217;m guessing core.js relies on the extra margins. Now, the strange thing is, the custom master pages of MOSS (BlueBand, OrangeSingleLevel, &#8230;) do not experience this bug, altough they also use a specific doctype. I didn&#8217;t really investigate into it too much, but I suspect they restrict the height of some container surrounding the main content. This could stop the growth of offsetheight. If anyone of you, readers, can confirm this behaviour, feel free to respond in the comments.</p>
<p>In the meantime.. have fun branding!</p>
<p><strong>Update:</strong> according to reader Rufino, you can also revert this behaviour by specifying a height. Didn&#8217;t test it yet, but I&#8217;m pretty sure this &#8216;ll do the trick too. Thanks Rufino!</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/07/23/sharepoint-branding-issues-edit-in-datasheet-view/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Summer Update</title>
		<link>http://tomblog.insomniacminds.com/2008/07/23/summer-update/</link>
		<comments>http://tomblog.insomniacminds.com/2008/07/23/summer-update/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 00:00:38 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[update]]></category>

		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/?p=82</guid>
		<description><![CDATA[Hey guys,
Maybe some of you already noticed, the layout of the blog got a small summer update. I never was quite happy on how the typography turned out to be. So I decided to change and go back to the good old Verdana. Hope you guys like it.
While I was at it, I also made [...]]]></description>
			<content:encoded><![CDATA[<p>Hey guys,</p>
<p>Maybe some of you already noticed, the layout of the blog got a small summer update. I never was quite happy on how the typography turned out to be. So I decided to change and go back to the good old Verdana. Hope you guys like it.</p>
<p>While I was at it, I also made the site compatible with Firefox 2 and Safari (FF3 &amp; IE8, I still have to check). So, all you iPhone users can now enjoy a bugfree layout. <img src='http://tomblog.insomniacminds.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> Talking about the iPhone, I strongly suggest getting <a href="http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=285073074&amp;mt=8">WordPress app</a> which was released today. It lets you compose wordpress blogposts in an easy manner right from your iPhone.</p>
<div id="attachment_364" class="wp-caption alignnone" style="width: 210px"><a href="http://tomblog.insomniacminds.com/wp-content/uploads/2008/07/p-480-320-a4d45050-e44a-49b8-9a42-125fab97eb3f.jpeg"><img class="size-full wp-image-364" src="http://tomblog.insomniacminds.com/wp-content/uploads/2008/07/p-480-320-a4d45050-e44a-49b8-9a42-125fab97eb3f.jpeg" alt="Summer Update posted from the iPhone" width="200" height="300" /></a><p class="wp-caption-text">WordPress on iPhone</p></div>
<p>Later on, I&#8217;ll release a new article in the branding issues series. Bye now.</p>
<p><a href="http://tomblog.insomniacminds.com/wp-content/uploads/2008/07/p-480-320-a4d45050-e44a-49b8-9a42-125fab97eb3f.jpeg"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/07/23/summer-update/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SharePoint Tricks: Adding Google Search To Search Scopes</title>
		<link>http://tomblog.insomniacminds.com/2008/04/01/sharepoint-tricks-adding-google-search-to-search-scopes/</link>
		<comments>http://tomblog.insomniacminds.com/2008/04/01/sharepoint-tricks-adding-google-search-to-search-scopes/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 23:54:56 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[SharePoint]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[Search]]></category>

		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/?p=75</guid>
		<description><![CDATA[Tonight&#8217;s article is one based on a little trick I pulled of last year at one of my customer&#8217;s Intranet. As it turns out, there seems to be quite some people using Google Search (Live Search anyone?) 
So how do we add this search scope? The trick lies in a custom page for the search [...]]]></description>
			<content:encoded><![CDATA[<p>Tonight&#8217;s article is one based on a little trick I pulled of last year at one of my customer&#8217;s Intranet. As it turns out, there seems to be quite some people using Google Search (Live Search anyone?) <img src='http://tomblog.insomniacminds.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
So how do we add this search scope? The trick lies in a custom page for the search scope. When creating a search scope in your site collection settings, you&#8217;re allowed to enter a custom search page.</p>
<p> <img src="http://tomblog.insomniacminds.com/wp-content/uploads/2008/04/st_googlesearchscope_1.jpg" alt="SharePoint Tricks: Google Search Scope Configuration" width="517" height="84" /></p>
<p>This custom search page simply has to redirect to the google query webpage: eg.<em>http://www.google.com/search?q=<strong>ENTER+A+WORD</strong></em>. Don&#8217;t forget to replace the ENTER+A+WORD content of the q variable with the k variable you find in the query string of the custom page. This is whare all the magic lies, you see. So in the end, we&#8217;re basicly rerouting the query from SharePoint to Google. Pretty simple, but very effective!</p>
<p> <img src="http://tomblog.insomniacminds.com/wp-content/uploads/2008/04/st_googlesearchscope_2.jpg" alt="SharePoint Tricks: Google Searc Scope Use" width="447" height="54" /></p>
<p>Hope you guys liked the trick. See you next time!</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/04/01/sharepoint-tricks-adding-google-search-to-search-scopes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>April&#8217;s Fool?</title>
		<link>http://tomblog.insomniacminds.com/2008/04/01/aprils-fool/</link>
		<comments>http://tomblog.insomniacminds.com/2008/04/01/aprils-fool/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 23:26:02 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[Games]]></category>

		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[Computer]]></category>

		<category><![CDATA[Crysis]]></category>

		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/?p=74</guid>
		<description><![CDATA[No no, no april&#8217;s fool joke. I am actually updating my blog.  
I&#8217;ve been extremly busy last couple of weeks, as some of you may already know. But with the release of the new WordPress past weekend, I found myself upgrading the blog and obliged to baptize the new system with a couple of [...]]]></description>
			<content:encoded><![CDATA[<p>No no, no april&#8217;s fool joke. I am actually updating my blog. <img src='http://tomblog.insomniacminds.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>I&#8217;ve been extremly busy last couple of weeks, as some of you may already know. But with the release of the new WordPress past weekend, I found myself upgrading the blog and obliged to baptize the new system with a couple of posts. <img src='http://tomblog.insomniacminds.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> You&#8217;ll see the other one published later tonight.</p>
<p>Talking about the new <a href="http://www.wordpress.org/">WordPress</a>, I recommend everyone to check it out. The developers made some great advancements in the admin panel. So I&#8217;m quite pleased to run the new version. It&#8217;s a real breath of fresh air.<br />
Also, fitting right into my current spirit of time of change, I&#8217;ve upgraded my 5 year old Windows XP rigg to a new Vista-based quad core system. And I have to say&#8230; blazing fast! Even <a title="Crysis" href="http://www.ea.com/crysis/">Crysis</a> runs like a charm on very high settings. For those of you who have never played Crysis: check out the <a title="Play the demo!" href="http://www.crysisdemo.com/download.htm">demo</a>! It&#8217;s awesome, I&#8217;ll surely be picking up a copy pretty soon. When downloading the demo, don&#8217;t let the massive 1.8 GB download scare you of! It&#8217;s worth it. Man, where&#8217;s the time when games fit on a small floppy disk&#8230; good stuff! My last 2 systems didn&#8217;t even have such a drive anymore.</p>
<p>Anyway&#8230; Have a nice read!</p>
<p>PS: I have started to fix some of the layout bugs on IE7. IE 8 still gives problems though.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/04/01/aprils-fool/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SharePoint Internals: Resources</title>
		<link>http://tomblog.insomniacminds.com/2008/02/25/sharepoint-internals-resources/</link>
		<comments>http://tomblog.insomniacminds.com/2008/02/25/sharepoint-internals-resources/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 01:34:33 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[SharePoint]]></category>

		<category><![CDATA[Resources]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/2008/02/25/sharepoint-internals-resources/</guid>
		<description><![CDATA[In a country where English is not the native tongue, localisation can be pretty important. Localisation within SharePoint is achieved by using resources and resource files. Although the use of resources is not mandatory, it&#8217;s usually good practise to use them anyway. You don&#8217;t want to hard code strings in your application, and, moreover, you [...]]]></description>
			<content:encoded><![CDATA[<p>In a country where English is not the native tongue, localisation can be pretty important. Localisation within SharePoint is achieved by using resources and resource files. Although the use of resources is not mandatory, it&#8217;s usually good practise to use them anyway. You don&#8217;t want to hard code strings in your application, and, moreover, you never know when your application should be localized. Setting up and using these resources in SharePoint can be quite confusing. So here is a little article covering this topic.</p>
<p><strong>Resources</strong></p>
<p>Resources - in this case: strings - are contained within XML based .resx files. Every resource in such a file is identified by a fixed name. (quite like a HashTable) Here is a little example.</p>
<p><code>&lt;root&gt;<br />
&lt;data name="FieldManagerPageDescription"&gt;<br />
&lt;value&gt;Manage the field of this application.&lt;/value&gt;<br />
&lt;/data&gt;<br />
&lt;/root&gt;<br />
</code><br />
For every new localization, you need a new .resx file with the same names as keys. You can just copy the original .resx file to achieve this quickly. In this new resource file you translate the original values within the value tag. The new resource file has to be named as follows: &lt;original_name&gt;.&lt;culture&gt;.resx.<br />
eg. - myresource.resx<br />
- myresource.en-US.resx<br />
- myresource.fr-FR.resx</p>
<p><strong>SharePoint &amp; Resources</strong></p>
<p>First thing you need to know, SharePoint defines two kinds of Resource files: Application resources and Provisioning resources. <strong>Application resources</strong> are resources used within the normal execution of the SharePoint application. Normal SharePoint execution include: Application Pages, Web Parts and Controls. SharePoint also makes a difference between application resources used in normal web applications and application resources used in the central administration. Don&#8217;t forget that. <strong>Provisioning resources</strong>, on the other hand, are used when provisioning elements, so you have to use them within features, site definitions and list definitions. Ok, now let&#8217;s see the practical side of it: deployment and usage.</p>
<p><strong>1. Deployment</strong></p>
<p>Resource files in SharePoint are located in different folders. Here is a list:</p>
<ul>
<li>C:\Inetpub\wwwroot\wss\VirtualDirectories\&lt;port&gt;\App_GlobalResources\</li>
<li>&lt;hive&gt;\12\Resources\</li>
<li>&lt;hive&gt;\12\CONFIG\Resources\</li>
<li>&lt;hive&gt;\12\CONFIG\AdminResources\</li>
<li>&lt;hive&gt;\12\TEMPLATE\FEATURES\&lt;feature&gt;\Resources\</li>
</ul>
<p>So, how do you know where to put your resource files? Well, every type of resource has its own folders.</p>
<p><em>Provisioning resources</em></p>
<ul>
<li>&lt;hive&gt;\12\TEMPLATE\FEATURES\&lt;feature&gt;\Resources\Resources.&lt;culture&gt;.resx</li>
<li>&lt;hive&gt;\12\TEMPLATE\FEATURES\&lt;feature&gt;\Resources\</li>
<li>&lt;hive&gt;\12\Resources\</li>
</ul>
<p>Every feature uses the resources file located in its Resources folder. You can however use another resource file or even share resources. To share resource files you have to put them in the 12\Resources\ folder. Site definitions and list definitions also get their resources from this folder.</p>
<p><em>Application resources</em></p>
<ul>
<li>&lt;hive&gt;\12\CONFIG\Resources\</li>
<li>C:\Inetpub\wwwroot\wss\VirtualDirectories\&lt;port&gt;\App_GlobalResources\</li>
</ul>
<p>Application resources are located in CONFIG\Resources folder. For a web application to use those resources, they have to be copied to their App_GlobalResources folder. (each web application has its own Global Resources folder) How is this done? At creation of the web application, the resources are initially copied to the App_GlobalResources folder. When adding new resources to the CONFIG\Resources folder, the resources have to be copied to existing web applications. You can do this manually or use the STSADM command: copyappbincontent.</p>
<p><em>Application resources: admin</em></p>
<ul>
<li>&lt;hive&gt;\12\CONFIG\AdminResources\</li>
<li>C:\Inetpub\wwwroot\wss\VirtualDirectories\&lt;port&gt;\App_GlobalResources\</li>
</ul>
<p>Application resources for the central administration work the same way as normal application resources, except that the base folder is CONFIG\AdminResources.</p>
<p><strong>2. Usage</strong></p>
<p>This last part will focus on how to use resources within SharePoint elements. Luckily it doesn&#8217;t really matter which kind of resource you are using. Here are the different ways:</p>
<p>In C#:<br />
<code>HttpContext.GetGlobalResourceObject("MyResource", "MyName").ToString();</code></p>
<p>In ASPX properties:<br />
<code>&lt;%$Resources:MyResource, MyName%&gt;</code></p>
<p>In ASPX as text:<br />
<code>&lt;asp:literal runat="server" Text="&lt;%$Resources:MyResource, MyName%&gt;" /&gt;</code></p>
<p>In XML:<br />
<code>$Resources:MyResource, MyName</code></p>
<p>In XML features, using the default resource file:<br />
<code>$Resources:MyName</code></p>
<p><strong>3. Conclusion</strong></p>
<p>There you go. Everything you will ever want to know about resources in SharePoint.</p>
<p>Part of this article is derived from the excellent article of <a href="http://www.mikhaildikov.com/2007/03/sharepoint-resources-types-use-and_2163.html ">Mikhail Dikov</a>. You can consider this article as some sort of extension of his article. Be sure to read it. Also, I&#8217;d like to thank Tom Verhelst for the heads up on the copyappbincontent. Thanks man!</p>
<p>Have a great week!</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/02/25/sharepoint-internals-resources/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Workflow Insights: Dependency</title>
		<link>http://tomblog.insomniacminds.com/2008/02/04/workflow-insights-dependency/</link>
		<comments>http://tomblog.insomniacminds.com/2008/02/04/workflow-insights-dependency/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 00:40:39 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[Workflow Foundation]]></category>

		<category><![CDATA[Activity]]></category>

		<category><![CDATA[Dependency]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/2008/02/04/workflow-insights-dependency/</guid>
		<description><![CDATA[Dependency is one of those magic paradigms in Workflow Foundation which gives the use of the framework so much more richness, especially when using activities to break up functionality.
Dependency lets properties depend on other properties, and this in a dynamic way. In practise, if property object1.Property1 is dependent of object2.Property2 when you assign or get [...]]]></description>
			<content:encoded><![CDATA[<p>Dependency is one of those magic paradigms in Workflow Foundation which gives the use of the framework so much more richness, especially when using activities to break up functionality.<br />
Dependency lets properties depend on other properties, and this in a dynamic way. In practise, <strong>if property object1.Property1 is dependent of object2.Property2 when you assign or get the Property1 of object1, you are actually modifying and retrieving Property2 of object2</strong>. The great advantage of this method and way of thinking is the avoidance of duplication of data. Also you enable activities to connect to each other.</p>
<p>So how does it work? There are actually two steps. The first one is the setup of the activity and its properties. The second one is the actual binding between two properties.</p>
<p><strong>STEP 1 : Setup of the activity</strong><br />
Dependency at its core consists of two main classes: DependencyObject and DependencyProperty. The DependencyObject is the object that needs the data. It will do this by exposing properties which use DependencyProperty objects. One thing to remember is that when using dependency, the source object (the object which has the actual data) will never know that another object of objects is depending on it.<br />
As dependency is one of the core paradigms of Workflow Foundation, it won&#8217;t come you as a shock to know that the base Activity class inherits from the DependencyObject class. The DependencyObject class exposes a number of methods to work with DependencyProperty&#8217;s. DependencyProperty&#8217;s are static values defined in the DependencyObject implementations. Those implementations (eg. Activities or Object1) are using these static values in Properties like this:</p>
<p><code>public class Object1<br />
{<br />
  public static DependencyProperty Property1Property =<br />
            DependencyProperty.Register("Property1", typeof(string), typeof(Object1));</p>
<p>  public string Property1<br />
  {<br />
      get { return (string)base.GetValue(Property1Property); }<br />
      set { base.SetValue(Property1Property, value); }<br />
  }<br />
}<br />
</code><br />
It is doing this as Properties should enhold actual data or link to other properties. This is why Workflow Foundation needed this alternative method with static values and internal methods. DependencyProperty&#8217;s define when a binding is chosen or when actual data is set. Actual data will be saved in an internal dictionary.</p>
<p><strong>STEP 2 : Binding of properties</strong><br />
So how can we use these properties? There are two methods and both of them can be achieved in the visual designer as well as in code. (As you all know the visual designer is just creating code in the code behind designer class)<br />
The first method is to use actual data. You can do this by assigning data to the property and retrieving them from the property, just like any other property. Nothing really special, actually.<br />
The second and most interesting method is working with bindings. A new class is used to define them: the ActivityBind.</p>
<p><code>ActivityBind activityBind = new ActivityBind();<br />
activityBind.Name = "object2";<br />
activityBind.Path = "Property2";<br />
this.object1.SetBinding(Object1.Property1, activitybind1);<br />
</code><br />
As you see, the ActivityBind object creates a link to the object2&#8217;s Property2 property. As we are using this reference, the object2 does not actually know it is relied on by another object. Pretty simple.</p>
<p>In the end, it&#8217;s actually enough to remember just this one thing: <strong>if property object1.Property1 is dependent of object2.Property2 when you assign or get the Property1 of object1, you are actually modifying and retrieving Property2 of object2</strong>. Just keep to it, and you&#8217;ll be just fine. To end, here&#8217;s a quick overview. See ya.</p>
<p><code>object1..................object2<br />
= DependencyObject.......= Plain object<br />
= Target.................= Source<br />
- Property1..............- Property2<br />
...- get...=============>...- get<br />
...- set...=============>...- set<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/02/04/workflow-insights-dependency/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SharePoint Internals: SPList.GetItems</title>
		<link>http://tomblog.insomniacminds.com/2008/01/28/sharepoint-internals-splistgetitems/</link>
		<comments>http://tomblog.insomniacminds.com/2008/01/28/sharepoint-internals-splistgetitems/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 23:48:03 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[SharePoint]]></category>

		<category><![CDATA[List]]></category>

		<category><![CDATA[Object Model]]></category>

		<category><![CDATA[View]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/2008/01/28/sharepoint-internals-splistgetitems/</guid>
		<description><![CDATA[SharePoint is build upon lists. These lists contain items. So the action to retrieve items from these lists is quite common. But when you&#8217;re coding against the object model. You might run into surprises. In the previous post I already talked about internal names and display names of fields. Today I&#8217;ll talk about an issue [...]]]></description>
			<content:encoded><![CDATA[<p>SharePoint is build upon lists. These lists contain items. So the action to retrieve items from these lists is quite common. But when you&#8217;re coding against the object model. You might run into surprises. In the previous post I already talked about internal names and display names of fields. Today I&#8217;ll talk about an issue when retrieving items from a list, and more specifially from a view.</p>
<p>When SharePoint is retrieving items from a list or view, SPList.GetItems is always called. This method will actually create a new collection of items. Those items will actually be retrieved by a query. To query in SharePoint we use a SPQuery object. This object is a container for SQL like queries. You select the fields you want to see, you have some conditions, a rowlimit, &#8230; And this is were a possible problem can reside. When retrieving items from a view, the query will only retrieve the fields defined in the SPView. In other words: the SPListItems you will get do not include all the data. This can be very confusing, as you expect a one-to-one relationship between the data of an object and the SPListItem. You should not forget however that the SPListItem is actually a proxy container for XML data. The object encapsulates the data for easy access and is not the actual full (logic) list item.</p>
<p>So how can we solve this? Well pretty easily actually. We create a real SPQuery object to retrieve our items with:</p>
<p><code>SPView view = myList.DefaultView;</p>
<p>   SPQuery query = new SPQuery();<br />
   query.Query = view.Query;</p>
<p>   SPListItemCollection myColl = myList.GetItems(query);<br />
</code><br />
Pretty easy, huh. The thing to remember here: SPListItem objects encapsulate XML data and are not the actual list items! Have a great week, everyone!</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/01/28/sharepoint-internals-splistgetitems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SharePoint Internals: InternalName versus DisplayName</title>
		<link>http://tomblog.insomniacminds.com/2008/01/25/sharepoint-internals-internalname-versus-displayname/</link>
		<comments>http://tomblog.insomniacminds.com/2008/01/25/sharepoint-internals-internalname-versus-displayname/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 18:33:00 +0000</pubDate>
		<dc:creator>Tombo</dc:creator>
		
		<category><![CDATA[SharePoint]]></category>

		<category><![CDATA[Object Model]]></category>

		<guid isPermaLink="false">http://tomblog.insomniacminds.com/2008/01/25/sharepoint-internals-internalname-versus-displayname/</guid>
		<description><![CDATA[When creating columns (more commonly called fields) in SharePoint through the interface, you have to enter a name for it. This name is used throughout the lists and sites, included internally. Except when you try to change the name, it&#8217;ll only reflect on the outside. Internally the old name will be kept. This is because [...]]]></description>
			<content:encoded><![CDATA[<p>When creating columns (more commonly called fields) in SharePoint through the interface, you have to enter a name for it. This name is used throughout the lists and sites, included internally. Except when you try to change the name, it&#8217;ll only reflect on the outside. Internally the old name will be kept. This is because a field has two names: an internal name and a display name. When creating a field, you set both. When renaming it, you only change the display name. (There is actually no way to change the internal name afterwards)<br />
<br />
But why is this a concern? Well, in the object model it can become quite vague when to use the internal name and when to use the display name. Here is a short list with some common methods and the name they need.</p>
<ul>
<li><strong>SPFieldCollection[name] </strong>: SPField<br />
  <em>name</em>: DisplayName<br />
  <em>unexistent</em>: exception</li>
<li><strong>SPFieldCollection.GetField(name)</strong> : SPField<br />
  name: internalName, displayName or internalName and displayName from the current context<br />
  unexistent: exception</li>
<li><strong>SPFieldCollection.GetFieldByInternalName(name)</strong> : SPField<br />
  <em>name</em>: internalName<br />
  <em>unexistent</em>: exception</li>
<li><strong>SPFieldCollection.ContainsField(name)</strong> : bool<br />
  name<em>: displayName or internalName<br />
  </em><em>unexistent</em>: boolean</li>
<li><strong>SPListItem[name]</strong> : object<br />
  <em>name</em>: internalName, displayName or internalName and displayName from the current context<br />
  <em>unexistent</em>: null</li>
<li><strong>SPListItem.GetFormattedValue(name)</strong> : string<br />
  <em>name</em>: internalName, displayName or internalName and displayName from the current context<br />
  <em>unexistent</em>: exception</li>
</ul>
<p>If I find more relevant functions, I will update this list. On a related note, there also exists a static name. This is a name used by the field type. This is different from the internal name, as the internal name must be unique in its list and could have changed.</p>
<p>Hope this clears up some confusion about field naming in SharePoint. See ya.</p>
]]></content:encoded>
			<wfw:commentRss>http://tomblog.insomniacminds.com/2008/01/25/sharepoint-internals-internalname-versus-displayname/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
