<?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>WSS Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/tag/wss/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/tag/wss/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Thu, 10 Jan 2019 14:15:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>SharePoint 2007 Deployment: Using Resources in Features</title>
		<link>https://blogit.create.pt/andrevala/2009/05/02/sharepoint-2007-deployment-using-resources-in-features/</link>
					<comments>https://blogit.create.pt/andrevala/2009/05/02/sharepoint-2007-deployment-using-resources-in-features/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 02 May 2009 20:08:40 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[Localization]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=621</guid>

					<description><![CDATA[<p>This series of posts about SharePoint deployment would not be complete if I didn’t write one about using resources in Features to allow localization. After all, SharePoint’s out-of-the-box features use resources all the time. Check the first post SharePoint 2007 Deployment: Overview for an introduction and the series index. Why should I use Resources? In [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/05/02/sharepoint-2007-deployment-using-resources-in-features/">SharePoint 2007 Deployment: Using Resources in Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This series of posts about SharePoint deployment would not be complete if I didn’t write one about using resources in Features to allow localization. After all, SharePoint’s out-of-the-box features use resources all the time. Check the first post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/02/SharePoint-2007-Deployment_3A00_-Overview.aspx">SharePoint 2007 Deployment: Overview</a> for an introduction and the series index.</p>
<h3>Why should I use Resources?</h3>
<p>In my opinion, you should <strong>always</strong> use resource files for your features. Why? </p>
<ul>
<li>First, because it’s easy to do even if you only have one language. </li>
<li>Second, because if you do, all the objects you are provisioning in SharePoint will be localized and will be displayed in the correct language of the website (provided you have deployed the resource file for that language). </li>
</ul>
<p>Examples of things that should be placed in resource files:</p>
<ul>
<li><strong>Title</strong> and <strong>Description</strong> of you feature, so that they will be displayed in the language of the website; </li>
<li>Site column <strong>display name</strong> and <strong>description</strong>; </li>
<li>Content type <strong>name</strong> and <strong>description</strong>; </li>
<li>List template <strong>name</strong> and <strong>description</strong>; </li>
<li>List instance <strong>title</strong> and <strong>description</strong>; </li>
<li>Custom action <strong>title</strong> and <strong>description</strong>. </li>
</ul>
<h3>How do I use it?</h3>
<p>There are three steps to use resources in a feature:</p>
<ol>
<li>Build the resource (<code>.resx</code>) files; </li>
<li>Place the resource files in the correct folder; </li>
<li>Use the resource strings in the feature manifest and element manifests. </li>
</ol>
<p><strong>Note:</strong> The next sections show how to use feature-specific resources. I’ll briefly discuss shared resources in the end of the post.</p>
<h4>Building the resource (.resx) files</h4>
<p>The best way to build the resource files is using Visual Studio 2008, but you can do it manually on any text editor since they’re just XML text files.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot;<span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">root</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">resheader </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">resmimetype</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;</span>text/microsoft-resx<span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">resheader</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">resheader </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">version</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;</span>2.0<span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">resheader</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">resheader </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">reader</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
      </span>System.Resources.ResXResourceReader, 
      System.Windows.Forms, 
      Version=2.0.0.0, 
      Culture=neutral, 
      PublicKeyToken=b77a5c561934e089
    <span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">resheader</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">resheader </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">writer</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
      </span>System.Resources.ResXResourceWriter, 
      System.Windows.Forms, 
      Version=2.0.0.0, 
      Culture=neutral, 
      PublicKeyToken=b77a5c561934e089
    <span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">resheader</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">data </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyFeatureName</span>&quot; <span style="color: red">xml:space</span><span style="color: blue">=</span>&quot;<span style="color: blue">preserve</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;</span>My Feature Name<span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">data</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">data </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyFieldDisplayName</span>&quot; <span style="color: red">xml:space</span><span style="color: blue">=</span>&quot;<span style="color: blue">preserve</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;</span>My Field Display Name<span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">data</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">data </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyFieldChoice1</span>&quot; <span style="color: red">xml:space</span><span style="color: blue">=</span>&quot;<span style="color: blue">preserve</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;</span>My Choice 1<span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">data</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">data </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyFieldChoice2</span>&quot; <span style="color: red">xml:space</span><span style="color: blue">=</span>&quot;<span style="color: blue">preserve</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">value</span><span style="color: blue">&gt;</span>My Choice 2<span style="color: blue">&lt;/</span><span style="color: #a31515">value</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">data</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">root</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p><a href="http://11011.net/software/vspaste"></a>See above an example of a resource (<code>.resx</code>) file. The <code>&lt;data&gt;</code> elements are the ones that hold the localized strings:</p>
<ul>
<li>The <code>name</code> attribute is the key used to retrieve the localized string; </li>
<li>The <code>&lt;value&gt;</code> child element is the localized string itself. </li>
</ul>
<p>Each language must have its own resource file which follows a specific naming convention:</p>
<ul>
<li>The main resource file must be called <code><strong>Resources.resx</strong></code>. This is the culture neutral resource file (or fall back resource file) which will be used by SharePoint whenever there is no resource file for a specific culture. </li>
<li>All culture specific resource files must be named <code><strong>Resources.[culture].resx</strong></code>. Some examples:
<ul>
<li><code>Resources.en-US.resx</code> (english – United States) </li>
<li><code>Resources.pt-PT.resx</code> (portuguese – Portugal) </li>
<li><code>Resources.fr-FR.resx</code> (french – France) </li>
<li><code>Resources.pt-BR.resx</code> (portuguese – Brazil) </li>
</ul>
</li>
</ul>
<h4>Placing the resource files in the correct folder</h4>
<p>These files must be placed in a <strong>Resources</strong> folder inside your feature’s folder. So, if your feature’s folder is <code>C:\…\12\TEMPLATE\FEATURES\MyFeature</code>, the resource files need to be placed in the folder <code>C:\…\12\TEMPLATE\FEATURES\MyFeature\Resources</code>.</p>
<h4>Resources and the Feature Manifest</h4>
<p>After you have created the resource files and placed the in the correct folder, you can now used them in your feature manifest (<code>feature.xml</code>).</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
         <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">5DFD12AF-D0AA-4c63-8FB8-C49DB1191083</span>&quot;
         <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">$Resources:MyFeatureName</span>&quot;
         <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Site</span>&quot;
         <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">SiteColumns.xml</span>&quot;<span style="color: blue">/&gt;
    &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Resources\Resources.resx</span>&quot; <span style="color: blue">/&gt;
    &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Resources\Resources.pt-PT.resx</span>&quot; <span style="color: blue">/&gt;
    &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Resources\Resources.es-ES.resx</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The sample above, shows a feature manifest that uses resources to specify the feature title. As you can see, the value of the <code>Title</code> attribute is <code><strong>$Resources:MyFeatureName</strong></code>. This tells SharePoint that it should check the resource file for the current website’s culture and retrieve the string that has the key <code>MyFeatureName</code>.</p>
<p>Notice the use of <code>&lt;ElementFile&gt;</code> elements to reference the resource files in the feature. This is required if you are deploying this feature through a solution package (<code>.wsp</code>).</p>
<p><strong>Important:</strong> because we are using feature-specific resource files (resource files that are only used for this specific feature), you cannot use the <code>DefaultResourceFile</code> attribute on the <code>&lt;Feature&gt;</code> element. If you do, SharePoint will not look for resource files in the local <code>Resources</code> folder for this feature.</p>
<h4>Resources and the Element Manifest</h4>
<p>Besides using localized strings to specify the feature title and description, you can (and should) use localized strings for most feature elements.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Elements </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">Field </span><span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">Choice</span>&quot;
         <span style="color: red">DisplayName</span><span style="color: blue">=</span>&quot;<span style="color: blue"><strong>$Resources:MyFieldDisplayName</strong></span>&quot;
         <span style="color: red">Required</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot;
         <span style="color: red">Format</span><span style="color: blue">=</span>&quot;<span style="color: blue">Dropdown</span>&quot;
         <span style="color: red">FillInChoice</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot;
         <span style="color: red">ID</span><span style="color: blue">=</span>&quot;<span style="color: blue">{485b2176-4cfc-4923-8085-c003b85dab36}</span>&quot;
         <span style="color: red">StaticName</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyField</span>&quot;
         <span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyField</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">Default</span><span style="color: blue">&gt;</span><strong>$Resources:MyFieldChoice1</strong><span style="color: blue">&lt;/</span><span style="color: #a31515">Default</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">CHOICES</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">CHOICE</span><span style="color: blue">&gt;</span><strong>$Resources:MyFieldChoice1</strong><span style="color: blue">&lt;/</span><span style="color: #a31515">CHOICE</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">CHOICE</span><span style="color: blue">&gt;</span><strong>$Resources:MyFieldChoice2</strong><span style="color: blue">&lt;/</span><span style="color: #a31515">CHOICE</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">CHOICES</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">Field</span><span style="color: blue">&gt;
 &lt;/</span><span style="color: #a31515">Elements</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>The sample above specifies a choice field, and uses localized strings for:</p>
<ul>
<li>Field display name </li>
<li>Each of the field’s choices </li>
<li>The field’s default choice </li>
</ul>
<p>The theory is exactly the same as it was used for the feature manifest: you use the expression <code>$Resources:[key]</code> whenever you want SharePoint to retrieve a localized string from the resource file of the current website’s culture.</p>
<h3>Shared Resource Files</h3>
<p>The method shown in the previous sections assumed that each feature has its own resource files. However, that is not always the case and SharePoint itself uses shared resource files. That is, resource files that can be shared by multiple features.</p>
<p>There are only two differences when using shared resource files:</p>
<ul>
<li>The folder where the resource files are placed; </li>
<li>The way you reference the localized string in you feature manifest and element manifests. </li>
</ul>
<p>Other than that, the file format and contents can be exactly the same.</p>
<h4>Folder for Shared Resources</h4>
<p>Shared resource files must be placed in the folder <code>C:\…\12\Resources</code> instead of the local Resources folder inside the feature folder.</p>
<h4>Referencing Shared Resources</h4>
<p>Because the shared resources files can have any name you want, you must reference the localized strings in a more specific way, so as to tell SharePoint which resource file holds a particular string.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
         <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">5DFD12AF-D0AA-4c63-8FB8-C49DB1191083</span>&quot;
         <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue"><strong>$Resources:MyResources,MyFeatureName</strong></span>&quot;
         <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Site</span>&quot;
         <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">SiteColumns.xml</span>&quot;<span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h5></h5>
<p>As you can see in the above sample, instead of <code>$Resources:MyFeatureName</code> I’m referencing the localized string with <code>$Resources:MyResources,MyFeatureName</code>. This tells SharePoint to look for:</p>
<ul>
<li>A localized string whose key is <code>MyFeatureName</code> </li>
<li>In a resource file named <code>MyResources.[Culture].resx</code> </li>
<li>In the <code>C:\…\12\Resources</code> folder </li>
</ul>
<p>If all your strings are in the same shared resource file, then you can specify that file as the default resource file and reference the strings as shown in the first sample.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
         <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">5DFD12AF-D0AA-4c63-8FB8-C49DB1191083</span>&quot;
         <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue"><strong>$Resources:MyFeatureName</strong></span>&quot;
         <strong><span style="color: red">DefaultResourceFile</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyResources</span>&quot;</strong>
         <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Site</span>&quot;
         <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">SiteColumns.xml</span>&quot;<span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p>The sample above does exactly the same as the previous one. The only difference is that it specifies <code>MyResources.[culture].resx</code> as the default resource file and, because of that, you don’t need to specify it on all references to the localized strings.</p>
<h3>Additional Notes</h3>
<p>So, how does SharePoint choose which resource file to use when loading the localized strings?</p>
<ol>
<li>Looks for the resource file of the exact culture of the website. If you have a website based on a portuguese (pt-PT) site template, it will look for the <code>Resources.pt-PT.resx</code>. If it’s there, it loads all the strings from it. </li>
<li>If it’s not there, it looks for any resource files of the same culture, even if it has a different location. So if your website’s language is pt-PT (Portuguese – Portugal) and you don’t have a <code>Resources.pt-PT.resx</code> file, but you have a <code>Resources.pt-BR.resx</code> (Portuguese – Brazil) file, then SharePoint will use it. </li>
<li>If there is no resource file for the website’s culture, SharePoint will use the fall back resource file (<code>Resources.resx</code>). </li>
</ol>
<h3>Samples</h3>
<p>You can download samples for:</p>
<ul>
<li><a href="http://cid-b4544db7b7183eb8.skydrive.live.com/self.aspx/.Public/Blog%20Data/Feature%20Resources/LocalResources.zip" target="blank">Feature with Local Resources</a> </li>
<li><a href="http://cid-b4544db7b7183eb8.skydrive.live.com/self.aspx/.Public/Blog%20Data/Feature%20Resources/SharedResources.zip" target="blank">Feature with Shared Resources</a> </li>
</ul>
<p>These samples include:</p>
<ul>
<li>The solution manifest file (<code>manifest.xml</code>). </li>
<li>The solution cab structure file (<code>solution.ddf</code>). </li>
<li>The feature manifest file (<code>Feature.xml</code>). </li>
<li>The element manifest file (<code>SiteColumns.xml</code>). </li>
<li>The resource files (<code>.resx</code>) </li>
<li>A batch file (<code>build.bat</code>) that creates the solution package </li>
</ul>
<p><strong>Warning:</strong> Do not install both solutions in the same farm, since some of the IDs are the same and the feature has the same name on both solutions. If you want to use it as is, test each solution separately, removing one before installing the other.</p>
<p><strong>Notice: </strong>These samples are given for illustrative purposes only. Feel free to modify and use them as templates for your solutions and features. </p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/05/02/sharepoint-2007-deployment-using-resources-in-features/">SharePoint 2007 Deployment: Using Resources in Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2009/05/02/sharepoint-2007-deployment-using-resources-in-features/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint 2007 Deployment: Feature Stapling</title>
		<link>https://blogit.create.pt/andrevala/2009/04/25/sharepoint-2007-deployment-feature-stapling/</link>
					<comments>https://blogit.create.pt/andrevala/2009/04/25/sharepoint-2007-deployment-feature-stapling/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 25 Apr 2009 20:40:31 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=641</guid>

					<description><![CDATA[<p>Summary This post is about developing features that associate other features to an existing site definition. This is one of the most powerful types of feature since it allows you to add new functionality to existing site definitions. Check the first post SharePoint 2007 Deployment: Overview for an introduction and the series index. Package Structure [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/04/25/sharepoint-2007-deployment-feature-stapling/">SharePoint 2007 Deployment: Feature Stapling</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Summary</h3>
<p>This post is about developing features that associate other features to an existing site definition. This is one of the most powerful types of feature since it allows you to add new functionality to existing site definitions. Check the first post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/02/SharePoint-2007-Deployment_3A00_-Overview.aspx">SharePoint 2007 Deployment: Overview</a> for an introduction and the series index.</p>
<h3>Package Structure</h3>
<p>As I mentioned previously in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/15/SharePoint-2007-Deployment_3A00_-Creating-and-Using-Features.aspx">SharePoint 2007 Deployment: Creating and Using Features</a>, to build a feature you need to create the following files:</p>
<ul>
<li>The <em>feature manifest</em> file (which must be named <code>feature.xml</code>) </li>
<li>One or more <em>element manifest</em> files </li>
</ul>
<p>The <em>feature manifest</em> file contains the generic information about the feature package, and the <em>element manifest</em> files contain the information about each specific type of element that makes up the feature. Since I already explained all the possible contents of the <em>feature manifest</em> file in the above mentioned post, I will focus this one the <em>element manifest</em> that allows the feature stapling (feature site template association).</p>
<p>You can then place these two files inside a <em>Solution</em> following the instructions in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/02/17/SharePoint-2007-Deployment_3A00_-Creating-Solutions.aspx">SharePoint 2007 Deployment: Creating Solutions</a>, to provide an easy way to deploy the feature (or upgrade it).</p>
<h3>Feature Stapling</h3>
<p>Feature stapling is the process of associating features to existing site definitions so that, when a new site is provisioned from that definition the associated features are automatically activated.</p>
<p>This means that you need, at least, two features to do this:</p>
<ul>
<li>The feature (or features) you wish to associate (that is, to staple) to a site definition; </li>
<li>The feature that performs the association (the stapler). </li>
</ul>
<p>The first one can be any feature with scope <em>Site</em> or <em>Web</em>. The second is the one I’m presenting in this post.</p>
<h3>Allowed Scopes</h3>
<p>The scopes to which a feature can be deployed, are dictated by the types of elements included in it. A feature with feature site template association elements can be deployed to <strong>Site Collection</strong>, <strong>Web Application</strong> or <strong>Farm</strong> scopes. </p>
<h3>Feature Manifest</h3>
<p>I will only present a simple feature manifest, since the additional options were presented in the above mentioned post.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature
    </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
    <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">{8213A053-46B0-43f9-B00C-B2A8CF7A3355}</span>&quot;
    <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Feature Stapling</span>&quot;
    <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This feature staples other features to a<br>    site definition.</span>&quot;
    <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Farm</span>&quot;
    <span style="color: red">Creator</span><span style="color: blue">=</span>&quot;<span style="color: blue">Create IT</span>&quot;
    <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Elements.xml</span>&quot;<span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p><p>Notes about this feature manifest:</p>
<ul>
<li>The title of the feature is <em>My Feature Stapling.</em> </li>
<li>It will be deployed as a <strong>Farm </strong>feature, since it&#8217;s <code>Scope</code> value is <code>Farm</code>. By default, SharePoint automatically activates features of this scope. You can, however, override this behaviour by setting the <code>ActivateOnDefault</code> attribute to <code>false</code> on the <code>Feature</code> element. </li>
<li>It references a single <em>element manifest</em> file: <code>Elements.xml</code>. </li>
</ul>
<h3>Element Manifest</h3>
<p>The element manifest file can have any name you wish (in this example it&#8217;s called <code>Elements.xml</code>), but it&#8217;s root element must be <code>&lt;Elements&gt;</code>. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <code>&lt;FeatureSiteTemplateAssociation&gt;</code> element which is used to associate features to existing site definitions.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Elements </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color: blue">&gt;
  &lt;!-- </span><span style="color: green">My Site Columns </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">FeatureSiteTemplateAssociation 
    </span><span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">{CC3144A5-E055-4474-928E-5D21CDE53D38}</span>&quot; 
    <span style="color: red">TemplateName</span><span style="color: blue">=</span>&quot;<span style="color: blue">STS#0</span>&quot; <span style="color: blue">/&gt;
  &lt;!-- </span><span style="color: green">My Content Types </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">FeatureSiteTemplateAssociation 
    </span><span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">{E739683D-ACB8-4187-A764-1323BE76D12D}</span>&quot; 
    <span style="color: red">TemplateName</span><span style="color: blue">=</span>&quot;<span style="color: blue">STS#0</span>&quot; <span style="color: blue">/&gt;
&lt;/</span><span style="color: #a31515">Elements</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>This example associates two features with the <em>Team Site</em> definition. The <code>&lt;FeatureSiteTemplateAssociation&gt;</code> element has no child elements and only two attributes:</p>
<ul>
<li><code>Id</code> &#8211; (required) The GUID of the feature that is to be stapled to the site definition. </li>
<li><code>TemplateName</code> &#8211; (required) The name of the site definition including the configuration Id. For SharePoint’s out-of-the-box site definitions, this attribute can be:
<ul>
<li><code>STS#0</code> (Team Site) </li>
<li><code>STS#1</code> (Blank Site) </li>
<li><code>STS#2</code> (Document Workspace) </li>
<li><code>MPS#0</code> (Basic Meeting Workspace) </li>
<li><code>MPS#1</code> (Blank Meeting Workspace) </li>
<li><code>MPS#2</code> (Decision Meeting Workspace) </li>
<li><code>MPS#3</code> (Social Meeting Workspace) </li>
<li><code>MPS#4</code> (Multipage Meeting Workspace) </li>
<li><code>CENTRALADMIN#0</code> (Central Administration) </li>
<li><code>WIKI#0</code> (Wiki Site) </li>
<li><code>BLOG#0</code> (Blog Site) </li>
<li><code>BDR#0</code> (Document Center) </li>
<li><code>OFFILE#1</code> (Records Center) </li>
<li><code>SPSMSITEHOST#0</code> (My Site Host) </li>
<li><code>SPSMSITE#0</code> (Personalization Site) </li>
<li><code>CMSPUBLISHING#0</code> (Publishing Site) </li>
<li><code>BLANKINTERNET#2</code> (Publishing Site with Workflow) </li>
<li><code>BLANKINTERNETCONTAINER#0</code> (Publishing Portal) </li>
<li><code>SPSPORTAL#0</code> (Collaboration Portal) </li>
<li><code>SPSNHOME#0</code> (News Site) </li>
<li><code>SPSITES#0</code> (Site Directory) </li>
<li><code>SPSREPORTCENTER#0</code> (Report Center) </li>
<li><code>SRCHCEN#0</code> (Search Center with Tabs) </li>
<li><code>SRCHCENTERLITE#0</code> (Search Center) </li>
</ul>
</li>
</ul>
<p>There can be other site definitions depending on which site templates you have installed on your farm. The best way to check which ones you can use is to go to the folder <code>C:\…\12\TEMPLATE\[LCID]\XML</code> where <code>[LCID]</code> represent the Language ID of the site definition you are looking for, and open each <code>webtemp*.xml</code> file.</p>
<p>Each of these files will have the following structure:</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot;<span style="color: blue">?&gt;
&lt;!-- </span><span style="color: green">_lcid=&quot;1033&quot; _version=&quot;12.0.4518&quot; _dal=&quot;1&quot; </span><span style="color: blue">--&gt;
&lt;!-- </span><span style="color: green">_LocalBinding </span><span style="color: blue">--&gt;
&lt;</span><span style="color: #a31515">Templates </span><span style="color: red">xmlns:ows</span><span style="color: blue">=</span>&quot;<span style="color: blue">Microsoft SharePoint</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">Template </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">STS</span>&quot; <span style="color: red">ID</span><span style="color: blue">=</span>&quot;<span style="color: blue">1</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">Configuration </span><span style="color: red">ID</span><span style="color: blue">=</span>&quot;<span style="color: blue">0</span>&quot; 
                   <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">Team Site</span>&quot; 
                   <span style="color: red">Hidden</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot; 
                   <span style="color: red">ImageUrl</span><span style="color: blue">=</span>&quot;<span style="color: blue">/_layouts/images/stsprev.png</span>&quot; 
                   <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">A site for teams to quickly […]</span> 
                   <span style="color: red">DisplayCategory</span><span style="color: blue">=</span>&quot;<span style="color: blue">Collaboration</span>&quot; <span style="color: blue">&gt;          
    &lt;/</span><span style="color: #a31515">Configuration</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">Configuration </span><span style="color: red">ID</span><span style="color: blue">=</span>&quot;<span style="color: blue">1</span>&quot; 
                   <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">Blank Site</span>&quot; 
                   <span style="color: red">Hidden</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot; 
                   <span style="color: red">ImageUrl</span><span style="color: blue">=</span>&quot;<span style="color: blue">/_layouts/images/blankprev.png</span>&quot; 
                   <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">A blank site for you to […]</span> 
                   <span style="color: red">DisplayCategory</span><span style="color: blue">=</span>&quot;<span style="color: blue">Collaboration</span>&quot; 
                   <span style="color: red">AllowGlobalFeatureAssociations</span><span style="color: blue">=</span>&quot;<span style="color: blue">False</span>&quot; <span style="color: blue">&gt;      
    &lt;/</span><span style="color: #a31515">Configuration</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">Configuration </span><span style="color: red">ID</span><span style="color: blue">=</span>&quot;<span style="color: blue">2</span>&quot; 
                   <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">Document Workspace</span>&quot; 
                   <span style="color: red">Hidden</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot; 
                   <span style="color: red">ImageUrl</span><span style="color: blue">=</span>&quot;<span style="color: blue">/_layouts/images/dwsprev.png</span>&quot; 
                   <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">A site for colleagues to work[…]</span> 
                   <span style="color: red">DisplayCategory</span><span style="color: blue">=</span>&quot;<span style="color: blue">Collaboration</span>&quot; <span style="color: blue">&gt;          
    &lt;/</span><span style="color: #a31515">Configuration</span><span style="color: blue">&gt;
    </span>[...]
  <span style="color: blue">&lt;/</span><span style="color: #a31515">Template</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Templates</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>In the sample above you can see the description of the three configurations of the STS site template. To build the <code>TemplateName</code> required for the feature site template association, you get the template name (attribute <code>Name</code> of the element <code>Template</code>), which in this case is <code>STS</code>, add a hash sign (<code>#</code>) and complete the string with the configuration ID (attribute <code>ID</code> of the element <code>Configuration</code>), which in this case can be <code>0</code>, <code>1</code> or <code>2</code>, depending on the chosen configuration.</p>
<h3>Sample</h3>
<p>You can download this sample <a href="http://ydcqka.bay.livefilestore.com/y1p6oIxj6THKZnRIUbgwuVrdTXCYSfMXnCQ9vV5tClPLTY2Oy4onsPFG428MAiXqlVgfeWjJJfW0VmBmr45C47r_MGcdjgT48y8/FeatureStaplingSample.zip?download">here</a>. This sample includes:</p>
<ul>
<li>The solution manifest file (<code>manifest.xml</code>). </li>
<li>The solution cab structure file (<code>solution.ddf</code>). </li>
<li>The feature manifest file (<code>Feature.xml</code>). </li>
<li>The feature site template association element manifest file (<code>Elements.xml</code>). </li>
<li>A batch file (<code>build.bat</code>) that creates the solution package (<code>MyFeatureStapling.wsp</code>). </li>
</ul>
<p><strong>Notice: </strong>This sample is given for illustrative purposes only. Feel free to modify and use it as a template for your solutions and features.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/04/25/sharepoint-2007-deployment-feature-stapling/">SharePoint 2007 Deployment: Feature Stapling</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2009/04/25/sharepoint-2007-deployment-feature-stapling/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint 2007 Deployment: Content Type Binding Features</title>
		<link>https://blogit.create.pt/andrevala/2009/03/31/sharepoint-2007-deployment-content-type-binding-features/</link>
					<comments>https://blogit.create.pt/andrevala/2009/03/31/sharepoint-2007-deployment-content-type-binding-features/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Tue, 31 Mar 2009 17:55:00 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=661</guid>

					<description><![CDATA[<p>Summary This post is about developing features to bind content types to lists that were provisioned through an onet.xml file. Check the first post SharePoint 2007 Deployment: Overview for an introduction and the series index. Package Structure As I mentioned previously in the post SharePoint 2007 Deployment: Creating and Using Features, to build a feature [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/03/31/sharepoint-2007-deployment-content-type-binding-features/">SharePoint 2007 Deployment: Content Type Binding Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Summary</h3>
<p>This post is about developing features to bind content types to lists that were provisioned through an <strong>onet.xml</strong> file. Check the first post <a href="/blogs/andrevala/archive/2007/12/02/SharePoint-2007-Deployment_3A00_-Overview.aspx">SharePoint 2007 Deployment: Overview</a> for an introduction and the series index.</p>
<h3>Package Structure</h3>
<p>As I mentioned previously in the post <a href="/blogs/andrevala/archive/2007/12/15/SharePoint-2007-Deployment_3A00_-Creating-and-Using-Features.aspx">SharePoint 2007 Deployment: Creating and Using Features</a>, to build a feature you need to create the following files:</p>
<ul>
<li>The <em>feature manifest</em> file (which must be named <code>feature.xml</code>) </li>
<li>One or more <em>element manifest</em> files </li>
</ul>
<p>The <em>feature manifest</em> file contains the generic information about the feature package, and the <em>element manifest</em> files contain the information about each specific type of element that makes up the feature. Since I already explained all the possible contents of the <em>feature manifest</em> file in the above mentioned post, I will focus this one the <em>element manifest</em> that allows the binding of content types.</p>
<p>You can then place these two files inside a <em>Solution</em> following the instructions in the post <a href="/blogs/andrevala/archive/2008/02/17/SharePoint-2007-Deployment_3A00_-Creating-Solutions.aspx">SharePoint 2007 Deployment: Creating Solutions</a>, to provide an easy way to deploy the feature (or upgrade it).</p>
<h3>Content Type Binding</h3>
<p>When you provision a list through a feature, using the method explained in the post <a href="/blogs/andrevala/archive/2008/05/17/SharePoint-2007-Deployment_3A00_-List-Template-Features.aspx">SharePoint 2007 Deployment: List Template Features</a>, you can bind a content type to it only by editing the <code>schema.xml</code> file of the list template.</p>
<p>However, if the list was provisioned through a site definition (<code>onet.xml</code> file) and you had no access to its definition, you must do it using a <strong>Content Type Binding</strong> feature element. This can only be used to attach a content type to a list provisioned through a site definition.</p>
<h3>Allowed Scopes</h3>
<p>The scopes to which a feature can be deployed, are dictated by the types of elements included in it. A feature with content type binding elements can only be deployed to a <strong>Site Collection</strong> scope.</p>
<p>Attempting to install a feature of another scope that contains content type binding elements, will result in an error.</p>
<h3>Feature Manifest</h3>
<p>I will only present a simple feature manifest, since the additional options were presented in the above mentioned post.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature
    </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
    <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">{ACDECF85-BDF7-446c-AC1B-C5F133C83F15}</span>&quot;
    <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">Content Type Binding</span>&quot;
    <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This feature binds a content type to the masterpage<br></span><span style="color: blue">gallery.</span>&quot;
    <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Site</span>&quot;
    <span style="color: red">Creator</span><span style="color: blue">=</span>&quot;<span style="color: blue">Create IT</span>&quot;
    <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;<span style="color: blue">&gt;
  
  &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">ContentTypeBinding.xml</span>&quot;<span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Notes about this feature manifest:</p>
<ul>
<li>The title of the feature is <em>Content Type Binding.</em> </li>
<li>It will be deployed as a <strong>Site Collection</strong> feature, since it&#039;s <code>Scope</code> value is <code>Site</code>. </li>
<li>It references a single <em>element manifest</em> file: <code>ContentTypeBinding.xml</code>. </li>
</ul>
<h3>Element Manifest</h3>
<p>The element manifest file can have any name you wish (in this example it&#039;s called <code>ContentTypeBinding.xml</code>), but it&#039;s root element must be <code>&lt;Elements&gt;</code>. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <code>&lt;ContentTypeBinding&gt;</code> element which is used to binding Content Types to list definitions.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Elements </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">ContentTypeBinding
    </span><span style="color: red">ContentTypeId</span><span style="color: blue">=</span>&quot;<span style="color: blue">0x010101</span>&quot;
    <span style="color: red">ListUrl</span><span style="color: blue">=</span>&quot;<span style="color: blue">_catalogs/masterpage</span>&quot; <span style="color: blue">/&gt;
&lt;/</span><span style="color: #a31515">Elements</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a>This example binds the content type <em>Form</em> (which has the ID <code>0x010101</code>) to the master page gallery (which has the URL <code>_catalogs/masterpage</code>). There <code>&lt;ContentTypeBinding&gt;</code> element has no child elements, and only two attributes:</p>
<ul>
<li><code>ContentTypeId</code> &#8211; (required) The ID of the content type that will be bound to a list. </li>
<li><code>ListUrl</code> &ndash; (required) The URL of the list to which the content type will be bound. </li>
</ul>
<h3>Additional Notes</h3>
<p>The content type will be bound to the list definition as soon as the administrator activates this feature on a site collection. However, deactivating the feature will not remove the connection between the content type and the list. If you wish to remove it, you must do so manually.</p>
<h3>Sample</h3>
<p>You can download this sample <a href="http://cid-b4544db7b7183eb8.skydrive.live.com/self.aspx/.Public/Blog%20Data/Content%20Type%20Binding%20Feature/ContentTypeBindingSample.zip">here</a>. This sample includes:</p>
<ul>
<li>The solution manifest file (<code>manifest.xml</code>). </li>
<li>The solution cab structure file (<code>solution.ddf</code>). </li>
<li>The feature manifest file (<code>feature.xml</code>). </li>
<li>The content type binding element manifest file (<code>ContentTypeBinding.xml</code>). </li>
<li>A batch file (<code>build.bat</code>) that creates the solution package (<code>ContentTypeBinding.wsp</code>). </li>
</ul>
<p><strong>Notice: </strong>This sample is given for illustrative purposes only. Feel free to modify and use it as a template for your solutions and features.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/03/31/sharepoint-2007-deployment-content-type-binding-features/">SharePoint 2007 Deployment: Content Type Binding Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2009/03/31/sharepoint-2007-deployment-content-type-binding-features/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint 2007 Deployment: Event Registration Features</title>
		<link>https://blogit.create.pt/andrevala/2009/02/21/sharepoint-2007-deployment-event-registration-features/</link>
					<comments>https://blogit.create.pt/andrevala/2009/02/21/sharepoint-2007-deployment-event-registration-features/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 21 Feb 2009 21:16:00 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=681</guid>

					<description><![CDATA[<p>Summary This post is about developing features to register event receivers. Check the first post SharePoint 2007 Deployment: Overview for an introduction and the series index. Package Structure As I mentioned previously in the post SharePoint 2007 Deployment: Creating and Using Features, to build a feature you need to create the following files: The feature [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/02/21/sharepoint-2007-deployment-event-registration-features/">SharePoint 2007 Deployment: Event Registration Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Summary</h3>
<p>This post is about developing features to register event receivers. Check the first post <a href="/blogs/andrevala/archive/2007/12/02/SharePoint-2007-Deployment_3A00_-Overview.aspx">SharePoint 2007 Deployment: Overview</a> for an introduction and the series index.</p>
<h3>Package Structure</h3>
<p>As I mentioned previously in the post <a href="/blogs/andrevala/archive/2007/12/15/SharePoint-2007-Deployment_3A00_-Creating-and-Using-Features.aspx">SharePoint 2007 Deployment: Creating and Using Features</a>, to build a feature you need to create the following files:</p>
<ul>
<li>The <em>feature manifest</em> file (which must be named <code>feature.xml</code>) </li>
<li>One or more <em>element manifest</em> files </li>
</ul>
<p>The <em>feature manifest</em> file contains the generic information about the feature package, and the <em>element manifest</em> files contain the information about each specific type of element that makes up the feature. Since I already explained all the possible contents of the <em>feature manifest</em> file in the above mentioned post, I will focus this one the <em>element manifest</em> that allows the registration of event receivers.</p>
<p>Additionally, you must include the assembly that contains the <em>event receiver</em> class in the <em>solution package</em>, so that it gets deployed to the <em>Global Assembly Cache</em>. Follow the instructions in the post <a href="/blogs/andrevala/archive/2008/02/17/SharePoint-2007-Deployment_3A00_-Creating-Solutions.aspx">SharePoint 2007 Deployment: Creating Solutions</a> on how to package these three files (both manifests plus the assembly file) on a <em>SharePoint Solution </em>file.</p>
<h3>Events Receivers</h3>
<p>SharePoint allows you to handle several events that are fired according to actions performed on items, lists and web sites. Event are handled through <em>event receivers</em>, which are classes that implement a method for each event that is handled.</p>
<p>Once an <em>event receiver</em> is developed, compiled into an assembly and deployed to the GAC, it must be registered to a content type, a list or a web site in order to handle its events. That can be done through the API (or third-party tool such as <em>Event Handler Explorer</em>) or, concerning item and list event receivers, through this type of feature.</p>
<h3>Allowed Scopes</h3>
<p>The scopes to which a feature can be deployed, are dictated by the types of elements included in it. A feature with event registration elements can only be deployed to <strong>Web Site</strong> scopes.</p>
<h3>Feature Manifest</h3>
<p>I will only present a simple feature manifest, since the additional options were presented in the above mentioned post.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature
    </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
    <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">{282902FB-0369-4f98-93C5-7FD7121CE164}</span>&quot;
    <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Event Receiver</span>&quot;
    <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This feature registers My Event Receiver.</span>&quot;
    <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Web</span>&quot;
    <span style="color: red">Creator</span><span style="color: blue">=</span>&quot;<span style="color: blue">Create IT</span>&quot;
    <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">EventReceivers.xml</span>&quot;<span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p>Notes about this feature manifest:</p>
<ul>
<li>The title of the feature is <em>My Event Receiver.</em> </li>
<li>It will be deployed as a <strong>Web Site </strong>feature, since it&#039;s <code>Scope</code> value is <code>Web</code>. </li>
<li>It references a single <em>element manifest</em> file: <code>EventReceivers.xml</code>. </li>
</ul>
<h3>Element Manifest</h3>
<p>The <em>element manifest</em> file can have any name you wish (in this example it&#039;s called <code>EventReceivers.xml</code>), but it&#039;s root element must be <code>&lt;Elements&gt;</code>. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <code>&lt;Receivers&gt;</code> element which is used to register <em>event receivers</em> that will handle list events.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Elements </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">Receivers 
    </span><span style="color: red">ListTemplateId</span><span style="color: blue">=</span>&quot;<span style="color: blue">3500</span>&quot; 
    <span style="color: red">ListTemplateOwner</span><span style="color: blue">=</span>&quot;<span style="color: blue">{11663D54-6152-4532-ABF5-FC08FAC216A7}</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">Receiver</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">Assembly</span><span style="color: blue">&gt;
        </span>MyEventReceiver, 
        Version=1.0.0.0, 
        Culture=Neutral, 
        PublicKeyToken=6c0c7604915f786e
      <span style="color: blue">&lt;/</span><span style="color: #a31515">Assembly</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">Class</span><span style="color: blue">&gt;</span>MyEventReceiver.MyEventReceiver<span style="color: blue">&lt;/</span><span style="color: #a31515">Class</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">Name</span><span style="color: blue">&gt;</span>My Event Receiver<span style="color: blue">&lt;/</span><span style="color: #a31515">Name</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">Type</span><span style="color: blue">&gt;</span>ItemAdded<span style="color: blue">&lt;/</span><span style="color: #a31515">Type</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">SequenceNumber</span><span style="color: blue">&gt;</span>10000<span style="color: blue">&lt;/</span><span style="color: #a31515">SequenceNumber</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">Receiver</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">Receivers</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Elements</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>&nbsp;</p>
<p>The example above registers an <em>event receiver</em> to all lists based on list template with ID <strong><code>3500</code></strong> that was deployed by a feature with the ID <strong><code>{11663D54-6152-4532-ABF5-FC08FAC216A7}</code></strong>. The receiver is the <strong><code>MyEventReceiver.MyEventReceiver</code></strong> class included in the assembly <strong><code>MyEventReceiver.dll</code></strong> that is installed in the GAC, and it handles the <strong><code>ItemAdded</code></strong> event on these lists.</p>
<p><strong>The Receivers Element</strong></p>
<p>The <code>&lt;Receivers&gt;</code> element is used to specify the list template to which the event receiver will be registered. There can be any number of <code>&lt;Receivers&gt;</code> elements in a single element manifest file. Here is a summary of the possible attributes of this element:</p>
<ul>
<li><strong><code>ListTemplateId</code></strong> &#8211; (required) Specifies the ID of the list template to which the event receiver will be registered. If you wish to register an event receiver to one of SharePoint&rsquo;s list templates, you can use one of the following values:
<ul>
<li>100 &ndash; Generic List </li>
<li>101 &ndash; Document Library </li>
<li>102 &ndash; Survey </li>
<li>103 &ndash; Links List </li>
<li>104 &ndash; Announcements List </li>
<li>105 &ndash; Contacts List </li>
<li>106 &ndash; Events List </li>
<li>107 &ndash; Tasks List </li>
<li>108 &ndash; Discussion Board </li>
<li>109 &ndash; Picture Library </li>
<li>110 &ndash; Data Sources </li>
<li>111 &ndash; Site Template Gallery </li>
<li>112 &ndash; User Information List </li>
<li>113 &ndash; Web Part Gallery </li>
<li>114 &ndash; List Template Gallery </li>
<li>115 &ndash; XML Form Library </li>
<li>116 &ndash; Master Pages Gallery </li>
<li>117 &ndash; No-Code Workflows </li>
<li>118 &ndash; Custom Workflow Process </li>
<li>119 &ndash; Wiki Page Library </li>
<li>120 &ndash; Custom grid for a list </li>
<li>130 &ndash; Data Connection Library </li>
<li>140 &ndash; Workflow History </li>
<li>150 &ndash; Gantt Tasks List </li>
<li>200 &ndash; Meeting Workspace Series List </li>
<li>201 &ndash; Meeting Workspace Agenda List </li>
<li>202 &ndash; Meeting Workspace Attendees List </li>
<li>204 &ndash; Meeting Workspace Decisions List </li>
<li>207 &ndash; Meeting Workspace Objectives List </li>
<li>210 &ndash; Meeting Workspace text box </li>
<li>211 &ndash; Meeting Workspace Things To Bring List </li>
<li>212 &ndash; Meeting Workspace Pages List </li>
<li>301 &ndash; Blog Posts List </li>
<li>302 &ndash; Blog Comments List </li>
<li>303 &ndash; Blog Categories List </li>
<li>1100 &ndash; Issue Tracking </li>
<li>1200 &ndash; Administrator Tasks List </li>
</ul>
</li>
<li><strong><code>ListTemplateOwner</code></strong> &#8211; (optional) Specifies the GUID of the Feature where the list template is defined, or the name of the site definition that registered the list. </li>
</ul>
<p><strong>The Receiver Element</strong></p>
<p>The <code>&lt;Receiver&gt;</code> element specifies which class implements the event receiver and which list event it handles. There can any number <code>&lt;Receiver&gt;</code> child elements inside a <code>&lt;Receivers&gt;</code> parent element. This element has no attributes, but has six child elements, which are listed below:</p>
<ul>
<li><strong><code>Assembly</code></strong> &ndash; The strong name of the assembly that contains the event receiver class. The strong name is composed of the name of the assembly (without the .dll extension), followed by a comma and the assembly version, followed by a comma and the assembly culture, followed by a comma and the assembly&rsquo;s public key token. </li>
<li><strong><code>Class</code></strong> &ndash; The name of the class (including the namespace) that contains the implementation of the event receiver. </li>
<li><strong><code>Name</code></strong> &ndash; The name of the event receiver. This value is used to identify it if you wish to retrieve it through the API. </li>
<li><strong><code>Type</code></strong> &ndash; The event that the event receiver handles. Possible values are:
<ul>
<li><code>ContextEvent</code> &ndash; The list received a context event. </li>
<li><code>EmailReceived</code> &ndash; The list received an e-mail message. </li>
<li><code>FieldAdded</code> &ndash; A field was added to the list. </li>
<li><code>FieldAdding</code> &ndash; A field is being added to the list. </li>
<li><code>FieldDeleted</code> &ndash; A field was removed from the list. </li>
<li><code>FieldDeleting</code> &ndash; A field is being removed from the list. </li>
<li><code>FieldUpdated</code> &ndash; A field was updated in the list. </li>
<li><code>FieldUpdating</code> &ndash; A field is being updated in the list. </li>
<li><code>ItemAdding</code> &ndash; An item is being added to the list. </li>
<li><code>ItemAdded</code> &ndash; An item was added to the list. </li>
<li><code>ItemAttachmentAdded</code> &ndash; An attachment was added to an item. </li>
<li><code>ItemAttachmentAdding</code> &ndash; An attachment is being added to an item. </li>
<li><code>ItemAttachmentDeleted</code> &ndash; An attachment was removed from an item. </li>
<li><code>ItemAttachmentDeleting</code> &ndash; An attachment is being removed from an item. </li>
<li><code>ItemCheckedIn</code> &ndash; An item was checked-in in the list. </li>
<li><code>ItemCheckingIn</code> &ndash; An item is being checked-in in the list. </li>
<li><code>ItemCheckedOut</code> &ndash; An item was checked-out in the list. </li>
<li><code>ItemCheckingOut</code> &ndash; An item is being checked-out in the list. </li>
<li><code>ItemDeleted</code> &ndash; An item was removed from the list. </li>
<li><code>ItemDeleting</code> &ndash; An item is being removed from the list. </li>
<li><code>ItemFileConverted</code> &ndash; A file was converted. </li>
<li><code>ItemFileMoved</code> &ndash; A file was moved. </li>
<li><code>ItemFileMoving</code> &ndash; A file is being moved. </li>
<li><code>ItemUncheckedOut</code> &ndash; An item was unchecked-out in the list. </li>
<li><code>ItemUncheckingOut</code> &ndash; An item is being unchecked-out in the list. </li>
<li><code>ItemUpdated</code> &ndash; An item was updated in the list. </li>
<li><code>ItemUpdating</code> &ndash; An item is being updated in the list. </li>
</ul>
</li>
<li><strong><code>SequenceNumber</code></strong> &ndash; Specifies the order of the event receiver when more than one handler is associated with the same event. A high sequence number (10000 or higher) should be used to prevent problems with SharePoint&rsquo;s own event handlers. </li>
<li><strong><code>Data</code></strong> &ndash; Specifies a string that will be passed as a parameter to the receiver method when handling the event. </li>
</ul>
<h3>Sample</h3>
<p>You can download this sample <a href="http://cid-b4544db7b7183eb8.skydrive.live.com/self.aspx/.Public/Blog%20Data/Event%20Registration%20Feature/EventReceiverFeatureSample.zip" target="_blank">here</a>. This sample includes:</p>
<ul>
<li>The solution manifest file (<code>manifest.xml</code>). </li>
<li>The solution cab structure file (<code>solution.ddf</code>). </li>
<li>The feature manifest file (<code>feature.xml</code>). </li>
<li>The event receiver element manifest file (<code>EventReceivers.xml</code>). </li>
<li>A <strong>fake</strong> assembly (<code>MyEventReceiver.dll</code>) that must be replaced by your own assembly. <strong>Important:</strong> this file is not a real assembly containing an <em>event receiver</em> class, hence it will not work if deployed as is to your Sharepoint environment. </li>
<li>A batch file (<code>build.bat</code>) that creates the solution package (<code>MyEventReceiver.wsp</code>). </li>
</ul>
<p><strong>Notice: </strong>This sample is given for illustrative purposes only and it <u>should not be used</u> as is in your SharePoint environment. Feel free to modify and use it as a template for your solutions and features.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/02/21/sharepoint-2007-deployment-event-registration-features/">SharePoint 2007 Deployment: Event Registration Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2009/02/21/sharepoint-2007-deployment-event-registration-features/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint 2007 Workflow &#8211; Using the OnWorkflowItemDeleted activity</title>
		<link>https://blogit.create.pt/miguelisidoro/2009/02/07/sharepoint-2007-workflow-using-the-onworkflowitemdeleted-activity/</link>
					<comments>https://blogit.create.pt/miguelisidoro/2009/02/07/sharepoint-2007-workflow-using-the-onworkflowitemdeleted-activity/#respond</comments>
		
		<dc:creator><![CDATA[Miguel Isidoro]]></dc:creator>
		<pubDate>Sat, 07 Feb 2009 16:03:48 +0000</pubDate>
				<category><![CDATA[Windows Workflow Foundation]]></category>
		<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[Workflows]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/miguelisidoro/?p=71</guid>

					<description><![CDATA[<p>Introduction One of the most exciting features included in SharePoint 2007 is workflow support and the possibility of developing our own custom workflows (for more information about workflow development in the SharePoint 2007 platform please click here). While it is possible to develop workflows to automate a series of activities without any human intervention, the [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/miguelisidoro/2009/02/07/sharepoint-2007-workflow-using-the-onworkflowitemdeleted-activity/">SharePoint 2007 Workflow &#8211; Using the OnWorkflowItemDeleted activity</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h5>Introduction</h5>
<p>One of the most exciting features included in SharePoint 2007 is workflow support and the possibility of developing our own custom workflows (for more information about workflow development in the SharePoint 2007 platform please click <a href="http://msdn.microsoft.com/en-us/library/ms549489.aspx" target="_blank">here</a>). </p>
<p>While it is possible to develop workflows to automate a series of activities without any human intervention, the full power of workflows in the SharePoint platform can only be achieved with human-oriented workflows. These workflows are characterized by creating and assigning tasks to users that must complete them in order to fulfill the purpose of the workflow. Some examples of out of the box human-oriented workflows that are included with MOSS 2007 are Approval, Collect Feedback and Issue Tracking.</p>
<p>In the SharePoint world, the most common usage of human-oriented workflows is in the context of document libraries, to perform some work when a new document is uploaded into a document library. Typically, in such scenario, tasks are created and assigned to users throughout the workflow lifetime that will complete them until the workflow purpose has been fulfilled. Having the workflow goal to be achieved is the desired and most common scenario, but unexpected actions may occur before the end of the workflow such as a user to delete the document. The following example will show you how to handle this situation in a custom workflow by using the OnWorkflowItemDeleted activity.</p>
<h5>Example</h5>
<p>The OnWorkflowItemDeleted activity can be used within a custom workflow to handle an item deletion in any SharePoint list. In this example, this activity will be used to delete all uncompleted tasks associated with the deleted item. After dragging and dropping the OnWorkflowItemDeleted activity into the workflow designer, the Invoke property must be set to the event handler that will perform the work. </p>
<p>For the purpose of this example, please consider the simple approval workflow in the following image:</p>
<p><img decoding="async" src="http://pic90.picturetrail.com/VOL2147/10903553/19399056/354040008.jpg"> </p>
<p>In this workflow, a parallel activity with two branches is used. One contains the main workflow logic while the other contains a OnWorkflowItemDeleted activity that will handle the item deletion. The Invoke event property was set to be handled by an event handler method called OnWorkflowItemDeleted_Invoked. Let&#8217;s take a look at the code:</p>
<pre class="code"><span style="color: blue">public sealed partial class </span><span style="color: #2b91af">ApprovalWorkflow </span>: SequentialWorkflowActivity
{
    <span style="color: gray">/// &lt;summary&gt;
    /// </span><span style="color: green">Handles the workflow item deleted event.
    </span><span style="color: gray">/// &lt;/summary&gt;
    /// &lt;param name=&quot;sender&quot;&gt;&lt;/param&gt;
    /// &lt;param name=&quot;e&quot;&gt;&lt;/param&gt;
    </span><span style="color: blue">private void </span>OnWorkflowItemDeleted_Invoked(<span style="color: blue">object </span>sender, ExternalDataEventArgs e)
    {
        <span style="color: green">//delete uncompleted tasks when 
        //an item is deleted
        </span>SPWorkflow workflowInstance = 
            workflowProperties.Workflow;
        SPWorkflowTaskCollection taskCollection = 
            GetWorkflowTasks(workflowInstance);
        <span style="color: blue">for </span>(<span style="color: blue">int </span>i = taskCollection.Count; i &gt; 0; i--)
        {
            SPWorkflowTask task = 
                taskCollection[i - 1];
            <span style="color: blue">using </span>(SPWeb web = 
                workflowProperties.Web)
            {
                <span style="color: blue">if </span>(task[SPBuiltInFieldId.TaskStatus]
                    .ToString() != SPResource.GetString
                    (<span style="color: blue">new </span><span style="color: #2b91af">CultureInfo</span>((<span style="color: blue">int</span>)web.Language, <span style="color: blue">false</span>),
                    <span style="color: #a31515">&quot;WorkflowTaskStatusComplete&quot;</span>, <span style="color: blue">new object</span>[0]))
                {
                    task.Delete();
                }
            }
        }
    }

    <span style="color: gray">/// &lt;summary&gt;
    /// </span><span style="color: green">Reads the workflow tasks. This method 
    </span><span style="color: gray">/// </span><span style="color: green">is implemented because the Tasks property
    </span><span style="color: gray">/// </span><span style="color: green">of the SPWorkflow instance takes a 
    </span><span style="color: gray">/// </span><span style="color: green">while to be populated.
    </span><span style="color: gray">/// &lt;/summary&gt;
    </span><span style="color: blue">public static </span>SPWorkflowTaskCollection 
        GetWorkflowTasks(SPWorkflow workflowInstance)
    {
        SPWorkflowTaskCollection taskCollection = <span style="color: blue">null</span>;
        <span style="color: blue">bool </span>tasksPopulated = <span style="color: blue">false</span>;
        <span style="color: blue">while </span>(!tasksPopulated)
        {
            <span style="color: blue">try
            </span>{
                taskCollection = workflowInstance.Tasks;
                tasksPopulated = <span style="color: blue">true</span>;
            }
            <span style="color: blue">catch </span>{ }
        }

        <span style="color: blue">return </span>taskCollection;
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>In the previous example, the following actions are being performed:</p>
<ul>
<li>In the OnWorkflowItemDeleted_Invoked event handler, the workflow instance task collection is obtained by calling the GetWorkflowTasks method;</li>
<li>The task collection is iterated and the each task status is checked to verify if it is still uncompleted;</li>
<li>If so, the task is deleted.</li>
</ul>
<p>The post <a href="https://blogit.create.pt/miguelisidoro/2009/02/07/sharepoint-2007-workflow-using-the-onworkflowitemdeleted-activity/">SharePoint 2007 Workflow &#8211; Using the OnWorkflowItemDeleted activity</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/miguelisidoro/2009/02/07/sharepoint-2007-workflow-using-the-onworkflowitemdeleted-activity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint 2007 &#8211; Updating List Content Types Event Handlers on Site Content Type Update</title>
		<link>https://blogit.create.pt/miguelisidoro/2009/01/11/sharepoint-2007-updating-list-content-types-event-handlers-on-site-content-type-update/</link>
					<comments>https://blogit.create.pt/miguelisidoro/2009/01/11/sharepoint-2007-updating-list-content-types-event-handlers-on-site-content-type-update/#respond</comments>
		
		<dc:creator><![CDATA[Miguel Isidoro]]></dc:creator>
		<pubDate>Sun, 11 Jan 2009 15:53:53 +0000</pubDate>
				<category><![CDATA[SharePoint 2007]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/miguelisidoro/?p=91</guid>

					<description><![CDATA[<p>Introduction One of the areas where the SharePoint 2007 platform (both WSS 3.0 and MOSS 2007) still needs to improve is deployment despite all the major improvements made when compared to its antecessor, the 2003 version. One of the faults I ran recently into is related with updating list content types event handlers when site [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/miguelisidoro/2009/01/11/sharepoint-2007-updating-list-content-types-event-handlers-on-site-content-type-update/">SharePoint 2007 &#8211; Updating List Content Types Event Handlers on Site Content Type Update</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h5>Introduction</h5>
<p>One of the areas where the SharePoint 2007 platform (both WSS 3.0 and MOSS 2007) still needs to improve is deployment despite all the major improvements made when compared to its antecessor, the 2003 version. One of the faults I ran recently into is related with updating list content types event handlers when site content types event handlers are updated.</p>
<p>For those who don&#8217;t know, let&#8217;s start by a brief introduction about content types and explain the difference between a site content type and a list content type. Content types are a new concept introduced in SharePoint 2007 and is basically a reusable collection of settings that can be applied to a certain category of content. Content types basically define the metadata (they are composed by a reusable set of columns called site columns) and behaviors (event handlers, workflows, etc) of a certain category of content. They are stored centrally and are reusable throughout a site or site collection depending on its scope. For more information about content types please click <a href="http://msdn.microsoft.com/en-us/library/ms472236.aspx" target="_blank">here</a>.</p>
<p>So what is the difference between a site content type and a list content type? Probably, the easiest way to explain this is to think of site content types as templates (in the sense that they are reusable) and list content types as instances of those templates. Site content types are defined at the site level and are visible to the site where they are created and all its subsites (this concept is called content type scope) and they are reusable and not bound to any specific list, meaning that they can be associated with any list within the sites under its scope. When a site content type is associated with a list, a copy of the site content type is copied into the list, creating a new instance. This instance is called a list content type.</p>
<h5>Example</h5>
<p>The best approach to deploy content types is to use features (for more information about deploying site content types as a feature please click <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/03/27/SharePoint-2007-Deployment_3A00_-Site-Content-Type-Features.aspx" target="_blank">here</a>). Registering content type event handlers can also be achieved using a feature (check this <a href="http://msdn.microsoft.com/en-us/library/ms475328.aspx" target="_blank">article</a> for more information) or by using Patrick Tisseghem&#8217;s <a href="http://www.u2u.info/Blogs/Patrick/Lists/Posts/Post.aspx?ID=1547" target="_blank">Event Handler Explorer</a>. The problem is when there are already list content types based on a site content type and we need to add a new event handler to it and have all list content types also updated. In my experience, both using the feature model approach or using Patrick&#8217;s application didn&#8217;t update the list content types. The remainder of this post will show you how to do this programmatically.</p>
<p>The following example basically uses a console application to register a event handler and associate it to a content type.</p>
<pre class="code"><span style="color: blue">class </span><span style="color: #2b91af">Program
</span>{
    <span style="color: blue">private const string </span>URL = <span style="color: #a31515">&quot;http://myIntranet&quot;</span>;
    <span style="color: blue">private const string </span>CONTENT_TYPE = <span style="color: #a31515">&quot;MyContentType&quot;</span>;
    <span style="color: blue">private const string </span>EVENT_RECEIVER_NAME = <span style="color: #a31515">&quot;MyEventReceiver&quot;</span>;
    <span style="color: blue">private const string </span>EVENT_RECEIVER_ASSEMBLY =
        <span style="color: #a31515">&quot;MyEventReceivers.MyEventReceiver, MyEventReceiver, &quot; </span>+
        <span style="color: #a31515">&quot;Version=1.0.0.0, Culture=neutral, PublicKeyToken=5989549632a535cf&quot;</span>;
    <span style="color: blue">private const string </span>EVENT_RECEIVER_CLASS_NAME = 
        <span style="color: #a31515">&quot;MyEventReceivers.MyEventReceiver&quot;</span>;

    <span style="color: blue">static void </span>Main(<span style="color: blue">string</span>[] args)
    {
        <span style="color: green">//open site collection
        </span><span style="color: blue">using </span>(<span style="color: #2b91af">SPSite </span>siteCollection = <span style="color: blue">new </span><span style="color: #2b91af">SPSite</span>(URL))
        {
            <span style="color: blue">using </span>(<span style="color: #2b91af">SPWeb </span>site = siteCollection.OpenWeb())
            {
                <span style="color: green">//get content type
                </span><span style="color: #2b91af">SPContentType </span>contentType = 
                    site.ContentTypes[CONTENT_TYPE];
                <span style="color: green">// add ItemUpdating event handler
                </span><span style="color: #2b91af">ContentTypeHelper</span>.AddEventHandler(contentType, 
                    EVENT_RECEIVER_NAME, EVENT_RECEIVER_ASSEMBLY, 
                    EVENT_RECEIVER_CLASS_NAME, 10000, 
                    <span style="color: #2b91af">SPEventReceiverInstallerType</span>.ItemUpdating);

                site.Update();
            }
        }
    }
}</pre>
<pre class="code"><span style="color: blue">internal class </span><span style="color: #2b91af">ContentTypeHelper
</span>{
    <span style="color: gray">/// &lt;summary&gt;
    /// </span><span style="color: green">Register an event handler in a list
    </span><span style="color: gray">/// &lt;/summary&gt;
    /// &lt;param name=&quot;contentType&quot;&gt;</span><span style="color: green">SharePoint Content Type</span><span style="color: gray">&lt;/param&gt;
    /// &lt;param name=&quot;receiverName&quot;&gt;</span><span style="color: green">Event receiver name</span><span style="color: gray">&lt;/param&gt;
    /// &lt;param name=&quot;className&quot;&gt;</span><span style="color: green">Event handler class name</span><span style="color: gray">&lt;/param&gt;
    /// &lt;param name=&quot;sequenceNumber&quot;&gt;</span><span style="color: green">Sequence number</span><span style="color: gray">&lt;/param&gt;
    </span><span style="color: blue">public static void </span>AddEventHandler(<span style="color: #2b91af">SPContentType </span>contentType, 
        <span style="color: blue">string </span>receiverName, <span style="color: blue">string </span>assemblyName, 
        <span style="color: blue">string </span>className, <span style="color: #2b91af">Int32 </span>sequenceNumber, 
        <span style="color: #2b91af">SPEventReceiverInstallerType </span>eventReceiverInstallerType)
    {
        <span style="color: green">//get assembly full name
        </span><span style="color: blue">string </span>assemblyFullName = System.Reflection.<span style="color: #2b91af">Assembly
            </span>.GetAssembly(<span style="color: #2b91af">Type</span>.GetType(assemblyName)).FullName;

        <span style="color: green">// remove existing event handlers
        </span>RemoveEventHandlers(contentType, assemblyFullName);

        <span style="color: #2b91af">SPEventReceiverDefinition </span>receiverDefinition = <span style="color: blue">null</span>;

        <span style="color: green">//ItemAdding event handler
        </span><span style="color: blue">if </span>(<span style="color: #2b91af">SPEventReceiverInstallerTypeHelper</span>.CheckOption
            (eventReceiverInstallerType, 
            <span style="color: #2b91af">SPEventReceiverInstallerType</span>.ItemAdding))
        {
            <span style="color: green">// add ItemAdding event handler
            </span>receiverDefinition = contentType.EventReceivers.Add();
            receiverDefinition.Name = receiverName;
            receiverDefinition.Type = 
                <span style="color: #2b91af">SPEventReceiverType</span>.ItemAdding;
            receiverDefinition.Assembly = assemblyFullName;
            receiverDefinition.Class = className;
            receiverDefinition.SequenceNumber = sequenceNumber;
            receiverDefinition.Update();
        }

        <span style="color: green">//ItemAdded event handler
        </span><span style="color: blue">if </span>(<span style="color: #2b91af">SPEventReceiverInstallerTypeHelper</span>.CheckOption
            (eventReceiverInstallerType, 
            <span style="color: #2b91af">SPEventReceiverInstallerType</span>.ItemAdded))
        {
            <span style="color: green">// add ItemAdded event handler
            </span>receiverDefinition = contentType.EventReceivers.Add();
            receiverDefinition.Name = receiverName;
            receiverDefinition.Type = 
                <span style="color: #2b91af">SPEventReceiverType</span>.ItemAdded;
            receiverDefinition.Assembly = assemblyFullName;
            receiverDefinition.Class = className;
            receiverDefinition.SequenceNumber = sequenceNumber;
            receiverDefinition.Update();
        }

        <span style="color: green">//ItemUpdating event handler
        </span><span style="color: blue">if </span>(<span style="color: #2b91af">SPEventReceiverInstallerTypeHelper</span>.CheckOption
            (eventReceiverInstallerType, 
            <span style="color: #2b91af">SPEventReceiverInstallerType</span>.ItemUpdating))
        {
            <span style="color: green">// add ItemUpdating event handler
            </span>receiverDefinition = contentType.EventReceivers.Add();
            receiverDefinition.Name = receiverName;
            receiverDefinition.Type = 
                <span style="color: #2b91af">SPEventReceiverType</span>.ItemUpdating;
            receiverDefinition.Assembly = assemblyFullName;
            receiverDefinition.Class = className;
            receiverDefinition.SequenceNumber = sequenceNumber;
            receiverDefinition.Update();
        }

        <span style="color: green">//ItemUpdated event handler
        </span><span style="color: blue">if </span>(<span style="color: #2b91af">SPEventReceiverInstallerTypeHelper</span>.CheckOption
            (eventReceiverInstallerType, 
            <span style="color: #2b91af">SPEventReceiverInstallerType</span>.ItemUpdated))
        {
            <span style="color: green">// add ItemUpdating event handler
            </span>receiverDefinition =contentType.EventReceivers.Add();
            receiverDefinition.Name = receiverName;
            receiverDefinition.Type = 
                <span style="color: #2b91af">SPEventReceiverType</span>.ItemUpdated;
            receiverDefinition.Assembly = assemblyFullName;
            receiverDefinition.Class = className;
            receiverDefinition.SequenceNumber = sequenceNumber;
            receiverDefinition.Update();
        }

        <span style="color: green">//ItemCheckingIn event handler
        </span><span style="color: blue">if </span>(<span style="color: #2b91af">SPEventReceiverInstallerTypeHelper</span>.
            CheckOption(eventReceiverInstallerType, 
            <span style="color: #2b91af">SPEventReceiverInstallerType</span>.ItemCheckingIn))
        {
            <span style="color: green">// add ItemCheckingIn event handler
            </span>receiverDefinition = contentType.EventReceivers.Add();
            receiverDefinition.Name = receiverName;
            receiverDefinition.Type = 
                <span style="color: #2b91af">SPEventReceiverType</span>.ItemCheckingIn;
            receiverDefinition.Assembly = assemblyFullName;
            receiverDefinition.Class = className;
            receiverDefinition.SequenceNumber = sequenceNumber;
            receiverDefinition.Update();
        }

        <span style="color: green">//ItemCheckedIn event handler
        </span><span style="color: blue">if </span>(<span style="color: #2b91af">SPEventReceiverInstallerTypeHelper</span>.CheckOption
            (eventReceiverInstallerType, 
            <span style="color: #2b91af">SPEventReceiverInstallerType</span>.ItemCheckedIn))
        {
            <span style="color: green">// add ItemCheckedIn event handler
            </span>receiverDefinition = contentType.EventReceivers.Add();
            receiverDefinition.Name = receiverName;
            receiverDefinition.Type = 
                <span style="color: #2b91af">SPEventReceiverType</span>.ItemCheckedIn;
            receiverDefinition.Assembly = assemblyFullName;
            receiverDefinition.Class = className;
            receiverDefinition.SequenceNumber = sequenceNumber;
            receiverDefinition.Update();
        }

        <span style="color: green">//update content type - setting the updateChildren 
        //parameter to true will update list content types
        </span><strong>contentType.Update(<span style="color: blue">true</span>);</strong>
    }

    <span style="color: gray">/// &lt;summary&gt;
    /// </span><span style="color: green">Remove an event handler registration from a list.
    </span><span style="color: gray">/// &lt;/summary&gt;
    /// &lt;param name=&quot;list&quot;&gt;</span><span style="color: green">SharePoint list</span><span style="color: gray">&lt;/param&gt;
    /// &lt;param name=&quot;receiverClass&quot;&gt;</span><span style="color: green">Event receiver class name</span><span style="color: gray">&lt;/param&gt;
    </span><span style="color: blue">internal static void </span>RemoveEventHandlers(
        <span style="color: #2b91af">SPContentType </span>contentType, 
        <span style="color: blue">string </span>receiverClass)
    {
        <span style="color: #2b91af">SPEventReceiverDefinition </span>receiverDefinition = <span style="color: blue">null</span>;

        <span style="color: green">// cycle through all the receiver definitions and 
        //delete the receiver with the supplied class name
        </span><span style="color: blue">for </span>(<span style="color: blue">int </span>i = contentType.EventReceivers.Count - 1;
            i &gt;= 0; i--)
        {
            receiverDefinition = contentType.EventReceivers[i];
            <span style="color: blue">if </span>(receiverDefinition.Class == receiverClass)
            {
                receiverDefinition.Delete();
            }
        }
    }
}</pre>
<p>The statement that does the trick is &quot;contentType.Update(<span style="color: blue">true</span>);&quot; in the end of the AddEventHandler method. Setting the updateChildren parameter of this method to true will update list content types.</p>
<p>The post <a href="https://blogit.create.pt/miguelisidoro/2009/01/11/sharepoint-2007-updating-list-content-types-event-handlers-on-site-content-type-update/">SharePoint 2007 &#8211; Updating List Content Types Event Handlers on Site Content Type Update</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/miguelisidoro/2009/01/11/sharepoint-2007-updating-list-content-types-event-handlers-on-site-content-type-update/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint 2007 Deployment: Module Features</title>
		<link>https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/</link>
					<comments>https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 10 Jan 2009 19:41:22 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[Web Parts]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=741</guid>

					<description><![CDATA[<p>Summary This post is about developing features to deploy files in a SharePoint site (module features). Check the first post SharePoint 2007 Deployment: Overview for an introduction and the series index. Package Structure As I mentioned previously in the post SharePoint 2007 Deployment: Creating and Using Features, to build a feature you need to create [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/">SharePoint 2007 Deployment: Module Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Summary</h3>
<p>This post is about developing features to deploy files in a SharePoint site (module features). Check the first post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/02/SharePoint-2007-Deployment_3A00_-Overview.aspx">SharePoint 2007 Deployment: Overview</a> for an introduction and the series index.</p>
<h3>Package Structure</h3>
<p>As I mentioned previously in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/15/SharePoint-2007-Deployment_3A00_-Creating-and-Using-Features.aspx">SharePoint 2007 Deployment: Creating and Using Features</a>, to build a feature you need to create the following files:</p>
<ul>
<li>The <em>feature manifest</em> file (which must be named <code>feature.xml</code>) </li>
<li>One or more <em>element manifest</em> files </li>
</ul>
<p>The <em>feature manifest</em> file contains the generic information about the feature package, and the <em>element manifest</em> files contain the information about each specific type of element that makes up the feature. Since I already explained all the possible contents of the <em>feature manifest</em> file in the above mentioned post, I will focus this one the <em>element manifest</em> that allows the provisioning of files (<em>modules</em>)<em>&#160;</em>in a SharePoint site.</p>
<p>You can then place these two files inside a <em>Solution</em> following the instructions in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/02/17/SharePoint-2007-Deployment_3A00_-Creating-Solutions.aspx">SharePoint 2007 Deployment: Creating Solutions</a>, to provide an easy way to deploy the feature (or upgrade it).</p>
<h3>Modules</h3>
<p>Modules are collections of files that must be provisioned in a SharePoint web site. This type of feature element can be used to:</p>
<ul>
<li>Add pages to a web site </li>
<li>Add web parts to a web site&#8217;s web part gallery </li>
<li>Add web parts to a web part page </li>
<li>Add documents to a document library </li>
<li>Add style sheets to the a web sites style library </li>
</ul>
<p>According to the documentation, WSS 3.0 supports provisioning a maximum of 1000 files through module feature elements (whether using a single module element with 1000 files, or 1000 module elements each with a single file).</p>
<h3>Allowed Scopes</h3>
<p>The scopes to which a feature can be deployed, are dictated by the types of elements included in it. A feature with module elements can be deployed to <strong>Site Collection</strong> and <strong>Web Site</strong> scopes, since they represent files that are to be placed in web sites.</p>
<h3>Feature Manifest</h3>
<p>I will only present a simple feature manifest, since the additional options were presented in the above mentioned post.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature
  </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
  <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Module Feature</span>&quot;
  <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">17E94729-EF3E-4f43-9385-88E1201F91E0</span>&quot;
  <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This feature adds files to the web site.</span>&quot;
  <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;
  <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Web</span>&quot;
  <span style="color: red">Hidden</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot;
  <span style="color: red">DefaultResourceFile</span><span style="color: blue">=</span>&quot;<span style="color: blue">core</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Modules.xml</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">default.aspx</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyMasterPage.master</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocument.docx</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyWebPart\MyWebPart.webpart</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyStyles.css</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Notes about this feature manifest:</p>
<ul>
<li>The title of the feature is <em>My Module Feature.</em> </li>
<li>It will be deployed as a <strong>Web Site </strong>feature, since it&#8217;s <code>Scope</code> value is <code>Web</code>. </li>
<li>It references a single <em>element manifest</em> file: <code>Modules.xml</code>. </li>
<li>It references several <em>element file</em> files. You must reference separately, using these elements, each file you wish to include in the module. </li>
</ul>
<h3>Element Manifest</h3>
<p>The <em>element manifest</em> file can have any name you wish (in this example it&#8217;s called <code>Module.xml</code>), but it&#8217;s root element must be <code>&lt;Elements&gt;</code>. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <code>&lt;Module&gt;</code> element which is used to deploy Files to SharePoint web sites.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot;<span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Elements </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color: blue">&gt;
    
    &lt;!-- </span><span style="color: green">Page Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Pages</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;&quot; <span style="color: red">Path</span><span style="color: blue">=</span>&quot;&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">default.aspx</span>&quot; 
              <span style="color: red">NavBarHome</span><span style="color: blue">=</span>&quot;<span style="color: blue">True</span>&quot; 
              <span style="color: red">IgnoreIfAlreadyExists</span><span style="color: blue">=</span>&quot;<span style="color: blue">TRUE</span>&quot; 
              <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">Ghostable</span>&quot;<span style="color: blue">&gt;

            &lt;!-- </span><span style="color: green">Places Web Part on Page </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">AllUsersWebPart </span><span style="color: red">WebPartZoneID</span><span style="color: blue">=</span>&quot;<span style="color: blue">Left</span>&quot; <span style="color: red">WebPartOrder</span><span style="color: blue">=</span>&quot;<span style="color: blue">1</span>&quot;<span style="color: blue">&gt;
                &lt;![CDATA[
                  </span><span style="color: gray">&lt;webParts&gt;
                    &lt;webPart xmlns=&quot;http://schemas.microsoft.com/WebPart/v3&quot;&gt;
                      &lt;metaData&gt;
                        &lt;type name=&quot;MyWebPart, 
                                    MyWebPart.MyWebPart, 
                                    Version=1.0.0.0, 
                                    Culture=neutral, 
                                    PublicKeyToken=1255988569cf0248&quot; /&gt;
                        &lt;importErrorMessage&gt;
                            Cannot import My Web Part.
                        &lt;/importErrorMessage&gt;
                      &lt;/metaData&gt;
                      &lt;data&gt;
                        &lt;properties&gt;
                          &lt;property name=&quot;Title&quot; type=&quot;string&quot;&gt;
                            My Web Part
                          &lt;/property&gt;
                        &lt;/properties&gt;
                      &lt;/data&gt;
                    &lt;/webPart&gt;
                  &lt;/webParts&gt;
                </span><span style="color: blue">]]&gt;
            &lt;/</span><span style="color: #a31515">AllUsersWebPart</span><span style="color: blue">&gt;
            
            &lt;!-- </span><span style="color: green">Places a List View for a Discussion Board </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">View </span><span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">Lists/Discussions</span>&quot; 
                  <span style="color: red">BaseViewID</span><span style="color: blue">=</span>&quot;<span style="color: blue">4</span>&quot; 
                  <span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Discussions</span>&quot; 
                  <span style="color: red">WebPartZoneID</span><span style="color: blue">=</span>&quot;<span style="color: blue">Left</span>&quot; 
                  <span style="color: red">WebPartOrder</span><span style="color: blue">=</span>&quot;<span style="color: blue">2</span>&quot;<span style="color: blue">/&gt;

            &lt;!-- </span><span style="color: green">Places a List View for a Document Library </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">View </span><span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocuments</span>&quot; 
                  <span style="color: red">BaseViewID</span><span style="color: blue">=</span>&quot;<span style="color: blue">10</span>&quot; 
                  <span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Documents</span>&quot; 
                  <span style="color: red">WebPartZoneID</span><span style="color: blue">=</span>&quot;<span style="color: blue">Left</span>&quot; 
                  <span style="color: red">WebPartOrder</span><span style="color: blue">=</span>&quot;<span style="color: blue">3</span>&quot;<span style="color: blue">/&gt;

            &lt;!-- </span><span style="color: green">Customizes Navigation </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">NavBarPage </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">$Resources:core,nav_Home;</span>&quot; 
                        <span style="color: red">ID</span><span style="color: blue">=</span>&quot;<span style="color: blue">1002</span>&quot; 
                        <span style="color: red">Position</span><span style="color: blue">=</span>&quot;<span style="color: blue">Start</span>&quot; <span style="color: blue">/&gt;
        &lt;/</span><span style="color: #a31515">File</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;
    
    &lt;!-- </span><span style="color: green">Master Page Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Master Pages</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">116</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">_catalogs/masterpage</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyMasterPage.master</span>&quot; <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;

    &lt;!-- </span><span style="color: green">Document Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Documents</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">101</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocuments</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocument.docx</span>&quot; <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;

    &lt;!-- </span><span style="color: green">Web Part Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">WebParts</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">113</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">_catalogs/wp</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Path</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyWebPart\MyWebPart.webpart</span>&quot;
              <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyWebPart.webpart</span>&quot;
              <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;

    &lt;!-- </span><span style="color: green">Style Sheet Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Stylesheets</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">101</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">Style Library</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyStyles.css</span>&quot; <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Elements</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p><p>The example above provisions five different files in a SharePoint web site:</p>
<ul>
<li>An ASPX web page (web part page) to the root of the web site. This web page contains:
<ul>
<li>A MyWebPart Web Part (on web part zone Left) </li>
<li>A List View Web Part that shows a view of a discussion board list </li>
<li>A List View Web Part that shows a view of a document library </li>
</ul>
</li>
<li>A Master Page to the Master Page Gallery of the web site </li>
<li>A document to a Document Library of the web site </li>
<li>A web part to the Web Part Gallery of the web site </li>
<li>A style sheet to the Style Library of the web site </li>
</ul>
<p><strong>The Module Element</strong></p>
<p>The <strong><code>&lt;Module&gt;</code></strong> element is used to specify a Module. There can be any number of modules in a single element manifest. Here is a summary of the possible attributes of this element:</p>
<ul>
<li><strong><code>IncludeFolders</code></strong> &#8211; (optional) I could figure out what this attribute is for&#8230; </li>
<li><strong><code>List</code></strong> &#8211; (optional) Type of list where the files included in this module should be provisioned (check the possible values on my post about <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/05/17/SharePoint-2007-Deployment_3A00_-List-Template-Features.aspx" target="_blank">List Template Features</a>). </li>
<li><strong><code>Name</code></strong> &#8211; (required) Name of the module (file set). </li>
<li><strong><code>Path</code></strong> &#8211; (optional) Specifies the physical path of the files, inside the feature folder (<code>C:\Program Files\...\12\TEMPLATE\FEATURES\</code>[feature]). By default, SharePoint assumes the files are in the same folder as the element manifest file. You can also specify the path on each <strong><code>&lt;File&gt;</code></strong> element (see below). </li>
<li><strong><code>RootWebOnly</code></strong> &#8211; (optional) Boolean value. If <strong><code>TRUE</code></strong> it specifies that the files in this module will only be provisioned on the root web site of a site collection. </li>
<li><strong><code>SetupPath</code></strong> &#8211; (optional) Specifies the physical path to a folder, inside SharePoint&#8217;s setup folder (<code>C:\Program Files\...\12\TEMPLATE</code>), that contains the files included in the module. </li>
<li><strong><code>Url</code></strong> &#8211; (optional) Specifies the virtual path of the folder in which to place the files of the module. This attribute is also used to provision a folder inside a list. If the <strong><code>Path</code></strong> is not specified, the value of this attribute will be used for the physical path also. </li>
</ul>
<p><strong>The File Element</strong></p>
<p>The <strong><code>&lt;File&gt;</code></strong> element is used to specify a file inside a module. There can be any number of <strong><code>&lt;File&gt;</code></strong> elements inside a <strong><code>&lt;Module&gt;</code></strong> element. See below a list of the possible attributes of this element:</p>
<ul>
<li><strong><code>IgnoreIfAlreadyExists</code></strong> &#8211; (optional) Boolean value. If <strong><code>TRUE</code></strong> it specifies that the file should be provisioned even if it already exists on the destination URL. </li>
<li><strong><code>Name</code></strong> &#8211; (optional) Specifies the virtual path for the file. </li>
<li><strong><code>NavBarHome</code></strong> &#8211; (optional) Boolean value. If <strong><code>TRUE</code></strong> it specifies that the file will be the destination of the <em>Home</em> link, used in the web site&#8217;s navigation. This attribute is only used for web pages. </li>
<li><strong><code>Path</code></strong> &#8211; (optional) Physical path to the file, inside the feature folder (<code>C:\Program Files\...\12\TEMPLATE\FEATURES\</code>[feature]). This attribute is used if you need to specify a different path for each file inside the module. Otherwise, you can use the <strong><code>Path</code></strong> attribute on the <strong><code>Module</code></strong> element. </li>
<li><strong><code>Type</code></strong> &#8211; (optional) Specifies if the file is to be stored in a Document Library (in this case the value should be <strong><code>GhostableInLibrary</code></strong>) or outside of a list (in this case the value should be <strong><code>Ghostable</code></strong>). </li>
<li><strong><code>Url</code></strong> &#8211; (required) Specifies the virtual path for the file. If <strong><code>Name</code></strong> is specified, then the value of this attribute is ignored. However, if <strong><code>Path</code></strong> is not specified, the value of this attribute will be used for the physical path. </li>
</ul>
<p><strong>The AllUsersWebPart Element</strong></p>
<p>The <strong><code>&lt;AllUsersWebPart&gt;</code></strong> element is used when you want to add a generic web part (non-List View web part) to a web part page. It can only be used inside a <strong><code>&lt;File&gt;</code></strong> element that provisions a web part page file. It has only two attributes:</p>
<ul>
<li><strong><code>WebPartOrder</code></strong> &#8211; (required) Specifies the vertical position of the web part inside a web part zone. </li>
<li><strong><code>WebPartZoneID</code></strong> &#8211; (required) Specifies the name of the web part zone. </li>
</ul>
<p>Inside this element, you can place a <code>CDATA</code> element with the web part&#8217;s XML description, either using the DWP file schema (also called V2) or the WEBPART file schema (also called V3).</p>
<p><strong>The View Element</strong></p>
<p>The <strong><code>&lt;View&gt;</code></strong> element is used when you want to add a List View Web Part to a web part page. It can only be used inside a <strong><code>&lt;File&gt;</code></strong> element that provisions a web part page file. It has a lot of possible attributes, but I will only list the most common:</p>
<ul>
<li><strong><code>List</code></strong> &#8211; (optional) Specifies either the template type of the list (an integer value) or the URL of a list provisioned in the web site (a string value). On most cases, you should use the URL, since there might be two lists of the same type on the web site. </li>
<li><strong><code>BaseViewID</code></strong> &#8211; (optional) Specifies the ID of the list view to be used. </li>
<li><code><strong>Name</strong></code> &#8211; (optional) Specifies the name of the view. </li>
<li><strong><code>WebPartOrder</code></strong> &#8211; (required) Specifies the vertical position of the web part inside a web part zone. </li>
<li><strong><code>WebPartZoneID</code></strong> &#8211; (required) Specifies the name of the web part zone. </li>
</ul>
<p><strong>The NavBarPage Element</strong></p>
<p>The <strong><code>&lt;NavBarPage&gt;</code></strong> element is used to define how the navigation items should be created so that other pages link to this one. It can only be used inside a <strong><code>&lt;File&gt;</code></strong> element that provisions a web page file. It has three attributes:</p>
<ul>
<li><strong><code>ID</code></strong> &#8211; (required) Specifies the ID for the page. This ID will be used by other pages when defining the relative position of the navigation items. </li>
<li><strong><code>Name</code></strong> &#8211; (required) Specifies the text that is displayed in the navigation area of other pages that link to this one. </li>
<li><strong><code>Position</code></strong> &#8211; (optional) Specifies the position of the navigation item on the navigation area of other pages that link to this one. This attribute can have the following possible values:
<ul>
<li><strong><code>Start</code></strong> &#8211; Add the node to the start of the top navigation area. </li>
<li><strong><code>End</code></strong> &#8211; Add the node to the end of the top navigation area. </li>
<li>Number between <strong>1001</strong> and <strong>2000</strong> &#8211; Add the node after another <code>NavBarPage</code> element whose ID matches the number. </li>
</ul>
</li>
</ul>
<p><strong>The Property Element</strong></p>
<p>The <code><strong>&lt;Property&gt;</strong></code> element is used only inside the <code><strong>&lt;File&gt;</strong></code> element, to define the value of one or more properties of that file, once it is provisioned. It&#8217;s mostly used to set properties of web part files or document files. It has only two attributes:</p>
<ul>
<li><strong><code>Name</code></strong> &#8211; (required) Name of the property to be set. </li>
<li><strong><code>Value</code></strong> &#8211; (required) Value to set the property with. </li>
</ul>
<h3></h3>
<h3>Additional Notes</h3>
<p>The files included in a module feature element are provisioned in the web site where the feature is activated. However, when the feature is deactivated, the files that belong to the module element are <u>not</u> removed.</p>
<p>You can learn a lot about modules by looking inside the <code>onet.xml</code> files included in each site template (look in <code>C:\Program Files\...\12\TEMPLATE\SiteTemplates</code>). These files include a <code>&lt;Modules&gt;</code> element which shares the same schema as the Module Features.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/">SharePoint 2007 Deployment: Module Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #24: Changing a Web Site&#8217;s Navigation Settings</title>
		<link>https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/</link>
					<comments>https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 06 Dec 2008 16:30:55 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=761</guid>

					<description><![CDATA[<p>Changing a web site&#8217;s navigation settings is pretty easy using the SharePoint user interface. You just click the Site Actions button, select the Site Settings option, and click on Navigation. But how do you do it programmatically? Most navigation options on a SharePoint web site are manipulated through the SPWeb object&#8217;s property bag. Set the [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/">SharePoint Tip #24: Changing a Web Site&#8217;s Navigation Settings</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Changing a web site&#8217;s navigation settings is pretty easy using the SharePoint user interface. You just click the Site Actions button, select the Site Settings option, and click on Navigation. But how do you do it programmatically?</p>
<p>Most navigation options on a SharePoint web site are manipulated through the <strong><code>SPWeb</code></strong> object&#8217;s property bag. Set the following properties to configure a web site&#8217;s navigation settings:</p>
<ul>
<li><strong><code>__IncludeSubSitesInNavigation</code></strong>: Set this property to <strong><code>True</code></strong> to show the subsites of the current site on the global and current navigation menus. Set it to <strong><code>False</code></strong> to hide the subsites. </li>
<li><strong><code>__IncludePagesInNavigation</code></strong>: Set this property to <strong><code>True</code></strong> to show the pages on the global and current navigation menus. Set it to <strong><code>False</code></strong> to hide the pages. </li>
<li><strong><code>__InheritCurrentNavigation</code></strong>: Set this property to <strong><code>True</code></strong> to display the same navigations items as the parent site in the current navigation menu. Set it to <strong><code>False</code></strong> to display only items from the current site and subsites. </li>
<li><strong><code>__NavigationShowSiblings</code></strong>: Set this property to <strong><code>True</code></strong> to display the navigation items below the current site and the current site&#8217;s siblings, in the current navigation menu. </li>
<li><strong><code>__NavigationOrderingMethod</code></strong>: Set this property to one of the following values:
<ul>
<li><strong><code>0</code></strong>: Sort the navigation items automatically </li>
<li><strong><code>1</code></strong>: Sort the subsites manually but the pages automatically </li>
<li><strong><code>2</code></strong>: Sort the navigation items manually </li>
</ul>
</li>
<li><strong><code>__NavigationAutomaticSortingMethod</code></strong>: When using automatic ordering, set this property to one of the following values:
<ul>
<li><strong><code>0</code></strong>: Sort by Title </li>
<li><strong><code>1</code></strong>: Sort by Created Date </li>
<li><strong><code>2</code></strong>: Sort by Last Modified Date </li>
</ul>
</li>
<li><strong><code>__NavigationSortAscending</code></strong>: When using automatic ordering, set this property to <strong><code>True</code></strong> if the automatic sorting of the navigation items should be done in ascending order. Set it to <strong><code>False</code></strong> to use descending order. </li>
</ul>
<p><strong>Note:</strong> there are two underscore characters (<code>_</code>) in each property name.</p>
<p><strong>Example      <br /></strong>In the example below, I&#8217;m setting the navigation options to:</p>
<ul>
<li>Show only the current site&#8217;s navigation items in the global navigation </li>
<li>Show the current site&#8217;s sub sites in the global navigation </li>
<li>Don&#8217;t show the pages in the global navigation </li>
<li>Show only the current site&#8217;s navigation items in the current navigation </li>
<li>Don&#8217;t show the current site&#8217;s siblings in the current navigation </li>
<li>Sort the navigation items manually </li>
</ul>
<blockquote>
<pre class="code"><span style="color: green">// break inheritance of global navigation
</span>web.Navigation.UseShared = <span style="color: blue">false</span>;

<span style="color: green">// show subwebs but don't show pages in global navigation
</span>web.AllProperties[<span style="color: #a31515">&quot;__IncludeSubSitesInNavigation&quot;</span>] = <span style="color: #a31515">&quot;True&quot;</span>;
web.AllProperties[<span style="color: #a31515">&quot;__IncludePagesInNavigation&quot;</span>] = <span style="color: #a31515">&quot;False&quot;</span>;

<span style="color: green">// show only current site's navigation items in current navigation
</span>web.AllProperties[<span style="color: #a31515">&quot;__InheritCurrentNavigation&quot;</span>] = <span style="color: #a31515">&quot;False&quot;</span>;
web.AllProperties[<span style="color: #a31515">&quot;__NavigationOrderingMethod&quot;</span>] = <span style="color: #a31515">&quot;2&quot;</span>;
web.AllProperties[<span style="color: #a31515">&quot;__NavigationShowSiblings&quot;</span>] = <span style="color: #a31515">&quot;False&quot;</span>;
web.Update();</pre>
</blockquote>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/">SharePoint Tip #24: Changing a Web Site&#8217;s Navigation Settings</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2008/12/06/sharepoint-tip-24-changing-a-web-sites-navigation-settings/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #20: Get User Profile</title>
		<link>https://blogit.create.pt/andrevala/2008/10/14/sharepoint-tip-20-get-user-profile/</link>
					<comments>https://blogit.create.pt/andrevala/2008/10/14/sharepoint-tip-20-get-user-profile/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Tue, 14 Oct 2008 17:58:00 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=841</guid>

					<description><![CDATA[<p>User Profiles are a central concept to Office SharePoint Server 2007. They store all the information about the SharePoint users in a central location, the User Profile Store, allowing that information to be indexed and searched. The User Profile store can be populated and synchronized with several data sources: Active Directory directory services LADP Directory [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/14/sharepoint-tip-20-get-user-profile/">SharePoint Tip #20: Get User Profile</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>User Profiles</strong> are a central concept to Office SharePoint Server 2007. They store all the information about the SharePoint users in a central location, the User Profile Store, allowing that information to be indexed and searched. The User Profile store can be populated and synchronized with several data sources:</p>
<ul>
<li>Active Directory directory services</li>
<li>LADP Directory (other than Active Directory)</li>
<li>Databases and web services, via Business Data Catalog</li>
<li>Custom sources, via the User Profiles object model</li>
</ul>
<p>You can also add users to it manually. Additionally, you can add custom properties to the User Profile and map some of them to the data sources you have. This great flexibility allows a multitude of scenarios. In this post I&#039;ll show you how you can get access a User Profile programmatically.</p>
<p>Everything is starts with the <strong>UserProfileManager</strong> object. Here is how you use it to get a <strong>UserProfile</strong> object.</p>
<pre class="code"><span style="color: green">// open a site collection
</span><span style="color: blue">using </span>(<span style="color: #2b91af">SPSite </span>site = <span style="color: blue">new </span><span style="color: #2b91af">SPSite</span>(<span style="color: #a31515">&quot;http://myportal&quot;</span>))
{
    <span style="color: green">// get the server context
    </span><span style="color: #2b91af">ServerContext </span>context = <span style="color: #2b91af">ServerContext</span>.GetContext(site);

    <span style="color: green">// create the profile manager object
    </span><span style="color: #2b91af">UserProfileManager </span>profileManager = <span style="color: blue">new </span><span style="color: #2b91af">UserProfileManager</span>(context);

    <span style="color: green">// get the user profile
    </span><span style="color: #2b91af">UserProfile </span>profile = profileManager.GetUserProfile(<span style="color: #a31515">&quot;domain\\username&quot;</span>);
}</pre>
<p>There constructor for the <strong>UserProfileManager</strong> class is overloaded, which means there are other ways to create an instance but this is the way I usually do it. The <strong>GetUserProfile</strong> method is also overloaded, allowing you to get a user profile using its ID or just getting the current user&#039;s profile.</p>
<p><strong>Attention:</strong> User Profiles are a MOSS only feature. You cannot use them with WSS.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/10/14/sharepoint-tip-20-get-user-profile/">SharePoint Tip #20: Get User Profile</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2008/10/14/sharepoint-tip-20-get-user-profile/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint 2007 Deployment: Custom Action Features</title>
		<link>https://blogit.create.pt/andrevala/2008/08/11/sharepoint-2007-deployment-custom-action-features/</link>
					<comments>https://blogit.create.pt/andrevala/2008/08/11/sharepoint-2007-deployment-custom-action-features/#comments</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Mon, 11 Aug 2008 19:10:33 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=861</guid>

					<description><![CDATA[<p>Summary This post is about developing features to create action features in a SharePoint site. Check the first post SharePoint 2007 Deployment: Overview for an introduction and the series index. Package Structure As I mentioned previously in the post SharePoint 2007 Deployment: Creating and Using Features, to build a feature you need to create the [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/08/11/sharepoint-2007-deployment-custom-action-features/">SharePoint 2007 Deployment: Custom Action Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Summary</h3>
<p>This post is about developing features to create action features in a SharePoint site. Check the first post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/02/SharePoint-2007-Deployment_3A00_-Overview.aspx">SharePoint 2007 Deployment: Overview</a> for an introduction and the series index.</p>
<h3>Package Structure</h3>
<p>As I mentioned previously in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/15/SharePoint-2007-Deployment_3A00_-Creating-and-Using-Features.aspx">SharePoint 2007 Deployment: Creating and Using Features</a>, to build a feature you need to create the following files:</p>
<ul>
<li>The <em>feature manifest</em> file (which must be named <code>feature.xml</code>) </li>
<li>One or more <em>element manifest</em> files </li>
</ul>
<p>The <em>feature manifest</em> file contains the generic information about the feature package, and the <em>element manifest</em> files contain the information about each specific type of element that makes up the feature. Since I already explained all the possible contents of the <em>feature manifest</em> file in the above mentioned post, I will focus this one the <em>element manifest</em> that allows the creation of <em>custom actions </em>in a SharePoint site.</p>
<p>You can then place these two files inside a <em>Solution</em> following the instructions in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/02/17/SharePoint-2007-Deployment_3A00_-Creating-Solutions.aspx">SharePoint 2007 Deployment: Creating Solutions</a>, to provide an easy way to deploy the feature (or upgrade it).</p>
<h3>Custom Actions</h3>
<p>Custom actions are links, toolbar buttons and menu items that you can add to or hide from the SharePoint&#8217;s user interface. Each custom action exists in a specific <em>location</em>, and depending on that location, can be a part of a <em>group</em> of actions.</p>
<p>With a custom action feature, you can:</p>
<ul>
<li><strong>Add a new</strong> <strong>Custom Action Group</strong> which can be used to group custom actions in a specific options screen; </li>
<li><strong>Add a new Custom Action </strong>which can be a new option in a settings screen, a new menu item, or a new toolbar button; </li>
<li><strong>Hide an existing Custom Action</strong> whether that action is the result of custom action feature or it belongs to SharePoint&#8217;s out-of-the-box features. </li>
</ul>
<h3>Allowed Scopes</h3>
<p>The scopes to which a feature can be deployed, are dictated by the types of elements included in it. A feature with custom action elements can be deployed to all the scopes, that is, <strong>Farm</strong>, <strong>Web Application</strong>, <strong>Site Collection</strong> and <strong>Web Site</strong>. </p>
<p>The correct scope must be chosen according to the group and location of the custom action being added or hidden. Note that you can&#8217;t mix feature elements with different scopes on the same feature.</p>
<h3>Feature Manifest</h3>
<p>I will only present a simple feature manifest, since the additional options were presented in the above mentioned post.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
         <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">5DFD12AF-D0AA-4c63-8FB8-C49DB1191083</span>&quot;
         <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Custom Action Feature</span>&quot;
         <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">Adds Custom Actions to the Web Site.</span>&quot;
         <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Web</span>&quot;
         <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">CustomActions.xml</span>&quot;<span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p><p>Notes about this feature manifest:</p>
<ul>
<li>The title of the feature is <em>My Custom Actions Feature.</em> </li>
<li>It will be deployed as a <strong>Web Site </strong>feature, since it&#8217;s <code>Scope</code> value is <code>Web</code>. </li>
<li>It references a single <em>element manifest</em> file: <code>CustomActions.xml</code>. </li>
</ul>
<h3>Element Manifest</h3>
<p>The <em>element manifest</em> file can have any name you wish (in this example it&#8217;s called <code>CustomActions.xml</code>), but it&#8217;s root element must be <code>&lt;Elements&gt;</code>. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of three feature elements:</p>
<ul>
<li><code>&lt;CustomActionGroup&gt;</code> used to create new custom action groups; </li>
<li><code>&lt;CustomAction&gt;</code> used to create new custom actions; </li>
<li><code>&lt;HideCustomAction&gt;</code> used to hide existing actions. </li>
</ul>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Elements </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color: blue">&gt;
    &lt;!-- </span><span style="color: green">Custom Action Group </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">CustomActionGroup
        </span><span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyActionGroup</span>&quot;
        <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This group contains all my custom actions.</span>&quot;
        <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Action Group</span>&quot;
        <span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Microsoft.SharePoint.SiteSettings</span>&quot;
        <span style="color: red">Sequence</span><span style="color: blue">=</span>&quot;<span style="color: blue">30</span>&quot; <span style="color: blue">/&gt;<br></span><span style="color: blue">
    &lt;!-- </span><span style="color: green">Custom Action in Custom Action Group </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">CustomAction
        </span><span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyCustomAction</span>&quot;
        <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This link is a custom action.</span>&quot;
        <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Custom Action</span>&quot;
        <span style="color: red">GroupId</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyActionGroup</span>&quot;
        <span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Microsoft.SharePoint.SiteSettings</span>&quot;
        <span style="color: red">Rights</span><span style="color: blue">=</span>&quot;<span style="color: blue">ManageWeb</span>&quot;
        <span style="color: red">RequireSiteAdministrator</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot;
        <span style="color: red">Sequence</span><span style="color: blue">=</span>&quot;<span style="color: blue">20</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">UrlAction </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">~sitecollection/_layouts/MyCustomPage1.aspx</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">CustomAction</span><span style="color: blue">&gt;<br>
    &lt;!-- </span><span style="color: green">Custom Action in Site Actions Menu </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">CustomAction
        </span><span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyNewCustomAction</span>&quot;
        <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This menu item is a new custom action.</span>&quot;
        <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My New Custom Action</span>&quot;
        <span style="color: red">GroupId</span><span style="color: blue">=</span>&quot;<span style="color: blue">SiteActions</span>&quot;
        <span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Microsoft.SharePoint.StandardMenu</span>&quot;
        <span style="color: red">ImageUrl</span><span style="color: blue">=</span>&quot;<span style="color: blue">/_layouts/MyActionIcon.jpg</span>&quot;
        <span style="color: red">Sequence</span><span style="color: blue">=</span>&quot;<span style="color: blue">10</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">UrlAction </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">~sitecollection/_layouts/MyCustomPage2.aspx</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">CustomAction</span><span style="color: blue">&gt;<br>
    &lt;!-- </span><span style="color: green">Hide Custom Action </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">HideCustomAction
        </span><span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">HideDeleteWeb</span>&quot;
        <span style="color: red">GroupId</span><span style="color: blue">=</span>&quot;<span style="color: blue">SiteAdministration</span>&quot;
        <span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Microsoft.SharePoint.SiteSettings</span>&quot;
        <span style="color: red">HideActionId</span><span style="color: blue">=</span>&quot;<span style="color: blue">DeleteWeb</span>&quot; <span style="color: blue">/&gt;
&lt;/</span><span style="color: #a31515">Elements</span><span style="color: blue">&gt;</span></pre>
<h5>The &lt;CustomActionGroup&gt; Element</h5>
<p>The <code>&lt;CustomActionsGroup&gt;</code> element is used to create custom action groups that can contain custom actions. In the sample above, a new custom action group, named <strong>My Action Group</strong>, is added to the <strong>Site Settings</strong> screen.</p>
<p>The following attributes can be used with this element:</p>
<ul>
<li><code>Id</code> &#8211; (optional) Specifies a unique identifier for this group. It can be a GUID or a unique term, for example <code>&quot;SiteManagement&quot;</code>. </li>
<li><code>Description</code> &#8211; (optional) Description for the custom action group. </li>
<li><code>Title</code> &#8211; (required) Title of the custom action group, shown to the user in the UI. </li>
<li><code>Location</code> &#8211; (required) Specifies the place where the custom action group will be placed
<ul>
<li><code>Microsoft.SharePoint.SiteSettings</code> &#8211; Site Settings screen </li>
<li><code>Microsoft.SharePoint.ContentTypeSettings </code>&#8211; Content Type Settings screen </li>
<li><code>Microsoft.SharePoint.Administration.Operations</code> &#8211; Operations screen in the Central Adminstration web site </li>
<li><code>Microsoft.SharePoint.Administration.ApplicationManagement</code> &#8211; Application Management screen in the Central Administration </li>
</ul>
</li>
<li><code>Sequence</code> &#8211; (optional) Order of the custom action group in the list of groups that exist in the specified location. </li>
</ul>
<h5>The &lt;CustomAction&gt; Element</h5>
<p>The <code>&lt;CustomAction&gt;</code> element is used to create a new custom action in the UI. In the above samples, two custom actions are created:</p>
<ul>
<li>A custom action (named <strong>My Custom Action</strong>) in a custom action group (named <strong>My Action Group</strong>) in the<strong> Site Settings </strong>screen. </li>
<li>A custom action (named <strong>My New Custom Action</strong>) in an existing action group (which is the <strong>Site Actions</strong> menu). </li>
</ul>
<p>The following attributes can be used with this element:</p>
<ul>
<li><code>Id</code> &#8211; (optional) Unique identifier to the custom action. The ID can be GUID or unique term, for example, <code>&quot;MyCustomAction&quot;</code>. </li>
<li><code>Description</code> &#8211; (optional) Description for the custom action. It will be displayed as a tooltip or sub-description for the action, depending on its location. </li>
<li><code>Title</code> &#8211; (required) Title for the custom action. </li>
<li><code>GroupId</code> &#8211; (optional) Specifies an action group inside which to place the custom action. If this custom action is contained inside a custom action group, the value of this attribute must match the value of the Id attribute of the <code>&lt;CustomActionGroup&gt; element</code>. </li>
<li><code>Location</code> &#8211; (required) Specifies the location for this custom action. If this custom action is contained inside a custom action group, the value of this attribute must match the value of the Location attribute of the <code>&lt;CustomActionGroup&gt;</code> element. Check the possible values below, in the <strong>Locations and Group IDs</strong> section. </li>
<li><code>ImageUrl</code> &#8211; (optional) Address of the image to use as the icon for this custom action. Note that, in certain locations, the custom actions don&#8217;t have an icon. </li>
<li><code>Rights</code> &#8211; (optional) Specifies a set of permissions that the user must have in order for the link to be visible. If omitted, the action always appears. To specify multiple values, separate them using commas (which means the user must have all the permissions specified). Check the possible values below, in the <strong>Action Rights</strong> section. </li>
<li><code>RequireSiteAdministrator</code> &#8211; (optional) <strong><code>TRUE</code></strong> to specifiy that the user must be a site administrator to see the custom action. The default value is <strong><code>FALSE</code></strong>. This attribute is not supported if the custom action is to be placed in the context menu for a list item. </li>
<li><code>Sequence</code> &#8211; (optional) Specifies the order of the custom action inside its action group. </li>
<li><code>ContentTypeId</code> &#8211; (optional) Specifies the ID of the content type to associate with the custom action. </li>
<li><code>ShowInReadOnlyContentTypes</code> &#8211; (optional) <strong><code>TRUE</code></strong> to specify that the action should only appear in the Manage Content Type screen, for Read Only Content Types. The default value is <strong><code>FALSE</code></strong>. </li>
<li><code>ShowInSealedContentTypes</code> &#8211; (optional) <strong><code>TRUE</code></strong> to specify that the action should only appear in the Manage Content Type screen, for Sealed Content Types. The default value is <strong><code>FALSE</code></strong>. </li>
<li><code>ControlAssembly</code> &#8211; (optional) Specifies the fully qualified name of the assembly of the control that supports the custom action. This attribute is used in conjunction with the next one. </li>
<li><code>ControlClass</code> &#8211; (optional) Specifies the name of the class of the control that supports the custom action. This attribute is used in conjunction with the previous one. </li>
<li><code>ControlSrc</code> &#8211; (optional) </li>
<li><code>RegistrationType</code> &#8211; (optional) Used to specify the type of attachment in <strong>per-item</strong> custom actions. The possible values are:
<ul>
<li><code>ContentType</code> </li>
<li><code>FileType</code> </li>
<li><code>List</code> </li>
<li><code>ProgId</code> </li>
</ul>
</li>
<li><code>RegistrationId</code> &#8211; (optional) Depending on the <code>RegistrationType</code> value, this attribute can hold a Content Type ID, a File Type identifier, a List ID or a Program identifier. </li>
</ul>
<h5>The &lt;UrlAction&gt; Element</h5>
<p>The <code>&lt;UrlAction&gt;</code> element is used inside the <code>&lt;CustomAction&gt;</code> element to specify what happens when the user clicks the link (or toolbar button, or menu item). It has a single attribute, <code>Url</code>, which is the address of the page to redirect the user to.</p>
<p>In this URL address you can use a few tokens that SharePoint will replace by the correct values when the user clicks it:</p>
<ul>
<li><code>~site</code> &#8211; relative address of the current web site. </li>
<li><code>~sitecollection</code> &#8211; relative address of the root web site of the current site collection. </li>
<li><code>{ItemId}</code> &#8211; ID (Integer value) of the item being acted upon (if applicable). </li>
<li><code>{ItemUrl}</code> &#8211; URL of the item being acted upon (only works in document libraries). </li>
<li><code>{ListId}</code> &#8211; GUID of the list. </li>
<li><code>{SiteUrl}</code> &#8211; absolute URL of the current web site. </li>
<li><code>{RecurrenceId}</code> &#8211; Recurrence index (not supported in the context menu of list items). </li>
</ul>
<h5>The &lt;HideCustomAction&gt; Element</h5>
<p>The <code>&lt;HideCustomAction&gt;</code> element is used to hide an existing custom action. </p>
<p>The following attributes can be used with this element:</p>
<ul>
<li><code>Id</code> &#8211; (optional) Specifies the ID of this hide custom action element. </li>
<li><code>GroupId</code> &#8211; (optional) Identifies an action group that contains the action. </li>
<li><code>Location</code> &#8211; (required) Specifies the location of the custom action to hide. Check the possible values in the table below. </li>
<li><code>HideActionId</code> &#8211; (required) Specifies the ID of the action to hide. </li>
</ul>
<h3>Locations and Group IDs</h3>
<p>The location and group ID values identify a specific place where the custom action must be created (or hidden). See below the possible combinations for both attributes.</p>
<table style="border-right: #666666 1px solid;border-top: #666666 1px solid;font-size: smaller;border-left: #666666 1px solid;border-bottom: #666666 1px solid" cellspacing="0" cellpadding="2" width="520">
<tbody>
<tr>
<td valign="top" width="254"><strong>Description</strong></td>
<td valign="top" width="137"><strong>Location</strong></td>
<td valign="top" width="127"><strong>Group ID</strong></td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Display form toolbar</td>
<td style="border-top: #666666 1px solid" valign="top" width="137">DisplayFormToolbar</td>
<td style="border-top: #666666 1px solid" valign="top" width="127">N/A</td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Edit form toolbar </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">EditFormToolbar </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">N/A</td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">New form toolbar </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">NewFormToolbar </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">N/A</td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">List view toolbar </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">ViewToolbar </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">N/A</td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">List item context menu</td>
<td style="border-top: #666666 1px solid" valign="top" width="137">EditControlBlock </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">N/A</td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">New menu for list and document library view toolbars </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.StandardMenu </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">NewMenu </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Actions menu for list and document library view toolbars </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.StandardMenu </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">ActionsMenu </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Settings menu for list and document library view toolbars </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.StandardMenu </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">SettingsMenu </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Upload documents menu for document libraries </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.StandardMenu </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">UploadMenu </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Actions menu </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.StandardMenu </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">SiteActions </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Settings Site Collection Administration links </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.SiteSettings </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">SiteCollectionAdmin </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Settings Site Administration links </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.SiteSettings </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">SiteAdministration </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Settings Galleries Links </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.SiteSettings </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">Galleries </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Settings Look and Feel links </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.SiteSettings </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">Customization </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Settings Users and Permissions links </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.SiteSettings </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">UsersAndPermissions </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Actions menu for surveys </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.StandardMenu </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">ActionsMenuForSurvey </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Site Settings links for surveys </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.SiteSettings </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">SettingsMenuForSurvey </td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Content Type Settings links </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.ContentTypeSettings </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">N/A</td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Central Administration Operations page </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.Administration.Operations </td>
<td style="border-top: #666666 1px solid" valign="top" width="127">N/A</td>
</tr>
<tr>
<td style="border-top: #666666 1px solid" valign="top" width="254">Central Administration Application Management page </td>
<td style="border-top: #666666 1px solid" valign="top" width="137">Microsoft.SharePoint.Administration.ApplicationManagement </td>
<td style="border-top: #666666 1px solid" valign="top" width="134">N/A</td>
</tr>
</tbody>
</table>
<h3>Action Rights</h3>
<p>Each custom action has its own set of permission requirements which are defined using the <code>Rights</code> attribute of the <code>&lt;CustomAction&gt;</code> element. The list below summarizes the possible values for this attribute.</p>
<ul>
<li><b>AddAndCustomizePages</b> &#8211; Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a Windows SharePoint Services&#8211;compatible editor.</li>
<li><b>AddDelPrivateWebParts</b> &#8211; Add or remove personal Web Parts on a Web Part Page.</li>
<li><b>AddListItems</b> &#8211; Add items to lists, add documents to document libraries, and add Web discussion comments.</li>
<li><b>ApplyStyleSheets</b> &#8211; Apply a style sheet (.css file) to the Web site.</li>
<li><b>ApplyThemeAndBorder</b> &#8211; Apply a theme or borders to the entire Web site.</li>
<li><b>ApproveItems</b> &#8211; Approve a minor version of a list item or document.</li>
<li><b>BrowseDirectories</b> &#8211; Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.</li>
<li><b>BrowseUserInfo</b> &#8211; View information about users of the Web site.</li>
<li><b>CancelCheckout</b> &#8211; Discard or check in a document which is checked out to another user.</li>
<li><b>CreateAlerts</b> &#8211; Create e-mail alerts.</li>
<li><b>CreateGroups</b> &#8211; Create a group of users that can be used anywhere within the site collection.</li>
<li><b>CreateSSCSite</b> &#8211; Create a Web site using Self-Service Site Creation.</li>
<li><b>DeleteListItems</b> &#8211; Delete items from a list, documents from a document library, and Web discussion comments in documents.</li>
<li><strong>DeleteVersions</strong> &#8211; Delete past versions of a list item or document.</li>
<li><strong>EditListItems</strong> &#8211; Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.</li>
<li><strong>EditMyUserInfo</strong> &#8211; Allows a user to change his or her user information, such as adding a picture.</li>
<li><strong>EmptyMask</strong> &#8211; Has no permissions on the Web site. Not available through the user interface.</li>
<li><strong>EnumeratePermissions</strong> &#8211; Enumerate permissions on the Web site, list, folder, document, or list item.</li>
<li><strong>FullMask</strong> &#8211; Has all permissions on the Web site. Not available through the user interface.</li>
<li><strong>ManageAlerts</strong> &#8211; Manage alerts for all users of the Web site. </li>
<li><strong>ManageLists</strong> &#8211; Create and delete lists, add or remove columns in a list, and add or remove public views of a list.</li>
<li><strong>ManagePermissions</strong> &#8211; Create and change permission levels on the Web site and assign permissions to users and groups. </li>
<li><strong>ManagePersonalViews</strong> &#8211; Create, change, and delete personal views of lists.</li>
<li><strong>ManageSubwebs</strong> &#8211; Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.</li>
<li><strong>ManageWeb</strong> &#8211; Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the <em>Site Collection Features</em> page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.</li>
<li><strong>Open</strong> &#8211; Allow users to open a Web site, list, or folder to access items inside that container.</li>
<li><strong>OpenItems</strong> &#8211; View the source of documents with server-side file handlers.</li>
<li><strong>UpdatePersonalWebParts</strong> &#8211; Update Web Parts to display personalized information.</li>
<li><strong>UseClientIntegration</strong> &#8211; Use features that launch client applications; otherwise, users must work on documents locally and upload changes.</li>
<li><strong>UseRemoteAPIs</strong> &#8211; Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.</li>
<li><strong>ViewFormPages</strong> &#8211; View forms, views, and application pages, and enumerate lists.</li>
<li><strong>ViewListItems</strong> &#8211; View items in lists, documents in document libraries, and view Web discussion comments.</li>
<li><strong>ViewPages</strong> &#8211; View pages in a Web site.</li>
<li><strong>ViewUsageData</strong> &#8211; View reports on Web site usage.</li>
<li><strong>ViewVersions</strong> &#8211; View past versions of a list item or document.</li>
</ul>
<p>The post <a href="https://blogit.create.pt/andrevala/2008/08/11/sharepoint-2007-deployment-custom-action-features/">SharePoint 2007 Deployment: Custom Action Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2008/08/11/sharepoint-2007-deployment-custom-action-features/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
