Friday, November 16, 2007

Installing SharePoint 2007 MOSS


Installing SharePoint 2007 MOSS

Hi all,

Are u planning to install sharepoint on ur server........
if yes then do follow this....

Read Me Prior to Install Share Point 2007
=========================================


Please read this "Read Me" file before going for the installation of SharePoint 2007.
In this document I am trying to give the detailed steps for installation.

Before going for the installation below is the hardware and OperatingSystem related Pre-requisite.

Hardware:-
~~~~~~~~~~~~

1] Name Of PC :- v2inmumpc098.in.v2solutions.com (this is example)

2] Domain Name :- in.v2solutions.com (this is example)

3] Processor Details:- Intel Pentium 4 or AMD athelon
2.26 Ghz

4] RAM :- 0.99 GB ~ 1 GB (Recommended is 2 GB)

5] Hard Disk Drive:-
Primary C drive : 19.5 GB- free space 15.1 GB (this is example)
Secondary E: 17.7 GB free space 17.6 GB (this is example)
File Format:- NTFS (Please format hard disc with NTFS prior to installation)
[*Note Minimum hard-disk space required must not be less then 5 GB]

6] Ip Address :- 192.168.8.247 (this is example)


Operating System:-
~~~~~~~~~~~~~~~~~~

1] Operating System Details:-
MS- Windows Server 2003 R2 [Note OS sholud be Server Edition with latest Service Pack.]
Enterprise Edition
Service Pack 1

2] IIS Configuration:-
IIS 6.0

3] Microsoft .NET FrameWork 2.0

Tip:-
~~~~~~
IIS and Microsoft .NET FrameWork 2.0 are present in the OS CD.
Procedure to install above is :- After installation of OS completely then again run Ist CD then Install the IIS
and the MicroSoft .NET Framework 2.0

Note:- Along with the IIS and .Net Framework 2.0 we can get installer for the Windows Sharepoint Services 2.0.
But please dont install it because for Share Point 2007 we need Windows Sharepoint Services 3.0 which will be provided wit this document.

******

** The folder contains some Pre-requisite software/applications that needs to be installed before installing SharePoint 2007.
The Sequence is as follows:
__________________________________________________________________________________________________________________
Folder Name | Exe to be used
__________________________________________________________________________________________________________________
1] MS .NET 3.0 Framework | dotnetfx3setup.exe

2] Windows Workflow Foundation Version 3.0.4203.2 | Visual Studio 2005 Extensions for Windows Workflow Foundation (EN).exe

3] Microsoft Windows SharePoint Services 3.0 | SharePoint.exe

4] Langauge Pack Sharepoint 3.0 * | SharePointLanguagePack.exe

5] Share Point Services 3.0 SDK * | WssSDK.exe
_______________________________________________|__________________________________________________________

* Note Install these when requierd else no need to install.
__________________________________________________________________________________________________________________

Tips & Tricks for building a Webpart

Hi all,I am back again with some interesting stuff on webpart development in asp.net 2.0 and SharePoint both.
The time since I had started to work on sharepoint tools and
technology, I had always came across the requirement of building a
webpart in the sharepoint site for implementing new stuffs [like email,
calculations, displaying images etc.].

After a good long googling and R&D I came up with some discoveries,
concepts, conculsion, tricks and tacts which I am going to share with u
all.I feel u will get those things with less pain.

Ok here I start with basic defination of webpart:
Web Parts in Windows SharePoint Services provide developers with a way to create user interface elements that support both customization and personalization. A site owner or a site member with the appropriate permissions can customize Web Part Pages using a browser or Microsoft Office SharePoint Designer 2007 by adding, reconfiguring, and removing Web Parts.
The term customization implies that changes are seen by all site members. Individual users can further personalize Web Part Pages by adding, reconfiguring, and removing Web Parts. The term personalization implies that these changes will be seen only by the user that made them. Developing custom Web Parts provides an easy and powerful way to extend Windows SharePoint Services sites.

Following are some ways in which you can use custom Web Parts:

* Creating custom properties you can display and modify in the user interface.
* Improving performance and scalability. A compiled custom Web Part runs faster than a script.
* Implementing proprietary code without disclosing the source code.
* Securing and controlling access to content within the Web Part. Built-in Web Parts allow any users with appropriate permissions to change content and alter Web Part functionality. With a custom Web Part, you can determine the content or properties to display to users, regardless of their permissions.
* Making your Web Part connectable, allowing Web Parts to provide or access data from other connectable Web Parts.
* Interacting with the object models that are exposed in Windows SharePoint Services. For example, you can create a custom Web Part to save documents to a Windows SharePoint Services document library.
* Controlling the cache for the Web Part by using built-in cache tools. For example, you can use these tools to specify when to read, write, or invalidate the Web Part cache.
* Benefiting from a rich development environment with debugging features that are provided by tools such as Microsoft Visual Studio 2005.
* Creating a base class for other Web Parts to extend. For example, to create a collection of Web Parts with similar features and functionality, create a custom base class from which multiple Web Parts can inherit. This reduces the overall cost of developing and testing subsequent Web Parts.
* Controlling the implementation of the Web Part. For example, you can write a custom server-side Web Part that connects to a back-end database, or you can create a Web Part that is compatible with a broader range of Web browsers.


