Freigeben über


BCS Tooling Investments in 2010: Part 2

In the first installment of this series of posts, “BCS Tooling Investments in 2010: Part 1”, we talked about in to the design experience in SharePoint Designer 2010. Now let’s take a look at what you can do in Visual Studio 2010 followed by the interoperability between SharePoint Designer 2010 and Visual Studio 2010.

Visual Studio 2010

In Visual Studio you can either create reusable BCS code components (that can be used by others to compose new solutions) or you can create complete client-server solutions that leverage BCS. In the case of reusable components, External Content Types are probably the most important, but you can also create custom class library projects that implement specific interfaces defined by BCS to provide external data access logic and user interface.

Complete solutions can involve any combination of server and client side components that are typically packed together as a WSP and/or ClickOnce solution package. These types of solutions will normally use the full power of Visual Studio to create a wide range of SharePoint and Office components ranging from sites, lists, and Web parts to custom Office add-ins. Any of these can be extended through code to access external data through BCS.

External Content Type Authoring

From a BCS perspective, the most prominent investment in Visual Studio 2010 is the new Business Data Connectivity Model project template that comes with a set of visual designers and code management that will let you author External Content Types that can access virtually any data source through your own custom connectivity logic in .Net code. A notable aspect of the tool is that it does a great job on encapsulating the SharePoint specifics so you don’t need to be a SharePoint expert to create very powerful External Content Types that can aggregate data from multiple sources, apply transformations and business logic, deal with custom security schemes, etc.

clip_image002

Figure 1. Screenshot of Visual Studio 2010 (Beta) showing a Business Data Connectivity Model project with four External Content Types and their associations.

Business Data Connectivity Model projects in Visual Studio 2010 always produce External Content Types of type .Net Assembly. External Content Types that connect directly to databases, WCF or Web Services can be authored and included in SharePoint solution projects, but only XML-based authoring (i.e. no visual design experience) is supported for them.

Authoring BCS-enabled Reusable Components

In Visual Studio 2010 you can author BCS-enabled reusable components for both client and server by creating standard class library projects that implement specific BCS-defined interfaces as well as making use of the BCS Object Models to access external data. Some examples of reusable components are:

- Code actions that can be invoked through the ribbon within Outlook

- External Data Parts that can be hosted in declarative taskpanes in Outlook to present external data

- Workflow activities that access external data using the BCS Object model. These can then be made available for use within the Workflow Designer in SharePoint Designer 2010.

- Field renderers can be created to provide custom UI for complex data types inside External Lists

- Custom credential providers that can be used to access systems that support custom authentication mechanisms

Authoring BCS-enabled Office Add-ins

Visual Studio 2010 allows you to integrating external data into Office applications by creating a standard Office add-in project that uses the BCS object model.

External Data in Workflows

Visual Studio 2010 allows you to access external data by authoring code SharePoint workflows that interact with External Lists or the BCS object models.

For more information on how to create an external list using Visual Studio 2010 take a look at the SharePoint team’s blog post: "Walkthrough of creating a SharePoint 2010 external list using Visual Studio 2010 Beta"

Interoperability between SharePoint Designer 2010 and Visual Studio 2010

When authoring SharePoint solutions, you can actually use a combination of Visual Studio 2010 and SharePoint Designer 2010, you just need to be aware that they have slightly different authoring and deployment models that affect interoperability. SharePoint Designer 2010 works with a “live” connection, so changes are saved directly to the SharePoint server. In the case of Visual Studio 2010, projects need to be first built and then deployed to the SharePoint server. This is based on WSP packages that can be manually deployed or be deployed automatically when the user run or debugs the project.

Projects created in Visual Studio 2010 can be further edited in SharePoint Designer 2010 after they have been deployed to the SharePoint server. However, components authored in SharePoint Designer 2010 need to be manually exported/imported into Visual Studio 2010. In the case of Business Data Connectivity Models, SharePoint Designer 2010 allows you to export one or more External Content Types into an XML file that can then be imported into a Visual Studio 2010. Note that Visual Studio does not support a visual experience for External Content Types that are not based on a .Net Assembly, so for these an XML-only authoring experience will be provided.

SharePoint SDK

The SharePoint SDK will include documentation, samples and guidance for creating SharePoint solutions that leverage BCS. There is one type of solution that will be exclusively supported through the SDK. It is known as an Outlook Declarative solution and it allows you to extend Outlook with custom taskpanes, ribbon actions, forms and views based on declarative XML files that are packaged and deployed together to be interpreted by the BCS at runtime. The SDK will include a packaging tool that will allow you to create this type of solution package from a file system folder containing your solution files. Stay tuned for future posts that will cover more details about this type of solutions.

Summary

The following table provides a side-by-side comparison of the different capabilities in Visual Studio 2010, SharePoint Designer 2010 and the SharePoint SDK.

 

Capability

SharePoint

Designer 2010

Visual

Studio 2010

SharePoint SDK

Author External Content Types

External Content Type Designer - Connect to existing WCF/Web Services, SQL Server or .Net Assemblies through a no code “discover and map” approach.

External Content Type Designer - Connect to virtually any data source through custom .Net code to achieve data aggregation, transformation, security, etc.

Documentation, samples and guidance.

Integrate External Data in Workflow

Support for no code workflows

Support for code workflows as well as reusable code workflow activities.

Documentation, samples and guidance.

Generate and Author External Lists, InfoPath Forms and Web Part Pages

List, Form and Page designers with auto-gen support.

External Lists and Web Part pages can be authored through XML/HTML. Authoring External List InfoPath forms is not natively supported.

Documentation, samples and guidance.

Extend Office apps through BCS-aware code add-ins

N/A

Office add-in projects can access external data through the BCS Object Model.

Documentation, samples and guidance.

Create BCS-enabled reusable code components

N/A

Standard class library projects can implement special interfaces and use the BCS Object Model to access external data.

Documentation, samples and guidance.

Extend Outlook Declaratively

N/A

N/A

Documentation, samples, guidance and tools to author Outlook declarative solution packages including ribbon, Taskpane, Form and View customizations.

- Rolando Jimenez Salgado, Sr. Lead Program Manager