programming4us
programming4us
ENTERPRISE

Microsoft Content Management Server : Building SharePoint Web Parts - The SharePoint MCMS Navigation Control, Creating the Web Part Project

8/30/2012 3:13:28 AM

The SharePoint MCMS Navigation Control

We will develop a Web Part as a server control by building a Web Part that acts as an MCMS navigation component. The server control methodology has been selected as it is the most flexible method. End users with WSS/SPS Web Designer rights will be able to add the Web Part to a Web Part Page and configure the Web Part by specifying the MCMS Channel. The items in the configured MCMS Channel will be rendered in the Web Part using an XSLT (Extensible Stylesheet Language Transformations) stylesheet to produce the following display:

To build this Web Part, we’ll perform the following steps:

  • Prepare the development environment

  • Create the Web Part Project

  • Create the Web Part

  • Define custom properties for the Web Part

  • Develop custom properties for the Web Part

  • Build the Data Layer

  • Build the Presentation Layer

  • Deploy the Web Part

The Web Part we are building will run under both SPS and WSS as we will not be using any features specific to Microsoft SharePoint Portal Server.

Preparing the Development Environment

To most efficiently develop Web Parts as ASP.NET Server Controls, we need to install the Visual Studio .NET templates necessary for Web Parts. These templates don’t ship with Visual Studio .NET 2003, but are available for download from the Microsoft website at:

http://www.microsoft.com/downloads/details.aspx?FamilyID=CAC3E0D2-BEC1-494C-A74E-
75936B88E3B5&displaylang=en

					  

During installation of the Web Part templates, you will be prompted for the location of Microsoft.SharePoint.dll. This assembly is located in Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\ISAPI\ on your SharePoint (WSS/SPS) Server. You might need to copy Microsoft.SharePoint.dll to your development PC from the server with SPS or WSS installed.

Creating the Web Part Project

Web Parts should be built using the Web Part Library project. So let’s go ahead and create this project.

1.
In Visual Studio .NET, select Create New Project (Shift + Ctrl + N).

2.
Select the project type as Visual C# Projects, and choose the new Web Part Library template from the right-hand pane.

3.
Name the new project ExtensibleMCMSPageListingWebPart, and place the project directory under My Documents\Visual Studio Projects.

4.
Click OK.

Once our new project is created, we can see a variety of files and references that have been created by the template:

Some of the most important of these are:

  • References to:

    • Microsoft.SharePoint—SharePoint’s main API

    • System.Web—.NET Framework namespace holding classes for web operations

    • System.Xml—.NET Framework namespace holding classes for XML operations

  • AssemblyInfo.cs—used to define the metadata of the assembly and to specify a key file to sign it.

  • Manifest.xml—used to populate CAB files during the deployment process.

  • WebPart1.cs—an empty Web Part template similar to the Class1.cs file created when using a Class Library template.

  • WebPart1.dwp—an XML file used when deploying Web Parts to Windows SharePoint Services. It contains the references to the assembly name and the class name used by the Web Part.

You can delete the following files from the solution: WebPart1.cs, WebPart1.dwp, and Manifest.xml, as we will create our own later on.

Other  
 
video
 
Video tutorials
- How To Install Windows 8

- How To Install Windows Server 2012

- How To Install Windows Server 2012 On VirtualBox

- How To Disable Windows 8 Metro UI

- How To Install Windows Store Apps From Windows 8 Classic Desktop

- How To Disable Windows Update in Windows 8

- How To Disable Windows 8 Metro UI

- How To Add Widgets To Windows 8 Lock Screen

- How to create your first Swimlane Diagram or Cross-Functional Flowchart Diagram by using Microsoft Visio 2010
programming4us programming4us
programming4us
 
 
programming4us