Using the BCS

The BCS is implemented as a service application. This allows you to create external system definitions once, and not only share those definitions to many sites within the same Site Collection or SharePoint web application, but to share those definitions with more than one web application. In addition, a SharePoint farm—a SharePoint installation that is installed on one or more servers that share the same SharePoint configuration database—can host more than one BCS; each one can be configured independently by different sets of administrators. Also, a BCS on one SharePoint farm, and therefore the external system definitions stored in that farm, can be referenced from another SharePoint farm so that access to external systems can be managed centrally but are consumed from SharePoint installations hosted in other locations. A BCS can also be partitioned in a multi-tenancy configuration, which is the term commonly used to describe the isolation of websites in a hosting environment.

Tip

INSIDE OUT Service applications

In SharePoint Foundation, you can create only one type of service application. In SharePoint Server 2010, many service applications are provided such as the Managed Metadata Service (MMS), Access Services, Visio Graphics Service, and Secure Store Service (SSS).

The BCS can be divided into four areas:

  • The External System This is where the external content resides. It can be maintained by one of your organization’s business critical applications often known as Line-of-Business (LOB) applications. They might have a custom user interface or a programmable interface, such as a Windows Communication Framework (WCF) service, web 2.0 source or as a database. Before using BCS, you should explore the external system to which you want to connect and evaluate the best method of connecting to that system. Check with creators of the external system as to the methods available to access the content. If there is more than one method, then ask which is the best option for you. In many cases, the web services method is the best; for example, if you can obtain the external content from the external system by either directly interrogating the database or by using web services, choose web services. If you have an external system that does not have a compatible interface, then you could develop your own BCS connectors or expose the content as a web service. The Microsoft BCS team has a two-part blog called “Making Web Services BCS Friendly.” The first part of the series can be found at http://blogs.msdn.com/b/bcs/archive/2009/11/18/making-web-services-bcs-friendly-part-1.aspx.

  • Connectivity Before SharePoint can access the content from an external system, the definition on how to connect to it and the authentication method used must be created. This is the BDC model. The BDC model consists of declaration XML that describes the external system that you want to access as well as the operations you might like to perform on this external content; for example, read a list of data, or read one item (row) of data, or update one item (row) of data. The BDC model can be created on a development or test SharePoint installation, from which it can be downloaded and imported into the SharePoint production farm where it resides in the BDC metadata store, or it can be used by Microsoft Office applications. The BDC model can be used in a SharePoint installation to create ECTs, also known as entities. However, in a SharePoint 2010 installation, before you can create or upload a BDC model, you must first create the BDC service application. Office 2010 applications only contain the components that allow you to upload a BDC model, and thus, there is no management or configuration interface provided.

  • Presentation This is the client-side consumer of the external content, such as an Office 2010 application, or if you are using SharePoint, it could be an External list created from the ECT.

  • Tools Microsoft provides two tools to create the BDC model, to interact with the BCS program interfaces, and manipulate the BDC objects. These are Microsoft SharePoint Designer 2010 and Visual Studio 2010. There are other third-party tools that can help ECT designers such as BCS Meta Man, which you can find at http://lightningtools.com. You can also use an XML editor such as XML Notepad 2007 or Notepad to create a BDC Model.

Figure 9-3 shows the high-level interaction between these four areas. Notice the symmetry; the BCS architect is the same for Office 2010 applications as it is in a SharePoint installation. However, the Office 2010 applications do not have a BDC metadata store. In its place they have a BDC client-side cache so that when content in an External list is taken offline, the BDC model is taken from the BDC metadata store on the server and stored in the BDC client-side cache. The offline content from the External list is also stored in the client-side cache, which uses a SQL Compact Edition client database so that the offline external content and the BDC model is persisted when the user’s computer is shutdown.

The components of the BCS.

Figure 9-3. The components of the BCS.

Also, note in Figure 9-3 that the Office 2010 applications also have their own connectors; therefore, when a user switches to online mode, the Office application connects directly to the external content without connecting through SharePoint. Other Office 2010 applications such as Access 2010 can import a client-side version of the BDC model, and therefore in this scenario, Access 2010 does not need to connect to SharePoint at all; it would connect directly to the external system.

Tip

INSIDE OUT Taking external data offline

