Jul30

Business Data Catalog Read/Write - Screencast

Categories:

Following on from yesterday's blog post we've recorded a screencast to show you how to generate and implement the web parts to edit and create data in your SQL Server line of business system with BDC Meta Man. You can watch it here:

Screencast

This screencast is part of our BDC Meta Man knowledge base which is constantly growing. Click the link below to see what other screencasts we have available:

http://www.bdcmetaman.com/Knowledge%20Base/Home.aspx

 
Jul29

Business Data Catalog Read and Write? You got it!

Categories:

We've been working on BDC Meta Man for little over a year now. Along with the first release I think the feature I can show you today is just as exciting! I've always known that being able to write back to a business data catalog source was possible, but finding the time to create the new functionality was the reason for it taking so long. I also wasn't 100% sure that Microsoft would want us to make the BDC 'writeable' as in most presentations I'd seen they always say it's a read-only solution. Well if you dig into the SDK it is possible to find that they don't mind it being a write back solution:

"GenericInvoker methods are extremely useful if you are writing a custom Web Part that must invoke logic in a back-end system, because the Business Data Catalog takes care of all the authentication, authorization, and other security requirements."

I'd already hand written some web parts and application definition files so I knew it would only be a matter of time before we put this functionality into BDC Meta Man. Well we've done it! And we're releasing it today as BDC Meta Man version 2.0.0.1 Beta!

Here below is a walkthrough of how to create a read-write scenario with MOSS 2007 and the Business Data Catalog without writing a line of C# whatsoever. A few notes though before you read any further:

  • This release of BDC Meta Man will only generate the write stuff for SQL server tables. We're working on the other data sources as we talk but wanted to get SQL server out for people to use (Oracle will be next, then Web Services).
  • We only generate web parts for insert/updates at the moment. InfoPath forms and Web Services will be coming in the future though!
  • The web part code generated is C#. Soon we'll have an option for both C# and VB.NET.

Ok with those notes out the way let's get on with this walkthrough!

Open BDC Meta Man in the usual manner and connect to your database. For this example we'll use AdventureWorks2000. We've dragged and dropped the Products table onto the design surface:

Right click on our Product entity on the design surface and pick 'Edit Entity'. On the first screen of Entity Admin select a title column from the drop down:

Notice along the top we have a new tab for 'Write Back'!! J Click on this and you'll see this is where we configure what fields we want to be able to update and insert. Check top checkbox so that web parts get generated for this entity, and then select the fields you want to be able to insert and update. Please note that the identifier fields for the entity are not visible. This is because we presume identifier fields are auto generated at the database level when inserted, and shouldn't be changed as part of an update.

When we are updating a Product, the web part we generate will be looking to get the ID of the entity from the pages URL query string, eg pages/editproduct.aspx?ProductID=139. So on this page we'll be editing the Product with the identifier 139. We can create a custom action so that the BDC List Web Part has a drop down action that will navigate us to the correct page to be able to edit the record selected. To do this go to the Actions tab of Entity Admin and click on 'Create Custom Action'

Notice the Action Parameter we added was ProductID and the url has the value {0} in it. {0} represents where the ProductID value will be slotted in. The page editproduct.aspx we will have to create shortly and this is the page we add our edit web part.
Once you have setup your Custom Action, close the Entity Admin box by clicking save. Now before we generate our application definition file and web part code there are a few settings we need to do. From the main menu click on Configuration -> Settings…

As usual we have to set the path to where we want our Application Definition file to be generated, but now we can also set a folder for where we want our web parts to be generated, and also a namespace for the web part classes.

Once you have set those chose Build -> Generate All, or the Play button in the top left of the BDC Meta Man screen to generate your Application Definition File and also your Web Part project and classes.

Upon messages saying you have been successful lets go and take a look at our web part folder and see what we have…

As you can see we generate the solution file, class project, web part files, and even the ddf and setup.bat files for you to be able to create a WSP and install it. There is one thing we need to do however and this required Visual Studio 2005. We need to add to add a strong name key file so we can strongly name the assembly. To do this open the project in Visual Studio 2005 by double clicking on the .sln file, ProductSolution.sln in our case here. This will open up the whole solution in VS 2005. Then right click on the class file and chose properties. At the bottom of the vertical tabs you will see one called Signing. Click on this and check the 'Sign this assembly' checkbox. Then for the 'strong name key file:' drop down pick New… and give enter a filename such as products.snk and uncheck the password option. This is how it should now look:

Now all you need to do is press F5 or from the main menu click Build -> Build Solution.

Because our project contains some Build Events and a .DDF file our web parts actually get packaged up into a .WSP SharePoint solution file which we can install directly into SharePoint. This WSP package along with a setup file is copied to c:\WSP. Now if you are running SharePoint as the default web site on your machine you can simply double click on the setup.bat file in c:\WSP and it will install all for you. If you need to change the URL of your SharePoint site simply right click on it, and chose edit.

Phew….. so that's our web parts built and deployed and as you can see we've not written a single line of code! We could of course customized our web parts to include some validation etc but we'll leave that up to you for the time being. Now we need to make use of our web parts.

First things first import the application definition file we generated into your Shared Services Administration site.

Once you've done that navigate to the SharePoint application that you installed the web parts to.

I have a site at http://usb-server1/bdc where I want to get this all working. Because of the action we created earlier I am going to add a web part pages library to this site called Pages, and create a web part page in there called editproduct.aspx.

