Wednesday, May 1, 2013

ICellProvider vs IRowProvider vs IListProvider vs IFilterProvider vs IWebPartField vs IWebPartRow vs IWebPartTable vs IWebPartParameters



Interfaces used to make web part connections.

ICellProvider: This API is now obsolete. Enables a Web Part to communicate with a Web Part that implements the ICellConsumer interface to work with a single value item.
IWebPartField : Defines a provider interface for connecting two server controls using a single field of data.

IRowProvider: This API is now obsolete. Enables a Web Part to send a row of data to a Web Part that implements the IRowConsumer, ICellConsumer, IFilterConsumer, or IParametersInConsumer interface.
IWebPartRow: Defines a provider interface for connecting two server controls using a single field of data.


IListProvider: This API is now obsolete. Defines events that a Web Part can implement so that it can provide an entire list (rowset) of data to another Web Part that implements the IListConsumer interface.
IWebPartTable: Defines a provider interface for connecting two server controls using an entire table of data.

IFilterProvider: This API is now obsolete. Used to communicate with a Web Part that implements IFilterConsumer interface to provide filter information to the consumer.
IWebPartParameters: Defines the contract a Web Parts control implements to pass a parameter value in a Web Parts connection.

Source: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.webparts.aspx

Tuesday, April 23, 2013

Fast Search in SharePoint 2010


Advantages of using Fast Search in SharePoint 2010
1. Crawl BDC content with FAST.
2. Previewers – Display inline previews of Word, PowerPoint, and Excel files.
3. Indexing more documents
4. FAST can be configured for Enterprise edition only
5. Search enhancements based on user context Scopes Best Bets, visual Best Bets, and document promotions and demotions to a sub-group of employees.
6. Rich Web indexing support Indexing of wide variety of Web content, including Flash.

Using LINQ to SharePoint


The LINQ to SharePoint provider is a new feature in SharePoint 2010 that allows you to use a strongly-typed entity model and the language integrated query (LINQ) query syntax to query list data. Essentially, LINQ to SharePoint hides the complexity of developing CAML queries from developers, which can reduce development time and make code more readable. The LINQ to SharePoint provider converts the LINQ expressions into CAML queries at run time.

Using LINQ to SharePoint in your own solutions consists of three main steps:
  • Generate the entity classes. Before you can start writing LINQ queries against your SharePoint lists, you must create or generate the strongly-typed entity classes that represent your list data and lookup column relationships.
  • Develop the solution. After you add the entity classes to your Visual Studio 2010 project, you can write LINQ queries against the strongly-typed entities that represent your data model.
  • Run the solution. At run time, the LINQ to SharePoint provider dynamically converts your LINQ expressions into CAML queries, executes the CAML, and then maps the returned items to your strongly-typed data entities.
Although you can manually develop your entity classes, in most cases, you will want to use the SPMetal command line tool. This is included in SharePoint Foundation 2010 and can be found in the BIN folder in the SharePoint root. The SPMetal tool targets an individual SharePoint site and, by default, generates the following code resources:
  • A data context class that derives from DataContext. This is the top-level entity class. It represents the content of your site and provides methods that allow you to retrieve list entities. The data context class uses the EntityList<TEntity> class to represent the lists in your site, where TEntity is a class that represents a content type.
  • Classes that represent content types. These are marked with the ContentTypeAttribute. Content type classes are generated for implicit content types as well as content types that are explicitly defined on the site. For example, if a user adds a column to an existing list, the user is creating an implicit content type and a representative class will be generated.
  • Classes and properties that represent relationships between listsSPMetal can detect relationships based on lookup columns. Within the entity class that represents a content type, SPMetaluses the EntityRef<TEntity> class to represent the singleton side of a one-to-many relationship and the EntitySet<TEntity> class to represent the “many” side of one-to-many or many-to-many relationships (known as a reverse lookup). Properties that are mapped to a field in a related list are decorated with the AssociationAttribute.
Reference: 

Error: The type or namespace name ‘SharePoint’ does not exist in the namespace ‘Microsoft’(are you missing reference?)


