This post examines the samples from the book: Inside MOSS 2007
To be able to execute the samples you need to:
Chapter 2. P.58 – Walkthrough: Populating User Profiles Remotely – Sample FavoritesManagerApp
2) Build the sample \Inside SharePoint Server 2007\Chapter 02\FavoritesManagerApp.
3) The FavoritesManagerApp sample needs an extra field (named FavoriteColor) in the User Profiles. Add an extra field to User Profiles:
- Goto http://dev-env-moss:11000/ssp/admin/_layouts/ProfMain.aspx
(If there are errors on the page then look at https://rasor.wordpress.com/2009/06/27/moss07-ssp-and-search-errors/)
- Click the Add – link
4) Verify which users are in the User Profiles data.
5) Execute the FavoritesManagerApp:
- Enter path to Site Collection
- Get Users
- Select an account that also exists in the SSP User Profile list
- Get Info
- Write a Favorite Color and Set Info
- Verify via SSP that the property has been set
//Pseudo code: //Get Users XmlNode nodes = ugSvc.UserGroup.GetAllUserCollectionFromWeb(); //Get Info upSvc.PropertyData props = upSvc.UserProfileService.GetUserProfileByName("domain\account"); //Set Info upSvc.UserProfileService.ModifyUserPropertyByAccountName("domain\account",props);
Chapter 3. P.69 – Sample SearchAdminSample
6) Check to see if Moss search is available. See https://rasor.wordpress.com/2009/06/27/moss07-ssp-and-search-errors/
7) Open \Inside SharePoint Server 2007\Chapter 03\SearchAdminSample – Comment out a couple of lines. They throw Not Authorized exception.
8) Build and run SearchAdminSample
1. First you must get the SearchContext from a specified SSP. You might need to change SSP name.
With the SearchContext in place you can choose whether you want to work with Content Sources (2), Search Scopes (10) or Managed Properties (20) in any order.
Chapter 3. P.112 – Sample SearchKeywords
9) Open – change the SSP name if needed – and build.
Chapter 3. P.117 – Sample MOSSQueryWebServiceDemo
10) Open MOSSQueryWebServiceDemo – do a few changes as seen in img – and build.
In the demo you can choose between a keyword search or a SQL search.
You can choose scope and property to match.