Sunday, November 22, 2009

Hardware and Software requirements for SharePoint Server 2010

Hardware and Software requirements for SharePoint Server 2010

Harware Requirements
Processor
--> 64-bit, dual processor, 3 GHz
RAM --> 4 GB for stand-alone or evaluation installation (or) 8 GB for single server and multiple server farm installation for production use
Hard disk --> 80 GB


Software Requirements

Database server in a farm: The 64-bit edition of Microsoft SQL Server 2005 with Service Pack 3 (SP3), or the 64-bit edition of Microsoft SQL Server 2008 with Service Pack 1 (SP1)

Stand-alone server
1) The 64-bit edition of Windows Server 2008 Standard with SP2
2) Web Server (IIS) role
3) Application Server role
4) Microsoft .NET Framework version 3.5 SP1
5) SQL Server 2008 Express with SP1
6) Microsoft "Geneva" Framework
7) Microsoft Sync Framework Runtime v1.0 (x64)
8) Microsoft Filter Pack 2.0
9) Microsoft Chart Controls for the Microsoft .NET Framework 3.5
10) Windows PowerShell 2.0 CTP3
11) SQL Server 2008 Native Client
12) Microsoft SQL Server 2008 Analysis Services ADOMD.NET
13) ADO.NET Data Services v1.5 CTP2


Front-end Web servers and application servers in a farm
1) The 64-bit edition of Windows Server 2008 Standard with SP2
2) Web Server (IIS) role
3) Application Server role
4) Microsoft .NET Framework version 3.5 SP1
5) Microsoft "Geneva" Framework
6) Microsoft Sync Framework Runtime v1.0 (x64)
7) Microsoft Filter Pack 2.0
8) Microsoft Chart Controls for the Microsoft .NET Framework 3.5
9) Windows PowerShell 2.0 CTP3
10) SQL Server 2008 Native Client
11) Microsoft SQL Server 2008 Analysis Services ADOMD.NET
12) ADO.NET Data Services v1.5 CTP2


Client computer
1) Microsoft Silverlight 3.0
2) A supported browser

Saturday, November 21, 2009

Advantage of 64-bit OS for SharePoint Server 2010

Advantage of 64-bit OS for SharePoint Server 2010

The main reason for building SharePoint Server 2010 on 64-bit OS is
(remember optimum benefit is derived only when 64-bit hardware and software are working together)

1. A server that has both a 64-bit CPU and a 64-bit data bus is better able to process and manage the large database files associated with Office SharePoint Server 2007. Among other benefits, a 64-bit CPU can calculate individual tasks two times as fast as a 32-bit model and can address significantly more random access memory (RAM) than the 4-gigabyte (GB) limit imposed by 32-bit processors. The prevalence of 32-bit servers puts some limitations on the speed, reliability, and scalability of applications that require a lot of resources, such as Office SharePoint Server 2007.
2) A 32-bit system architecture can directly address only a 4-GB address space whereas a 64-bit system architecture that is running a 64-bit edition of Windows Server can support up to 1,024 GB of both physical and addressable memory.
3) The 64-bit editions of Windows Server can address 16 terabytes of virtual memory by using a flat addressing model.
4) A 64-bit system offers practically unlimited address space for user mode processes.
5) Improvements in parallel processing and bus architectures enable 64-bit environments to support as many as 64 processors and provide almost linear scalability with each additional processor.
6) Function calls are also faster in a 64-bit environment because as many as four arguments at a time can be passed in registers to a function.
7) It is less likely that the buffer will overflow
8) Fewer lost connections, improved I/O handling

Thursday, November 19, 2009

Access STSADM.EXE From any Directory in a Command Prompt

Access STSADM.EXE From any Directory in a Command Prompt

STSADM.EXE the main administration utility for SharePoint, is a command line utility. You'll find it in c:\program files\common files\microsoft shared\web server extensions\12\bin . To run it, you have to actually be in that directory... but its itching to go to that path and then executing the command Instead, add the directory to the PATH environment variable so you can type STSADM.EXE from any directory on your system. To do this:

Start -> All Programs -> Control Panel -> System
On the Advanced tab, click the Environment Variables button.
Select the variable Path and click the Edit button.

Add the following to the end of the Variable value field (don't forget the semicolon... the Path environment variable is a semicolon delimited string of directories):;C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN
OK out of all the dialogs.
Next time your system restarts, you'll be able to type STSADM.EXE at a command prompt from any directory on your system.

Tuesday, November 17, 2009

Adding navigation hierarchial nodes to BreadBrumb

Showing links to Sub Folders of Document Library in BreadCrumb

While navigating to folders within Document library, have you ever noticed the name of the folder in BreadCrumb........
By default you will not be seeing folders of a document library in BreadCrumb, you will be able to see only till the name of the Document Library
Unless you customize the BreadCrumb,
so How to customize it?
Follow the below steps to display the Sub Folders of a Document Library in BreadCrumb
1. Open SharePoint Desigenr 2007
2. Open that web site where you want to customize the BreadCrumb
3. Go to that document library. Inside you can see a folder with the name of "Forms".
4. Double click to open it.
5. Double click on "AllItems.aspx" file.
6. Within that source, you can see the below code. sometime, the below code will not be available. If the code is not available, add the below code in between any of the 2 Content blocks.


Content1" ContentPlaceHolderId="PlaceHolderTitleBreadcrumb" runat="server">



7. Change the SiteMapProvider value as "SPContentMapProvider" instead of "CurrentNavSiteMapProviderNoEncode"
See the Sample Code below:
Content1" ContentPlaceHolderId="PlaceHolderTitleBreadcrumb" runat="server">


Navigate to a sub folder in the document library where we modified the code
And you are done..... :)

Monday, November 16, 2009

Creating a Custom HttpHandler in Windows SharePoint Services 3.0

Creating a Custom HttpHandler in Windows SharePoint Services 3.0

ASP.NET programming supports the creation of custom HttpHandler components, which provide a flexible and efficient way to process requests that don't return standard HTML-based pages. For example, HttpHandler components are great for situations in which you want to return simple text, XML, or binary data to the user.


The easiest way to create a custom HttpHandler component is to create a source file with an .ashx extension. You must then add a @WebHandler directive to the top of the .ashx file, along with a class definition that implements the IHttpHandler interface. Any class that implements the IHttpHandler interface must provide an implementation of the IsReusable method and the ProcessRequest method. If you want to be able to program against the Windows SharePoint Services object model from inside the HttpHandler component, you can also add an @Assembly directive to reference the Microsoft.SharePoint assembly.

<%@ Assembly Name="Microsoft.SharePoint, [full assembly name]" %>
<%@ WebHandler Language="C#" Class="HelloHttpHandler" %>
using System;
using System.Web;
using Microsoft.SharePoint;
public class HelloHttpHandler : IHttpHandler {
public bool IsReusable {
get { return false; }
}
public void ProcessRequest(HttpContext context) {
SPSite siteColl = SPContext.Current.Site;
SPWeb site = SPContext.Current.Web;
context.Response.ContentType = "text/plain"
context.Response.Write("Hello HttpHandler from the site " +
site.Title +
" at " +
site.Url);
}
}


After you create an .ashx file that defines an HttpHandler component, you must deploy it within the \LAYOUTS directory as you would deploy a custom application page. A best practice is not to deploy any files directly inside the \LAYOUTS directory but instead to create a project-specific or company-specific directory and then to deploy files inside this inner directory. That way you don't run the risk of file name conflicts as you deploy a custom solution.
After you deploy your .ashx file within a directory nested within the \LAYOUTS directory, it is accessible to any site in the farm by using a site-relative path.


http://MyWebServer/sites/Sales/_layouts/Litware/HelloHttpHandler.ashx

