<?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>Yaroslav Pentsarskyy&#039;s SharePoint adventures &#187; sharepoint</title>
	<atom:link href="http://www.sharemuch.com/category/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sharemuch.com</link>
	<description>Yaroslav writes about his innovative SharePoint solutions</description>
	<lastBuildDate>Fri, 30 Jul 2010 02:21:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>25 min screencast on Extending SharePoint 2010 document ID provider</title>
		<link>http://www.sharemuch.com/2010/07/29/25-min-screencast-on-extending-sharepoint-2010-document-id-provider/</link>
		<comments>http://www.sharemuch.com/2010/07/29/25-min-screencast-on-extending-sharepoint-2010-document-id-provider/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 02:21:50 +0000</pubDate>
		<dc:creator>Yaroslav Pentsarskyy</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sharepoint 2010]]></category>
		<category><![CDATA[custom document id provider]]></category>
		<category><![CDATA[DocumentIdProvider]]></category>
		<category><![CDATA[GenerateDocumentId]]></category>
		<category><![CDATA[GetDocumentUrlsById]]></category>
		<category><![CDATA[GetSampleDocumentIdText]]></category>
		<category><![CDATA[sharepoint document id]]></category>

		<guid isPermaLink="false">http://www.sharemuch.com/?p=1321</guid>
		<description><![CDATA[In my last article on document ID we looked at how SharePoint 2010 document center allows you to add new documents to the site and then after they are assigned unique ID – be able to find them by that ID. In past versions the problem was that you have no control on what the resulting [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.sharemuch.com%252F2010%252F07%252F29%252F25-min-screencast-on-extending-sharepoint-2010-document-id-provider%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%2225%20min%20screencast%20on%20Extending%20SharePoint%202010%20document%20ID%20provider%22%20%7D);"></div>
<p>In my <a href="http://www.sharemuch.com/2010/05/31/deploy-your-custom-sharepoint-2010-document-id-provider/" target="_self">last article on document ID </a>we looked at how SharePoint 2010 document center allows you to add new documents to the site and then after they are assigned unique ID – be able to find them by that ID. In past versions the problem was that you have no control on what the resulting ID will end up being.</p>
<p>In SharePoint 2010 – there is no visual way for you to decide what is your ID going to be – however this short screencast talk about how you can implement such a capability by extending document id provider.</p>
<p>First part of the video Michal talks about the concept of document ID and how they can be used. The second part I show Visual Studio code sample as well as a way to deploy the custom provider.</p>
<p>Enjoy!</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="513" height="345" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=13750098&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=b31e00&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="513" height="345" src="http://vimeo.com/moogaloop.swf?clip_id=13750098&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=b31e00&amp;fullscreen=1" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>

]]></content:encoded>
			<wfw:commentRss>http://www.sharemuch.com/2010/07/29/25-min-screencast-on-extending-sharepoint-2010-document-id-provider/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatically provisioning default webparts on a page with a new site template</title>
		<link>http://www.sharemuch.com/2010/07/28/automatically-provisioning-default-webparts-on-a-page-with-a-new-site-template/</link>
		<comments>http://www.sharemuch.com/2010/07/28/automatically-provisioning-default-webparts-on-a-page-with-a-new-site-template/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 06:08:54 +0000</pubDate>
		<dc:creator>Yaroslav Pentsarskyy</dc:creator>
				<category><![CDATA[MOSS]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sharepoint 2010]]></category>

		<guid isPermaLink="false">http://www.sharemuch.com/?p=1319</guid>
		<description><![CDATA[When provisioning your SharePoint site automatically with a script &#8211; you often create site templates for your sites and sub sites to bundle up pieces of functionality such as page layouts and other features to be created and instantiated when a user creates new instance of your site template. One of the most common scenarios [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.sharemuch.com%252F2010%252F07%252F28%252Fautomatically-provisioning-default-webparts-on-a-page-with-a-new-site-template%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Automatically%20provisioning%20default%20webparts%20on%20a%20page%20with%20a%20new%20site%20template%22%20%7D);"></div>
<p>When provisioning your SharePoint site automatically with a script &#8211; you often create site templates for your sites and sub sites to bundle up pieces of functionality such as page layouts and other features to be created and instantiated when a user creates new instance of your site template. One of the most common scenarios is the ability to provision Web Parts and their values on to a page that is a default page of your site template. This will make it look as if default web parts were added to the page when users create new instance of your custom site template.</p>
<p>To get started we will be using one of the out-of-the-box site templates and enhance it. Let&#8217;s grab STS template from (<em>[Drive]:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates</em>).  Locate <em>ONET.XML</em> file in your template.</p>
<p>Locate <em>&lt;Configuration ID=&#8221;1&#8243; Name=&#8221;Blank&#8221;&gt;</em>  in the template. Navigate to the <em>&lt;WebFeatures&gt;</em> node. This is where the Web features will be activated when the template is instantiated.</p>
<p>The next step is to create a feature that will create a page upon being called. We will reference that feature right under the Web Features, by using ID just like all of the other features are referenced.</p>
<p>In (<em>[Drive]:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\sts</em>) you will find <em>default.aspx</em>which we will include in our feature. The <em>default.aspx</em>  file already has some web part zones which you can change, delete and add new ones as you see fit.</p>
<p>So far our feature definition will look like this:</p>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Feature xmlns="<a href="http://schemas.microsoft.com/sharepoint/">http://schemas.microsoft.com/sharepoint/</a>"
 Id="090A251F-86DB-4035-959C-4A3E2FDEA856"
 Title="Provision my page"
 Version="1.0.0.0"
 Scope="Web"
 Hidden="FALSE"
 ActivateOnDefault="FALSE"
 AlwaysForceInstall="TRUE"
 ImageUrl=""&gt;
  &lt;ElementManifests&gt;
    &lt;ElementFile Location="Default.aspx" /&gt;
    &lt;ElementManifest Location="Default.aspx.xml" /&gt;
  &lt;/ElementManifests&gt;
&lt;/Feature&gt;</pre>
<p>That&#8217;s <em>Default.aspx.xml</em>  you&#8217;re looking at in the feature definition will define what web part are going to show up in which zones. Here is how we typically provision our web parts into zones:</p>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;Elements xmlns="<a href="http://schemas.microsoft.com/sharepoint/">http://schemas.microsoft.com/sharepoint/</a>"&gt;
  &lt;Module Name="Content"&gt;
    &lt;File Name="Default.aspx"
Url="Default.aspx" Type="GhostableInLibrary"&gt;
&lt;AllUsersWebPart WebPartZoneID="LeftZone1" WebPartOrder="1"&gt;
        &lt;![CDATA[Your webpart definition goes here]]&gt;
    &lt;/File&gt;
  &lt;/Module&gt;
&lt;/Elements&gt;</pre>
<p>That&#8217;s about it. Now all you need to do is to reference the feature ID in a WebFeatures section of your <em>onet.xml</em>.</p>
<p>I assume you already know how to provision your site template. Now when users create new instance of your template. You pre-formatted, so to say, page will be provisioned with it.</p>
<p>Good Luck!</p>

]]></content:encoded>
			<wfw:commentRss>http://www.sharemuch.com/2010/07/28/automatically-provisioning-default-webparts-on-a-page-with-a-new-site-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enhancing SharePoint lists and libraries with image picker</title>
		<link>http://www.sharemuch.com/2010/07/27/enhancing-sharepoint-lists-and-libraries-with-image-picker/</link>
		<comments>http://www.sharemuch.com/2010/07/27/enhancing-sharepoint-lists-and-libraries-with-image-picker/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 03:19:13 +0000</pubDate>
		<dc:creator>Yaroslav Pentsarskyy</dc:creator>
				<category><![CDATA[MOSS]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sharepoint 2010]]></category>
		<category><![CDATA[image picker field]]></category>
		<category><![CDATA[library image picker]]></category>
		<category><![CDATA[sharepoint image picker]]></category>

		<guid isPermaLink="false">http://www.sharemuch.com/?p=1314</guid>
		<description><![CDATA[If you worked with SharePoint lists and libraries you probably noticed that you have an ability to add an Image type field or a hyperlink. When you add one using SharePoint UI &#8230;. you end up with somehting that looks like this below which is not so user friendly, because usually content authors ,don&#8217;t know [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.sharemuch.com%252F2010%252F07%252F27%252Fenhancing-sharepoint-lists-and-libraries-with-image-picker%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Enhancing%20SharePoint%20lists%20and%20libraries%20with%20image%20picker%22%20%7D);"></div>
<p>If you worked with SharePoint lists and libraries you probably noticed that you have an ability to add an Image type field or a hyperlink. When you add one using SharePoint UI</p>
<p><a href="http://www.sharemuch.com/wp-content/uploads/2010/07/picture-field.png"><img class="alignnone size-full wp-image-1315" title="picture field" src="http://www.sharemuch.com/wp-content/uploads/2010/07/picture-field.png" alt="" width="313" height="88" /></a></p>
<p>&#8230;. you end up with somehting that looks like this below</p>
<p><a href="http://www.sharemuch.com/wp-content/uploads/2010/07/image-field-in-action.png"><img class="alignnone size-full wp-image-1316" title="image field in action" src="http://www.sharemuch.com/wp-content/uploads/2010/07/image-field-in-action.png" alt="" width="532" height="128" /></a></p>
<p>which is not so user friendly, because usually content authors ,don&#8217;t know whether it is relative URL they have to specify let alone the fact that they now have to go and look for image and then go back to the page.</p>
<p>If you worked with SharePoint Publishing pages before, you remember how publishing pages have a notion of publishing image field that renders like this</p>
<p><a href="http://www.sharemuch.com/wp-content/uploads/2010/07/publishing-page-image.png"><img class="alignnone size-full wp-image-1317" title="publishing page image" src="http://www.sharemuch.com/wp-content/uploads/2010/07/publishing-page-image.png" alt="" width="443" height="152" /></a></p>
<p>In here you can click on the Add Image link and you will get a friendly UI to select image from the site; way better approach. So how can you have the same functionality in your regular document library.</p>
<p>For this I will create a copy of my out of the box document library defined here (<em>[Drive]:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\DocumentLibrary</em>)</p>
<p>then in the <em><strong>schema.xml </strong></em>of the library I will add the following field (along with other fields):</p>
<pre>&lt;Field ID="{2E2A32F1-1B2E-4401-9527-7482D2AD0569}"</pre>
<pre>Type="Image" Name="ThumbImage"</pre>
<pre>DisplayName="Thumbnail Image" RichText="TRUE"</pre>
<pre>RichTextMode="FullHtml"</pre>
<pre>SourceID="<a href="http://schemas.microsoft.com/sharepoint/v3">http://schemas.microsoft.com/sharepoint/v3</a>"</pre>
<pre>StaticName="ThumbImage"&gt;
&lt;/Field&gt;</pre>
<p>In here, nothing much more different than deifning a regular image field. The only difference are two attributes: <strong>RichText=&#8221;TRUE&#8221; RichTextMode=&#8221;FullHtml&#8221;</strong> that will actually render appropriate UI.</p>
<p>Once the feature is deployed and activated &#8211; now my <em>enhanced </em>document libraries will contain an image picker.</p>
<p>In my next article &#8211; I&#8217;ll touch on how you can add this field to existing document libraries.</p>
<p>Enjoy!</p>

]]></content:encoded>
			<wfw:commentRss>http://www.sharemuch.com/2010/07/27/enhancing-sharepoint-lists-and-libraries-with-image-picker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Searching SharePoint list metadata by lookup column</title>
		<link>http://www.sharemuch.com/2010/07/25/searching-sharepoint-list-metadata-by-lookup-column/</link>
		<comments>http://www.sharemuch.com/2010/07/25/searching-sharepoint-list-metadata-by-lookup-column/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 07:11:50 +0000</pubDate>
		<dc:creator>Yaroslav Pentsarskyy</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sharepoint 2010]]></category>
		<category><![CDATA[searching lookup column]]></category>

		<guid isPermaLink="false">http://www.sharemuch.com/?p=1311</guid>
		<description><![CDATA[It&#8217;s a common task to search SharePoint lists and libraries using an SPQuery mechanism. The rules are pretty simple, you write a query involving columns and values you would like to filter and get the results back. Things are not that straighforward when you`re dealing with lookup column. When one of your lists is referencing [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.sharemuch.com%252F2010%252F07%252F25%252Fsearching-sharepoint-list-metadata-by-lookup-column%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Searching%20SharePoint%20list%20metadata%20by%20lookup%20column%22%20%7D);"></div>
<p>It&#8217;s a common task to search SharePoint lists and libraries using an SPQuery mechanism. The rules are pretty simple, you write a query involving columns and values you would like to filter and get the results back. Things are not that straighforward when you`re dealing with lookup column.</p>
<p>When one of your lists is referencing another using a lookup column in it`s relationship &#8211; the format the data gets stored in the column involves the referenced ID delimited by a semicolon and followed by the value. You`d think that by supplying exact same format and values you will get your query working but not so.</p>
<p>In order to filter byb a lookup column &#8211; you need to supply LookupId=&#8217;True&#8217; attribute and value and then provide just an ID of the looked up item.</p>
<p>In the below example, I use a list called <em>comments </em>to search comments that have been associated with a particular <em>post</em>.</p>
<p>Here is how my query is going to look like:</p>
<pre>SPListItemCollection items = commentsList.GetItems(
new SPQuery {
    Query = "&lt;Where&gt;&lt;Eq&gt;&lt;FieldRef Name='PostId' LookupId='True'/&gt;"+
"&lt;Value Type='Integer'&gt;" +
    properties.ListItemId + "&lt;/Value&gt;&lt;/Eq&gt;&lt;/Where&gt;",
    RowLimit = 0,
}
);</pre>
<p>That&#8217;s all there is to it, enjoy!</p>

]]></content:encoded>
			<wfw:commentRss>http://www.sharemuch.com/2010/07/25/searching-sharepoint-list-metadata-by-lookup-column/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Provisioning SharePoint lookups fields into existing list schema</title>
		<link>http://www.sharemuch.com/2010/07/22/provisioning-sharepoint-lookups-fields-into-existing-list-schema/</link>
		<comments>http://www.sharemuch.com/2010/07/22/provisioning-sharepoint-lookups-fields-into-existing-list-schema/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 04:51:29 +0000</pubDate>
		<dc:creator>Yaroslav Pentsarskyy</dc:creator>
				<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[sharepoint 2010]]></category>
		<category><![CDATA[provisioning splookupfield]]></category>
		<category><![CDATA[SchemaXml]]></category>
		<category><![CDATA[SPField]]></category>

		<guid isPermaLink="false">http://www.sharemuch.com/?p=1308</guid>
		<description><![CDATA[In SharePoint lookup fields allow you to display information from a parent list in the child list. At the time of you provisioning the child list you must already have a parent list where the field is going to be looked up from. In case of SharePoint Publishing scenario &#8211; when you want your Publishing [...]]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Fwww.sharemuch.com%252F2010%252F07%252F22%252Fprovisioning-sharepoint-lookups-fields-into-existing-list-schema%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Provisioning%20SharePoint%20lookups%20fields%20into%20existing%20list%20schema%22%20%7D);"></div>
<p>In SharePoint lookup fields allow you to display information from a parent list in the child list. At the time of you provisioning the child list you must already have a parent list where the field is going to be looked up from.</p>
<p>In case of SharePoint Publishing scenario &#8211; when you want your Publishing Pages to have a field that looks up its values from another list &#8211; you don&#8217;t really have a luxury or defining the way Pages list will look like. At the same time you can&#8217;t create a list which is going to be a parent list in lookup relationship because Pages library is the first one that gets provisioned during a site creation.</p>
<p>In this case, the easiest scenario is to create your lookup field on already existing library after all of the dependent components have been created.</p>
<p>Here is how you would go about provisioning your custom lookup field into a Pages library of a Publishing site. This code can be ran as an event receiver, and if you want to run it standalone &#8211; you&#8217;d obviously modify it a bit.</p>
<pre>using (SPWeb web = (SPWeb)properties.Feature.Parent)</pre>
<pre>{</pre>
<pre>    if (PublishingWeb.IsPublishingWeb(web))</pre>
<pre>    {</pre>
<pre>        PublishingWeb pubWeb = PublishingWeb.GetPublishingWeb(web);</pre>
<pre>        SPList pagesList = pubWeb.PagesList;</pre>
<pre>        SPList parentList = web.Lists["ParentList"];</pre>
<pre>        pagesList.Fields.AddLookup("NewLookupField", parentList.ID, true);</pre>
<pre>        SPField newLookupField = pagesList.Fields.GetField("NewLookupField");</pre>
<pre>        XmlDocument doc = new XmlDocument();</pre>
<pre>        doc.LoadXml(newLookupField.SchemaXml);</pre>
<pre>        XmlNode root = doc.FirstChild;</pre>
<pre>        XmlNode attr = doc.CreateNode(XmlNodeType.Attribute,</pre>
<pre>"ShowField", string.Empty);</pre>
<pre>        attr.Value = "Title";</pre>
<pre>        root.Attributes.SetNamedItem(attr);</pre>
<pre>        newLookupField.SchemaXml = doc.InnerXml;</pre>
<pre>         newLookupField.Update();</pre>
<pre>    }</pre>
<pre>}</pre>
<p>Above you notice, there is a handy method allowing you to add a lookup to the list, however that one has limited number of properties you can assign and for lookup we need a property that will specify the field name that will be displayed in child list. One way to get around this is to modify field schema; this is how you can modify all of the other attributes/properties of the field that you would normally do in through CAML.</p>
<p>Good Luck!</p>

]]></content:encoded>
			<wfw:commentRss>http://www.sharemuch.com/2010/07/22/provisioning-sharepoint-lookups-fields-into-existing-list-schema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
