Wednesday, March 3, 2010

SPExportObject.IncludeDescendants vs SPExportObject.ExcludeChildrens, what's the difference?

Really, what's the difference between children and descendants?

MSDN doesn't say about this difference: IncludeDescendants, ExcludeChildren.

But it looks like that IncludeDescendants is more flexible.

Export result shows that:

· ExcludeChildren = true is the same with IncludeDescendants = SPIncludeDescendants.Content.

· ExcludeChildren = false goes to IncludeDescendants = SPIncludeDescendants.All.

Ok, let check how the export depends from IncludeDescendants value and ExportObject type.

SPDeploymentObjectType.Web:

SPIncludeDescendants.All all web content and its sub-containers (like doclibs and lists) with sub-sites is exported

SPIncludeDescendants.Content – only root web content (doclibs, lists) is exported, without sub-sites

SPIncludeDescendants.None – exports only web property and service containers (like galleries). Usual doclibs and lists are not exported. In this mode export result doesn’t contain any custom aspx files from root web folder. /_themes, /images subfolders are excluded from the export also.

SPDeploymentObjectType.List

SPIncludeDescendants.Content, SPIncludeDescendants.All – full list content is exported

SPIncludeDescendants.None – only list properties are exported, no content

ExcludeChildren – doesn’t work for List because it maps to SPIncludeDescendants.Content or SPIncludeDescendants.All, those have the same export result. Note: MSDN says that ExcludeChildren works for List, but I do not see difference between results for ExcludeChildren = true or false. But it works for Folder!

SPDeploymentObjectType.Folder

SPIncludeDescendants.All (or ExcludeChildren = false) full folder and its sub-folders content is exported

SPIncludeDescendants.Content (or ExcludeChildren = true) and None – only folder properties is exported!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.