Class XmlContentTransformerBase<TPublish>
Abstract base class for transformers that manipulate the Tableau XML file of a content item.
Namespace: Tableau.Migration.Engine.Hooks.Transformers
Assembly: Tableau.Migration.dll
Syntax
public abstract class XmlContentTransformerBase<TPublish> : IXmlContentTransformer<TPublish>, IContentTransformer<TPublish>, IMigrationHook<TPublish> where TPublish : IFileContent
Type Parameters
| Name | Description |
|---|---|
| TPublish |
Methods
NeedsXmlTransforming(TPublish)
Finds whether the content item needs any XML changes, returning false prevents file IO from occurring.
Declaration
protected virtual bool NeedsXmlTransforming(TPublish ctx)
Parameters
| Type | Name | Description |
|---|---|---|
| TPublish | ctx | The content item to inspect. |
Returns
| Type | Description |
|---|---|
| bool | Whether or not the content item needs XML changes. |
TransformAsync(TPublish, XDocument, CancellationToken)
Transforms the XML of the content item.
Declaration
public abstract Task TransformAsync(TPublish ctx, XDocument xml, CancellationToken cancel)
Parameters
| Type | Name | Description |
|---|---|---|
| TPublish | ctx | The content item being transformed. |
| XDocument | xml | The XML of the content item to transform. Any changes made to the XML are persisted back to the file before publishing. |
| CancellationToken | cancel | The cancellation token to obey. |
Returns
| Type | Description |
|---|---|
| Task | A task to await. |