To take the external data offline, additional logic is required. This logic is provided by a Visual Studio Tools for Office (VSTO) ClickOnce deployment package, which is only provided with the Enterprise Edition of SharePoint Server 2010. Therefore, with SharePoint Foundation you cannot take External list data offline in Outlook 2010 or SharePoint Workspace 2010. You can find more information about deploying Office solutions at http://msdn.microsoft.com/en-us/library/bb386179.aspx.

The advantage of using BCS as opposed to the Data Source gallery in SharePoint Designer is that you only need to define the external system and ECT once; you can then use that ECT on many sites across all web applications that are associated with the BDC service application. The disadvantage is that ECT designers must be given edit permissions to the metadata store, which is a high level of security, whereas with the Data Source gallery you only need to be, for example, a site owner. In addition, other BCS security settings are needed to allow users to access the external content that can only be set by using the SharePoint 2010 Central Administration website or Windows PowerShell. This results in a level of collaboration between the ECT designers and the SharePoint farm administrators, which in large organizations is typically two different people.

To connect and retrieve data from an external system with SharePoint Foundation, complete the following tasks:

  1. Create a BDC service application and set permissions on the BDC metadata store to allow for the creation of the BDC model, external system definitions, and ECTs.

  2. Define the external system connection.

  3. Define the operations to create, read, update, and delete (CRUD) content stored in that external system as appropriate to your business requirements.

  4. Create an ECT based on an external system definition.

  5. Configure the permissions on the ECT so that users can see content from the external system.

  6. Use the ECT to present the data from the external data source as External lists, an external data column, Web Parts, or from within an Office application.

Creating a BDC Service Application

You can use the SharePoint 2010 Farm Configuration Wizard, the SharePoint 2010 Central Administration website, or Windows PowerShell to create a BDC service application. Using the SharePoint 2010 Central Administration website or Windows PowerShell, you can specify the SQL server database name or use a preconfigured database name. When you use the configuration wizard an automatically generated BDC database name is created.

When using the SharePoint 2010 Central Administration website or Windows PowerShell, first check that at least one BDC machine service instance is started on one of the servers in your SharePoint farm. The machine service instance—also known as the SharePoint service—uses the service binaries to manage components such as any related timer jobs to make the service application function correctly. If you have more than one server in your SharePoint farm, then the machine instance can be started on one or more of your servers; SharePoint then provides its own round-robin load-balancing mechanism to evenly distribute user requests for data from the external systems.

Once a machine service instance is started, you can then create the BDC service application. This allows you to manage and create the definitions for the external systems. When the BDC service machine instance is started and its associated service application is created, an Internet Information Service (IIS) Virtual Application is created that runs in the context of an IIS application pool within the SharePoint Web Services IIS website. It exposes a WCF web service, also known as the service application endpoint, as shown in Figure 9-4. This is used by SharePoint itself and can be used by your organization to develop new solutions. Such an endpoint is created by SharePoint on each server on which the machine service instance is started.

The BDC service application endpoint created within the SharePoint Web Services IIS website.

Figure 9-4. The BDC service application endpoint created within the SharePoint Web Services IIS website.

Once the BDC service application is started, in the Central Administration website on the Service Applications page, below the BDC service application, you see a BDC service application proxy, also known as the service connection (see Figure 9-5). This provides the connection between the components, such as webpages that want to access the data from the external systems and the BDC service application. The service application proxy also understands the load-balancing mechanism that SharePoint uses, and if you publish a BDC service application for use on other farms, then the service application proxy will be used for managing those connections, as well.

The BDC service application and the BDC service application proxy.

Figure 9-5. The BDC service application and the BDC service application proxy.

The BDC service application contains two interfaces:

  • BDC Administration This is used to manage the metadata store; therefore, this is the interface that is used when you use the SharePoint 2010 Central Administration website to upload the BDC model or when you use SharePoint Designer to create the definitions for the external system and the ECT. BDC Administration is also used by the External Data Picker when you create an external data column on a list or library.

  • BDC Server Runtime This is used to create, update, display, or edit the external content. External content is not saved in the BCS database. Instead, it is retrieved by the BDC server runtime by using bulk load routines when the content is needed. For example, if a user clicks a link to an External list, then this interface is used to populate the default view of the External list. Before the BDC runtime can populate the default view, it must first call the BDC Administration interface to find the location and format of the data from the BDC model so that it can call the appropriate connector, which is the component that obtains the external data. Calls to the BDC runtime result in network traffic between the SharePoint server that is servicing the user’s request and the external system. The data is then passed from the SharePoint Server over the network to the user’s computer. The BDC runtime, whether it is a component in an Office 2010 application or SharePoint 2010, uses the same connectors, and therefore, the Office 2010 applications do not need a connection with SharePoint to access the external data.

