Introduce your drastic UI changes... slowly

 

We are in the middle of a somewhat sudden rebranding exercise.  One of the main colours that was used prominently in the previous theme of the website is now being retired as the UI is simplified.

 

So here is what we have right now:

image

 

And here is where we're going (currently in development).

image

 

Where's the Yellow?

 

In every case where we ask one of our existing users the first response is always: Where's the "Company Yellow"?

There's of course a marketing message that will go out with our latest release. 

But here's the secret developer compromise.

 

We can reduce the yellow, slowly, overtime

 

The old header background will remain.  But in the Javascript that's run on every page, we introduce a small piece of script that modifies the opacity of the background header.

var days = (new Date("2013-08-20") - new Date()) / (24*60*60*1000);  // remaining days until 2013-08-20
var opacity = (days > 0) ?  (0.5  * (days / 14)) : 0;   // starts from 0.5 opacity to 0
$(".header-banner").css("opacity", opacity);

What this does, is that over the course of two weeks, the yellow's opacity reduces from the original (50% at this next release) to 0%.  So as days go on, the yellow header begins to fade, and after two weeks, it will simply disappear!

I wonder what'd be the water cooler conversation.  Each person will wonder what happened to the yellow as it slowly faded out of our lives.

SharePoint Saturday Melbourne 2013

It's that time again!  I'm down in Melbourne for SharePoint Saturday later today on July 27. 

I'm presenting TypeScript and SharePoint, with updated notes as I have been working with TypeScript since Feburary.  It's been just awesome.

The SharePoint Saturday version of the presentation will be more developer focused, and I'm hoping my audience will come with their dev hat on and ready to play with JavaScript and TypeScript.

I'll update this post later to include the download files for the presentation.

See you at SharePoint Saturday.  Early night and early morning for me later.

 

Update

 

Again, I had a lot of fun in Melbourne, had a lot of fun discussions and talked to a number of you guys about TypeScript in the real world.  Drop me a line as you start to play with TypeScript in your own environment.

Happy Birthday shout out to Elaine van Bergen!

 

Downloads:

Chrome, the Trojan Horse we didn't know about

 

I do not like where Chrome browser is going, and I'm typing this on Chrome.
Let me explain, there are a few pieces in this puzzle.

Language and API

  1. Google is working on a javascript pre-compiler, Dart.
  2. Google argues that because javascript will never be as fast as native code, Dart will eventually run on its own VM. Dartium. The Dart development browser has two VM's, the Javascript VM (Chrome's V8) and Dart VM.
  3. Dart provides its own methods to talk to the browser and access features such as storage, camera, geo.

Browser

  1. Google splits off from WebKit and starts its own browser engine Blink.
  2. Google says this will allow them to drop support for legacy features in WebKit and focus on new stuff. What I think they mean is that eventually Dart VM will be included side by side with the chrome Javascript VM (V8).
  3. I think this was never about WebKit. This decision is purely so that they can structure the chrome development to be completely in-house, and they can dictate including a second VM, without having to get approval from Apple's Safari guys.

OS

  1. Google continues to manufacture the Chromebook. Even with a very low market penetration.
  2. The Android operating system is under the ChromeOS group. Now that may seem strange. Android has huge penetration, Chrome OS is unheard of. Why are they structured like this?

Java

  1. Oracle sued Google for Java infringements, and Google does not licensing Java from Oracle. This means Google can't use a number of improved Java VM from Oracle who holds much stronger patents. Aka. Java performance on Google Android's Dalvik VM can't go faster because Google doesn't license those techniques from Oracle.

Joining the dots

  1. I think Dart will tie the whole thing together.
  2. Dart will provide API to Android, allowing developers to work directly with Android OS without going through the Dalvik VM.
  3. Dart will provide javascript developers ways to call the Operating System functions through Chrome browser, even APIs that aren't finalized by the W3C. Because Google will dictate these APIs.
  4. Chrome OS will run Dart natively, yes right now it's just a notebook that only runs a browser. But what if that browser now has access to OS level APIs? Suddenly it's a device that can run code that goes outside of the browser.
  5. Both javascript developers currently writing Chrome apps as well as Android developers will suddenly form that army that will be able to develop Dart apps. These will run across Chrome OS, Chrome Browser and Android.
  6. Dart is Google's version of Microsoft's .NET Framework. Born out of a necessity to control the entire ecosystem and with a gentle push (lawsuit) from Oracle. To give them a complete framework and API that they can control completely, without having to ask for approval from anyone.
  7. Chrome browser is the Trojan Horse that will allow Dart to run on Windows & Mac. It will run on Android and ChromeOS (which Google controls).
  8. The only places where Dart won't run are going to be few: WindowsPhone and Windows RT - neither OS Google cares or has any plans to support. iOS currently has Chrome (without Dart) - it remains to be seen if Apple will bow to public pressure if Google plays the card to include Dart within the iOS Chrome browser. But I think that war will come, especially since Chrome is the gateway drug.
  9. So while we're bashing Adobe's Flash and MS' Silverlight for being non-standard and plugin architecture degrades the security of our systems, Google's been ramping up to ship another VM right under our noses.

