codeflood logo

Revolver 2.1 Released

Today I’m happy to announce the release of Revolver 2.1. You can head on over to the codeflood website to get the Sitecore package files right now. These will also be available on the Sitecore Marketplace very soon. This isn’t a huge release, but does have some important new features. Let’s take a look at each of these.

Support for Sitecore 6.6 (and Sitecore 7)

Sitecore 6.6 introduced some new security features to make the Sitecore client interfaces more secure. One such feature was to protect against cross site request forgery. Sitecore client UI forms now contain a field named __CSRFTOKEN which contains a token which must be posted to the server on each request. Revolver 2.1 contains an update to submit this field when you execute a command in the Revolver script window. If you’ve tried using Revolver <= 2.0 with Sitecore 6.6 and received an error message mentioning something about missing a “CSRF” field, then make sure you upgrade to Revolver 2.1 to get the fix. And although it’s not released yet, Sitecore 7 is on the horizon, so I’ve been testing Revolver with the Sitecore 7 release we lucky MVPs have. If you have access to Sitecore 7 and want to install Revolver on it, grab the current 2.1 release for Sitecore 6.6.

No spell check warning for script window

A small UI tweak in Revolver 2.1 is to add the spellcheck="false" attribute to the main script window text field to stop browsers from trying to run spell check on the contents of the script window. Most of what you enter in the script window is not plain English, so this tweak removes the sea of red you would have put up with in Revolver <= 2.0 in some browsers.

“Does not contain” operator for expressions

Expressions in Revolver are like predicates in XPath. They allow defining a condition when using the find command. There are a number of operators available in expressions such as comparing equality, starts with and ends with and check whether a string contains another. One scenario that couldn’t be implemented with those operators was to check the absence of a token from input. “Show me items where __renderings doesn’t contain this ID”. The find command also supports testing field values against a regex. Regex is great at finding patterns in text, but not very good at finding the absence of a pattern in text. Hence why I added the “doesn’t contain” (written as !?) operator to expressions. The scenario I gave above about trying to find items without a specific ID in their __renderings field is exactly why I added this operator. I was trying to locate all items in a Sitecore solution where the __renderings field was populated but didn’t contain a particular control. With the new operator I can now use a command similar to the following to locate these items:

find -r -e (@__renderings != () and 
  @__renderings !? {885B8314-7D8C-4CBB-8000-01421EA8F406}) pwd

The above Revolver command will show me the path to all descendant items (from the current context item) that has presentation defined but does not include the control given my the ID {885B8314-7D8C-4CBB-8000-01421EA8F406}.

Preserve ID when pasting from XML

Revolver has allowed you to create items from Sitecore item XML for a while now. And now you can select to keep the IDs in the input XML string. Previously Revolver was changing the IDs to ensure there were no item ID clashes. But what if the XML being pasted came from another Sitecore instance and the ID of the items are vital; perhaps they’re referenced from another XML blob you’re about to paste. You can now tell Revolver to keep the IDs but using the -id flag when using the touch command to create the items as follows:

touch -id -x (item-xml)

where item-xml is actual Sitecore item XML (you can get that using the gi command).

Conclusion

Like I said, not a huge release, but now supporting Sitecore 6.6.

Comments

Ivan Huang

Al, do you know if there is a confirmed release date for Sitecore 7 yet?

Alistair Deneys

Hi Ivan, I’m sure you’ve seen the flood of Tweets by now, but Sitecore 7 was released on May 21st.

Ivan Huang

Oh, yes. lots, had a play with it, the search function is amazing.

Comments are closed