When using the SharePoint 2010 Central Administration website, use the following steps to create a BDC service application:

  1. Open a browser, and then go to the SharePoint 2010 Central Administration website.

  2. Under System Settings, click Manage Services On Server.

  3. Ensure that the server on which you want to start the service is selected in the Server drop-down list, and then in the Action column, click Start for the Business Data Connectivity Service, if it is not already started, as shown here.

    image with no caption
  4. In the left navigation pane, click Application Management, and then under Service Applications, click Manage Service Application.

  5. On the Service Applications tab, click New in the Create group, and then click Business Data Connective Service.

  6. On the Create New Business Data Connectivity Service Application page, type the name of the service application, the database server, the database name, the authentication method, and user name and password if appropriate, as shown in the illustration that follows.

    You can also specify a failover server if you are using SQL Server database mirroring as well as creating or using an existing application pool. Application pools created for service applications can only be used by other service applications; they cannot be used as application pools for web applications.

image with no caption

Web applications are linked to service applications through an application proxy group. When you create a new application, proxy it is placed in the default application proxy group. When you create a new web application, you can choose to use the default application proxy group or choose your own custom set of service applications. To change the set of service applications to which a web application is connected, use the Configure Service Application Associations under Service Applications on the Application Management page of the Central Administration website.

Configuring BDC Metadata Store Permissions

Once you have created the BDC service application, the next task you should complete is to set the permissions on the metadata store and the actions that the user or group or claim has, as shown in Table 9-2.

Table 9-2. BDC Metadata Store Permissions

Permission

Description

Edit

Use to allow users to create and modify BDC models, external system definitions, and ECTs. Only allow highly trusted users with this permission, especially in a production environment. Users with this permission can see external system definitions created by other users, and therefore, this can be a security risk, whereby a malicious user can exploit the security information in the external system definition to access and corrupt external content and adversely affect the running of the SharePoint installation. When you upload a BDC model from a development environment into a production environment with its security settings, remove the edit permissions from the BDC model for those users who created it in the development environment. If you do not have a development or prototype environment, you will need to give edit permission on the BDC model to users who create external system definitions and ECTs via either SharePoint Designer or Visual Studio.

Execute

Selectable in Clients

There is no execute or selectable in Clients permission on the metadata store; however, you can choose to propagate these settings to child objects in the BDC model, external systems, ECTs, methods, and method instances, and their child objects.

Set Permissions

Users with this permission can manage BCS permissions on the BDC metadata store, and by propagating a user’s settings, the user can set permission on any object in the metadata store. This permission is usually only given to BCS service application administrators.

Note

You can find more information about BCS security on TechNet at http://technet.microsoft.com/en-us/library/ee661734.aspx#Section4 and on the Microsoft Business Connectivity Services Team Blog at http://blogs.msdn.com/b/bcs/archive/2009/11/24/permissions-in-business-connectivityservices.aspx.

Perform the following steps to set permissions on the BDC metadata store:

  1. Open a browser, and then go to the SharePoint Central Administration website.

  2. Under Application Management, click Manage Service Applications.

  3. On the Service Applications page, click the name of the Business Data Connectivity Service for which you want to manage permissions.

  4. On the Service Application Information page, on the Edit tab on the ribbon, click Set Metadata Store Permissions.

  5. On the Set Metadata Store Permissions page, enter the appropriate users or groups, and then select the appropriate permissions.

    image with no caption
  6. Select the Propagate permissions check box if you want the permissions settings to be copied to all child objects.

    Before you select this option, you need to be aware that by propagating permissions, you are overwriting existing permissions on the child objects. Therefore, generally you should only propagate when you first create a BDC service application.

  7. Click OK.

Tip

INSIDE OUT BDC server application security

