Jaap Vossers' SharePoint Blog

Just another WordPress.com site

Archive for the ‘SharePoint’ Category

A developer’s thoughts on the Microsoft SharePoint Conference 2009 in Las Vegas

with 5 comments

After having attended the Microsoft SharePoint Conference in Las Vegas last week, I decided to write a blog post in which I will summarise my thoughts on SPC09 and SharePoint 2010 from a Developer point of view.

The majority of the sessions I attended were developer-oriented sessions.  There are so many new promising features that will greatly increase developer productivity.  I seriously can’t wait to start my first SharePoint 2010 project!

Let’s just walk through some of the new features that I think are most promising.

Client Object Model

The Client Object Model is a richer alternative to the already existing SharePoint web services. Before SharePoint 2010, anyone writing code that would run somewhere else then on the actual SharePoint server could not use the Server Object model but instead had to rely on using the SharePoint web services.  If you knew how to use the Server Object model, that didn’t necessarily mean you knew how to deal with the web services, since they are so different!

SharePoint 2010 Introduces the Client Object Model which comes in three flavours: Javascript, .NET CLR and Silverlight. It basically means that your code can call into the Client Object Model, which exposes a programming interface that is very similar to the Server Object model programming interface. The idea is that you can apply your knowledge of the Server Object Model to the Client Object Model.

I am particularly looking forward to using the Javascript Client Object Model, combined with jQuery. Any half-decent developer will now be able to build rich, AJAX-enabled UI’s in SharePoint 2010 without too much effort.

REST API

The REST API is another feature that will simplify the process of consuming data from client applications by exposing a very simple HTTP based interface. It basically allows you to fetch or update/insert/delete data in SharePoint. You can specify what data you want to work with by constructing a url that SharePoint understands. The url will include parameters for the web, the list and possibly a filter that SharePoint will use to scope the operation to. If you are simply performing a fetch of the data, the server will return XML or JSON (depending on what you asked for by adding the right HTTP header to your request) for you to consume in your client application.

Again something that will be very useful in a javascript client, with or without jQuery, as you can perform AJAX requests in the background to fetch or modify data. Fetched data returned as JSON can easily be converted into javascript objects for further consumption in your javascript code.

For .NET clients there is a thing called ADO.NET Data Services which allows you to create DataSources that point to a REST url, which can then be used as the DataSource for databound controls. One of the sessions at SPC09 demonstrated how easy it is to set up a grid with insert/update/delete support, simply by binding it to such a datasource. Amazing!

SPMetal + LINQ

Cool! Now you won’t have to write those pesky CAML queries anymore AND you won’t have to access SPListItem field values through an indexer that returns an object that isn’t strongly typed – which in turn means that you don’t have to perform any casting anymore. Querying is now done via LINQ, which I am sure you have heard of before. You can actually perform inner joins in LINQ allowing you to use only one query to return all Employee items where Employee.Company.CompanyName == “Microsoft”. In SharePoint 2007 you need to perform two separate queries to achieve this. I am curious how this works under the hood. My understanding is that your LINQ query is translated to a CAML query which is then executed. If that’s true then presumably they have extended the CAML query schema to support JOINs. Does anyone have an answer to this?

SPMetal is the commandline tool that generates the classes to support LINQ Querying and strongly typed access to properties of an SPListItem.

Business Connectivity Services

This is the replacement for Business Data Catalog. It allows you to write data access code which can be used to connect alternative data source to SharePoint lists. SharePoint users won’t even notice that the “list data” they are working with is in fact stored somewhere else.

I really hope my code can access this external data as if it was contained in a standard SharePoint list, for example by using the SPList and SPListItem classes or performing LINQ queries. Does anyone have an answer to this?

Developer Dashboard

The developer dashboard helps developers with identifying poorly performing code by having diagnostic information related to your current request printed on the page. It is similar to the ASP.NET trace information, but more SharePoint-specific. It prints processing time for Web Parts (allowing you to instantly spot which one is causing the page to be so slow) and even processing time for the underlying Stored Procedures that are executed by SharePoint!

PowerShell

PowerShell is the new STSADM for SharePoint. Microsoft has invested heavily in PowerShell support for SharePoint by providing hundreds new SharePoint-specific Cmdlets! Looks very promising. I have this PowerShell book somewhere – I think I will pick it up again soon!

Visual Studio integration

Visual Studio 2010 integration for SharePoint 2010 development has strongly improved. I must say that for some reason I had assumed Microsoft would provide this level of integration when MOSS 2007 came out a few years ago (wishful thinking), but unfortunately we’ve had to depend on third party tools like WSPBuilder to produce our deployment artifacts. I guess it was necessary for us to go through this pain in order for us to be able to appreciate what’s coming our way now!

Custom Service Applications

There is no such thing as an SSP in SharePoint 2010. Instead there is a collection of Services Applications, to which you can add your own custom Service Application. The main focus lies on scalability – it supports load balancing and you can decide which servers in the farm will run your custom Service Application.

It is very important to plan properly and decide whether a custom Service Application is the right solution to your problem. Developing custom Service Applications might well be the most complex subject within SharePoint Development.

Written by jvossers

October 30, 2009 at 1:09 pm

New version of SharePoint InlineSiteSettings released (javascript only)

with one comment

SharePoint InlineSiteSettings is a tool which I originally released several months ago. It provides a quick way to access your Site Settings in SharePoint; it allows you to pop up the Site Settings of the current site – triggered by a keyboard shortcut – without navigating away from the current page. InlineSiteSettings uses jQuery to power its AJAX functionality.

After I was hinted by Jeroen Ritmeijer from Muhimbi that a javascript only version of SharePoint InlineSiteSettings (the previous version was implemented as a serverside WebControl spitting out javascript) would work very well with their free SharePoint Infuser product, I started my investigation and ended up implementing a new version of SharePoint InlineSiteSettings! I am quite pleased that it is now a very compact solution compared to it’s previous release.

You COULD use the new version SharePoint InlineSiteSettings without Muhimbi Infuser by pasting the script into a Content Editor Web Part on each page where you want to enable the SharePoint InlineSiteSettings functionality, BUT to be honest, this doesn’t really make sense and it would be very time consuming. What we really want is a solution that allows us to inject the script on every page and configure it only once. This is where SharePoint Infuser comes into play.

Please try it out and let me know your thoughts!

Download SharePoint InlineSiteSettings 1.2 from CodePlex

Written by jvossers

September 20, 2009 at 8:42 pm

Reusable Content & HTML Snippets

with 3 comments

So your client wants to be able to insert more than just formatted text and images in his Publishing HTML field control? So he wants to insert those fancy looking boxes that your graphics designer made? Ah, but they are variable height and require several background images so we are talking about inserting a bit of “complex” html. How can we provide a user friendly interface with as little customisation as possible? I personally like the out-of-the-box Reusable Content functionality provided by MOSS 2007. I will demonstrate how it can be used to solve our problem.

Let’s take the following box for example:

rc-start

Because of the vertical scaling requirements, the box needs to be split into three logical sections: header, content, footer. The html for the box shown is as follows:

<div class="box">
    <div class="box-header">This is the header</div>
    <div class="box-content">Lorem ipsum ...</div>
    <div class="box-footer">&nbsp;</div>
</div>

The styling of the box, including the background images is done via CSS. The header and footer are fixed height, whereas the content area is variable height and has a background image that repeats in the vertical direction.

Back to SharePoint – when you create a site collection using the Publishing Site Site Definition, you should have a list called Reusable Content in your root web. You can navigate to it using Site Content and Structure. We will create an item in this list that will be a “template” for our box.

Insert a new item into the Reusable Content list. Ensure you have Automatic Update turned OFF. Use the Edit HTML Source on the html editor to paste in the following html:

<div class="box">
    <div class="box-header">[HEADER] </div>
    <div class="box-content">[CONTENT]<div>
    <div class="box-footer">&nbsp;</div>
</div>

The rest of the fields are for you to fill in. Save the item and then approve it (the Reusable Content list has content approval turned on by default).

Now that we have our box html template in place, let’s go to our page that needs to have an instance of the box appear on it. Go to edit mode and locate your Publishing Html Field Control. Click the toolbar button Open a new window to Insert Reusable Content.

rc-insertfromeditor

Select the item that we created earlier and press OK. If everything went well, an instance of the box with text placeholders has been inserted into your Publishing HTML Field control.

rc-inserted1

All there is left to do is to place the cursor in the text placeholders and replace it with the actual content.

rc-inserted2

On a final note, be aware of the risk involved when content editors play around with div elements. I have seen situations where content editors got “creative” and partially deleted boxes, leaving orphaned div opening tags and turning the layout of your page into scrambled eggs.

