MOSS Training

Hi !

Today, We feel proud in introducing MOSS 2007 Training modules.

We offer training for both technical staff and end users on all aspects of Microsoft Office SharePoint Server 2007 and SharePoint Portal Server 2003. We also deliver on job training to target specific queries or issues. Please feel free to drop a mail to Hitender or Karun for details

Currently Training is offered only in Delhi/NCR(India) region.

-------------------------------------------------------------

A year later : 26 June 2009

We no longer provide MOSS Trainings. It has been a very good experience, Thanks to all who appreciated our content and methodology. Thanks again!

SharePoint search using Object Model, FullTextSqlQuery

Today, I will be posting a small snippet demonstrating SharePoint search using FullTextSqlQuery.
First Add References to required NameSpace
using Microsoft.Office.Server;
using Microsoft.Office.Server.Search.Query;

And the code goes here

//Here SharedServices2 refers to the Shared Service Provider servicing the site in Question
ServerContext context = ServerContext.GetContext("SharedServices2");
FullTextSqlQuery qrySearch = new FullTextSqlQuery(context);
//Specifies the results set containing the main search results from the content index matching the search query.
qrySearch.ResultTypes = ResultType.RelevantResults;
//Sremming : expansion of searches to include plural forms and other word variations :-)
qrySearch.EnableStemming = true;
qrySearch.TrimDuplicates = false;
qrySearch.QueryText = "SELECT URL, Title, Size, Write, HitHighlightedSummary FROM SCOPE() where \"scope\"='NTFS Archive' And FREETEXT(*,'" + TextBox1.Text.Trim() + "')";
ResultTableCollection results = qrySearch.Execute();
ResultTable resultTable = results[ResultType.RelevantResults];
// Data Table to Store Search Results
DataTable dtResults = new DataTable();
dtResults.Load(resultTable, LoadOption.OverwriteChanges);

SharePoint Definitions

What are FrontPage RPCs?

1). When we say FrontPage RPCs in general, we’re really talking about both the FrontPage Remote Procedure Call methods (which have nothing to do with the DCE RPCs that normally come to mind when we hear “RPC”) implemented by both the FrontPage Server Extensions and by Windows SharePoint Services, as well as the Windows SharePoint Services RPC methods implemented only by WSS.
2)They’re structured commands either passed directly to OWSSVR.DLL as query string parameters (a.k.a. the URL Protocol) or sent to OWSSVR.DLL as a set of batched commands formatted as CAML XML.
3)They’re what Office client applications use to handle document I/O and checkins/checkouts of documents in SharePoint libraries. (SOAP is, however, what’s used in the Shared Workspace task pane.)
4)They’re documented at http://msdn.microsoft.com/library/en-us/spptsdk/html/SPPTWSSClientAPI_SV01072206.asp, although that documentation is pretty much all references without examples or “how-to” tips.

Web Creation : The act of creating an SPWeb object at a specific URL.

Web Provisioning : The act of selecting a template and, based on the contents of that template, populating the initial page, list, and Web Part structures.

Feature Activation : The act of activating a particular Feature for a Web site.

Site Definition : A site definition provides the base blueprint for a site, what lists it features, the default navigation structure, etc. A site definition involves a set of XML, ASPX, and other files on the front-end Web server.

Site Template : A site template is a package that contains a set of differences and changes from a base site definition. This package is stored as an .stp file, which is a CAB file that contains XML files that define the differences. The .stp file can be downloaded and uploaded to site collections by users with appropriate rights, meaning that .stp files have some measure of portability.

Feature : A Feature is a package of Windows SharePoint Services elements that helps a user accomplish a particular goal or task. For example, one Feature might be named "My Favorite Items" and contain the following:
· A custom list that stores, per user, a list of the user’s favorite items. This list is created as a single hidden list per workspace when a Feature is enabled.
· A custom menu item, named "Add to Favorites", that is attached to all lists and adds an item to the Favorites list.
· A Web Part that shows the user the top 10 favorites, with usage and link tracking to bring true favorites to the top.
Each of these individual elements, by themselves, may not be useful, but when you enable all of them on a site they become a complete Feature that solves a particular task.

