The sn:SenseNetDataSource is here!

I am really excited to announce that today -as part of the Beta5 marching- we checked in the SenseNetDataSource feature.

With this new ASP.NET DataSource you can use the Sense/Net Content Repository with the rich set of DataBound controls  provided by Microsoft and other vendors (like GridView, ListView or Form) to produce more in less time using the data driven, rapid application development approach.

Also, the SenseNetDataSource (and some other controls I’ll tell you about later) makes it easier for you to build declarative solutions, that are easier to maintain, as much of the scenarios that in previous Betas needed coding now can be developed without a line of code – as long as we don’t consider writing html tags coding :).

So here is how it works: of course the way you expected it. You place a SenseNetDataSource object in the markup (you can do this from code of course) and link it to a DataBound control - GridView in our example.

image

The ContentPath attribute specifies the Content (typically a collection) we are interested in. MemberName is optional, and its default value is “Children” – so the default behavior is to list a content’s child items. You can also target reference properties with the MemberName attribute if the content has any (like “Related Articles” can be a reference property defined on an Article content type).

The result is as might expected to be:

image

Beyond accessing simple collections of the Content Repository, the SenseNetDataSource can also provide an easy access to the ContentQuery functionality. Setting the Filter, OrderBy and GroupBy attributes will help you to define your query expressions on an easy, declarative way.

But wait! Haven’t I seen Eval and BoundField there? So all these new stuff now needs C# classes and so? Do I have to define my content types in CODE NOW????

 

Wait, no! Not at all! Quite the contrary: the best thing is that all these data binding magic works with the Content Types you created as Content Types Definitions – mere XML data. This is a really really important thing: with Sense/Net 6.0 your are able to define data types – content types we call it – dynamically and then your are able to treat instances from them as strongly typed, bindable data entities.

Here is how it works:… But now I really must be going home :) I’ll finish this today, so stay tuned.

Comments (3) -

Tom
12/1/2009 11:57:15 PM #

Great post. I can not wait for the release! Smile Seriously, we are preparing some good stuff for end-users, business alanysts and coders, too. Stay tuned folks.

Gergely Orosz
12/3/2009 11:24:56 AM #

Looks like this solution integrates nicely with the ASP.NET data binding concept. Two small comments:
- As a C# developer I'm surprised to see Eval() being present. I'll probably peek in the source to see what that does, it's something I've only used in Javascript / JScript Smile
- In the example you're binding a content. This looks good but I'm suspecting end users will be wanting to use custom queries 80% of the time. If they could define them in the aspx, now that would be really cool. Based on this example users can already define smart folders an list children of the results.

Anyhow, this feature looks really promising both from a developer and a site builder perspective!

Peter Zentai
12/11/2009 11:10:50 AM #

Hello Gergely,

Thanks for your comments, let me have some corrections on what you wrote:
1) Eval() is the standard ASP.NET databinding function, along with Bind(). Smile Refer to the ASP.NET documentation, there is nothing jscripted around it.

2) the SenseNetDataSource is capable of executing ContentQueries, quoting myself here:
"Beyond accessing simple collections of the Content Repository, the SenseNetDataSource can also provide an easy access to the ContentQuery functionality. Setting the Filter, OrderBy and GroupBy attributes will help you to define your query expressions on an easy, declarative way. "

cheers
Z

Comments are closed

Welcome to the blog!

Sense/Net ECM is ever evolving. Community means the world to us so we want to keep you apprised on what’s happening on our side of the woods. Want to make us happy? Add a comment and tell us what you think!

Month List