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