zevenseas


 

SharePoint, Social Networking and “TownSquare”

Its a pretty safe bet that the next version of SharePoint will include functionality aimed at bringing many of the benefits people are enjoying from sites like Facebook to the Enterprise. We certainly see lots of advantages in being able to map out the connections between colleagues, thereby providing mechanisms that effortlessly communicate what people are working on and organically identify subject matter experts. Having just read this article, it looks to me like this functionality is going to be driven out of the “OfficeLabs” team, an approach which gives me some confidence given the team is led by OneNote (one of my favourite all time apps) creator Chris Pratley.

With a layout that is strikingly similar to Facebook.com's (in which Microsoft invested $240 million in October 2007), TownSquare is fueled by enterprise news feeds that use Web services to query SharePoint for public information, such as promotions and company anniversaries, about an employee.

TownSquare also notifies users when a document or file is modified. Users can customize their feeds and monitor who is receiving information about them.

I have recently been thinking about how to build something that does just this, largely driven by the vastly improved SharePoint Search technology. Its one of the reasons why I built out the zevenseas Search OM that we release to codeplex last week, making search application easier to write. MOSS Search provides an excellent mechanism for aggregating information in a scalable and performant way. Anyway, be sure to watch the OfficeLabs site.

Microsoft testing prototype of Facebook-like social network | InfoWorld | News | 2008-06-11 | By Heather Havenstein, Computerworld
http://www.infoworld.com/article/08/06/11/Microsoft_testing_prototype_of_Facebooklike_social_network_1.html?source=rss&url=http://www.infoworld.com/article/08/06/11/Microsoft_testing_prototype_of_Facebooklike_social_network_1.html

PressPass: Microsoft releases a community initiative around SharePoint and Podcasting

Just read today on PressPass that Microsoft has kicked off another community project (much like the Community Kits) focused on Podcasting. You can check it out here:

Podcasting Kit for SharePoint

A quick look at it leaves me fairly impressed, as I have been with the Community Kits projects on the whole. The announcement comes during the Enterprise 2.0 Conference which is going on in the US. I would have loved to be there, as zevenseas is keen on this area, in particular around community building (podcasting being just one of the elements), having recently posted about it on the Get The Point Blog here:

How can your organisation create an online community around its products and services?

Anyway, I have a download to make, interested in your experiences.

Announcing: MOSS SQL SearchCoder

DOWNLOAD

Search in MOSS, from a programmatic perspective, has come a long way in MOSS, specifically it is more robust (though could still be MORE robust), more bug free and therefore more suited for use as plumbing in applications. I have found it particularly useful to get over some of the scale restrictions SharePoint places on developers, and taken advantage of it to meet the need for aggregation.

In a recent project however I found myself writing this little piece of spaghetti code.

   1: //Build the Select Statement
   2: string baseQuery =
   3:     @"SELECT Title, Rank, Description, Created, Path, NumComments, NumViews, NumLinkbacks, Tags, Categories FROM portal..scope()";
   4:  
   5: //Set the base scope
   6: string baseScope = @" (""SCOPE"" = 'All http://" + strSiteURL.Host + @"/ Blogs') ";
   7:  
   8: // Build the Where Clause
   9: string baseWhere;
  10: switch (tag)
  11: {
  12:     case "":
  13:         baseWhere = @"WHERE " + baseScope;
  14:         break;
  15:     default:
  16:         //TODO: MUST ADD TAG FIELD SUPPORT
  17:         baseWhere = @"WHERE CONTAINS (""Categories"",'""" + tag + @"""') AND " + baseScope;
  18:         break;
  19: }
  20:  
  21: //Build the OrderBy Clause
  22: string localSortField;
  23: if (_sortField == "")
  24:     localSortField = "Created";
  25: else
  26:     localSortField = _sortField;
  27:  
  28: string orderQuery;
  29: if (localSortField == "")
  30:     orderQuery = "";
  31: else
  32:     orderQuery = @"ORDER BY """ + localSortField;
  33:  
  34: //End the Query
  35: string endQuery = @""" DESC";
  36:  
  37: //Putting it all together
  38: string strsql = baseQuery + baseWhere + orderQuery + endQuery;
  39: Debug.Write(strsql);
  40:  
  41: return strsql;

I'm not proud of it, and couple of small bugs aside, was revisiting it to ensure it was "solid" (as if code like this could EVER be solid) when I threw in the towel, sick of writing code to write code every time I hit a project that needs to use search. There should be an easier/better way.

The result of my frustration is a tool that takes spaghetti code like this and turns it into:

   1: MOSSSearch mossSearch = new MOSSSearch();
   2:  
   3: ArrayList Scopes = new ArrayList();
   4: Scopes.Add("All http://" + strSiteURL.Host + @"/ Blogs");
   5: mossSearch.Scopes = Scopes;
   6:  
   7: ArrayList returnProperties = new ArrayList();
   8: returnProperties.Add("Title");
   9: returnProperties.Add("Path");
  10: returnProperties.Add("Rank");
  11: returnProperties.Add("Description");
  12: returnProperties.Add("Created");
  13: returnProperties.Add("NumComments");
  14: returnProperties.Add("NumViews");
  15: returnProperties.Add("NumLinkbacks");
  16: returnProperties.Add("Tags");
  17: returnProperties.Add("Categories");
  18: mossSearch.ReturnProperties = returnProperties;
  19:  
  20: WhereContains whereStatement = new WhereContains();
  21: whereStatement.FirstWhereProperty = "Categories";
  22:  
  23: if (!string.IsNullOrEmpty(tag))
  24: {
  25:     WhereProperty whereTags = new WhereProperty();
  26:     whereTags.Property = "Tags";
  27:     whereTags.SearchTerm = tag;
  28:     whereTags.LogOperator = WhereProperty.LogicalOperator.OR;
  29:     whereStatement.WhereProperties.Add(whereTags);
  30:  
  31:     WhereProperty whereCategories = new WhereProperty();
  32:     whereCategories.Property = "Categories";
  33:     whereCategories.SearchTerm = tag;
  34:     whereStatement.WhereProperties.Add(whereCategories);
  35: }
  36: mossSearch.Where = whereStatement;
  37:  
  38: SortStatement sortStatement = new SortStatement();
  39: sortStatement.SortProperty = _sortField;
  40: sortStatement.ResultSortOrder = SortDirection.Descending;
  41: mossSearch.SortStatement = sortStatement;
  42:  
  43: Debug.Write(mossSearch.GetSQLStatement());
  44: return mossSearch.GetSQLStatement();

Which looks much more elegant to me. Of course actually creating the query in the first place is tricky too, and while a couple of test tools are available, I wanted to put one together that:

  • Tested the SQL generated by the OM
  • Output not only the SQL Statement, but the OM code as well, making using it as simple as cut and paste.
  • Was inspired by the now missing in action tool MossQueryTool.exe written by SharePoint legend Steve Peschka (was on GotDotNet).

The result is the zevenseas SearchCoder and it looks like this:

image

Here you build your query graphically, when done you click on the "Build SQL" or "Execute Query" buttons which take you here:

image

Note the SQL Statement is generated, an on the C# SearchCoder OM Tab:

image

Anyway, this is the .9 release, still a little polishing to do, including:

- Add Sort order (it is in the OM, but not in the tool)

- Add support for multiple sort orders

- Better exception handling (of course!)

But I would rather it was out there than sitting on my hard disk, so grab it now from CodePlex:

CodePlex Project

DOWNLOAD


 
 
 

© 2009 Community Kit For SharePoint