SharePoint 2007: BDC - The Business Data Catalog
This post is in continuation to a series of blogposts I put up on BDC - the Business Data Catalog.
Table of Contents:
Introduction
In-built Webparts
Lists with Business data type columns
Search
User Profiles
Other custom applications targeting a common runtime object model.
Making it easier to author XML Applications: BDCMetaMan
In my series on BDC, I just got done creating a simple BDC example where I can connect to NorthWind.Customers, and fetch all Customers (entites) that are in a specific city.
Both times, I was warned by my SSP that "Profile Page Creation" was skipped. Well, fear no more because in this blogpost, I am going to extend that very example, so we indeed do end up using Profile Pages.
To acheive this, use the following steps -
Start with the XML Goo you already used here.
Modify the Method "GetCustomers", change the RdbCommandText to this -
SELECT CustomerID, ContactName, Address, City FROM Customers WHERE (City like @City) AND (CustomerID Like @CustomerID)
Change FilterDescriptors to this -
<FilterDescriptors>
<!-- Define the filters supported by the back-end method (or sql query) here. -->
<FilterDescriptor Type="Wildcard" Name="City" >
<Properties>
<Property Name="UsedForDisambiguation" Type="System.Boolean">true</Property>
</Properties>
</FilterDescriptor>
<FilterDescriptor Type="Wildcard" Name="CustomerID"/>
</FilterDescriptors>
Add a new MethodInstance at the bottom of the XML as shown below -
<MethodInstance Name="CustomerSpecificFinderInstance" Type="SpecificFinder" ReturnParameterName="Customers" />
Change the Parameters to as shown below ...
<Parameter Direction="In" Name="@City">
<TypeDescriptor TypeName="System.String" AssociatedFilter="City" Name="City">
<DefaultValues>
<DefaultValue MethodInstanceName="CustomerFinderInstance" Type="System.String">%</DefaultValue>
<DefaultValue MethodInstanceName="CustomerSpecificFinderInstance" Type="System.String">%</DefaultValue>
</DefaultValues>
</TypeDescriptor>
</Parameter>
<Parameter Direction="In" Name="@CustomerID">
<TypeDescriptor TypeName="System.String" AssociatedFilter="CustomerID" Name="CustomerID" IdentifierName="CustomerID">
<DefaultValues>
<DefaultValue MethodInstanceName="CustomerFinderInstance" Type="System.String">%</DefaultValue>
<DefaultValue MethodInstanceName="CustomerSpecificFinderInstance" Type="System.String">%</DefaultValue>
</DefaultValues>
</TypeDescriptor>
</Parameter>
<Parameter Direction="Return" Name="Customers">
...
<Parameter>
Save the XML. :-)
Redeploy the application using the following steps -
Go to the SSP
Click n Business Data catalog//view applications --> Delete the previous application (or you could also version, but I'm gonna be lazy and consistently lazy)
Click on Business data catalog//import application definition
Browse to the Xml Goo as your "Application Definition File", choose to import as a "Model", and hit "Import"
Note - you won't see the "Profile Page Creation skipped" message anymore.
Your BDC application is ready to eat. You can use it in the following manner.
- Go to your favorite sharepoint site.
- Edit a page that accepts webparts.
- Add a webpart called "Business Data List". If you created this site using the Blank Template, you will need to first go and enable this webpart in the webpart gallery (Site Actions --> Site Settings --> WebPart gallery).
- When you add the WebPart, it'd look like this -
- Do exactly that, Click on "Open the Tool Pane" (or you can also "Modify Shared Web Part" under the Edit menu).
- In the tool pane, put in "Customer (NorthWindTraders)" under the "Type" text field. It's better if you use the finder button, so there are no typos. Mine looks like this -
- Hit "OK" at the bottom of the page, and your webpart should look like this now -
- Click "Exit Edit Mode", and type in a City of "London" (or whatever else you please), hit "Retreive Data" and assuming you actually followed all I wrote in this post above properly, you should see results in your BDC webpart as shown below -

- Now, go ahead and EDIT the page one more time. Add yet another WebPart, this time the Business Data Item webpart.
- Click on "Open the tool pane" or modify the shared webpart.
- Specify "Customer (NorthWindTraders)" as the Type of entity you are interested in, but just for fun, don't specify the specific Item. My screen looks like this -
- Hit "OK"
- Now, while still in Edit Mode, "CONNECT" the Customer List webpart, so that it supplies the necessary entity to the Customer WebPart. This is shown as below -
- Now go ahead and Exit Edit Mode.
- Search for customers in a city, and select one of them using the provided radio button. You should see the individual customer now appear on the right side as shown below -
- AWESOME :-)
Now, since you have created a profile page, and implemented a specific finder method, you can now go ahead and start using the BDC data in a custom list.
Also, there is a curious "View Profile" action on the top of the profile. How could you customize that, so you could provide more actions to the end user? This is done by adding custom actions to the entity.