Australian SharePoint Conference 2013 Melbourne

Thank you attendees for yet another super conference.  It was quite a lot of fun presenting TypeScript for SharePoint.

 

I've got lots of feedback regarding the section on JavaScript - and have heard you guys loud and clear:

  • While the examples are fun...
  • But if you have other stuff to talk about, skip it!

I will miss talking about hoisting.  One of the craziest JavaScript gotchas there ever was.

 

VS.NET Extension

 

Downloads

ContentType Workflows not being updated in the Site Collection

 

This is a problem we've been seeing for a long time in our development and production server.  It is hard to describe the error, but there are a series of consequences.

  • We have reusable content type workflows defined for a InfoPath Form content type.
  • The Workflow Association is created at the root content type level and pushed down through the site collection, for every Forms Library that uses the content type.
  • Sometimes, we discover that an older version of the workflow is running, after we've updated the workflow. 
  • Next, we'll find that for some reason, for one specific Forms Library, the Workflow Association is still pointing to the old workflow template, so even when we manually start a new instance of a workflow, it is still running the older version.
  • In our specific case, the error was happening with Nintex Workflows, but this is not a Nintex Workflow problem - the problem is in the underlying SharePoint platform and how it is creating the workflow associations.

 

The Chase

 

I begin to write scripts to try to catch the form libraries that has this behaviour.  I worked out how to read the Workflow Association records.  For every workflow association, there is an InternalName field that looks like this:

  • [workflow name] <Cfg.{guid}>

When it is updated, the current workflow association is renamed to:

  • [workflow name (Previoius Version:{date}) <Cfg.{guid}>

Additionally, each Workflow Association has a BaseId that points to a BaseTemplate object, and the Template object has an Indexer Property

  • template["DeclarativeConfiguration"] - which gives back the same Cfg.{guid}

So a program (or script) can be written that looks through all the form libraries in our site collection, and report on content type workflow associations where the Cfg.{guid} on the Workflow Association doesn't match the one on the template.

 

UpdateAssociationToLatestVersion

 

Each Workflow Associations collection has a special method that will attempt to update the Workflow Associations to the latest version.  The method UpdateAssociationToLatestVersion will detect the Cfg difference, create a new Association to the latest template, rename the old Workflow Association to Previous, and set the old WorkFlow Association to continue running, but not start new instances.

 

The Error

 

I see a few scenarios.  When there is a workflow instance currently running, that seems to be when the Workflow Association for that Form Library breaks.

I also begin to watch SharePoint's Workflow Association table and notice that when a Workflow Association is broken, it seems to have a strange StatusFieldName "ows_" - this is for the Workflow Status column, but shouldn't be with that specific name.

image

 

Deep into the logs, I also see this exception buried:

Column 'ows_' does not exist. It may have been deleted by another user.

 

The Fix

 

Some quick search turns up Stefan Gossner's blog post from 2011.  Which describes the problem probably better than I could.  Essentially, when you have a lot of Lookup in your List View (remembering that each Workflow Status column is actually also a Lookup), it is possible for your List View Lookup Threshold throttling to break the code that creates new Workflow Associations.  When this exception happens, the existing Workflow Association is broken and must be manually removed and recreated.  And in the broken state, it will not Update to the latest version.

http://blogs.technet.com/b/stefan_gossner/archive/2011/05/20/error-message-quot-column-ows-does-not-exist-quot-when-updating-workflow-associations-on-a-list.aspx

image

 

The Aftermath

 

After we bumped the List View Lookup Threshold from 8 to 50, we are now able to update our Workflow Templates, and the correct Workflow Associations are being created and pushed down.  We still have a bunch of broken associations that requires attention and fixing, but at least we can identify them and correct them manually.

Very, very annoying problem, but it feels good to finally find the solution that has plagued us for months.