Nick Hadlee's Blog on SharePoint and Other Occasional Rants…


New Zealand SharePoint Conference – Day One Tit-Bits
June 9, 2010, 6:07 pm
Filed under: 2010, NZSPC

The first day of the New Zealand SharePoint Conference is almost over and it has been a really good day with some great sessions and a lot of attendees. I managed to attend a couple of sessions in between being a “booth-babe” and there were some great extra things I didn’t already know that came out. Yes I hear you saying there is a lot of stuff you don’t know…[quiet in the cheap seats!]

SharePoint 2010 has sort of been out for quite some time because the Beta has been available since late last year so this isn’t yet-another-post on SharePoint 2010 and why it will change your life. It’s just a “things I reckon I need to remember” post.

REST and LINQ

I was lucky enough to see Todd Bleeker do his talk on REST and LINQ and for me a lot of this stuff was pretty interesting and a good refresh on things I had read but maybe not seen. So how easy is REST and LINQ to use? Very easy if your Todd! Anyway the highlights from his session were:

List Improvements

The improvements to SharePoint 2010 lists have been highly publicised for some time but its always good to refresh (I know I said I wouldn’t do this but lists are the lifeblood of SharePoint solutions so I’m making one exception):

  1. Relationships – if your using list lookups (the heart of many SharePoint based solutions) you can now enforce the list relationships between lists(lookups). This is either via restricted delete or cascading delete
  2. Joins – you can join lists when using LINQ to query them
  3. Data integrity – because of 1. you now can have proper data integrity in SharePoint lists that have these relationships defined.

Random Internet Explorer Tip

  1. Internet Explorer – Feed Settings to Help XML “Debugging”

    This was a very handy little tip for when you want to check some RSS or REST output via the browser (Of course the browser would be Internet Explorer right?). By default IE will make the data look nice (via a built in XSL stylesheet I assume) but you want the raw XML. How do you get it apart from a view source? You need to turn off the default behaviour in IE via the screenshot below:

    clip_image002

 

LINQ

  1. REST is AJAX’ian and nice and snappy for anything where you want no page post-backs. However if you want to do any aggregation (sums, counts etc) via REST then this automatically means it will be done on the client and that’s not really very efficient. What’s the better way? Do those type of “heavy” operations using LINQ so its all done on the server and then the result can be sent to the client. Ahhh…much better!
  2. A point came up from the audience (it was Adam Cogan I think) questioning whether using LINQ with SharePoint can be dangerous if the very likely situation arises that the underlying structure of the lists change (e.g. a user removes a field). The answer from Todd was yes that’s true and therefore you should couple the use of LINQ with SharePoint content types to ensure the fields that make up the base class created/used by the LINQ will not change!
  3. The DataContext – you make one of these with SPMetal which is a command-line tool provided by SharePoint. The bare minimum that SPMetal needs to work with is 2 parameters. One is the site url and the other is that type of class you want it to output (An extension like .CS or .VB) – seriously that sounds too easy!
  4. If you want to see the CAML generated by LINQ then set the .Log property of your DataContext object to a StringWriter and then you can see the CAML!
  5. The IQueryable interface (which is what the SPMetal generate class  implements) lets you output a List<> with the simple method .ToList() – again too easy!

 

15 Things Every Developer Should Know

Next up was Paul Swider with his 15 things a developer should know about SharePoint. Only 15? No seriously it was a lot of stuff to get through and the tit-bits that came out were:

  1. Start Visual Studio as the Administrator (Run As “Administrator”) if you want debugging to work nicely. This will let you attach to the IIS worker process
  2. Sandboxed Solutions. These were created as a result of developers writing bad code and bringing down the servers/farms. Ha ha I just found that funny enough to post!
  3. A sandboxed solution can be turned into a farm solution by toggling a property in visual studio and redeploying it. Good to know…
  4. The resource governor only works for sandboxed solutions but it would have be a good addition for farm solutions!

There was a question I still need to follow up:

  1. How can you query the term-store and term-sets via a web service? I’m thinking via a DataView web part or jQuery here.
Advertisements

Leave a Comment so far
Leave a comment



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s



%d bloggers like this: