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);
Sitecore.Web.UI.Sheer.SheerResponse.Eval(msg);
Note: “window.parent” in this message is mandatory. Otherwise it won’t work.

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

Friday, December 9, 2011

Ensure valid Sitecore Internal Links in Page Editor (Update)

A while back I published a solution to ensure correct links in page editor. Some folks used it and provided a valuable feedback suggesting improvements for RegEx statements to match links. This post is intended to update the solution with suggested improvements.

The suggested RegEx looks like this :
((http)|(https)):((//)|(\\\\))({0}).*?(~/link.aspx)

I updated both regular links and media links RegEx patterns with suggested modifications and re-assembled the package.

You can get from here.

Kudos to anonymous developer who provided the updated RegEx!

Monday, November 28, 2011

Rich Text auto-save

Another customization to address rising demand for auto save functionality in Rich Text fields. Per teammate’s suggestion I started with an approach that we found in our knowledge base system. I expected that some customization would be required as it was created a while back and we updated Rich Text editor since then. Here is what we’ve done to achieve the goal. The customization introduces a few changes to the following files at /sitecore/shell/Controls/Rich Text Editor folder:
  • EditorPage.aspx – added some JS changes and changed class inheritance to a custom one.
  • EditorPage.js – made some JS changes.
  • EditorWindow.aspx – made some JS changes.
One can use any merger tool to see what changes were made to aforementioned files. I also included a link to Sitecore package that contains required customization.
Keep in mind that the package contains a DLL so that app pool will be recycled during the package installation.
Please BACKUP files listed above prior to installing the package.
Keep in mind that a Sitecore update that overrides any of the listed files will cease auto save functionality for RTE fields.
This feature was tested in Sitecore 6.4.1 Update-3 and Update-5 as well as Sitecore 6.5.0 Update-1.
Sitecore package link.

Thursday, October 27, 2011

Helicon URL Rewrite module with Sitecore in Integrated pipeline mode

I recently happened to help a few customers resolve an issue with Helicon ISAPI URL Rewrite module when Sitecore runs in Integrated mode. So, I decided to make create a quick post about it as it took me awhile to figure out why this was happening. I even had to contact Helicon support channel to see if they had any insights into this issue.

The long story short Helicon module has to be configured in early request processing in order to work with Sitecore in Integrated pipeline mode. Here is the setting that you need to set up to make it happen: http://www.helicontech.com/isapi_rewrite/doc/NotificationType.htm

Now a few more details for those who still reading. So, why this becomes an issue when you run your Sitecore app in Integrated mode? The answer lies in the model that Integrated pipeline has. It’s different from Classic mode (aka IIS 6 model) which is based around ISAPI modules. For those who want to dive into details I’d recommend to read these articles: ASP.NET Application Life Cycle Overview for IIS 7.0 and Comparing Native-Code and Managed-Code Notifications [IIS 7].
As all native and managed modules can subscribe to the same processing events when you run you app in integrated mode, the Helicon ISAPI module turns out to be not the first one that accepts a request. The first event that gets raised is Authentication one. Sitecore Http Module gets subscribed to that event thus it’s the first one who intercepts the request. After the Http Module the request gets changed and it points to the physical file, which is a physical layout page for your dynamically constructed page represented by a Sitecore item. As a result Helicon module gets a “wrong” URL.

If you’re not satisfied with this workaround, consider using official Microsoft URL Rewrite module.

For those who are still looking for the solution it's a first link in this post Smile.

Hope this will save someone a bit of time.