Monday, August 16, 2010

Configuration to use Content Type in search scope and to display the Content Type in core results web part

1. In Central Admin click on “Manage Service Applications” and select the Search service application
2. Select “Manage” from the ribbon control
Steps 3 and 4 are required if you want to display the content type data in the core results web part
3. Select “Metadata properties” from the left navigation and add a “New managed Property”
4. Give the new property a name, add crawled property mapping to Basic:5(Text) and ows_ContentType(Text), check “Allow this property to be used in scopes” and “Add managed property to custom results set retrieved on each query” check boxes. Click ok when done.

5. Select “Scopes” from the left navigation and select “New scope” to add a new scope for the content type.
Note: If you are using the inbuilt content type managed property then you have to edit the property and check “Allow this property to be used in scopes” check box.
6. After creating the new scope you should add a rule by clicking “New Rule” link.
7. In the new rule screen, check the “Property Query” for the “Scope Rule Type”
8. Select “ContentType” from the “Add Property Restriction” drop down if using the inbuilt Content type managed property if not select the managed property that you added in steps 3 and 4
9. Type in the content type name in the “=” text box below the “Add Property Restriction” drop down

10. Now drop a Core results web part to a page and set the scope to the one created in step 5
11. Add to the “Fetched Properties” under display properties of the core results web part
12. To display the raw XML that is generated, set the XSL editor property of the web part to

Tuesday, August 03, 2010

Issues with starting User Profile Synchronization Service.

Here are some of the issues I faced trying to start the User profile synchronization Service in SharePoint 2010:
1. Exception trying to write the dbName regkey for MIIS System.Security.SecurityException: Requested registry access is not allowed
To solve this error add the farm admin user to the local administrator group on the server on which the service is being started.

2. "The trust relationship between this workstation and the primary domain failed." when trying to start the User profile synchronization service.
The farm admin account needs to be given "Replicating Directory Changes" permission for the domain. Knowledge base 303972 provides the steps needed to grant "Replicating Directory Changes" permission. I am including the steps below from the above knowledge base.

Setting permissions by using the ACL editor

  1. Open the Active Directory Users and Computers snap-in
  2. On the View menu, click Advanced Features.
  3. Right-click the domain object, such as "company.com", and then click Properties.
  4. On the Security tab, if the desired user account is not listed, click Add; if the desired user account is listed, proceed to step 7.
  5. In the Select Users, Computers, or Groups dialog box, select the desired user account, and then click Add.
  6. Click OK to return to the Properties dialog box.
  7. Click the desired user account.
  8. Click to select the Replicating Directory Changes check box from the list.
  9. Click Apply, and then click OK.
  10. Close the snap-in.
Have a look at http://msmvps.com/blogs/shane/archive/2010/07/09/configuring-profile-import-in-sharepoint-2010.aspx, this covers the setup steps in detail.

Wednesday, June 09, 2010

SharePoint 2010 - An exception occurred when trying to issue security token.

Make sure that "Claims to Windows Token Service" is starte if you see the following error in the event log with SharePoint 2010:
Task Category: Claims Authentication
Source: SharePoint Foundation
Level: Error
EventData: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

Monday, February 08, 2010

Setting up PHP and Eclipse IDE for debugging on IIS7.

Here are the steps required to setup PHP on IIS7 and configure Eclipse IDE for debugging:
1. To install PHP on IIS7 you can either download the PHP installer from http://php.net/downloads.php or use Microsoft Web Platform installer. If you are installing PHP directly without using Microsoft Web Platform installer make sure you install the non thread safe version. The web installer automatically install the correct version. Also, on the window to select the web server, select IIS FastCGI.
2. Download and install Eclipse for PHP developers from http://www.eclipse.org/downloads/
3. Download and copy the non thread safe version of Zenddebugger.dll (from 5_2_x_nts_comp folder) into ext folder of PHP install directory.
4. Include the following at the end of PHP.ini file in the PHP install directory
[Zend]
zend_extension="C:/Program Files/PHP/ext/ZendDebugger.dll"
zend_debugger.allow_hosts="localhost,127.0.0.1"
zend_debugger.expose_remotely=always
zend_debugger.connector_port=9009
5. Now open Eclipse and select Windows -> Preferences
6. On the preferences window select Debug under PHP. In the Default settings, select "Zend Debugger" from the dropdown and click on Configure link and enter 9009 next to Zend Debugger for the port. Next select the PHP servers link and enter the URL of the PHP web application (eg. http://localhost).

Tuesday, January 26, 2010

SPGridView and "Multiple Lines of Text" type in SharePoint.

To remove the div tag from being displayed in SPGridView when displaying data from "Multiple Lines of Text" column type, set the HtmlEncode property of the BoundField to false.

BoundField boundfield = new BoundField();
boundfield.HeaderText = "Description";
boundfield.DataField = "Description";
boundfield.SortExpression = "Description";
boundfield.HtmlEncode = false;

m_GridView.Columns.Add(boundfield);