<?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: Using SPChangeQuery in a new Site (SPWeb)</title>
	<atom:link href="http://blog.sharepoint2007.com.au/2009/06/23/using-spchangequery-in-a-new-site-spweb/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sharepoint2007.com.au/2009/06/23/using-spchangequery-in-a-new-site-spweb/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-spchangequery-in-a-new-site-spweb</link>
	<description>Scott Samuels on SharePoint</description>
	<lastBuildDate>Thu, 01 Sep 2011 17:46:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Carol</title>
		<link>http://blog.sharepoint2007.com.au/2009/06/23/using-spchangequery-in-a-new-site-spweb/comment-page-1/#comment-554</link>
		<dc:creator>Carol</dc:creator>
		<pubDate>Thu, 11 Mar 2010 16:44:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sharepoint2007.com.au/?p=141#comment-554</guid>
		<description>Hi Scott,

Thanks a lot for your help. When I saw the results in a Console I am not able to see the ADD.

But in the actual back end I developed using Switch statements for each Object Type and Change Type, I was able to see &quot;ADD&quot; event logged.

But now I am stuck up with Deletes, i am not able to see any information except the ID of the change object.
I am not able to get the other information  like URL and child items that are also deleted.

Can you help me with this by sharing your ideas?


Thanks again for you time.

