IE8 SharePoint Rendering
19. March 2009 03:49

If you've recently started using IE8, you might notice the default MOSS/SharePoint master pages are not rendering properly.

You can fix this quickly by adding this to your master page to tell IE8 how to render:

    <meta http-equiv="X-UA-Compatible" content="IE=7" />

Of course the better solution is to create a master page that is properly XHTML compliant.

Tags: Comments (0) | Permalink
Virtual Earth Map in SharePoint Search Results
16. March 2009 09:15

I often integrate Virtual Earth / Live Maps into MOSS because It's a relatively easy way to add some interesting and useful interaction without any custom code.

I wanted to share with you the 'default' XSL template I typically start from for generating a Virtual Earth Map in my MOSS search results.  From here, I make whatever enhancements or customizations I want, which I'll describe more in a moment.

The prerequisites here are that you have managed columns with Latitude and Longitude that are coming back in your search results (which means you've updated the columns XML to include them on the settings of your search core results webpart)

Here's an example of the managed columns I've got, and will be using -- It's simply an addition of Lat and Lon, and utilization of the existing Title column.  On the right is my updated XML that goes in the columns property of the core results part:

image image

This data could come from a BDC connection to an external data source (e.g. SQL), or you could have a content type or list that has the Lat/Lon information in it.

(If you have a big list or table of data with addresses, and want to generate the coordinates for them, I recommend using this tool: http://www.batchgeocode.com/, You can export your list to excel, save as a delimited format, geocode, and re-import)

So once you have your columns available, this is the base XSL you can put in your core results part to generate a map, and put Push Pins with a popup for the Title at all the correct locations:

 

maptransform.xsl (2.34 kb)

 

The XSL does the following:

  1. Create a div for the map
  2. Includes the Virtual Earth javascript
  3. Write javascript for creating the map, creating a shape array, and pushing the CreateMap function into the body load for sharepoint (_spBodyOnLoadFunctionNames)
  4. Use the XSL to generate a bunch of calls to "Add Shape" based on the search results, to add in all the points.  You could expand this to add any HTML into the pushpin popup, such as content from the result item.

 

You will need to update the Map.LoadMap call to set the zoom level and coordinates to center on (currently its in Redmond, Washington, at a high zoom).

You can build on this using the ability to drag areas of the map to refine search results, or use the built in clustering ability to cluster large groups at different zoom levels.

Good luck!

Tags: , , , , Comments (2) | Permalink
"Tweet This" Link with TinyURL in ASP.Net
14. March 2009 10:59

In migrating to my new blog platform, one thing that I am really excited about is now being able to put custom code to power features I was not able to have in Google Blogger.

The first thing I did was add some code-behind to my user controls to generate good "Tweet This" links so that users could Tweet my posts on Twitter.

 

Most samples you see for this simple stick your page URL in the query string.  This doesn't often work, as the URL will be too long, as the user won't be able to tweet the message.

 

I create two functions behind my page, TweetThisLink and TinyUrl

 

    public string TweetThisLink(string Url, string Title)
{
return "http://twitter.com/home?status=@StefanGordon Reading "
              + TinyUrl(Url) + " " + Title;
}

public string TinyUrl(string Url)
{
try
{
if (!Url.ToLower().StartsWith("http") && !Url.ToLower().StartsWith("ftp"))
{
Url = "http://" + Url;
}
WebRequest request =
                  WebRequest.Create("http://tinyurl.com/api-create.php?url=" + Url);
WebResponse res = request.GetResponse();
string text;
using (StreamReader reader = new StreamReader(res.GetResponseStream()))
{
text = reader.ReadToEnd();
}
return text;
}
catch (Exception)
{
return Url;
}
}

From my ASPX page, I can now insert a nice "Tweet This" link as follows:

<a href="<%=TweetThisLink(Post.PermaLink.ToString(), Server.HtmlEncode(Post.Title)) %>">
Some image or text </a>
Tags: , , Comments (1) | Permalink
New Blog Platform Launched
14. March 2009 05:52

After much preparation, I've made the move this morning over to the BlogEngine.Net platform, which gives me dramatically more control than my old Blogger.com platform.

Some of my favorite new features:

  • Easy master pages based themes
  • Code behind!
  • Nice Search and APML support
  • Ability to have multiple pages

I've implemented some pretty neat features here, and have a lot more work to do over the next few days.  I'll be blogging about some of them, such as:

  • How to automatically create a tinyURL so people can more easily tweet your post
  • How to use URL Rewriting in IIS7 to rewrite URL's that aren't managed extensions (e.g. HTML)
Tags: , Comments (1) | Permalink
SharePoint ULS Log Viewer 2.0 Released
10. March 2009 08:44

I've been a bit quiet on the blog lately as I've been trying to finish up several exciting things.  One of them is an updated version of the SharePoint ULS Log Viewer.

The original post about the ULSViewer.

The key benefit of using the viewer is that you do *not* need access to the SharePoint server.  Great for when clients send log files.

The new version has some really simple but useful new features:

  • Sort on any column by clicking column header (ascending or descending)
  • Ability to open and concatenate multiple log files (select multiple from open dialog)
  • Ability to automatically browse the default log directory (When running on a SharePoint server)
  • Full Text Search (of log Message, Category, and Process AND combined with other filters)

image

You can Download It Here from CodePlex

Tags: , , , Comments (0) | Permalink