By Chris R. Chapman at April 30, 2010 04:47
Filed Under: hacks, sharepoint, sharepoint2010

Via Todd Baginski’s recent post (Which SharePoint 2010 site is right for me?) this fantastic list of “hidden” site templates which were to be officially retired from the final release of SharePoint 2010.  Todd notes that these have been marked as obsolete but some can be created programmatically.

And here I thought all the “fun” of hacking SharePoint was going to be lost with this release.

Site Template NameSite DefinitionConfigurationConcatenated StringPreview Image NameDefined in this WEBTEMP File
Wiki Site WIKI 0 WIKI#0 wikiprev.png WEBTEMP.XML
Tenant Admin Site TENANTADMIN 0 TENANTADMIN#0   WEBTEMP.XML
Access Services Site ACCSRV 0 ACCSRV#0 bsprev.png WEBTEMPACCSRV.XML
(obsolete) Records Center OFFILE 0 OFFILE#0 strc.png WEBTEMPOFFILE.XML
Shared Services Administration Site OSRV 0 OSRV#0   WEBTEMPOSRV.XML
PerformancePoint PPMASite 0 OSRV#0 rchome.png WEBTEMPOSRV.XML
SharePoint Portal Server Site SPS 0 SPS#0 spshome.gif WEBTEMPSPS.XML
SharePoint Portal Server Personal Space SPSPERS 0 SPSPERS#0 perstemp.gif WEBTEMPSPS.XML
Contents Area Template SPSTOC 0 SPSTOC#0 spshome.gif WEBTEMPSPS.XML
Topic Area Template SPSTOPIC 0 SPSTOPIC#0 spshome.gif WEBTEMPSPS.XML
News Site SPSNEWS 0 SPSNEWS#0 spshome.gif WEBTEMPSPS.XML
Publishing Site BLANKINTERNET 0 BLANKINTERNET#0 stpb.png WEBTEMPSPS.XML
Press Releases Site BLANKINTERNET 1 BLANKINTERNET#1 stpb.png WEBTEMPSPS.XML
News Site SPSNHOME 0 SPSNHOME#0 template_news.png WEBTEMPSPS.XML
Site Directory SPSSITES 0 SPSSITES#0 template_site_dir.png WEBTEMPSPS.XML
Community Area Template SPSCOMMU 0 SPSCOMMU#0 spshome.gif WEBTEMPSPS.XML
Report Center SPSREPORTCENTER 0 SPSREPORTCENTER#0 strp.png WEBTEMPSPS.XML
Collaboration Portal SPSPORTAL 0 SPSPORTAL#0   WEBTEMPSPS.XML
Profiles PROFILES 0 PROFILES#0   WEBTEMPSPS.XML
Basic Search Center SRCHCENTERLITE 1 SRCHCENTERLITE#1 template_srch_center_lite.png WEBTEMPSPS.XML

Fantastic find, especially for those situations where customers lament the passing of their favourite site template.  This also goes a long way to explaining why the Fab-40 won’t easily migrate away from SharePoint 2007 to 2010.

By Chris R. Chapman at January 08, 2010 01:10
Filed Under: amuse, hacks, windows7

By now you’re probably well-acquainted with the “discovery” of so-called “god modes” or “superuser” features in Windows 7.  In actuality, these are nothing more than undocumented developer shortcuts to common control panel dialogs, apps and utils.  In fact, the wild-eyed brouhaha that’s erupted from this has caused some mirth down Redmond way, with Windows Division President, Steven Sinofsky even providing a C|NET reporter with a list of the shortcuts.

Here’s how you can quickly create your own “god mode” shortcut links to experiment with:

