<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.sharepointblogs.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>tom.shirley&amp;#39;s blog</title><link>http://www.sharepointblogs.com/tomshirley/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Help: Editing user permissions locks site collection</title><link>http://www.sharepointblogs.com/tomshirley/archive/2008/10/21/help-editing-user-permissions-locks-site-collection.aspx</link><pubDate>Tue, 21 Oct 2008 05:27:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:22153</guid><dc:creator>Tom.Shirley</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/tomshirley/rsscomments.aspx?PostID=22153</wfw:commentRss><comments>http://www.sharepointblogs.com/tomshirley/archive/2008/10/21/help-editing-user-permissions-locks-site-collection.aspx#comments</comments><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve got an issue currently with a SharePoint environment and need some assistance from people who know SharePoint inside-out.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Environment&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;WSS 3.0 - 12.0.0.6303 &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Symptoms&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Adding/Editing user permissions on a root-level site is extremely slow (5-10 minutes). &lt;br /&gt;Browser is stuck loading the edit permissions page &amp;#39;_layouts/editprms.aspx&amp;#39;&lt;br /&gt;Furthermore, the entire Site Collection is effectively offline, i.e. no pages load while above action is being processed.&lt;br /&gt;Thats right, the whole Site Collection is &lt;em&gt;unusable&lt;/em&gt;...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cause&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Having a hunt around in SQL, it seems as though the process that&amp;#39;s kicked off to update the user&amp;#39;s permissions locks&lt;br /&gt;out any other processes,&amp;nbsp;and this process seems to access the &amp;#39;Deps&amp;#39; table in the content database.&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no information about what the Deps table is used for (suprise suprise), however in my environment there&amp;#39;s&amp;nbsp;alot of&amp;nbsp;records&lt;br /&gt;(tens of 1000&amp;#39;s) whose SiteId column is set to the Site guid&amp;nbsp;which is in the process&amp;nbsp;of&amp;nbsp;updating it&amp;#39;s&amp;nbsp;user permissions.&lt;/p&gt;
&lt;p&gt;A single record in the Deps table looks like the following:&lt;/p&gt;
&lt;p&gt;SiteId = &amp;lt;guid&amp;gt;&lt;br /&gt;DeleteTransactionId = 0x&lt;br /&gt;FullUrl = site/subsite/uploadedpage.htm&amp;nbsp;&lt;br /&gt;DepType = 1&amp;nbsp;&amp;nbsp;&lt;br /&gt;DepDesc = site/_themes/&amp;lt;THEME&amp;gt;/theme.css&amp;nbsp;&lt;br /&gt;Level = 1&lt;/p&gt;
&lt;p&gt;All the records are for *.htm pages maintaining a dependancy to an applied themes CSS file. &lt;br /&gt;In this environment users have uploaded thousands of htm pages and on all sites a theme is applied. &lt;/p&gt;
&lt;p&gt;I replicated this issue on a test server. Out of frustration i&amp;nbsp;deleted all the entries in the Deps table which&amp;nbsp;fixed the problem, &lt;br /&gt;updating a user performs as expected.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;So it looks to me like it&amp;#39;s a performance issue processing all of these records in the Deps table. &lt;br /&gt;But why is it accessing this information for a user permission update?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;??&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Questions&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;What the hell is going on here..Anyone experienced this issue before? &lt;br /&gt;What is this table used for and why would uploaded htm pages need a reference to a theme css file which they don&amp;#39;t use anyway?&lt;/p&gt;
&lt;p&gt;This looks to be a bug to me, and i&amp;#39;ve had a hunt around in the hotfixes to date and haven&amp;#39;t found a fix.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Tom.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=22153" width="1" height="1"&gt;</description></item><item><title>Access Checker Web Part v1.1</title><link>http://www.sharepointblogs.com/tomshirley/archive/2008/03/28/access-checker-web-part-v1-1.aspx</link><pubDate>Fri, 28 Mar 2008 05:34:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:14647</guid><dc:creator>Tom.Shirley</dc:creator><slash:comments>3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/tomshirley/rsscomments.aspx?PostID=14647</wfw:commentRss><comments>http://www.sharepointblogs.com/tomshirley/archive/2008/03/28/access-checker-web-part-v1-1.aspx#comments</comments><description>&lt;p&gt;A new version of the Access Checker web part is &lt;a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AccessChecker&amp;amp;ReleaseId=12015" target="_blank"&gt;now available&lt;/a&gt; on CodePlex.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;a href="http://www.sharepointblogs.com/tomshirley/attachment/14647.ashx"&gt;&lt;img src="http://www.sharepointblogs.com/tomshirley/attachment/14647.ashx" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;Whats New:&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;- Added a filter control to the Web Part allowing filtering of nodes in the tree.&lt;br /&gt;- Item text in the tree are now colored green/red.&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Whats Changed:&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;-
When viewing the permission inheritance of a site hierarchy, the
coloring of the nodes is no longer in relation to the current site, it
is now in relation to the nodes parent object.&lt;br /&gt;- Client side javascript has been cleaned up in order to improve the loading time of the color-bar.&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Whats Fixed:&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;- Node coloring is now printable.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tom.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=14647" width="1" height="1"&gt;</description><enclosure url="http://www.sharepointblogs.com/tomshirley/attachment/14647.ashx" length="31734" type="image/png" /></item><item><title>New Web Part: Access Checker</title><link>http://www.sharepointblogs.com/tomshirley/archive/2008/01/28/new-web-part-access-checker.aspx</link><pubDate>Mon, 28 Jan 2008 07:42:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:11952</guid><dc:creator>Tom.Shirley</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/tomshirley/rsscomments.aspx?PostID=11952</wfw:commentRss><comments>http://www.sharepointblogs.com/tomshirley/archive/2008/01/28/new-web-part-access-checker.aspx#comments</comments><description>&lt;p&gt;G&amp;#39;day mates.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I&amp;#39;ve just released a new Web Part called the &lt;a href="http://www.codeplex.com/AccessChecker" class="" target="_blank"&gt;Access Checker Web Part&lt;/a&gt; (Beta) on Codeplex. It&amp;#39;s purpose is to allow site administrators to determine what access a particular user has to content within a Site.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.sharepointblogs.com/tomshirley/attachment/11952.ashx" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;More specifically, you can view graphically whether a user has a particular set of permissions on Sites and Lists.&lt;/p&gt;&lt;p&gt;&lt;b&gt;Background&amp;nbsp;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In our environment we would receive emails from site administrators fed up with managing permissions for users. A common scenario would be that a user needed to be able to read all content within a site. For a site admin to be certain of this, they would need to visit each list and library permissions page and check that a) the list was inheriting permissions or b) the list has unique permissions and the user needs to be added directly. (Not to mention folder and list item permissions, but that&amp;#39;s outside the scope of what this web part addresses!)&lt;/p&gt;&lt;p&gt;Expand this problem out to groups of sites and it gets really scary...&lt;/p&gt;&lt;p&gt;The Web Part solves this management issue for site administrators. The web part will confirm what permissions a user has to each list and site at a certain level in a Sharepoint hierarchy. It can also show the permission inheritance hierarchy for a better understanding of how permissions are setup.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The Web Part is currently in &lt;a href="https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=AccessChecker&amp;amp;ReleaseId=10220" class="" target="_blank"&gt;Beta&lt;/a&gt;,&amp;nbsp;so i would like to get&amp;nbsp;some feedback on its usefulness and&amp;nbsp;if you have any suggestions on improving this web part i would like to hear about them.&lt;/p&gt;
&lt;p&gt;Tom Shirley.&lt;/p&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=11952" width="1" height="1"&gt;</description><enclosure url="http://www.sharepointblogs.com/tomshirley/attachment/11952.ashx" length="14376" type="image/x-png" /><category domain="http://www.sharepointblogs.com/tomshirley/archive/tags/Web+Parts/default.aspx">Web Parts</category></item><item><title>SPI + PowerShell</title><link>http://www.sharepointblogs.com/tomshirley/archive/2007/09/20/spi-powershell.aspx</link><pubDate>Thu, 20 Sep 2007 05:45:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:5008</guid><dc:creator>Tom.Shirley</dc:creator><slash:comments>4</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/tomshirley/rsscomments.aspx?PostID=5008</wfw:commentRss><comments>http://www.sharepointblogs.com/tomshirley/archive/2007/09/20/spi-powershell.aspx#comments</comments><description>
Update - 2007-09-20 - Blog now has project attached temporarily until it&amp;#39;s added into the SPI solution on Codeplex.&lt;br /&gt;
&lt;h3&gt;Purpose&lt;/h3&gt;
&lt;p&gt;Provide a User Interface to administer Sharepoint content using PowerShell.&lt;/p&gt;
&lt;h3&gt;Background&lt;/h3&gt;
&lt;p&gt;I received an email recently of some interesting downloads on &lt;a href="http://www.codeplex.com/"&gt;CodePlex&lt;/a&gt; relating to Sharepoint. One that caught my attention was a developer tool called &lt;a href="http://www.codeplex.com/spi"&gt;Sharepoint Inspector&lt;/a&gt; (SPI), created by &lt;a href="http://www.gatweb.fr/"&gt;Gaetan Bouveret&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;SPI is a tool to inspect a Sharepoint farm by drilling down into the various objects and then viewing their properties through reflection. There are other tools out there that do basically the same thing but a) the ones I know of are closed source (meaning I can&amp;#39;t mess them up!) and b) Gaetan has devoted quite a lot of effort and started to add functionality to manage certain components within a farm, like activating features, querying site data and managing solutions to name a few.&lt;/p&gt;

&lt;p&gt;A tool like this is really a must for all Sharepoint developers and even administrators (In our environment we only have WSSv3 deployed so we don&amp;#39;t even get that OOTB MOSS manager tool which provides some management features).&lt;/p&gt;

&lt;p&gt;So that&amp;#39;s the first operand within the title explained, onto the second… PowerShell.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ve been using PowerShell, a run down and tutorials to get started using it with SP is available &lt;a href="http://blogs.flexnetconsult.co.uk/colinbyrne/PermaLink,guid,1665700b-e0de-4b8a-bb1c-014d6fbcf2db.aspx"&gt;here&lt;/a&gt;, to do more and more Sharepoint tasks from things as massive as migrating from STS v1 to WSS v3, to little one off&amp;#39;s like resetting a bunch of site&amp;#39;s themes to creating play sites based off Active Directory user details. &lt;/p&gt;

&lt;p&gt;Both operands on the stack, time to push() the operator (post-fix notation).&lt;/p&gt;

&lt;p&gt;I thought it would be great if you could select a Sharepoint site from a tree view of your farm and then run a PowerShell script to perform a task on what&amp;#39;s selected.&lt;/p&gt;

&lt;p&gt;And reducing the contents of the stack brings us to a…&lt;/p&gt;
&lt;h3&gt;Solution&lt;/h3&gt;
&lt;p&gt;I&amp;#39;ve extended Gaetan&amp;#39;s SPI to include the ability to execute PowerShell scripts while making available to script writers the current state of SPI, exposed via the class SharepointReferences. &lt;/p&gt;

&lt;p&gt;So what this means is you can now drill down to an object and right click to select &amp;quot;PowerShell Actions&amp;quot; which will give you a listing of any available scripts that are defined in a user defined directory. &lt;/p&gt;
&lt;a href="http://www.flickr.com/photos/56032958@N00/1289912086/" title="Photo Sharing"&gt;&lt;img src="http://farm2.static.flickr.com/1204/1289912086_2513baf600.jpg" alt="SPI+PowerShell" height="390" width="500" /&gt;&lt;/a&gt;
&lt;p&gt;Each PowerShell script needs an accompanying definition file which is a simple xml file, as an example here is the schema for the Export Web script: &lt;/p&gt;

&lt;code&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;utf-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;PowerShellCommand&amp;gt;&lt;br /&gt;&amp;lt;Name&amp;gt;Export Web and child Webs&amp;lt;/Name&amp;gt;&lt;br /&gt;&amp;lt;Command&amp;gt;.\Scripts\ExportWeb.ps1 &amp;quot;$($($spRef.currentSite).id)&amp;quot; &amp;quot;$($($spRef.currentWeb).id)&amp;quot;&amp;lt;/Command&amp;gt;&lt;br /&gt;&amp;lt;Category&amp;gt;Backup&amp;lt;/Category&amp;gt;&lt;br /&gt;&amp;lt;Scope&amp;gt;Web&amp;lt;/Scope&amp;gt;&lt;br /&gt;&amp;lt;/PowerShellCommand&amp;gt;&lt;/code&gt;

&lt;p&gt;The only thing that needs explaining is the Command element. This element takes the PowerShell command that is to be executed, which calls your script and passes any required parameters.&lt;/p&gt;

&lt;p&gt;In order to obtain the parameter values I&amp;#39;ve defined within a PowerShell runspace a variable called &lt;span style="font-family:Courier New;"&gt;$spRef&lt;/span&gt;. This is a reference to the SharepointReferences instance defined in SPI which exposes all of the currently selected Sharepoint objects.&lt;/p&gt;

&lt;p&gt;This means that if you wanted the ID property of the currently selected SPWeb object you would type: &lt;span style="font-family:Courier New;"&gt;&amp;quot;$($($spRef.currentSite).id)&amp;quot;&lt;/span&gt;. This command is then executed in a PowerShell runspace using a technique called &lt;a href="http://blogs.msdn.com/powershell/archive/2006/07/15/Variable-expansion-in-strings-and-herestrings.aspx"&gt;Variable Expansion&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ve now been using this method of administration for a little while and so far it&amp;#39;s quite handy. I&amp;#39;ve written some simple import/export scripts which allows an admin to right-click on a SPWeb and export it and its subsites to file, then click on a different location in the Sharepoint farm and right-click import (replace site or import as subsite) the last exported web. It&amp;#39;s a time saver when you have requests coming in ad-hoc.&lt;/p&gt;

&lt;p&gt;I&amp;#39;ve asked Gaetan to incorporate it into the original project, so hopefully he we get on this soon so that other people can use this feature. I will update on the status of this shortly. &lt;br /&gt;&lt;br /&gt;Tom. &lt;/p&gt;

			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=5008" width="1" height="1"&gt;</description><enclosure url="http://www.sharepointblogs.com/tomshirley/attachment/5008.ashx" length="2636405" type="application/x-zip-compressed" /><category domain="http://www.sharepointblogs.com/tomshirley/archive/tags/PowerShell/default.aspx">PowerShell</category></item><item><title>Repost: Apply Theme to all webs based off any Site Def</title><link>http://www.sharepointblogs.com/tomshirley/archive/2007/08/08/apply-theme-to-all-webs-based-off-any-site-def.aspx</link><pubDate>Wed, 08 Aug 2007 12:01:00 GMT</pubDate><guid isPermaLink="false">1f6a1193-f4bb-4480-a5ae-b538d8b20f46:4081</guid><dc:creator>Tom.Shirley</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://www.sharepointblogs.com/tomshirley/rsscomments.aspx?PostID=4081</wfw:commentRss><comments>http://www.sharepointblogs.com/tomshirley/archive/2007/08/08/apply-theme-to-all-webs-based-off-any-site-def.aspx#comments</comments><description>&lt;p&gt;&lt;i&gt;This is a repost of an article i upped on my blog back in Feb 2007&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Purpose: &lt;/b&gt;&lt;/p&gt;



&lt;p&gt;Apply a Sharepoint Theme to any provisioned webs based off
any Site Definition via Feature Stapling.&lt;/p&gt;



&lt;p&gt;&lt;b&gt;Background:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;A pre-deployment task for our&amp;nbsp;implementation&amp;nbsp;of
WSS 3.0 is to brand Sharepoint.&amp;nbsp;There are several ways to customize a
Sharepoint implementation. One of the simpler&amp;nbsp;methods is to create your
own Sharepoint Theme.&lt;/p&gt;



&lt;p&gt;Themes, once applied to a Sharepoint web, allow you to
skin&amp;nbsp;the look and feel of a significant portion of the pages that
users&amp;nbsp;come into contact with whilst using&amp;nbsp;a&amp;nbsp;site. We required
fairly minimal customizations which were mostly&amp;nbsp;serviced&amp;nbsp;through&amp;nbsp;custom
stylesheets.&lt;/p&gt;



&lt;p&gt;In our implementation of WSS 2.0 we used a custom site
definition (based off the STS site def)&amp;nbsp;to service our branding needs,
along with modifications&amp;nbsp;to bunch of admin pages on the front-end servers.&lt;/p&gt;



&lt;p&gt;We could of taken the same approach of&amp;nbsp;creating a new
custom site definition which would give us more flexibility in terms of
customization, but this approach&amp;nbsp;isn&amp;#39;t favourable&amp;nbsp;due to the fact
that we wanted all of the OOTB site definitions available for use, not just the
standard team site definition.&lt;/p&gt;



&lt;p&gt;Yes, we could create a custom site def based off each of the
default site defs (STS, MPS, WIKI, BLOG etc), but this approach is no longer
necessary&amp;nbsp;for simple customizations&amp;nbsp;due to&amp;nbsp;a new feature in
Sharepoint called umm.. &lt;a href="http://msdn2.microsoft.com/en-us/library/ms460318.aspx"&gt;Features&lt;/a&gt;. A
Feature as defined in the SDK manual:&lt;/p&gt;

&lt;p&gt;&lt;i&gt;&amp;quot;Features reduce the complexity involved in making
simple site customizations, and are robust when upgrades are applied to a
deployment. Features eliminate the need to copy large chunks of code to change
simple functionality. Features thus reduce versioning and inconsistency issues
that may arise among front-end Web servers. Features make it easier to activate
or deactivate functionality in the course of a deployment, and administrators can
easily transform the template or definition of a site by simply toggling a
particular Feature on or off in the user interface&amp;quot;&lt;/i&gt;&lt;/p&gt;







&lt;p&gt;Another alternative would be to directly modify the OOTB
site definitions. This however is not supported&lt;i&gt;.&lt;/i&gt; So what we wanted in a nutshell is a way to skin any type of
Sharepoint site with as&amp;nbsp;few modifications to Sharepoint files as possible.&lt;/p&gt;



&lt;p&gt;The solution also had to have&amp;nbsp;three main
features:&amp;nbsp;&lt;/p&gt;





&lt;p&gt;Req 1. Our custom Theme needs to be applied to sites
automatically. (The&amp;nbsp;standard process&amp;nbsp;to apply a Theme&amp;nbsp;is a
manual one,&amp;nbsp;&amp;#39;Site Actions-&amp;gt;Site Settings-&amp;gt;Look and Feel-&amp;gt;Site
Theme&amp;#39;)&lt;br /&gt;&lt;br /&gt;Req 2. Any changes made to the custom Theme post deployment, must be
reflected in existing sites that were provisioned after this solution was
deployed.&lt;br /&gt;&lt;br /&gt;Req 3. Modify as few Sharepoint files as possible&lt;br /&gt;&lt;/p&gt;



&lt;p&gt;&lt;b&gt;Solution: &lt;/b&gt;&lt;/p&gt;



&lt;p&gt;A quick rundown of the solution is as follows:&lt;/p&gt;









&lt;p&gt;1. Create a custom Theme. CSS importing is used to get
around Sharepoint caching a copy of the Theme&amp;#39;s css file, which would violate
Req 2.&lt;br /&gt;2. Create a Sharepoint&amp;nbsp;Feature that applies a Theme to
a site when a site is provisioned.&lt;br /&gt;3. Create another Feature that staples the previous Feature
to all site definitions. This idea came from &lt;a href="http://blogs.msdn.com/cjohnson/archive/2006/11/01/feature-stapling-in-wss-v3.aspx"&gt;Chris
Johnson&amp;#39;s blog&lt;/a&gt;.&lt;br /&gt;4. Deploy&amp;nbsp;the second&amp;nbsp;feature at the Farm scope,
which attaches the first feature to all sites within the Sharepoint farm. For
ease of deployment&amp;nbsp;i have used the WSS Solution framework.&lt;/p&gt;







&lt;p&gt;&lt;b&gt;Detailed Description:&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;1. Creating a Theme is detailed here &lt;a href="http://msdn2.microsoft.com/en-us/library/aa979310.aspx"&gt;WSS 3.0 SDK - How
to: Customize Themes&lt;/a&gt;&amp;nbsp; or alternatively&amp;nbsp;read&amp;nbsp;&lt;a href="http://www.graphicalwonder.com/?p=419"&gt;Shane Perran&amp;#39;s blog&lt;/a&gt;. In order
to utilize the css&amp;nbsp;&amp;#39;indirection&amp;#39; method&amp;nbsp;see &lt;a href="http://weblogs.asp.net/bsimser/archive/2005/02/24/379533.aspx"&gt;Bil
Simser&amp;#39;s &amp;quot;Automagically updating themes&amp;quot; blog entry&lt;/a&gt;&lt;/p&gt;





&lt;p&gt;2.&lt;br /&gt;&lt;br /&gt;Feature.xml&lt;/p&gt;&lt;p&gt;&lt;img src="http://www.flickr.com/photos/56032958@N00/395964210/" alt="" /&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.flickr.com/photos/56032958@N00/395964210/" title="Photo Sharing"&gt;
 
 
  
  
  
  
  
  
  
  
  
  
  
  
 
 
 

 
&lt;img src="http://farm1.static.flickr.com/160/395964210_e5201e2780_o.png" title="Theme_Feature_ScreenCapture_01" alt="Theme_Feature_ScreenCapture_01" border="0" height="222" width="860" /&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;ApplyTheme.cs&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.flickr.com/photos/56032958@N00/395964213/" title="Photo Sharing"&gt;
 
&lt;img src="http://farm1.static.flickr.com/145/395964213_86e5a0dee2_o.png" title="ApplyTheme_ScreenCapture_01" alt="ApplyTheme_ScreenCapture_01" border="0" height="493" width="800" /&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;3. &lt;/p&gt;

&lt;p&gt;Feature.xml&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.flickr.com/photos/56032958@N00/395964211/" title="Photo Sharing"&gt;
 
&lt;img src="http://farm1.static.flickr.com/134/395964211_82b90f70a3_o.png" title="Feature_Staple_FeatureXML_ScreenCapture_01" alt="Feature_Staple_FeatureXML_ScreenCapture_01" border="0" height="234" width="602" /&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;Elements.xml&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.flickr.com/photos/56032958@N00/395964212/" title="Photo Sharing"&gt;
 
&lt;img src="http://farm1.static.flickr.com/170/395964212_95da4c268f_o.png" title="Feature_Staple_ElementsXML_ScreenCapture_01" alt="Feature_Staple_ElementsXML_ScreenCapture_01" border="0" height="76" width="837" /&gt;&lt;/a&gt;&lt;/p&gt;



&lt;p&gt;4.&lt;/p&gt;

&lt;p&gt;I have&amp;nbsp;attached the VS 2005 solution. All you need to
do is replace the GUIDS and Public Keys, sign the assembly and fix up any
broken references. Oh and change names of classes, dll, etc so they mean
something to you.&lt;/p&gt;



&lt;p&gt;See the &lt;a href="http://sharepointsolutions.blogspot.com/2006/10/anatomy-of-sharepoint-wss-v3-feature.html"&gt;Sharepoint
Solutions Team blog&lt;/a&gt;&amp;nbsp;for an example VS 2005 solution, explaining
all the files in the project and also check out Andrew Connell&amp;#39;s &lt;a href="http://www.andrewconnell.com/blog/articles/UsingVisualStudioAndMsBuildToCreateWssSolutions.aspx"&gt;HowTo
on creating Solution files&lt;/a&gt;.&lt;/p&gt;



&lt;p&gt;To deploy the Solution, here is a script that was posted by
Daniel Larson on the SDK page &lt;a href="http://msdn2.microsoft.com/en-gb/library/aa544500.aspx"&gt;Deploying a
Solution&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;@set PATH=C:\Program
Files\Common Files\Microsoft Shared\web server extensions\12\BIN;%PATH%&lt;br /&gt;
stsadm -o deactivatefeature -name MyCustomTheme -url&amp;nbsp; &lt;a href="http://localhost/"&gt;http://localhost&lt;/a&gt; &lt;br /&gt;
stsadm -o retractsolution -name MyCustomTheme.wsp -immediate -allcontenturls &lt;br /&gt;
stsadm -o execadmsvcjobs &lt;br /&gt;
stsadm -o deletesolution -name MyCustomTheme.wsp -override &lt;br /&gt;
stsadm -o execadmsvcjobs &lt;br /&gt;
stsadm -o addsolution -filename C:\MyCustomTheme.wsp&lt;br /&gt;
stsadm -o execadmsvcjobs &lt;br /&gt;
stsadm -o deploysolution -name MyCustomTheme.wsp -immediate -allcontenturls
-allowGacDeployment -allowCasPolicies &lt;br /&gt;
stsadm -o execadmsvcjobs &amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Limitations:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;The solution does not automatically apply the Theme to any
sites that have already been provisioned.&lt;/p&gt;

&lt;p&gt;Any feedback is appreciated,&lt;/p&gt;

&lt;p&gt;Tom.&lt;/p&gt;(Originally) Published Monday, February 19, 2007 11:42 AM by &lt;a href="http://www.sharepointblogs.com/user/Profile.aspx?UserID=3551"&gt;Tom.Shirley&lt;/a&gt;
			&lt;hr&gt;&lt;span style="font-size:10pt;"&gt;Posted on &lt;a href="http://www.sharepointblogs.com/"&gt;SharePoint Blogs&lt;/a&gt;&lt;/span&gt;
		  &lt;img src="http://www.sharepointblogs.com/aggbug.aspx?PostID=4081" width="1" height="1"&gt;</description><enclosure url="http://www.sharepointblogs.com/tomshirley/attachment/4081.ashx" length="112432" type="application/x-zip-compressed" /><category domain="http://www.sharepointblogs.com/tomshirley/archive/tags/Themes+feature.stapling+customization/default.aspx">Themes feature.stapling customization</category></item></channel></rss>