Monday, March 16, 2009

Caching the first load times in SharePoint (Improving the performance of MOSS site at first load)

Generally the first time page load takes a huge time after doing IISReset. But by doing the below settings, the performance on first load will be faster.
To improve the performance of the SharePoint pages after we do an IISReset.
· Object cache size: 350 (http://servername/_Layouts/objectcachesettings.aspx)
· Site Collection Output Cache: enabled w/ modified Intranet profile:










Click on the image for better resoultion

Showing the page fields/Controls only in edit mode of the page

To show the fields only in the Edit mode of the page, add the controls in the following node by editing the page layout using SharePoint designer
layoutPublishingWebControls:EditModePanel

Integrating InfoPath with Sharepoint List

Microsoft InfoPath supports multiple views of the same form.Based on business requirements and user roles, different views of the form can be shown to different users. The below steps is to integrate Infopath forms with Sharepoint Server

  • Create the Sharepoint List
  • Create the CAML fragment to serve as the base schema to submit to the webservice
  • Create the form template and add the data connections
  • Identify the GUID used as the ID for the List
  • Add controls to the form template to display the current items in the list
  • Add fields and controls for entering new items to submit to the list
  • Add a connection to the sharepoint Lists webservice and define the parameters for calling UpdateListItems web method
  • Add the event handler code required to submit additions, updates and deletions from the list
  • Test the form and publish to Sharepoint Server To a Form Library or As a site content type

Building Windows SharePoint Services Search Queries

Search in Windows SharePoint Services supports three types of search syntax for building search queries:

· Keyword Query syntax (search terms are passed directly to the Search service)
· SQL syntax (extension of SQL syntax for querying databases)
· URL syntax (search parameters are encoded in URL, and posted directly to the search page)

Keyword Query syntax

You can pass two types of terms in a Windows SharePoint Services Search keyword query:
· Keywords (the actual query words for the search request)
· Property filters (the property constraints for the search request)
e.g Keyword site:http://marketing http://customersupport/

Site and URL are the Managed Properties used in Search.

The filtering Search results based on the web sites and sub sites can be done thru OOB search itself by giving the filter site keyword (Note: site is a Managed property). SharePoint allows searching content based on one or more managed property. If the search keyword is “Test”, we need to append the web site URL along with the search keyword in the OOB Search Web part to get the results Test site: http://servername/US. OOB web part provides this functionality and the site filter is appended along with the Search keyword.

Otherwise, the url is given like this http://servername/SearchCenter/Pages/results.aspx?k=Test.

In the above URL, key word and site are used to filter the results.
Where http://servername/SearchCenter/Pages/results.aspx is the Search results page

Mapping Crawled Properties to Managed Properties
To make a crawled property available for the Search experience—to make it available for Search queries and display it in Advanced Search and search results—you must map it to a managed property. You can map multiple crawled properties to a single managed property or map a single crawled property to multiple managed properties. If a managed property has multiple crawled properties mapped to it, and a document contains values for more than one of the crawled properties, the order in which the properties are mapped and their priority determine the managed property’s value.

Multiple Property Filters in Enterprise Search
Enterprise Search in Microsoft Office SharePoint Server 2007 keyword syntax supports the use of multiple property filters within the same query. You can use either multiple instances of the same property filter or different property filters.
Using the Same Property Filter
In this scenario, the keyword query is based on a union of the property filters. This is equivalent to the OR operator used in SQL search syntax.
For example, if you specify the following property filters for a keyword query, both the http://marketing/and http://customersupport/ sites are included in the search:
site:http://marketing/ site:http://customersupport/

Using Different Property Filters
In this scenario, the keyword query is based on an intersection of the property filters. This is equivalent to the AND operator used in SQL search syntax.

For example, if you specify the following property filters for a keyword query, all content authored by John Smith from the http://marketing site is included in the search:
site:http://marketing/ author:"John Smith"

SQL Syntax Examples
Search in Windows SharePoint Services provides support for constructing complex search queries through the SQL syntax. Some examples of what is available when using SQL syntax for search queries include the following:
· Comparison operators, such as ">", "<", or · Multiple logical operators, such as AND, OR, and NOT.

1. Finds relevant results containing the keyword SharePoint.
SELECT WorkId,Path,Title,Write,Author,HitHighlightedSummary, HitHighlightedProperties,CollapsingStatusFROM Scope()WHERE FREETEXT(defaultproperties, 'SharePoint') ORDER BY Rank Desc

2. Finds relevant results containing at least one of the keywords SharePoint and Search. SELECT WorkId,Path,Title,Write,Author,...FROM Scope()WHERE FREETEXT(defaultproperties, 'SharePoint Search') ORDER BY Rank Desc

3. Finds relevant results containing both the keywords SharePoint and Search.
SELECT WorkId,Path,Title,Write,Author,...FROM Scope()WHERE FREETEXT(defaultproperties, '+SharePoint +Search') ORDER BY Rank Desc

4. Finds relevant results containing the exact phrase SharePoint Search.
SELECT WorkId,Path,Title,Write,Author,...FROM Scope()WHERE FREETEXT(defaultproperties, ' "SharePoint Search" ') ORDER BY Rank Desc

5. Finds relevant results containing both the keywords SharePoint and Search but not the keyword WSS.
SELECT WorkId,Path,Title,Write,Author,...FROM Scope()WHERE FREETEXT(defaultproperties, '+SharePoint +Search -WSS') ORDER BY Rank Desc

6. Finds relevant SharePoint results authored by persons named John.
SELECT WorkId,Path,Title,Write,Author,...FROM Scope()WHERE FREETEXT(defaultproperties, 'SharePoint') AND CONTAINS(Author,' "John" ')ORDER BY Rank Desc

7. Finds relevant SharePoint results modified within the last 30 days. SELECT WorkId,Path,Title,Write,Author,...FROM Scope()WHERE FREETEXT(defaultproperties, 'SharePoint') AND Write<=DATEADD(DAY,30,GETGMTDATE())ORDER BY Rank Desc.

Configuring sharePoint Search step by step is available here

Customizing core results web part is avaialble here

Configuring Audiences in Sharepoint Central administration SSP

· Create audience in Central Admin SSP (Shared service Provider)
· Create Rules based on user account or profile.
· Compile Audience group
Once the audience is compiled, then the profiles are loaded into the audience group and we can have any number of rules.

Pre-Requsities to create Audience
1. A SSP(shared service provider) must be created
2. User must have administrative previleges

Adding Custom user Control in SharePoint Page

User Control can be added to SharePoint master file or it can be embedded in a web part. The steps for attaching a user control in SharePoint are described below.
Step1:
Create a user control (*.ascx) file.
Step2:
Put the ascx in C:\Inetpub\wwwroot\wss\VirtualDirectories\1111\USerControls\
Where USerControls is a custom created folder in virtual directory.
Step3:
Copy the usercontrol dll in GAC
Step4:
Edit the web config file as below

Add the usercontrols folder as safe controls
<
SafeControl src="~/userControls/*" includesubfolders="True" safe="True" allowremotedesigner="True">

Add the user controls dll as safe controls

<
SafeControl assembly="usercontrol, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cb1dc3b73b79f0d0" namespace="usercontrol" typename="*" safe="True">