Thursday, 18 August 2011

Difference between Classic Authentication and Claim based authentication

What are the differences between Classic Mode Authentication and Claims based Authentication?

Classic Mode Authentication: It refers to the integrated windows authentication. You cannot configure the Forms based authentication if your web application is using Classic Mode Authentication. You can convert a web application from Classic Mode Authentication to Claims Based Authentication. However, that can only be done using PowerShell commands and its an irreversible process. I have detailed steps to convert the web application from Classic Mode authentication to Claims Based Authentication.

Claims Based Authentication: SharePoint 2010 is built on Windows Identity Foundation. It enables authentication from windows as well as non-windows based systems. This also provides the capability to have multiple authentication in a single URL.

Thursday, 4 August 2011

What is Server Farm and Front End Web Server

Server Farm:
SharePoint Server farm environments can encompass a wide range of topologies, and can include many servers or as few as two servers.
  • A small server farm typically consists of a database server running Microsoft SQL Server , and one or more servers running Internet Information Services (IIS) and Office SharePoint Server 2007. In this configuration, the front-end servers are configured as Web servers and application servers. The Web server role provides Web content to clients. The application server role provides Office SharePoint Server 2007 services such as servicing search queries, and crawling and indexing content.
  • A medium server farm typically consists of a database server, an application server running Office SharePoint Server 2007, and one or two front-end Web servers running Office SharePoint Server 2007 and IIS. In this configuration, the application server provides indexing services and Excel Calculation Services, and the front-end Web servers service search queries and provide Web content.
  • A large server farm typically consists of two or more clustered database servers, several load-balanced front-end Web servers running Office SharePoint Server 2007, and two or more application servers running Office SharePoint Server 2007. In this configuration, each of the application servers provides specific Office SharePoint Server 2007 services such as indexing or Excel Calculation Services, and the front-end servers provide Web content.
  • You can deploy Office SharePoint Server 2007 in a server farm environment if you are hosting a large number of sites, if you want the best possible performance, or if you want the scalability of a multi-tier topology. A server farm consists of one or more servers dedicated to running the Office SharePoint Server 2007 application
Front End Web Server

            In a server farm environment, the front-end Web servers contain only the files and settings required to route requests from clients to the appropriate sites in the database. Unlike in SharePoint Team Services v1.0 from Microsoft, they do not contain site data.
            All site content and all configuration data is shared for all front-end Web servers in a server farm. To get the best performance and the best protection against hardware failure, you should configure Windows SharePoint Services identically on all the front-end Web servers in your server farm.

Wednesday, 3 August 2011

Site collection & Subsite defintion

Site Collection:
                 A SharePoint site collection is a hierarchical set of sites that can be managed together. Sites within a site collection have common features, such as shared permissions, galleries for templates, content types, and Web Parts, and they often share a common navigation. A site collection contains a single top-level site, and any number of subsites organized in a hierarchy. A subsite is a single SharePoint site within a site collection.


SubSites:
A subsite can inherit permissions and navigation structure from its parent site, or these can be specified and managed independently. Creation of subsites can be delegated to users of a site collection, but creation of site collections must be performed by a service administrator.

Saturday, 30 July 2011

Object Model Defintion in Sharepoint

What is Object Model:
        Collection of classes and methods in general.   At the time of developing webparts or workflow we need some details from the SharePoint site it may be a list item, list, site url , subsite exatra....    To provide these information SharePoint have predefined collection of classes, object and function this is exactly called Object Model in SharePoint.

          For example SPContext return the information about the current site.


Friday, 29 July 2011

Site Definition -- Defintion


Site Definition
  • Site Definitions are the foundations on which all sites and user templates are built. 
  • Site Definition is collection ox XML and .aspx file.
  • Site Definitions are predefined components needs to be included when a site was created in SharePoint server.
  • Site Definition contains information of Web Part , Lists, Features and navigation bars to be included in the site.
  • Customizing Portal Sites and other SharePoint sites using Site Definition is most appropriate for third party developer and SharePoint Administrator.
  • Site Definitions requires access to a file system of the Web Server.
  • Server administrator must be also involved in deployment of Site Definitions. 
  • Custom Site Definitions are Version and Upgrade independent. 
  • Subsequent upgrades to SharePoint products  and technologies may overwrite  existing Site Definitions. Using Custom Site definition exclude site from potential upgrade issues. 
  • To avoid Unghosting  , Custom Site Definition is to be create.
  • There are two options to create it
    1. Create New Site Definition File : Either Start from Scratch and create files one by one  or Copy an existing Site Definition and modify it.
    2. Copy a Site Definition and change it in Visual Studio:   We can make copy an existing site definition and modify it in visual studio to create new site definition.
  • The configuration of this site definitions are defined in XML file which is available in

    C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML folder.

  • In the file system these definitions are available in C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Site Templates.
  • Each of these site definitions consists a XML folder and a Home page (default.aspx).

Thursday, 7 July 2011

How to Handle PostBack event in Sharepont 2010 C# webpart

The dynamic control generation is always done by the help of 'createchildcontrols' function.  Here we must handle the postback event to avoid the creation of control at each and every time. For that in asp we use

if(!ispostback)

like that here

we use

if(!page.ispostback)

Friday, 1 July 2011

How to Read,Update LookUp fields in SharePoint List

Lookup fields in SharePoint provides a great way to pickup dynamically changing values from a dropdown list.But programmatic access of this type of fields is not straightforward. The actual list item value is stored as ID:#Value. Where ID is reference to the id of referring list and value is the value selected. SharePoint SDK provides APIs to read and update lookup fiedls. SPFieldLookupValue object can be used to read and update/insert lookup fields.
For example:
Lets create a sample master list "Skills ", add following values:
ASP.Net
C#
SQL

Following is screen shot of the master list "Skills":






Now create another custom list "My Skills", with a lookup field which refers to Title column of "Skills" list, which is created earlier.

Following code snippet, reads and updates the "TechSkills" field of "My Skills" list.


using (SPSite site = new SPSite("http://servername"))
{
using(SPWeb web = site.OpenWeb())
{
SPList list = web.Lists["My Skills"]; //List which has lookupfield TechSkills
SPListItemCollection itemCollection;
itemCollection = list.Items;
foreach (SPListItem item in itemCollection)
{
SPFieldLookupValue lookupField = new SPFieldLookupValue(item["TechSkills"].ToString());
string lookUpValue = lookupField.LookupValue;
Console.WriteLine("List item actual value:" + item["TechSkills"].ToString());
Console.WriteLine("List item lookfield value:" + lookUpValue);
}
SPListItem listItem = itemCollection[0];
listItem["Skill Name"] = new SPFieldLookupValue(1, "ASP.Net"); //ID field of ASP.Net is 1
listItem.Update();
}
}