Archive for April 30, 2010

Introducing SQL Server Master Data Services – Submitting Entity Members via WCF Services

Yes, yes, the Master Data Hub makes creating a new member simple and straight-forward, but if you are a developer like me, you want to dive into the WCF services and write some code. Right? Right.

There are some good resources on the topic out there for creating your first integration project in Visual Studio.

MDS Team: http://sqlblog.com/blogs/mds_team/archive/2010/01/29/creating-entities-using-the-mds-wcf-api.aspx

IT Mentors: http://www.msdev.com/Directory/SeriesDescription.aspx?CourseId=155

I wanted to take this a step further and actually create a customer member in the Customer sample model.

First, I created a simple screen for connecting to the .svc endpoint – simply did not want to hard code the value.

clip_image002

The code for setting up the endpoint is the same for other WCF clients. The important piece is the location of the .svc file, which is located under the MDS site you created in Configuration Manager, under service/service.svc.

Note: the service has a ServiceCheck method which effectively pings the service to ensure we are up and running.

clip_image004

OK, you have your service client now. Let’s create a new Customer. The Customer model has a few Required Attributes – what this means is that the member will fail to validate when the business rules are run against it: however, you can still add the member. All you need, in fact, is a code (you don’t even need a name). That said, in this example, I choose to provide the capability to set Code, Name, Address and Customer Status from a single call to the service.

First step is our using statements. I like to shorten the long namespace. Also, we will use Collections throughout.

clip_image006

Next, let’s get the model and entity to which we want to add the new member. We can do this by using the MetadataGet method on our ServiceClient object. There are a few things to note here:

1. The ResultType enumeration allows us to limit the result set to just the identifiers for these objects. We only need the identifiers for Model, Entity and Version.

2. The SearchOption enumeration allows us to limit our search to User Defined objects

3. We find the Model and Entity by name. There is only “VERSION_1” currently, but this would be a good thing to add later.

clip_image008

If we did this right, we should now have only one model, entity and version each:

clip_image010

Now, we need to collect in the information entered by the user on the screen and construct our new member and attributes. This is somewhat painstaking, but it allows us to make one big call to the service endpoint, rather than a set of calls in sequence.

clip_image012

Additional Attributes have been elided for brevity.

Finally, we add the attributes to the Member object, transform the Member object into an EntityMember object (using our criteria from earlier) and submit the data.

clip_image014

I’m looking forward to trying this approach from InfoPath clients, SharePoint web parts and with BizTalk Server.

Day 5 – Tag Profiles

I promise, last post on Tags… So, the tag profile is basically a special page that provides a virtual community around a specific keyword. It includes a list of items that have been tagged with a particular term. The items can come from different lists and the actual individuals that tagged the item are displayed. Finally, an individual can follow the tag on their personal newsfeed.

 

So, what’s the business benefit? Again, any of the benefits of tags come forward here and are still valid. Taking it a step further though, this approach is almost like a refined search that’s tag based. One of the most challenging things as a SharePoint architect is defining the information architecture. In this case, perhaps no one conceived of creating a document library called “Advertising” and they didn’t think of creating a content type called “Advertising”. Now, the power is in the hands of end users to define content and in this case they’ve identified that “Advertising” is a term that has relevance and allows someone to, in essence, build a virtual document library. It’s empowering the end user to structure their content in a way that suits them and their colleagues best.

As a partner with BlumShapiro Consulting, Michael Pelletier leads our Technology Consulting Practice. He consults with a range of businesses and industries on issues related to technology strategy and direction, enterprise and solution architecture, service oriented architecture and solution delivery.

Day 4 – Tag Cloud

Yesterday we talked about Tags and Notes. That topic leads naturally into the Tag Cloud. If you’ve ever published a blog or visited someone else’s you’ve probably noticed something called a Tag Cloud. A Tag Cloud is essentially a visual way to represent the relative number of posts someone has made that reference that tag. So, for example, if someone has posted three articles and tagged them with the word “Marketing” and tagged one article with the word “Sales” then they would have a two word tag cloud with the “Marketing” tag being displayed in a larger font (indicating more posts) than the “Sales” tag. You can see the Tag Cloud web part in action on the site pictured below showing the relative size difference between sales and marketing.

So what can you tag? Well, a page of course, since it is a document at the end of the day, list items, documents and external pages. You can apply “managed keywords” to almost any list item or document by default. In SharePoint 2007 you had Title as really the only default user editable column on a list. Now, Manage Keywords is included for just this purpose.

Depending on where you place the Tag Cloud web part it will either serve as a navigational tool or allow you to filter results. So, for example, if you had it on a page that was listing several documents you could simply click on one of the terms and filter the results from the list so that only the ones tagged with that term are presented. When you tag an item SharePoint presents a list of suggested tags that were either already used or seeded by an administrator to help with organization and so that you avoid having a term like “Policy” and “Policies” and splitting up content. The idea is that you’d see someone already created a term and you’d reuse that.

The value of this feature is in making the investment in tagging content pay off so that it’s easy to see what most of the content is about (Advertising in the above image) and makes it easy for users to navigate or filter tagged content.

As a partner with BlumShapiro Consulting, Michael Pelletier leads our Technology Consulting Practice. He consults with a range of businesses and industries on issues related to technology strategy and direction, enterprise and solution architecture, service oriented architecture and solution delivery.

Day 3 – Tags and Notes

I didn’t really have a plan to focus on one particular area of functionality, but since my last feature was “I Like It” and the “Tags and Notes” button is right next to it…

A tag is like a keyword and is used to help classify and organize information. If you’ve ever managed or uploaded digital pictures you’ve probably noticed an ability to tag those pictures with something like “Beach” so that years after many trips to the beach you could simply click on the keyword/tag and see all the pictures you had taken from your various trips to the beach. All of the information created every day in your business is like one of those digital pictures. Having the ability to create your own personal classification system that sits alongside SharePoint 2010s taxonomy provides you and your colleagues (if you allow it) to sift through the mountains of lists, documents, sites and pages in a more meaningful way.

So how is this useful in a business setting? Much like yesterday’s example where we leveraged the “I Like It” tag to find any content that a given user likes we can use tags to provide a more refined way of finding that content. So, if our employee who had 4 hours yesterday wanted to focus his efforts on just sales or marketing information then looking at content tagged as such might provide him with a leg up.

As a partner with BlumShapiro Consulting, Michael Pelletier leads our Technology Consulting Practice. He consults with a range of businesses and industries on issues related to technology strategy and direction, enterprise and solution architecture, service oriented architecture and solution delivery.