Presentation is loading. Please wait.

Presentation is loading. Please wait.

Business Connectivity Services

Similar presentations


Presentation on theme: "Business Connectivity Services"— Presentation transcript:

1 Business Connectivity Services
Name Title Company

2 Agenda Business Connectivity Services Overview OData Sources
App-Level External Content Types CSOM and REST Interfaces Notifications & Custom Event Receivers

3 BCS Overview

4 BCS Overview: External Content Types
BCS allows the integration of external data into SharePoint through an object relational map (ORM) known as an External Content Type (ECT). ECTs map external data fields to business entities (e. g., Customer, Order, Employee) ECTs define operations to perform on the external data (e.g., create, read, update, delete) Creating ECTs is the primary development activity Business Connectivity Services (BCS) makes it easy to integrate external data into SharePoint and Office by providing infrastructure to help solve many of the data, user, and IT problems inherent in data integration solutions. BCS solutions map External System capabilities to standardized interfaces to define how to interact with a system’s external data. As a result, solution developers don’t have to learn the nuances of each LOB system; they can deliver powerful solutions faster. The External Content Type (ECT) is perhaps the most important BCS concept. An External Content Type is the SharePoint and Office representation of a real business entity, such as a customer, order, or employee. An ECT is a metadata description of the connectivity settings, data structures, and stereotyped operations—like create, read, update and delete—that allows access to external data. The external data can live in OData Services, Web Services, WCF Services, SQL Server, Azure, or custom line-of-business databases. ECTs may be created in the SharePoint Designer or in Visual Studio depending upon your needs. Creating ECTs is the primary development activity.

5 Microsoft SharePoint Server 2013
BCS Overview SharePoint Server Business Connectivity Services Metadata Store BDC Server Runtime Secure Store Service (SSS) Search, Columns, Web Parts, CSOM, Profiles SharePoint Site/App VSTO Package External List BDCM Files Office Client Office Integration External Business Parts Custom Code Business Connectivity Services Connectors – connectors allow BCS to connect with external systems. OOB connectors support OData, web services, WCF services, and SQL Server. .NET Assembly connectors and custom connectors can be created for accessing other systems. BDC Service Application - The BDC Service Application is installed as part of SharePoint setup and can be administered through the Central Administration site. The Service Application is comprised of several components, including the BDC Metadata Store database (where settings such as Metadata Model files are stored) and the BDC Server Runtime (which are the main connectivity components). Secure Store Service – SSS is a credential mapping system that allows BCS to retrieve credentials to use when accessing external data. This helps solve problems such as double-hop and accessing systems with proprietary security infrastructures. Search, Columns, Web Parts, CSOM, Profiles – There are many ways to use external data inside SharePoint. You can search external systems, display data in OOB web parts, access the data through the Client Object Model, and provide supplemental data to user profiles. SharePoint Site/App – Sites and Apps can use external data. The primary way that users interact with external data is through an external list. External lists look and feel like standard lists, but they are backed by an ECT instead of a standard content type. Apps can also have ECTs defined within the app through a BDCM file. This file allows for app-level ECTs (discussed in detail later), which supports the isolation model of Apps. Exernal lists may be synchronized with Outlook through the automatic creation of a VSTO click-once package, which is downloaded to the client. Client Components – The client BCS components are installed as part of the Pro Plus SKU and above. They include a client cache, which holds the BDC Metadata Model as well as cached external data. The BDC Client Runtime contains the main connectivity components for BCS on the client. External data is displayed in Outlook using External Business Parts for no-code solutions. There is also support for custom solutions. BDC Client Runtime Client Cache Connectors © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 Other BCS Enhancements
Support for BCS in SharePoint Online Improved sorting and filtering capabilities for External Lists to improve query efficiency OData and SQL support both WCF does not support sorting BCS in SharePoint Online BCS and SSS will be enabled at the tenant level for SharePoint Online Improved Filtering In SharePoint 2010, large recordsets were retrieved by BCS and then sorted/filtered locally. Instead of retrieving a large data set to filter and sort locally, we send the predicates to the external system there by retrieving only fewer records. Sorting is only for OData/SQL, filtering is for all external systems

7 OData Sources

