Microsoft Knowledge Base Email Alertz

How to add keyword best bets by using the API in SharePoint Portal Server 2003

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 929261 - Last Review: December 26, 2006 - Revision: 1.2

How to add keyword best bets by using the API in SharePoint Portal Server 2003

INTRODUCTION

This article describes how to add keyword best bets by using the API in Microsoft Office SharePoint Portal Server 2003.

MORE INFORMATION

Keywords are special portal areas. To create keywords, add a subarea to the keywords area, as in the following example.
Uri uri = "http://ServerURL";
TopologyManager tm = new TopologyManager();
PortalSiteCollection sites = tm.PortalSites;
PortalContext portalContext = PortalApplication.GetContext(sites[uri]);
Guid keywordGuid = AreaManager.GetSystemAreaGuid(portalContext, SystemArea.Keyword);
Area keywordArea = AreaManager.GetArea(portalContext, keywordGuid);
Area newKeyword = keywordArea.Areas.AddArea("Test");
keywordArea.Update();
//Add synonyms to the newly created keyword
newKeyword.AddKeyWord(“String1”);
newKeyword.Update();
Keyword best bets are the area listings in the keywords area. The code that you use to create a keyword best bet resembles the code that you use to create area listings in an area. For example, the following sample code can be used to create a keyword best bet.
// Create guid array that represents the audiences (00000000-0000-0000-0000-000000000000 represents all audiences)
Guid[] guidAudiences = new Guid[] { new Guid("00000000-0000-0000-0000-000000000000")};
AreaListing myListing = newKeyword.Listings.AddListing("Title","Description",ListingType.Person,"url",guidAudiences);
myListing.Update(ListingUpdateBehavior.SubmitToSiteRegistry);
newKeyword.Update();

APPLIES TO
  • Microsoft Office SharePoint Portal Server 2003
Keywords: 
kbhowto kbexpertiseinter KB929261
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate