<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>yuriburger.net</title>
	<atom:link href="http://yuriburger.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://yuriburger.net</link>
	<description>All Things SharePoint!</description>
	<lastBuildDate>Mon, 14 May 2012 21:02:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='yuriburger.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/fa79594c06991457feed629e5d35aaa3?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>yuriburger.net</title>
		<link>http://yuriburger.net</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://yuriburger.net/osd.xml" title="yuriburger.net" />
	<atom:link rel='hub' href='http://yuriburger.net/?pushpress=hub'/>
		<item>
		<title>SharePoint for the Internet &#8211; Part 1, Performance</title>
		<link>http://yuriburger.net/2012/05/12/sharepoint-for-the-internet-part-1-performance/</link>
		<comments>http://yuriburger.net/2012/05/12/sharepoint-for-the-internet-part-1-performance/#comments</comments>
		<pubDate>Fri, 11 May 2012 22:45:22 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[anonymous]]></category>
		<category><![CDATA[internet facing]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=267</guid>
		<description><![CDATA[The last months I have been involved in a couple SharePoint internet facing projects and decided to create a list of things to consider, specific to these type of projects. But before I start, I’d like to make a few things clear: 1. There is no definite checklist for deploying SharePoint for the Internet. Every [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=267&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The last months I have been involved in a couple SharePoint internet facing projects and decided to create a list of things to consider, specific to these type of projects. But before I start, I’d like to make a few things clear:</p>
<p>1. There is no definite checklist for deploying SharePoint for the Internet. Every project is different and there are no silver bullets. In fact, it is not even a real checklist (just a list of items I’d like to consider on every internet project).</p>
<p>2. This is my checklist based on experiences with past projects, your mileage may (and will) vary <img style="border-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://allthingssharepoint.files.wordpress.com/2012/05/wlemoticon-smile.png?w=540">&nbsp;</p>
<p>3. There are so many options and configurations possible, it is not just about enabling/disabling features and options to achieve your goal. Every option should be investigated thoroughly and remember: ‘Just because you can, doesn’t mean you should’.&nbsp; </p>
<p>Since there many options to consider, I divided them in three main categories and three separate blog posts:</p>
<ul>
<li>Part 1: Performance (this post)
<li>Part 2: Security
<li>Part 3: Customization and usability </li>
</ul>
<h3>Performance</h3>
<p>Big topic for internet facing websites. While SharePoint 2010 performs a lot better compared to previous versions, performance will (and should) always be on your list.</p>
<h4>#1: Reduce page load</h4>
<ul>
<li>Remove the “Name Active X Control”. This control is used by SharePoint to show presence information (the little icon next to author names, etc.) and has no meaning on public (anonymous) web sites. You can do this through Central Administration (Web Application General Settings:</li>
</ul>
<p><a href="http://allthingssharepoint.files.wordpress.com/2012/05/image.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://allthingssharepoint.files.wordpress.com/2012/05/image_thumb.png?w=477&h=138" width="477" height="138"></a></p>
<ul>
<li>Remove the reference to the SharePoint Workspace ActiveX from the master page (present if based on the OOTB master pages).
<li>Limit the use of Content Query Web Parts on landing pages. While this is a beautiful Web Part, it adds significantly to the page load time especially initially with uncached data. As a workaround you could use custom developed web parts or user controls to achieve your data query goals. This way you have good control of the rendered HTML and avoid the XSLT query processing part. But make sure you have some kind of caching in place.
<li>Remove the Ribbon for anonymous users. There are a couple of ways to do this, these are the most obvious ones:</li>
</ul>
<table border="1" cellspacing="0" cellpadding="2" width="640">
<tbody>
<tr>
<td valign="top" width="32">Ok?</td>
<td valign="top" width="606">Remove or hide it using CSS. Usually not the best way to do this, because the Ribbon and support files are still downloaded by the client. They are just hidden or removed from the DOM.</td>
</tr>
<tr>
<td valign="top" width="32">Better?</td>
<td valign="top" width="606">Wrap the Ribbon in a SPSecurityTrimmedControl. A far better option IMO, but there is a penalty because SharePoint needs a database round-trip to fetch the rights. </td>
</tr>
<tr>
<td valign="top" width="32">Best?</td>
<td valign="top" width="606">Use different Master Pages for anonymous users and editors. You can remove the Ribbon control and support files completely from the anonymous Master Page. Also a good option if you use Content Deployment and have separate authoring and publishing farms. On the downside, you will need to find a way to use Master Pages based on what type of user requests the page.</td>
</tr>
</tbody>
</table>
<ul>
<li>Minify jQuery and other 3rd party JavaScript libraries. Use a CDN if applicable for the libraries since this facilitates caching by browser, proxy server, etc. Remember to enable local fail-over copies.</li>
</ul>
<p>#2: Monitor Page Requests</p>
<ul>
<li>Use a network monitor or traffic inspector (like Fiddler2) to monitor the HTTP request and response associated with a page request. These type of tools make optimizing page loads a whole lot easier.
<li>Use the SharePoint Developer Dashboard to monitor processing and render times of individual components.</li>
</ul>
<p>#3: Adjust IIS Dynamic Compression</p>
<ul>
<li>By default SharePoint Web Servers have static and dynamic file compression enabled, but the compression level for dynamic files is set to “0”. This means that dynamic files don’t get compressed at all. You can adjust the compression level and the CPU threshold settings, for more information see <a href="http://technet.microsoft.com/en-us/library/cc771003(v=ws.10).aspx">Technet</a>. It is not just about enabling this, you will have to monitor performance and Web Server CPU for tuning adjustments.</li>
</ul>
<p>#4: Caching</p>
<p>SharePoint 2010 and the underlying ASP.NET offer several different methods for caching. Again no silver bullets here, and my advice: develop a caching strategy! The way you configure the different caching options totally depends on the type of content served (static versus dynamic), the audience, intended web site usage and so on. Make a note on what type of cache you configure, how you configure it and what results you expect. Once you start monitoring your site’s performance you can easily check and adjust where needed. </p>
<p>More info on this topic, see <a href="http://technet.microsoft.com/en-us/library/cc261797.aspx">Technet</a>.</p>
<ul>
<li>The BLOB cache. BLOB stands for Binary Large OBject and is a disk based storage. Files initially retrieved from the SharePoint Content Database are stored on disk and served to clients on subsequent requests. You need to think about what type of files to store, where to store them (on the web server) and what client cache life time to configure (max-age).</li>
<li>The Object cache. If you are using SharePoint’s publishing feature (and you probably are on internet facing sites), you can configure this cache. The cache stores SharePoint objects (lists, page layouts, etc.) in-memory to speed up queries on them. They require the correct configuration of what is called the “Object Cache User Accounts”, again see <a href="http://technet.microsoft.com/en-us/library/ff758656.aspx">Technet</a> for more information.</li>
<li>Output cache. Based on ASP.NET Output Caching, but with added features (which also require the SharePoint publishing feature). Usually the least popular of the three, probably because it is a little bit harder to configure correctly. There are a couple of considerations to make, so definitely take a look at the <a href="http://msdn.microsoft.com/en-us/library/aa661294.aspx">Technet</a> article. </li>
</ul>
<p>Please, feel free to comment on this topic, more coming soon.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/267/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/267/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/267/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=267&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2012/05/12/sharepoint-for-the-internet-part-1-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/05/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/05/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom SharePoint Health Analyzer Rule for the ViewFormPagesLockdown feature</title>
		<link>http://yuriburger.net/2012/04/16/custom-sharepoint-health-analyzer-rule-for-the-viewformpageslockdown-feature/</link>
		<comments>http://yuriburger.net/2012/04/16/custom-sharepoint-health-analyzer-rule-for-the-viewformpageslockdown-feature/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 21:49:14 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Health Analyzer]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=258</guid>
		<description><![CDATA[SharePoint 2010 has a special hidden feature that ensures anonymous users with read access cannot view list and library form pages (i.e. “Forms/AllItems.aspx”). This feature is also known as SharePoint Lockdown mode and is automatically enabled on publishing sites. Especially on internet facing SharePoint sites, this feature ensures anonymous users stay out of certain area’s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=258&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SharePoint 2010 has a special hidden feature that ensures anonymous users with read access cannot view list and library form pages (i.e. “Forms/AllItems.aspx”). This feature is also known as SharePoint Lockdown mode and is automatically enabled on publishing sites. Especially on internet facing SharePoint sites, this feature ensures anonymous users stay out of certain area’s of a site. Since this feature is not automatically enabled on non-publishing sites, we need to find a way to check this features state on a regular basis. We could of course create a scheduled PowerShell script for this, but I like a more solid approach for this one. </p>
<p>More info on the Lockdown feature on this MSDN <a href="http://blogs.msdn.com/b/ecm/archive/2007/05/12/anonymous-users-forms-pages-and-the-lockdown-feature.aspx">blog</a> (MOSS 2007, but still applicable. By Ryan Duguid)</p>
<p>As we all know, SharePoint 2010 includes the Health Analyzer. This component uses a bunch of rules to check the farm for predefined issues and report on any found:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2012/04/1.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="1" border="0" alt="1" src="http://allthingssharepoint.files.wordpress.com/2012/04/1_thumb.png?w=477&h=93" width="477" height="93"></a></p>
<p>Fortunately, the rule set is extensible and we can add our custom ones. This is not a difficult task and a good candidate for our feature check!</p>
<p>To start we need to create a class that inherits from either the SPHealthAnalysisRule or SPRepairableHealthAnalysisRule. From these abstract classes we need to implement some string properties “Summary”, “Explanation” and “Remedy” (for explaining the issues found) and the “Category” and “ErrorLevel” properties. The “Check()” method performs the actual analysis so must be implemented too. If you want users to be able to execute a repair right from the Central Administration interface, the SPRepairableHealthAnalysisRule includes a “Repair()” method just for that. Finally we can implement the “AutomaticExecutionParameters” property to enable automatic Timer Job execution for our rule and in this case we do.</p>
<p>More detailed info on this on <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.health.sphealthanalysisrule.aspx">MSDN</a>. </p>
<p>1. We start with an Empty SharePoint Project, and deploy it as a Farm Solution. We add our Central Administration web as our Site Url.</p>
<p>2. Next we add the class that inherits from SPHealthAnalysisRule and add the necessary using statements. After implementing the abstract class our rule looks like this:</p>
<div style="margin:0;display:inline;float:none;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:f9759c7a-72f4-4def-b314-27c9a250cb1d" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp; pad-line-numbers: true;">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.Administration.Health;

namespace Blog.Examples.HealthAnalysisRule
{
     public sealed class ViewFormPagesLockDown : SPHealthAnalysisRule
    {
        public override SPHealthCategory Category
        {
            get { throw new NotImplementedException(); }
        }

        public override SPHealthCheckStatus Check()
        {
            throw new NotImplementedException();
        }

        public override SPHealthCheckErrorLevel ErrorLevel
        {
            get { throw new NotImplementedException(); }
        }

        public override string Explanation
        {
            get { throw new NotImplementedException(); }
        }

        public override string Remedy
        {
            get { throw new NotImplementedException(); }
        }

        public override string Summary
        {
            get { throw new NotImplementedException(); }
        }
    }
}
</pre>
</pre>
</div>
<p>3. Next we add our logic to the Check() method to do the actual testing. This method uses two helper functions, both included in the downloadable solution:</p>
<ul>
<li>isAnonymousEnabled: checks if the Web Application has Anonymous Access turned on.</li>
<li>isFeatureActivated: checks if the FormPagesLockDown feature is activated.</li>
</ul>
<p>The method itself stores any failing Web Application and a counter which we can use for reporting the issues.</p>
<div style="margin:0;display:inline;float:none;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:cdd30431-240b-4f92-a016-e6fdb7e1bf84" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp;">
public override SPHealthCheckStatus Check()
{
            SPHealthCheckStatus ret = SPHealthCheckStatus.Passed;
            SPFarm farm = SPFarm.Local;
            foreach (SPService service in farm.Services)
            {
                if (service is SPWebService)
                {
                    SPWebService webService = (SPWebService)service;
                    foreach (SPWebApplication webApp in webService.WebApplications)
                    {
                        if (isAnonymousEnabled(webApp))
                        {
                            foreach (SPSite site in webApp.Sites)
                            {
                                try
                                {
                                    if (!isFeatureActivated(site, new Guid(FEATUREGUID)))
                                    {
                                        //Anonymous Access is enabled on the Web Application, but the ViewFormsLockDown feature was not found.
                                        this.failingWebApplications.Add(webApp.Name, +1);
                                    }
                                }
                                finally
                                {
                                    if (site != null)
                                    {
                                        site.Dispose();
                                    }
                                }
                            }
                        }
                    }
                }
            }
            if (this.failingWebApplications.Count == 0)
            {
                ret = SPHealthCheckStatus.Passed;
            }
            else
            {
                ret = SPHealthCheckStatus.Failed;
            }
            return ret;
 }
</pre>
</pre>
</div>
<p>4. Finally implement the property “SPHealthAnalysisRuleAutomaticExecutionParameters” to enable automatic Timer Job schedules.</p>
<div style="margin:0;display:inline;float:none;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:2fce8e5c-f718-4163-89f7-f4300575a3b6" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp;">
public override SPHealthAnalysisRuleAutomaticExecutionParameters AutomaticExecutionParameters
{
            get
            {
                SPHealthAnalysisRuleAutomaticExecutionParameters retval = new SPHealthAnalysisRuleAutomaticExecutionParameters();
                retval.Schedule = SPHealthCheckSchedule.Daily;
                retval.Scope = SPHealthCheckScope.All;
                retval.ServiceType = typeof(SPTimerService);
                retval.RepairAutomatically = false;
                return retval;
            }
 }     
</pre>
</pre>
</div>
<p>5. We now could build and deploy, but we would have to register the custom Health Analyzer rules through PowerShell. This process can be automated through SharePoint’s feature framework.</p>
<div style="margin:0;display:inline;float:none;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:9edcb4ea-199c-40aa-91d6-dde8aa6ca887" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp;">
 public override void FeatureInstalled(SPFeatureReceiverProperties properties)
 {
            try
            {
                Assembly currentAssembly = Assembly.GetExecutingAssembly();
                IDictionary exceptions = SPHealthAnalyzer.RegisterRules(currentAssembly);
            }
            catch (Exception ex)
            {
                throw new Exception(&quot;There was an error registering the Health Analysis rules: &quot; + ex.Message); 
            }
}
</pre>
</pre>
</div>
<p>If we compile and deploy, we can see our rule in action.</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2012/04/2.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="2" border="0" alt="2" src="http://allthingssharepoint.files.wordpress.com/2012/04/2_thumb.png?w=565&h=142" width="565" height="142"></a></p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2012/04/image.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="image" border="0" alt="image" src="http://allthingssharepoint.files.wordpress.com/2012/04/image_thumb.png?w=317&h=270" width="317" height="270"></a></p>
<p>If you want the rule to report any errors, make sure you enable anonymous access on a Web Application and disable the (hidden) feature. Of course we should use PowerShell for this:</p>
<p><div style="margin:0;display:inline;float:none;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:50db2f08-3d59-43cf-a249-1bbbd0321852" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: powershell;">
Disable-SPFeature -Identity ViewFormPagesLockDown -Url http://public.demo.loc
</pre>
</pre>
</div>
<p>Download the complete solution <a href="https://skydrive.live.com/redir.aspx?cid=39f293cbf7e4e82e&amp;resid=39F293CBF7E4E82E!237&amp;parid=39F293CBF7E4E82E!195">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=258&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2012/04/16/custom-sharepoint-health-analyzer-rule-for-the-viewformpageslockdown-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/04/1_thumb.png" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/04/2_thumb.png" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/04/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Get SharePoint Health Score using PowerShell</title>
		<link>http://yuriburger.net/2012/04/03/get-sharepoint-health-score-using-powershell/</link>
		<comments>http://yuriburger.net/2012/04/03/get-sharepoint-health-score-using-powershell/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 20:55:14 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Health Score]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Throttling]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=245</guid>
		<description><![CDATA[If you look at the HTTP headers SharePoint 2010 adds to a response you might notice the one that is called “X-SharePointHealthScore”. This special header is used in conjunction with HTTP throttling and ranges in value from 0 to 10. By default this score is calculated using two performance counters: Memory/Available Mbytes and ASP.NET/Requests Current. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=245&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you look at the HTTP headers SharePoint 2010 adds to a response you might notice the one that is called “X-SharePointHealthScore”. This special header is used in conjunction with HTTP throttling and ranges in value from 0 to 10. </p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2012/04/headerfiddler.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="HeaderFiddler" border="0" alt="HeaderFiddler" src="http://allthingssharepoint.files.wordpress.com/2012/04/headerfiddler_thumb.png?w=407&h=122" width="407" height="122"></a></p>
<p>By default this score is calculated using two performance counters: Memory/Available Mbytes and ASP.NET/Requests Current. A value “0” indicates everything is fine, while a value of “10” indicates SharePoint will start throttling requests (if enabled). There is quite some info around explaining the workings and configuration. This blog post for instance: <a title="http://blogs.msdn.com/b/besidethepoint/archive/2010/09/13/http-request-throttling-in-sharepoint-2010.aspx" href="http://blogs.msdn.com/b/besidethepoint/archive/2010/09/13/http-request-throttling-in-sharepoint-2010.aspx">http://blogs.msdn.com/b/besidethepoint/archive/2010/09/13/http-request-throttling-in-sharepoint-2010.aspx</a> (by Josh Gavant).</p>
<p>Since this header is added to every response it can be used for different purposes, from monitoring to load balancing. I wanted to create a small “tool” to report the score without having to use a network monitor or HTTP sniffer like Fiddler. And what better way than to use PowerShell for this task?</p>
<p>The script uses a simple PowerShell function with a System.Net.WebClient object connecting to a SharePoint site and retrieving the header:</p>
<div style="margin:0;display:inline;float:none;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:9741335c-3196-48ca-a979-8e08d613c469" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: powershell; pad-line-numbers: true;">
function ReadHealthScore()
{
	param([string]$url,[System.Net.NetworkCredential]$cred=$null)
	
	$wc = New-Object Net.WebClient
	
	# Include the IE9 User Agent
	$wc.Headers.Add(&quot;user-agent&quot;, &quot;Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0;)&quot;)

	if($cred -eq $null)
	{
		$cred = [System.Net.CredentialCache]::DefaultCredentials;
	}
	$wc.credentials = $cred;
	$page = $wc.DownloadString($url);
	
	# This header holds the Health Score
	return $wc.ResponseHeaders.Item(&quot;X-SharePointHealthScore&quot;)
}
</pre>
</pre>
</div>
<p>Combined with some logic to calculate average, minimum and maximum:</p>
<div style="margin:0;display:inline;float:none;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:c5b26bb8-5dd5-493b-a3de-39ca06d313bf" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: powershell;">
# Wait in number of seconds
$wait = 1
$times = 5
$score = @()

# Set the URL to a page to avoid redirection errors
$url = &quot;http://portal.demo.loc/Pages/Default.aspx&quot;

for ($i=1; $i -lt $times+1; $i++) {
 	$score = $score + (ReadHealthScore($url))
	Write-Progress -Activity &quot;Reading HealthScore&quot; -PercentComplete (($i/$times)*100) -Status &quot;Working&quot;
  	Start-Sleep -Seconds $wait
}

$calc = $score | Measure-Object -Average -Maximum -Minimum
Write-Host (Get-Date -f o) &quot;Average:&quot;$calc.Average &quot; High:&quot;$calc.Maximum &quot; Low:&quot;$calc.Minimum
</pre>
</pre>
</div>
<p>We get the following output:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2012/04/healthscore1.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="HealthScore1" border="0" alt="HealthScore1" src="http://allthingssharepoint.files.wordpress.com/2012/04/healthscore1_thumb.png?w=535&h=143" width="535" height="143"></a></p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2012/04/healthscore2.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="HealthScore2" border="0" alt="HealthScore2" src="http://allthingssharepoint.files.wordpress.com/2012/04/healthscore2_thumb.png?w=537&h=77" width="537" height="77"></a></p>
<p>With a little modification you can output to xml or CSV. Schedule it using Task Scheduler and you will have a nice little health reporter.</p>
<p>Download the script <a href="https://skydrive.live.com/redir.aspx?cid=39f293cbf7e4e82e&amp;resid=39F293CBF7E4E82E!236&amp;parid=39F293CBF7E4E82E!195">here</a>.</p>
<p><em>Note: since this script doesn’t use any specific SharePoint cmdlets, you can use standard Windows PowerShell.</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=245&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2012/04/03/get-sharepoint-health-score-using-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/04/headerfiddler_thumb.png" medium="image">
			<media:title type="html">HeaderFiddler</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/04/healthscore1_thumb.png" medium="image">
			<media:title type="html">HealthScore1</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2012/04/healthscore2_thumb.png" medium="image">
			<media:title type="html">HealthScore2</media:title>
		</media:content>
	</item>
		<item>
		<title>Core Results Web Part with configurable Ranking Model</title>
		<link>http://yuriburger.net/2011/09/01/core-results-web-part-with-configurable-ranking-model/</link>
		<comments>http://yuriburger.net/2011/09/01/core-results-web-part-with-configurable-ranking-model/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 23:15:11 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[dotnetmag]]></category>
		<category><![CDATA[Ranking Model]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=229</guid>
		<description><![CDATA[Ranking Models are cool. If you don’t know what they can do for you, here’s a summary: SharePoint 2010 Enterprise Search uses ranking models to determine how data is weighed and results are ranked. Out of the box SharePoint 2010 provides different models, but you can also create your own. Creating your own ranking model [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=229&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ranking Models are cool. If you don’t know what they can do for you, here’s a summary:</p>
<p>SharePoint 2010 Enterprise Search uses ranking models to determine how data is weighed and results are ranked. Out of the box SharePoint 2010 provides different models, but you can also create your own. Creating your own ranking model allows you to tailor the results your query returns by:</p>
<ul>
<li>assigning different weights to metadata properties.
<li>include hits on custom managed properties in general search (as opposed to searching them through advanced search exclusively).</li>
</ul>
<p>There are several nice blogs out there that describe in detail how you can add your own custom ranking model. For instance this excellent blog post, which describes the process quite clear: <a title="http://calvisblog.wordpress.com/2010/06/21/custom-ranking-models-with-sharepoint-2010-background-value-and-administrative-overview/" href="http://calvisblog.wordpress.com/2010/06/21/custom-ranking-models-with-sharepoint-2010-background-value-and-administrative-overview/">http://calvisblog.wordpress.com/2010/06/21/custom-ranking-models-with-sharepoint-2010-background-value-and-administrative-overview/</a> (by Shaun O&#8217;Callaghan).</p>
<p>Applying your custom ranking model requires you to look up the GUID, export the standard OOB Core Results Web Part, modifying a web part property and uploading it again (see this previous <a href="http://allthingssharepoint.wordpress.com/2011/08/25/changing-sharepoint-2010-search-ranking-model/">post</a>). Now, that works of course, but I wanted a true end-user solution where you can configure the ranking model through the web part properties. Something like this:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/09/editorpart.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="EditorPart" border="0" alt="EditorPart" src="http://allthingssharepoint.files.wordpress.com/2011/09/editorpart_thumb.png?w=191&h=244" width="191" height="244"></a></p>
<h3>Extending the Core Results Web Part</h3>
<p>Note: we need to develop a SharePoint Farm Solution, because the Microsoft.SharePoint.WebPartPages.DataFormWebPart class (referenced <br />by the CoreResultsWebPart) is not available in sandbox solutions.</p>
<p>To start, we create a new web part deriving from the Core Results Web Part. The web part includes a property that allows setting the RankingModelID. It also inherits from IWebEditable needed for implementing an EditorPart (see further down).</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:2dc38e8a-ab07-44f4-925a-f358051ea929" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp; pad-line-numbers: true;">
public class EnhancedCoreResults : CoreResultsWebPart, IWebEditable
{
     [WebBrowsable(false)]
     [Personalizable(PersonalizationScope.Shared)]
     public string rankingModelID { get; set; }


 }
</pre>
</pre>
</div>
<p>I want the web part properties to show the available Ranking Models so the user can select them from a dropdown list. For this to work, we cannot use regular properties and have to implement an EditorPart. The reason for this, is that regular properties don’t allow you to dynamically load values through code behind and I don’t want to hardcode the values for the dropdown list. </p>
<p>Next, create the EditorPart:</p>
<p>The EditorPart needs to get the names and values of the available ranking models. For this to work, we need to connect to our Search Service Application and fetch the available models:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:5d3ee736-1098-4872-8fdb-fe230433690a" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp; auto-links: false;">
class EnhancedCoreResultsEditorPart:EditorPart
    {
        private DropDownList rankingModelList = new DropDownList(); 

        protected override void CreateChildControls()
        {
            base.CreateChildControls();

            RankingModelCollection rankingModels = null;

            SPServiceContext context = SPServiceContext.GetContext(SPContext.Current.Site);
            SearchServiceApplicationProxy searchApplicationProxy = context.GetDefaultProxy(typeof(SearchServiceApplicationProxy)) as SearchServiceApplicationProxy;
            SearchServiceApplicationInfo searchApplictionInfo = searchApplicationProxy.GetSearchServiceApplicationInfo();
            Guid searchApplicationID = searchApplictionInfo.SearchServiceApplicationId;
            SearchServiceApplication searchApplication = SearchService.Service.SearchApplications.GetValue&lt;SearchServiceApplication&gt;(searchApplicationID);

            Ranking ranking = new Ranking(searchApplication);
            rankingModels = ranking.RankingModels;

            foreach (RankingModel rankingModel in rankingModels)
            {
                ListItem item = new ListItem();
                item.Text = rankingModel.Name;
                item.Value = rankingModel.ID.ToString();
                rankingModelList.Items.Add(item);
            }

            this.Controls.Add(new LiteralControl(&quot;&lt;div class=\&quot;UserSectionHead\&quot;&gt;Ranking Model&lt;/div&gt;&quot;));
            this.Controls.Add(new LiteralControl(&quot;&lt;div class=\&quot;UserSectionBody\&quot;&gt;&quot;));
            this.Controls.Add(rankingModelList);
            this.Controls.Add(new LiteralControl(&quot;&lt;br/&gt;&lt;br/&gt;&lt;/div&gt;&quot;));

            this.ChildControlsCreated = true;
        }
}
</pre>
</pre>
</div>
<p>The EditorPart sets the web part RankingModelID using the value from our dropdown list.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:abf13e20-020b-4340-ae3c-a60a9445fdbf" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp;">
     public override bool ApplyChanges()
        {
            EnsureChildControls();

            EnhancedCoreResults enhancedCoreResultsWebPart = (EnhancedCoreResults)this.WebPartToEdit;
            if (enhancedCoreResultsWebPart != null)
            {
                enhancedCoreResultsWebPart.rankingModelID = rankingModelList.SelectedValue; 
            }
            else
            {
                return false;
            }
            return true;
        }

        public override void SyncChanges()
        {
            EnsureChildControls();

            EnhancedCoreResults enhancedCoreResultsWebPart = (EnhancedCoreResults)this.WebPartToEdit;
            if (enhancedCoreResultsWebPart != null)
            {
                rankingModelList.SelectedValue = enhancedCoreResultsWebPart.rankingModelID;
            }
        }
</pre>
</pre>
</div>
<p>Wire up the EditorPart in our custom Core Results class:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:89ab8e3f-5ceb-4967-8ad3-6ff637c2f912" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp;">
        EditorPartCollection IWebEditable.CreateEditorParts()
        {
            List&lt;EditorPart&gt; editors = new List&lt;EditorPart&gt;();
            EnhancedCoreResultsEditorPart editorPart = new EnhancedCoreResultsEditorPart();
            editorPart.ID = &quot;EnhancedCoreResults_editorPart&quot;;
            editors.Add(editorPart);
            return new EditorPartCollection(editors);
        }

        object IWebEditable.WebBrowsableObject
        {
            get { return this; }
        }
</pre>
</pre>
</div>
<p>Create the logic that actually sets the RankingModelID by overriding the ConfigureDataSourceProperties() method:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:3cf9ed73-c443-4039-afa9-0cbcaac9636a" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: csharp;">
     protected override void ConfigureDataSourceProperties()
        {
            if (this.ShowSearchResults)
            {
                base.ConfigureDataSourceProperties();

                if (!string.IsNullOrEmpty(rankingModelID))
                {
                    CoreResultsDatasource dataSource = this.DataSource as CoreResultsDatasource;
                    dataSource.RankingModelID = rankingModelID;
                }
            }

        }
</pre>
</pre>
</div>
<p>Note: I found several articles on the web showing similar functionality by overriding the GetXPathNavigator() method and setting the ranking model through the SharedQueryManager instance. Somehow I couldn’t get this to work the way I wanted to so I decided to do it differently.</p>
<p>That’s it, build, package and deploy.</p>
<p>You can download the Visual Studio solution <a href="https://skydrive.live.com/?cid=39f293cbf7e4e82e&amp;sc=documents&amp;uc=1&amp;id=39F293CBF7E4E82E%21195#">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=229&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2011/09/01/core-results-web-part-with-configurable-ranking-model/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/09/editorpart_thumb.png" medium="image">
			<media:title type="html">EditorPart</media:title>
		</media:content>
	</item>
		<item>
		<title>Output Escaping Rich Text in a Content Query Web Part</title>
		<link>http://yuriburger.net/2011/08/25/output-escaping-rich-text-in-a-content-query-web-part/</link>
		<comments>http://yuriburger.net/2011/08/25/output-escaping-rich-text-in-a-content-query-web-part/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 16:00:23 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Content Query Web Part]]></category>
		<category><![CDATA[escape]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[output]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/2011/08/25/output-escaping-rich-text-in-a-content-query-web-part/</guid>
		<description><![CDATA[If you use a SharePoint (2010) Content Query Web Part to display content from a rich text field, you will end up with escaped HTML. Because it is escaped it is rendered as content on your page, probably not what you would want. To fix this, you need to edit the ItemStyle.xsl (preferably a custom [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=215&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you use a SharePoint (2010) Content Query Web Part to display content from a rich text field, you will end up with escaped HTML. Because it is escaped it is rendered as content on your page, probably not what you would want.</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/08/11.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="1" border="0" alt="1" src="http://allthingssharepoint.files.wordpress.com/2011/08/1_thumb1.png?w=560&h=106" width="560" height="106"></a></p>
<p>To fix this, you need to edit the ItemStyle.xsl (preferably a custom one, see this <a href="http://allthingssharepoint.wordpress.com/2011/07/10/code-easy-modifications-for-sharepoint-2010-part-2-the-custom-content-query-web-part-item-style/">post</a>). You would just have to add the following command to the part outputting the HTML:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:66e29dca-d5e1-48ba-81f7-b97c99199ec8" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: xml;">
&lt;xsl:value-of disable-output-escaping=&quot;yes&quot; select=&quot;$blah&quot;/&gt;
</pre>
</pre>
</div>
<p>One other thing to watch out for, is when creating summary descriptions from these rich text fields. Say you have this text:</p>
<p>&lt;h1 class=&#8221;ms-rteElement-H1&#8243;&gt;Cras porta pharetra magna eget consectetur. &lt;/h1&gt; &lt;p class=&#8221;ms-rteElement-H1&#8243;&gt; &lt;/p&gt; &lt;p&gt;Etiam eget nibh eu libero dictum congue. Etiam tempor auctor lectus, at porta dolor molestie vitae.&lt;/p&gt;</p>
<p>And you want to create a summary of 150 characters with a “Read More” link. You would cut off the output rendering and potentially leave open HTML tags! And that could really screw up the user experience. So another option would be to strip all html from your output. This way you will loose the rich text markup (H1, bolds and so on), but ensure valid html output.</p>
<p>To accomplish this, you would also need to edit the ItemStyle.xsl (again preferably a custom one) and include some kind of HTML stripping function.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:e279caa6-00d5-41fc-8b11-b8bb11cc2924" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: xml;">
&lt;xsl:template name=&quot;Functions.RemoveHtml&quot;&gt;
    &lt;xsl:param name=&quot;String&quot;/&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test=&quot;contains($String, '&amp;lt;')&quot;&gt;
        &lt;xsl:value-of select=&quot;substring-before($String, '&amp;lt;')&quot;/&gt;
        &lt;xsl:call-template name=&quot;Functions.RemoveHtml&quot;&gt;
          &lt;xsl:with-param name=&quot;String&quot;
            select=&quot;substring-after($String, '&amp;gt;')&quot;/&gt;
        &lt;/xsl:call-template&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:value-of select=&quot;$String&quot;/&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;
</pre>
</pre>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/215/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=215&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2011/08/25/output-escaping-rich-text-in-a-content-query-web-part/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/08/1_thumb1.png" medium="image">
			<media:title type="html">1</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing SharePoint 2010 Search Ranking Model</title>
		<link>http://yuriburger.net/2011/08/25/changing-sharepoint-2010-search-ranking-model/</link>
		<comments>http://yuriburger.net/2011/08/25/changing-sharepoint-2010-search-ranking-model/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 10:51:43 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Search]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[Configuring]]></category>
		<category><![CDATA[Ranking Model]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/2011/08/25/changing-sharepoint-2010-search-ranking-model/</guid>
		<description><![CDATA[SharePoint 2010 Enterprise Search uses ranking models to determine how data is weighed and results are ranked. Out of the box SharePoint 2010 provides nine different models, from which two are used by default. You also have the option to create your own if this is required. To see which models are registered with your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=212&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SharePoint 2010 Enterprise Search uses ranking models to determine how data is weighed and results are ranked. Out of the box SharePoint 2010 provides nine different models, from which two are used by default. You also have the option to create your own if this is required. To see which models are registered with your Search Service Application, you can use the following PowerShell Command:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:fead5ab1-a5cb-4c5c-8d9b-1226bb46c771" class="wlWriterEditableSmartContent">
<pre style="white-space:normal;">
<pre class="brush: powershell; pad-line-numbers: true;">
 Get-SPEnterpriseSearchRankingModel -SearchApplication &quot;Search
 Service Application&quot;
</pre>
</pre>
</div>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/08/1.png"><img style="background-image:none;border-bottom:0;border-left:0;padding-left:0;padding-right:0;display:inline;border-top:0;border-right:0;padding-top:0;" title="1" border="0" alt="1" src="http://allthingssharepoint.files.wordpress.com/2011/08/1_thumb.png?w=466&h=123" width="466" height="123"></a></p>
<p>The default Core Results Web Part uses the MainResultsDefaultRankingModel and the People Results Web Part uses the MainPeopleModel. To try the different models, you can just append the search results querystring with &amp;rm=&lt;guid&gt;</p>
<p>So …/Pages/peopleresults.aspx?k=john&amp;s=People&amp;rm=0bba4d7d-4f2c-4086-975a-8f9d2b6c6d53 would return people results using the NameModel.</p>
<p>If you want to permanently alter the used ranking model, you have to adjust the Results Web Part. Follow these steps to modify the normal search:</p>
<ol>
<li>Export the Core Results Web Part.</li>
<li>Add or modify the following property, for instance:<br />&lt;property name=&#8221;DefaultRankingModelID&#8221; type=&#8221;string&#8221;&gt;0bba4d7d-4f2c-4086-975a-8f9d2b6c6d53&lt;/property&gt;.</li>
<li>Import and re-add the web part.</li>
</ol>
<p>For people search, this unfortunately does not work very well. The People Core Results Web Part will reset your DefaultRankingModelID back to use the MainPeopleModel once you upload your web part. Just add a (hidden) Core Results Web Part to your page and configure the property that way.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/212/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/212/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/212/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=212&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2011/08/25/changing-sharepoint-2010-search-ranking-model/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/08/1_thumb.png" medium="image">
			<media:title type="html">1</media:title>
		</media:content>
	</item>
		<item>
		<title>Speed up SharePoint 2010 development</title>
		<link>http://yuriburger.net/2011/07/19/speed-up-sharepoint-2010-development/</link>
		<comments>http://yuriburger.net/2011/07/19/speed-up-sharepoint-2010-development/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 20:07:14 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[dotnetmag]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=204</guid>
		<description><![CDATA[SharePoint Development tends to be a wee bit more time consuming compared to “standard” ASP.NET development. Although Microsoft really helped us a lot by providing seriously improved integration with Visual Studio 2010, building, packaging, deploying and debugging can still be annoyingly slow. Here are a couple of things you could do to speed things up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=204&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>SharePoint Development tends to be a wee bit more time consuming compared to “standard” ASP.NET development. Although Microsoft really helped us a lot by providing seriously improved integration with Visual Studio 2010, building, packaging, deploying and debugging can still be annoyingly slow.</p>
<p>Here are a couple of things you could do to speed things up a bit.</p>
<h3>1. Fast hardware</h3>
<p>Of course the most important part. Be sure to have a lot of RAM in your development machine, at least 4 GB. With the 64-bit OS requirement for SharePoint 2010 we can address more than 3 GB so make sure it is available. Even current generation laptops can handle 8 GB of RAM, no excuses anymore (apart from budget that is).</p>
<p>Because you probably run all required software on one machine, fast disks are equally important. This component improves the overall experience, but MSSQL Server benefits the most. If you are running virtuals, you can go for fast external disks using eSata (or maybe USB 3.0). If you are more like me (and don’t like the external disk hassle) be sure to examine the disk specs when shopping for new hardware.</p>
<h3>2. The right OS</h3>
<p>I tried running Windows 7 Ultimate with SharePoint 2010 installed locally. Yes it works, but it is still a desktop OS. And you really can’t run things like domain controllers and stuff like that locally. If you really want things to go fast, you boot a regular server OS, say Windows Server 2008 R2. It handles server software far better than any desktop OS. And if you can, just install all needed components on one server (i.e. MSSQL Server, SharePoint 2010, Visual Studio, Office, Domain Controller, DNS, etc.). And Windows 7 VHD boot makes dual booting a breeze!</p>
<p>If you do need more than one server, think about installing Windows Server 2008 R2 with the Hyper-V role. And run your servers on top of that! You will probably need at least 8GB (host + 2 guests), but will give you ultimate flexibility.</p>
<h3> </h3>
<h3>3. Tweak your OS and server software</h3>
<p>Same old story:</p>
<ul>
<li>Don’t run unneeded services or components. No, you don’t need Adobe Auto Updater or the Windows Media Player Online Subscription blah blah. Check the Windows Services and registry “run” keys.</li>
<li>If you run MSSQL Server (and you probably do), be sure to maximize its memory to a value you consider adequate. This way, it won’t hog up your machine. Also if you have more than one disk, store the “tempdb” on a different disk than the content or configuration database. Other “production” performance tweaks also apply of course.</li>
<li>Regarding SharePoint IIS configuration, I normally run most parts on the same Application Pool. This saves valuable memory, but makes recycling take a bit longer. If you run many Web Applications but only develop in one, dedicate one AppPool to your development application and share the rest.</li>
<li>Keep your content databases lean. There is normally no need to develop against a 50+ GB database. Just use a default empty one or with limited content. You can of course switch later on if you need to test your solution.</li>
</ul>
<h3> </h3>
<h3>4. Be smart</h3>
<p>When deploying and debugging SharePoint solutions, Application Pool recycles are a pain! Be smart when laying out your Visual Studio projects and decide which parts must be farm solutions and which parts sandbox solutions. Remember: farm solutions require a IIS recycle where as sandbox solutions do not (see earlier <a href="http://allthingssharepoint.wordpress.com/2011/06/03/to-sandbox-or-not-to-sandbox/">post</a> about Sandbox solutions). You can always merge them later when heading towards production state.</p>
<p>If you are developing loads of Web Parts or User Controls (used by Visual Web Parts), there is another thing you could do. Since most of them are plain ASP.NET components, you can stick them on a simple ASPX page and develop them using IIS. Especially handy during the early stages and you can add them to your SharePoint project when they need a SharePoint environment.</p>
<h3>5. Time savers</h3>
<p>You probably already have the “CKS: Development Tools Edition” installed. If not, please do. They also contain several time savers regarding deployment, like Quick Deploy, Copy Assemblies and Copy Files. There is even a feature that warms up your site after a IIS recycle!</p>
<p>You probably have other tricks up your sleeve, but I thought I’d share mine.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/204/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/204/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/204/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=204&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2011/07/19/speed-up-sharepoint-2010-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Code-easy&#8221; modifications for SharePoint 2010: Part 2, the custom Content Query Web Part Item Style</title>
		<link>http://yuriburger.net/2011/07/10/code-easy-modifications-for-sharepoint-2010-part-2-the-custom-content-query-web-part-item-style/</link>
		<comments>http://yuriburger.net/2011/07/10/code-easy-modifications-for-sharepoint-2010-part-2-the-custom-content-query-web-part-item-style/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 14:55:24 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=196</guid>
		<description><![CDATA[I always wanted to do a series about easy to build, real life customer requests for SharePoint modifications. And as with most ideas, never really found the time to do it. Well, now’s as good a time as any! Other parts: Part 1, the Validating Email Field. So here is part 2, the custom Content [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=196&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I always wanted to do a series about easy to build, real life customer requests for SharePoint modifications. And as with most ideas, never really found the time to do it. Well, now’s as good a time as any!</p>
<p>Other parts:</p>
<ul>
<li><a href="http://allthingssharepoint.wordpress.com/2011/05/30/code-easy-modifications-for-sharepoint-2010-part-1-the-validating-email-field/">Part 1, the Validating Email Field.</a></li>
</ul>
<p>So here is part 2, the custom Content Query Web Part Item Style</p>
<p>Aaahh, the Content Query Web Part, or CQWP for short. The Swiss Army Knife no real SharePoint solution architect can do without. If you are not familiar with the Content Query Web Part in SharePoint, here is a small introduction. I won’t go in depth on all the different advanced options you might have configuring the CQWP, because there are lots of good articles about that out there. I do focus on how you would package and deploy such a customization using Visual Studio 2010.</p>
<h3>Introduction</h3>
<p>The Content Query Web Part (CQWP) was first introduced in SharePoint MOSS 2007. It allows for querying and presenting SharePoint data in a very flexible and customizable way and is considered one of the most important Web Parts in SharePoint. It can roll up SharePoint items:</p>
<ul>
<li>Throughout your site collection.</li>
<li>In one specific site and all of its sub sites.</li>
<li>In one specific list.</li>
</ul>
<p>As an example, say you want to do an aggregation (“roll up”) of all news articles from your news site and show the latest 3 with a thumbnail image on your home page? Easy with the help of the CQWP:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="1" src="http://allthingssharepoint.files.wordpress.com/2011/07/1_thumb.png?w=244&h=167" alt="1" width="244" height="167" border="0" /></a></p>
<p>You start with configuring the CQWP through the settings in the Web Part toolbox.</p>
<table width="400" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="133"><a href="http://allthingssharepoint.files.wordpress.com/2011/07/2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="2" src="http://allthingssharepoint.files.wordpress.com/2011/07/2_thumb.png?w=191&h=221" alt="2" width="191" height="221" border="0" /></a></td>
<td valign="top" width="133"><a href="http://allthingssharepoint.files.wordpress.com/2011/07/3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="3" src="http://allthingssharepoint.files.wordpress.com/2011/07/3_thumb.png?w=168&h=244" alt="3" width="168" height="244" border="0" /></a></td>
<td valign="top" width="133"><a href="http://allthingssharepoint.files.wordpress.com/2011/07/4.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="4" src="http://allthingssharepoint.files.wordpress.com/2011/07/4_thumb.png?w=182&h=114" alt="4" width="182" height="114" border="0" /></a></td>
</tr>
</tbody>
</table>
<p>The Query part determines where you will get your items from:</p>
<ul>
<li>Source: the scope of the query.</li>
<li>List Type: choose the list type your items are in. In this case we pick Pages Library because our news articles are based on Publishing Pages stored in the default Pages library.</li>
<li>Content Type: we only want to return Article Pages and not Web Part pages.</li>
</ul>
<p>The Presentation part determines how the items will be presented on the page:</p>
<ul>
<li>Grouping and Sorting: speaks for itself. We pick 3 items, sorted by Article Date Descending.</li>
<li>Styles: the group style is used when we group the items and is not used in this example. The Item style is the most interesting part and controls how the items are rendered. There are several options, so be sure to check them all out. For now we pick the default “Image on left”.</li>
</ul>
<p>Fields to display:</p>
<p>This part is a new feature of the CQWP in SharePoint 2010. These fields are called “Slots” and are used to bind item fields to XSL properties. Every item style template can have its own set of configurable fields.</p>
<h3>Customization</h3>
<p>This post is about configuring and customizing the CQWP if you are not *that* happy with the standard behavior of the available Item Styles. My most requested style for instance, is not available out of the box:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/15.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="15" src="http://allthingssharepoint.files.wordpress.com/2011/07/15_thumb.png?w=244&h=108" alt="15" width="244" height="108" border="0" /></a></p>
<ul>
<li>the title on top</li>
<li>the image on the left, just beneath the title</li>
<li>the byline to the right of the image</li>
<li>the first 200 characters of the article content, beneath the byline</li>
<li>a read more link</li>
</ul>
<p>The standard CQWP gets its configuration from files in the Site Collection Style Library. These files are shared among all default Content Query Web Parts in your site. Let’s take a closer look at these files and the best way to do this is using SharePoint Designer. Just open up your site and navigate to the All Files section. Here you will find the Style Library with the XSL Style Sheets:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/5.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="5" src="http://allthingssharepoint.files.wordpress.com/2011/07/5_thumb.png?w=244&h=80" alt="5" width="244" height="80" border="0" /></a></p>
<p>The file we are interested in is the ItemStyle.xsl. If you take a peek at the contents of this file, you will find several &lt;xsl:template&gt; elements which correspond to the different Style options you see configuring the CQWP. The names of the template should mostly speak for themselves. One exception, the “Image Left” is called “Default”.</p>
<p><strong>Important:</strong>If you are not familiar with XSL you might want to read up on the subject. We keep our customization fairly simple, so you will just need a basic understanding.</p>
<p>We could of course modify the OOTB file using SharePoint Designer and create our customization that way. And that is a perfectly supported scenario, but with three major downsides:</p>
<ul>
<li>This is an OOTB file and if it is modified it is saved to the content database. If someone chooses to reset it to the site definition all your changes would be lost.</li>
<li>Coexistence with other applications could be hard since you would have to share the default ItemStyle.xsl among them.</li>
<li>If you mess up the default ItemStyle.xsl it could affect other Content Query Web Parts in the Site Collection.</li>
</ul>
<p>So the best way around these issues is to supply our own style sheet with our Web Part.</p>
<p>To start, create a Visual Studio 2010 Empty SharePoint solution. Since we don’t have an assembly that needs Full Trust (see my earlier post about Sandbox solutions), we select a sandboxed solution.</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/8.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="8" src="http://allthingssharepoint.files.wordpress.com/2011/07/8_thumb.png?w=244&h=194" alt="8" width="244" height="194" border="0" /></a></p>
<p>Add a SharePoint module:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/9.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="9" src="http://allthingssharepoint.files.wordpress.com/2011/07/9_thumb.png?w=244&h=170" alt="9" width="244" height="170" border="0" /></a></p>
<p>After the module is added to the project, delete the Sample.txt</p>
<p>Next we add the XSLT Style Sheet: Add New Item/ Data / Style Sheet. Remember to give it a .xsl extension instead of .xslt to be in line with OOTB SharePoint files.</p>
<p>Your Solution should now look like this:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/10.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="10" src="http://allthingssharepoint.files.wordpress.com/2011/07/10_thumb.png?w=173&h=244" alt="10" width="173" height="244" border="0" /></a></p>
<p>My next step is to copy the content of the OOTB file in my new file to start off with.</p>
<p>Open the default file in SharePoint Designer and answer “No” to the question if you want to check the file out (see downside no. 1). Copy and Paste the contents in your new file in Visual Studio, clearing the current contents of the file.</p>
<p>You now effectively made a copy of the OOTB file and are ready to create your own rendering template (the actual CQWP Item Style customization).</p>
<p>To give yourself a head start, it is easiest to copy a similar one. In this case that would be “Image Left”, which is called “Default” in the ItemStyle.xsl. Just copy and paste the complete template (everything between and including the &lt;xsl:template name=&#8221;Default&#8221; match=&#8221;*&#8221; mode=&#8221;itemstyle&#8221;&gt; and &lt;/xsl:template&gt; tags).</p>
<p>Rename our template to something like “ImageWithArticleContent” and replace the wildcard match (“*”) with our specific style.</p>
<p>&lt;xsl:template name=&#8221;ImageWithArticleContent&#8221; match=&#8221;Row[@Style='ImageWithArticleContent']&#8221; mode=&#8221;itemstyle&#8221;&gt;</p>
<p>The next step is to reorganize the template to match our requested design. Basically it just starts with the title and the image and finally the Byline (“description”). We then add a new property “Content” and display the first 200 characters and the Read More link. Because we add a property a new slot will be created in the CQWP toolbox as we’ll see later.</p>
<p>&nbsp;</p>
<p><pre class="brush: xml;">
&lt;xsl:template name=&quot;ImageWithArticleContent&quot; match=&quot;Row[@Style='ImageWithArticleContent']&quot; mode=&quot;itemstyle&quot;&gt;
    &lt;xsl:variable name=&quot;SafeLinkUrl&quot;&gt;
      &lt;xsl:call-template name=&quot;OuterTemplate.GetSafeLink&quot;&gt;
        &lt;xsl:with-param name=&quot;UrlColumnName&quot; select=&quot;'LinkUrl'&quot;/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:variable&gt;
    &lt;xsl:variable name=&quot;SafeImageUrl&quot;&gt;
      &lt;xsl:call-template name=&quot;OuterTemplate.GetSafeStaticUrl&quot;&gt;
        &lt;xsl:with-param name=&quot;UrlColumnName&quot; select=&quot;'ImageUrl'&quot;/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:variable&gt;
    &lt;xsl:variable name=&quot;DisplayTitle&quot;&gt;
      &lt;xsl:call-template name=&quot;OuterTemplate.GetTitle&quot;&gt;
        &lt;xsl:with-param name=&quot;Title&quot; select=&quot;@Title&quot;/&gt;
        &lt;xsl:with-param name=&quot;UrlColumnName&quot; select=&quot;'LinkUrl'&quot;/&gt;
      &lt;/xsl:call-template&gt;
    &lt;/xsl:variable&gt;
    &lt;div class=&quot;item&quot;&gt;
      &lt;div class=&quot;link-item&quot;&gt;
        &lt;xsl:call-template name=&quot;OuterTemplate.CallPresenceStatusIconTemplate&quot;/&gt;
        &lt;a href=&quot;{$SafeLinkUrl}&quot; title=&quot;{@LinkToolTip}&quot;&gt;
          &lt;xsl:if test=&quot;$ItemsHaveStreams = 'True'&quot;&gt;
            &lt;xsl:attribute name=&quot;onclick&quot;&gt;
              &lt;xsl:value-of select=&quot;@OnClickForWebRendering&quot;/&gt;
            &lt;/xsl:attribute&gt;
          &lt;/xsl:if&gt;
          &lt;xsl:if test=&quot;$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'&quot;&gt;
            &lt;xsl:attribute name=&quot;onclick&quot;&gt;
              &lt;xsl:value-of disable-output-escaping=&quot;yes&quot; select=&quot;$OnClickTargetAttribute&quot;/&gt;
            &lt;/xsl:attribute&gt;
          &lt;/xsl:if&gt;
          &lt;xsl:value-of select=&quot;$DisplayTitle&quot;/&gt;
        &lt;/a&gt;
      &lt;/div&gt;
      &lt;xsl:if test=&quot;string-length($SafeImageUrl) != 0&quot;&gt;
        &lt;div class=&quot;image-area-left&quot;&gt;
          &lt;a href=&quot;{$SafeLinkUrl}&quot;&gt;
            &lt;xsl:if test=&quot;$ItemsHaveStreams = 'True'&quot;&gt;
              &lt;xsl:attribute name=&quot;onclick&quot;&gt;
                &lt;xsl:value-of select=&quot;@OnClickForWebRendering&quot;/&gt;
              &lt;/xsl:attribute&gt;
            &lt;/xsl:if&gt;
            &lt;xsl:if test=&quot;$ItemsHaveStreams != 'True' and @OpenInNewWindow = 'True'&quot;&gt;
              &lt;xsl:attribute name=&quot;onclick&quot;&gt;
                &lt;xsl:value-of disable-output-escaping=&quot;yes&quot; select=&quot;$OnClickTargetAttribute&quot;/&gt;
              &lt;/xsl:attribute&gt;
            &lt;/xsl:if&gt;
            &lt;img class=&quot;image&quot; src=&quot;{$SafeImageUrl}&quot; title=&quot;{@ImageUrlAltText}&quot;&gt;
              &lt;xsl:if test=&quot;$ImageWidth != ''&quot;&gt;
                &lt;xsl:attribute name=&quot;width&quot;&gt;
                  &lt;xsl:value-of select=&quot;$ImageWidth&quot; /&gt;
                &lt;/xsl:attribute&gt;
              &lt;/xsl:if&gt;
              &lt;xsl:if test=&quot;$ImageHeight != ''&quot;&gt;
                &lt;xsl:attribute name=&quot;height&quot;&gt;
                  &lt;xsl:value-of select=&quot;$ImageHeight&quot; /&gt;
                &lt;/xsl:attribute&gt;
              &lt;/xsl:if&gt;
            &lt;/img&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;/xsl:if&gt;
      &lt;div class=&quot;description&quot;&gt;
        &lt;xsl:value-of select=&quot;@Description&quot; /&gt;
      &lt;/div&gt;
      &lt;div class=&quot;content&quot;&gt;
        &lt;xsl:value-of select=&quot;substring(@Content, 0, 200)&quot; disable-output-escaping=&quot;yes&quot;/&gt;
        &lt;a href=&quot;{$SafeLinkUrl}&quot;&gt;...Read More&lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/xsl:template&gt;
  </pre></p>
<p>Important: Because we are cutting off the output rendering we potentially leave open HTML tags! See this <a href="http://allthingssharepoint.wordpress.com/2011/08/25/output-escaping-rich-text-in-a-content-query-web-part/">post </a>about a solution.</p>
<p>Unfortunately, there is no SharePoint GUI way to link our custom Item Style to the Content Query Web Part. The way around this, is to deploy a pre-configured Web Part file with our solution.</p>
<p>Add a Web Part to our project:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/12.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="12" src="http://allthingssharepoint.files.wordpress.com/2011/07/12_thumb.png?w=244&h=170" alt="12" width="244" height="170" border="0" /></a></p>
<p>Delete the Web Part class file, since we are only interested in the .webpart file.</p>
<p>Add an empty (unconfigured) CQWP to your SharePoint Page and export this Web Part.</p>
<p>Open the exported file in notepad or Visual Studio and copy the contents.</p>
<p>Paste this in the .webpart file in our Visual Studio project.</p>
<ul>
<li>Set the Title and Description to the required values.</li>
<li>Set the ItemLimit to 3</li>
</ul>
<p>Modify the ItemXslLink property to link our custom style sheet:</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:7e7069c8-0ec8-4a7e-bf93-1ead854f1f46" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;"><pre class="brush: xml;">
&lt;property name=&quot;ItemXslLink&quot; type=&quot;string&quot; &gt;/Style%20Library/Xsl/CustomItemStyle.xsl&lt;/property&gt;
</pre></p>
</div>
<p>Modify the ItemStyle property to match our custom style:</p>
<div id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:9d8e8c1d-af77-4362-aa7d-96e3762c793a" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;"><pre class="brush: xml;">
&lt;property name=&quot;ItemStyle&quot; type=&quot;string&quot;&gt;ImageWithArticleContent&lt;/property&gt;
</pre></p>
</div>
<p>Save the file.</p>
<p><strong>Important:</strong> since our solution doesn’t need an assembly, we need to exclude it from the package. Select your project and set the “Include Assembly In Package” to false.</p>
<p>We can now deploy our solution and test our work.</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/13.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="13" src="http://allthingssharepoint.files.wordpress.com/2011/07/13_thumb.png?w=244&h=62" alt="13" width="244" height="62" border="0" /></a></p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/07/14.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="14" src="http://allthingssharepoint.files.wordpress.com/2011/07/14_thumb.png?w=244&h=129" alt="14" width="244" height="129" border="0" /></a></p>
<p>You can download the Visual Studio 2010 solution <a href="https://skydrive.live.com/?cid=39f293cbf7e4e82e&amp;sc=documents&amp;uc=1&amp;id=39F293CBF7E4E82E%21195#">here</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=196&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2011/07/10/code-easy-modifications-for-sharepoint-2010-part-2-the-custom-content-query-web-part-item-style/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/1_thumb.png" medium="image">
			<media:title type="html">1</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/2_thumb.png" medium="image">
			<media:title type="html">2</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/3_thumb.png" medium="image">
			<media:title type="html">3</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/4_thumb.png" medium="image">
			<media:title type="html">4</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/15_thumb.png" medium="image">
			<media:title type="html">15</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/5_thumb.png" medium="image">
			<media:title type="html">5</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/8_thumb.png" medium="image">
			<media:title type="html">8</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/9_thumb.png" medium="image">
			<media:title type="html">9</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/10_thumb.png" medium="image">
			<media:title type="html">10</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/12_thumb.png" medium="image">
			<media:title type="html">12</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/13_thumb.png" medium="image">
			<media:title type="html">13</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/07/14_thumb.png" medium="image">
			<media:title type="html">14</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio 2010: Sandbox Deployment Errors</title>
		<link>http://yuriburger.net/2011/06/15/visual-studio-2010-sandbox-deployment-errors-2/</link>
		<comments>http://yuriburger.net/2011/06/15/visual-studio-2010-sandbox-deployment-errors-2/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 14:39:31 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=167</guid>
		<description><![CDATA[So you created a nice Sandbox SharePoint solution and need to deploy it. You entered the correct Site URL and hit deploy. Unfortunately the output shows  a failed deployment step: Couple of deployment errors Visual Studio might throw at you at this stage: Error occurred in deployment step &#8216;Activate Features&#8217;: Cannot start service SPUserCodeV4 on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=167&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So you created a nice Sandbox SharePoint solution and need to deploy it. You entered the correct Site URL and hit deploy. Unfortunately the output shows  a failed deployment step:</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/06/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="image" src="http://allthingssharepoint.files.wordpress.com/2011/06/image_thumb.png?w=619&h=50" alt="image" width="619" height="50" border="0" /></a></p>
<p>Couple of deployment errors Visual Studio might throw at you at this stage:</p>
<table width="400" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="208">Error occurred in deployment step &#8216;Activate Features&#8217;: <strong>Cannot start service SPUserCodeV4</strong> on computer &lt;name&gt;.</td>
<td valign="top" width="192">Check if the Windows Service is not disabled: “SharePoint 2010 User Code Host”. Better yet, set it to “Automatic” on your development machine.</td>
</tr>
<tr>
<td valign="top" width="208">Error occurred in deployment step &#8216;Activate Features&#8217;: This feature cannot be activated at this time. <strong>The contents of the feature&#8217;s solution requires the Solution Sandbox service to be running</strong>.</td>
<td valign="top" width="192">Your development environment should have at least one server running the “Microsoft SharePoint Foundation Sandboxed Code Service “. Check in Central Administration/ Services on Server.</td>
</tr>
<tr>
<td valign="top" width="208">Error occurred in deployment step &#8216;Add Solution&#8217;: <strong>Sandboxed code execution request failed</strong>.</td>
<td valign="top" width="192">This could have a couple of reasons, but the one I encounter the most is lack of rights. I normally enable “god-mode” on my dev machines (see below).</td>
</tr>
<tr>
<td valign="top" width="208">Error occurred in deployment step &#8216;Activate Features&#8217;: <strong>Attempted to perform an unauthorized operation.</strong></td>
<td valign="top" width="192">If you are running in “god-mode” this shouldn’t happen. Just make sure you are Site Collection Administrator.</td>
</tr>
</tbody>
</table>
<p>This list is by no means complete and I will extend it as I encounter other issues, hopefully not too many <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<h3>Running in “God-mode”</h3>
<p>Important: Not recommended in production environments. Since you are deploying with Visual Studio, this is obviously not the case.</p>
<p>Update 1: if you are a local admin on your dev box (and most of us are), make sure you test your solutions using lesser priviliged accounts!</p>
<p>To enable easy access on your development machine, make sure the following is true</p>
<ul>
<li>Disable User Account Control (in Windows 2008 R2 this means lowering the setting to “Never notify”).</li>
</ul>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/06/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:0;" title="image" src="http://allthingssharepoint.files.wordpress.com/2011/06/image_thumb1.png?w=244&h=143" alt="image" width="244" height="143" border="0" /></a></p>
<ul>
<li>Microsoft Visual Studio runs as Administrator (see title bar).</li>
</ul>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/06/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;margin:0;" title="image" src="http://allthingssharepoint.files.wordpress.com/2011/06/image_thumb2.png?w=244&h=38" alt="image" width="244" height="38" border="0" /></a></p>
<ul>
<li>You are a member of the local Administrators group</li>
<li>You are a member of the local WSS_ADMIN_WPG group</li>
<li>You are database owner (dbo) of both content databases and the SharePoint_Config database</li>
<li>You are Farm Administrator</li>
<li>You are Site Collection Administrator</li>
</ul>
<p>Update 2: this post needs revising, since this can be done with fewer permissions than mentioned here.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/167/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/167/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/167/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=167&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2011/06/15/visual-studio-2010-sandbox-deployment-errors-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/06/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/06/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/06/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>To Sandbox or not to sandbox?</title>
		<link>http://yuriburger.net/2011/06/03/to-sandbox-or-not-to-sandbox/</link>
		<comments>http://yuriburger.net/2011/06/03/to-sandbox-or-not-to-sandbox/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 15:50:30 +0000</pubDate>
		<dc:creator>yuriburger</dc:creator>
				<category><![CDATA[Custom Development]]></category>
		<category><![CDATA[dotnetmag]]></category>
		<category><![CDATA[Sandbox]]></category>
		<category><![CDATA[Sandboxed solutions]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">https://allthingssharepoint.wordpress.com/?p=123</guid>
		<description><![CDATA[Microsoft SharePoint (Foundation) 2010 introduced the concept of running sandboxed code. This code can be deployed using WSP solutions, but the difference is it can be uploaded by authorized users at the Site Collection. Sandbox solutions run in a limited SharePoint Execution context and farm administrators can monitor and manage those solutions. Because of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=123&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Microsoft SharePoint (Foundation) 2010 introduced the concept of running sandboxed code. This code can be deployed using WSP solutions, but the difference is it can be uploaded by authorized users at the Site Collection. Sandbox solutions run in a limited SharePoint Execution context and farm administrators can monitor and manage those solutions.</p>
<p>Because of the limited context, only a subset of the SharePoint Server Object Model is available. To quickly figure out, if a Sandboxed solution is possible (or even required), I created a small chart. The chart and information is not even close to complete and I will probably update these regularly.</p>
<p>For extensive information about the Sandbox in SharePoint 2010: <a title="http://msdn.microsoft.com/en-us/magazine/ee335711.aspx" href="http://msdn.microsoft.com/en-us/magazine/ee335711.aspx">http://msdn.microsoft.com/en-us/magazine/ee335711.aspx</a></p>
<p>Oh, one more thing: Microsoft recommends Sandbox Solutions by default. So only use those Farm solutions if you really need to.</p>
<p><a href="http://allthingssharepoint.files.wordpress.com/2011/05/sharepoint-2010-design-chart1.png"><img style="display:inline;" title="SharePoint 2010 design chart" src="http://allthingssharepoint.files.wordpress.com/2011/05/sharepoint-2010-design-chart_thumb1.png?w=642&h=460" alt="SharePoint 2010 design chart" width="642" height="460" /></a></p>
<p>The following Microsoft.SharePoint subset <strong>can</strong> be used with sandboxed solutions:</p>
<table width="554" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="200">Namespace   </td>
<td valign="top" width="352">Remark</td>
</tr>
<tr>
<td valign="top" width="200">Microsoft.SharePoint</td>
<td valign="top" width="352">All, except SPSite constructor, SPSecurity, SPWorkItem and SPWorkItemCollection, SPAlertCollection.Add, SPAlertTemplateCollection.Add, SPUserSolution and SPUserSolutionCollection, SPTransformUtilities</td>
</tr>
<tr>
<td valign="top" width="200">Microsoft.SharePoint.Navigation   </td>
<td valign="top" width="352"> </td>
</tr>
<tr>
<td valign="top" width="200">Microsoft.SharePoint.Utilities</td>
<td valign="top" width="352">SPUtility.SendEmail, SPUtility.GetNTFullNameandEmailFromLogin</td>
</tr>
<tr>
<td valign="top" width="200">Microsoft.SharePoint.Workflow</td>
<td valign="top" width="352">SPWebPartManager, SPWebPartConnection, WebPartZone, WebPartPage, ToolPane, ToolPart</td>
</tr>
<tr>
<td valign="top" width="200">Microsoft.SharePoint.WebPartPages</td>
<td valign="top" width="352"> </td>
</tr>
</tbody>
</table>
<p>The following items can <strong>not</strong> be deployed using a sandboxed solution:</p>
<ul>
<li>Site Definition</li>
<li>Application Pages</li>
<li>Farm and Web Application scoped features</li>
<li>Custom Actions Group</li>
<li>Custom Fields</li>
<li>Visual Studio Visual Web Part</li>
<li>Workflows with code</li>
<li>HideCustomAction</li>
<li>SharePoint Timer Jobs</li>
<li>Feature Receivers for Farm and Web scoped features</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/allthingssharepoint.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/allthingssharepoint.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/allthingssharepoint.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/allthingssharepoint.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/allthingssharepoint.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/allthingssharepoint.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/allthingssharepoint.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/allthingssharepoint.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/allthingssharepoint.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/allthingssharepoint.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/allthingssharepoint.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/allthingssharepoint.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/allthingssharepoint.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/allthingssharepoint.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=yuriburger.net&#038;blog=17822140&#038;post=123&#038;subd=allthingssharepoint&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://yuriburger.net/2011/06/03/to-sandbox-or-not-to-sandbox/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7a65f6af25145195dbc973f00d250c62?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">yuriburger</media:title>
		</media:content>

		<media:content url="http://allthingssharepoint.files.wordpress.com/2011/05/sharepoint-2010-design-chart_thumb1.png" medium="image">
			<media:title type="html">SharePoint 2010 design chart</media:title>
		</media:content>
	</item>
	</channel>
</rss>