8 OData Sources: Overview
Open Data Protocol (OData) Protocol for performing CRUD operations on web data Uses standard HTTP GET, POST, PUT, DELETE Returns ATOM and JSON results Provides easy cross-platform data access Representational State Transfer (REST) Architecture utilizing URIs to specify operations Often used in conjunction with OData protocol The Open Data Protocol (OData) is a web protocol for querying and updating data. OData applies web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores. OData emerged organically based on the experiences implementing AtomPub clients and servers in a variety of products over the past several years. OData is being used to expose and access information from a variety of sources, including but not limited to relational databases, file systems, content management systems, and traditional web sites. Microsoft has released OData under the Open Specification Promise (OSP) to allow anyone to freely interoperate with OData implementations. We intend on working with others in the community to move the features of OData into future version of AtomPub or other appropriate standards. Links to learn more: Open Data Protocol site - Open Data Protocol by Example - OData Q&A -

9 OData Sources: Overview
Microsoft SharePoint 2010 Microsoft Azure Windows Azure Marketplace SQL Server Reporting Services OData producers are services that expose their data using the OData protocol. These are just some sample producers. A detailed list of producers can be found at SharePoint 2010 exposes OData through the ListData.svc service Azure allows access to SQL Azure and structured storage through OData. You can configure OData services in your Azure account Azure Marketplace exposes OData producers either for free or a fee. MSFT exposes a free OData source you can work with for testing SQL Server Reporting Services for SQL Server 2008 R2 can expose report data as an OData source

10 OData Sources: Overview
OData is an important protocol for services that was not previously supported by BCS BCS can now access OData sources OOB just like WCF or SQL data sources Visual Studio support for automatically generating BDC Metadata Models from an OData source Not supported in SharePoint Designer The key message here is that OData is now a first-class source for BCS models with support in SPD and VS. This makes it simple to create no-code solutions against OData sources.

11 OData - Creating External Content Types
<LobSystem Name="ODataWebNorthwindModel" Type="OData"> <Properties> <Property Name="ODataServiceMetadataUrl" Type="System.String"> <Property Name="ODataMetadataAuthenticationMode" Type="System.String">PassThrough</Property> <Property Name="ODataServicesVersion" Type="System.String">2.0</Property> </Properties> <LobSystemInstances> <LobSystemInstance Name=" <Property Name="ODataServiceUrl" Type="System.String"> </Property> <Property Name="ODataServiceAuthenticationMode" Type="System.String">PassThrough</Property> <Property Name="ODataFormat" Type="System.String">application/atom+xml</Property> </LobSystemInstance></LobSystemInstances></LobSystem> This is a portion of a BDC Metadata Model showing how an OData source can be accessed Type - This attribute must be set to ODATA when working with OData datasources. ODataServiceMetadataUrl- Provides the end point of the metadata service. ODataAuthenticationMode - The authentication mode used by the datasource to allow access and what type of access to the calling API. ODataServicesVersion - The version of OData ODataServiceUrl- The endpoint for the service ODataFormat- The format for the returned data

12 OData - Creating Stereotypes in External Content Types
Operation Sample Uri Finder GET SpecificFinder Creator POST Updater PUT Deleter DELETE AssociationNavigator This slide is showing the key supported stereotypes for BCS and how they relate to OData. Remember that OData uses HTTP GET, PUT, POST, and DELETE to perform crud operations. BCS uses stereotypes to implement CRUD operations on external data. This slide shows the mapping between a stereotype and the OData operation and Uri. Example: A Finder stereotype returns a view of a list. In the crm.svc odata producer, the Uri for returning many clients is This Uri is called using a GET operation and the resulting JSON is displayed as a view of the external list. The rest of the notes in this section detail the stereotypes shown in the slide. Finder <CollectionUrl > > <HttpMethod>GET</HttpMethod> Example Url: SpecificFinder <CollectionUrl > > <KeyPredicate KeyPredicate > <HttpMethod>GET</HttpMethod> Specific finder selects a specific entity based on the input parameter. The InputParameter here refers to the parameter passed as input to a specific finder Example Url: Creator <CollectionUrl> CollectionUrl > <HttpMethod>POST</HttpMethod> Following the AtomPub protocol, new Entries are created by executing an HTTP POST request against the URI of the Collection where the Entry is to be created. The POST request includes the new Entry in its body, in one of the supported formats. Updater KeyPredicate > <HttpMethod>PUT</HttpMethod> To update the data in an Entry clients execute an HTTP PUT request against the Entry's URI, with a new Entry resource included in the request body. According to the AtomPub protocol specification, the PUT request replaces the existing Entry, so all property values in the Entry either take the values indicated in the request body, or are reset to their default value if not mentioned in the request. Deleter <KeyPredicate <HttpMethod>DELETE</HttpMethod> Deleter deletes a specific entity based on the input parameter. AssociationNavigator <CollectionUrl > > <KeyPredicate KeyPredicate > <NavigationProperty>Orders</NavigationLink> <HttpMethod>GET</HttpMethod> Example Url:

