4. Working with external content types
The easiest way of defining an external system is to use SharePoint
Designer 2013 or Visual Studio 2012. The tooling to create a BDC model
for an OData source type has been included within Visual Studio 2012
and not SharePoint Designer. The BCS tooling within SharePoint Designer
2013 remains as it was in SharePoint Designer 2010; that is, you can
define ECTs that use the following data source types: SQL Server, .NET,
and WCF Service. By including the new tooling within Visual Studio
2012, the BDC model can either be included in a SharePoint or Office
app or imported into a BDC metadata store using the SharePoint Central
Administration website, Windows PowerShell, or in a tenant environment,
such as Office 365, using the tenant admin site.
Creating an external system using SharePoint Designer
Follow these steps to create a BDC model for an SQL Server database:
-
Open SharePoint Designer 2013 and then open a SharePoint site.
You will not be storing anything in the site, so this can be any
site in the web application that is associated with the BDC service
application where you have edit permissions on the BDC metadata store. -
In the Navigation pane, click External Content Types to open the
External Content Types gallery that lists the ECTs to which you have
permission.
The gallery may be empty if no ECTs are created or you do not have permission to see any, as shown next.
-
On the External Content Types tab, click External Content Type in the New group.
The summary view of the ECT is displayed with an asterisk on the
workspace label, indicating that the ECT has not been saved to the
metadata store on the SharePoint server. You cannot save an ECT until
you have given it a name and defined Read Item and Read List operations
on an external system. -
In the External Content Type Information area, to the right of Name,
click New External Content, type the name of the ECT and enter a
display name, which is the name displayed in the ECT picker dialog box.
The ECT name is usually a short, terse, but meaningful name that
preferably does not contain spaces. You cannot save an ECT until it has
a name. Once you have saved the ECT, you cannot change the ECT name in
SharePoint Designer; however, you can change the ECT display name. You
could export the ECT as part of a BDC model, alter the XML in the file
(say in Visual Studio), and then reimport the BDC model into the BDC
metadata store. This will create a new ECT. You could then remove the
misspelled ECT, however, this will affect any external lists you have
created from the misspelled ECT, as ECTs are based on the name of the
ECT and the namespace.
The namespace of a SharePoint Designer–created ECT is the URL of the
web application. The namespace is used to group ECTs, so you should
change the namespace to reflect the business purpose for a group of
ECTs. In the following example, http://adventure-works-CRM relates all the customer relationship records for your organization.
-
To the right of External System, click Click Here To Discover
External Data Sources and Define Operations to display the Operations
Design view of the ECT.
You can toggle between the Summary view and the Operations Design
view by using the two commands in the Views group on the External
Content Types ribbon tab. -
Click Add Connection. -
In the External Data
Source Type Selection dialog box, select the appropriate data source
type, such as SQL Server, and then click OK to display the source type
connection dialog box. -
Enter the connection details. For example, for a SQL Server source
type, enter the database server name, the database name, and the
authentication type: User’s Identity, Impersonated Windows Identity, or
Custom Identity.
For the two impersonated identities, you will need to use the SSS
and provide the secure store application ID. The authentication details
that you enter here will be used to authenticate with the external
system as you use SharePoint Designer. You can specify different
authentication methods for both SharePoint and Office applications that
you wish to store in the BDC model, by clicking Edit Connection
properties in the Connection Properties group. -
Click OK.
The external system is registered in the BDC metadata store as an external system named SharePointDesigner-<external system name>-<userid>-<guid>, where <external system name> would be the name of the SQL database, <userid> is the user name of the person who created the external system definition, and <guid>
is a generated number. One such example is
SharePointDesigner-northwind-peter-581fd994-5891-49a5-8842-73b806483a04.
These are placeholders to store the definitions you have created. It is
not until you create an ECT for this external system that a valid
external system definition is created that can be used by other ECT
designers in other sites.
|