Element : An element is an atomic unit within a Feature. There are different types of element—for example, a custom menu item or an event handler.

Web Site Feature : A Web site Feature is one that is scoped at the Web site level. Scoping of a Feature is implicitly determined by the Feature developer by the elements he or she packages into the Feature.

Site Collection Feature : A site collection Feature is a Feature that is scoped at the site collection level. Typically, a site collection Feature contains items that apply to the site collection as a whole, such as Web Parts or content types that are global to the site collection.

Farm Feature : A farm Feature is a Feature that is scoped globally for the entire server farm. For this reason, farm Features are also known as "global Features." Unlike other Feature types, a global Feature is activated by default in the farm. A farm Feature contains several elements that are critical for implementing applications and logic.

Web Application Feature : A Web application Feature is a Feature that is scoped to the Web application level. A Web application Feature can be activated and deactivated and can contain the following element types:
· Web application assemblies
· Web application administrative links

New Callbacks
Features support the following callbacks for event handling:
· FeatureInstalled/FeatureUninstalled Feature has been installed or uninstalled through the object model or a command line operation.
· FeatureActivated Feature has been activated on a Web site
· FeatureDeactivating Feature is being deactivated on a Web site


Fetching user information in InfoPath 2007 Forms

While designing InfoPath forms for applications, at times the need arises to fetch user information from SharePoint site and to have some check name validation.

There are 2 ways of achieving the same
1. By using web service UserProfile.asmx
2. By using Contact Selector ActiveX control

In this article, I will focus on Contact Selector ActiveX control

Step1: In Microsoft Office InfoPath 2007, from the Controls pane, drag a Contact Selector control onto your form.

Step2: Double-click the control. In the Contact Selector Properties dialog box, on the Data tab, for Field or group name, type a name for the control. Click OK

Step3: Design the appearance of the control as you want.
After these steps now you need to bind this control with data.
Configuring the Contact Selector Control Schema
To data-bind the Contract Selector control, you must create a data schema within the control that represents each contact. Create the schema for each contact in the following format.

'<'person'>'
'<'DisplayName>user display name'<'/DisplayName'>'
'<'AccountId>DOMAIN/user account'<'/AccountId'>'
'<'AccountType>user or group type'<'/AccountType'>'
'<'/person'>'

Following are the elements of the schema:

  • Person Root element of the schema that represents one contact.
  • DisplayName Display name of the contact in Windows SharePoint Services or Active Directory directory service.
  • AccountId Domain and user account identifier for this contact.
  • AccountType Type of account that this contract represents


To configure the schema for a Contact Selector control

1. In Office InfoPath 2007, insert the Contact Selector control into your form, as described earlier.

2. Select the Contact Selector control, and in the Design Tasks pane, click Data Source.

3. Click the arrow next to the Contact Selector name, and on the drop-down menu, click Add.

4. In the Add Field or Group dialog box, create a group with the following properties:
a. For Name, type Person.
b. For Type, select Group.
c. Select Repeating.
d. Click OK.

5. Click the Person group, and then on the drop-down menu, click Add.

6. Add a field with the following properties:
a. For Name, type DisplayName.
b. For Type, select Field (element).
c. For Data Type, select Text (string).
d. Select Repeating.
e. Click OK.

7. Click the Person group, and then add two more fields as described in the previous step.
a. For Name, type AccountId for the first field and AccountType for the second field.
b. For Type, select Field (element) for each field.
c. For DataType, select Text (string) for each field.
d. Select Repeating for each field.

The only drawback of this control is that with internet explorer’s High Internet security settings, it doesn’t work. The work around is to use web service (UserProfile.asmx).

thanks to Pushpinder for the inputs.