I have a question on PortalListItemSiteMapNode class. I am
trying to use PortalSiteMapProvider to access a large list for
optimization as they can take advantage of the caching feature of
sharepoint. My question is, I am trying to get an SPListItem object
from PortalListItemSiteMapNode object, based on my code snippet
below, I tried to get an SPListItem instance via
aPortalListItemSiteMapNode["Item"], is this correct?
Or there is another way to do it?
Below is part of my code:
SPWeb site = SPControl.GetContextWeb(Context);
//create the query
SPQuery query = new SPQuery();
query.Query = "<Where><Eq><FieldRef
Name=\"Employee_x0020_ID\"/><Value
Type=\"Text\">12345</Value></Eq></Where>";
//get the portal map provider
PortalSiteMapProvider ps =
PortalSiteMapProvider.WebSiteMapProvider;
PortalWebSiteMapNode pNode = (PortalWebSiteMapNode)
ps.FindSiteMapNode(site.ServerRelativeUrl);
//get the items from ABC library
SiteMapNodeCollection items =
ps.GetCachedListItemsByQuery(pNode, "ABC", query, site);
foreach (PortalListItemSiteMapNode pItem in items)
{
SPListItem listItem = (SPListItem)pItem["Item"];
}