Pipelines are one of Sitecore’s essential integration concepts. They are used to extend existing functionality. Pipelines define a sequence of processor that implement different functions such as handling page requests, to uploading files and saving items through the UI. If you have a series of tasks, which need to be performed to accomplish a task, then a pipeline may be the way to go.
What is Pipelines?
Pipelines are used to control most of Sitecore’s functionality. Pipelines are defined in
Web.config and in Sitecore patch files.
The following is an example of the pipeline that is responsible for rendering a page:
Sitecore separates the pipelines into two groups: those defined within the /configuration/sitecore/pipelines and /configuration/sitecore/processors elements in the web.config file. In general, those defined within the /configuration/sitecore /processors define pipelines that operate for UI requests and can interact with the user. Those defined with the /configuration/sitecore/pipelines tend to define system processes.
What is processor?
Each step in pipeline is called a ‘processor’. The sequence of processors within a pipeline is defined in web.config file. Each Processor contains a unique operation and all these steps together create a pipeline.
A processor is a .NET class that implements a method. When a pipeline is invoked, the processors are run in order. Processes ranging from authentication to request handling to publishing to indexing are all controlled through pipelines.
Each processor in a pipeline contains a method named Process() that accepts a single argument and returns void. This method should return immediately if the processing context is not relevant to the processor. A processor can abort the pipeline, preventing Sitecore from invoking subsequent processors.
<pipelines /> define system process such as initialize Sitecore application, load content editor warning. <processors /> define UI process such as copy item, delete item, drag item and so on.
List of Sitecore Pipelines
Sitecore includes more than 140 pipelines. Installing Sitecore modules also results in more pipelines being added.
The following is a list of some of the more commonly used pipelines.
Runs when the IIS application pool is started. Processors handle initialization tasks that need to run once.
This pipeline handles the HTTP request. This includes tasks such as resolving the context item, device and presentation settings.
<httpRequestBegin> under configuration/sitecore/pipelines in sitecore.config, defines Sitecore context. By default there are 19 processors under <httpRequestBegin> pipeline but it may vary based on different modules you have installed in Sitecore.
For example: If you have installed Sitecore DMS then you will find 21 processors under <httpRequestBegin> pipeline.
<insertRenderings> – Determines the presentation components to include when rendering an item
<renderField> – Runs when the FieldRenderer is used to render a field value.
The following table lists all of the Sitecore pipelines that are only used by MVC:
|RequestBegin||This is the first action of an MVC request after the request has been passed down from the main
A PageContext is created and assigned to the current thread.
If the request is a form post, the associated form handler (if any) is executed.
|RequestEnd||This is the last action of an MVC request. This pipeline is not currently used.|
|CreateController||This pipeline is called by the
If the requested item (
|ActionExecuting||This pipeline executes before an MVC controller action is executed. This pipeline is not currently used.|
|ActionExecuted||This pipeline executes after an MVC controller action is executed. This pipeline is not currently used.|
|ResultExecuting||This pipeline executes before an MVC result is executed. This pipeline is not currently used.|
|ResultExecuted||This pipeline executes after an MVC result is executed. This pipeline is not currently used.|
|Exception||This pipeline executes after the MVC runtime catches an unhandled exception. This pipeline is not currently used.
If you attach a custom processor to this pipeline, this processor should set the
|GetPageItem||This pipeline resolves the item that was requested using route information. If the item cannot be resolved from the route,
|BuildPageDefinition||This pipeline builds the initial
|GetPageRendering||This pipeline selects the rendering to use as the root rendering of the page for creating the output of the current request.
Currently, the root rendering is selected based solely on the current device (
|GetRenderer||This pipeline transforms an abstract rendering definition (rendering) into an object that can render output back to the client (renderer).|
|GetModel||This pipeline creates the model object to use when rendering an MVC view. This is typically a ASP.NET MVC 3 Razor view.
If the pipeline returns no model, the view receives an instance of
|RenderPlaceholder||This pipeline is called as part of the
By default, the pipeline finds all renderings matching the specified placeholder name in the current
|RenderRendering||The pipeline renders the specified rendering. This pipeline handles caching and sets up the