Step 1:  Copy the following code into your fave editor and save as a batch file – I called mine “godmodes.bat” (removing the line numbers).  Save this file in a folder on your desktop or other preferred location.

    1 mkdir "GodModeA.{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}"
    2 mkdir "GodModeB.{1206F5F1-0569-412C-8FEC-3204630DFB70}"
    3 mkdir "GodModeC.{15eae92e-f17a-4431-9f28-805e482dafd4}"
    4 mkdir "GodModeD.{17cd9488-1228-4b2f-88ce-4298e93e0966}"
    5 rem mkdir "GodMode.{1D2680C9-0E2A-469d-B787-065558BC7D43}"
    6 mkdir "GodModeE.{1FA9085F-25A2-489B-85D4-86326EEDCD87}"
    7 mkdir "GodModeF.{208D2C60-3AEA-1069-A2D7-08002B30309D}"
    8 mkdir "GodModeG.{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
    9 mkdir "GodModeH.{2227A280-3AEA-1069-A2DE-08002B30309D}"
   10 mkdir "GodModeI.{241D7C96-F8BF-4F85-B01F-E2B043341A4B}"
   11 mkdir "GodModeJ.{4026492F-2F69-46B8-B9BF-5654FC07E423}"
   12 rem mkdir "GodMode.{62D8ED13-C9D0-4CE8-A914-47DD628FB1B0}"
   13 mkdir "GodModeK.{78F3955E-3B90-4184-BD14-5397C15F1EFC}"
   14 mkdir "GodModeL.{ED7BA470-8E54-465E-825C-99712043E01C}"

Note:  The rem’ed entries were included in Sinofsky’s list, but didn’t work when I created them – I’ve included them here for completeness.

Step 2:  Open a command console using Run As Administrator from your Start Menu and execute the batch file created in Step 1 above.

Godmodes_cmd

Step 3:  Behold the “God Mode” links that have been created – double-click and explore away!  The most useful one by far is the last one, the “original” God Mode discovery that provides a consolidated list of shortcuts to just about every imaginable Windows 7 control panel feature, property manager or utility.

Godmodes

One more note:  The folder names don’t have to be prefixed with “GodMode” – in fact, any prefix will do.  As the batch file reveals, the trick is in naming the folder with a “.[GUID]” suffix.  I’ve added an alphabetical identifier to each of my entries to keep them in order.

By Chris R. Chapman at October 22, 2009 06:05
Filed Under: hacks, moss, software development, wss30

Earlier today, I was working on a custom survey list event receiver that ports results into a SQL database table when I noticed some peculiar behaviour:  Every time I added an entry to the survey, two duplicate rows were added to the SQL table.

Poking around the web, I see that this is indeed a common issue – David Birin captured the problem (and a solution) quite succintly on his blog in his January 2009 entry.  As he notes, the root of the problem is that if you have your event receiver deployed as a Feature (I did) and then create a template of a targeted list (you bet I did that) then the event receiver registrations are “baked in” to the template definition.

Now, when you create a list based on this template in a site that has the same event receiver Features enabled, you now are running each event handler twice.  As you repeat this process, you register more event receivers and things get out of hand geometrically.

NOT GOOD.

A Hack for a Solution

David’s solution is to add in some custom code that loops through the event receivers and deletes them individually.  While this is robust for future-proofing, I wanted an easier way so that I could get back to coding.  Here’s what I did:

  1. First, I went to the List Template Gallery for my Site Collection and saved the offending list template to my C:\ drive and renamed the extension from “.stp” to “.cab”
  2. Next, I opened up the .cab file and extracted the manifest.xml file within and tossed it into Visual Studio where I cleaned it up with an Edit -> Advanced -> Format Document
  3. I located the <Receivers> element and removed each <Receiver> child element.
  4. I changed the <TemplateTitle> to reflect the new version, eg. “My Survey V4”
  5. I made similar changes to the <Form> and <WebPart> element URL attributes, eg. “Lists/My Survey V4/DispForm.aspx”
  6. Next, I saved this file and then used MAKECAB.EXE to package it up (comes with the Windows SDK) and renamed the extension from “.cab” to “.stp”
  7. I opened up a browser on my test server, navigated to the List Template Gallery and uploaded my revised template and created a list from it.
  8. Presto!  The ItemAdded event was only firing once as it should.

Hope this helps anyone encountering the same issue – it’s a quick-fix which helps avoid the ground-zero for the issue which is building a template of a list while the event receiver feature that targets that list is enabled.

By Chris R. Chapman at December 12, 2007 23:07
Filed Under: hacks

As promised, I’ve set up a wiki to help aggregate the information gathered so far in my efforts to black-box reverse engineer the Tassimo T-DISCs!  You can find the main wiki page at http://blog.chapmanconsulting.ca/wiki and the top page for Tassimo Hacking at http://blog.chapmanconsulting.ca/wiki/Tassimo%20Hacking.ashx

