BDC Meta Man – Getting Started

Here we’ll cover creating two entities with BDC Meta Man, editing them, creating an assocation, and then generating the application defintion file.

This walkthrough is also available as a screencast that you can click here to watch

After creating our application defintion file we’ll import it into Microsoft Office SharePoint Server (MOSS) 2007, add a Business Data List and Business Data Related List web part to a page, and configure them to work together.

For this walk through we are going to use the AdventureWorks2000 sample database that is available from Microsoft here:

http://www.microsoft.com/downloads/details.aspx?FamilyID=487c9c23-2356-436e-94a8-2bfb66f0abdc&DisplayLang=en

Generating our Application Definition File.

Open up BDC Meta Man on the PC you want to work on (it doesn’t necessarily need to be the MOSS server). To connect to SQL Server click the drop down arrow on the ‘Connect to data source’ button in the top right of the screen and choose SQL Server.

Choose which data source to connect to

In the ‘Connect To Data Source’ box enter the name of your Server and SQL Server instance if necessary, and select the Authentication mode. If you are using SQL Authentication you will also have to enter your SQL user account details.

Choose the authentication mechanism

Upon successfully connecting to SQL Server you’ll see the top window of BDC Meta Man populate with a list of databases. You can expand each database to see the list of tables by clicking the plus sign next to each database name

BDC entities can be created from all these tables

Now we can see listed all the tables for this particular database. With BDC Meta Man we think of each table as being its own entity. We create an entity by dragging and dropping a table onto our design surface which is the large grey area to the right.

Drag a table to create an entity

Upon dragging and dropping the table, the entity is created with the Finder and SpecificFinder methods. You can see a view of it on the design surface with the fields listed that are returned by the Finder method. For this walk through drag the dbo.Department table across

The BDC entity and all the methods you need will be generated.

When you have two entities that have a primary key->foreign key relationship between them you can create this relationship as a BDC association. This will allow us to make use of the BDC Related Data web part. To add an association, drag and drop the dbo.Employee table onto our design surface to create an Employee entity. You can create an association simply by dragging and dropping between the fields that are related. With our two entities it is the DepartmentID of the Department entity, and DepartmentID of the Employee entity. Drag and drop from the Department entity DepartmentID to the Employee entity DepartmentID

Drag and drop between your two related fields to create a BDC association

Doing this drag and drop creates the association for us, and any methods required to bring data back for the BDC Related Data Web Part.

Now all we need to do is generate our application definition file. First we need to set the path to save the file. We set this location by going Configuration -> XML OutPut File from the main options. In the Filename textbox you can either manually type the location and the filename or use the browse button

Configure where to generate the XML file.

Once you have saved the filename and path to create your application definition file to simply click the green play button and your application definition file will get generated.

Hit the play button to generate

Once generated you get the option to open the XML file in your registered XML editor. If you click yes it’ll probably open it up in Internet Explorer for you to view. Look how much XML it has generated for you!

All the BDC XML that is generated for you!

Importing our Application Definition File.

Remember the Business Data Catalog is only part of MOSS 2007 Enterprise Edition. You can download a trial of MOSS 2007 Enterprise Edition here:

http://www.microsoft.com/downloads/details.aspx?FamilyId=2E6E5A9C-EBF6-4F7F-8467-F4DE6BD6B831&displaylang=en

Once installed and correctly configured we need to import our application definition file.

Open up MOSS 2007 Central Administration by either browsing to it or through the start menu on the server running MOSS 2007 – Start -> All Programs -> Microsoft Office Server -> SharePoint 3.0 Central Administration.

Navigate to the Shared Service Provider Administration (SSP Admin) page from the left quick launch menu

Click on the Shared Services link in Central Admin

In the SSP Admin page you’ll see a whole section devoted to the BDC. Click on ‘Import application definition’.

In the Business Data Catalog Section, click to Import you file

Use the browser button to locate our application definition file, or type in the path and filename yourself. Leave all the other options as they are for the time being, and click ‘Import’

Browse to where we saved the XML

MOSS 2007 will now go through and validate your application definition file is correct, once it is done you will get a success page. Clicking past that you will see the administration page for the BDC application we just imported

View and change BDC security and settings on the application page

Using our BDC application in MOSS 2007

Browse to the page where you want to add the Business Data Web Part and edit the page. Click ‘Add a Web Part’ button to display the web part gallery.

Add the BDC web parts to you SharePoint Page

Scroll down to the ‘Business Data’ section and click the checkboxes for the ‘Business Data List’ web part and the ‘Business Data Related List’ web part. Click the ‘Add’ button to add the web parts to our web part zone. Once the Web Part Gallery form disappears you’ll see the two BDC web parts added to our web part zone. Now we need to configure them. First the Business Data list, click the ‘Open the tool pane’ link to open the web part tool pane down the right hand side of the screen.

Configure the BDC web parts

We need to select what BDC entity our BDC data list is going to display, to do this click on the Browse button.

Choose the entities you want to display

From the pop up window select our dbo.Department Entity and click OK. Then Click OK at the bottom of the Web Part Tool Pane to configuring this web part.

Now we need to configure the BDC Related List web part. Again click on the ‘Open the tool pane’ and select the dbo.Employee entity from the Browse button as you did for the Business Data List. You’ll see when you have selected the Employee entity the relationship drop down is populated and selected with our relationship method. If our entity had multiple association methods this is where we’d select which one to use.

Setup the association method

Click ok to close the web part tool pane. The final configuration step we need to do is to connect the web parts together so when a Department is selected, only the Employees for that department are listed. To do this click on the small edit button for the Business Data Related List web part and go:

Edit -> Connections -> Get Related Item From -> dbo.Departments

Connect the two web parts together

And there we go. We should now be able to bring back all the Departments by clicking on the ‘Retrieve Data’ button on our Business Data List. Upon selecting a department from the returned values the Business Data Related List will bring back the employees for the selected department.

Now you have a working BDC example!

We hope this walkthrough was useful to you. If you have any questions feel free to email them to support@lightningtools.com.