googlebot
Buy Differin Gel Online
ADVERTISEMENT

Microsoft Office SharePoint Server 2007 - Application Development

  By Certification Magazine —

1 | 2 |

UserProfileChangeService Members (User Profile Change)    
MSDN
http://msdn.microsoft.com/en-us/library/aa980922.aspx     


Objective: Targeting Content Based on Audience Membership.
Sub-Objective: Display all users in a given audience.

Single answer, multiple choice.

You are creating a custom Web Part that displays all members in an audience named Public Notaries.

You need to write code to retrieve all members of the audience.

What code segment should you use?

A.    AudienceManager audienceManager = new AudienceManager();
ArrayList members = audienceManager.Audiences["Public Notaries"].GetMembership();

B.    AudienceManager audienceManager = new AudienceManager(ServerContext.Current);
ArrayList members = audienceManager.GetUserAudienceIDs("Public Notaries", true, null);

C.    AudienceManager audienceManager = new AudienceManager();
ArrayList nameList = new ArrayList();
nameList.Add("Public Notaries");
ArrayList members = audienceManager.GetAudienceNames(nameList);

D.    ArrayList members = AudienceManager.GetADsPath("Public Notaries");

Answer:
A

Tutorial:
You should use the following code segment:

AudienceManager audienceManager = new AudienceManager();
ArrayList members = audienceManager.Audiences["Public Notaries"].GetMembership();

This code accesses the Audiences property of the AudienceManager class. This returns an AudienceCollection instance that represents all audiences. It then retrieves an Audience instance for an audience named Public Notaries from this collection. Finally, it calls the GetMembership method to return an ArrayList instance that contains all members of the audience.

You should not use the following code segment:

AudienceManager audienceManager = new AudienceManager(ServerContext.Current);
ArrayList members = audienceManager.GetUserAudienceIDs("Public Notaries", true, null);

This code attempts to retrieve the IDs of all audiences for which a user named Public Notaries is a member.

You should not use the following code segment:

AudienceManager audienceManager = new AudienceManager();
ArrayList nameList = new ArrayList();
nameList.Add("Public Notaries");
ArrayList members = audienceManager.GetAudienceNames(nameList);

This code calls GetAudienceNames to return a list of audience names whose IDs match the list passed to the method.

You should not use the following code segment:

ArrayList members = AudienceManager.GetADsPath("Public Notaries");

The GetADsPath parses the data passed in as a parameter into a collection of domains, e-mail addresses and user names.

References:
Audience Object Model Overview
MSDN                
http://msdn2.microsoft.com/en-us/library/ms567140.aspx      

Audiences Overview
MSDN
http://msdn2.microsoft.com/en-us/library/ms571011.aspx
    
How to: Determine Members of an Audience
MSDN
http://msdn2.microsoft.com/en-us/library/ms494684.aspx      


Objective: Searching Data by Using the Search Service.
Sub-Objective: Display the results of a keyword query.

Single answer, multiple choice.

You create the following method to return the results of a keyword query:

public ResultTableCollection Search(string keyword)
{
}

You need to complete the method.

Which code segment should you use?

A.    KeywordQuery query = new KeywordQuery(ServerContext.Current);
query.QueryText = keyword;
return query.Execute();

B.    KeywordQuery query = new KeywordQuery(ServerContext.Current);
query.QueryText = string.Format("select * from Scope() where keyword={0}", keyword);
return query.Execute();

C.    KeywordQuery query = new KeywordQuery(ServerContext.Current);
query.QueryText = string.Format("select {0} from Scope()", keyword);
return query.Execute();

D.    KeywordQuery query = new KeywordQuery(ServerContext.Current);
query.QueryText = string.Format("select * from Scope() where Contains(keyword, '{0}')", keyword);
return query.Execute();

Answer:
A

Tutorial:
You should use the following code segment:

KeywordQuery query = new KeywordQuery(ServerContext.Current);
query.QueryText = keyword;
return query.Execute();

This code creates an instance of the KeywordQuery class. This class allows you to search SharePoint for existing keywords. You simply set the QueryText property to a keyword query and call the Execute method.

You should not set the QueryText property to a value that represents a SQL query. If you want to use a SQL query, you must use the FullTextSqlQuery class.

References:
Enterprise Search Query Object Model Overview    
MSDN                
http://msdn2.microsoft.com/en-us/library/ms544561.aspx      

Building Enterprise Search Queries    
MSDN
http://msdn2.microsoft.com/en-us/library/ms561536.aspx
    
Enterprise Search SQL Syntax Reference    
MSDN                
http://msdn2.microsoft.com/en-us/library/ms493660.aspx     

1 | 2 |
Viewed 9961 times.
SPONSORED LINKS
gps systems used