Thanks
Carol</description>
		<content:encoded><![CDATA[<p>Hi Scott,</p>
<p>Thanks a lot for your help. When I saw the results in a Console I am not able to see the ADD.</p>
<p>But in the actual back end I developed using Switch statements for each Object Type and Change Type, I was able to see &#8220;ADD&#8221; event logged.</p>
<p>But now I am stuck up with Deletes, i am not able to see any information except the ID of the change object.<br />
I am not able to get the other information  like URL and child items that are also deleted.</p>
<p>Can you help me with this by sharing your ideas?</p>
<p>Thanks again for you time.</p>
<p>Thanks<br />
Carol</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carol</title>
		<link>http://blog.sharepoint2007.com.au/2009/06/23/using-spchangequery-in-a-new-site-spweb/comment-page-1/#comment-553</link>
		<dc:creator>Carol</dc:creator>
		<pubDate>Thu, 11 Mar 2010 16:36:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sharepoint2007.com.au/?p=141#comment-553</guid>
		<description>Hi Scott,

Thanks a ton for your response.

Actually I am not able to see that when I do this-

foreach (SPChange change in changes)
                                    {
                                        Console.WriteLine(&quot;\r\nDate: {0}&quot;, timeZone.UTCToLocalTime(change.Time).ToString());
                                        Console.WriteLine(&quot;Object type: {0}&quot;, change.GetType().ToString());
                                        Console.WriteLine(&quot;Change type: {0}&quot;, change.ChangeType);
}

But when I did this

switch (objType.Name)
                                        {
                                            case &quot;SPChangeWeb&quot;:
                                                {
                                                    SPChangeWeb changeWeb = change as SPChangeWeb;
                                                    Guid owebId = changeWeb.Id;
                                                    var Q = from SPWeb oweb in ositeCollection.AllWebs
                                                            where oweb.ID == owebId
                                                            select oweb;

Now it is working, it is logging as &quot;Add&quot; now</description>
		<content:encoded><![CDATA[<p>Hi Scott,</p>
<p>Thanks a ton for your response.</p>
<p>Actually I am not able to see that when I do this-</p>
<p>foreach (SPChange change in changes)<br />
                                    {<br />
                                        Console.WriteLine(&#8220;\r\nDate: {0}&#8221;, timeZone.UTCToLocalTime(change.Time).ToString());<br />
                                        Console.WriteLine(&#8220;Object type: {0}&#8221;, change.GetType().ToString());<br />
                                        Console.WriteLine(&#8220;Change type: {0}&#8221;, change.ChangeType);<br />
}</p>
<p>But when I did this</p>
<p>switch (objType.Name)<br />
                                        {<br />
                                            case &#8220;SPChangeWeb&#8221;:<br />
                                                {<br />
                                                    SPChangeWeb changeWeb = change as SPChangeWeb;<br />
                                                    Guid owebId = changeWeb.Id;<br />
                                                    var Q = from SPWeb oweb in ositeCollection.AllWebs<br />
                                                            where oweb.ID == owebId<br />
                                                            select oweb;</p>
<p>Now it is working, it is logging as &#8220;Add&#8221; now</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott Samuels</title>
		<link>http://blog.sharepoint2007.com.au/2009/06/23/using-spchangequery-in-a-new-site-spweb/comment-page-1/#comment-552</link>
		<dc:creator>Scott Samuels</dc:creator>
		<pubDate>Thu, 11 Mar 2010 13:05:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sharepoint2007.com.au/?p=141#comment-552</guid>
		<description>Carol, 

Thanks for the comment. To the best of my knowledge, the addition of a site is not logged as a change. If you have a look at &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spchangetype.aspx&quot; rel=&quot;nofollow&quot;&gt;SPChangeType Enumeration&lt;/a&gt; on MSDN, you can see that the &quot;Add&quot; change type only relates to &lt;strong&gt;items&lt;/strong&gt; being added to a specific scope. The change you are seeing is generated when SharePoint makes a change to the global navigation when you add a new site. I suspect that if you do not inherit the local or global navigation when you create a new site, you may not see any change recorded (try it and let me know what you find).

If you use the Publishing feature, you will see the creation of new &lt;strong&gt;pages&lt;/strong&gt; logged as an &quot;Add&quot; change type because these are being created in the Pages list (instantiated by the Publishing feature when activated).

If you want to track the creation of SPWebs as a change that you can pull out of an SPChangeQuery, you may want to investigate adding a record to the dbo.eventlog table in the appropriate content database (SPChangeQuery is querying this table for its events). I would add the record in a feature that is stapled to the &quot;GLOBAL&quot; site definition (this will execute the feature on all sites, although I have heard reports that GLOBAL site definition does not include blank sites). If I were to hazard a guess I would say that this would be an unsupported solution from Microsoft&#039;s perspective as you would be directly accessing the content database to write the record...

Hope this helps, let me know how you go. If you have any more questions I am more than happy to answer them.

Regards, 
Scott</description>
		<content:encoded><![CDATA[<p>Carol, </p>
<p>Thanks for the comment. To the best of my knowledge, the addition of a site is not logged as a change. If you have a look at <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spchangetype.aspx" rel="nofollow">SPChangeType Enumeration</a> on MSDN, you can see that the &#8220;Add&#8221; change type only relates to <strong>items</strong> being added to a specific scope. The change you are seeing is generated when SharePoint makes a change to the global navigation when you add a new site. I suspect that if you do not inherit the local or global navigation when you create a new site, you may not see any change recorded (try it and let me know what you find).</p>
<p>If you use the Publishing feature, you will see the creation of new <strong>pages</strong> logged as an &#8220;Add&#8221; change type because these are being created in the Pages list (instantiated by the Publishing feature when activated).</p>
<p>If you want to track the creation of SPWebs as a change that you can pull out of an SPChangeQuery, you may want to investigate adding a record to the dbo.eventlog table in the appropriate content database (SPChangeQuery is querying this table for its events). I would add the record in a feature that is stapled to the &#8220;GLOBAL&#8221; site definition (this will execute the feature on all sites, although I have heard reports that GLOBAL site definition does not include blank sites). If I were to hazard a guess I would say that this would be an unsupported solution from Microsoft&#8217;s perspective as you would be directly accessing the content database to write the record&#8230;</p>
<p>Hope this helps, let me know how you go. If you have any more questions I am more than happy to answer them.</p>
<p>Regards,<br />
Scott</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carol</title>
		<link>http://blog.sharepoint2007.com.au/2009/06/23/using-spchangequery-in-a-new-site-spweb/comment-page-1/#comment-551</link>
		<dc:creator>Carol</dc:creator>
		<pubDate>Wed, 10 Mar 2010 15:15:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sharepoint2007.com.au/?p=141#comment-551</guid>
		<description>Hi Scott,

I am wondering why the Change Type is not shown as &quot;ADD&quot; when a new site is created.

I am working with SPChange class and calling GetChanges on every site collection.

Results look like:(for new site created under sitecollection)

The object type is shown as SPChangeWeb
The Change Type is shown as &quot;Navigation&quot;.

Is this a bug ?
Can you help me with this. How to know that a new site has been added using GetChanges()


Thanks
Carol</description>
		<content:encoded><![CDATA[<p>Hi Scott,</p>
<p>I am wondering why the Change Type is not shown as &#8220;ADD&#8221; when a new site is created.</p>
<p>I am working with SPChange class and calling GetChanges on every site collection.</p>
<p>Results look like:(for new site created under sitecollection)</p>
<p>The object type is shown as SPChangeWeb<br />
The Change Type is shown as &#8220;Navigation&#8221;.</p>
<p>Is this a bug ?<br />
Can you help me with this. How to know that a new site has been added using GetChanges()</p>
<p>Thanks<br />
Carol</p>
]]></content:encoded>
	</item>
</channel>
</rss>

