Friday, November 23, 2012

Dynamic Workflow module

I recently published a new module to our Sitecore Marketplace site. It’s called Dynamic Workflow.

The gist of this module is to help content administrators to easily configure workflows of any complexity level. It takes advantage of Rules Engine to execute workflow actions that contain set of rules. Any workflow command or state should have a workflow action that determines what operations should be executed on the item.

The module comes with some basic rule actions and could be easily extended with custom ones.

Here are a few basic scenarios that are very easy to solve with the module:

  • Set up a landing workflow that decides which workflow should be applied to a specific type of item.
  • Configure an action that moves an item to a specific location. For instance, all media assets get uploaded into a common folder and workflow sorts them out based on an attribute.
  • Skip irrelevant workflow states based on some criteria, e.g. user role.
  • Add a custom validation rule that controls application of mandatory data, etc.

I’d be happy to hear any feedback or ideas for improvements from the community.

Thursday, September 20, 2012

Interacting with Content Editor in Sitecore 6

I recently stumbled across an interesting challenge. The issue was to programmatically select an item from within a custom item editor tab.
In Sitecore 5.x it was quite easy to do. All you need to code was this.
Sitecore.Context.ClientPage.SendMessage(this, string.Format("load:item(id={0})", itemId));
Quite simple, huh?

In Sitecore 6 some revamping has been done to Content Editor and now aforementioned approach does not work. The “SendMessage” method does not broadcast the message called from the custom item editor all the way to parental window of Content Editor. The message is sent to an object of custom editor and gets handled by it.

Here is the way it should be done in Sitecore 6.
string msg = string.Format("window.parent.scForm.postRequest(\"\",\"\",\"\",\"item:load(id={0})\")", itemId);
Note: “window.parent” in this message is mandatory. Otherwise it won’t work.

P.S. Saving brain-power energy for whomever stumbles upon.