As with a standard application page, the HttpHandler component can gain an entry point into the Windows SharePoint Services object model to the current SPSite and SPWeb objects by using SPContext.Current.Site and SPContext.Current.Web.
You can write content back to the caller by using one or more calls to context.Response.Write or context.Response.BinaryWrite. You can also write data directly to the ASP.NET output stream by using various classes available in the System.IO namespace.
Finally, note that you are often required to programmatically assign a value to the ContentType property of the ASP.NET Response object. This example demonstrated using a ContentType value of "text/plain" to indicate that simple text is returned. You use a value of "text/xml" if your handler creates and passes back an XML document. There are also other values that you can use to indicate other types of files, such as Microsoft Word documents, PDF files, and media files such as audio clips and movies.

Sunday, November 15, 2009

Floating (Movable) Web Part Task Pane

Floating (Movable) Web Part Task Pane

The following script will allow you to attach javascript dragging events to any element on the page, using only it's "ID" field. The only trouble that I had implementing this into SharePoint is that you have to circumvent the out-of-the-box tag. This is easy enough with a little change to your master page.

1. Download "
dom-drag.js" from the website mentioned above
2. Upload this script somewhere on your server
3. Open your master page in SharePoint Designer 2007
4. Find the line in your master page that begins with

5. Replace this line with the following code:

6. In the section of your master page, add the following code:




7. Add this code to your default CSS file:


