<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://www.sharepointblues.com/wp-atom.php">
	<title type="text">SharePoint Blues</title>
	<subtitle type="text" />

	<updated>2013-04-10T10:51:18Z</updated>

	<link rel="alternate" type="text/html" href="http://www.sharepointblues.com" />
	<id>http://www.sharepointblues.com/feed/atom/</id>
	

	<generator uri="http://wordpress.org/" version="3.1.3">WordPress</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/SharepointBlues" /><feedburner:info uri="sharepointblues" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry>
		<author>
			<name>Marko Rosberg</name>
					</author>
		<title type="html"><![CDATA[Stopped-extension-dll-exceptions in User Profile Sync]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/SK3fCB74S0M/" />
		<id>http://www.sharepointblues.com/?p=2490</id>
		<updated>2013-02-04T13:37:42Z</updated>
		<published>2013-02-04T13:34:09Z</published>
		<category scheme="http://www.sharepointblues.com" term="Configuration and Administration" /><category scheme="http://www.sharepointblues.com" term="Tips" />		<summary type="html"><![CDATA[<p>Symptons: You get stopped-extension-dll-exceptions in MIIS client while running full or incremental user profile sync.<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2013/02/miislog.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2013/02/miislog.png" alt="MIIS Client" title="MIIS Client" width="685" height="44" class="aligncenter size-full wp-image-2500" /></a></p>
<p>At the same time you will get following exceptions in Application log:<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2013/02/applicationlog.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2013/02/applicationlog.png" alt="Application Log" title="Application Log" width="812" height="196" class="aligncenter size-full wp-image-2498" /></a></p>
<p>Fix: This problem arises from user profiles that have URL in PictureURL field, but the picture is not accessible. You can fix this issue by running the...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2013/02/04/stopped-extension-dll-exceptions-in-user-profile-sync/"><![CDATA[<p>Symptons: You get stopped-extension-dll-exceptions in MIIS client while running full or incremental user profile sync.<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2013/02/miislog.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2013/02/miislog.png" alt="MIIS Client" title="MIIS Client" width="685" height="44" class="aligncenter size-full wp-image-2500" /></a></p>
<p>At the same time you will get following exceptions in Application log:<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2013/02/applicationlog.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2013/02/applicationlog.png" alt="Application Log" title="Application Log" width="812" height="196" class="aligncenter size-full wp-image-2498" /></a></p>
<p>Fix: This problem arises from user profiles that have URL in PictureURL field, but the picture is not accessible. You can fix this issue by running the following PS script. The script loops through every user profile and makes a HTTP request to the picture URL. If the URL cannot be accessed the script clears PictureURL field.</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;"># Get user profile service</span><br />
<span style="color: #800080;">$UserProfileService</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>SPServiceApplication <span style="color: pink;">|</span> <span style="color: pink;">?</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.TypeName <span style="color: #FF0000;">-eq</span> <span style="color: #800000;">&quot;User Profile Service Application&quot;</span> <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span><br />
<br />
<span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$UserProfileService</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$serviceContext</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.SPServiceContext<span style="color: #000000;">&#93;</span>::GetContext<span style="color: #000000;">&#40;</span><span style="color: #800080;">$UserProfileService</span>.ServiceApplicationProxyGroup<span style="color: pink;">,</span> <span style="color: #000000;">&#91;</span>Microsoft.SharePoint.SPSiteSubscriptionIdentifier<span style="color: #000000;">&#93;</span>::Default<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; <span style="color: #800080;">$profileManager</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> Microsoft.Office.Server.UserProfiles.UserProfileManager<span style="color: #000000;">&#40;</span><span style="color: #800080;">$serviceContext</span><span style="color: #000000;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #008000;"># Get all profiles</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$allProfiles</span> <span style="color: pink;">=</span> <span style="color: #800080;">$profileManager</span>.GetEnumerator<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>; <br />
<br />
&nbsp; &nbsp; <span style="color: #800080;">$counter</span> <span style="color: pink;">=</span> <span style="color: #804000;">0</span>;<br />
&nbsp; &nbsp; <span style="color: #800080;">$decCounter</span> <span style="color: pink;">=</span> <span style="color: #804000;">0</span>;<br />
<br />
&nbsp; &nbsp; <span style="color: #008000;"># Loop through every profile</span><br />
&nbsp; &nbsp; <span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$profile</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$allProfiles</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$counter</span><span style="color: pink;">++</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$decCounter</span><span style="color: pink;">++</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$url</span> <span style="color: pink;">=</span> <span style="color: #800080;">$Profile</span><span style="color: #000000;">&#91;</span><span style="color: #800000;">'PictureURL'</span><span style="color: #000000;">&#93;</span> <span style="color: #FF0000;">-as</span> <span style="color: #000000;">&#91;</span><span style="color: #008080;">string</span><span style="color: #000000;">&#93;</span>;<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$url</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># Create HTTP Request</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$req</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>system.Net.WebRequest<span style="color: #000000;">&#93;</span>::Create<span style="color: #000000;">&#40;</span><span style="color: #800080;">$url</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$req</span>.UseDefaultCredentials <span style="color: pink;">=</span> <span style="color: #800080;">$true</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; try <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$res</span> <span style="color: pink;">=</span> <span style="color: #800080;">$req</span>.GetResponse<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; catch <span style="color: #000000;">&#91;</span>System.Net.WebException<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$res</span> <span style="color: pink;">=</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.Exception.Response<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$int</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span><span style="color: #008080;">int</span><span style="color: #000000;">&#93;</span><span style="color: #800080;">$res</span>.StatusCode<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$status</span> <span style="color: pink;">=</span> <span style="color: #800080;">$res</span>.StatusCode<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;"># If the image cannot be accessed clear the field</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$int</span> <span style="color: #FF0000;">-gt</span> <span style="color: #804000;">400</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-NoNewLine</span> <span style="color: #800080;">$Profile</span><span style="color: #000000;">&#91;</span><span style="color: #800000;">'PreferredName'</span><span style="color: #000000;">&#93;</span> <span style="color: #800000;">&quot;profile picture broken &quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$Profile</span><span style="color: #000000;">&#91;</span><span style="color: #800000;">'PictureURL'</span><span style="color: #000000;">&#93;</span>.Value <span style="color: pink;">=</span> <span style="color: #800080;">$null</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$Profile</span>.Commit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #008080; font-style: italic;">-ForegroundColor</span> Green <span style="color: #800000;">&quot;[FIXED]&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000FF;">if</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$deccounter</span> <span style="color: #FF0000;">-eq</span> <span style="color: #804000;">10</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Write-Host</span> $counter<span style="color: #800000;">&quot; user profile checked&quot;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #800080;">$decCounter</span><span style="color: pink;">=</span><span style="color: #804000;">0</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>After running this script the User Profile Sync started to work immediately.</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2490&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2013/02/04/stopped-extension-dll-exceptions-in-user-profile-sync/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2013/02/04/stopped-extension-dll-exceptions-in-user-profile-sync/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2013/02/04/stopped-extension-dll-exceptions-in-user-profile-sync/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Juha Alhojoki</name>
					</author>
		<title type="html"><![CDATA[Alternative for PublishingWeb.IsPublishingWeb]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/H84j1yxTM30/" />
		<id>http://www.sharepointblues.com/?p=2472</id>
		<updated>2013-01-14T13:37:07Z</updated>
		<published>2012-12-19T14:26:45Z</published>
		<category scheme="http://www.sharepointblues.com" term="Development and Customization" /><category scheme="http://www.sharepointblues.com" term="Tips" /><category scheme="http://www.sharepointblues.com" term="0x80070002" /><category scheme="http://www.sharepointblues.com" term="PublishingWeb.IsPublishingWeb" />		<summary type="html"><![CDATA[<p>
Just today I wondered why something was not working with a specific custom code and was able to track the problem down by debugging to using <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.ispublishingweb.aspx" target="_blank">PublishingWeb.IsPublishingWeb</a> -method to a web in another site collection with read-permissions. The error message was somewhat puzzling, something like:
</p>
<p>
<b><i>0&#215;80070002</i></b>
</p>
<p>
<b><i>at Microsoft.SharePoint.Library.SPRequestInternalClass.GetWebUrl(Guid gWebId, String bstrSiteUrl)&#8230;..</i></b>
</p>
<p>...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2012/12/19/alternative-for-publishingweb-ispublishingweb/"><![CDATA[<p>
Just today I wondered why something was not working with a specific custom code and was able to track the problem down by debugging to using <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.ispublishingweb.aspx" target="_blank">PublishingWeb.IsPublishingWeb</a> -method to a web in another site collection with read-permissions. The error message was somewhat puzzling, something like:
</p>
<p>
<b><i>0&#215;80070002</i></b>
</p>
<p>
<b><i>at Microsoft.SharePoint.Library.SPRequestInternalClass.GetWebUrl(Guid gWebId, String bstrSiteUrl)&#8230;..</i></b>
</p>
<p>
Then I remembered that my colleaque <a href="http://www.sharepointblues.com/author/tomi-tavela/" target="_blank">Tomi Tavela</a> had resolved figuring out whether the SPWeb object is a publishing web or not in an anonymous scenario in this post <a href="http://www.sharepointblues.com/2011/12/22/anonymous_access_and_publishing_web_pages_list/" target="_blank">Anonymous Access and Publishing Web Pages List</a>.
</p>
<p>So what I did following Tomi&#8217;s approach was to implement an alternative for the awkwardly behaving PublishingWeb.IsPublishingWeb -method by creating a method which checks if the site (SPWeb) has got a Pages-library.</p>
<div class="codecolorer-container csharp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsPublishingWeb<span style="color: #008000;">&#40;</span>SPWeb web<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>web <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">||</span> <span style="color: #008000;">!</span>web<span style="color: #008000;">.</span><span style="color: #0000FF;">Exists</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">return</span> web<span style="color: #008000;">.</span><span style="color: #0000FF;">Lists</span><span style="color: #008000;">.</span><span style="color: #0000FF;">TryGetList</span><span style="color: #008000;">&#40;</span>SPUtility<span style="color: #008000;">.</span><span style="color: #0000FF;">GetLocalizedString</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;$Resources:List_Pages_UrlName&quot;</span>, <span style="color: #666666;">&quot;cmscore&quot;</span>, web<span style="color: #008000;">.</span><span style="color: #0000FF;">Language</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2472&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2012/12/19/alternative-for-publishingweb-ispublishingweb/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2012/12/19/alternative-for-publishingweb-ispublishingweb/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2012/12/19/alternative-for-publishingweb-ispublishingweb/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Tuukka Uskali</name>
					</author>
		<title type="html"><![CDATA[Fix Broken Category Class Title in SharePoint 2010 Blog site]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/ZTtV6oFsxZU/" />
		<id>http://www.sharepointblues.com/?p=2453</id>
		<updated>2012-12-13T06:10:30Z</updated>
		<published>2012-12-12T19:31:25Z</published>
		<category scheme="http://www.sharepointblues.com" term="Uncategorized" />		<summary type="html"><![CDATA[<p>There is an old bug in SharePoint 2010 that surfaces to me from time to time: <b>blog site category title doesn&#8217;t render correctly if it contains some funny foreign characters we Finnish like to use in our language. </b></p>
<p>The reason I&#8217;m writing this down right now is that I&#8217;ve got a case tomorrow at work where I have to...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2012/12/12/fix-broken-category-clas-title-in-sharepoint-2010-blog-site/"><![CDATA[<p>There is an old bug in SharePoint 2010 that surfaces to me from time to time: <b>blog site category title doesn&#8217;t render correctly if it contains some funny foreign characters we Finnish like to use in our language. </b></p>
<div id="attachment_2458" class="wp-caption alignnone" style="width: 563px"><a href="http://www.sharepointblues.com/wp-content/uploads/2012/12/categorytitle-ootb.png"><img class="size-full wp-image-2458" title="categorytitle-ootb" src="http://www.sharepointblues.com/wp-content/uploads/2012/12/categorytitle-ootb.png" alt="" width="553" height="182" /></a><p class="wp-caption-text">The power of umlauts is too much for this blog</p></div>
<p>The reason I&#8217;m writing this down right now is that I&#8217;ve got a case tomorrow at work where I have to fix this. This happens on a regular basis and I always write the fix from the scratch. Only this time, I don&#8217;t have to do it. I&#8217;ve got the CTRL-C / CTRL-V solution right here.</p>
<p>Buğra Postacı has blogged <a href="http://blog.bugrapostaci.com/2012/01/27/sharepoint-2010-charecter-problem-in-category-titles-in-blog-site-for-different-languages/" target="_blank">a solution that involves SharePoint Designer and manual labour</a> earlier this year. As I&#8217;m not a fan of either I decided to use some nasty client script to hack the problem.</p>
<p><strong>But let&#8217;s start with CSS!</strong></p>
<p>Those question marks look weird in the category title, let&#8217;s get rid of the title by applying a CSS display: none.  As we&#8217;re going to use JavaScript for our fix, it will take a few milliseconds to complete. I&#8217;m doing this CSS hiding to prevent flicker until the JS kicks in. Pure optional, that is.</p>
<div>
<dl id="attachment_2454"></dl>
</div>
<div class="codecolorer-container css blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">h3<span style="color: #6666ff;">.ms-CategoryTitleMonth</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span></div></div>
<div id="attachment_2460" class="wp-caption alignnone" style="width: 598px"><a href="http://www.sharepointblues.com/wp-content/uploads/2012/12/categorytitle-hide.png"><img class="size-full wp-image-2460" title="categorytitle-hide" src="http://www.sharepointblues.com/wp-content/uploads/2012/12/categorytitle-hide.png" alt="" width="588" height="182" /></a><p class="wp-caption-text">Let&#39;s hide the title with a bad word, there might be children watching</p></div>
<p><strong>The Javascript</strong></p>
<p>I&#8217;m going to be using my favourite DOM manipulation library, jQuery combined with some vanilla JS but you can use whatever works for you. I&#8217;m just using the jQuery to find the element, so it is a bit of an overkill here but this is just an example.</p>
<p>First we need a helper function <strong>getUrlVars() </strong>to parse the URL and get to the hash. We will be using that to get the category name.</p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> getUrlVars<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> vars <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> hash<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> hashes <span style="color: #339933;">=</span> window.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">location</span>.<span style="color: #660066;">href</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'?'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&amp;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> hashes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; hash <span style="color: #339933;">=</span> hashes<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'='</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vars.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>hash<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; vars<span style="color: #009900;">&#91;</span>hash<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> hash<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> vars<span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>When the page is ready, we set the textual content of the category title to the decoded hash value and show the element (it was initially hidden with CSS).<em> I&#8217;m using PageLoad() here because the page I&#8217;m using has a postback but once again you can use whatever works for you.</em></p>
<div class="codecolorer-container javascript blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #003366; font-weight: bold;">function</span> pageLoad<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $j<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'h3.ms-CategoryTitleMonth'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span>unescape<span style="color: #009900;">&#40;</span>getUrlVars<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'Name'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">show</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>Which translates to:</p>
<div id="attachment_2461" class="wp-caption alignnone" style="width: 539px"><a href="http://www.sharepointblues.com/wp-content/uploads/2012/12/categorytitle-fix.png"><img class="size-full wp-image-2461" title="categorytitle-fix" src="http://www.sharepointblues.com/wp-content/uploads/2012/12/categorytitle-fix.png" alt="" width="529" height="179" /></a><p class="wp-caption-text">The Iceman cometh!</p></div>
<p>That&#8217;s all there really is to it. Have fun.</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2453&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2012/12/12/fix-broken-category-clas-title-in-sharepoint-2010-blog-site/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2012/12/12/fix-broken-category-clas-title-in-sharepoint-2010-blog-site/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2012/12/12/fix-broken-category-clas-title-in-sharepoint-2010-blog-site/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marko Rosberg</name>
					</author>
		<title type="html"><![CDATA[Configuring SharePoint 2013 Host Named Site Collections and Apps Host]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/yQU09StVvVo/" />
		<id>http://www.sharepointblues.com/?p=2425</id>
		<updated>2012-11-27T13:29:25Z</updated>
		<published>2012-11-22T11:51:49Z</published>
		<category scheme="http://www.sharepointblues.com" term="Configuration and Administration" /><category scheme="http://www.sharepointblues.com" term="SharePoint 2013" /><category scheme="http://www.sharepointblues.com" term="Tips" />		<summary type="html"><![CDATA[<p>There are a few good articles about configuring Sharepoint 2013 apps host, but atleast I found it somehow difficult to figure out how for example Intranet web application and application host could be configured. For beginning you should read this article <a href="http://technet.microsoft.com/en-us/library/fp161230(v=office.15).aspx">http://technet.microsoft.com/en-us/library/fp161230(v=office.15).aspx</a></p>
<p>The key to get apps host working is host named site collection (HNSC). Most of us have...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2012/11/22/configurin-sharepoint-2013-host-named-site-collections-and-apps-host/"><![CDATA[<p>There are a few good articles about configuring Sharepoint 2013 apps host, but atleast I found it somehow difficult to figure out how for example Intranet web application and application host could be configured. For beginning you should read this article <a href="http://technet.microsoft.com/en-us/library/fp161230(v=office.15).aspx">http://technet.microsoft.com/en-us/library/fp161230(v=office.15).aspx</a></p>
<p>The key to get apps host working is host named site collection (HNSC). Most of us have used host named web applications, but quite a few are familiar with host named site collections. Host named site collections are part of tenant technology and you can read more about it in Kirk Evans MSDN blog article <a href="http://blogs.msdn.com/b/kaevans/archive/2012/03/27/what-every-sharepoint-admin-needs-to-know-about-host-named-site-collections.aspx">http://blogs.msdn.com/b/kaevans/archive/2012/03/27/what-every-sharepoint-admin-needs-to-know-about-host-named-site-collections.aspx</a></p>
<p>I will first explain what we are going to do. The idea is to create web application that will host two site collections:<br />
- Intranet site (http://intranet.sp.dev)<br />
- Apps Catalog site (http://intranet.sp.dev/apps)</p>
<p>In SharePoint 2010 this wouldn’t have been possible since you couldn’t use managed paths with host named site collections. This is one of the improvements in 2013 and hence it’s now possible to use managed paths with HNSC.</p>
<p>Based on the technet article we are going to use url http://app-GUID.spapps.dev for apps. Note that this is not a subdomain of sp.dev –domain.<br />
The first thing to do is to add DNS-records for intranet and apps. You can do this by following the steps listed in the following article <a href="http://technet.microsoft.com/en-us/library/fp161236.aspx">http://technet.microsoft.com/en-us/library/fp161236.aspx</a>. You should also start following services in Central Admin:<br />
- App Management Service<br />
- Microsoft SharePoint Foundation Subscription Settings Service</p>
<p>We are not going to take a look at these steps in more detail because there’s already tens of articles explaining how to do that.</p>
<p>Next we are going create a new host web application for site collections. This is done by PowerShell (note that managed account sp_app has to be added already):</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$ap</span> <span style="color: pink;">=</span> New<span style="color: pink;">-</span>SPAuthenticationProvider<br />
<span style="color: #800080;">$wa</span> <span style="color: pink;">=</span> New<span style="color: pink;">-</span>SPWebApplication <span style="color: pink;">-</span>DatabaseName <span style="color: #800000;">&quot;SharePoint_Content_Intranet&quot;</span> –ApplicationPool <span style="color: #800000;">&quot;Intranet&quot;</span> <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Intranet&quot;</span> <span style="color: pink;">-</span>Port <span style="color: #804000;">80</span> <span style="color: pink;">-</span>ApplicationPoolAccount <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>SPManagedAccount <span style="color: #800000;">&quot;sp\sp_app&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">-</span>AuthenticationProvider $ap</div></div>
<p>This will create an empty web application that will be using servers name as address. Next you have to create an empty site in CA to the web application root. I got a lot of critical events to the event log when it was missing. Also other users have reported issues if it&#8217;s missing (i.e. <a href="http://blogs.technet.com/b/mpriem/archive/2012/11/07/always-have-a-root-site-collection.aspx">http://blogs.technet.com/b/mpriem/archive/2012/11/07/always-have-a-root-site-collection.aspx</a>).</p>
<p>After that we will add intranet site collection. We will be using team site as site collection template (STS#0). You can get all templates by using Get-SPWebTemplate command.</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">New<span style="color: pink;">-</span>SPSite <span style="color: #800000;">&quot;http://intranet.sp.dev&quot;</span> <span style="color: pink;">-</span>OwnerAlias <span style="color: #800000;">&quot;SP\sp_install&quot;</span> <span style="color: pink;">-</span>HostHeaderWebApplication <span style="color: #800080;">$wa</span> <span style="color: #008080; font-style: italic;">-Name</span> <span style="color: #800000;">&quot;Intranet&quot;</span> –Template <span style="color: #800000;">&quot;STS#0&quot;</span></div></div>
<p>Now you should be able to open address http://intanet.sp.dev. Let’s next create the apps host site for our intranet. We want to use URL http://intranet.sp.dev/apps thus we need to add a new managed path. SharePoint 2013 supports managed paths with host HNSC (SharePoint 2010 did also). A new managed path to be used with HNSC can be added by using PowerShell:</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">New<span style="color: pink;">-</span>SPManagedPath <span style="color: pink;">-</span>RelativeURL <span style="color: #800000;">&quot;apps&quot;</span> <span style="color: pink;">-</span>HostHeader –Explicit</div></div>
<p>Let’s now add the App Catalog Site: APPCATALOG#0</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">New<span style="color: pink;">-</span>SPSite <span style="color: #800000;">&quot;http://intranet.sp.dev/apps&quot;</span> <span style="color: pink;">-</span>OwnerAlias “<span style="color: #008080; font-weight: bold;">SP</span>\sp_install<span style="color: #800000;">&quot; -HostHeaderWebApplication $wa -Name &quot;</span>Application Catalog<span style="color: #800000;">&quot; -Template “APPCATALOG#0”</span></div></div>
<p>After that we have to configure apps. This can be done in Central Admin Apps section. Click <em>Manage App Catalog</em>.</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/11/apps.png"><img class="size-full wp-image-2437 aligncenter" title="apps" src="http://www.sharepointblues.com/wp-content/uploads/2012/11/apps.png" alt="Apps section in CA" width="531" height="132" /></a></p>
<p>Select the right web application from top right corner and select <em>Enter a URL for an existing app catalog site</em>. Insert your app catalog address.</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/11/appcatalogsettings.png"><img class="size-full wp-image-2436 aligncenter" title="appcatalogsettings" src="http://www.sharepointblues.com/wp-content/uploads/2012/11/appcatalogsettings.png" alt="" width="819" height="145" /></a></p>
<p>After that configure App URLs from Apps section.<br />
Insert your app domain (spapps.dev) and app prefix (app).</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/11/appurls.png"><img class="aligncenter size-full wp-image-2438" title="appurls" src="http://www.sharepointblues.com/wp-content/uploads/2012/11/appurls.png" alt="" width="648" height="224" /></a></p>
<p>You can now test your apps host by navigating to http://app-123456789.spapps.dev . You should get a login prompt.</p>
<p>Then comes the tricky question. What is the best practice for handling these URLs?<br />
You cannot add http://*.spapps.dev to trusted sites or local intranet zone because it would compromise your security with certain browsers (), but I’m sure your users will be not happy with constant login prompts when they navigate to sites using apps. If you have an opinion about this, please leave a comment.</p>
<p>Note that if you want to crawl HNSCs you just add your web applications address to the search content source (not individual site collection addresses).</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2425&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2012/11/22/configurin-sharepoint-2013-host-named-site-collections-and-apps-host/#comments" thr:count="5" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2012/11/22/configurin-sharepoint-2013-host-named-site-collections-and-apps-host/feed/atom/" thr:count="5" />
		<thr:total>5</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2012/11/22/configurin-sharepoint-2013-host-named-site-collections-and-apps-host/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Jarno Leikas</name>
					</author>
		<title type="html"><![CDATA[Integrate SharePoint 2013 Design Manager with TFS]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/FyaxaohOsZ0/" />
		<id>http://www.sharepointblues.com/?p=2410</id>
		<updated>2012-08-13T14:07:52Z</updated>
		<published>2012-08-13T14:01:08Z</published>
		<category scheme="http://www.sharepointblues.com" term="Development and Customization" /><category scheme="http://www.sharepointblues.com" term="Tips" />		<summary type="html"><![CDATA[<p>I think all artefacts produced in a SharePoint project should be treated as software artefacts. This includes all the UI stuff implemented by designers, such as css files and master pages.</p>
<p>Treating them as software artefacts means that they should be version-controlled. The problem is that there’s no design tool that integrates with TFS, making version control integration with the...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2012/08/13/2410/"><![CDATA[<p>I think all artefacts produced in a SharePoint project should be treated as software artefacts. This includes all the UI stuff implemented by designers, such as css files and master pages.</p>
<p>Treating them as software artefacts means that they should be version-controlled. The problem is that there’s no design tool that integrates with TFS, making version control integration with the designers&#8217; workflows can be a pit of a pain.</p>
<p>I wanted to talk to you quickly about how you could do this in SharePoint 2013. Let’s assume we want to take advantage of SharePoint 2013’s new design manager capabilities and have all your stuff stored safely in TFS.</p>
<p>We could end up with the following list of requirements for the designer’s workflow:</p>
<ul>
<li> The designer should be able to edit the design files with any editor</li>
<li> The designer should be able to see any changes automatically in SharePoint, without copying files manually</li>
<li> The designer should have to use Visual Studio only as a version control client, nothing more</li>
</ul>
<p>Here&#8217;s an approach you might want to try out:</p>
<ul>
<li>Map an SP2013 master page gallery as a network drive (using the new WebDAV), e.g. Y:</li>
<li>Create a project in TFS, say $/MyDesignProject</li>
<li>Map the TFS project&#8217;s working folder to your master page gallery&#8217;s network drive (Y drive)</li>
<li>Add, modify any design files in the web editor of your choice</li>
<li>When you&#8217;re done, the following tasks may need to be done:</li>
</ul>
<p>1. If you modified a file, you&#8217;ll need check in your changes in Source Control Explorer. If someone else had checked in some changes to the same file, you&#8217;ll need to merge<br />
2. If you added a file, you need to add it to TFS in Source Control Explorer before you can check it in, but this should be no biggie<br />
3. To delete a file, you have to delete it through the Source Control Explorer. The file will be deleted automatically from your working folder (which now is also your master page gallery).</p>
<p>One thing this approach <em>doesn&#8217;t</em> solve is building your solutions. In order to build your design package (.wsp) for deployment, you’ll need to export it using Design Manager. You can’t do it in Visual Studio, unless</p>
<ul>
<li>You pre-create a new SharePoint Project in $/MyDesignProject and do some crazy folder mappings that I haven&#8217;t tried yet</li>
<li>Custom code</li>
</ul>
<p>Hope this helps!</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2410&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2012/08/13/2410/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2012/08/13/2410/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2012/08/13/2410/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Tomi Tavela</name>
					</author>
		<title type="html"><![CDATA[SharePoint 2010 Resource File Deployment Done Easy]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/uwWtIjocGOQ/" />
		<id>http://www.sharepointblues.com/?p=2355</id>
		<updated>2012-05-28T17:30:59Z</updated>
		<published>2012-05-28T12:46:35Z</published>
		<category scheme="http://www.sharepointblues.com" term="Development and Customization" /><category scheme="http://www.sharepointblues.com" term="Featured" /><category scheme="http://www.sharepointblues.com" term="Tips" /><category scheme="http://www.sharepointblues.com" term="App_GlobalResources" /><category scheme="http://www.sharepointblues.com" term="deployment" /><category scheme="http://www.sharepointblues.com" term="resource" />		<summary type="html"><![CDATA[<p>Deployment of resource files with SharePoint has always been a little tricky. With MOSS we used features to provision resource files. With SharePoint 2010 it was a little easier but not enough.<br />
There are blogs with some ideas how to make it easier to deploy resources in multiple locations <a href="http://johanleino.wordpress.com/2010/11/08/working-with-resource-files-in-sharepoint-2010/">here</a>, <a href="http://blogs.msdn.com/b/yojoshi/archive/2012/04/29/easy-way-to-deploy-resx-resource-files-under-app-globalresources-folder-in-sharepoint-2010.aspx">here</a> and <a href="http://blog.bugrapostaci.com/2011/10/21/sharepoint-deploying-resource-files-to-app_globalresources-folder-using-timer-job/">here</a>. They did not...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2012/05/28/sharepoint-2010-resource-file-deployment-done-easy/"><![CDATA[<p>Deployment of resource files with SharePoint has always been a little tricky. With MOSS we used features to provision resource files. With SharePoint 2010 it was a little easier but not enough.<br />
There are blogs with some ideas how to make it easier to deploy resources in multiple locations <a href="http://johanleino.wordpress.com/2010/11/08/working-with-resource-files-in-sharepoint-2010/">here</a>, <a href="http://blogs.msdn.com/b/yojoshi/archive/2012/04/29/easy-way-to-deploy-resx-resource-files-under-app-globalresources-folder-in-sharepoint-2010.aspx">here</a> and <a href="http://blog.bugrapostaci.com/2011/10/21/sharepoint-deploying-resource-files-to-app_globalresources-folder-using-timer-job/">here</a>. They did not anyways fill all my requirements.</p>
<p>I do not want to:<br />
1. Use feature to deploy resources<br />
2. Keep two copies of the same resource file in the project<br />
3. Edit the manifest.xml in visual studio.<br />
4. To have &#8220;Resources&#8221; subfolder inside App_GlobalResources folder.</p>
<p>With the help of the blog post above, I managed to create solution where you only keep one copy of the resource file and that it is easy to manage and easy to deploy to the whole farm.</p>
<p>Add a <strong>mappedfolder</strong> to your project and point it to <strong>14\Resources</strong> folder. Then add your custom resource file(s) to it:</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/create_mapped_folder.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/create_mapped_folder.png" alt="" /></a></p>
<p>Add a <strong>Empty Element</strong> to your project and name it <strong>App_GlobalResources</strong>:</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/create_empty_element.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/create_empty_element.png" alt="" /></a></p>
<p><strong>Delete</strong> the <strong>feature</strong> it created automatically, you will not need it:</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/delete_created_feature.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/delete_created_feature.png" alt="" /></a></p>
<p><strong>Delete</strong> the <strong>Elements.xml</strong> file it automatically created, you will not need that:</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/delete_created_element_file.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/delete_created_element_file.png" alt="" /></a></p>
<p>Edit the <strong>SharePointProjectItem.spdata</strong> file inside the <strong>App_GlobalResources</strong> folder (If you cannot see it, press &#8220;Show All Files&#8221; button from the Solution Explorer). Replace the empty</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Files</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></div></div>
<p>node with the following xml, with your own path and file name:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Files</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ProjectItemFile</span> <span style="color: #000066;">Source</span>=<span style="color: #ff0000;">&quot;..\Resources\EasyResource.en-US.resx&quot;</span> <span style="color: #000066;">Type</span>=<span style="color: #ff0000;">&quot;AppGlobalResource&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ProjectItemFile</span> <span style="color: #000066;">Source</span>=<span style="color: #ff0000;">&quot;..\Resources\EasyResource.fi-FI.resx&quot;</span> <span style="color: #000066;">Type</span>=<span style="color: #ff0000;">&quot;AppGlobalResource&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ProjectItemFile</span> <span style="color: #000066;">Source</span>=<span style="color: #ff0000;">&quot;..\Resources\EasyResource.resx&quot;</span> <span style="color: #000066;">Type</span>=<span style="color: #ff0000;">&quot;AppGlobalResource&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Files<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>If you add new resource files later remember to update this file too.</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/edit_spdata_file.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/edit_spdata_file.png" alt="" /></a></p>
<p>Double click the <strong>Package</strong> folder and add the <strong>App_GlobalResource</strong> item to the Package:</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/add_element_to_package.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/add_element_to_package.png" alt="" /></a></p>
<p>Build and deploy, all resource files will be deployed to 14Hive and WebApplication.<br />
14Hive:</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/14_resources.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/14_resources.png" alt="" /></a></p>
<p>WebApplication:</p>
<p><a href="http://www.sharepointblues.com/wp-content/uploads/2012/05/globalresources.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/05/globalresources.png" alt="" /></a></p>
<p>When editing the resource files, just a normal <strong>Update-SPSolution</strong> command with <strong>PowerShell</strong> will update the resources to the whole Farm. I hope this helps someone struggling with the manual copies or other hacks with deployment of resource files.</p>
<p>***********************************************<br />
Jerry Seinfeld: Why not? We’re neighbors. What’s mine is yours.<br />
Cosmo Kramer: [leaning against the door-frame and looking around in wonder] Really?<br />
***********************************************</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2355&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2012/05/28/sharepoint-2010-resource-file-deployment-done-easy/#comments" thr:count="4" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2012/05/28/sharepoint-2010-resource-file-deployment-done-easy/feed/atom/" thr:count="4" />
		<thr:total>4</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2012/05/28/sharepoint-2010-resource-file-deployment-done-easy/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marko Rosberg</name>
					</author>
		<title type="html"><![CDATA[Debugging SharePoint 2010 Server Search Crawler With Fiddler2]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/bwES9BWnrh8/" />
		<id>http://www.sharepointblues.com/?p=2321</id>
		<updated>2013-02-06T06:05:05Z</updated>
		<published>2012-04-27T07:26:06Z</published>
		<category scheme="http://www.sharepointblues.com" term="Configuration and Administration" /><category scheme="http://www.sharepointblues.com" term="Tips" />		<summary type="html"><![CDATA[<p>Every now and then you may end up in a situation where SharePoint crawler returns just one <em>top level error</em> or multiple errors. Probably most of us would first enable verbose logging for SharePoint search, run crawl and monitor ULS logs with <a href="http://archive.msdn.microsoft.com/ULSViewer">ULS Viewer</a>. This is a good beginning, but it often offers very little information and very limited...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2012/04/27/debugging-sharepoint-2010-server-search-crawler/"><![CDATA[<p>Every now and then you may end up in a situation where SharePoint crawler returns just one <em>top level error</em> or multiple errors. Probably most of us would first enable verbose logging for SharePoint search, run crawl and monitor ULS logs with <a href="http://archive.msdn.microsoft.com/ULSViewer">ULS Viewer</a>. This is a good beginning, but it often offers very little information and very limited insight to crawler’s behavior.</p>
<p>By using Fiddler as a proxy server for SharePoint crawler, we can actually track what the crawler is actually crawling. This is very handy when debugging problems arising e.g. from multiple redirects, proxy- or authentication issues. You can enable fiddler proxy by following the following steps:</p>
<ol>
<li>1. <a href="http://fiddler2.com/fiddler2/">Download</a> and install Fiddler2</li>
<li>2. Start Fiddler2 to enable it to act as proxy</li>
<li>3. Create file called mssdmn.exe.config to folder  %CommonProgramFiles%\Microsoft Office Servers\14.0\Bin (mssdmn.exe file should be also found here)</li>
<li>4. Add following lines to the file
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;system.net<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;defaultProxy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;proxy</span></span><br />
<span style="color: #009900;"><span style="color: #000066;">usesystemdefault</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;"><span style="color: #000066;">proxyaddress</span>=<span style="color: #ff0000;">&quot;http://127.0.0.1:8888&quot;</span></span><br />
<span style="color: #009900;"><span style="color: #000066;">bypassonlocal</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/defaultProxy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system.net<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
</li>
<li>5. Restart SharePoint Server Search 14 service on server to apply proxy settings.</li>
<li>6. Start SharePoint crawl and monitor Fiddler2. You should see something similar to picture below:<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2012/04/fiddler2_search_small.png"><img src="http://www.sharepointblues.com/wp-content/uploads/2012/04/fiddler2_search_small.png" alt="" title="fiddler2_search_small" width="593" height="177" class="alignleft size-full wp-image-2342" /></a></li>
</ol>
<p>So, now you have a little bit better insight to SharePoint&#8217;s crawler. Hope this helps you to solve crawler related problems.</p>
<p><strong>Update:</strong> You need to run Fiddler has the same account the Search Service is running. Otherwise Fiddler doesn’t log anything as it will run in a different user context.</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2321&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2012/04/27/debugging-sharepoint-2010-server-search-crawler/#comments" thr:count="1" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2012/04/27/debugging-sharepoint-2010-server-search-crawler/feed/atom/" thr:count="1" />
		<thr:total>1</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2012/04/27/debugging-sharepoint-2010-server-search-crawler/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Marko Rosberg</name>
					</author>
		<title type="html"><![CDATA[SharePoint Certificate errors]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/8No0_V6-vtk/" />
		<id>http://www.sharepointblues.com/?p=2262</id>
		<updated>2013-04-10T10:51:18Z</updated>
		<published>2012-01-09T08:24:50Z</published>
		<category scheme="http://www.sharepointblues.com" term="Configuration and Administration" /><category scheme="http://www.sharepointblues.com" term="Tips" />		<summary type="html"><![CDATA[<p>This article introduces some tools and practices that I’ve seen useful for tackling SharePoint 2010 errors arising from SSL Certificates. The main reason for writing this article is the &#8220;The root of the certificate chain is not a trusted root authority&#8221; – error.</p>
<p>Let&#8217;s first take a look at a useful tool for solving certificate errors. Windows has built in...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2012/01/09/sharepoint-certificate-errors/"><![CDATA[<p>This article introduces some tools and practices that I’ve seen useful for tackling SharePoint 2010 errors arising from SSL Certificates. The main reason for writing this article is the &#8220;The root of the certificate chain is not a trusted root authority&#8221; – error.</p>
<p>Let&#8217;s first take a look at a useful tool for solving certificate errors. Windows has built in a very good SSL certificate error log called CAPI2. This can be enabled under Application and Services Logs -&gt; Microsoft -&gt; CAPI2 by left clicking “Operational” and pressing “Enable Log”.<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2012/01/capi2.png"><img class="aligncenter size-full wp-image-2264" title="capi2" src="http://www.sharepointblues.com/wp-content/uploads/2012/01/capi2.png" alt="CAPI2 Log" width="321" height="384" /></a><br />
Two most common errors in CAPI2 log seems to be errors in Certification Revocation Lists (CRL) and untrusted root certificate chains. Let&#8217;s take a look at how one could solve these problems.</p>
<p><strong>Certificate revocation list errors</strong><br />
To make sure that the SSL certificates are valid windows checks for CRL. By default it will try to access this list for 15 seconds. If the list cannot be accessed the process is continued normally.<br />
In SharePoint CRL problems may occur for example as long loading times (especially if the page is not used frequently), broken functionalities, etc.<br />
CRL access errors can be solved by a few quite easy steps:<br />
1. In CAPI2 open error event in Details / XML view and find what CRL (Certificate Revocation List) URL the server is trying to access.<a href="http://www.sharepointblues.com/wp-content/uploads/2012/01/capi2_crl.png"><img class="aligncenter size-full wp-image-2277" title="capi2_crl" src="http://www.sharepointblues.com/wp-content/uploads/2012/01/capi2_crl.png" alt="CRL error" width="624" height="408" /></a><br />
2. You basically have two options for solving this:</p>
<ol>
<li>a. Enable access to the CRL address. If you can connect to the Internet via a proxy, you can first configure proxy settings in Internet settings panel and then run:
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">netsh winhttp import proxy ie</div></div>
</li>
<li>b. Disable certificate revocation list check (not recommended) <a href="http://www.page-house.com/blog/2009/04/how-to-disable-crl-checking.html">How to Disable CRL Checking</a></li>
</ol>
<p><strong>Untrusted root authority or broken certificate chain error in SharePoint</strong><br />
1.Let’s first make sure that you have the proper error.</p>
<ol>
<li>a. Open Management console and add certificate snap in.</li>
<li>b. Expand Certificates -&gt; SharePoint -&gt; Certificates and open one of the certificates included in that folder.<a href="http://www.sharepointblues.com/wp-content/uploads/2012/01/sharepoint_container.png"><img class="aligncenter size-full wp-image-2285" title="sharepoint_container" src="http://www.sharepointblues.com/wp-content/uploads/2012/01/sharepoint_container.png" alt="" width="265" height="282" /></a></li>
<li>c. On the Certification Path -tab should look like as in the following figure.<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2012/01/broken_crt.png"><img class="aligncenter size-full wp-image-2292" title="broken_crt" src="http://www.sharepointblues.com/wp-content/uploads/2012/01/broken_crt.png" alt="" width="408" height="507" /></a></li>
</ol>
<p>2. OK, so let’s fix this problem. The problem by the way is that these certificates are issued by a certificate authority which is not trusted.</p>
<ol>
<li>a. First we must export the root certificate from SharePoint by using the following PowerShell commands:
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$rootCert</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span>Get<span style="color: pink;">-</span>SPCertificateAuthority<span style="color: #000000;">&#41;</span>.RootCertificate<br />
<span style="color: #800080;">$rootCert</span>.Export<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Cert&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Set-Content</span> C:\FarmRoot.cer <span style="color: #008080; font-style: italic;">-Encoding</span> byte</div></div>
</li>
<li>b. Then import the SharePoint root certificate to trusted root authorities<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2012/01/crt_import.png"><img class="aligncenter size-full wp-image-2293" title="crt_import" src="http://www.sharepointblues.com/wp-content/uploads/2012/01/crt_import.png" alt="" width="330" height="314" /></a></li>
</ol>
<p>3. If all went well the certificates under SharePoint certificate store should look like in the following figure.<br />
<a href="http://www.sharepointblues.com/wp-content/uploads/2012/01/working_crt.png"><img class="aligncenter size-full wp-image-2294" title="working_crt" src="http://www.sharepointblues.com/wp-content/uploads/2012/01/working_crt.png" alt="" width="409" height="507" /></a></p>
<p>Allthought we have focused on SharePoint 2010 in this blog post these tools and practices can alse been applied for many other software running on Windows platform.</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2262&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2012/01/09/sharepoint-certificate-errors/#comments" thr:count="3" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2012/01/09/sharepoint-certificate-errors/feed/atom/" thr:count="3" />
		<thr:total>3</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2012/01/09/sharepoint-certificate-errors/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Tomi Tavela</name>
					</author>
		<title type="html"><![CDATA[Anonymous Access and Publishing Web Pages List]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/raANv1pZUFk/" />
		<id>http://www.sharepointblues.com/?p=2224</id>
		<updated>2011-12-22T12:57:10Z</updated>
		<published>2011-12-22T08:58:37Z</published>
		<category scheme="http://www.sharepointblues.com" term="Development and Customization" /><category scheme="http://www.sharepointblues.com" term="Tips" /><category scheme="http://www.sharepointblues.com" term="anonymous user" /><category scheme="http://www.sharepointblues.com" term="PublishingWeb" />		<summary type="html"><![CDATA[<p>As You know, using <a href="http://msdn.microsoft.com/en-us/library/ms497306(v=office.14).aspx">PublishingWeb.GetPublishingWeb(web)</a> method causes Access Denied exception for anonymous users. You will also get the same exception if you try to access the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.getpageslistid.aspx">PublishingWeb.GetPagesListId(web)</a> or <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.getpageslistname.aspx">PublishingWeb.GetPagesListName(web)</a> methods.<br />
There are solutions <a href="http://henry-chong.com/2010/11/sharepoint-anonymous-access-and-publishing-web-default-page/">here</a> and <a href="http://blogs.pointbridge.com/Blogs/sabadra_prasham/Pages/Post.aspx?_ID=1">here</a> and <a href="http://www.google.fi/search?ix=hca&#038;sourceid=chrome&#038;ie=UTF-8&#038;q=anonymousaccess+publishingweb">in many other blogs</a>. These solutions use <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx">SPSecurity.RunWithElevatedPrivileges</a>, but that&#8217;s not ideal solution for anonymous...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2011/12/22/anonymous_access_and_publishing_web_pages_list/"><![CDATA[<p>As You know, using <a href="http://msdn.microsoft.com/en-us/library/ms497306(v=office.14).aspx">PublishingWeb.GetPublishingWeb(web)</a> method causes Access Denied exception for anonymous users. You will also get the same exception if you try to access the <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.getpageslistid.aspx">PublishingWeb.GetPagesListId(web)</a> or <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.getpageslistname.aspx">PublishingWeb.GetPagesListName(web)</a> methods.<br />
There are solutions <a href="http://henry-chong.com/2010/11/sharepoint-anonymous-access-and-publishing-web-default-page/">here</a> and <a href="http://blogs.pointbridge.com/Blogs/sabadra_prasham/Pages/Post.aspx?_ID=1">here</a> and <a href="http://www.google.fi/search?ix=hca&#038;sourceid=chrome&#038;ie=UTF-8&#038;q=anonymousaccess+publishingweb">in many other blogs</a>. These solutions use <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx">SPSecurity.RunWithElevatedPrivileges</a>, but that&#8217;s not ideal solution for anonymous sites.<br />
So how to get pages list from a web, if you don&#8217;t even know if the web is publishing site and you are not able to use <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.publishing.publishingweb.ispublishingweb.aspx">PublishingWeb.IsPublishingWeb(web)</a>?<br />
Heres yet another solution. Open the web you want to check if it is a publishing site and try to get the pages list using <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistcollection.trygetlist.aspx">TryGetList</a> method with the right localized pages list name. You will get the localized name from cmscore.resx file using <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.getlocalizedstring.aspx">SPUtility.GetLocalizedString</a> method with resource key &#8220;List_Pages_UrlName&#8221;.</p>
<div class="codecolorer-container csharp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">var pages <span style="color: #008000;">=</span> web<span style="color: #008000;">.</span><span style="color: #0000FF;">Lists</span><span style="color: #008000;">.</span><span style="color: #0000FF;">TryGetList</span><span style="color: #008000;">&#40;</span>SPUtility<span style="color: #008000;">.</span><span style="color: #0000FF;">GetLocalizedString</span><span style="color: #008000;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;$Resources:{0}&quot;</span>, <span style="color: #666666;">&quot;List_Pages_UrlName&quot;</span><span style="color: #008000;">&#41;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #666666;">&quot;cmscore&quot;</span>, web<span style="color: #008000;">.</span><span style="color: #0000FF;">Language</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>pages <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
<span style="color: #008080; font-style: italic;">// do the do</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>It all gets interesting, if the site is not publishing web, but still contain a list called &#8220;Pages&#8221;. Then You might want to check another things from returned list, not just if it&#8217;s null like in the snippet above.</p>
<p>***********************************************<br />
Jerry Seinfeld: Why not? We’re neighbors. What’s mine is yours.<br />
Cosmo Kramer: [leaning against the door-frame and looking around in wonder] Really?<br />
***********************************************</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2224&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2011/12/22/anonymous_access_and_publishing_web_pages_list/#comments" thr:count="2" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2011/12/22/anonymous_access_and_publishing_web_pages_list/feed/atom/" thr:count="2" />
		<thr:total>2</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2011/12/22/anonymous_access_and_publishing_web_pages_list/</feedburner:origLink></entry>
		<entry>
		<author>
			<name>Tomi Tavela</name>
					</author>
		<title type="html"><![CDATA[Remove Keys From PropertyBag on FeatureDeactivating Override]]></title>
		<link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/SharepointBlues/~3/zmnzzDUl_fQ/" />
		<id>http://www.sharepointblues.com/?p=2200</id>
		<updated>2011-12-13T12:25:09Z</updated>
		<published>2011-12-13T08:17:09Z</published>
		<category scheme="http://www.sharepointblues.com" term="Development and Customization" /><category scheme="http://www.sharepointblues.com" term="Tips" /><category scheme="http://www.sharepointblues.com" term="feature" /><category scheme="http://www.sharepointblues.com" term="PropertyBag" />		<summary type="html"><![CDATA[<p>You can add keys to spweb propertybag trough a feature using CAML:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&#60;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&#34;1.0&#34;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&#34;utf-8&#34;</span><span style="color: #000000; font-weight: bold;">?&#62;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&#60;Elements</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&#34;http://schemas.microsoft.com/sharepoint/&#34;</span><span style="color: #000000; font-weight: bold;">&#62;</span></span><br />
&#160; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&#60;PropertyBag</span> <span style="color: #000066;">ParentType</span>=<span style="color: #ff0000;">&#34;Web&#34;</span> <span style="color: #000066;">RootWebOnly</span>=<span style="color: #ff0000;">&#34;False&#34;</span><span style="color: #000000; font-weight: bold;">&#62;</span></span><br />
&#160; &#160; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&#60;Property</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&#34;MyCustomProperty&#34;</span></span><br />
<span style="color: #009900;"> &#160; &#160; &#160; &#160; &#160; &#160; &#160;<span style="color:</span></div></div><p>...</p>]]></summary>
		<content type="html" xml:base="http://www.sharepointblues.com/2011/12/13/remove_keys_from_propertybag_on_featuredeactivating_override/"><![CDATA[<p>You can add keys to spweb propertybag trough a feature using CAML:</p>
<div class="codecolorer-container xml blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Elements</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://schemas.microsoft.com/sharepoint/&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;PropertyBag</span> <span style="color: #000066;">ParentType</span>=<span style="color: #ff0000;">&quot;Web&quot;</span> <span style="color: #000066;">RootWebOnly</span>=<span style="color: #ff0000;">&quot;False&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Property</span> <span style="color: #000066;">Name</span>=<span style="color: #ff0000;">&quot;MyCustomProperty&quot;</span></span><br />
<span style="color: #009900;"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000066;">Type</span>=<span style="color: #ff0000;">&quot;string&quot;</span> <span style="color: #000066;">Value</span>=<span style="color: #ff0000;">&quot;MyValue&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/PropertyBag<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Elements<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>The property is written to SPWebs AllProperties propertybag. When you deactivate the feature, it does not remove the keys.<br />
If you want to remove the keys when deactivating the feature, add Event Receiver to your Feature and the following code to the FeatureDeactivating override.</p>
<div class="codecolorer-container csharp blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="csharp codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> FeatureDeactivating<span style="color: #008000;">&#40;</span>SPFeatureReceiverProperties properties<span style="color: #008000;">&#41;</span><br />
<span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; var web <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>SPWeb<span style="color: #008000;">&#41;</span>properties<span style="color: #008000;">.</span><span style="color: #0000FF;">Feature</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Parent</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; var allowUnsafeUpdates <span style="color: #008000;">=</span> web<span style="color: #008000;">.</span><span style="color: #0000FF;">AllowUnsafeUpdates</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; var elementDefinitions <span style="color: #008000;">=</span> properties<span style="color: #008000;">.</span><span style="color: #0000FF;">Definition</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetElementDefinitions</span><span style="color: #008000;">&#40;</span>CultureInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">CurrentCulture</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var n <span style="color: #0600FF; font-weight: bold;">in</span> <span style="color: #0600FF; font-weight: bold;">from</span> SPElementDefinition elementDefinition <span style="color: #0600FF; font-weight: bold;">in</span> elementDefinitions<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">where</span> elementDefinition<span style="color: #008000;">.</span><span style="color: #0000FF;">ElementType</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;PropertyBag&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">select</span> elementDefinition<span style="color: #008000;">.</span><span style="color: #0000FF;">XmlDefinition</span> into xml<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">where</span> xml<span style="color: #008000;">.</span><span style="color: #0000FF;">Attributes</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span> <span style="color: #008000;">&amp;&amp;</span> xml<span style="color: #008000;">.</span><span style="color: #0000FF;">Attributes</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;ParentType&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;Web&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">from</span> n <span style="color: #0600FF; font-weight: bold;">in</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">from</span> XmlNode xNode <span style="color: #0600FF; font-weight: bold;">in</span> xml<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; let xmlAttributeCollection <span style="color: #008000;">=</span> xNode<span style="color: #008000;">.</span><span style="color: #0000FF;">Attributes</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">where</span> xmlAttributeCollection <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">select</span> xmlAttributeCollection<span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;Name&quot;</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0600FF; font-weight: bold;">select</span> n<span style="color: #008000;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; web<span style="color: #008000;">.</span><span style="color: #0000FF;">AllProperties</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Remove</span><span style="color: #008000;">&#40;</span>n<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; web<span style="color: #008000;">.</span><span style="color: #0000FF;">Update</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">&#125;</span><br />
&nbsp; &nbsp; web<span style="color: #008000;">.</span><span style="color: #0000FF;">AllowUnsafeUpdates</span> <span style="color: #008000;">=</span> allowUnsafeUpdates<span style="color: #008000;">;</span><br />
&nbsp; &nbsp; web<span style="color: #008000;">.</span><span style="color: #0000FF;">Update</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span><br />
<span style="color: #008000;">&#125;</span></div></div>
<p>This sample only removes the keys, if the propertybag ParentType is &#8220;Web&#8221;, which means the key will be written to SPWebs AllProperties propertybag.</p>
<p>***********************************************<br />
Jerry Seinfeld: Why not? We’re neighbors. What’s mine is yours.<br />
Cosmo Kramer: [leaning against the door-frame and looking around in wonder] Really?<br />
***********************************************</p>
<img src="http://www.sharepointblues.com/?ak_action=api_record_view&id=2200&type=feed" alt="" />]]></content>
		<link rel="replies" type="text/html" href="http://www.sharepointblues.com/2011/12/13/remove_keys_from_propertybag_on_featuredeactivating_override/#comments" thr:count="0" />
		<link rel="replies" type="application/atom+xml" href="http://www.sharepointblues.com/2011/12/13/remove_keys_from_propertybag_on_featuredeactivating_override/feed/atom/" thr:count="0" />
		<thr:total>0</thr:total>
	<feedburner:origLink>http://www.sharepointblues.com/2011/12/13/remove_keys_from_propertybag_on_featuredeactivating_override/</feedburner:origLink></entry>
	</feed>
