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


Is it Code? – A Rant, Response and Example of Social Media’s Reach
June 5, 2010, 1:08 pm
Filed under: Cutomisation, Rant

First up a warning! This will appear to be post that has no purpose, meanders a little, and probably has no actual conclusion (also I use all sorts of weird colloquialisms). Appearances are often correct! I didn’t plan to write it but felt compelled to in response to some effort put in Jim (@dullroar) and Raymond (@iwkid). Honourable mentions to Marc (@sympmarc) for his championing of the ‘middle-tier’ (oh brother flames and brimstone await me for the use of that term) and Mark (@mrackley) for tackling a similar question previously. Ok, ok enough with the setup; let’s get on with the show…er post.

I asked what I thought was a fairly innocent question on twitter the other day but is anything ever innocent or innocuous when “thrown” out onto twitterverse or the interwebs? I was trying to validate the use of “codeless” when describing certain types of SharePoint solutions.

nickhadlee Poll: Is #XSL code? In the context of a ‘codeless’ solution 🙂 [Feel free to RT]

Why? Was I trying to deliberately rile people and get into some sort of tit-for-tat twitter banter going? No – absolutely not. The context of the question was aimed at what an end-user might consider code. A typical end-user might not even know what XSL is so the point is possibly moot. Really at the heart of my question was to define what we can call a “no code” SharePoint solution. I am a big fan of using the “no code” moniker and to quote Jim it is "probably more related to business politics rather than technical reality".

So what sort of response did I get? It started off pretty tame.

iwkid RT @nickhadlee: Poll: Is #XSL code? In the context of a ‘codeless’ solution <– I consider it "no-code" in that it is not managed/deployed

kennethprice @nickhadlee I think xsl is within boundaries of codeless solution.

Off I went to bed thinking that was that. 3-0 to the “it’s not code” camp and the “codeless” term can be applied liberally. Hmm that’s what I thought. Overnight Jim and Raymond decided to put pen-to-paper and expand their thoughts on the topic past the 140 character limitations of twitter:

dullroar @nickhadlee @iwkid @sympmarc My (long) answer to the poll: http://ping.fm/aziFn

iwkid @dullroar @nickhadlee @sympmarc @EUSP My response 🙂 http://www.iwkid.com/blog/Lists/Posts/Post.aspx?ID=82

Not to mention I irked Marc a little. Marc and I chat a bit on the interwebs so I knew the responses were all in good humour (I think…Marc we still talking???):

sympmarc RT @nickhadlee: Poll: Is #XSL code? -> You know my answer to this one. Is English not a language because lots of people speak it?

sympmarc @nickhadlee Is Druidism not a religion because it contains little spiritual duality?

sympmarc @nickhadlee Ok, that’s enough for me. Goodnight, Gracie.

For me Jim’s post pretty clearly sums up why XSL is indeed code. Based on Raymond’s response I think we both now admit our initial NOs were really a bit premature! If you’re still reading then I do congratulate you on persistence…now would be a good time to pull out some high-school-essay-style argument backed up with evidence. Not quite yet – I am quickly going to mention that there were other RTs (that’s a retweet for the twitter uninitiated. Twitter…what you mean that twitter-the-complete waste of time social-media-thing-ma-bob? No I don’t mean that. I mean twitter-the-extended-SharePoint-community-reach-out-tool. Sorry got a little preachy there!). One that I think is worth a mention was from Mark Miller (@EUSP) over at EndUserSharePoint.com. Why? Because if you work in the “no code” world then please check out the site as its one of the better resources for that kind of stuff:

EUSP RT @sympmarc @dullroar: @nickhadlee @iwkid @sympmarc http://ping.fm/aziFn -> Is XSL code? <- Critical discussion for EUSP authors.

Ok so I think I need to wrap this baby up so here is where I stand on the matter.

Do we need a label like “no code” or “codeless”? Does this all really matter or is it just semantics? No I don’t think it matters, not really. It seems easier to brand something ”no code” to make it easier to sell the idea to people that we are using the SharePoint platform more extensively instead of needing to deploy some heavy code-based customisations (By the way I like code – I even write some occasionally!). Are “no code” solutions any less risky or a lower impact option than deployed DLLs?…..NO! That would be a massive half-truth/un-truth/fallacy/plain-old-lie. I have seen Data Views, JavaScript and other “codeless” options bring pages and sites to their knees just as well as any dodgy code can.

Answer the question Nick! Is XSL code? I’d have to say (now) yes it is, thanks again Jim! Do we need a name for this so called “codeless” middle tier? Hmm, probably not but the debate will rage on for a bit yet…bet you a fiver! I think Marc Anderson said it best (not exactly like this but close enough).

“Does it really matter how we get to the solution? It’s satisfying the business requirement that matters most!”

Now I think I have come to the end of my diatribe. I’m not sure if I went anywhere but I at least feel I spent as much time as Jim and Raymond on a response. It has made me think I need to do a post on why I prefer using “codeless” techniques whenever possible but that is definitely a post for another time. Feel free to hit me up on twitter or leave a comment if you find any of this contentious/a further pollution of the internet or whatever. It’s really just the ramblings of a confused and simple mind!




%d bloggers like this: