zevenseas


 

Assembly Free Twitter Solution Improved

I received an email last week from Tulasi Talakola (Twitter: talakola2009) which included a new version of our assembly-free Team Status (“Twitter”) template for SharePoint.

The new functionality provides for the ability to “Follow” only a subset of users within the site. We agreed that I could post it here, and I really like having others take our solutions and make them even better.

DOWNLOAD

Thanks Tulasi!

Announcing Discussion Central for SharePoint

We released Blog Central (Demo Site) a little over 4 months ago and it has always been our intention to grow it into a suite of products that perform two core functions:

  1. Aggregate and summarise information from across your SharePoint farm.
  2. Extend the out-of-the-box templates with small additional features that add a lot of value.

I’m pleased to announce our first addition to the Central suite, our beta release of “Discussion Central” (Demo Site).

image

Discussion Central provides a “Jumping Off Point” into Discussions that are happening across your organisation. It does this by aggregating both the topics, and the replies, people are creating in Discussions Lists across your SharePoint farm. To be clear, this is cross Site Collection, cross Web Application aggregation.

Inspired by the Facebook news feed, we provide anyone accessing the portal with a quick summary of the most recent topics of discussions, and the most recent replies. It provides information on the number of views a discussion has received, and at a click, allows you to expand any topic.

image   image

At this stage we have made a single extension to the standard Discussions List, adding the ability to enable View Tracking. This provides an easy way for people to see which discussions are proving the most popular.

image

image

image

Anyway, a blog post can only take you so far, head over to our Discussion Central Demonstration Site and have a look for yourself. If you are interested in learning more, drop me an email daniel@zevenseas.com.

Using HTML Meta Tags to add Information to SharePoint Search

This week Robin was working away on a tool to make it easier for people to find Team Sites across their organisation. He was evaluating the use of SharePoint Search to do it, but found that many site properties, for example the template that Publishing Sites are based on is not marked as STS_Site, were not exposed in the index.

This reminded me of a very similar exploration I did a little while ago, and it reminded me that I didn’t blog about it and should have. So now I am.

As many of you know, SharePoint is very good at automatically finding metadata as it crawls content. It finds document properties, list columns, and much more. It collects these all together and adds them into the SSP as “Crawled Properties”. Once in this list, you can map them to a “Managed Property”, thereby making them available for use in search queries and results.

A little known fact is that SharePoint can also pick up properties from HTML pages via the “META” tag. For example, in the top of the home page on any SharePoint site you will see:

<META Name="CollaborationServer" Content="SharePoint Team Web Site">

This value is detected by SharePoint and then added to the Crawled Properties here:

image

This got me thinking. Wouldn’t this make it possible to create a small control that used the SharePoint OM to pull out the properties from the site and then expose them inside a META Tag. Once there would be picked up by the Indexer? The answer course was ‘Yes’. Even better, you could add this control onto any site using the “Delegate Control” capability.

Here is the little base class I built:

using System.Collections.Generic;
using System.IO;
using System.Web;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using Microsoft.SharePoint;
 
namespace codezeven.Social.WebControls
{
    public class MetaManager : Control
    {
        private Dictionary<string, string> metaData;
        protected SPWeb currentWeb;
 
        public MetaPropPageType PageType
        {
            get
            {
                if (IsDefaultPage())
                    return MetaPropPageType.Default;
 
                return MetaPropPageType.None;
            }
        }
 
        public Dictionary<string, string> MetaData
        {
            get { return metaData; }
            set { metaData = value; }
        }
 
        protected override void OnInit(System.EventArgs e)
        {
            this.currentWeb = SPContext.Current.Web;
            metaData = new Dictionary<string, string>();
        }
 
        protected override void CreateChildControls()
        {
            foreach (KeyValuePair<string, string> pair in metaData)
            {
                HtmlMeta metaTag = new HtmlMeta();
                metaTag.Name = pair.Key.ToUpper();
                metaTag.Content = pair.Value;
                Controls.Add(metaTag);
            }
            
            base.CreateChildControls();
        }
 
        protected bool IsDefaultPage()
        {
            string defaultPage = currentWeb.Url.TrimEnd('/') + "/default.aspx";
            string currentPage = HttpContext.Current.Request.Url.OriginalString;
 
            if (!string.IsNullOrEmpty(defaultPage) && !string.IsNullOrEmpty(currentPage))
            {
                if (currentPage.ToLower() == defaultPage.ToLower())
                    return true;
            }
 
            return false;
        }
    }
}


And the referenced Enum:

namespace codezeven.Social.WebControls
{
    public enum MetaPropPageType
    {
        Default, None        
    }
}

From here you can just layer your own control on top, to output just the values you would like from SharePoint:

using System;
using codezeven.Social.WebControls;
 
namespace codezeven.Social.WebControls
{
    public class SiteMetaManager : MetaManager
    {
        protected override void CreateChildControls()
        {
            MetaData.Add("SharePointWebTitle", currentWeb.Title);
 
            switch (PageType)
            {
                case MetaPropPageType.Default:
                    MetaData.Add("SharePointWebTemplate", currentWeb.WebTemplate);
                    MetaData.Add("SharePointWebDescription", currentWeb.Description);
                    break;
                case MetaPropPageType.None:
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
 
           base.CreateChildControls();
        }
    }
}

 

Then via a feature add it in as a Delegate control with something like this:

<Control Id="AdditionalPageHead" 
Sequence="50" 
ControlClass="codezeven.Social.WebControls.BlogMetaManager"
ControlAssembly="codezeven.Social, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=0fec8ae58e85e93e" />

 

This will then produce something like the following in the top of each page (ok, so my demo data is not ideal! <grin>):

<meta name="SHAREPOINTWEBTITLE" content="Setup's Again" />
<meta name="SHAREPOINTWEBTEMPLATE" content="BLOG" />
<meta name="SHAREPOINTWEBDESCRIPTION" content="This is a really long description just to see if it comes across ok." />


And after performing a Full Crawl, you will find the following new “Crawled Properties”:

image

After mapping them to equivalent Managed Properties, and using our useful SearchCoder tool, you can see the result here:

image

image

There is a downside, these properties only change in the Index after a Full Crawl (or when the page changes, though never really bottomed that out as it lost its real benefit at that point). This was a deal breaker for me, but no problem for Robin. Anyway, that’s it, hope it helps!


 
 
 

© 2009 Community Kit For SharePoint