Logo 
Search:

MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Change log feature, and programming with it

  Asked By: Erik    Date: Apr 25    Category: MOSS    Views: 1426

Does anyone know much about the change log feature in SharePoint, and
especially programming the thing? (I'm looking at the 2007 SDK, so I
don't know if it was also in 2003).

What I can't quite get, even after several readings of the Help file,
is: how do you use these classes, particularly SPChangeToken? It has
only two properties:

Scope: "Gets the scope of the changes contained in a collection of
changes, which can be a list, site, site collection, or content database."

ScopeID: "Gets the GUID of the object providing the scope for the
collection containing the parent change object."

now what the hell does the latter mean?

Secondly, we have SPChange and SPChangeItem: what's the difference?
In this coding example from SPChange, one seems to be able to be cast
to the other:

==========================================
SPChangeCollection changes = site.GetChanges(query);

foreach (SPChange changedObject in changes)
{
switch (changedObject.GetType().ToString())
{
case "Microsoft.SharePoint.SPChangeItem":
SPChangeItem changedItem = (SPChangeItem)changedObject;
try
{
Response.Write(lists[changedItem.ListId].Title + " ==
" +
lists[changedItem.ListId].GetItemByUniqueId(changedItem.UniqueId).Name
+ " == " + timeZone.UTCToLocalTime(changedItem.Time) + " == " +
changedItem.ChangeType + "<BR>");
}
catch
{
Response.Write("The object to which item " +
changedItem.UniqueId + " belongs does not exist.<BR>");
}
break;
}
}
==================================================

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on Change log feature, and programming with it Or get search suggestion and latest updates.




Tagged: