Sunday, 19 February 2012

SharePoint Server 2010 Authentication Methods

SharePoint Server 2010 provides a flexible and extensible authentication system, which supports authentication for identity management systems that are based or are not based on the Microsoft Windows operating system. By integrating with ASP .NET pluggable authentication, SharePoint Server 2010 supports a variety of authentication scenarios, including:
  • Using standard Windows authentication methods.
  • Using a simple database of user names and passwords.
  • Connecting directly to an organisation’s identity management system.
  • Using two or more methods of authentication for accessing partner applications (such as, connecting to your partner company’s identity management system for authenticating partner employees while using Windows authentication methods to authenticate your internal employees).
The following are the lists of authentication methods:
  • Claims: Claims authentication for SharePoint Server 2010 is built on the Windows Identity Foundation, which is a set of .NET Framework classes that are used to implement claims-based identity.
  • Windows: The standard IIS Windows authentication methods are supported.
    Below are the following  types of windows authentication:
    • Anonymous
    • Basic
    • Digest
    • Certificates
    • Kerberos (Integrated Windows)
    • NTLM (Integrated Windows)
  • Forms-based authentication (FBA): SharePoint Server 2010 adds support for identity management systems that are not based on Windows by integrating with forms-based authentication. Forms-based authentication enables SharePoint Server 2010 to work with identity management systems that implement the MembershipProvider interface. You do not need to rewrite the security administration pages or manage shadow Active Directory directory service accounts.
    Below are the following  types of FBA authentication:
    • Lightweight Directory Access Protocol (LDAP)
    • SQL database or other database
    • Other forms-based authentication solutions

What is Content Types and Site Columns?

Content types and site columns are the foundational elements of SharePoint, but they often get misused. Whether it’s creating too many content types, not enough, or recreating site columns that are already available out of the box, it is critical to remember some key aspects when instituting and managing these items:

Content Types
Content types are a core organizational feature of SharePoint 2010. They are designed to give users the ability to organize SharePoint content in a centralized and meaningful manner. Site columns (metadata) can be encapsulated within a content type to allow for reusable structure or independently added to sites and lists.
At its most basic level, a content type is a collection of settings which can be applied to content. They are reusable since content types are independent of sites and lists. A content type includes site columns to define the desired information. Example: The Task content type includes site columns for Task Status, Start Date and Due Date where the Schedule content type includes site columns for Location, Start Time and End Time. Using these content types as a template when a new task or event list needs to be created is much more efficient than rebuilding separate lists from site columns.

Sample Issue Content Type
SharePoint 2010 Content Type Information

Site Columns
Site columns are similar to content types in that they are centrally manged and can be added to sites and lists. They differ in that the information in a site column is focused to a single definition of data while content types enscapulate multiple site columns and definitions of data. Example: A site column named Department is created as a single line of text for users to enter their department name and a content type is created named Projects which includes the site columns of Department, Project Name and Project Due Date.
Site columns can contain multiple types of information, ranging from a Single line of text to Managed Metadata. It is important to note the difference between metadata and managed metadata. Site columns are referred to as metadata since they represent an attribute a user wants to manage. Example: The site column of Department is an attribute that can be reused in multiple lists.

Sample Site Column Information Options
SharePoint Site Column Options

Managed Metadata
Managed metadata is collection of centrally managed terms that can be used as attributes for SharePoint items. Defining a site column to use Managed Metadata for information is a powerful tool for assigning attributes. Example: Creating a Department site column, based on a managed metadata term set containing all of the department names in an organization, allows users to select the correct department and reduces typographical errors and non relevant data. It also provides for the proper tagging of documents for routing and search purposes.

Content Type Hub
Content types can also be stored in a Content Type Hub for centralized management of content types across Site Collections and Web Applications. This features utilizes the Managed Metadata Service and allows Site Collections to subscribe to any published content types. Any changes to published content types will be updated in the subsribing Site Collections. Since managed metadata can be created as a site column within a content type, terms can be globally syndicated across Site Collections and Web applications.

Content Type and Site Column Suggestions
Centrally creating and managing relevant content types and site columns is critical to ensuring consitent attributes across SharePoint. The following points offer guidance on maintaining an organized content type and site column structure:
Review the built in content types and site columns before creating new ones
SharePoint 2010 comes with many built in content types and site columns that may meet the needs of your structure. In planning your SharePoint structure, review the built in options before creating any new content types or site columns. New content types will be based on content types that already exist (parent content types). This allows for a pre organized template to begin the content type creation process. Example: Creating a new content type of “Proposal Document” based on the parent content type of “Document” will provide the necessary settings for referencing a document template and include the site columns of Name, Title and Keywords.

Carefully plan the information contained in content types and site columns and be prepared to refine metadata
Creation of new content types and site columns should not be done on an ad hoc basis. Take the time to discover what metadata is relevant to your organizations data collection and referencing needs. Creation of underutilized site columns (metadata) and content types places an unnecessary data entry burden on users which can lead to poor adoption of SharePoint and creation of non-relevant data.

Centrally manage content types and site columns
Site columns (metadata) can be created at the list or document library level. Site columns created in this manner exist only at the list level in which they were created and not within the confines of content types or the centrally managed Site Column Gallery. This becomes problematic when managing consistent metadata as these site columns cannot be reused. It is highly recommended to create new site columns within the Site Column Gallery and add these site columns to the content types associated with the preferred list or document library. Changes made to centrally managed content types will propagate down to the list and document libraries they have been added to.
A SharePoint implementation with multiple Site Collections or Web applications would benefit from the use of a Content Type Hub. This will allow for central management of “global” content types across the Enterprise for Site Collections that are subscribed to published content types. Leveraging this feature in tandem with managed metadata creates globally syndicated terms. Example: A content type containing a managed metadata site column, based on a product term set, is published. The list of products can now be reused as an attribute across the organization.

SharePoint 2010 Web Parts vs. Visual Web Parts

I have read a lot of SharePoint documentation and articles recently, and one confusing point that kept getting glossed over was whether there was a difference between what was called a “Visual” Web Part and a Web Part by any other name.
The answer is, there is a difference, but not in the .NET type. There is a difference in how the part is implemented and its project type in Visual Studio. The short answer is that a Web Part is “visual” if its implementation includes an ASP.NET user control, i.e. an .ascx file. Creating a project of type “Visual Web Part” from the Visual Studio project wizard creates a project that looks like this:

Notice the automatically-created .ascx user control. Indeed, the code in the Web Part is the same as we would find on a normal part, but in the implementation the user control is instantiated programmatically like this:
01public class VisualWebPart1 : WebPart
02{
03    private const string _ascxPath =
04        @"~/_CONTROLTEMPLATES/VisualWebPartProject2/VisualWebPart1/VisualWebPart1UserControl.ascx";
05
06    protected override void CreateChildControls()
07    {
08        Control control = Page.LoadControl(_ascxPath);
09        Controls.Add(control);
10    }
11}
Trying to deploy this project as a sandboxed solution will fail, since user controls violate the constraints placed on code that runs in the sandbox. There is nothing intrinsically about the code that would prevent its installation as a sandboxed solution, but it will fail when the solution is activated.

Changing a Visual Web Part to a regular Web Part

We can change the Web Part type by manually editing the .spdata file in the project. Visual Studio won’t allow direct access to this file, so we’ll have to browse to it on the filesystem and edit it in notepad.
01<?xml version="1.0" encoding="utf-8"?>
02<ProjectItem Type="Microsoft.VisualStudio.SharePoint.VisualWebPart" DefaultFile="VisualWebPart1UserControl.ascx" SupportedTrustLevels="FullTrust" SupportedDeploymentScopes="Site" xmlns="http://schemas.microsoft.com/VisualStudio/2010/SharePointTools/SharePointProjectItemModel">
03  <Files>
04    <ProjectItemFile Source="Elements.xml" Target="VisualWebPart1\" Type="ElementManifest" />
05    <ProjectItemFile Source="VisualWebPart1.webpart" Target="VisualWebPart1\" Type="ElementFile" />
06    <ProjectItemFile Source="VisualWebPart1UserControl.ascx" Target="CONTROLTEMPLATES\VisualWebPartProject2\VisualWebPart1\" Type="TemplateFile" />
07  </Files>
08  <SafeControls>
09    <SafeControl Name="SafeControlEntry1" Assembly="$SharePoint.Project.AssemblyFullName$" Namespace="VisualWebPartProject2.VisualWebPart1" TypeName="*" IsSafe="true" IsSafeAgainstScript="false" />
10  </SafeControls>
11</ProjectItem>
We are interested only in this line:
1<ProjectItem Type="Microsoft.VisualStudio.SharePoint.VisualWebPart" DefaultFile="VisualWebPart1UserControl.ascx" SupportedTrustLevels="FullTrust"
We can change the Type from VisualWebPart to WebPart and SupportedTrustLevels from FullTrust to All.
The resulting code looks like this:


1<ProjectItem Type="Microsoft.VisualStudio.SharePoint.WebPart" DefaultFile="VisualWebPart1UserControl.ascx" SupportedTrustLevels="All"
Once the change is made, reload the project in Visual Studio, and its type should be recognized as a normal web part. Be sure to remove the user control before attempting to deploy as a sandboxed solution!

Tuesday, 3 January 2012

How to deploye WSP?

Commands to deploy WSP

Using Stsadm

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o retractsolution -name "Eversheds.Connect.wsp" -immediate -allcontenturls

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o execadmsvcjobs

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o deletesolution -name "Eversheds.Connect.wsp"

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o execadmsvcjobs

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o addsolution -filename "Eversheds.Connect.wsp"

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o execadmsvcjobs

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o deploysolution -name "Eversheds.Connect.wsp" -immediate -allcontenturls -allowGacDeployment -allowCasPolicies -force

"C:\Program Files\Common Files\Microsoft Shared\web server extensions\14\BIN\stsadm.exe" -o execadmsvcjobs

Using WSP builder

wspbuilder.exe -WSPName Eversheds.Connect.wsp -BuildWSP false -deploy true


If there are features involved, add commands to activate feature also in this batch file.

Saturday, 31 December 2011