Written by jvossers

April 19, 2009 at 11:10 pm

TunnelPoint review

with 4 comments

Last Wednesday during the UK SharePint event in London, Daniel McPherson from Zevenseas mentioned their new TunnelPoint service (Beta). I was kind of curious what the fuss was all about so I decided to spend a little time playing with it. I am quite excited and I must say that I love the concept. Let me try and explain how it works.

TunnelPoint is a hosted service provided by Zevenseas. It connects external services (for example SOAP web services) to SharePoint List data in your SharePoint Site. TunnelPoint uses the built-in SharePoint SOAP web services exposed by your SharePoint environment to read and write list data. Really, all you need to do is log in to TunnelPoint using your TunnelPoint account and use the web interface provided to configure which external services should map to which lists in your SharePoint site. Once you have completed your configuration, TunnelPoint will periodically consume the service and update field values in your list. The whole idea being that you do not touch your server and you do not write a single line of code.

tunnelpoint_overview

Currently, TunnelPoint offers several services to connect with, one of which is a Currency Conversion service. I decided I would try that one out. My goal was to have a list of currency conversions in my hosted WSS site, and have TunnelPoint periodically perform the conversion for me based on the latest exchange rates.

I performed the following steps to achieve my goal:

  1. Registered with TunnelPoint.com to get a Beta user account
  2. Setup a SharePoint site within my hosted WSS environment.
  3. Created a user and added it to the owners group of my newly created site
  4. Logged in TunnelPoint.com and registered my SharePoint site by supplying its url and account credentials to be used by TunnelPoint to access the web services of my SharePoint site.
  5. Using the TunnelPoint web interface, I added the Currency Conversion service and configured it to point to the site I registered earlier and configured it to create the list for me.
  6. Manually added list items to the newly created list in my SharePoint site. These list items can be seen as tasks to be processed by TunnelPoint.
  7. Wait for TunnelPoint to operate on my list

This is what my list looked like before TunnelPoint started doing its work:

tunnelpoint_list_before

Now, after a few minutes, TunnelPoint started to wake up and decide it should update my To Amount fields by applying the currency conversion (using the external service) for each list item.

After TunnelPoint did its job, my list looked like this:

tunnelpoint_list_after

It all works like a charm and the fact that I got this to work on my hosted WSS environment where I have limited access to (I can’t even deploy a Feature to it) opens so many doors for so many people.

In my example I only connect to the Currency Conversion service, but Zevenseas offers several other services like, SMS, stock quote, short url and web site preview + more services to be added later.

On a final note, to make TunnelPoint even more powerful I would like to suggest to Zevenseas to provide a generic service, where you can configure a SOAP web service url and define mappings between list fields and web service parameters. That way the pool of services to connect to instantly grows from several, to… a lot more!

Thumbs up Zevenseas!

Written by jvossers

April 10, 2009 at 7:51 pm

Live demo online for SharePoint InstantListFilter

with 5 comments

Not so long ago I posted something on my blog about a tool I released on CodePlex, called SharePoint InstantListFilter.

I have just put a live demo online so you can try it out before installing it.

Go check it out!

Written by jvossers

April 4, 2009 at 1:40 pm

cmd.exe Command History with F7

with one comment

Go and open a cmd.exe window, run a few commands and press F7…

Wow! Nice surprise, I never realised that existed. Very useful when you need to re-run some (stsadm) commands. Apparently it works in PowerShell as well.

cmd

Thank you Dan Lewis.

Written by jvossers

April 2, 2009 at 2:06 pm

Released: SharePoint InstantListFilter

with 26 comments

The latest addition to my CodePlex portfolio is called SharePoint InstantListFilter.

It is an assembly free solution and you can even “install” it by editing the contents of a Content Editor Web Part! So what is it really? It is a javascript based solution that adds filter textboxes to every column of a SharePoint list view (SPGridView) with filter-as-you-type functionality. It uses jQuery to add the textboxes and perform the filtering.

Update: Live demo online

One cool freebie is that you can use it to filter on field types that normally aren’t filterable, like calculated fields and note (multiple lines of text) fields.

instantlistfilter_cropped

Instructions on how to install can be found on the CodePlex site.

Download SharePoint InstantListFilter @ CodePlex

Written by jvossers

March 30, 2009 at 8:40 pm