Online Training On SharePoint

Saturday, 26 December 2009

Sandboxed Solutions are not Enabled in SharePoint 2010

I was trying to write a simple browser enabled InfoPath form with code behind and like to get this run as Sandboxed solution in SharePoint 2010. When I was publishing this form following error was thrown:
"The form template cannot be published to the server: ServerName. Sandboxed Solutions are not enabled on the SharePoint Server Farm."

On further investigation I found that "Microsoft Sharepoint Foundation User Code Service" is required to run for the Sandboxed solutions to work. To enable this service go to Central Administration and in Manage Services on Server, Start “Microsoft Sharepoint Foundation User Code Service” :

Monday, 21 December 2009

Federated Search in SharePoint 2010 - Part 2

In the Federated Search Part 1 we covered how to use Federated Search. In this Part we will see how to custmoize the pre defined locations and how to create new locations. Location defines from where the Federated Search Web Part will show the results. We can also customize the result presentation using the locations.

To access predefined locations we need to go to Central Administration and go to Query SSA. There the Federated locations are defined.

Here are the predefined locations which are available for SharePoint:

Now we will create a new location to show the top news results from Google for the keyword specified in SharePoint search. Here are the steps to create a new location:
1. Click on the New Location.
2. We need to provide the name, Display Name, Location and Author of the Location. The Display name will be available in the web part to select this location name.
3. The next two parameters are important and define the Type of the location and Query Template. The type of the location specifies the nature of the location. We can have the results from the Search index stored on the server farm or from the Search Engines supporting the OpenSearch protocals.
4. The Query Template is the query in which we specify the query used to search the data. To get the top google news result we will use the following query:{SearchTerms}&output=rss
so in this query we will be passing the query parameter using the q.

5. Other fileds we can leave for now. They can help to customize the UI of the results and the data returned from the engine. We will see this in the Part 3 of this post.
6. Now we need to select this location in the Federated Results Web Part:.

7. Now the Google News Results are displayed like:

Saturday, 19 December 2009

Federated Search in SharePoint 2010 - Part 1

There are new set of capablities added in SharePoint 2010 for Federated Search. Before diving into that lets try to understand what is Federated Search. Federated Search is a way to get data from different sources to create single search experience in SharePoint. Though it is very simple to do yet very powerful. With this we can display the data from several sources without really indexing them. So as an example with Federated search we can display results from Bing or Google in our SharePoint site without doing much effort. Federated Search is based upon OpenSearch which is a standard used in Search.

Federated Search is helpfil in the scenario where the data is stored in multiple repositories and we can not crawl this data to create our own index. There is a OOB web part called Federated Results given in SharePoint which can be used to display the Federated results from various Locations. Now lets try to use this web part and display results from Bing in our SharePoint pages. Bing will show the results based on the query given by the user in search text box. First we need to add this web part to our page. Once this Web Part is added we need to select the Location. Locations helps to configure the federated results. There are some preconfigured locations are there and one of this location we will be using to show results from Bing. We can also create our own locations. We will do this in Part 2 of this post on Creating Locations for Federated Search in SharePoint.

To show the results from Bing on SharePoint pages select Interent Search Results as Location.

This is all we need to do to show the results. Now based on the search keyword the results will be shown in the Federated Results Web Part. I am doing a search on SharePoint and the top 3 results are returned from Bing as well other than the results along the results from SharePoint.

We can change some settings through this web part like number of results which we want to show and the number of characters in the description. We can also provide Fixed Keyword Query. With this we can hardcode the query which will be passed to the Bing search engine and result will be returned always for with this keyword.

Wednesday, 16 December 2009

Logging Improvement in SharePoint 2010

Log files are an important medium to find what is really happening within the SharePoint Farm. There are quite a few improvements are done in SharePoint 2010 with respect to Log Files retention. In SharePoint 2007, the default log file retention policy was to set log files to generate once every 30 minutes with a total of 96 log files at any given time. This equates to 48 (30*96/60) hours.

