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 describing a somewhat complete business data application definition, that lets you import data from Northwind.Customers. I provided both a Finder method and a specific finder method. In this blogpost, I am going to demonstrate adding custom actions to the various entities on your list.
You already have an action called "View Profile". What if, I wanted to add a custom action, that allowed me to issue a search on live.com for the user?
To achieve this, use the following steps -
- Start with the XML Goo you already used here.
- In the definition for the entity where you want to add the custom action (i.e. under the Customer Entity in our example), right after </Methods>, copy paste the following XML -
<Actions>
<Action Name="Live it!" Position="1" IsOpenedInNewWindow="true"
Url="http://search.live.com/results.aspx?q={0}" ImageUrl="">
<ActionParameters>
<ActionParameter Name="ContactName" Index="0" />
</ActionParameters>
</Action>
</Actions>
- Umm .. thats it ! (Seriously, it is that easy)
As you can see above, the parameter "ContactName" will be substituted at index "0", which is specified as a querystring URL to search.live.com.
Save and 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"
Now go ahead and use the application exactly as I described in this blog post here. and you should see the custom action show up as shown below -
Clicking on that, will issue a search on live.com for "Elizabeth Brown". :-)