Wednesday, September 03, 2008

Access is denied. Check that the Default Content Access Account has access to this content

This is one of most common issue reported by people on the internet. I also came across this issue and able to solve after doing deep dive into MOSS search.
If you are facing this issue, look for following:

1. Check default content account have read permission to the site. Go to Central Admin-> Application Management -> Policy for web application. Confirm that the default content account have full read permission to the web application

2. Try changing the host file to crawl the local server to eliminate network issues. This is just for testing and should not be done in live environment

3. Make sure none of Web front end server have spaces in their custom headers. Seems crawler don't like spaces in custom headers

4. Finally, this took us a weekend to note. Someone removed the following site permissions "Use Remote Interfaces" and "Use Client Integration Features" to stop developer to connect to MOSS site using SharePoint Designer. This BROKE THE SEARCH CRAWL. So, make sure for your application these permission are enabled. Go to Central Admin-> Application Management -> User Permissions for Web Application to verify this.

Saturday, August 16, 2008

Issue searching for custom profile property

You have added a custom property "Location" in User Profile. When you try to do a search with keyword "india" (there are some users having India as their location), it does not return the people records we expect. However, if you do a by property search by "location:india", it can return the people records.

Resolution:

Turn back on the option "Include values for this property in the search index" option behind "Location" crawled property

1. Open SSP Admin home page
2. Go to Search settings
3. Click Metadata property mappings
4. Click Crawled Properties link
5. Choose the People category (folder)
6. Locate Expertise, Edit/Map Property
7. At the bottom of the page, there should be check box saying "Include values for this property in the search index", click to select it.
8. Force an incremental crawl. If this does not help, please try to do a full crawl.

Monday, June 30, 2008

LDAP User Profile Connection Horror

Whenever you go to Edit Connection page while editing an import connection, make sure to re-enter the password of user again. MOSS for some reason changes the password and you will be prompted with error like--

The query is not valid based on the specified search base and search filter.

