Sunday, June 24, 2012

Business Connectivity Services SharePoint 2010

================= 6 Sep 2012 =================

ECT has the
  1. methods -- create/update/delete
  2. schema
  3. data access capability
  4. permissions

Authentic for users

  1. Revert to Self :
  2. using the process a/c . network Service
  3. Pass thorugh : logged on user.

BDC identity : ie. the customer data i.e. first name /last name / password from the db table.


Single Sign ON  :

using an alias/ for a individual/group for theSQL/ credentials .This was discussed here as
i have seen with the other videos

2 methods that are reqd ; Readitem,ReadList.
   
BCS associations :
relation between the tables  in the database  can be replicated
into relations between entities in ECT.

Supported Associations:
1 to many based on FK

many to many assoc between CTs is not supported

Eg .
 the Salesorder CT is related to
 the Customer CT 
 with the feild customerId.

ULS Viewewer -- download from
http ://code.msdn.com/UlsViewer

For eanabling BCS search :

1> Create Search Content Source : Here you can point the content source to the BCS connection that u created in SPD or

VS2010
  1.  Ensure that  permissions are set on the same .
  2.  create profile page site
  3.  Enable profile pages in BCS CA \
  4. Crawl


WorkFlow :
You cant create WF against Ext List . as the data is in the ext system.
However you can create a SIte level WF and there we  can decide and update a field in an ext list using the WF.

and since the wf runs under process user you have to have a  SSS for the WF to run against.


For Viewing BLOB  data on the Ext list we can do the following :as it cant be done from the SPD
Export the BDC model to desktop and then you can open the same.You can open the same from  a DeskTop
and it will be an xml.It has method / instance/params etc.
you can add some customization to the same  XML for streaming of data
goto CA of the site and then Import the same BDC model in the SP site .

SP server enterprise edition has the Web Parts for BCS.



===================  ===================
Was really confused regarding the .Net Assembly connector from BCS .
aper from .Net there is the WCF  and SQL connectors for connecting to external systesm :

http://msdn.microsoft.com/en-us/library/hh144965.aspx
is real usefull

In scenarios where you need more flexibility than is provided by the SQL and WCF connectors, you will likely build a .NET Assembly Connector instead. A .NET Assembly Connector is a project that you create in Visual Studio 2010 that contains the ECT definition and associated business logic for accessing a specific external system. The .NET Assembly Connector differs from the custom connector because it targets a specific instance of a system, as opposed to all instances of a specific system type. In other words, you can use a .NET Assembly Connector to access a specific folder in Exchange, while a custom connector could be used to access any folder in Exchange.

The .NET Assembly Connector is also useful for aggregating data from multiple sources into a single ECT, which cannot be accomplished using a custom connector. While accessing an external system, the .NET Assembly Connector can also apply business rules to data before it is made available in SharePoint, and facilitate search indexing of a specific external system. The .NET Assembly Connector is covered in detail later in the chapter.

The key thing to note about the .NET Assembly Connector is that it gives complete control over the method implementations. This means you can easily implement additional business rules or security functions when retrieving data from external systems.

Example is that the .net  connector is used to fetch data from  an XML file/storage of data.

Hence after you have coded the same using VS2010 where you can connect to any source like XML/Oracle/SQL etc.  you can deploy the same . Now in the SPD  you select .Net Type and then the deployed  BDC connections/assemblies show up in a list and you can select them .



-------------------------------------------

Was trying to create a connection to a  SQL database and the show that as an ext list in my Sharepoint site . the best is thanks to Fabian Williams for his blog :
http://www.sharepointfabian.com/blog/Lists/Posts/Post.aspx?ID=122

 Now what i did was that i missed the ReadList()  Method and  did everything else .
 . So after the publish and deploy etc   was getting the below error when looking for ECT from Site :



No ECT available .Contact Siyte admion .
 I went to the CA and there i could see the  ECT and gave it the perms required for the user concerned.

So i went ahead and created the ReadList() method and bingo  the ECT shows up.



EXTERNAL CONTENT TYPE 
A core concept of Microsoft Business Connectivity Services (BCS) is the external content type. Used throughout the functionality and services offered by Business Connectivity Services, external content types are reusable metadata descriptions of connectivity information and data definitions plus the behaviors you want to apply to a certain category of external data. External content types enable you to manage and reuse the metadata and behaviors of a business entity such as Customer or Order from a central location, and enable users to interact with that external data and processes in a more meaningful way.
For example, consider a business entity such as Customer. You might want to interact with items of type Customer inside a SharePoint list or work on them offline in Microsoft Outlook. Or, you might want to enable the user to pick a customer from a list of customers in an Orders contract document inside Microsoft Word. You can create an external content type once and then reuse it anywhere you need it.
External content types offer the following benefits:
  • Enable reusability An external content type is a reusable data definition of a business entity. After you create it, you can use it with any of the Presentation Features in BCS to provide a rich user experience to interact with external data.
  • Encapsulate complexities of external systems External content types enable information workers to assemble business solutions without having to handle the complexities of the external systems, for example, without needing to know the connectivity information or learn their programmability interfaces. After an experienced user or a developer creates an external content type, it is available to any user for use in any way they need (provided they have the permissions to perform that operation and access the external data). However, the user does not need to know anything about the location of the external data or how to connect to it.
  • Provide built-in Office and SharePoint behavior External content types provide Office item-type behaviors (such as contacts, tasks, calendars in Microsoft Outlook, documents in Microsoft Word, and lists in Microsoft SharePoint Workspace); SharePoint behaviors (such as lists, Web Parts, and profile pages); and capabilities (such as the ability to search or work offline) to external data and services, so users can work in their familiar work environments without having to hunt for data or learn and interact with different (and proprietary) user interfaces.
  • Ensure secure access External content types adhere to the security put in place by both the external system and SharePoint Products and Technologies. You can have full control of who accesses what data by configuring security in SharePoint.
  • Simplify maintenance. Because external content types can be created once and used by multiple solutions in various scenarios, you can manage them easily. For example, you can manage their access permissions and connection and data definitions in one central location.
  • Enable external data search You can use SharePoint Server search from an intranet portal to look up information about a specific external content type such as a Customer. SharePoint Server search retrieves the data directly from the external system. Consequently, users can get the information they need without having to get approval or install a separate application.
  • Enable working offline You can take external content types offline in Outlook 2010 and SharePoint Workspace 2010. Business Connectivity Services provides rich cache and offline work features, and supports cache-based operations. Users can manipulate external data seamlessly and efficiently, even when they are offline or if the server connectivity is slow, intermittent, or unavailable. The read/write operations performed against cached business entities are synchronized when connection to the server becomes available.
 --------------------

all about ONET.xml file :
http://msdn.microsoft.com/en-us/library/ms474369.aspx

2 comments:

  1. Both the .NET Assembly Connector and custom connector are highly valuable Business Connectivity Services connectivity extensibility mechanisms that are offered by Business Connectivity Services.
    The .NET Assembly Connector approach is recommended if the external system is static. Otherwise, for every change in the back end, you must make changes to the .NET connectivity assembly DLL. This, in turn, requires recompilation and redeployment of the assembly and the models.
    If the back-end interfaces frequently change, the custom connector approach is recommended. By using this approach, only changes to the model are required.

    http://msdn.microsoft.com/en-us/library/ee554911%28office.14%29.aspx

    ReplyDelete
  2. http://jardalu.blogspot.in/2010/03/writing-custom-connector-for-bcs.html
    good one for custom connectors

    ReplyDelete