Moss07: Discovering samples from Book – Inside MOSS 2007 – Part 2

This post examines the samples from the book:  Inside MOSS 2007

To be able to execute the samples you need to:

1) Do part1:  https://rasor.wordpress.com/2009/06/26/moss07-discovering-samples-from-book-inside-moss-2007-part-1/

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:

4) Verify which users are in the User Profiles data.

View User Profiles

5) Execute the FavoritesManagerApp:

Sample FaveritesManager

  1. Enter path to Site Collection
  2. Get Users
  3. Select an account that also exists in the SSP User Profile list
  4. Get Info
  5. Write a Favorite Color and Set Info
  6. 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.

Comment out lines in SearchAdminSample

8) Build and run SearchAdminSample

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.

Sample SearchKeywords

Chapter 3. P.117 – Sample MOSSQueryWebServiceDemo

10) Open MOSSQueryWebServiceDemo – do a few changes as seen in img – and build.

MOSSQueryWebServiceDemo

Sample: MOSSQueryWebServiceDemo

In the demo you can choose between a keyword search or a SQL search.
You can choose scope and property to match.

.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: