Hats off, lads

Just seen the sad news of the passing of Arthur C. Clarke. The world was better for his having been in it, and will not be the same without him.

A great article on handy SharePoint controls

I don’t know about you, but I always mean to gather various bits of knowledge into one place, but just like tidying my filing at home, I never quite get around to it. Fortunately for me, Chris O’Brien is a bit more organised and in my ever expanding blogroll today I saw a great article about really useful SharePoint controls to use in custom pages for that handy bit of functionality.

Taking time to enjoy the scenery

You know, the thing about RSS is that it’s a bit like the advent of the motor car – you miss things. Just as driving around means you don’t get to pass the time of day with folk, or discover that tiny little deli you’d never notice from the road, RSS dehumanises the web.

For example, I subscribe to the blog of my good friend Nick Smith. Since he hasn’t posted about his new redesign, I didn’t know about it. Which is a shame, because I like it – it puts me in mind of Tim Burton’s animations with it’s tendril-like curves.

It just shows that every now and then you need to get out and enjoy the scenery, before it’s not there any more.

Searching SharePoint through an IE8 Activity

IE8 Activities look cool. They’re almost like favlets from where I stand, but they offer a very simple way for users to access online services and pass simple parameters.

I decided I wanted to play, and we use SharePoint heavily here at Black Marble. The obvious thing to do was to create an activity which would allow the user to search for the selected text using SharePoint search.

Activities are defined through XML. Essentially, you give it a name, an icon and define the actions that can be performed. There are execute and preview actions, but the small preview window doesn’t really lend itself to SharePoint search (I tried!).

Here is the xml for our sharepoint search activity. Note that I’ve replaced our hostnames. I called this file SharePointSearch.xml

   1: <?xml version=“1.0” encoding=“UTF-8”?>
   2:   <openServiceDescription xmlns=“http://www.microsoft.com/schemas/openservicedescription/1.0”>
   3:   <homepageUrl>https://portal.blackmarble.co.uk</homepageUrl>
   4:   <display>
   5:     <name>Find in Black Marble Portal</name>
   6:  <icon>https://portal.blackmarble.co.uk/_layouts/images/favicon.ico</icon>   
   7:   </display>
   8:   <activity category=“find”>
   9:   <activityAction context=“selection”>
  10:       <execute action=“https://portal.blackmarble.co.uk/search/Pages/results.aspx”>
  11:         <parameter name=“k” value=“{selection}” type=“text” />
  12:       </execute>
  13:     </activityAction>
  14:   </activity>
  15: </openServiceDescription>

So what does that lot do? Well most of it seems pretty self explanatory. The key to the activitiy is in the section which defines the custom action. That has a url which IE8 will call and a list of parameters into which information is passed. A simple search in SharePoint uses the ‘k’ parameter to pass in the search term, so I have set that here.

So now we have our file, how do we get it into the browser. Well, I copied the xml file into the LAYOUTS folder in the SharePoint installation folder on the hard disk of the server, which is reference via _layouts in a url. I then added a Content Editor web part onto one of my pages and pasted the code to add the action into the source view:

   1: <p>Search Portal easily from IE8 with our custom activity.</p><button onclick=“BLOCKED SCRIPTwindow.external.addService(‘/_layouts/SharePointSearch.xml’)”>Add Portal Search Activity</button>

This simply shows a short paragraph and a button. When the user clicks the button, IE8 asks whether it should install the activity and hey presto, a new menu item appears under ‘More Activities’ on the context menu. When I highlight text in my browser I can now quickly search our SharePoint for any relevant content.

IE8 Rapid Fire Site Test

I can’t spend much longer playing with IE8 or my wife will skin me. However, from my cursory browsing experience I’m worried. Either the devs have a good deal of work to do or I’m going to be very busy with CSS rules for a while.

Here’s the University of Bradford site in IE8:

image

And to try to compare apples with oranges, here it is in Firefox 3 beta 3:

image

More surprisingly, here is the Web Standards Project site in IE8:

image

and again, in Firefox 3b3:

image

Apple.com, IE8:

image

and Apple.com, Firefox 3b3:

image

As you can see, there are issues with the placement of some elements on each of these pages. I have not yet started to investigate why, but I am honestly surprised. Given the much-touted, ‘vastly-improved’ web standards support I was not expecting the number of issues I have seen. Ironically, as usual, old style table layouts look great…

I’ll try to do more comprehensive testing tomorrow. Stay tuned.

Internet Explorer 8…

Well, as expected, the public beta of IE8 appeared on the web pretty much straight after the Mix08 keynote mentioned it. I managed to grab it within mere moments and I now have it installed on my trusty laptop.

As announced only a day or two ago, it defaults to the new rendering mode, with a big toolbar button to toggle back to IE7 mode. I haven’t had time to test the browser with any sites yet, but I’ll try to do that in the next few days and maybe post again.

What did strike me, though, was that there are developer tools right out of the box. Reminiscent of the Safari tools that let you view the page code, the IE dev tools are enabled with a simple icon on the toolbar. Once enabled, what you get is cool:

HTML developer window

A nice CSS/HTML view where you can see the elements and which style rules are being inherited by the element, along with the opportunity to enable/disable individual rules. Suddenly IE is no longer Firebug’s poor cousin.

Javascript debugging window

More on for my developer colleagues, script debugging is also available. This will also come in jolly handy.

The new Favorites Bar I can take or leave- I just don’t browser like that. Underneath, it feels like the old links toolbar to me. Nothing to see here, move along.

Activities look ike they may have legs, though, particularly in the corporate sector where they can guarantee the desktop browser. Being able to right click on the page, element or highlighted text and call functions from other web sites, such as searching for a term or cross-connecting business applications – I can see uses for that and I’ll be playing with this as soon as I can.