Farm administrators, SharePoint PowerShell users, and application pool accounts have full permissions to a BDC service application. Farm administrators can then maintain or repair the BDC service, if necessary, and allow the deployment of solutions packages that use BCS. However, these accounts do not have execute permissions on any metadata store objects. Therefore, such accounts could create a BDC model with its associated external system definition and ECT, and could even create an External list from those ECTs. These accounts would not be able to execute any of the operations on the external content, and therefore, when the External list is displayed in the browser, an authentication error would be displayed.

Defining External Systems Connections

To create an external system definition, you need to know which protocol to use to connect to the external content (known as the data source type) and the authentication method to use as well as the operations that you want to perform on the data. The following data source types can be used (these define the connector that the BDC server runtime uses to connect to the external system):

  • Databases

  • Cloud-based services

  • WCF endpoints

  • Web services

  • .NET assemblies that can gather data from multiple sources

  • Custom external systems that have non-static interfaces that change dynamically

The authentication methods that BDC server runtime uses to retrieve, modify, and delete, if appropriate, the data from the external systems are:

  • User’s Identity (also known as PassThrough) When a user requests a SharePoint page that displays data from an external system, SharePoint sends the user’s credentials to the external system, which uses that identity to decide whether the user is allowed access or not. If you use Windows authentication and have a single server SharePoint farm and the external system is installed on that server, then using the user’s identity will work well. However, to use Windows authentication in any other configuration to mitigate the double-hop issue (explained earlier in this chapter), you will need to configure Kerberos on your servers or configure your SharePoint web applications to use SSL. The other disadvantage of using the user’s identity is that if the external system is an SQL database, it causes a new SQL connection pool to be created for each user who is using the ECT to access the external content, which can cause performance issues. Connection pooling can be disabled, which can also affect performance.

  • Impersonate Windows Identity Specific Windows identities are used to authenticate with the external system. This Windows identity could be the same for all users or there could be some mapping mechanism so that the user requesting the content from SharePoint is matched to a different Windows identity that is passed on to the external system. To use this and the next authentication method, an application that does this mapping is required. If you are using SharePoint Server 2010, you could use the SSS application; if you are using SharePoint Foundation, you will need to write your own equivalent system.

  • Impersonate Custom Identity These could be credentials mapped in a database, or they could be claims-aware identities, which are sent to the external system.

  • BDC Identity (also known as RevertToSelf) SharePoint reverts to the web application’s application pool identity to authenticate with the external system. This user name has a high level of privileges on a SharePoint installation. Any user who can create or edit a BDC Identity model can make themselves an administrator of SharePoint. Therefore, Microsoft does not recommend the use of this authentication mode, and it is disabled by default. When a user tries to import or change the authentication mode to RevertToSelf, an error message displays. The error message that displays when using SharePoint Designer is shown in Figure 9-6.

The BDC Identity (RevertToSelf) Import error dialog box.

Figure 9-6. The BDC Identity (RevertToSelf) Import error dialog box.

Tip

INSIDE OUT When to use RevertToSelf authentication mode

Microsoft recommends that you should only use the RevertToSelf authentication mode in a production environment, when all of the following conditions are true:

  • You are using SharePoint Foundation 2010.

  • You do not have resources to create a custom SSS.

  • You trust all of the people who use SharePoint Designer as completely as if they were SharePoint administrators.

  • The application pool account is locked down so that the attack surface exposed to a malicious user of SharePoint Designer is limited.

RevertToSelf can be turned on by code or by using PowerShell, as shown in the following example, in which the variable BCSName is the name of your BCS application:

$bcs = Get-SPServiceApplication | where {$_.displayname -eq $BCSname};
$bcs.RevertToSelfAllowed = $True;

Although the BDC server runtime would use the application pool ID to retrieve data from the external system no matter which user wants to display the external content, remember that permission settings on the BDC service application can be used to restrict access to the external content.

The easiest way of defining an external system is to use SharePoint Designer 2010; however, by using this tool, you can only define external systems that use the data source types: SQL Server, .NET, and WCF Service.

Once defined, you can modify the external system definitions by using the SharePoint 2010 Central Administration website. To do so, go to the System Application Information page, click the external system, and then on the External System Information page, select the external system and click Settings to display the Property Settings page. The Property Setting page is not displayed if you select Settings on the System Application Information page.