13 BCS Models with OData demo

14 App-Level ECTs

15 App-Level ECTs: Overview
In SharePoint 2010, all ECTs were farm level Or in service application level New 2013 model requires more granular isolation 2013 introduces ability to define ECTs within an App In SharePoint 2010, External Content Types could only be installed and used at the farm level. This caused a problem for developers because, even for simple applications, an administrator had to be involved because of the access rights needed to install at the farm level. In SharePoint 2013, a new paradigm is introduced that more or less isolates applications into more autonomous units, more simply, Apps. They generally will contain all the resources they need within the App itself and will be insulated from other Apps. The benefit of this architecture is that 1) Developers can create Apps that are aligned with the new Apps model of SharePoint 2013, 2) developers can create Apps that access external data from SAP, Netflix, proprietary and other types of data without involving the tenant administrator and 3) access to external applications is maintained through BCS, which provides a consistent and uniform interface that can be used by other SharePoint Apps .

16 App level external content types
BusinessDataMetadataCatalog -library External System BDC Runtime BDCM files BDC Metadata Models will be saved in library named “BusinessDataMetadataCatalog”. This means you can upload a BDC Metadata Model to the site, or include it within the definition of an App. External List will have new property named “MetadataCatalogFileName” that refers to the BDCM model file located in the library. The “FileBackedMetadataCatalog” class will load the BDC Metadata Model and then the External List will render. Support for OData, WCF, and SQL only. No support for .NET Assembly Connectors or Custom Connectors. External List MetadataCatalogFileName = MyModel.BDCM

17 App-Level ECTS External List Instances

18 App-Level ECTS demo

19 CSOM and REST Interfaces

20 CSOM – Client Side Object Model
var ctx = new SP.ClientContext(); var web = ctx.get_web(); entity = web.getAppBdcCatalog().getEntity(entityNameSpace, entityName); ctx.load(entity); lobSystem = entity.getLobSystem(); ctx.load(lobSystem); lobSystemInstances = lobSystem.getLobSystemInstances(); ctx.load(lobSystemInstances); ctx.executeQueryAsync(success, failure); This slide shows how to use the BCS object model through JSOM

