Welcome Guest   •   Login

Sitecore Rocks

RSS RSS




Search the wiki
»

PoweredBy
Pipelines in Sitecore Rocks are similar to pipelines in Sitecore. The implementation is a bit different but the concept is the same. A pipeline consists of a number of pipeline processors that are executed in sequence.

A pipeline is a class that inherits from the Pipeline<T> class where T is the class itself:


public class DeleteItemPipeline : Pipeline&lt;DeleteItemPipeline&gt;
{
...
}

The pipeline class defines the parameters that are used when processing. The class does not need an attribute.

Each pipeline processor must be marked with the Pipeline attribute and inherit from the PipelineProcessor<T> class where T is the pipeline.


[Pipeline(typeof(DeleteItemPipeline), 1000)]
public class SetName : PipelineProcessor&lt;DeleteItemPipeline&gt;

The Pipeline attribute takes 2 parameters - the type of the pipeline and a sorting value.

The PipelineProcessor class defines the abstract method Process which takes the pipeline type as a generic argument:


protected override void Process(DeleteItemPipeline pipeline)

To instantiate a pipeline, use the PipelineManager.GetPipeline&lt;T&gt; method.
var pipeline = PipelineManager.GetPipeline&lt;DeleteItemPipeline&gt;();
pipeline.ItemUri = ...
pipeline.Start();

Tip

Download the PipelineDump plugin to make a list of all defined pipelines and their processors. This tool also makes it possible to see the sorting values of each processor.

ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.