Showing posts with label Sitecore Client Tools. Show all posts
Showing posts with label Sitecore Client Tools. Show all posts

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.

Friday, September 9, 2011

Advanced Publish Dialog

Every once in a while our customers ask if it’s possible to terminate a publishing job. A demand for this functionality increased as our customers started pouring more and more content into their Sitecore implementations. Sometimes an innocent  publishing job could become vicious and freeze other publications.

In this blog post I’m going to present an approach that allows a user to cancel a triggered publishing job. This became possible as new publishing pipelines were introduced in Sitecore 6.

Main idea of this tool was to add flexibility to control Publish Dialog UI through Sitecore security mechanism. For instance, hide or disable publish options and  “Publish Subitems” checkbox using user security settings. This was implemented by introducing Sitecore setting items for Publish Dialog UI controls. The items located at /sitecore/system/Settings/Publish folder.

The security settings on publish option items as well as checkbox field, Disabled, control appearance and accessibility of the controls on Publish Dialog form.
There are a few more setting items under the /Behaviors branch described below:

  • Publish Cancel Behavior
    Controls publish cancelling mechanism. If “Cancel with exception” field is checked, it throws an exception after publishing job is cancelled. This is necessary to suppress post publish events and prevent update of LastPublish property when needed.
  • Cancel Button
    Controls accessibility of “Cancel” button in Publish Dialog form. By default it has standard behavior – button is disabled after one starts publishing process. When enabled, it’s possible to cancel current publishing job.
  • Confirm subitems publish
    If enabled, it pops-up a confirmation dialog when “Publish Subitems” checkbox is selected. You can tweak the confirmation message at “/sitecore/system/Dictionary/A/Are you sure you want to publish subitems too” dictionary item in the Core database.

There are two versions of this component:

1. v1.1.1 – developed for AppPool running any .NET version

2. v1.2.0 – developed for AppPool running .NET 4.0 version ONLY. It takes advantage of a feature in .NET 4.0 that allows to speed up publishing by assigning multiple threads to publish items.

Setting that controls number of allowed threads for publishing process is located in /App_Config/Include/Sitecore.SharedSource.AdvancedPublishDialog.config file. By default allows 2 publishing threads.

<!--  Max number of concurrent threads for publishing process.
If this setting is not set Environment.ProcessorCount variable will be used.
-->
<setting name="Publishing.MaxConcurrentThreads" value="2"/>



To observe and cancel publishing jobs an additional application was added to the component – Publish Status Manager. A link to this app appears in Publish Dialog form if a user has access to the app. It’s also possible to open the app from Sitecore start button, again, if the user has access to it.


From within the app one can select a job and hit “Cancel” button to terminate it. By clicking “Cancel all”, all publishing jobs will be forced to be finished.


A few words on how publishing cancel works and its consequences.
When one triggers publishing cancellation, the job gets set to Finished state which is utilized in customized ProcessQueue processor of <publish> pipeline to get off the publishing loop. If “Publish Cancel Behavior” is enabled (setting described above), then custom ProcessPublishCancel pipleline will throw an exception to suppress post publish events.


The caveats of cancelling publishing process.


Publishing of each item is an atomic operation. When you cancel the publishing, there is no mechanism to roll back changes for already processed items. The data for already published items will make their way to the publishing target database. The search indexes will index new data as soon as IndexingManager reads new entries from History table. New published data may not appear on the public site if old data sit in HTML cache of presentation controls and “publish:end” event did not rise to clear it out.


The “Cancel with exception” behavior on “Publish Cancel Behavior” setting item can suppress “publish:end” event and leave LastPublish property unchanged. This could be required if one wants to re-publish processed items, which got published before the publishing job was cancelled, at next Incremental publishing.
If this setting is not set, then caches will be cleared for all processed items whenever publishing is terminated. The LastPublish property will be updated with publish cancellation time. Next Incremental publish will pick up items from the point where they were left when publish cancel event got fired.


Having said this, I’d recommend to leave “Cancel with exception” field unchecked unless you have a strong requirement to republish processed items along with those that were skipped by publish cancellation event.


Here as screencast of quick overview of the component:


Advanced Publish Dialog for Sitecore

UPDATED on Sep 20, 2011
Support for v1.1.x was dropped as v1.2.x does not require AppPool to run .NET 4.0. The link to v1.1.x is no longer available.


Below are the links to the mentioned Sitecore packages:
Sitecore package of AdvancedPublishDialog.


If you have any enhancement ideas or additional features for this module, feel free to express them in the comments.
Enjoy!

Monday, March 31, 2008

Convert unversioned media to versioned

This tool is intended to make a work with media be smoothly. By default Sitecore uploads media as unversioned data. In order to have different media data for different languages we need to upload media as versioned. Otherwise you won't be able to have different data for the same media item. Even if you change unversioned template to versioned.
After installing the package a "Make versioned" button will be available on Media tab.


You can convert media item as well as the whole media folder.

You can download sitecore package from here.

Friday, February 29, 2008

Go To Item tool

Sometimes you have item ID or somebody provides you with pretty long item path and you want to navigate to the item as fast as you can. Of course you can use DBBrowser tool but it's not very convenient switching between several browser windows, isn't it.
So, I created a "Go To Item" tool and I like to share it with Sitecore lovers :).
To get it working you have to install the attached Sitecore package on your Sitecore.
After installation you can see the "Go To Item" button on Developer tab.


After clicking the button you get dialog window where you should input item path/ID. Since /sitecore item is a root of any sitecore trees you can avoid it in item path.


Here is Sitecore package (follow readme instruction during installation).
Here is GoToItem sources.