<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Putting Custom Web Parts in ONET.xml</title>
	<atom:link href="http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/</link>
	<description>Whatever I'm working on, really...</description>
	<lastBuildDate>Tue, 07 Sep 2010 14:54:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Andy</title>
		<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/comment-page-1/#comment-5902</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 16 Sep 2009 12:42:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.novolocus.com/?p=1287#comment-5902</guid>
		<description>Edit the page &gt; Modify Web Part &gt; Export...

Doesn&#039;t work with ListViews</description>
		<content:encoded><![CDATA[<p>Edit the page > Modify Web Part > Export&#8230;</p>
<p>Doesn&#8217;t work with ListViews</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/comment-page-1/#comment-5898</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Tue, 15 Sep 2009 10:24:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.novolocus.com/?p=1287#comment-5898</guid>
		<description>How do you export a web part to a file?</description>
		<content:encoded><![CDATA[<p>How do you export a web part to a file?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/comment-page-1/#comment-5646</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 03 Jun 2009 09:06:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.novolocus.com/?p=1287#comment-5646</guid>
		<description>Sure. It&#039;s within a File node of one the Module nodes of your ONET.xml. This page has an example:
http://msdn.microsoft.com/en-gb/library/ms474369.aspx

You&#039;re looking for the &#039;AllUsersWebPart&#039; element:
http://msdn.microsoft.com/en-us/library/dd585727.aspx

(Unless you&#039;re wanting to use a ListView web part - they&#039;re a bit different):
http://www.novolocus.com/2009/05/13/pointing-listviewwebparts-at-lists/</description>
		<content:encoded><![CDATA[<p>Sure. It&#8217;s within a File node of one the Module nodes of your ONET.xml. This page has an example:<br />
<a href="http://msdn.microsoft.com/en-gb/library/ms474369.aspx" rel="nofollow">http://msdn.microsoft.com/en-gb/library/ms474369.aspx</a></p>
<p>You&#8217;re looking for the &#8216;AllUsersWebPart&#8217; element:<br />
<a href="http://msdn.microsoft.com/en-us/library/dd585727.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/dd585727.aspx</a></p>
<p>(Unless you&#8217;re wanting to use a ListView web part &#8211; they&#8217;re a bit different):<br />
<a href="http://www.novolocus.com/2009/05/13/pointing-listviewwebparts-at-lists/" rel="nofollow">http://www.novolocus.com/2009/05/13/pointing-listviewwebparts-at-lists/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PRaj</title>
		<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/comment-page-1/#comment-5642</link>
		<dc:creator>PRaj</dc:creator>
		<pubDate>Tue, 02 Jun 2009 20:16:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.novolocus.com/?p=1287#comment-5642</guid>
		<description>Can you please tell me where exactly should the webparts node be placed on the onet.xml? a screenshot of the node structure of the onet.xml would be very helpful.

Thanks.</description>
		<content:encoded><![CDATA[<p>Can you please tell me where exactly should the webparts node be placed on the onet.xml? a screenshot of the node structure of the onet.xml would be very helpful.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Hillman</title>
		<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/comment-page-1/#comment-5444</link>
		<dc:creator>Dan Hillman</dc:creator>
		<pubDate>Wed, 13 May 2009 12:28:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.novolocus.com/?p=1287#comment-5444</guid>
		<description>I&#039;m using the SPWebProvisioningProvider suggested by Connell so that I can get the site constructed before doing any custom code.  The basic code outline is 

public override void Provision(SPWebProvisioningProperties props)
        {
            Microsoft.Office.Server.Diagnostics.PortalLog.LogString(&quot;Beginning CPDCMSiteDef provision code.&quot;);
            SPWeb elevWeb = null;
     try
     {                
     SPSecurity.RunWithElevatedPrivileges(delegate()
     {                   
         // Apply the actual Web template for the CPD CM site   
        // get elevated web - sometimes sharepoint doesn&#039;t like to do stuff inside the elevpriv block
        elevWeb = props.Web;          
        elevWeb.ApplyWebTemplate(CPDCMSiteDef#0);                    
      });              
      elevWeb.AllowUnsafeUpdates = true;
      elevWeb.Site.AllowUnsafeUpdates = true;
... all of the site pieces are in the onet.xml of the CPDCMSiteDef#0 template.  After the site has been created above, I run the custom code, which is where I have tried to use the SPLimitedWebPartManager to get at the ReportViewerWebPart.  ListViewWebParts on the same page are accessible but the ReportViewerWebPart doesn&#039;t seem to be.</description>
		<content:encoded><![CDATA[<p>I&#8217;m using the SPWebProvisioningProvider suggested by Connell so that I can get the site constructed before doing any custom code.  The basic code outline is </p>
<p>public override void Provision(SPWebProvisioningProperties props)<br />
        {<br />
            Microsoft.Office.Server.Diagnostics.PortalLog.LogString(&#8220;Beginning CPDCMSiteDef provision code.&#8221;);<br />
            SPWeb elevWeb = null;<br />
     try<br />
     {<br />
     SPSecurity.RunWithElevatedPrivileges(delegate()<br />
     {<br />
         // Apply the actual Web template for the CPD CM site<br />
        // get elevated web &#8211; sometimes sharepoint doesn&#8217;t like to do stuff inside the elevpriv block<br />
        elevWeb = props.Web;<br />
        elevWeb.ApplyWebTemplate(CPDCMSiteDef#0);<br />
      });<br />
      elevWeb.AllowUnsafeUpdates = true;<br />
      elevWeb.Site.AllowUnsafeUpdates = true;<br />
&#8230; all of the site pieces are in the onet.xml of the CPDCMSiteDef#0 template.  After the site has been created above, I run the custom code, which is where I have tried to use the SPLimitedWebPartManager to get at the ReportViewerWebPart.  ListViewWebParts on the same page are accessible but the ReportViewerWebPart doesn&#8217;t seem to be.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/comment-page-1/#comment-5442</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Wed, 13 May 2009 10:18:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.novolocus.com/?p=1287#comment-5442</guid>
		<description>Hmm. Interesting one, that - and something I have to figure out later this month!

Where is your code to get the SPLimitedWebPartManager running? Is it in a feature receiver that is stapled to the site definition? That way, you should be confident that the Web Part should exist before you try to access it.

Otherwise, I don&#039;t know - but I will have to figure this one out myself.</description>
		<content:encoded><![CDATA[<p>Hmm. Interesting one, that &#8211; and something I have to figure out later this month!</p>
<p>Where is your code to get the SPLimitedWebPartManager running? Is it in a feature receiver that is stapled to the site definition? That way, you should be confident that the Web Part should exist before you try to access it.</p>
<p>Otherwise, I don&#8217;t know &#8211; but I will have to figure this one out myself.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Hillman</title>
		<link>http://www.novolocus.com/2009/04/22/putting-custom-web-parts-in-onetxml/comment-page-1/#comment-5432</link>
		<dc:creator>Dan Hillman</dc:creator>
		<pubDate>Tue, 12 May 2009 20:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.novolocus.com/?p=1287#comment-5432</guid>
		<description>Let me pose this to you, and realize i&#039;m a newb.  I am creating a site definition, and in the onet.xml I&#039;m adding servarl ReportViewerWebParts to a report page.  Inside the CData section there is a ReportPath node that defines where the rdl file exists using an absolute url.  When I provision a new site I&#039;d like to update the ReportPath to point to a location on the new site.  However, I have not found a way to access the ReportPath through code. During site provisioning, the ReportViewerWebPart doesn&#039;t seem to be accessible (if I try to get it through the SPLimitedWebPartManager, all I get is an ErrorWebPart).  Now the way I am calling the site creation code is through an Infopath form on the parent site - the user fills in some information for the new site, which is used in the call to create the new site.  Am I breaking any rules by updating ReportPath value in the onet.xml file before I call my site creation code?  I know it kind-of works in my tests, but sometimes it appears that the onet.xml is cached, as the new site sometimes had reportpaths to the previously created site rather than the new site.  If I haven&#039;t erred grievously, do you know how to force the site provisioning code to not used a cached version of the onet.xml?  thanks for any guidance you can provide.</description>
		<content:encoded><![CDATA[<p>Let me pose this to you, and realize i&#8217;m a newb.  I am creating a site definition, and in the onet.xml I&#8217;m adding servarl ReportViewerWebParts to a report page.  Inside the CData section there is a ReportPath node that defines where the rdl file exists using an absolute url.  When I provision a new site I&#8217;d like to update the ReportPath to point to a location on the new site.  However, I have not found a way to access the ReportPath through code. During site provisioning, the ReportViewerWebPart doesn&#8217;t seem to be accessible (if I try to get it through the SPLimitedWebPartManager, all I get is an ErrorWebPart).  Now the way I am calling the site creation code is through an Infopath form on the parent site &#8211; the user fills in some information for the new site, which is used in the call to create the new site.  Am I breaking any rules by updating ReportPath value in the onet.xml file before I call my site creation code?  I know it kind-of works in my tests, but sometimes it appears that the onet.xml is cached, as the new site sometimes had reportpaths to the previously created site rather than the new site.  If I haven&#8217;t erred grievously, do you know how to force the site provisioning code to not used a cached version of the onet.xml?  thanks for any guidance you can provide.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