Once that page is created edit the page and click 'Add Web Part' in one of the zones. Down in the miscellaneous section we'll see our Update Product Web Part (kindly generated by BDC Meta Man J)

Click OK to add this web part. Now you'll be taken to an error page, don't worry this is expected! This is because the url does not have the query string value in it that we need! If we edit:

http://usb-server1/bdc/Pages/editproduct.aspx.aspx?PageView=Shared&DisplayMode=Design

To

http://usb-server1/bdc/Pages/editproduct.aspx.aspx?ProductID=8

The page will load fine and you'll see the product information you can edit. We shall put some better error handling into the next version so the error page does not get displayed.

Now if we go back to our subsites default.aspx page, we can add a Business Data List Web Part onto it and set it to look at our Product Entity. When this loads ok if you click the action drop down, and Edit Product item, you'll be taken to our editproduct.aspx page with the correct ProductID added to the query string.

Create a addproduct.aspx page and put the Add Product web part on there and you'll also have a page for creating brand new records!

A couple of further things to note at this time:

  • The web part .dll gets installed into the GAC which will give it full trust. We shall cover in an upcoming post how to not do this with code access security. It will take more manual work however.
  • Currently every field will be filled in as a textbox. This includes things such as dates and Boolean values. We're doing some work now to allow you to select which type of control gets rendered for each field.

OK so you've read all of this, and now you want to try it! Head over to the BDC Meta Man site then and download version 2.0.0.1 beta.

The very final thing I want to let you know is that this functionality is currently available in the free Developer version of BDC Meta Man. It is likely however that in the next version it will be available for Professional users only! You have been warned! J

If you have any feedback/ideas/bugs please either email us at support@bdcmetaman.com or fill in a bug case here:
http://support.lightningtools.com/

Enjoy!

 
Jul23

BDC Meta Man version 1.2.0.12 beta released

Categories:
woops, forgot to actually post on here that we'd released the next version of BDC Meta Man on Wednesday last week. It has been around a month since our last version and we're happy with what we've accomplished so far. Here's a list of bits we covered:
New features:
Open SQL Server and Oracle application defintion files (web services will be next version)
Much improved UI for creating web service entities
Bug Fixes:
Improved UI messages when editing Stored Procedure entities
Allow setting of username and password for SQL account access by BDC
?wsdl warning when connecting to Web Services
General Web Service bug fixes
Actions for stored procedures
 
I'm working hard all next week on an exciting new feature you'll hopefully be able to try next week. Once I get further down the line I'll post a teaser screenshot or two :-)
 
Jul17

BDC screen cast teasers

Categories:

I usually record and post the screen casts after we've done the release of BDC Meta Man but this time I couldn't wait. Here are links to the new ones we'll be posting in our Knowledge Base soon.

Improved UI for create application definition files for Web Services

Opening previously created application definition files!

The new release of BDC Meta Man will be out later tonight where you'll be able to make use of this functionality (if you're a professional user). I'll post a separate blog entry here when it's up…

 
Jul16

SUGUK Meeting – July 26th, London

Categories:

I've not posted about the last few SUGUK meetings on here due to general abuse of my blog but the one on the 26th is going to be a good one! We're hosting it at Microsoft's new offices at Victoria so if nothing else you can come for a nosy around there J

We've got three presentations this time rather than the usual two so it's going to be a full evening of SharePoint. Presenting are:

Steve Smith – Capacity Planning

Penny Coventry – SharePoint Designer

Stephen Cummins – Managing SP 2007 platform

In case you haven't noticed they are all SharePoint MVPs! And with Andrew Woodward and myself also being in attendance there will be at least 5 MOSS MVPs for you to aim your questions at!

If you want to come please pop over to the SUGUK meeting thread and reply with your full name:

http://suguk.org/forums/thread/4015.aspx

 
Jul15

At last an update…

Categories:

I think it was my New Year's resolution to write one blog post a day, but I'm falling badly short of that at the moment. Hopefully BDC Meta Man customers appreciate it though as I'm putting all my time into that at the moment, both in terms of new features and bug fixes and also screen casts for our knowledge base. I'm definitely going to get back to writing some interesting content on here though so keep subscribed!

I usually go sailing with my family in the summer somewhere around Europe but have ducked out of it this year. I think you only get a couple of opportunities in your life like I have been given with BDC Meta Man and Lightning Tools and plan to certainly make the most of it.

Some cool news at home! We've now got two little kittens running around our house. I wanted to call them Share and Point but Sophie wouldn't let me so we've settled on Carragher and Fluffy. They are great to have around the house and a really good way to relieve stress when you need five minutes away from the keyboard.

I finally got persuaded to register on Facebook. Feel free to add me as a friend if you want. It's been quite useful to get in touch with pals from school but I can see it could turn into a real time waster if you're not careful.

Speaking of time wasting, you should check out the Hanselminutes podcast interview with Tim Ferriss. He's written a book called the Four Hour Workweek, it's all about focusing on things that matter. One great line from his interview with Robert Scoble was 'Are you being busy, or productive?' Productive is obviously much better so I've been trying to close Outlook and Messenger to during periods of the day to see how I get on. It's dam difficult though. I've ordered the book anyway from Amazon US as it doesn't seem to be out here in the UK yet.

Anyway I'm back to working on BDC Meta Man to get it ready for a new release tomorrow. I'll post again this evening…..promise J