Now as the webpart framework is build up on .Net 2.0 so its possible to built up sharepoint webpart using the same.

As per my research and extensive R&D I came up with conculsion that we can develope a sharepoint webpart in following way:

  1. Building sharepoint webpart using asp.net webpart namespace but for that we need
    to few more things in that code so that sharepoint can Identify it.
  2. By consuming or referring the sharepoint namespace while building a webpart.
And the techniquics to built a webpart are as follows:
  1. Using Visual Studio .NET ClassLibrary template.
  2. Using Visual Studio .NET WebControlLibrary template.
  3. Using Visual Studio .NET SharePoint Template for specifically building webparts.
Note: The above templates can be found as follows:-

Open
Visual Studio .NET--> File -->New -->Project -->Under Visual C# tree check Windows Option -->in left window u will find 2 options viz:
1]
ClassLibrary template; 2] WebControlLibrary.

where as for the
SharePoint Template:-
Open Visual Studio .NET--> File -->New -->Project -->Under Visual C# tree check SharePoint Option -->in left window u will find webpart template.

From the above techniquics here I will pen down the WebControlLibrary option [There are slight differences].

Creating a Web Control Project
To begin, you must first create a Web Control project in Visual Studio to contain code and supporting files for the Web Part.

To create a Web control project to contain the Web Part
Start Visual Studio 2005.

On the File menu, point to New, and then click Project.

The New Project dialog box appears.

In the Project Type pane, in the Visual C# node, select Windows.

In the Templates pane, click Web Control Library.

Rename your project from WebControlLibrary1 to MyFirstWebPart.

Setting Up Your Project
Before you can start working with the code for a Web Part, you must make the following changes to your project settings:

Note:
You must make these changes for any Web Part that you create, so you might want to keep this information available for future use.
  • Add the necessary references to create a SharePoint Web Part.
  • Remove unnecessary code from the project template.
  • Set the version number of the Web Part assembly.
  • Sign the Web Part assembly with a strong name.
Adding Necessary References to Create a SharePoint Web Part
A Web Part that is used on a SharePoint page must inherit from Microsoft.SharePoint.WebPartPages.WebPart. It also uses the

System.Xml.Serialization namespace to declare the attributes of the Web Part. Therefore, you must add references to those libraries, as follows.
To add references to the project
On the Project menu, click Add Reference.
In the Add Reference dialog box, on the .NET tab, select Microsoft.SharePoint.

Note:
You can also open the Add Reference dialog box in Solution Explorer by right-clicking References and selecting Add Reference.
Click OK.

Note:
The previous steps assume that you are building the Web Part on a computer where Office SharePoint Server 2007 is installed.
You can also find Microsoft.SharePoint.dll at drive:\Program Files\Common Files\Microsoft Shared\Web server extensions\12\ISAPI.

Repeat steps 1 to 3 to add a reference to System.Xml.

Removing Unnecessary Code from the Project Template
The WebCustomControl1.cs file contains code that is created by default when you create the Web Control project.

To remove unnecessary code from the project template
Rename the WebCustomControl1.cs file to MyFirstWebPart.cs.

In the MyFirstWebPart.cs class, replace all of the code that is inserted in the file by default with the following:

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
// custom added
using System.Xml.Serialization;
using Microsoft.SharePoint.WebPartPages;

namespace MyFirstWebPart
{
[XmlRoot(Namespace = "MyFirstWebPart")]
public class MyFirstWebPart : WebPart
{
protected override void RenderWebPart(HtmlTextWriter output)
{
base.RenderWebPart(output);
}
}
}

Setting the Version Number for the Project
By default, the AssemblyVersion property of your project is set to increment each time you recompile your Web Part. A Web Part Page identifies a Web Part with the version number that is specified in the web.config file. With the AssemblyVersion property set to increment, if you recompile your Web Part after importing it into a Web Part Page, the Web Part Framework looks for the version number that you specified in the web.config file. If the version number does not match, an error occurs. To prevent the version number of your Web Part from incrementing each time you recompile, you must set the version number in AssemblyInfo.cs.

To set the version number
In Solution Explorer, in the Properties node, double-click AssemblyInfo.cs.

Edit the line [assembly: AssemblyVersion("1.0.*")], so that it reads [assembly: AssemblyVersion("1.0.0.0")].

Save the project.

Signing the Assembly with a Strong Name
Web Parts are designed to be distributed over the Internet or an intranet. For security reasons, when you create a custom Web Part, you must sign it with a strong name to ensure that the Web Part can be trusted by your users.A strong name consists of the assembly's identity, a public key, a digital signature, and so on. You can use the strong name tool (sn.exe) to manage keys, generate signatures, and verify signatures. This tool is installed with the Microsoft .NET Framework software development kit (SDK) when you install Visual Studio 2005.

To assign a strong name to your assembly

In Solution Explorer, right-click the MyFirstWebPart project, and then select Properties.
On the Signing tab, select the Sign the assembly check box.

In the Choose a strong name key file list, select

Enter keypair as the file name, and clear the Protect my key file with a password check box.

Save the project.