The pages are definitely works-in-progress, and best of all:  You can create an account to help out!  In fact, I’m really hoping that there will be some collaborative input to build the pages out into a hacking Tassimopedia.

I’ll be updating the pages on and off for the next while as I have a whack of other articles to finish and, of course, X-Mas errands to run!

By Chris R. Chapman at December 05, 2007 13:28
Filed Under: hacks

Today's entry is an update in the progress made so far, which is "close, but not quite there yet".  I've received a lot of fantastic suggestions, and I have to give credit where it's due:

@SomeOne:  For providing the lead to the patent, which led to the now-famous Table 3 with the operational parameters binary codes;

@Mike Clay:  For suggesting converting the codes into binary or hex and looking for patterns;

@Tim Nowaczyk:  For having the 'nads to ask Braun's customer service if he could get the lookup codes directly.  Hey, the worst they could do was say "no" and that's exactly what they did!

@Hargobind Khalsa:  For three key observations:  That the leftmost 5 digits of the codes don't appear to exceed 65536, or 2^16;  That given this, the codes break down in 13 bits + 3 bits checksum;  That the last digit of the code seems to conform as a standard barcode/UPC check digit.

@Brandon Siegel:  For observing that the volume code "1101" for 250ml appears consistently for the Columbian, Crema and Cleaner programs when the bits are read in little-endian (right to left).

@Andreas Happel:  For providing 1) codes for Twinings Tea and Cafe Crema Vollmudig that can be "mocked" to get more measurement data;  2) his own empirical data on them;  3) observations that European T-DISCs have a slightly different encoding with a leading zero which may affect decoding the internal algorithms or lookups.

The Story So Far...

For those following along at home, here's a quick overview of the mini-breakthroughs that the above contributors, especially Brandon Siegel, have made possible:

  • Of the six digits decoded from the barcodes, the first five are significant, while the last is a standard UPC/barcode check digit;
  • Converting the five significant digits to binary provides 16 bits, which suggests 13 bits for data (per Table 3) and 3 bits as an internal checksum;
  • A "landmark" value for a beverage volume of 250ml (dec 13 or 1101 base-2), which should be seen in the Columbian, Crema and Cleaner programs, appears in a consistent location starting with the 7th bit when the binary is read in little-endian format;

So, if we take the codes for the Three Amigos (Columbian, Crema, Cleaner):

64226
44738
07879

... and convert them to little-endian binary:

0100011101011111
0100001101110101
1110001101111000

the code for dispensing 250ml is readily apparent.  This is a fairly significant coincidence which suggests that bits 7,8,9,10 are responsible for controlling the water pump.  However, this gets dashed to pieces when we look at the binary for the Latte and Cappucino discs which should dispense 148ml and 118ml respectively - which don't align to any values in Table 3 without some rounding and coercion.

In this range, Table 3 only accounts for 110ml, 130ml, and 150ml  (0110, 0111 and 1000) - looking at the binary for the Latte and Cappucino discs at bits 7-10 we see:

1110111000011111 - 150ml
1110111111101111 - 300ml

The Latte program could be considered correct if we round-up the 5oz I originally observed (it's 147.8ml), but the Cappucino program is completely wrong - it's more than the original beverage!

Conclusions

So far, the code is proving resilient to applying a consistent, rational pattern as suggested in the patent.  In turn, this suggests a couple of theories:

  • The table is completely wrong or needs adjusting
  • The values in the code have some interplay that may look up against another table, or perhaps adjust values, that can impose some consistency - perhaps the three "checksum" bits are involved?

As always, I'm ever-grateful for the input - I'm now investigating setting up a wiki to track this project so that I can aggregate the findings without having a string of blog posts!  I need to get back to my original articles in short order...!

About Me

I am a Toronto-based software consultant specializing in SharePoint, .NET technologies and agile/iterative/lean software project management practices.

I am also a former Microsoft Consulting Services (MCS) Consultant with experience providing enterprise customers with subject matter expertise for planning and deploying SharePoint as well as .NET application development best practices.  I am MCAD certified (2006) and earned my Professional Scrum Master I certification in late September 2010, having previously earned my Certified Scrum Master certification in 2006. (What's the difference?)