:-(

LDAP Connection in UserProfile

To create an import connection to LDAP, modify the web.config file of your SSP web site.
Under section add,



Make changes as per your enviornment.

Now, on Edit Connection page in MOSS, Enter provider name as LdapMembership and press ok

CustomWebPart Web Part: Cannot import CustomWebPart Web Part.

Check if the webpart class is declared public and any assembly referenced by project exists

Tuesday, June 24, 2008

People Crawl: Error in PortalCrawl Web Service

When I tried to crawl my content, I received following error:

sps3://SERVERNAME
Error in PortalCrawl Web Service

So people aren't crawled.


If I create an "root" site collection, so in http://SERVERNAME, the error disappears and people is crawled again.

Monday, June 23, 2008

Fix for Content type '0x01010007FF3E057FA8AB4AA42FCB67B453FFC100E214EEE741181F4E9F7ACC43278EE811' not found

While creating a new page in a collbartion portal, you might come with this error.

This ContentTypeID points to the "PublishingResources" feature.

You will need to activate this feature by running STSADM. The command is

STSADM -o activatefeature -name PublishingResources -url http://MOSS_URL

Tuesday, April 15, 2008

SharePoint administrative and development Tool

SharePoint SUSHI

SUSHI is a powerful, user-friendly SharePoint application enabling you to accomplish common SharePoint administrative and development tasks. You can think of SUSHI as a Swiss army knife for SharePoint.
What does the name SUSHI stand for?
SUSHI = SharePoint Utility with a Smart, Helpful Interface

Link

Wednesday, April 09, 2008

Display raw XML returned by SharePoint Search

On Search page, modify the XSLT of "Search Core Results" web part to

#?xml version="1.0" encoding="UTF-8"?>
#xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
#xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
#xsl:template match="/">
#xmp>
#/xsl:template>
#/xsl:stylesheet>


Replace # with <

Thursday, April 03, 2008

NumberToWord Function

private string[] _englishDigitMatrix = new string[]{"", "Second", "Third", "Fourth","Fifth", "Sixth", "Seventh", "Eighth","Nineth"};

public string changeNumericToWords(int number)

{

      string ret = _englishDigitMatrix.GetValue(number - 1).ToString();

       return ret;

}

 

Wednesday, April 02, 2008

Using Database Mirroring with Office SharePoint Server and Windows SharePoint Services

Database mirroring is a new technology in Microsoft® SQL Server™ 2005 database software that can deliver high availability and high performance solutions for database redundancy. In database mirroring, transactions are sent directly from a principal database and server to a mirror database and server whenever the principal database’s transaction log buffer is written to disk. This technique can keep the mirror database nearly up to date with the principal database. You can optionally use a third server, a witness server, to enable automatic failover from the principal server to the mirror server.
The update includes more prescriptive information on the type of supported topologies. It also recommends SQL connection aliasing for failover within a farm.

http://go.microsoft.com/fwlink/?LinkId=83725&clcid=0x409

SharePoint Branding Tool (Themes, Master pages, Site Logos...)

This tool can be used apply the following actions for multiple Site Collections, and Child Sites:

modify Themes
modify MasterUrl (Master Page)
modify CustomMasterUrl (System Master Page)
modify SiteLogoUrl (Site Logo)
modify SiteLogoDescription (Site Logo Alternative Text)
modify AlternateCssUrl (Custom CSS Style Sheet)
view various properties of sites and themes at a glance
Selection of sites can be filtered by the Site Template used.

http://www.codeplex.com/BrandingTool

Tuesday, April 01, 2008

Add White space in XSLT

Add and display Custom Column in SharePoint Search Result

The results in SharePoint Search are displayed by Search Core Results Web Part. This web part have “Selected Columns” property under “Results Query Options” category which contains an XML string that defines all of the columns that are to be displayed in the search results.

The following is the default list of columns shown in the search results:



Now, we will create a new mapped property named “ListItemId”. Managed properties map to one or more of the crawled properties. They group together the related crawled properties and expose them to the user

The Search Settings in the administrative site of the Shared Services Provider has a Metadata Property Mappings link. Clicking on it brings you to the Metadata Property Mappings page




Now, click on “New Managed Property”
Enter, the property name as: “ListItemId” and make sure you select “Integer” and “Allow this property to be used in scopes”
Note: By default “Type of Information “is set to Text




Now, you need map to the crawled properties. The Add Mapping button pops up a dialog box where you can navigate through all of the crawled properties and select the ones you want to map to the managed property
Enter ows_id and press Find, select the property and click OK.




Note: If you didn’t selected “Type of Information “as Integer, SharePoint is not able to search this property.
Now, start a full Crawl of your content and you should now see your List Item in search results

Wednesday, March 26, 2008

Use of Today field in SharePoint Formula

You can't use Today field in Sharepoint calculated field. The workaround is:

Create a custom column named "Today" with type as Date
Now, create a custom field and use above created field in formula
Delete the above created "Today" field.

The Sharepoint will work fine as it start using inbuild Today value for the formula

Install SharePoint workflow without MSI

To install a custom workflow developed using Visual studio, follow the steps given below-

-- Build your assembly
Drag and drop assembly to C:\Windows\Assembly. Right click and select the properties. Note down the pubclickeytoken for your assembly

-- Create a Feature.xml



-- Create a Workflow.xml



Change Association_FormURN based on your InfoPath Properties


-- Create a feature in SharePoint

Create a folder say "CUSTOM_WORKFLOW" in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATES\FEATURE"
Copy workflow.xml and feature.xml to this folder

-- Install and Activate the feature

Create a batch file with following content in your FEATURE folder
@ECHO OFF

ECHO.
ECHO Activiating and installing the feature...
ECHO.

SET STSADMDIR="C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN"

%STSADMDIR%\STSADM.EXE -o installfeature -filename CUSTOM_WORKFLOW\feature.xml -force
%STSADMDIR%\STSADM.EXE -o activatefeature -filename CUSTOM_WORKFLOW\feature.xml -url http://SHAREPOINT_URL

ECHO.
ECHO Resetting IIS
ECHO.

IISRESET

-- Run the batch file

Hurry, you could now see your workflow in Workflow settings of List

Thursday, March 20, 2008

Testing XSLT using VS2005

In past, I use to write code using XMLTransform to test an xslt. I found a better way last night, where you could use ASP.NET 2.0 XML control.
Steps:
Create a new ASP.NET web application using VS2005
Add your source xml file to the project
Add a new xslt file to the project using ADDITEM
On the default page, add the XML control from the toolbox
Set the TransformSource property of xml control to xml file
Set the TransformSource property of xml control to xslt file

Make changes in the xslt file and run the web application and check the result

Wednesday, March 19, 2008

Failed to determine definition for Feature with ID

I recently replicated my development server from the production server where changes are done by end users using STSADM back and restore process.

When I tried to edit my search page on development machine, I got error "An unexpected error has occurred."
To diagnosis this, I look at the log file created at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS".
The error logged was “Failed to determine definition for Feature with ID 'd75b8655-0098-40ac-aad6-7578d9d93901'. Skipping this feature for element querying consideration.”

Search this feature ID on production server at location “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES” and found that it is for old custom workflow which was still on Production as there are existing items using it. But this has been replaced with new one on development and as such was not found.

This error will also occur if you have an Enterprise license on Production and Standard on Development as there will be some of the feature not available on the Development

"Search Scope" not visible in SharePoint 2007

You created a new search scope in SharePoint 2007 using Shared Services Administration -> Search Settings -> Scopes and found that its not visible on the site.
This new scope NEED to be visible via the Site Settings. Go to your site collection, click on Site Actions -> Site Settings -> Search Scopes.
Click on "Display Group" and select the display scope


Wednesday, March 05, 2008

Expose Readonly public property of DataContract in WCF

To expose readonly property in WCF using DataContract, add DataMember to the private property

[DataMember]
private string name;

public string Name
{
get{ return name;}
}