Interface IJsonContentTransformer<TPublish>
Interface for a content transformer that manipulates the Tableau JSON file of a content item.
Inherited Members
Namespace: Tableau.Migration.Engine.Hooks.Transformers
Assembly: Tableau.Migration.dll
Syntax
public interface IJsonContentTransformer<TPublish> : IContentTransformer<TPublish>, IMigrationHook<TPublish> where TPublish : IFileContent
Type Parameters
| Name | Description |
|---|---|
| TPublish | The publishable content type. |
Methods
NeedsJsonTransforming(TPublish)
Finds whether the content item needs any JSON changes, returning false prevents file IO from occurring.
Declaration
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
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. |