C# Class Sitecore.SharedSource.Commons.Utilities.SitecoreItemFinder

Methods to help with getting items out of Sitecore
Exibir arquivo Open project: Velir/Sitecore-Commons

Public Methods

Method Description
GetItem ( Database db, string path ) : Item

Wraps the Sitecore get item call. This will return null if a blank path is passed in, instead of erroring out. This also checks for a null DB reference.

GetItemFromCurrentDatabase ( string path ) : Item

A convenience override for the get item call that defaults the database to the current context database.

GetItemsFromGuidList ( List guidList, Database db ) : List

Gets items from a list of passed in guids.

GetItemsFromGuidListString ( string guidList, char listSeperator, Database db ) : List

Gets items from a delimited GUID list.

GetItemsFromSitecoreGuidList ( string guidList, Database db ) : List

Gets items from a sitecore pipe delimited GUID list.

GetSubItemsNotOfTemplate ( Item rootItem, TemplateItem template, bool recursive ) : List

Get the sub items of an item that are not using the specified template.

GetSubItemsOfTemplate ( Item rootItem, TemplateItem template, bool recursive ) : List

Get the sub items of an item that are using the specified template.

GetSubItemsOfTemplate ( Item rootItem, string templateId, bool recursive ) : List

Get the sub items of an item that are using the specified template.

Method Details

GetItem() public static method

Wraps the Sitecore get item call. This will return null if a blank path is passed in, instead of erroring out. This also checks for a null DB reference.
public static GetItem ( Database db, string path ) : Item
db Database The Sitecore db to search for the item.
path string The path of the item to find.
return Item

GetItemFromCurrentDatabase() public static method

A convenience override for the get item call that defaults the database to the current context database.
public static GetItemFromCurrentDatabase ( string path ) : Item
path string The path of the item to find.
return Item

GetItemsFromGuidList() public static method

Gets items from a list of passed in guids.
public static GetItemsFromGuidList ( List guidList, Database db ) : List
guidList List The GUID list.
db Database The db.
return List

GetItemsFromGuidListString() public static method

Gets items from a delimited GUID list.
public static GetItemsFromGuidListString ( string guidList, char listSeperator, Database db ) : List
guidList string The delimited GUID list.
listSeperator char The list delimiter.
db Database The db.
return List

GetItemsFromSitecoreGuidList() public static method

Gets items from a sitecore pipe delimited GUID list.
public static GetItemsFromSitecoreGuidList ( string guidList, Database db ) : List
guidList string The GUID list.
db Database The db.
return List

GetSubItemsNotOfTemplate() public static method

Get the sub items of an item that are not using the specified template.
public static GetSubItemsNotOfTemplate ( Item rootItem, TemplateItem template, bool recursive ) : List
rootItem Item The root item.
template TemplateItem The template to check for.
recursive bool if set to true all sub items will be searched, otherwise only the first level children /// will be looked at.
return List

GetSubItemsOfTemplate() public static method

Get the sub items of an item that are using the specified template.
public static GetSubItemsOfTemplate ( Item rootItem, TemplateItem template, bool recursive ) : List
rootItem Item The root item.
template TemplateItem The template to check for.
recursive bool if set to true all sub items will be searched, otherwise only the first level children /// will be looked at.
return List

GetSubItemsOfTemplate() public static method

Get the sub items of an item that are using the specified template.
public static GetSubItemsOfTemplate ( Item rootItem, string templateId, bool recursive ) : List
rootItem Item The root item.
templateId string The template id to check for.
recursive bool if set to true all sub items will be searched, otherwise only the first level children /// will be looked at.
return List