Perform the following steps to create a BDC Model for an SQL Server database:

  1. Open SharePoint Designer 2010, and then open a SharePoint site in the web application that is associated with the BDC service application where you have edit permissions on the BDC metadata store.

  2. In the Navigation pane, click External Content Types to open the External Content Types gallery, which lists the ECTs to which you have permission.

    The gallery might be empty if no ECTs are created or you do not have permission to see any.

    image with no caption
  3. On the External Content Types tab, click External Content Type in the New group. The summary view of the ECT is displayed.

  4. In the External Content Type Information area, to the right of Name, click New External Content, and then type the name of the ECT and enter a display 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 can export the ECT as part of a BDC model, alter the XML in the file (perhaps in Visual Studio), and then reimport the BDC model into the BDC metadata store. This creates a new ECT. You can then remove the misspelled ECT; however, this will impact any External lists that you have created from the misspelled ECT, because 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. Therefore, it is important to think about the name that you want to give an ECT when you create one. Exporting and importing the BDC model is described later in this chapter.

    image with no caption
  5. To the right of External System, select 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 View group on the External Content Types ribbon tab.

  6. Click Add Connection.

  7. 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.

  8. 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 need to use the SSS and provide the secure store application ID. The authentication details you enter here are used to authenticate with the external system when you use SharePoint Designer. You can specify different authentication methods for both SharePoint and Office application that you want to store in the BDC model by clicking Edit Connection Properties in the Connection Properties group.

  9. Click OK.

    The database is now registered in the BDC metadata store as an external system named SharePointDesigner-<databasename>-<userid >-<guid>, where <database> is the name of the SQL database,<userid> is the user name of the person who created the external system definition, and <guid> is a randomly generated number. For example, SharePointDesigner-pubs-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.

Tip

INSIDE OUT Taking external data offline and the use of profile pages

The Offline Sync For External List refers to the use of External lists with SharePoint Workspace 2010. Taking external content offline using SharePoint Workspace is only available if you are using the Enterprise Edition of SharePoint Server 2010. Also on the External Content Type tab, you will see a command, Create Profile Page in the Profile Page group. This automatically creates a page to display all the fields returned for a specific ECT instance. This automatically created profile page uses the Business Data Web Parts, which again are only available with the Enterprise Edition of SharePoint Server 2010. You can manually create a profile page for an ECT by using the Data Form Web Part and BDC actions. If you click the Create Profile Page ribbon command, a Microsoft SharePoint Designer dialog box opens, stating that the server could not complete your request, but it does not provide any details as to why the request could not be completed. A second dialog box opens, stating that the expected changes to the ECT could not happen and that you should create the profile page again! Ignore these messages. The ribbon on the Central Administration website is trimmed not to display this option on a SharePoint Foundation installation.

Working with External Content Types

Once the external system definition is defined, you can now create an ECT and specify the CRUD operations that you want to execute on that external system. Many organizations use ECTs in preference to using the Data Sources gallery for security and logistic reasons. The ECT can be defined once and stored centrally in the BDC metadata store but used many times for all sites and Site Collections, depending on the permission settings of the ECT. The schema and authentication methods need only be explained to a small number of ECT designers. Unlike the Data Sources gallery, where the data source definition would need to be created for each site on which you want to use the external content.

Creating ECTs