in SharePoint 2010 ULS logging has been improved by reducing log file size significantly. This allows a  new approach to setting log file retention policy. The default setting is now at number of days. So we can specify directly for how many days we want to keep the log files. The default setting for this is 14. Also a new option exists to restrict trace logs to a fixed disk size. This is unchecked by default. With this option we can define how much disk space we want to assign to the logs.

As an example On 15th Day, log files from day 1 are pruned. If restrict trace log setting is also enforced to a fixed disk size, then both settings are enforced and the order on which the settings are enforced is dependent upon which condition is hit first. So if we have set 5 GB for these logs and this limit is reached on 10th day then the log files are cleaned to satisfy these settings. If we hit the 15 th day without consuming the log disk space still the files are cleaned.

Monday, 14 December 2009

Showing Specific Result Set in Search Result Core Web Part in SharePoint

I had a strange issue while working with my Search application build on SharePoint 2007. Whatever query user provide in the search query box the result set always displayed a fixed set of results. It never get changes whatever parameters are provided. All the index and logs were not showing any unexpected behavior. On further investigation I found that one user has mistakenly changed the Cross-Web Part Query Id from User Query to Query 2 in the Search Result Core Web Part:

This is an interesting property with this web part. It allows the user to show search results based on a fixed keyword which we can provide with this query. In that case always the results will be shown based on this keyword rather than based on the query what users have done on the Search Center Site. We can define up to 4 queries of this sort on a page. This can be very useful feature if on a specifc SharePoint page we want to display results based from search index on a some fixed keyword.

Tuesday, 8 December 2009

FAST Search Links are not appearing on a site base don FAST Search Template

Now in SharePoint Administration we see some additional links for FAST search administration.

These links are:
1. FAST Search Keyword
2. FAST Search site Promotion and Demotion
3. FAST Search User Contenxt

I have created a site based on FAST Search Center Site Template and strangely this site does not show these links.

That was very strange as these links are related to FAST implementation and a site based on FAST Template does not show these. On further investigation I found that the SharePoint Server Enterprise Site Collection Feature is not activated by default when we create a site based on FAST Search Center Template.

This feature is required to be activated to show these links. These links are shown once we activate this feature.

Thursday, 3 December 2009

Adding Visual Best Bets in SharePoint 2010

There is a very cool feature introduced in SharePoint 2010 using Fast Search. We can show Visual Best Bets to the users while searching for a particular key word. The Visual Best Bets are enhanced version of Best Bets which were introduced in SharePoint 2007. Here we can show a image or a URL to the users. But the Visual Best Bets are available only with Fast Search for SharePoint 2010.
Now lets try to add a Visual Best Bets. It is very easy!! For our example I will show the SharePoint 2010 image when ever somebody search with SharePoint as a Visual Best Bet. First we need to add a keyword for SharePoint. For this go to Site Settings and Look for Fast Search Keywords under Site Collection Administration. Add a Keyword for SharePoint.

Now Click on Add Keyword Link:

We can leave other fields for simplicity. With this a Keyword is created. Now once the Keyword is created we can create a Visual Best Bet by right clicking the Keyword.

I have uploaded SharePoint 2010 Logo in Image Library. I will use the URL for that show in the visual best bet:

The other cool features are we can apply start date and end date and based on that Best Bet would be activated and Deactivated. We can also apply the User Contex to Best Bet so that it will be shown to a particular set of users.

With this we are done. Now once we search SharePoint from the Fast Search site we will get like this and we can see that logo of SharePoint 2010 is displayed as visual best bet.

Wednesday, 2 December 2009

Error while accessing the Web Application in SharePoint 2010

After installing the SharePoint 2010 on Windows Server 2008 R2 some time I am getting this error:

Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.InteropServices.COMException: Retrieving the COM class factory for component with CLSID {BDEADF26-C265-11D0-BCED-00A0C90AB50F} failed due to the following error: 800703fa.

This problem is not frequent and comes some time. To solve this problem we need to change the Load User Profile Property and set it to true in IIS. To do this follow these steps:

1. Open IIS 7.0 and go to the Application pool associated with the Web Application.
2. Click on Advanced Settings.
3. Under Process Model you will find "Load User Profile". Set this property to true.

Tuesday, 1 December 2009

Related Posts with Thumbnails