/* float web part panel */ .ms-ToolPaneOuter { position: absolute; height: 80% !important; border: 2px #6f9dd9 solid; top: 0; left: 0; } td#MSOTlPn_MainTD { width: 0 !important; } td#MSOTlPn_ToolPaneCaption { cursor: move; }

Notice that we moved the "_spBodyOnLoadWrapper();" event into our custom onload event. This allows us to call the event as normal, but also to add our own custom onload javascript. The CSS basically hides the right-hand column and then "floats" the task pane by giving it an absolute position within the page. You can adjust the "top" and "left" values to make the task pane appear anywhere within the window.


Saturday, November 14, 2009

Redirecting Web Sites in IIS 6.0 (IIS 6.0)

Redirecting Web Sites in IIS 6.0 (IIS 6.0)

When a browser requests a page or program on your Web site, the Web server locates the page identified by the URL and returns it to the browser. When you move a page on your Web site, you can't always correct all of the links that refer to the old URL of the page. To make sure that browsers can find the page at the new URL, you can instruct the Web server to redirect the browser to the new URL.

You can redirect requests for files in one directory to a different directory, to a different Web site, or to another file in a different directory. When the browser requests the file at the original URL, the Web server instructs the browser to request the page by using the new URL.


Important

You must be a member of the Administrators group on the local computer to perform the following procedure or procedures. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run IIS Manager as an administrator. At a command prompt, type runas /user:Administrative_AccountName "mmc %systemroot%\system32\inetsrv\iis.msc".
Procedures
To redirect requests to another Web site or directory
1.In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
2.Click the Home Directory, Virtual Directory, or Directory tab.
3.Under The content for this source should come from, click A redirection to a URL.
4.In the Redirect to box, type the URL of the destination directory or Web site. For example, to redirect all requests for files in the Catalog directory to the NewCatalog directory, type /NewCatalog.


To redirect all requests to a single file
1.In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
2.Click the Home Directory, Virtual Directory, or Directory tab.
3.Under The content for this source should come from, click A redirection to a URL.
4.In the Redirect to box, type the URL of the destination file.
5.Select the The exact URL entered above check box to prevent the Web server from appending the original file name to the destination URL.
You can use wildcards and redirect variables in the destination URL to precisely control how the original URL is translated into the destination URL.
You can also use the redirect method to redirect all requests for files in a particular directory to a program. Generally, you should pass any parameters from the original URL to the program, which you can do by using redirect variables.

To redirect requests to a program
1.In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
2.Click the Home Directory, Virtual Directory, or Directory tab.

3.Under The content for this source should come from, click A redirection to a URL.
In the Redirect to box, type the URL of the program, including any redirect variables needed to pass parameters to the program. For example, to redirect all requests for scripts in a Scripts directory to a logging program that records the requested URL and any parameters passed with the URL, type /Scripts/Logger.exe?URL=$V+PARAMS=$P. $V and $P are redirect variables.

4.Select the The exact URL entered above check box to prevent the Web server from appending the original file name to the destination URL.


Source: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/6b855a7a-0884-4508-ba95-079f38c77017.mspx?mfr=true

Friday, November 13, 2009

Copying dll's from GAC (Global Assembly Cache)

Stealing assemblies (dll's) from Global Assembly Cache GAC


have you ever tried copying dll's from GAC


there is a way how you can  do it

go to start --> click "Run" then type "c:\WINDOWS\assembly\gac_MSIL" and type OK


now from the folders you can copy which ever the dll you want.

Thursday, November 12, 2009

MOSS 2007 pages and Query String Parameters

MOSS 2007 pages and Query String Parameters


Most of the time it might require for us to edit the SharePoint pages using browser.
Incase if the pages is created using a specific layout or other ways we can use "Edit Page" option from "Site Action" menu.
But what if we need to edit application pages like DispForm.aspx, AllItems.aspx...etc. Can you use "Edit Page" option from "Site Action" Menu the answer is unfortunately no :(.
Then how to edit the page...


Dont worry there are always ways to acheive the solution for problems,


use Query string variable to solve the problem:


append the page with the query string parameters
http://...../dispForm.aspx?ToolPaneView=2&PageView=Shared


below are some of the other options


Content=1  ---- Displays the page WebPart Maintenance View Mode

Mode=View/Edit (View or Edit)

DisplayMode=Design

ControlMode=Edit

ToopPaneView=1/2/3 (1 or 2 or 3)

PageView=Shared/Personal (Shared or Personal)

and many more....
try using permutations and combinations of these you will see the magic...

Wednesday, November 11, 2009

MOSS 2007 Alternate Access Mapping

Alternate Access Mapping


Alternate Access Mapping enables you to access your Sharepoint site via a typical url like http://mysharepoint.com instead of hitting the server name at http://mysharepointserver. In combination with DNS A host entries you can also define urls like http://mysite.mysharepoint.com even though your My Site web application is hosted on a different port.


1. Go to Central Administration for your WSS or MOSS instance.


2. Click on the Operations Tab


3. Click on Alternate Access Mappings under Global Configuration


4. You should now see a list of your web applications, switch over to the one you want to map to the new URL by selecting it from the drop down on the right side.


5. Click on Edit Public URLs and change the desired zone URL type to your new domain name. You can also change your internal URLs also by clicking Add Internal URLs.


6. Now you’ll have to switch over to your DNS server.


Within the DNS Management Console and Under Forward Lookup Zones:


7. Add a new Primary Zone with your new domain name.


8. Add a new Host (A) to the records and point the IP Address to the sharepoint server.


And that should be it! Now you can have friendly URLs pointing to whatever Sharepoint Site Collection/Web Application you’d like without exposing the server names or ports.

Tuesday, November 10, 2009

MOSS 2007 Checking In and Checking out multiple documents

MOSS 2007 Checking In and Checking out multiple documents



Below are the steps to check out / check in multiple documents in MOSS 2007

1. Make sure you have appropriate privileges
2. Select "Manage Content and Structure" under Site Actions menu.
3. You will be diplayed with all the site hierarchy to the left of the page
4. Navigate to the site and click on the document library where you want to check out / in multiple documents
5. You will be displayed with the documents with check boxes beside them.
6. Select all the documents you want to check in or check out.
7. Now click on Actions menu displayed on the top and select the action of your choice


and you are done :)

Monday, November 9, 2009

Programming SharePoint 2007 Web Services

Programming SharePoint 2007 Web Services

In the below example we will see how to get list items from a SharePoint list using SharePoint built in web services.
1. Open Visual Studio 2005
2. Create a new web application/web site of your choice, give the name MossWebServiceExample.
3. Add Web reference - either you can choose web services from local machine or by specifying the url http://servername:portnumber/_vti_bin/Lists.asmx - give the name ListService to the added web reference
4. Wihtin the page class file add a reference to the added web service
using MossWebServiceExample.ListService;

use the below code and you are done

ListService.Lists listService = new Lists();
listService.Credentials = System.Net.CredentialCache.DefaultCredentials;
XmlDocument xmlDoc = new System.Xml.XmlDocument();
XmlNode ndQuery = xmlDoc.CreateNode(XmlNodeType.Element, "Query", "");
XmlNode ndViewFields = xmlDoc.CreateNode(XmlNodeType.Element, "ViewFields", "");

ndViewFields.InnerXml ="";
ndQuery.InnerXml = "Specify text;

try
{
XmlNode ndListItems =
listService.GetListItems("", null, ndQuery, ndViewFields, "", null, null);
Page.Response.Write(ndListItems.InnerXml);
}

catch (System.Web.Services.Protocols.SoapException ex)
{
Page.Response.Write("Message:\n" + ex.Message + "\nDetail:\n" + ex.Detail.InnerText + "\nStackTrace:\n" + ex.StackTrace);
}

Sunday, November 8, 2009

Page Processing in SharePoint Server 2007 and MCMS

Page Processing


Page processing in Office SharePoint Server 2007 is more integrated with the ASP.NET 2.0 core elements, and is no longer an extension on top of IIS. SharePoint Server also takes advantage of the tighter integration to Windows SharePoint Services 3.0.

As a result, in SharePoint Server, page processing follows these steps:
1. The browser requests a Web page from IIS.
2. IIS passes the request to ASP.NET 2.0
3. ASP.NET 2.0 retrieves the page via a Windows SharePoint Services 3.0 file provider.
4. The stream for Page Layout associated with the current page is loaded
5. The stream for the master page is loaded.
6. Page Layout runs each control on the page in the context of the page that was requested.
7. IIS returns the page to the browser.

Due to the change of technologies, page processing differs between MCMS 2007 and Office SharePoint Server 2007.
In MCMS 2002, page processing follows these steps:
1. The browser requests a Web page from IIS.
2. The MCMS ISAPI filter determines that the request is an MCMS page (posting) or resource.
3. The filter rewrites the request with help from the MCMS Content Server.
4. The filter passes the updated request back to IIS.
5. The ASP.NET ISAPI extension determines that the request is for an ASP.NET–based file.
6. The extension passes the request to the ASP.NET worker process.
7. The worker process communicates with the MCMS Content Server to assemble all the information for the page.
8. The ASP.NET worker process returns the assembled page to IIS.
9. IIS returns the page to the browser.

Saturday, November 7, 2009

Resuable content in Mocrosoft Office Share Point Server 2007

Resuable content in Mocrosoft Office Share Point Server 2007


SharePoint Publishing controls are rich in presenting the information with a rich UI experience. Though these controls like RichHTML provides options to format you text using HTML styles, it will be more helpful if you can have a predefined layout sort or content to place in it with ease,
but they are variable height and require several background images so we are talking about inserting a bit of “complex” html. How can we provide a user friendly interface with as little customisation as possible?


Let us see how we can acheive this using Resuable Lists that comes with MOSS 2007. Remember this comes only with Publishing sites and not for all types of sites.


The styling of the box, including the background images is done via CSS. The header and footer are fixed height, whereas the content area is variable height and has a background image that repeats in the vertical direction.


when you create a site collection using the Publishing Site Site Definition, you should have a list called "Reusable Content" in your root web. You can navigate to it using Site Content and Structure. We will create an item in this list that will be a “template” for our box.


Create a new item by selecting "Reuable HTML" Content Type from the list as shown below:



While creating the new  item do not forget to deselect the check box "Automatic Update", otherwise you will not be able to edit the template content while editing from the target control.





If you want to customize the content after selecting the template click on button edit HTML Source Customize the template to fit your requirement. Click OK will create a new Reusable list item that can be placed withing your RichHTML SharePoint Publishing control.


Now select the template as shown below:







and you are done customize the content by placing the curson at the content area.



Thursday, November 5, 2009

Business Connectivity Services (BCS)

Business Connectivity Services (BCS)


Microsoft Business Connectivity Services (BCS) (formerly named the Business Data Catalog) provides read/write access to external data from line-of-business (LOB) systems, Web services, databases, and other external systems within Microsoft SharePoint 2010 and Microsoft Office 2010 applications. Both SharePoint 2010 and Office 2010 applications have product features that can use external data directly, both online and offline. Developers can gain access to a rich set of features and rapidly build solutions using familiar tools such as Microsoft Visual Studio 2010 and Microsoft SharePoint Designer 2010.


Business Connectivity Services enhances Office application and SharePoint application capabilities and their user interface (UI) through features, services, and tools. These enhanced capabilities and UI streamline development of solutions with deep integration of external data and services. Experienced users, developers, and business unit IT professionals can integrate assets from external systems and enable interaction with the external data through many types of Office client and server applications. The Business Connectivity Services feature set enables rapid development and deployment of scalable and security-rich solutions. The following diagram shows a high-level view of Business Connectivity Services.






 The following are some of the new features of Business Connectivity Services.


Write-Back to External Systems
Using Business Connectivity Services, you can Create, Read, Update, Delete, and Query (CRUDQ) to the external system from a Microsoft Office application or SharePoint site if the external system supports the operations and is modeled appropriately in the Business Data Connectivity (BDC) service


Familiar SharePoint and Office UI on External Data
External content types provide SharePoint behaviors (such as lists, Web Parts, and profile pages) and Office Type behaviors (such as Microsoft Outlook Contacts, Tasks, and Calendars, Microsoft Word documents, and Microsoft SharePoint Workspace 2010 lists), and capabilities (such as searching and working offline) to external data and services. As a result, users can work in their familiar work environments without needing to learn different (and often proprietary) user interfaces. 

Offline Access to External Data
Business Connectivity Services provides rich cache and offline work features, and supports cache-based operations. Users working with solutions that are deployed on Microsoft Office 2010 applications, such as Microsoft Outlook 2010 and Microsoft SharePoint Workspace 2010, can manipulate external data efficiently, even when they are working offline or if the server connectivity is slow, intermittent, or unavailable. The read/write operations performed against cached external entities are synchronized when connection to the server becomes available. It also provides a flexible external data caching mechanism that is as transparent as possible while still enabling the user or application to have explicit control over the content of the cache when required via automatic and manual cleanup.


More Connectivity Options
The core function of BDC is to provide connectivity support to the following types of external systems:  
  • Databases 
  • Web/WCF services 
  • Microsoft .NET Framework connectivity assemblies 
  • Custom data sources Extensible Provider Model
    In addition to connectors for the previous list of data sources provided by BDC, BDC provides a pluggable framework with which developers can plug in connectors for new external system types, thus enabling these new data source types to be accessed via the BDC.


    Batch and Bulk Operation Support
    In Microsoft Office SharePoint Server 2007, BDC supported only single item operations, such as search. BDC now provides batch and bulk operation support which enable you to read multiple items in a single call thus reducing round trips to the backend dramatically.

    Symmetrical Server and Client Runtimes
    In Microsoft SharePoint Server 2007, BDC was provided only in the Microsoft Office SharePoint Server 2007 Enterprise CAL. In Microsoft Office 2010 and SharePoint 2010, BDC is included in both client and server to provide symmetrical client/server scenarios. The preceding diagram shows the presence of BDC in both SharePoint Server and in the Office client applications. The primary reason for the client-side presence is to enable external data integration scenarios on Office client applications such as Microsoft Outlook 2010 and Microsoft SharePoint Workspace 2010. On the client computer, a SQL CE database is used to cache external data to provide a uniform experience offline in the absence of network connectivity. BDC supports two data paths from client to external system:  
    • Client connects directly to external system (known as online connection mode)  
    • BDC client fetches data from the local cache (known as cached connection mode)



Read Blobs
BDC now supports reading binary large object (BLOB) data. This is useful for streaming BLOBs of data from the external system.


Read and Write-Back of Complex Types
BDC now supports dot notation in field names and therefore enables you to read and write complex types


Life Cycle Management
Business Connectivity Services provides a set of tools to facilitate creation of models and Office 2010 application artifacts, declaratively and by writing code. You can use Microsoft SharePoint Designer 2010 to rapidly create composite solutions that meet external unit needs without writing code. You can use Visual Studio to create or extend solutions with sophisticated workflows and data that spans structured line-of-external (LOB) systems, unstructured SharePoint applications or Microsoft Office applications, and Web 2.0 services.


Business Connectivity Services Solutions are assembled from a diverse array of artifacts that must be deployed on the client (an Office 2010 application such as Microsoft Outlook 2010) and the server running SharePoint Server 2010. Business Connectivity Services provides automatic packaging and deployment for solutions. It packages all related artifacts as a single, versioned unit and then publishes them to a SharePoint site. After the artifacts are published on the server, the solution is available to the SharePoint sites immediately. The solution package can then be proactively distributed and deployed (the push model) to the clients or users, and they can be required to "opt in." Business Connectivity Services uses the Visual Studio Click Once deployment to rapidly deploy solutions on the clients.


Enhanced API Set and Extensibility
Developers can use the BDC Runtime object model to write generic applications by using the stereotyped APIs as building blocks. Such generic applications are then assured to work against any external system, including those that are preexisting and those that are yet to be built.


Developers can also write specific applications that make assumptions about the abstract entity model (the fields exposed by these, and the types of the fields).


And with the .NET Assembly Connector, Custom Connector, and the pluggable Secure Store Provider, it provides a rich extensibility mechanism for software developers.











    Wednesday, November 4, 2009

    Useful MOSS Search Development Related Articles

    Useful MOSS Search Development Related Articles


    Best Practices: Writing SQL Syntax Queries for Relevant Results in Enterprise Search --http://msdn2.microsoft.com/en-us/library/bb219479.aspx


    Creating Search Queries Programmatically by Using the Search Object Model in SharePoint Server 2007 - http://msdn2.microsoft.com/en-us/library/bb626127.aspx


    Creating Search Queries Programmatically by Using the Search Web Service in SharePoint Server 2007 -http://msdn2.microsoft.com/en-us/library/bb625950.aspx


    Evaluating and Customizing Search Relevance in SharePoint Server 2007 --http://msdn2.microsoft.com/en-us/library/bb499682.aspx


    Book Excerpts "Chapter 3: Customizing and Extending the Microsoft Office SharePoint 2007 Search (Part 1 of 2)" --http://msdn2.microsoft.com/en-us/library/bb608302.aspx


    Book Excerpts "Chapter 3: Customizing and Extending the Microsoft Office SharePoint 2007 Search (Part 2 of 2)" - http://msdn2.microsoft.com/en-us/library/bb608305.aspx


    Creating a Custom Search Page and Tabs in the Search Center of SharePoint Server --http://msdn2.microsoft.com/en-us/library/bb428855.aspx


    Creating and Exposing Managed Properties in the Advanced Search Page of SharePoint Server Enterprise Search -- http://msdn2.microsoft.com/en-us/library/bb428648.aspx


    Creating and Exposing Search Scopes in SharePoint Server 2007 Enterprise Search --http://msdn2.microsoft.com/en-us/library/bb428856.aspx


    Displaying Search Results in a Grid View in SharePoint Server 2007 -- http://msdn2.microsoft.com/en-us/library/ms497338.aspx


    Exposing Enterprise Search in SharePoint Server 2007 by Using Internet Explorer 7 and the Office Research Pane -- http://msdn2.microsoft.com/en-us/library/bb625970.aspx


    Creating Custom Enterprise Search Web Parts in SharePoint Server 2007 --http://msdn2.microsoft.com/en-us/library/bb871647.aspx


    Customizing Search Results with Custom XSLTs in SharePoint Server 2007 --http://msdn2.microsoft.com/en-us/library/bb896018.aspx


    Searching in MOSS in the SDK -- http://msdn2.microsoft.com/en-us/library/ms497338.aspx


    Class Library reference in MOSS SDK -- http://msdn2.microsoft.com/en-us/library/ms577961.aspx

    Windows PowerShell for SharePoint Foundation 2010

    Windows PowerShell for SharePoint Foundation 2010


    Windows PowerShell™ is a new command-line tool and a supporting scripting language from Microsoft that complements Cmd.exe in the Windows administration context and that supersedes the Stsadm.exe administration tool. Although both Cmd.exe and Stsadm.exe will be maintained for backward compatibility, all current and future development of scripts and administrative files in SharePoint Foundation should use this new scripting technology.

    Windows PowerShell Basics

    Unlike most command-line tools, which accept and return text, Windows PowerShell is built on the Microsoft .NET Framework and accepts and returns .NET Framework objects. This fundamental change in the environment brings entirely new tools and methods that greatly improve control, efficiency, and productivity for developers and administrators.

    Windows PowerShell is a simple command-line tool that introduces the concept of a cmdlet. A cmdlet is a verb-noun combination comprising a command and an object on which the command acts. Windows PowerShell cmdlet names are comprised of verbs and nouns, separated by a dash (-), which together denote their functional properties. For example, the cmdlet name Get-SPSite combines the verb (command) "Get" with the noun (object) "SPSite" to name the cmdlet that retrieves a specified SPSite object. You can use cmdlets individually, or you can string cmdlets together in linked sequences to perform complex tasks.

    Cmdlet nouns take parameters as name-value pairs that give specificity to the cmdlet noun. When cmdlets are invoked, they return output objects. The objects that are returned also have properties that display as name-value pairs. Because cmdlets return objects, these objects can be passed (or "piped") to another cmdlet, in sequence. In this way, cmdlets can be chained together, providing enormous flexibility.

    In fact, this is just the beginning of the significant differences between a Windows PowerShell cmdlet and commands in stsadm.exe. For example, it is important to note that a cmdlet is not an executable; rather, it is an instance of a .NET Framework class. So, with a few exceptions, cmdlets return objects rather than text streams, and they process their input objects from an object pipeline.

    As you can see, Windows PowerShell is not just a new command-line tool. It is also, and perhaps more importantly, a new scripting language. Windows PowerShell installs natively with over 100 core Windows cmdlets. The library of SharePoint Foundation cmdlets, which presently number over 500, will install on top of these core cmdlets.

    Windows PowerShell Cmdlets for SharePoint Foundation

    Windows PowerShell provides both general and SharePoint-specific implementations. Under the hood, this difference is reflected in the fact that, while Windows PowerShell cmdlets generally derive from the base class PSCmdlet, the Windows PowerShell cmdlets for SharePoint Foundation derive instead from a specialized SharePoint base class called SPCmdlet.

    Following is the signature for the SPCmdlet base class. Note that SPCmdlet derives from the PSCmdlet class.

    public abstract class SPCmdlet : PSCmdlet

    Note that when you use the variable operator cmdlets, which include Get, Set, New, and Remove, you must use the specific SPCmdlet class implementations, not those derived from the PSCmdlet class. This is consistent with the scripting model for using Windows PowerShell cmdlets in SharePoint Foundation.

    For cmdlets that handle persistent objects:

    Get cmdlets: SPGetCmdletBase
    Set cmdlets: SPSetCmdletBase
    New cmdlets: SPNewCmdletBase
    Remove cmdlets: SPRemoveCmdletBase

    For cmdlets that handle nonpersistent objects:

    Get cmdlets: SPCmdlet
    Set cmdlets: SPCmdlet

    For action cmdlets:

    SPCmdlet

    Tuesday, November 3, 2009

    SPMetal Linq with SharePoint 2010

    LINQ and SharePoint 2010

    SPMetal is a command line tool that generates entity classes, which provide an object oriented interface to the Microsoft SharePoint Foundation content databases. These classes are primarily used in LINQ to SharePoint queries; but they are also be used to add, delete, and change list items with protection against concurrency conflicts. Finally, they can be used as an alternative to the regular SharePoint Foundation object model for referencing content.

    The tool is included with SharePoint Foundation and is usually located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\\BIN.

    SPMetal is typically executed as a prebuild command in Microsoft Visual Studio because the code it generates is usually part of a solution that includes a new site type that is itself evolving during the development cycle. Because SPMetal overwrites the files it generates with each execution, for a given output path and against a given Web site, you should not make changes to these files. The classes it generates are partial, so you can add members to them in separate, manually created, code files.

    If your solution is based on an existing site type, such as the Team Site that ships with SharePoint Foundation, and it references only lists that are always present in such sites and only fields (columns) that are always present in those lists, you can run SPMetal just once and make changes to the generated file that will not be overwritten.

    For more information about the practicalities of using SPMetal, see How to: Use SPMetal.

    SPMetal uses the basic syntax of other Windows command line tools:

    SPMetal [options]

    Each option is preceded by a forward slash. Most options require values, in which case the option name is followed by a colon and the value follows the colon:

    SPMetal /option1 /option2:value /option3:"value with a space"

    Options can be in any order. Not every option is required, but if you include an option, you must give it a value. If a value contains spaces, you must enclose the whole value in quotation marks (").

    Example
    Generate C# code:
    SPMetal /web:http://ContosoServer/Marketing /code:MarketingSite.cs

    Generate Visual Basic code for client-side execution with custom parameters settings:
    SPMetal /web:http://ContosoServer/Marketing /code:MarketingSite.vb /useremoteapi /parameters:MarketingSite.xml

    Generate Visual Basic code from a specified user context:
    SPMetal /web:http://ContosoServer/Marketing /code:MarketingSite.vb /user:Contoso\sally /password:7Yj38d

    Monday, November 2, 2009

    New Namespaces added in SharePoint 2010

    New Namespaces added in SharePoint 2010
    One of the best ways to get a taste for what's new in SharePoint 2010 is to peruse the new Object Model.  As you can imagine, the changes are substantial.  There are literally hundreds of new classes and thousands of new properties and methods.

    From my initial exploration, very few items appear to have been deleted or moved around.  For the most part, SharePoint 2010 is an improved superset of MOSS 2007.

    Within the technical preview, I've identified 66 new namespaces:
    Microsoft.SharePoint.Administration.AccessControl
    Microsoft.SharePoint.Administration.Claims
    Microsoft.SharePoint.ApplicationPages.Calendar
    Microsoft.SharePoint.ApplicationPages.PickerQuery
    Microsoft.SharePoint.ApplicationPages.Applications
    Microsoft.SharePoint.ApplicationPages.Applications.GroupBoard
    Microsoft.SharePoint.BusinessData
    Microsoft.SharePoint.BusinessData.Administration
    Microsoft.SharePoint.BusinessData.Infrastructure
    Microsoft.SharePoint.BusinessData.Infrastructure.Collections
    Microsoft.SharePoint.BusinessData.MetadataModel
    Microsoft.SharePoint.BusinessData.MetadataModel.Collections
    Microsoft.SharePoint.BusinessData.MetadataModel.Constants
    Microsoft.SharePoint.BusinessData.MetadataModel.Dynamic
    Microsoft.SharePoint.BusinessData.MetadataModel.Static
    Microsoft.SharePoint.BusinessData.MetadataModel.Static.DataAccess
    Microsoft.SharePoint.BusinessData.Offlining
    Microsoft.SharePoint.BusinessData.Parser
    Microsoft.SharePoint.BusinessData.Runtime
    Microsoft.SharePoint.BusinessData.SharedService
    Microsoft.SharePoint.BusinessData.SystemSpecific
    Microsoft.SharePoint.BusinessData.Upgrade
    Microsoft.SharePoint.Calculation
    Microsoft.SharePoint.Client
    Microsoft.SharePoint.Client.Application
    Microsoft.SharePoint.Client.Utilities
    Microsoft.SharePoint.Client.WebParts
    Microsoft.SharePoint.Client.Workflow
    Microsoft.SharePoint.Cmdlet
    Microsoft.SharePoint.CoordinatedStreamBuffer
    Microsoft.SharePoint.Diagnostics
    Microsoft.SharePoint.Diagnostics.ULSEventTemplates
    Microsoft.SharePoint.Internal
    Microsoft.SharePoint.Internal.Converters
    Microsoft.SharePoint.JSGrid
    Microsoft.SharePoint.JsonUtilities
    Microsoft.SharePoint.Linq
    Microsoft.SharePoint.Linq.Provider
    Microsoft.SharePoint.Linq.Rules
    Microsoft.SharePoint.MobileMessage
    Microsoft.SharePoint.Portal.ClaimProviders
    Microsoft.SharePoint.Portal.Internal
    Microsoft.SharePoint.Portal.MobileControls
    Microsoft.SharePoint.Portal.Search.PortalCrawl
    Microsoft.SharePoint.Portal.WebServices
    Microsoft.SharePoint.Publishing.Cmdlet
    Microsoft.SharePoint.RBSWrapper
    Microsoft.SharePoint.Search.Cmdlet
    Microsoft.SharePoint.SocialData
    Microsoft.SharePoint.SocialData.WebService
    Microsoft.SharePoint.Taxonomy
    Microsoft.SharePoint.Taxonomy.Cmdlet
    Microsoft.SharePoint.Taxonomy.ContentTypeSync
    Microsoft.SharePoint.Taxonomy.Generic
    Microsoft.SharePoint.Taxonomy.OM
    Microsoft.SharePoint.Taxonomy.Upgrade
    Microsoft.SharePoint.Taxonomy.WebServices
    Microsoft.SharePoint.TenantAdministration
    Microsoft.SharePoint.UserCode
    Microsoft.SharePoint.Utilities.Cab
    Microsoft.SharePoint.Utilities.SimpleParsers
    Microsoft.SharePoint.Utilities.SqlTrace
    Microsoft.SharePoint.Utilities.Win32
    Microsoft.SharePoint.WorkflowActions.WithKey

    Sunday, November 1, 2009

    Programming concepts of Microsoft SharePoint2010 - for developers

    One of the most exciting developer feature for me in SharePoint 2010 is LINQ. It basically provides a consistent, strongly-typed way of dealing with entities in your data. In SharePoint’s terminology, this means webs, lists and list items. Consider the below example:

    Previuosly with SharePoint 2007 PObjct model code:
    using (SPSite site = new SPSite("http://MySharePoint2010Site.com")
    {
         using (SPWeb personalWeb = site.OpenWeb("/PersonalSite"))
        {
              SPList announcementsList = personalWeb.Lists["Announcements"];
              foreach (SPListItem announcementItem in announcementsList.Items)
             {
                 DateTime expires = DateTime.MinValue;
                 if (DateTime.TryParse(announcement["Expires"].ToString(), out expires))
                {
                             // here comes the value for
                }
            }
        }
    }
     
    With SharePoint 2010 object model code using LINQ:
    // Get DataContext from page context
    DataContext data = new DataContext(SPContext.GetContext(this.Context).Web.Url);
    EntityList Announcementslist = data.GetList("Announcements");
             var AnnouncementItems = from announcements in Announcementslist
                                                      where announcements.Title == "New Announcement"
                                                      select announcements;

    foreach (var ann in AnnouncementItems)
    {
                 Page.Response.Write("id = {0}, Title = {1}", ann.CustomerId, ann.Title);
    }

    LINQ provides your data access abstraction for free. In addition, other data access scenarios such as inserting/updating list items and querying lists (think SPSiteDataQuery or SPQuery) will also be simplified. If you don’t already, my advice would be to start to understand fundamental aspects of how LINQ works

     Recommended reading:
    jQuery:
    Another innovation in SharePoint 2010 is the client object model, which allows us to work with SharePoint data on the client (e.g. in JavaScript or Silverlight) in much the same way as we’re used to in .Net code on the server. In the case of JavaScript, jQuery will be useful here (though certainly not mandatory) because of the script which will frequently surround your use of the client OM. Put simply, whatever kind of objects you’re using in JavaScript, if you’re interacting with page elements jQuery is likely to reduce and simplify the code required.
    Recommended reading :
    jQuery in Action

    PowerShell 
    PowerShell will play a greater role in SharePoint than previously courtesy of the many cmdlets included in the product – certainly admins who are script-inclined are likely to be very happy. The draw here is the sheer power – PowerShell is known for being able call into the .Net framework (and your own custom code), but is also capable of dealing with the filesystem, registry etc. This means that PowerShell can be used for a variety of SharePoint related tasks – scripted installations, configuration scripts, site provisioning/updates and more.
    Recommended reading:
    Silverlight
    Whilst it wouldn’t necessarily have been difficult for skilled developers to build a custom web part to render Silverlight movies, it’s an indication of Microsoft’s desire to make it easy to build rich sites that Silverlight web parts are included in the SharePoint 2010 box. Having had to integrate Flash movies from other teams with XML data sources in the past, having this kind of technology on the “Microsoft developer” side of the fence is pretty appealing. If you have the skills you’ll be able to build web parts with killer user interfaces, and assuming Silverlight is available to your audience the whole SharePoint world will be able to use them.

     Recommended reading:
    FAST search
    You’ve probably heard that SharePoint Server 2010 has native integration with FAST search technology. If you’ve seen the capabilities of FAST and/or had conversations with clients about going beyond a ‘standard’ implementation of search, you’ll know how exciting this is. On my last project I worked with some guys from FAST on a proof-of-concept with extremely custom integration between SharePoint/FAST, so it’s great to see the barrier to entry being lowered here. For many, seeing the art of the possible in this space is a real eye-opener – often you don’t realise what you’ve been missing until you see it. On this one, my main recommendation at this stage is solely to introduce yourself to the concepts used by FAST such as the document processing and query pipelines, dictionaries, entity extraction and so on.

     Recommended reading:
    WCF
    SharePoint’s own web services are now WCF services, but also because if you ever want to build a service application in SharePoint 2010, you’ll need to do WCF work. In general terms, it’s good advice that all new .Net web services should be built using WCF (.svc) rather than as .asmx web services anyway.
    Recommended reading:

    Saturday, October 31, 2009

    How to setup variations in MOSS 2007

    What are MOSS Language Packs?
    MOSS Language packs enable site owners and site collection administrators to create SharePoint sites and site collections in multiple languages without requiring separate installations of Microsoft Office SharePoint Server 2007. You install language packs, which contain language-specific site templates, on your front-end Web servers. When an administrator creates a site or a site collection based on a language-specific site template, the text that appears on the site or the site collection is displayed in the site template's language. Language Packs are typically used in multinational deployments where a single server farm supports people in different locations or in situations where sites and Web pages must be duplicated in one or more languages. Application of a Language Pack will not change the language of the installed Office server product SKU. 

     
    What’s the difference between WSS Language Packs and MOSS language Packs?
    • WSS Language Packs are for WSS stand-alone installations and enable the creation of SharePoint sites in different languages; multiple language packs can be installed on the same server.
    • MOSS Language Packs are for MOSS, MOSS for Search, Forms Server, and Project Server installations and enable the creation of SharePoint sites in different languages; multiple language packs can be installed on the same server.  
    What’s the difference between a MOSS Language Pack and a fully localized version of MOSS?
    Microsoft’s 2007 Office server products are localized into languages in two different ways: 1) fully translated SKUs and 2) Language Packs. A language-specific SKU delivers the respective Office server product localized into a given language. A Language Pack may be applied to an installed Office server product to create sites or site collections in other languages. Application of a Language Pack will not change the language of the installed Office server product SKU, or the language of the admin feature

     
    A small note before we start with: Site variations can only be used if you have created a site using one of the Publishing templates, or if you have activated the Publishing feature for your site.
    Prepare Operating System for multi-lingual changes:-
    1) Install additional language files on Windows Server 2003
    • On your front-end Web server, click Start, point to Settings and then Control Panel, and then click Regional and Language Options.
    • In the Regional and Language Options dialog box, on the Languages tab, in the Supplemental Language Support section, select both of the following checkboxes:
    • Install files for complex script and right-to-left languages
    • Install files for East Asian languages
    • Click OK in the dialog box that alerts you that additional disk space is required for the files.  

    • Click OK to install the additional language files.
    • When prompted, insert your Windows Server 2003 product disc or provide the location of your Windows Server 2003 installation files. When prompted to restart your computer, click Yes.  
    2) Install additional language files on Windows Server 2008

    • In the Regional and Language Options dialog box, on the Keyboards and Languages tab, in the Display Language section, click Install/Uninstall languages.
    • In the Install or Uninstall Languages dialog box, click Install languages.
    • On the Select the Languages to Install page click Browse folder to navigate to where you extracted; point it to the “langpacks” folder > Click Select Folder



    •   
    • Select the language to install from the list of available languages
    • Select all the languages that you want to install, and then click Next.
    • Accept the terms, and then click Next.
    • Click Install.
    Prepare SharePoint for multi-lingual changes:- 

     
    WSS Language Pack Go to http://www.microsoft.com/downloads/details.aspx?FamilyID=36ee1bf0-652c-4e38-b247-f29b3eefa04&DisplayLang=en and Change Language to French  Website language will now change to French
    click on download
    MOSS Language Pack Go to http://www.microsoft.com/downloads/details.aspx?familyid=2447426b-8689-4768-bff0-cbb511599a45&displaylang=en and Change Language to French Website language will now change to French
    click on download
    • Save SharePointLanguagePack.exe and ServerLanguagePack.img to a folder on WFE
    • Extract ServerLanguagePack.img using WinRAR or UltraISO
    • Install SharePointLanguagePack.exe for WSS > Don’t run PSCONFIG now
    • From extracted location run Setup.exe for MOSS
    • Run PSCONFIG and ensure its successful > IISRESET
    • Browse to MOSS site where you want to configure variations > Go to Site Settings > Variations



    •  
    • Specify the variation home (if same site then put a "/")
    • Choose the following settings
      • Automatically create site and page variations
      • Recreate a new target page when the source page is republished.
      • Update Web Part changes to target pages when variation source page update is propagated.
      • Reference existing resources
    • Go to Site Settings Variation Labels  New Label  Provide values as below screenshot > OK

       

       (Now we are making a label for default language site (English in our case) and hence it will be the source variation)

    Click on New Label again > Create another variation label using different language (French in our case)


     

     
    • Click on button
    • You will see the variations are being created

    • Ensure
       
    • Now the site is available in English and French and any new pages will be created in French as well

     More Info: 

    Friday, October 30, 2009

    Programatically Add audiences and audience rules

    Adding audiences and audiences rules programatically using SharePoint Object code


    SPSecurity.RunWithElevatedPrivileges(delegate()
    {
    try
    {
    String siteUrl = args[0];
    using (SPSite site = new SPSite(siteUrl))
    {
    ServerContext context = ServerContext.GetContextsite);
    AudienceManager audManager = new AudienceManager(context);
    AudienceCollection ac = audManager.Audiences;
    Audience audNew1 = null;
    Audience audNew2 = null;
    string sNewAudience1 = "New Audience 1";
    string sAudience1Description = "Description for New Audience 1";
    string sNewAudience2 = "New Audience 2";
    string sAudience2Description = "Description for New Audience 2";
    try
    { //Create the audience for New Audience 1
    audNew1 = ac.Create(sNewAudience1 , sAudience1Description);
    ArrayList AudRules = new ArrayList();
    AudienceRuleComponent rule1 = new AudienceRuleComponent
    ("", "=", "");
    AudRules.Add(rule1);
    AudienceRuleComponent rule2 = new AudienceRuleComponent("", "=", "");
    AudRules.Add(rule2);
    AudienceRuleComponent rule3 = new AudienceRuleComponent("", "=", "");
    AudRules.Add(rule3);
    AudienceRuleComponent rule4 = new AudienceRuleComponent("", "=", "");
    AudRules.Add(rule4);
    audNew1.AudienceRules = AudRules;
    audNew1.Commit();
    Console.WriteLine("New Audiences 1 added successfully");
    //Create the audience for New Audience 1

    audNew2 = ac.Create(sNewAudience2, sAudience2Description);
    AudRules.Clear();
    AudienceRuleComponent rule5 = new AudienceRuleComponent("", "=", "");
    AudRules.Add(rule5);
    AudienceRuleComponent rule6 = new AudienceRuleComponent("", "=", "");
    AudRules.Add(rule6);
    AudienceRuleComponent rule7 = new AudienceRuleComponent("", "=", "");
    AudRules.Add(rule7);
    audNew2.AudienceRules = AudRules;
    audNew2.Commit();
    Console.WriteLine("New Audiences 2 added successfully");
    }
    catch (AudienceDuplicateNameException e)
    {
    Console.WriteLine(e.ToString());
    Console.Read();
    }
    }
    }
    catch (Exception exception)
    {
    Console.WriteLine(exception.ToString());
    Console.Read();
    }
    });

    Thursday, October 29, 2009

    SharePoint Architecture


    SharePoint Architecture
    Both ASP.NET and WSS rely on IIS 6.0 to supply the underlying listening mechanism to process incoming HTTP requests and supply a management infrastructure for launching and running worker processes on the Web server.An IIS Web site provides an entry point into the IIS Web server infrastructure. Each IIS Web site is configured to listen for and process incoming HTTP requests that meet certain criteria.For example, an IIS Web site can be configured to handle requests coming in over a specific IP address or port number or can be routed to the Web server by using a specific host header,such as http://Extranet.Litwareinc.com.IIS automatically creates and configures an IIS Web site named Default Web Site that listens for HTTP requests coming in over port 80 on any of the IP addresses supported on the local Web server.Each IIS Web site is configured to map to a root directory, which is a physical directory on the file system of the hosting Web server. For example, standard configuration for IIS maps the Default Web Site to a root directory located at C:\Inetpub\wwwroot. In the most straightforward routing scenarios, IIS maps incoming HTTP requests to physical files inside the root directory.For example, IIS will respond to a request for http://www.Litwareinc.com/page1.htm by simply loading the contents of the file located at c:\Inetpub\wwwroot\page1.htm into memory and streaming it back to the client.A virtual directory is an entity that defines a child URL space nested within the URL space of its parent IIS Web site. Like an IIS Web site, a virtual directory is configured with a root directory on the file system of the hosting Web server.Note that IIS tracks configuration information about its IIS Web sites and virtual directories in a repository known as the IIS metabase. The IIS metabase lives on the file system of each front-end Web server running IIS. For example, when you create and configure an IIS Web site using the IIS administration utility, IIS tracks these changes by writing entries to the local IIS metabase.

    ISAPI Extensions and ISAPI Filters

    In the most straightforward routing scenarios, IIS simply maps an incoming request to a physical file within the root directory of an IIS Web site or virtual directory. However, IIS also supports the Internet Server Application Programming Interface (ISAPI) programming model, which provides the opportunity for more sophisticated routing scenarios. In particular, the ISAPI programming model allows you to configure an IIS Web site or virtual directory so that incoming requests trigger the execution of custom code on the Web server.The ISAPI programming model consists of two primary component types: ISAPI extensions and ISAPI filters.

    An ISAPI extension is a component DLL that plays the role of an endpoint for an incoming request. The fundamental concept is that IIS can map incoming requests to a set of endpoints that trigger the execution of code within an ISAPI extension DLL. An ISAPI extension DLL must be installed on the Web server and configured at the level of either an IIS Web site or virtual directory. Configuration commonly involves associating specific file extensions with the ISAPI extensions by using an IIS application map.

    While an ISAPI extension serves as an endpoint, an ISAPI filter plays the role of an interceptor(interrupt/stop).An ISAPI filter is installed and configured at the level of the IIS Web site. Once installed, an ISAPI filter intercepts all incoming requests targeting that IIS Web site. The fundamental concept is that an ISAPI filter can provide pre-processing and post-processing for each and every incoming request. ISAPI filters are typically created to provide low-level functionality for an IIS Web site, such as custom authentication and request logging.

    Application Pools and the IIS Worker ProcessIIS

    provides a flexible infrastructure for managing worker processes by using application pools. An application pool is a configurable entity that allows you to control how IIS maps IIS Web sites and virtual directories to instances of the IIS worker process. Note that instances of the IIS worker process are launched using an executable named w3wp.exe as shown in the below picture



    The routing architecture of IIS is controlled by a kernel-level device driver named http.sys.This device driver listens for incoming HTTP requests and uses information in the IIS metabase to route them to whatever instance of w3wp.exe is associated with the target application pool. If http.sys determines that the target application pool doesn’t have a running instance of w3wp.exe, it launches a new instance on demand to process the request.Every application pool has an important setting known as the application pool identity. The application pool identity is configured with a specific Windows user account that is either a local account on the Web server or a domain account within an Active Directory directory service domain. When http.sys launches a new instance of w3wp.exe for a specific application pool,it uses the application pool identity to initialize a Windows security token that serves as the process token.

    ASP.NET 2.0 Framework
    The ASP.NET Framework is implemented as an ISAPI extension named aspnet_isapi.dll. The basic configuration for ASP.NET involves registering application maps for common ASP.NET file extensions including .aspx, .ascx, .ashx, and .asmx at the level of an IIS Web site or virtual directory. When IIS sees an incoming request targeting a file with one of these extensions, it forwards the request to aspnet_isapi.dll, which effectively passes control over to the ASP.NET Framework.Once the ASP.NET page parser builds the source file for an .aspx page, it can then compile it into a DLL. This compilation occurs automatically the first time the .aspx file is requested.Once the ASP.NET runtime has compiled an .aspx file into a DLL, that copy of the DLL can be used for all subsequent requests that target the same .aspx file. However, the ASP.NET runtime monitors the datetime stamp on the .aspx file and retriggers the compilation process to rebuild the DLL if it sees that the associated .aspx file has been updated.A page that links to a master page is known as a content page.

    HTTP Request Pipeline the below figure displays a picture of the HTTP Request Pipeline and its three replaceable component types: HttpHandler, HttpApplication, and HttpModule. As requests come in, they are queued up and assigned to a worker thread that then processes the request by interacting with each of these component types.

    The ultimate destination of any request is the endpoint, which is modeled in the HTTPRequest Pipeline by using an HttpHandler class, which implements the IHttpHandlerinterface. As a developer, you can create a custom HttpHandler component and plug it into the HTTP Request Pipeline by adding configuration elements to the web.config file.The HTTP Request Pipeline places an HttpApplication component in front of the HttpHandler.

    On an application-wide basis, incoming requests are always routed through the HttpApplication before they reach the target HttpHandler, thus giving the HttpApplication the ability to preprocess any request no matter which HttpHandler it is being routed to. This preprocessing stage is handled through a series of events that are defined inside the HttpApplication class such as BeginRequest, AuthenticateRequest, and AuthorizeRequest.However, you can replace this standard component by creating a file named global.asax and placing it in the root directory of the hosting ASP.NET application. For example, you can create a global.asax that looks like the following:

    protected void Application_AuthenticateRequest(object sender, EventArgs e) {
    // your code goes here for request authentication}

    protected void Application_AuthorizeRequest(object sender, EventArgs e) {
    // your code goes here for request authorization}

    The third replaceable component type in the HTTP Request Pipeline is the HttpModule. The HttpModule is similar to the HttpApplication component in that it is designed to handle events defined by the HttpApplication class and is processed before control is passed to any HttpHandler classes. For example, you can create a custom HttpModule component to handle request-level events such as BeginRequest, AuthenticateRequest, and AuthorizeRequest. As with the HttpHandler, an HttpModule class is defined with an interface. You can create a class that implements the IHttpModule interface and plug it into the HTTP Request Pipeline by adding configuration elements to the web.config file.Whereas custom HttpApplication components can be defined as simple text files with an.asax extension, custom HttpModule components are always compiled as classes withinassembly DLLs. To add a custom HttpModule component into the HTTP Request Pipeline,you then add entries into a web.config file.

    HttpModule components can be configured at the machine level. In fact, the ASP.NETFramework ships with several different HttpModule components that are automaticallyconfigured at the machine level to provide ASP.NET functionality for things such as Windows authentication, Forms authentication, and output caching.

    The final component that we want to discuss with respect to the HTTP Request Pipeline is HttpContext. As ASP.NET initializes a request to send to the HTTP Request Pipeline, it creates an object from the HttpContext class and initializes it with important contextual information.The Object contains such as Request, User, and Response.HttpContext currentContext = HttpContext.Current;string incomingUrl = currentContext.Request.Url;string currentUser = currentContext.User.Identity.Name;currentContext.Response.Write("Hello world");

    WSS Integration with ASP.NET

    WSS integrates with ASP.NET at the level of the IIS Web site. Each IIS Web site in which you intend to host WSS sites must go through a one-time transformation process in which it is configured to become what WSS terminology refers to as a Web application. This transformation process involves adding IIS metabase entries and a WSS-specific web.config file to the root directory of the hosting IIS Web site. Once the transformation is completed, WSS extends the routing architecture of IIS and ASP.NET to properly route all incoming requests through the WSS runtime.

    Creating a Web application requires a significant number of changes to the file system and the IIS metabase on each front-end Web server. In a Web farm environment, these changes are automatically mirrored across each front-end Web server in the farm by the WSS runtime.

    Once a Web application is created, it is no longer necessary to touch the file system or IIS metabase of the front-end Web server when creating, updating, and deleting sites or site collections. The WSS architecture makes it possible to provision new sites and site collections simply by adding entries to the configuration database and a content database. It is this aspect of the WSS architecture that gives it significant management and provisioning advantagesover ASP.NET.

    Web Applications

    Two primary ways exist to create a Web application by using either the WSS Central Administration Application or the stsadm.exe command-line utility. First, you can create a Web application by converting an existing IIS Web site. Alternatively, you can create a new Web application from scratch and let WSS create the new IIS Web site for you behind the scenes. In either case, WSS configures the resulting IIS Web site by adding an IIS application map and creating several virtual directories. WSS also copies a global.asax file and web.config file to the root directory of the hosting IIS Web site.WSS must add an IIS application map to each Web application to ensure that each and every incoming request is initially routed to the ASP.NET runtime. Remember that the default configuration for ASP.NET only registers application maps for requests with well-known ASP.NET file extensions such as .aspx, ascx, .ashx, and .asmx. Therefore, WSS configures the hosting IIS Web site with a wildcard application map to route all incoming requests to aspnet_isapi.dll, including those requests with non-ASP.NET extensions such as .doc, .docx, and .pdf.

    Because every request targeting a Web application is routed through aspnet_isapi.dll, the request gets fully initialized with ASP.NET context. Furthermore, its processing behavior can be controlled by using a custom HttpApplication object and adding configuration elements to the web.config file. The WSS team uses standard ASP.NET techniques to extend the HTTP Request Pipeline by using several custom components, as shown in the below figure

    First, you can see that WSS configures each Web application with a custom HttpApplication object by using the SPHttpApplication class. Note that this class is deployed in the WSS system assembly Microsoft.SharePoint.dll. WSS integrates this custom application class by creating a custom global.asax file at the root of the Web application that inherits from SPHttpApplication.

    You can see that the standard WSS web.config file configures SPRequestModule so that it is the first HttpModule to respond to application-level events in the HTTP Request Pipeline of ASP.NET. If you examine the web.config file for a WSS Web application, you will see that WSS adds back in several of the standard HttpModule components from the ASP.NET Framework that deal with things such as output caching and various types of authentication.

    SPVirtualPathProvider
    One of the strengths of WSS over ASP.NET is its ability to provision and customize pageswithin a site without having to make any changes to the local file system of the front-end Webserver. This capability of WSS to provision and customize pages is made possible by storingcustomized versions of .aspx files and .master files inside the content database and retrievingthem on demand when they are needed to process an incoming page request.

    when the same page is requested, WSS must retrieve the contents of this customized page definition from the content database and pass it along to the ASP.NET runtime for parsing. We will now explain the architectural details that make this possible.

    ASP.NET 2.0 introduced a new pluggable component type known as a virtual path provider. The idea behind a virtual path provider is that it abstracts the details of where page files are stored away from the ASP.NET runtime. By creating a custom virtual path provider, a developer can write a custom component that retrieves ASP.NET file types, such as .aspx and .master files, from a remote location, such as a Microsoft SQL Server database. Once a virtual path provider retrieves the contents of an .aspx page, it can pass it along to the ASP.NET runtime for parsing.

    SPVirtualPathProvider is able to retrieve an ASP.NET page file from the content database, such as default.aspx, and then pass it along to the ASP.NET page parser. The SPVirtualPathProvider class works together with another class named the SPPageParserFilter to supply processing instructions to the ASP.NET page parser. For example, the SPPageParserFilter component controls whether the ASP.NET page parser compiles the ASP.NET page into an assembly DLL or whether it processes the page in a no-compile mode that is introduced with ASP.NET 2.0.


    Imagine that you have just created 100 new WSS sites from the Blank Site template. If none of these sites requires a customized version of its home page (default.aspx), would it still make sense to copy the exact same page definition file into the content database 100 times? The answer to this question is obviously no. Fortunately, pages within a WSS site such as default.aspx are based on page templates that live on the file system of the front-end Web server. Page templates are used to provision page instances within the context of a site, such as the page that is accessible through a specific URL like http://litwareinc.com/default.aspx.

    When a page instance is initially provisioned from a page template, WSS doesn’t need to store a copy of it in the content database because WSS can load the page template from the file system of the Web server and use it to process any request for an uncustomized page instance.

    Therefore, you can say that page ghosting describes the act of processing a request for an uncustomized page instance by using a page template loaded into memory from the file system of the front-end Web server.

    Page ghosting is valuable because it eliminates the need to transfer the contents of a page definition file from the SQL Server computer with the content database to the front-end Web server computer. Page ghosting also makes it possible to process the home pages for thousands of different sites by using a single page template that is compiled into an assembly DLL and loaded into memory in the IIS worker process just once per Web application. Both of these optimizations are key factors in the scalability of WSS in high-traffic environments running thousands or tens of thousands of sites.

    Customized pages are sometimes referred to as unghosted pages
    SPVirtualPathProvider that determines whether the page being requested has beencustomized. The SPVirtualPathProvider makes the decision whether to process a page as a ghosted or an unghosted page.The new architecture introduced in WSS 3.0, which includes the SPVirtualPathProvider and the ASP.Net page parser, should be seen as one of the more significant architectural enhancements over WSS 2.0.
    When WSS converts an IIS Web site into a Web application, it creates several virtual directories. These virtual directories, including the _controltemplates directory, the _layouts directory, the _vti_bin directory, and the _wpresources directory, are used by various aspects of the WSS runtime. The _wpresources virtual directory provides a repository for resource files that are deployed along with Web Parts.
    Application pages are served up from the _layouts directory.