Use the following steps to create an ECT by using SharePoint Designer:

  1. On the ECT summary page, give the ECT a name, and if the external content is to be displayed in Outlook 2010, then configure the Office item type as Appointment, Contact, Task, or Post. Switch to the operations view of the ECT.

  2. 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.

  3. In the Data Source Explorer, expand the database node by clicking the plus sign (+) to the right of the database name, and then expand Tables or Views or Routines.

  4. Right-click the table for which you want to create a BDC Model, and then click the operation for the methods that you want to create.

    Depending on the operations exposed by the external system, you can create all operations or add the individual operations: read item, read list, create, update and delete.

    image with no caption

    The Operations wizard opens; each page also contains a section that displays issues, warnings, and errors as you configure the operations. The three pages are:

    • Operation Properties Use this page to set the operation name, operation display name, and operation type. For a database external system, you can create all operations if you choose this option; the operation properties are automatically generated and the operation names will be Create, Read Item, Update, Delete and Read List.

    • Parameters Use this page to select those fields, known as elements, that you want to use in your SharePoint solution. You can modify each data source element, including, the identifier name, field name, and the name of the field when it is displayed in the browser. By default, all fields will be shown in the external item picker when adding an external data column to a list or library. If the table, view, or routine returns a large number of fields, displaying them all in the external item picker might confuse users. Therefore, it is best practice to select a small set of elements that best describes an item. If you select an Office item type on the summary view, you will use this page to map the external content data fields to Office properties. The Office mapping form is part of the Read Item operation, and therefore, if you wish to modify these settings once an ECT is created, modify the return parameter properties of the Read Item operation. You also change the Office item type on the summary page once an ECT is created.

    • Filter Parameters Use this page to add your own throttling conditions to your solution, this will optimize the time it takes to return the data from the external system. Remember, external content is not saved in the BCS database but retrieved by the BDC server runtime, when needed. The filter types available are: Comparison, Limit, Page Number, Timestamp, and Wildcard. For string data types, use the Wildcard filter type because this will internally translate to a like clause in queries to get the data. BCS throttling is enabled by default to prevent Denial of Service attacks. You are most likely to see the effect of this feature if no limit filter was created; thus, when the BCS runtime attempted to retrieve data from the external system it timed out due to the large amount of data it was trying to retrieve. For more information on BCS throttling, see the sidebar later in this chapter.

  5. Click Finish, and then click Save.

    This will create an external system named <databasename> in the BDC metadata store if this is the first ECT created for the external system, and an ECT with the name you typed in step 1.

image with no caption

Managing Permission on ECTs

The ECT is just one of the BDC metadata store objects for which you can set permissions, and these permissions affect the interface between the SharePoint server and the presentation layer; that is, they do not define the authentication and security settings between the SharePoint server and the external system—those security settings are defined in the external system definition. The other objects present in the BDC metadata store that have their own access control list (ACL) are the BDC model and external system definitions, as described in Table 9-3. The information in this section is also relevant to those objects.

Table 9-3. BDC Model Object Permission Settings

Permission

Applies to

Description

Edit

Access-controlled metadata objects

Users with this permission can perform the following actions:

  • Update

  • Delete

  • Create child objects

  • Add property

  • Remove property

  • Clear property

  • Add localized display names

  • Remove localized display names

  • Clear localized display names

  • Give edit rights to administrators and users who use SharePoint Designer

Execute

ECT, Method Instance

Users with this permission can execute operations via various runtime API calls; that is, they can view the data of an ECT returned from a finder method. In most scenarios, you would assign this right to all users who have access to SharePoint.

Selectable in Clients

ECT

Users with this permission can use the external data picker to configure Web Parts and lists and create External lists. This permission should be available to administrators and users who design solutions via the browser or SharePoint Designer.

Set Permissions

Individually securable metadata objects

Users with this permission can manage BCS permissions on the object. This permission is usually given only to BCS service application administrators.

To set permissions on one or more models, external systems, or ECTs, complete the following steps:

  1. Open a browser and go to the SharePoint Central Administration website. Under Application Management, click Manage Service Applications.

  2. On the Service Applications page, click the name of the Business Data Connectivity Service for which you want to manage permissions.

  3. On the Service Application Information page, in the View group on the Edit tab, select BDC Models, External Systems, or External Content Types from the drop-down menu.

    image with no caption

    The page displays only objects of the type that you have chosen.

  4. Select the objects that you want to modify, and then click Set Object Permissions in the Permissions group on the Edit tab.

  5. On the Set Object Permissions page, enter the appropriate users or groups and assign the appropriate permissions.

    If you choose to propagate the permission to any child objects, remember that you will overwrite the existing permissions for those objects.

Exporting and Importing BDC Models and Resource Files

If you are fortunate to have a development environment, then you might have created your external system definition and ECTs in that environment. If the testing was successful, you must now deploy these BDC definitions to the production farm by first exporting the appropriate BDC model from the BDC service application in the development environment and importing the BDC model into the correct BDC service application in the production farm. You can use the SharePoint 2010 Central Administration website, a PowerShell cmdlet, or SharePoint Designer to export the BDC model.

Note

You can find information about Windows PowerShell Business Connectivity Services cmdlets at http://technet.microsoft.com/en-us/library/ff793356.aspx.

If you created the External System definition and ECT by using SharePoint Designer, then you should use that tool to export them. The BDC model, SharePointDesigner-<databasename>-<userid >-<guid>, created by SharePoint Designer does not appear to link to the ECTs that are created by SharePoint Designer. Therefore, you cannot use the SharePoint 2010 Central Administration website to export ECTs developed with SharePoint Designer.