SharePoint Server 2010 features?

    Here are my personal favorite SharePoint 2010 new features and enhancements:  
  • Access Services & Visio Services
  • Building on the successful Excel Services pattern, SPS 2010 allows users to publish Access and Visio applications to SharePoint which other users can access through their browsers. As can be expected, Access and Visio Services will be somewhat limited in functionality(when compared to their respective desktop versions), but on the flip side, the customers would benefit from the server-side capabilities such as scalability, one centralized version of the document (rendered in a browser friendly format), access to multiple users and security control.    Access Services will allow customers to publish their Access 2010 applications to SharePoint. For example, consider a departmental application such as a travel planner built using Access. Using Access Services it will be possible to bring such an application to Sharepoint, thereby reducing the total cost of ownership through one common user experience, development and deployment strategy. Similarly, Visio Services will allow customers to render Visio diagrams within the browser. An application of Visio Services would be a visualization of a SharePoint workflow that is rendered inside a browser as a Visio flowchart. Note that no client-side Visio software would be needed in this scenario.

  • Business Connectivity Services (BCS)
  • In MOSS 2007, Business Data Connector (BDC) was the tool of choice for integrating external data sources  into Sharepoint. BDC was available only to customers who purchased the enterprise version of MOSS 2007. Furthermore, BDC was limited to only reading data from the external data sources. Busincess Connectivity Services (BCS), which replaces the BDC functionality in SPS 2010, goes much further. Not only is BCS going to be available with the free, base version of SPS 2010 (renamed to Windows SharePoint Foundation from Windows SharePoint Services), it now supports updating, deletion and insertion of data into an external data source.  Another key advantage of BCS is that it will enable SharePoint Lists to be created directly based on a database table.

  • Developer Productivity Enhancements
  • First and foremost and unlike previous versions, it will now be possible to conduct SharePoint development on a client OS such as Windows 7. In earlier versions SharePoint development had to be undertaken on a server OS. This inevitably created overhead as the development had to be undertaken in a virtualized environment. Secondly, developer enhancements go beyond the support for client operating systems. Developers can now utilize familiar .NET patterns and practices such as LINQ (Language Integrated Query) to query data from a SharePoint List, XSLT for customizing a SharePoint list and Silverlight for creating richer visualizations. There are also a number of enhancements to the SharePoint programming model that offer greater flexibility in extending the out-of-the-box SharePoint behavior.  For example, SharePoint developers commonly extend the SharePoint behavior using small segments of code commonly referred to as event handlers. A common issue with event handlers in MOSS 2007 is that the event handler is not finished executing before the control is returned back to the user. This can lead to a confusing behavior for the users. SPS 2010 seeks to alleviate this by introducing “After-Synchronous” events which are guaranteed to complete execution before the control is returned to the user. Finally, Visual Studio 2010 contains extended capabilities for developers to create rich applications on the SPS 2010 platform. Many improvements have also been made in Visual Studio 2010 to increase developer productivity as well as take advantage of SPS 2010 functionality. These improvements help make it easier for .NET developers to create and deploy SharePoint solutions.

  • SharePoint Designer Enhancements
  • SharePoint Designer is a tool targeted towards business users and designers who have used it to quickly and easily perform actions such as customizing lists, changing layouts and creating simple workflows. The one area of improvement often requested is the ability to package and reuse the changes made using SharePoint Designer.  Fortunately, SharePoint Designer 2010 not only addresses this request, it also comes with major improvements with regard to designing workflows, editing SharePoint pages and setting up BCS ( discussed above). SharePoint administrators also have greater control over how SharePoint Designer 2010 is used within their environment. For instance, administrators can block the ability to perform certain actions such as modifying certain SharePoint pages and restricting access to certain areas with the Sharepoint setup. One other key feature provided by SharePoint Designer 2010 is the improved interaction between the business users and the IT department. Since SharePoint Designer 2010 uses the same packing and deployment format (commonly referred to as WSP solution package) as the rest of the SharePoint platform, it is now possible to take the work done by a business user within the SharePoint Designer 2010 and import it within Visual Studio 2010. This will allow the IT department to build upon and extend the work done by the business users.

  • Business Intelligence Enhancements
  • Business Intelligence is another area with significant improvements. To begin, there are a number of scalability improvements to the desktop version of Excel 2010, including the support for the numbers of rows within a workbook that goes far beyond the 64K limit in the current version. The new version of Excel effectively utilizes enhancements in the OS such as the 64-bit support for access to large memory pools and enhancement in hardware such as the multi-core computers. Microsoft has made a strategic decision to leverage Excel as the primary BI analyst tool. As part of the self-service BI initiative, Excel users can import large amounts of data from various data sources and quickly generate pivot tables. Once the data is imported into Excel 2010, using a feature called “Slicers”, users will be able to easily filter the data. In other words, Excel users can extract, transform and load (ETL) data from multiple sources directly into Excel without requiring IT to build a formal data import setup. The pivot table generated from imported data can later be shared with other users by publishing it to SharePoint 2010. Under the covers, the publishing process creates an SQL Server Analysis Services instance that can be monitored by IT, using tools such as usage dashboard and resource quota. Excel Services, the server-side Excel functionality provided by SharePoint Server, has seen a number of improvements as well. First off, it directly benefits from the scalability improvements to the underlying calculation engine mentioned earlier. Secondly, it enables additional programmability enhancements. For example it, using a JavScript based program, it will be possible.

  • In-Place Records Management
  • Records management relates to the process of marking a document as a record or “laminating” them for legal and compliance reasons. A records repository is a library of such records. SPS 2010 dramatically improves upon the capabilities for managing records by extending where and how the records are managed. Unlike MOSS 2007, SPS 2010 will support multiple records repositories within a single SharePoint installation.. This means that users can route records to multiple record repositories. Records managers can also define routing rules to aid in the classification of records. Records repositories now also support the use of hierarchical structures (commonly referred to as File Plan) for storing records in a manner that matches the customer’s organizational hierarchy. SharePoint 2010 also provides the flexibility for defining and applying retention rules. For instance, it is now possible to apply a recurring retention rule that specifies several stages of  record retention. This will be very helpful when a records manager wants to specify a retention rule such as “Maintain this document for three years after project completion then transfer it to the archive for the next five years”. In addition to using a records repository, SPS 2010 has the ability to declare records in-place, i.e., allow any document inside a document library to be marked as a record without the need to explicitly move it to a records repository. The new in-place record management capability exemplifies Microsoft’s mantra of “compliance everywhere”.

  • Enhancements related to Large List Handling
  • Microsoft has placed a lot of emphasis on performance of lists with large numbers of items in them. This has resulted in the addition of the new SPS 2010 features known as : Query Throttling, Batch Query Support, Remote Blob Storage, and External Lists. Query Throttling allows IT administrators to limit -or “throttle” – queries that are executed against large lists from consuming too many resources. For example, SharePoint will now block queries that will return more than 5000 rows by default – and this is of course, a configurable setting.  Rather than iterating over each item, SharePoint also includes the capability to process multiple items in a list simultaneously, as a single batch operation.  If there is content that is more suitable for storage outside SharePoint (for instance large media files), the Remote Blob Storage feature will provide a mechanism to store it on file shares (SANS, NAS, RAID arrays, File Servers). Finally, External Lists is another mechanism by which large lists can be incorporated in SharePoint. As stated earlier, database-backed lists that are a part of BCS allow content to be stored in separate data stores – such as SQL Server – outside of the Content Database. The benefit of course is that this feature allows for providing supporting large lists without burdening the SharePoint 2010 content database.

  • Workflow Improvements
  • Workflow is a very useful feature of SharePoint 2007. In addition to the out-of-the box workflows that were included with SharePoint 2007, it is possible to use the SharePoint designer to build declarative (no-code) workflows. For more advanced scenarios, developers created custom workflows in Visual Studio. Two of the main challenges in building workflows with SharePoint 2007 relate to the limitations in SharePoint Designer 2007 and the workflow host that is part of SharePoint 2007. While SharePoint Designer allows business users to develop simple workflows, it requires a direct connection to the site for which the workflow is being developed, thus limiting the ability to reuse the workflow in different locations. Furthermore, there is no easy way to leverage code components developed by IT. The workflow host within SharePoint 2007 comes pre-configured with a set of services such as persistence, eventing and tracing. There is no way to add custom services to the runtime host. For instance, there is no direct way to allow SharePoint-based workflows to interact with events other than the list item events. SharePoint 2010 alleviates these challenges by allowing the workflows created using SharePoint Designer to be saved as templates for reuse. SharePoint Designer 2010 has also been enhanced significantly to allow business users to leverage tools such as Visio for workflow modeling and visualization. Another major improvement is the ability to modify out-of-the-box SharePoint workflows (e.g. approval workflow, three-state workflow). The workflow host within SharePoint 2010 now provides the extensibility option to inject custom services. It is also now possible to kickoff workflows without explicitly associating it to a list item. Finally, and from an overall scalability perspective, it is also going to be possible to designate application server nodes as workflow participants. In other words, unlike SharePoint 2007 where each application server node participated in executing the workflows, there will be a way to throttle the workflow execution to a limited set of machines. This allows isolation of services within the farm so system administrators can better manage resources and troubleshoot issues.
  • Social Networking Capabilities
  • One can debate the impact and applicability of social networking tools such as Facebook in the workplace, but there is no doubt that information workers today are demanding similar capabilities from the tools they use inside the workplace. This is why the SPS 2010 enhancements in this arena are so noteworthy. In SPS 2010, just about every element such as sites, documents, videos, blog posts are taggable. There is out-of-the-box support for navigating the tag clouds and lists. Users will be able to rate artifacts and recommend it to others. Co-workers can keep up with the latest by tracking the activity data available as a new feed. Individual users will be able to setup profiles, write to a common or personal board, indicate their presence/location and be able to take advantage of micro-blogging capabilities.

  • Deployment Advancements
  • Unlike the previous versions, SPS 2010 uses a solution package-based single, consistent scheme for packaging and deploying any customizations. The solution package is a compressed file containing all of the necessary components such as features, web parts, list definitions, assemblies, customized ASPX pages and workflows. Additionally, the previous versions required an extensive amount of manual modification of XML files. In SharePoint 2010, these modifications can be done through point and click configuration with SharePoint Designer 2010. SharePoint 2010 also introduces a notion of sandbox solution packages that are designed to improve security and manageability. Sandbox solution packages restrict the scope to which a customization can be applied (For example, restricting the scope for a list customization to site collection). Sandbox solutions are also restricted to a subset of SharePoint programmability options. Finally, administrators can enforce quote limits on resources consumed by sandbox solutions to prevent abuse.