21 RESTful Access to External List
AppLevelECT.Grid.prototype = { init: function () { $.ajax({ url: this.surlWeb + "_api/lists/getbytitle('Customers')/items? $select=BdcIdentity,CustomerID,ContactName", headers: { "accept": "application/json;odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val() }, success: this.showItems }); } This shows a RESTful call to an External List

22 Notifications & Custom Event Receivers

23 Notifications & Custom Event Receivers
External Lists in 2010 did not support event receivers or alerts Highly-requested capability New model supports External List event handlers ECT event handlers External List alerts Business Connectivity Services provides SharePoint with the means to read and manipulate data from external systems. However, sometimes it is necessary to see changes to the underlying data as they occur. Many times, people who use this data to do their jobs, will require notifications that the data has changed. External Lists had lots of limitations in SharePoint Chief among them were no support for event handlers. Event handlers are a key aspect of designing solutions based on lists so that actions can be taken when items are added, modified, or deleted. Therefore, this is a highly-requested capability. SharePoint 2013 adds the ability to attach event handlers to an External List or directly to an External Content Type. Additionally, the new model enables alerts for External Lists.

24 Notifications & Custom Event Receivers
ECT must implement new stereotypes Subscribe (DeliveryAddress, EventType) Unsubscribe (SubscriptionId) DeliveryAddress can be Relative URL for External List event handlers Absolute URL for Entity event handlers EventType can be ItemAdded ItemUpdated ItemDeleted Subscribe and Unsubscribe are new BCS stereotypes. Delivery Address The Subscribe operation specifies the delivery address and event type for which a notification will be received. The Subscribe operation supports the use of a relative URL that will be used to build a delivery address that is specific to the SPWeb and will use the Client.svc endpoint to receive notifications. The Subscribe operation also supports the use of an absolute URL that can be called to receive notifications. The relative URL approach is typically used when an event handler is attached to an External List. The absolute URL is typically used when an event handler is attached direct to an ECT. When attaching events to an External List, you are limited as to the supported events. When you attach an event to an ECT, you can support custom notifications. Subscription ID The SubscriptionId is returned from a call to the Subscribe operation and can be used to call the Unsubscribe operation. When the Subscribe operation is called, the subscription is added to a hidden list named ExternalSubscriptionTable to track the subscriptions. The Unsubscribe operation removes the subscription entry. Event Type The model only supports item added, item updated, and item deleted for External Lists.

25 Notifications & Custom Event Receivers
Delivery Address <Parameter Direction="In" Name="deliveryAddress"> <TypeDescriptor TypeName="System.String" Name="deliveryAddress"> <Properties><Property Name="IsDeliveryAddress" Type="System.Boolean">true</Property> Event Type <Parameter Direction="In" Name="eventType"> <TypeDescriptor TypeName="System.String" Name="eventType"> <Properties><Property Name="IsEventType" Type="System.Boolean">true</Property> Subscription ID <Parameter Direction="Return" Name="Subscribe"> <TypeDescriptor TypeName="System.Int32" ReadOnly="true" Name="SubscriptionId"> <Properties><Property Name="SubscriptionIdName" Type="System.String">SubscriptionId</Property> <Interpretation><ConvertType LOBType="System.Int32" BDCType="System.String"/></Interpretation> This shows snippets of the model required to make up the Subscribe and Unsubscribe methods Note how the parameters must be properly tagged so that BCS can figure out which is the Delivery Address, Event Type, and Subscription ID. Also note that the SubscriptionID must be text so an interpretation can be used if necessary to convert it.

26 Notifications & Custom Event Receivers
External Lists support Alert Me functionality OOB capability for External Lists LOB System must implement Subscribe, Unsubscribe LOB System sends notification No custom event-handler required The point here is that alerts are enabled OOB if you implement Subscribe and Unsubscribe. Developers do not have to create or register an event handler. However, external systems must still call a well-know endpoint when an event occurs.

27 Notifications & Custom Event Receivers
string assembly = "MyAssembly, Culture=, Version=, PublicKeyToken="; string className = "MyAssembly.MyClass"; using (SPSite site = new SPSite(siteUrl)) { using (SPWeb web = site.RootWeb) SPList list = web.Lists[listTitle]; list.EventReceivers.Add( SPEventReceiverType.ItemAdded, assembly, className); } Developers can use a simple approach for adding event receivers to External Lists (similar to RER for standard lists). When an event receiver is added, the Subscribe operation is called behind the scenes. When an event receiver is deleted, the Unsubscribe operation is called. Developers may then write custom code to handle the events in their custom event receiver class. There is a CSOM implementation for this. Is the a CAML implementation??

28 Registering External Content Type Events
IEntity customerEntity = catalog.GetEntity("AdventureWorks", "Customer"); ILobSystemInstance lobSystemInstance = customerEntity.GetLobSystem(). GetLobSystemInstances()["AdventureWorks"]; NotificationCallback callback = new NotificationCallback() { Type = “Absolute”, Url = " }; string subscriptionId = customerEntity.Subscribe( EntityEventType.ItemAdded, callback, lobSystemInstance); This shows an example of registering an absolute URL for an ECT. This approach ties the notification to an ECT (not an External List). Notice that the Subscribe method is called directly, unlike the approach with External Lists. No CSOM Implementation

29 Microsoft SharePoint Server 2013
BCS External Events REST End Point Notifications SharePoint CSOM Event Sink External System Connectors Event Receivers Operations Business Data Connectivity Sequence of Events Developer creates an ECT that supports the Subscribe and Unsubscribe stereotypes An External List is created from the ECT Event subscriptions are wired up, which exposes an endpoint External system calls back into exposed endpoint CSOM Event Sink will update the set of notifications for the External List BCS queries External System for changes The Event receiver sends out alerts as necessary Remote Event Receiver can take any additional custom actions Notifications In order for SharePoint to be aware that a change has occurred and communicate that change through an alert or or text, it must receive the notifications from the external system. The external system sends information about the events occurring by posting those notifications to the REST endpoint configured as the DeliveryAddress property. These notifications happen on a “Push” basis, meaning that the line of business application must notify SharePoint users of the changes to the data. BCS is responsible for making requests of the external system for the current state of the data. When a change is made, or some other type of monitored event occurs, BCS will notify those who have subscribed to the notifications that a change has occurred. Event Sink Service This service is invoked when an event is called at its delivery address and subscribed to. It updates the list of notifications that have been received by the external system. Remote Event Receiver Remote event receivers can have custom code which provides developers with a way of performing business logic when a specific event occurs. Essentially, these are the hooks where a developer can create code to handle certain conditions, make notifications, updates to other systems, etc. Custom Event Receiver © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

30 Notifications demo

31 Summary Business Connectivity Services Overview OData Sources
App-Level External Content Types CSOM and REST Interfaces Notifications & Custom Event Receivers

32 Q&A

33 © 2012 Microsoft Corporation. All rights reserved
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Business Connectivity Services"

Similar presentations


Ads by Google