Skip to content

Latest commit

 

History

History
110 lines (73 loc) · 3.95 KB

provisioning-pipeline.rst

File metadata and controls

110 lines (73 loc) · 3.95 KB

Provisioning Pipeline

Omnia provides a way of doing modifications to resources provisioned as part of core Omnia features.

A Provisioning Pipeline makes it possible to modify the content of a resource file at the time it is provisioned to a SharePoint site. This enables you to adapt those resources to specific needs.

Add a Provisioning Pipeline #######

To add a new Provisioning Pipline to your project, add a new class inheriting from SharePointFileProvisioningPipeline (found in Omnia.Foundation.Extensibility.TenantResources).

Decorate it with a SharePointFileProvisioningPipelineDefinition attribute and a unique GUID:

Methods ######

The SharePointFileProvisioningPipeline class has two overridable methods:

The content parameter of the methods contains the full file content in a string format. This allows you to do string operations like Contains and Replace. Omnia also provides a number of extensions to the String object in C#, like InsertBefore and InsertAfter.

The tenantResource parameter contains information about the resource that is currently being processed. You can do comparisons with properties in this object to make sure your modifications only affects a specific Omnia resource:

The main difference between the BeforeContentReplacements and AfterContentReplacements is that in the BeforeContentReplacements the internal tokens Omnia uses to insert functionality to the files are still present in the content string.

The content in the AfterContentReplacements resembles exactly the content of the file that is provisioned to SharePoint.

Example of a BeforeContentReplacements method #####

Note

The ProvisioningPipelineTokens class contains the internal tokens still present in the resource files in the BeforeContentReplacements method

Example of an AfterContentReplacements method #####