Issue: I’ve got the above error when trying to run a simple code in the console application. Though added the Microsoft.SharePoint .dll from the following path C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.SharePoint.dll, was getting the error during debugging.
Resolution: Right click the Solution Explorer and click properties, In Application tab, .Net Frameworkf 4.0 Client Profile was selected by default, change it to .Net Framework 3.5 and debug again. Also change the Platform target in the Build tab to x64.

When to use ‘using’ and ‘dispose’ and when not to use in SharePoint


If you create your own SPSite object, you can use the Dispose method to close the object. However, if you have a reference to a shared resource, such as when the object is provided by the GetContextSite method in a Web Part, do not use either method to close the object. Using either method on a shared resource causes an Access Violation error to occur
Likewise, If you obtain an SPWeb object using OpenWeb or RootWeb, the best practice is to implement the using statement or the Dispose method to dispose of the object.
However, if you have a reference to a shared resource, such as when you obtain the Web site object from the SPContext object in a Web Part by using SPContext.Current.Web, do not use either method to close the object.

SharePoint 2010 Development Platform Stack


What’s New in Microsoft SharePoint Server 2010


Access Services

Use Access Services in Microsoft SharePoint Server 2010 to edit, update, and create linked Microsoft Access 2010 databases that can be viewed and manipulated by using an Internet browser, the Access client, or a linked HTML page.
Business Connectivity Services
SharePoint Server 2010 and the Microsoft Office 2010 suites include Microsoft Business Connectivity Services, which is a set of services and features that provide a way to connect SharePoint-based solutions to sources of external data and to define external content types based on that external data.
Central Administration (Redesigned)
Central Administration has been redesigned in SharePoint Server 2010 to provide a more familiar experience and make it easier for users to find what they are looking for.
Digital Asset Management
SharePoint Server 2010 includes a new asset library specially designed for managing and sharing digital assets such as audio, video, and other rich media files.
Enterprise Search
With the new capabilities in SharePoint Server 2010, search administrators can configure an optimal search infrastructure that helps end users find information in the enterprise quickly and efficiently.
Excel Services
Excel Services in Microsoft SharePoint Server 2010 can be used to publish Excel client workbooks on SharePoint Server 2010.
Health Monitoring
SharePoint Server 2010 includes an integrated health analysis tool called SharePoint Health Analyzer that enables SharePoint Server to automatically check for potential configuration, performance, and usage problems.
Managed Metadata
Managed metadata is a hierarchical collection of centrally managed terms that you can define, and then use as attributes for items in SharePoint Server 2010. The Managed Metadata Service supports the use of managed metadata, as well as the sharing of content types across the enterprise.
PerformancePoint Services
PerformancePoint Services in Microsoft SharePoint Server 2010 provides flexible, easy-to-use tools for building dashboards, scorecards, and key performance indicators (KPIs).
Records Management
In SharePoint Server 2010, you can manage records in an archive, or you can manage records in the same document repository as active documents.
Sandboxed Solutions
You can deploy sandboxed solutions to quickly and more securely solve business problems. Sandboxed solutions are like farm solutions except in the following ways: they are rights-restricted and have a more permissive deployment policy than farm solutions; they are limited to the site collection to which they are deployed; and their server resource usage is monitored against an administrator-controlled quota for the site collection.

Social Computing
SharePoint Server 2010 includes social networking tools such as My Site Web sites and social content technologies such as blogs, wikis, and really simple syndication (RSS). These features are built upon a database of properties that integrates information about people from many kinds of business applications and directory services. You can adapt content to each user while enabling administrators to set policies to protect privacy.
Upgrade
Review upgrade requirements and find out about new upgrade tools and options, including information about the pre-upgrade checker, Visual Upgrade, and the test-spcontentdatabase Windows PowerShell cmdlet.
Visio Services
The Visio Graphics Service is a service on the SharePoint Server 2010 platform that enables users to share and view Visio diagrams and enables data-connected Microsoft Visio 2010 diagrams to be refreshed and updated from a variety of data sources.
Windows PowerShell
Windows PowerShell is the new command-line interface and scripting language specifically designed for system administrators.