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

<channel>
	<title>trentacular &#187; sharepoint</title>
	<atom:link href="http://trentacular.com/category/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://trentacular.com</link>
	<description>Trent Foley's Spectacular Technical Blog</description>
	<lastBuildDate>Thu, 15 Apr 2010 21:32:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MOSS FullTextSqlQuery API: Little Known Flags on Managed Properties</title>
		<link>http://trentacular.com/2010/03/moss-fulltextsqlquery-api-little-known-flags-on-managed-properties/</link>
		<comments>http://trentacular.com/2010/03/moss-fulltextsqlquery-api-little-known-flags-on-managed-properties/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 17:56:55 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[full text search]]></category>
		<category><![CDATA[full text sql]]></category>
		<category><![CDATA[managed property]]></category>
		<category><![CDATA[moss]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=252</guid>
		<description><![CDATA[I just wrapped up a custom implementation of a faceted search web part that uses the MOSS Full Text Sql Query API.  During the development, I ran into issues querying certain multi-valued Managed Properties, specifically Skills and Interests.  In my query, I was using the CONTAINS predicate like such:

SELECT
UserProfile_GUID, PreferredName, JobTitle, Department, WorkPhone, [...]]]></description>
			<content:encoded><![CDATA[<p>I just wrapped up a custom implementation of a faceted search web part that uses the MOSS Full Text Sql Query API.  During the development, I ran into issues querying certain multi-valued Managed Properties, specifically Skills and Interests.  In my query, I was using the CONTAINS predicate like such:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span>
UserProfile_GUID<span style="color: #66cc66;">,</span> PreferredName<span style="color: #66cc66;">,</span> JobTitle<span style="color: #66cc66;">,</span> Department<span style="color: #66cc66;">,</span> WorkPhone<span style="color: #66cc66;">,</span> OfficeNumber<span style="color: #66cc66;">,</span>
AboutMe<span style="color: #66cc66;">,</span> PictureURL<span style="color: #66cc66;">,</span> WorkEmail<span style="color: #66cc66;">,</span> WebSite<span style="color: #66cc66;">,</span> Path<span style="color: #66cc66;">,</span> HitHighlightedSummary<span style="color: #66cc66;">,</span>
HitHighlightedProperties<span style="color: #66cc66;">,</span> Responsibility<span style="color: #66cc66;">,</span> Skills<span style="color: #66cc66;">,</span> SipAddress
<span style="color: #993333; font-weight: bold;">FROM</span> scope<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">WHERE</span> freetext<span style="color: #66cc66;">&#40;</span>defaultproperties<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'+trent'</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;scope&quot;</span> <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'People'</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">AND</span> CONTAINS<span style="color: #66cc66;">&#40;</span>Skills<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'&quot;numchucks&quot;'</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">AND</span> CONTAINS<span style="color: #66cc66;">&#40;</span>Skills<span style="color: #66cc66;">,</span> <span style="color: #ff0000;">'&quot;rockstar&quot;'</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>Use of the CONTAINS predicate was purely due to my need to query multi-valued properties.  If you are not querying a multi-valued property, you may simply use the &#8216;=&#8217; or &#8216;LIKE&#8217; predicates.</p>
<p>It turns out that the CONTAINS predicate will only work against managed properties that have been <em>enabled</em> as <strong>FullTextQueriable</strong>.  I am not aware of a way to enable a property in the SSP Search Settings, so this has to be done using the API.  I ended up including the following method as part of a Web Application scoped Feature Receiver to ensure certain Managed Properties were &#8216;FullTextQueriable&#8217;.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">    <span style="color: #0600FF;">using</span> <span style="color: #008080;">Microsoft.Office.Server</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF;">using</span> <span style="color: #008080;">Microsoft.Office.Server.Search.Administration</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF;">private</span> <span style="color: #0600FF;">void</span> EnsureFullTextQueriableManagedProperties<span style="color: #000000;">&#40;</span>ServerContext serverContext, <span style="color: #0600FF;">params</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> managedPropertyNames<span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        var schema <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Schema<span style="color: #000000;">&#40;</span>SearchContext.<span style="color: #0000FF;">GetContext</span><span style="color: #000000;">&#40;</span>serverContext<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF;">foreach</span> <span style="color: #000000;">&#40;</span>ManagedProperty managedProperty <span style="color: #0600FF;">in</span> schema.<span style="color: #0000FF;">AllManagedProperties</span><span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #008000;">!</span>managedPropertyNames.<span style="color: #0000FF;">Contains</span><span style="color: #000000;">&#40;</span>managedProperty.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
                continue<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>managedProperty.<span style="color: #0000FF;">FullTextQueriable</span><span style="color: #000000;">&#41;</span>
                continue<span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">try</span>
            <span style="color: #000000;">&#123;</span>
                managedProperty.<span style="color: #0000FF;">FullTextQueriable</span> <span style="color: #008000;">=</span> true<span style="color: #008000;">;</span>
                managedProperty.<span style="color: #0000FF;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
                Log.<span style="color: #0000FF;">Info</span><span style="color: #000000;">&#40;</span>m <span style="color: #008000;">=&gt;</span> m<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Successfully set managed property {0} to be FullTextQueriable&quot;</span>, managedProperty.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
            <span style="color: #0600FF;">catch</span> <span style="color: #000000;">&#40;</span>Exception e<span style="color: #000000;">&#41;</span>
            <span style="color: #000000;">&#123;</span>
                Log.<span style="color: #0000FF;">Error</span><span style="color: #000000;">&#40;</span>m <span style="color: #008000;">=&gt;</span> m<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Error updating managed property {0}&quot;</span>, managedProperty.<span style="color: #0000FF;">Name</span><span style="color: #000000;">&#41;</span>, e<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span></pre></div></div>

<p>So on the same note of Managed Property flags not visible in the SSP Search Settings, you may also want to know about the Retrievable flag.  This flag prevents a Managed Property&#8217;s value from being returned if specified as a column in the SELECT statement.</p>
<p>The following table lists most of the out of the box Managed Properties and their default FullTextQueriable, HasMultipleValues, and Retrievable flag values.</p>
<table class="datatable" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>Name</th>
<th>FullTextQueriable</th>
<th>HasMultipleValues</th>
<th>Retrievable</th>
</tr>
<tr class="even">
<td>AboutMe</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Account</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>AccountName</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>AssignedTo</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Assistant</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Author</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Authority</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>BestBetKeywords</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Birthday</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>CachedPath</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>CategoryNavigationUrl</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>CollapsingStatus</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Company</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>contentclass</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>ContentSource</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>ContentType</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Created</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>CreatedBy</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>DataSource</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>DatePictureTaken</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Department</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Description</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>DisplayTitle</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>DocComments</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>DocKeywords</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>DocSignature</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>DocSubject</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>DottedLine</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>EMail</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>EndDate</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Fax</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>FileExtension</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Filename</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>FirstName</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>FollowAllAnchor</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty1</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceDisplayProperty10</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty11</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceDisplayProperty12</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty13</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceDisplayProperty14</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty15</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceDisplayProperty2</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty3</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceDisplayProperty4</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty5</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceDisplayProperty6</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty7</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceDisplayProperty8</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceDisplayProperty9</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceImageURL</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HighConfidenceMatching</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HighConfidenceResultType</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HireDate</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HitHighlightedProperties</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>HitHighlightedSummary</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>HomePhone</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Interests</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>IsDocument</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>JobTitle</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Keywords</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>LastModifiedTime</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>LastName</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Location</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Manager</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>MemberOf</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Memberships</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>MobilePhone</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>ModifiedBy</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>MySiteWizard</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>NLCodePage</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>Notes</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>objectid</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>OfficeNumber</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>OWS_URL</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>PastProjects</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Path</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Peers</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>PersonalSpace</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>PictureHeight</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>PictureSize</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>PictureThumbnailURL</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>PictureURL</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>PictureWidth</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>PreferredName</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Priority</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>ProxyAddresses</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>PublicSiteRedirect</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Purpose</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Rank</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>RankDetail</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Responsibilities</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Schools</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>SID</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>SipAddress</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Site</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="even">
<td>SiteName</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>SiteTitle</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Size</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Skills</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>StartDate</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>Status</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>Title</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>UrlDepth</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr class="even">
<td>UserName</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>UserProfile_GUID</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>WebId</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>WebSite</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>WorkAddress</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>WorkCity</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>WorkCountry</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>WorkEmail</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>WorkId</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>WorkPhone</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr class="even">
<td>WorkState</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
<tr>
<td>WorkZip</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
<td>&nbsp;</td>
<td><img src="/wp-content/uploads/2010/03/icn-checkmark-small.gif" alt="X" /></td>
</tr>
</table>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2010/03/moss-fulltextsqlquery-api-little-known-flags-on-managed-properties/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint &#8220;Smart&#8221; Editor Parts</title>
		<link>http://trentacular.com/2009/12/sharepoint-smart-editor-parts/</link>
		<comments>http://trentacular.com/2009/12/sharepoint-smart-editor-parts/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 00:04:36 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[editorpart]]></category>
		<category><![CDATA[webpart]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=205</guid>
		<description><![CDATA[Stealing the name from Jan Tielens&#8217; SmartPart for SharePoint, I&#8217;ve put together a framework for building &#8220;Smart&#8221; Editor Parts — &#8220;Smart&#8221; Editor Parts being User Controls that serve as Editor Parts.  This blog post is an excerpt from the complete writeup of the framework.
Downloads
SharePoint Smart Editor Parts.docx (~159 KB)
A complete writeup of the SharePoint &#8220;Smart&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>Stealing the name from Jan Tielens&#8217; <a title="SmartPart for SharePoint" href="http://www.codeplex.com/smartpart">SmartPart for SharePoint</a>, I&#8217;ve put together a framework for building &#8220;Smart&#8221; Editor Parts — &#8220;Smart&#8221; Editor Parts being User Controls that serve as Editor Parts.  This blog post is an excerpt from the <a title="SharePoint &quot;Smart&quot; Editor Parts" href="http://trentacular.com/wp-content/uploads/2009/12/SharePoint-Smart-Editor-Parts.docx">complete writeup of the framework</a>.</p>
<h3>Downloads</h3>
<p><a title="SharePoint &quot;Smart&quot; Editor Parts" href="http://trentacular.com/wp-content/uploads/2009/12/SharePoint-Smart-Editor-Parts.docx">SharePoint Smart Editor Parts.docx</a> (~159 KB)<br />
<span class="link-description">A complete writeup of the SharePoint &#8220;Smart&#8221; Editor Part framework</span></p>
<p><a title="SharePoint &quot;Smart&quot; Editor Parts Solution" href="http://trentacular.com/wp-content/uploads/2009/12/Trentacular.SharePoint.SmartEditorPart.zip">Trentacular.SharePoint.SmartEditorPart.zip</a> (~ 320 KB)<br />
<span class="link-description">The Visual Studio solution of the SharePoint &#8220;Smart&#8221; Editor Part framework</span><br />
(Requires Visual Studio 2010 and WSPBuilder Extensions 2010)</p>
<h3>Introduction</h3>
<h4>About the SharePoint Web Part Platform</h4>
<p>Windows SharePoint Services 3.0 (WSS) offers a robust platform for hosting Web Parts, providing a Web Part Manager implementation that builds a rich tool pane for configuring the Web Parts.  Out of the box, WSS provides tool panes for customizing the appearance and layout, and will even generate basic fields for custom Web Part properties that are marked with the appropriate attributes.   The following table describes how custom property types are displayed in the property pane:</p>
<table class="datatable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<th>Custom Property Type</th>
<th>Generated Property Pane Field</th>
</tr>
<tr class="even">
<td>bool</td>
<td>Check Box</td>
</tr>
<tr>
<td>DateTime</td>
<td>Text Box</td>
</tr>
<tr class="even">
<td>enum</td>
<td>Dropdown List</td>
</tr>
<tr>
<td>int</td>
<td>Text Box</td>
</tr>
<tr class="even">
<td>string</td>
<td>Text Box</td>
</tr>
</tbody>
</table>
<h4>Building Custom Editor Parts</h4>
<p>When a custom property requires a user interface element other than the ones listed above or needs custom validation, you can write a custom Editor Part that inherits from <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.editorpart.aspx">System.Web.UI.WebControls.WebParts.EditorPart</a> and have your Web Part implement <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebeditable.aspx">System.Web.UI.WebControls.WebParts.IWebEditable</a> to create your custom Editor Part.</p>
<p>If you would like to build your custom Editor Part using a User Control, there are a few more steps you will have to take, because the abstract <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.editorpart.aspx">System.Web.UI.WebControls.WebParts.EditorPart</a> base class does not inherit from the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.usercontrol.aspx">System.Web.UI.UserControl</a> class.  The rest of this guide will walk you through the steps to create a framework for building Editor Parts with User Controls.</p>
<h4>Inheriting from a Web Part Base Class</h4>
<p>Web Parts inheriting from <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.aspx">Microsoft.SharePoint.WebPartPages.WebPart</a> can also take advantage of this framework with slight modifications to this guide.  You will be creating a base class that inherits from <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart.aspx">System.Web.UI.WebControls.WebParts.WebPart</a> that will encapsulate the majority of the Editor Part framework and will be used by the example Site Members Web Part.  If you prefer to inherit from <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.webpart.aspx">Microsoft.SharePoint.WebPartPages.WebPart</a>, you may change the base class you will be creating to inherit from this class instead; however, Microsoft recommends that you inherit from <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart.aspx">System.Web.UI.WebControls.WebParts.WebPart</a> whenever possible.<strong> </strong></p>
<h3>Overview of the User Control Editor Part Framework</h3>
<h4>Overview of Building an Editor Part</h4>
<p>In order for a Web Part to have a custom Editor Part, the Web Part can implement the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebeditable.aspx">System.Web.UI.WebControls.WebParts.IWebEditable</a> interface.  The abstract <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart.aspx">WebPart</a> class that is typically used as the base class for custom Web Part implementations already implements the <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebeditable.aspx">IWebEditable</a> interface, which includes two exposed members.  The <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebeditable.webbrowsableobject.aspx">WebBrowsableObject</a> property provides a way for <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.editorpart.aspx">EditorPart</a> controls to get a reference to the associated Web Part.  The <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.iwebeditable.createeditorparts.aspx">CreateEditorParts</a> method is used to create an instance of each custom <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.editorpart.aspx">EditorPart</a> control associated with the Web Part, and return them as a collection.  Custom Web Parts that inherit from the abstract <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart.aspx">WebPart</a> class need only to override the <em>CreateEditorParts</em> method in order to add additional Editor Parts.</p>
<p>The <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.editorpart.aspx">EditorPart</a> class exposes a property named <em>WebPartToEdit</em> of type <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart.aspx">WebPart</a> that the Editor Part can use to read and set the configurable properties of the Web Part.  Additionally, two abstract methods <em>SyncChanges</em> and <em>ApplyChanges</em> are exposed that are called by the Web Part framework at the appropriate times when the Editor Part should read or set these properties on the associated Web Part.</p>
<h4>Extending the Editor Part Framework to Support User Controls</h4>
<p>In order to use a User Control as an Editor Part, a generic Editor Part called <em>UserControlEditorPart&lt;T&gt;</em> is needed that will wrap the appropriate User Control.  The <em>UserControlEditorPart&lt;T&gt;</em> will also need to pass the <em>SyncChanges</em> and <em>ApplyChanges</em> method calls along to the User Control.  This can be accomplished by defining an interface to be implemented by the User Control.  This interface will be called <em>IWebPartEditor&lt;T&gt;</em>.</p>
<p>The <em>UserControlEditorPart&lt;T&gt;</em> class is generic because it will inherit from another base class that is also generic called <em>BaseEditorPart&lt;T&gt;</em>.  This base class is extracted so that it can be inherited by both the UserControlEditorPart &lt;T&gt; and any other custom non-User Control Editor Parts.  Its sole purpose is to provide the convenience of casting the <em>WebPartToEdit</em> property of the <em>EditorPart</em> abstract class to the specific Web Part type associated to the <em>EditorPart</em>.</p>
<h4>Enabling Attribute Decorations for Editor Part Associations</h4>
<p>While it is relatively straight-forward to implement the <em>IWebEditable</em> interface’s <em>CreateEditorParts</em> method in a custom Web Part class, the framework additionally abstracts this step away, enabling you to associate Editor Parts to your Web Part using attributes.  This is accomplished by supplying two additional classes: <em>WebEditableWebPart</em> and <em>EditorPartAttribute</em>.</p>
<p>The <em>WebEditableWebPart</em> class is a new base class to be used by your custom Web Parts.  The class inherits from <a href="http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.webpart.aspx">WebPart</a> and overrides the <em>CreateEditorParts</em> method to add any Editor Parts to the Web Part that are specified by the <em>EditorPartAttribute</em> class.</p>
<p>The <em>EditorPartAttribute</em> class is to be applied as a class attribute to a Web Part requiring a custom Editor Part.  The attribute allows for an Editor Part to be specified by either its type or by a virtual path to a User Control that implements <em>IWebPartEditor&lt;T&gt;</em>.</p>
<p><a href="http://trentacular.com/wp-content/uploads/2009/12/UserControlEditorPartFramework.png"><img title="User Control Editor Part Framework Class Diagram" src="http://trentacular.com/wp-content/uploads/2009/12/UserControlEditorPartFramework.png" alt="User Control Editor Part Framework Class Diagram" width="670" /></a></p>
<h4>Using the User Control Editor Part Framework</h4>
<p>With the User Control Editor Part framework in place, there are now just three steps needed in order to create an Editor Part as a User Control:</p>
<ol>
<li>Ensure the Web Part inherits from <em>WebEditableWebPart</em>.  In the case where you are already using a custom base class for your Web Parts, you may simply change your custom base class to inherit from <em>WebEditableWebPart</em>.</li>
<li>Create a User Control that implements <em>IWebPartEditor&lt;T&gt;</em>.</li>
<li>Decorate your Web Part using the <em>EditorPartAttribute</em> class specifying the virtual path to the User Control.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/12/sharepoint-smart-editor-parts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint FBA: Basic &#8220;All Authenticated Users&#8221; Role Provider</title>
		<link>http://trentacular.com/2009/12/sharepoint-fba-basic-all-authenticated-users-role-provider/</link>
		<comments>http://trentacular.com/2009/12/sharepoint-fba-basic-all-authenticated-users-role-provider/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 19:22:29 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[asp.net]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[forms based authentication]]></category>
		<category><![CDATA[role provider]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=198</guid>
		<description><![CDATA[When managing users and groups within a SharePoint Web application configured to use Windows Integrated Authentication,  there is a convenient &#8220;Add all authenticated users&#8221; link that adds a special Active Directory group &#8211; NT AUTHORITY\authenticated users &#8211; to the Users/Groups People Editor.  This group refers to any non-anonymous user, which if you ask me, seems [...]]]></description>
			<content:encoded><![CDATA[<p>When managing users and groups within a SharePoint Web application configured to use Windows Integrated Authentication,  there is a convenient &#8220;Add all authenticated users&#8221; link that adds a special Active Directory group &#8211; <strong>NT AUTHORITY\authenticated users</strong> &#8211; to the Users/Groups People Editor.  This group refers to any non-anonymous user, which if you ask me, seems like a pretty common group to have around.  However, when working within a SharePoint Web application configured to use Forms Based Authentication (FBA), this convenient group is no longer available.</p>
<p>When using FBA, the only &#8220;non-SharePoint&#8221; groups available to us are the roles exposed by an ASP.Net Role Provider.  If you are already using a custom Role Provider and are not able to make changes to it, then you can stop here.  This post is not for you.  If you are like me though, and are using FBA merely for authentication and are leveraging SharePoint for all authorization, then the single &#8220;All Authenticated Users&#8221; role is all I need from my Role Provider.  As a result, there is no need to use a heavy weight Role Provider (i.e., the SQL Role Provider) to accomplish this, but rather roll your own very dumb role provider.  There is only a single method that you will need to implement &#8211; GetRolesForUser &#8211; in which you can assume the user is already authenticated and always return the &#8220;All Authenticated Users&#8221; role for the user.  Here is the Role Provider I am currently using:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Web.Security</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">namespace</span> Trentacular.<span style="color: #0000FF;">Web</span>.<span style="color: #0000FF;">Security</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">public</span> <span style="color: #FF0000;">class</span> SimpleAllAuthenticatedUsersRoleProvider <span style="color: #008000;">:</span> RoleProvider
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">const</span> <span style="color: #FF0000;">string</span> AllAuthenticatedUsersRoleName <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;All Authenticated Users&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span> ApplicationName <span style="color: #000000;">&#123;</span> get<span style="color: #008000;">;</span> set<span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> GetRolesForUser<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> username<span style="color: #000000;">&#41;</span>
        <span style="color: #000000;">&#123;</span>
            <span style="color: #0600FF;">return</span> <span style="color: #008000;">new</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#123;</span> AllAuthenticatedUsersRoleName <span style="color: #000000;">&#125;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080;">#region Methods Not Implemented</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> GetAllRoles<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">bool</span> IsUserInRole<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> username, <span style="color: #FF0000;">string</span> roleName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">bool</span> RoleExists<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> roleName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> AddUsersToRoles<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> usernames, <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> roleNames<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> CreateRole<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> roleName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">bool</span> DeleteRole<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> roleName, <span style="color: #FF0000;">bool</span> throwOnPopulatedRole<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> FindUsersInRole<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> roleName, <span style="color: #FF0000;">string</span> usernameToMatch<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> GetUsersInRole<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> roleName<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> RemoveUsersFromRoles<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> usernames, <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> roleNames<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #0600FF;">throw</span> <span style="color: #008000;">new</span> NotImplementedException<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #008080;">#endregion</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<p>After rolling your own role provider, you will need to register it in the web.config inside the &lt;system.web&gt; section as such:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;roleManager</span> <span style="color: #000066;">enabled</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">defaultProvider</span>=<span style="color: #ff0000;">&quot;SimpleAllAuthenticatedUsersRoleProvider&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;providers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SimpleAllAuthenticatedUsersRoleProvider&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;Trentacular.Web.Security.SimpleAllAuthenticatedUsersRoleProvider, Trentacular.Web, Version=1.0.0.0, Culture=neutral, PublicKeyToken=aaaaaaaaaaaaaaaa&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/providers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/roleManager<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/12/sharepoint-fba-basic-all-authenticated-users-role-provider/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint smartsolutionupgrade stsadm command</title>
		<link>http://trentacular.com/2009/09/sharepoint-smartsolutionupgrade-stsadm-command/</link>
		<comments>http://trentacular.com/2009/09/sharepoint-smartsolutionupgrade-stsadm-command/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 20:16:09 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[moss]]></category>
		<category><![CDATA[smartsolutionupgrade]]></category>
		<category><![CDATA[solution]]></category>
		<category><![CDATA[solution deployment]]></category>
		<category><![CDATA[stsadm]]></category>
		<category><![CDATA[wsp]]></category>
		<category><![CDATA[wss]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=168</guid>
		<description><![CDATA[I just released a new stsadm command in the Trentacular SharePoint 2007 Features CodePlex project called smartsolutionupgrade.  The purpose of this command is to perform Solution upgrades in a smart manner by performing the following actions:

Accepts as input either a single Solution filename or a filename of a text file containing a list of Solutions [...]]]></description>
			<content:encoded><![CDATA[<p>I just released a new stsadm command in the <a href="http://trentacularfeatures.codeplex.com/">Trentacular SharePoint 2007 Features</a> CodePlex project called <strong>smartsolutionupgrade</strong>.  The purpose of this command is to perform Solution upgrades in a <em>smart</em> manner by performing the following actions:</p>
<ol>
<li>Accepts as input either a single Solution filename or a filename of a text file containing a list of Solutions to be upgraded</li>
<li>Extracts and parses the Solution manifest file from each existing Solution to be upgraded in order to determine the Features that will be affected by the upgrade</li>
<li>Inventories the deployment states of the existing Solutions</li>
<li>Inventories the activation states of the affected Features at all scopes within the SharePoint Farm</li>
<li>Deactivates all affected Features</li>
<li>Retracts each of the existing Solutions and deletes them from the Solution store</li>
<li>Adds the updated Solution to the Solution store</li>
<li>Deploys each of the upgraded Solutions according to their previous deployment state</li>
<li>Activates all affected Features according to their previous activation state</li>
</ol>
<h3>Usage</h3>
<p>stsadm -o smartsolutionupgrade [-<em>filename</em> &lt;Solution filename&gt;] [-<em>filenamelist</em> &lt;Path to text file containing each of the solution filenames on separate lines&gt;]</p>
<h3>Job Definition Execution</h3>
<p>Included in the project is a <a title="JobDefinition Executor Class" href="http://trentacularfeatures.codeplex.com/sourcecontrol/changeset/view/58701?projectName=trentacularfeatures#986186">Job Definition Executor</a> that takes care of running one-time scheduled service jobs and waiting for their completion before releasing control.  One particular issue addressed by the Job Definition Executor is the  &#8220;<em>A web configuration modification operation is already running</em>&#8221; error caused by successive execution of the <em>stsadm -o activatefeature</em> command on Features that perform web configuration modifications.</p>
<p>In a multi-server farm, web configuration modifications are delegated to Timer Jobs; therefore, the return from execution of the <em>activatefeature</em> command does not mean the Feature activation (and thus the web configuration modification) has completed.  So you might say, well duh, you need to also execute the <em>execadmsvcjobs</em> command, but this command simply kicks of the job execution and returns from execution while still not waiting for the jobs to actually complete.</p>
<p>The Job Definition Executor solves this problem by kicking of the jobs and monitoring for their completion.  We can now safely execute multiple web configuration modification Features in sequence.</p>
<h3>Update</h3>
<p>I just released a second stsadm command called <strong>smartexecjobdefs</strong> that simply wraps the Job Definition Executor and can be used as a substitute for the <em>execadmsvcjobs</em> command.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/09/sharepoint-smartsolutionupgrade-stsadm-command/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>SharePoint Enhanced List View Web Part</title>
		<link>http://trentacular.com/2009/08/sharepoint-enhanced-list-view-web-part/</link>
		<comments>http://trentacular.com/2009/08/sharepoint-enhanced-list-view-web-part/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 16:04:27 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[list view]]></category>
		<category><![CDATA[webpart]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=163</guid>
		<description><![CDATA[I just published an enhanced List View Web Part in the Trentacular SharePoint 2007 Features CodePlex project.  The Web Part is a substitute for the out of the box List View Web Part with two additional capabilities:

Toggling of views in place (without leaving the web part page)
Ability to display lists located in different sites [...]]]></description>
			<content:encoded><![CDATA[<p>I just published an enhanced List View Web Part in the <a href="http://trentacularfeatures.codeplex.com/">Trentacular SharePoint 2007 Features</a> CodePlex project.  The Web Part is a substitute for the out of the box List View Web Part with two additional capabilities:</p>
<ul>
<li>Toggling of views in place (without leaving the web part page)</li>
<li>Ability to display lists located in different sites of the same SharePoint Farm</li>
</ul>
<p>Development of this Web Part  has proved to be a very difficult undertaking, and I would love for any assistance or ideas with how to go about accomplishing this differently.</p>
<p>Here is where I&#8217;ve currently landed in the Web Part&#8217;s development:</p>
<ul>
<li>I am accessing the <a title="SPLimitedWebPartManager" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webpartpages.splimitedwebpartmanager_members.aspx">SPLimitedWebPartManager</a> at the selected view&#8217;s url to load the SharePoint List View Web Part that was provisioned for the view when created</li>
<li>I then use reflection to invoke the private RenderView method of the Web Part</li>
</ul>
<p>Yes, this sounds extremely hacky, and it is. Using the avaliable SharePoint ListView control didn&#8217;t play nice with many custom views (especially when the list used managed content types).  I&#8217;ve also tried the SPView.RenderAsHtml method, but this also presented problems.</p>
<p>Another possible option would be to use the <a title="ListViewByQuery" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.listviewbyquery.aspx">ListViewByQuery WebControl</a>, but this would require an intense amount of code to duplicate the sorting and filtering that is available through the <a title="ListView" href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.listview.aspx">ListView control</a>. So if you think this Web Part would be useful and would like to contribute to furthering it along, please get in touch.</p>
<p>Here are some screenshots:</p>
<p><img class="aligncenter size-full wp-image-166" title="Trentacular List View Web Part" src="http://trentacular.com/wp-content/uploads/2009/08/list1.png" alt="Trentacular List View Web Part" width="670" height="196" /></p>
<p><img class="aligncenter size-full wp-image-165" title="Trentacular List View Web Part Editor" src="http://trentacular.com/wp-content/uploads/2009/08/editor.png" alt="Trentacular List View Web Part Editor" width="247" height="410" /></p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/08/sharepoint-enhanced-list-view-web-part/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SharePoint Site Settings Custom Actions Feature</title>
		<link>http://trentacular.com/2009/06/sharepoint-site-settings-custom-actions-feature/</link>
		<comments>http://trentacular.com/2009/06/sharepoint-site-settings-custom-actions-feature/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 22:44:22 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[custom action]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[site settings]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=136</guid>
		<description><![CDATA[I just released the third Feature that is now part of the Trentacular SharePoint 2007 Features CodePlex project: Site Settings Custom Actions
The Feature currently adds just a single custom action and page for exposing and managing Web (Site) properties with a similar UI as the previously released Farm Properties Editor (part of the Central Administration [...]]]></description>
			<content:encoded><![CDATA[<p>I just released the third Feature that is now part of the <a href="http://trentacularfeatures.codeplex.com/">Trentacular SharePoint 2007 Features</a> CodePlex project: <strong>Site Settings Custom Actions</strong></p>
<p>The Feature currently adds just a single custom action and page for exposing and managing Web (Site) properties with a similar UI as the previously released Farm Properties Editor (part of the <a href="http://trentacular.com/2009/06/sharepoint-central-administration-extensions-feature/">Central Administration Extensions Feature</a>).</p>
<p><img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=trentacularfeatures&amp;DownloadId=71401" alt="Manage Farm Properties" title="Manage Farm Properties" width="670px" /></p>
<p>The Web Properties Editor has proved convenient for externalizing site-specific configuration settings from which your custom features, whatever they may be, can read from.  It also abstracts away the <a href="http://trentacular.com/2009/06/sharepoint-the-wicked-spwebproperties-propertybag/">peculiarities of the SPWeb.Properties and SPWeb.AllProperties API</a> which I wrote about in my <a href="http://trentacular.com/2009/06/sharepoint-the-wicked-spwebproperties-propertybag/">last post</a> &#8211; a must read if you are a SharePoint developer and haven&#8217;t already.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/06/sharepoint-site-settings-custom-actions-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint: The Wicked SPWeb.Properties PropertyBag</title>
		<link>http://trentacular.com/2009/06/sharepoint-the-wicked-spwebproperties-propertybag/</link>
		<comments>http://trentacular.com/2009/06/sharepoint-the-wicked-spwebproperties-propertybag/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 22:33:00 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Properties]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=138</guid>
		<description><![CDATA[*** This article is a must read for any developer reading or writing Web (Site) properties ***
If you haven&#8217;t already noticed, there are two different API properties on the SPWeb class &#8211; AllProperties (a Hashtable) and Properties (a PropertyBag).  Apparently the AllProperties is meant to replace Properties, but Properties was left in place for [...]]]></description>
			<content:encoded><![CDATA[<p>*** This article is a must read for any developer reading or writing Web (Site) properties ***</p>
<p>If you haven&#8217;t already noticed, there are two different API properties on the SPWeb class &#8211; <em>AllProperties</em> (a Hashtable) and <em>Properties</em> (a PropertyBag).  Apparently the <em>AllProperties</em> is meant to replace <em>Properties</em>, but <em>Properties</em> was left in place for backwards compatibility.  Here&#8217;s where things get wicked &#8230;</p>
<p>The unconventional PropertyBag data type stores its keys in all lowercase, thus not supporting case-sensitive keys, while the conventional Hashtable does support case-sensitive keys.  On top of that, while entries added to <em>Properties</em> get propagated to <em>AllProperties</em> with a lowercase key, entries added to <em>AllProperties</em> do not get propagated to <em>Properties</em>.  So this what Microsoft gives us developer peons to work with.  This is why consultants like myself stay employed.</p>
<p>If you are working with property entries that only your custom application will be reading and writing from, simply always use <em>AllProperties</em> and you will be good to go.  However I often find myself having to work with properties that are read or written by SharePoint internals, and SharePoint itself is very inconsistent in its interaction with Web (Site) properties, probably due to its evolving nature being a rather <em>old</em> product as far as software is concerned.</p>
<p>So the best solution that I have come up with to date is to add your entries to <em>both</em> API properties.  This ensures the entry will be present in both collections, and also ensures the key will have the correct case in <em>AllProperties</em>.  I have found though in order to add to both, the order of the update API calls is important &#8211; you must first update the SPWeb object followed by updating the SPWeb.Properties PropertyBag.  Performing the updates in the reverse order prevents an entry with a case-sensitive key from being added to <em>AllProperties</em>, and only the lowercase-keyed entry will be exposed in <em>AllProperties</em>.  Now that you are probably thoroughly confused, here is the code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Add a property entry</span>
web.<span style="color: #0000FF;">Properties</span><span style="color: #000000;">&#91;</span>key<span style="color: #000000;">&#93;</span> <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
web.<span style="color: #0000FF;">AllProperties</span><span style="color: #000000;">&#91;</span>key<span style="color: #000000;">&#93;</span> <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
web.<span style="color: #0000FF;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
web.<span style="color: #0000FF;">Properties</span>.<span style="color: #0000FF;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Remove a property entry</span>
web.<span style="color: #0000FF;">AllProperties</span>.<span style="color: #0000FF;">Remove</span><span style="color: #000000;">&#40;</span>key<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
web.<span style="color: #0000FF;">Properties</span><span style="color: #000000;">&#91;</span>key<span style="color: #000000;">&#93;</span> <span style="color: #008000;">=</span> null<span style="color: #008000;">;</span>
web.<span style="color: #0000FF;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
web.<span style="color: #0000FF;">Properties</span>.<span style="color: #0000FF;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Take a look, or straight up copy, my <a href="http://trentacularfeatures.codeplex.com/SourceControl/changeset/view/55520#912739">SharePoint utility class</a> that abstracts away Web property interactions.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/06/sharepoint-the-wicked-spwebproperties-propertybag/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>SharePoint Central Administration Extensions Feature</title>
		<link>http://trentacular.com/2009/06/sharepoint-central-administration-extensions-feature/</link>
		<comments>http://trentacular.com/2009/06/sharepoint-central-administration-extensions-feature/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 21:43:55 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[central admin]]></category>
		<category><![CDATA[feature]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=132</guid>
		<description><![CDATA[I just released the second feature that is now part of the Trentacular SharePoint 2007 Features CodePlex project: Central Administration Extensions
The solution currently deploys just a single custom action and page for managing farm properties. This has proved useful for us as a means to centralize configuration that is applicable across our entire SharePoint farm, [...]]]></description>
			<content:encoded><![CDATA[<p>I just released the second feature that is now part of the <a href="http://trentacularfeatures.codeplex.com">Trentacular SharePoint 2007 Features</a> CodePlex project: <strong>Central Administration Extensions</strong></p>
<p>The solution currently deploys just a single custom action and page for managing farm properties. This has proved useful for us as a means to centralize configuration that is applicable across our entire SharePoint farm, such as custom application connection strings, log4net config file location, etc.</p>
<p>If you are a seasoned ASP.Net developer, you may also find the included <a href="http://trentacularfeatures.codeplex.com/SourceControl/changeset/view/54541#889054">Delegate Data Source</a> useful. It essentially exposes the 4 main data source methods (select, insert, update, and delete) as events that can be handled directly in your code behind.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/06/sharepoint-central-administration-extensions-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint: Differences Between Global and Web Application Targeted Solution Deployment</title>
		<link>http://trentacular.com/2009/06/sharepoint-differences-between-global-and-web-application-targeted-solution-deployment/</link>
		<comments>http://trentacular.com/2009/06/sharepoint-differences-between-global-and-web-application-targeted-solution-deployment/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 15:48:24 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[solution deployment]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=124</guid>
		<description><![CDATA[SharePoint solutions are either deployed globally or targeted to a particular web application, depending on whether the solution contains web application scoped Features.  The deployment process behaves differently based on the type of deployment for the solution, and these differences have caused me quite a headache.  Here are my findings that I think [...]]]></description>
			<content:encoded><![CDATA[<p>SharePoint solutions are either deployed globally or targeted to a particular web application, depending on whether the solution contains web application scoped Features.  The deployment process behaves differently based on the type of deployment for the solution, and these differences have caused me quite a headache.  Here are my findings that I think any SharePoint developer or administrator should be aware of when performing solution deployments.</p>
<h4>Globally Deployed Solutions</h4>
<p>When a solution is deployed globally, all SharePoint application pools, including Central Administration&#8217;s, are recycled automatically.  This can be good and bad.  This is good because any GAC installed DLL that has been upgraded needs to be reloaded.  This can be bad though with regards to the availability of your entire SharePoint Farm.</p>
<p>In my particular case, I am working with a SharePoint administrator to deploy a globally deployed solution that is used by only a single web application.  It is fine for this web application to be unavailable, as we have cleared it with our change control process and made announcements of the downtime, but we haven&#8217;t announced to users of the other SharePoint web applications in the Farm that their sites will be coming down along with it.  So be forwarned.</p>
<h4>Web Application Targeted Solutions</h4>
<p>I have become fond of web application targeted solutions because they offer me a workaround to the above availability problem.  I now even trick my solutions to be web application targeted that otherwise would be deployed globally by including a dummy web application scoped feature in them.</p>
<p>When a web application targeted solution is deployed or retracted, only the application pools of the targeted web applications are recycled.</p>
<h4>Enterprise Farm Strategies</h4>
<ul>
<li>When upgrading solutions, the upgradesolution stsadm command only gets you so far.  I&#8217;ve found it is best to fully retract and remove the old solution and then add and deploy the new solution in order to be sure your upgraded features actually take.</li>
<li><strong>Avoid the -allcontenturls switch</strong> &#8211; When deploying and retracting a web application targeted solution, deploy or retract it only to those web applications that will use it &#8230; thus preventing unnecessary recycling of application pools.  I was being lazy in my deployment script and instead of specifying the particular web application url, I used the -allcontenturls switch to retract my solution, hoping SharePoint would be smart enough to recycle only the application pools of the web applications the solution was actually retracted from.  Bad assumption.  They all get recycled.</li>
</ul>
<h4>A Big Gotcha that Got Me</h4>
<p>If you are upgrading a web application targeted solution using the retract, remove, add, deploy strategy mentioned above and your web application scoped Features have associated Feature Receivers, then you <strong>MUST</strong> recycle the Central Administration application pool after removing the old solution and before adding the new solution.  It is the Central Administration application pool that executes your web application scoped Feature Receivers, and if not recycled, it will continue to use the loaded cached <strong>old</strong> versions of assemblies updated by your solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/06/sharepoint-differences-between-global-and-web-application-targeted-solution-deployment/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>SharePoint ASP.Net 3.5 Upgrade Feature</title>
		<link>http://trentacular.com/2009/05/sharepoint-aspnet-35-upgrade-feature/</link>
		<comments>http://trentacular.com/2009/05/sharepoint-aspnet-35-upgrade-feature/#comments</comments>
		<pubDate>Fri, 22 May 2009 20:17:13 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[asp.net 3.5]]></category>
		<category><![CDATA[feature]]></category>
		<category><![CDATA[moss]]></category>
		<category><![CDATA[wss]]></category>

		<guid isPermaLink="false">http://trentacular.com/?p=117</guid>
		<description><![CDATA[I&#8217;ve finally gotten around to starting a CodePlex project for publishing SharePoint features called Trentacular SharePoint 2007 Features.  The first contribution to the project should reach a broad audience (within the SharePoint population that is) &#8230; an ASP.Net 3.5 Upgrade Feature.
The Feature is naturally scoped to a Web Application and adds ASP.Net 3.5 entries [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally gotten around to starting a CodePlex project for publishing SharePoint features called <a href="http://trentacularfeatures.codeplex.com">Trentacular SharePoint 2007 Features</a>.  The first contribution to the project should reach a broad audience (within the SharePoint population that is) &#8230; an ASP.Net 3.5 Upgrade Feature.</p>
<p>The Feature is naturally scoped to a Web Application and adds ASP.Net 3.5 entries to the particular Web Application&#8217;s web.config file.  It works for both WSS and MOSS and also supports clean deactivation by iterating through the SPWebConfigModification collection and removing modifications by owner instead of recreating the modifications.  All modifications are done through a utility class called <a href="http://trentacularfeatures.codeplex.com/SourceControl/changeset/view/51804#821678">SPWebConfigModificationHelper</a> which can be taken advantage of alone if you are writing your own modifications.</p>
<p>Before deciding to write this feature, I tried several others that have been published.  Each had its own issues, from not supporting clean deactivation to simply just not adding the correct entries.  The entries this feature writes were taken from the Visual Studio ASP.Net 3.5 Web.config template.</p>
<p>If you give this Feature a shot, please let me know how it goes.</p>
]]></content:encoded>
			<wfw:commentRss>http://trentacular.com/2009/05/sharepoint-aspnet-35-upgrade-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