Sharepoint 2010 Object Model?


  1. The SPFarm object is the highest object within the SharePoint Foundation object model hierarchy. The Servers property gets a collection representing all the servers in the deployment, and the Services property gets a collection representing all the services.
  2. Each SPServer object represents a physical server computer. The ServiceInstances property provides access to the set of individual service instances that run on the individual computer.
  3. Each SPService object represents a logical service installed in the server farm. Derived types of the SPService class include, for example, objects for Windows services, such as the timer service, search, the database service, etc. and also objects for Web services, such as the basic content publishing Web service which supports the Web applications.
  4. An SPWebService object provides access to configuration settings for a specific logical service or application. The WebApplications property gets the collection of Web applications that run the service.
  5. If the service implements the Service Application Framework of SharePoint Foundation, then it can be split into multiple configured farm-scoped instantiations (CFSIs). Each of these provides the functionality of the service but each has its own individual permission and provisioning settings.
  6. Each instance of a service, or a CFSI, that is running on a specific server is represented by an SPServiceInstance object.
  7. An SPDatabaseServiceInstance object represents a single instance of a database service running on the database server computer. The SPDatabaseServiceInstance class derives from the SPServiceInstance class and thus inherits the Service property, which provides access to the service or application that the instance implements. The Databases property gets the collection of content databases used in the service.
  8. Each SPWebApplication object represents a Web application hosted in an Internet Information Services (IIS) Web site. The SPWebApplication object provides access to credentials and other farm-wide application settings. The Sites property gets the collection of site collections within the Web application, and the ContentDatabases property gets the collection of content databases used in the Web application.
  9. An SPContentDatabase object inherits from the SPDatabase class and represents a database that contains user data for a Web application. The Sites property gets the collection of site collections for which the content database stores data, and the WebApplication property gets the parent Web application.
  10. An SPSiteCollection object represents the collection of site collections within the Web application.

Hardware requirements for SharePoint 2010?


Processor

64-bit, four-core, 2.5 GHz minimum per core

RAM

4 GB for developer or evaluation use
8 GB for single server and multiple server farm installation for production use

Hard disk

80 GB for installation + additional space for day to day operations.