Monday, September 22, 2008

Creating an ASP.Net Page and embed in SharePoint

Sometimes, we may need to create some custom logic in a page and embed in Sharepoint pages as links.
Steps for Creating an ASP.Net page and bring into SharePoint Site
Step 1: Create an ASP.Net page and write the custom code in code behind. Then build.
Step 2: Copy the *.aspx file in C:\program files\....\12\Templates\Layouts folder
Step 3: Install the dll in GAC. If not works properly, copy the dll in bin folder of virtual directory.
Step 4: Refer the aspx file as http://servername/_layouts/*.aspx
These pages will be available for all the sites in the Server.

Page Not found 404 Error Page Customization in MOSS Site

In some applications, the default 404 should be customized to another valid application page to show meaning information to the user. It's very simple to do with some steps.

The following steps should be followed to customize the 404 error message for MOSS.

1. In the MOSS server, should make a copy of
%system drive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033\sps404.html and call it as 404Page.html
2. Should create a Virtual Directory /Errors in IIS under the MOSS root web application.
3. Should create a redirect aspx page, as /Errors/404redirect.aspx. This may be SharePoint Page or Normal ASP.Net Page. This page has the custom message to be shown to the user.
4. In 404Page.html , make the following change:
STSNavigate(“/Errors/404redirect..aspx?oldUrl=" + requestedUrl)
5. create a Console Application and insert the following code and run it in MOSS server. This code sets the new file not found page in sharepoint site.

System. Uri webApplicationUri = new Uri(http://ServerName/);
SPWebApplication webApplication = SPWebApplication.Lookup(webApplicationUri);
webApplication.FileNotFoundPage = " 404Page.html";
webApplication.Update();


v Note:
By default this is set to null. FileNotFoundPage needs to point to an html file that lives in %systemdrive%\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\1033. The file needs to be html only.

Saturday, September 13, 2008

Steps for Writing Custom Page Load Logic in SharePoint

One can create custom logic for the pages in sharepoint to implement specific functionality.
Step 1: Create a class overrides from System.Web.UI.MasterPage
public class MasterPageOverride : MasterPage
{
protected override void OnLoad(EventArgs e)
{
// Add custom code here
}
}
Step 2: Strong name the assembly and place in GAC.
Step 3: Edit the MOSS master file(.master) and edit the master directive

The MOSS layouts which inherits this master file has the custom logic.

Friday, September 12, 2008

Steps to Configure Multiple Languages in MOSS

Step 1: Install the language files on all WFE Operating Systems
This step is necessary to install the language specific files for the operating system like the Keyboard files and fonts etc. For this, go to the Regional and Language Options in the Control Panel , in the Languages tab, add the necessary supplemental language support which installs the necessary files needed

Step 2: Install Office SharePoint Server 2007
Install MOSS in the desired language and run the SharePoint Products and Technologies configuration wizard.

Step 3: Install Language Packs
Now you need to install the language pack of the desired language. Please note that language packs come in separate packages i.e. one language pack setup per installation, so if you need more than one language, multiple language packs need to be installed. Make sure the language pack is of the same language you need and you are installing the 'MOSS language pack' and not one of the 'WSS language packs'

Step 4: Rerun the SharePoint Products and Technologies Configuration Wizard
This should be done with the default options selected.
As soon as you successfully install a language pack in a particular language, a folder with the respective language ID is created in c:\Program Files\Common Files\Microsoft Shared\web server extensions\12\template\
For example: If you are currently running the English version of MOSS then you 1033 under this folder

Step 5: Create the site with the new language
You should notice that the site creation wizard now includes another option to select the language to create the site in.

Step 6: Enable Site Variations
Go to Site Settings->Site Collection Administration
Click 'Variations' .Select '/' to create variations for the top level site
Leave all other options to default settings and Click 'OK'

Step 7: Configure Variation Labels
Go to Site Settings->Site Collection Administration
Click 'Variation Labels'
On the' Variation Labels' screen, click 'New Label' and create an English label

Step 8: Create Hierarchies
On the' Variation Labels' screen, click 'Create Hierarchies'
The wizard automatically creates hierarchies for sites and sub sites and pairs them as well.

Step 9: View the Variation Log
Go to Site Settings->Site Collection Administration
Click 'Variation Logs'
Look at the Variation Log Entries and find the pairing of sites

Step 10: Change the Browser Language and view the site in different languages
Now as the variation hierarchy is created, you can view the site in different languages (English and Arabic) in our case. For this, use the URLs you saw in the Variation Log .
One more thing to note is that if you use the default URL of the site, you will be redirected to the variation that corresponds to the default language of the browser. Try changing the browser language to Arabic and check. This shows that you can redirect different users to the same site in different languages based on user preferences.

Step 11: Edit the Page in source language and observe the results
You are now ready to go with multilingual sites created in MOSS. Try to add some content to the content editor web part by using the Edit Page option. After the change, don't forget to Publish.

Configuring MOSS Enterprise Search step by step

MOSS Enterprise Search setting are done thru Shared Services Provider(SSP).

Enterprise Search Enables Search in
· Install and Configure iFilters, Content Sources, File Shares, Crawl Rules and Search Scopes
· People Search
· BDC Search
Step 1: We can have separate Index server and Search Server. This Security settings is done at Index server and Search Server.

Farm Search Service Account to from Admin group and WSS_ADMIN_WPG group

Step 2: Start Index Service in Index Server. Check the option "Use this Server for Indexing Content"

Step 3: Enable Office SharePoint Server Search. Check the Option "Use this Server for Serving Search queries"

Step 4: Start Windows SharePoint Services Search. This enables help to Enterprise search.

Step 5: Create an SSP (shared Services Provider).

Step 6: Navigate to newly created SSP and then click Search Settings.
· Configure content Sources. It may be Sites, SQL Server DB etc.
· Add Crawl Rules.
· Add file types if required. You can add pdf files here by installing iFilter pdf. Also u can set Image Icons.

Step 7: If any crawl rule is added,go to Content Sources and do "Start full Crawl". Optional Step.

Step 8: Metadata property Mappings to map crawl property and Data. This is also an optional step.

Step 9: You can define new search scopes and configure the Target Search Page and rules.

Step 10: At the site Collection level, we can add Search Keywords and Best bets

Step 11: We can add tabs for Search Page

Step12: To get the Search Related web parts, Office SharePoint Server Search Web Parts feature should be activated in MOSS site collection features.

Configuring user profiles in Sharepoint Central administration SSP

MOSS gets the user profiles information for the MOSS sites. Navigate to the Central Administration of the MOSS server and Open SSP(Shared Service Provider).

· User profile is configured through SharePoint Shared Service provider.
· Each SharePoint site can be mapped to an SSP in Central Admin
User profiles can be imported from
· Active directory through master connection. Configuring the user profiles from Activie directory http://mosstouch.blogspot.com/2009/03/configuring-user-profiles-in-sharepoint.html
· External Database through Business Data catalog (BDC).
Each user profile property has a data source that maps to AD or DB thru BDC. We need application definition file to map to External DB