Logo 
Search:

MOSS Forum

Ask Question   UnAnswered
Home » Forum » MOSS       RSS Feeds

Acessing the underlying listitem for a PortalWebSiteMapNode in the PortalSiteMapProvider

  Asked By: Mariah    Date: Mar 12    Category: MOSS    Views: 1277

I am using the Web Content Management Feature og MOSS2007 to build a Internet presence web-site for a client.

I have made my own implementation of the PortalSiteMapProvider, that returns an hierachical view of my site/pages structure, i bind this to a MOSSMEnu control and everything works like a charm..

However my my client requires that some of the menu items should be color coded, depending on one of the properties set in the underlying listitem (Page) of the PortalWebSiteMapNode.

How is this done? I have looked at the PortalWebSiteMapNode, and PortalSiteMapProvicer objects, but i have not found any obvious way to do this.

The only thing i can think of is binding to the listitem using the URL, but that does not appear to be a valid approach because of performance reasons.

Any help would greatly appreciated!!!!

PS: I originally posted this in the Programming Forum, but this is the right spot for it soory about the cross post

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Jarod Mathews     Answered On: Mar 12

Accessing the underlying list item will always be a perf issue. However, it turns out that the Portal*SiteMapNode classes were designed to handle this. We actually cache all of the custom properties  of a web  (the property bag) which can be indexed by the property name. I think the API is simply node["Property"].

Likewise, the fields of the associated list item are also cached, and can be accessed in a similar manner, where the accessor is either the field name, the internal name, or the field ID (Guid). You will need to cast the SiteMapNode to the correct type before using the accessor.

As an aside, the PortalSiteMapProvider also allows you to cache SPQuery results as well as SPSiteData queries.