If the BDC model is to be used by Office 2010 applications, then you can only export them in the correct format by using SharePoint Designer. The permissions that you have configured on the BDC Model, the external system, and ECT can also be included in the exported BDC model.

You can use the SharePoint 2010 Central Administration website or a Windows PowerShell cmdlet to import a BDC model. You cannot use SharePoint Designer to import BDC models.

When you export a BDC model, make changes, and then import it into a BCS application, you should update the version number for the ECT. By default, the version number is set to 1.0.0.0. Changing the third or fourth digit of the version number indicates a small change, such as adding a new method or changing connection information. Changing the first or second digit signals a “breaking change” to the BCS, such as adding a new field to the Read Item operation (SpecificFinder method) or changing the identifier field. Breaking changes usually cause External lists that were defined using the previous version of the BDC model to fail. Therefore, before making an ECT widely available, ensure that your ECT meets all your business needs and is tested thoroughly.

Note

You can find more information about migrating the BDC Model and ECT from a development environment to testing environments and production environments at http://msdn.microsoft.com/en-us/library/gg650431.aspx.

Tip

INSIDE OUT Deploying BDC solutions with Visual Studio

With Visual Studio, you can create resource files and custom BCS Web Parts as well as a BDC Model. In this scenario, you would not use the export functionality; instead, you would commonly deploy the files as a solution package (.wsp). You can read more about packaging and deploying solutions in Chapter 16.

To export a BDC model by using SharePoint Designer, follow these steps:

  1. Open SharePoint Designer 2010, and then open a SharePoint site in the web application that is associated with the BDC service application where you have created the external system definition and ECT.

  2. In the Navigation pane, click External Content Types to open the External Content Types gallery.

  3. Click the icon to the left of the ECT that you want to export, and then on the External Content Types tab, click Export BDC Model in the Manage group.

  4. In the Export BDC Model dialog box, type the BDC model name; in the Settings list, select Default if the BDC Model is to be imported into another SharePoint farm, or select Client if you are going to use the BDC model with Office 2010 applications.

    image with no caption
  5. Click OK to save the BDC model as an XML file.

    The file will have an extension of .bdcm. If you are importing the file into an Office 2010 application, change the extension to .xml.

To export a BDC model or the resource information in a separate file by using the Central Administration website, follow this procedure:

  1. Under Application Management, click Manage Service Applications, and then on the Service Applications page, click the name of the BDC service application that contains the BDC model that you want to export.

  2. In the View drop-down list, select BDC Models, if it is not already selected, and then under Service Application Information, select the BDC model that you want to export.

  3. On the Edit tab, click Export in the BDC Models group.

  4. On the Export BDC Model page, select the Model or Resource file type option and the resource components that you want to export.

    If you select the resource file type option, a separate resource XML file will be created, which usually has an extension of .bdcr. When you export a BDC model in SharePoint Designer, you cannot export the resources separately, nor can you choose which resources to export. With SharePoint Designer, all resource information is exported.

    image with no caption
  5. Click Export, and then save the file.

Note

You can find information about the BDC model and resource files at http://msdn.microsoft.com/en-us/library/aa674515.aspx.

To import a BDC model by using the Central Administration website, perform the following steps:

  1. Under Application Management, click Manage Service Applications, and then on the Service Applications page, click the name of the BDC service application that contains the BDC model you want to export.

  2. On the Edit tab, in the BDC Models group, click Import.

  3. On the Import BDC Model page, in the BDC Model section, use either the Browse button to navigate to the model file or type the location of the model file in the text box.

  4. In the Advanced Settings section, select the Resource option if you are importing a file that only contains localized names, properties, or permissions.

  5. Click Import.

    The Import BDC Model page then displays information on the progress of the import, and then when the model is imported, the page displays further information depending on whether the import was successful or not.

Caution

When you choose to import permissions that are defined in your BDC model and an entry for an ECT already exists in the ACL, the permission information from the imported file overwrites its value.

Once the BDC model is imported, SharePoint 2010 separates the external system and the ECT information. You should review both of these objects and set permissions according to your requirements. You should then check that an External list can be created from the ECT, and external content can be included in an external data column in a list or library.

You can also use the Delete command on the Edit tab to delete BCD models, external systems, or ECTs.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset