Class TableauServerConnectionUrlTransformer
Default XML transformer that updates Tableau Server connections to account for the URL components of the published data source possibly changing during migration.
Inheritance
TableauServerConnectionUrlTransformer
Implements
Namespace: Tableau.Migration.Engine.Hooks.Transformers.Default
Assembly: Tableau.Migration.dll
Syntax
public class TableauServerConnectionUrlTransformer : XmlContentTransformerBase<IPublishableWorkbook>, IXmlContentTransformer<IPublishableWorkbook>, IContentTransformer<IPublishableWorkbook>, IMigrationHook<IPublishableWorkbook>
Constructors
TableauServerConnectionUrlTransformer(IMigration, IDestinationContentReferenceFinderFactory, ILogger<TableauServerConnectionUrlTransformer>, ISharedResourcesLocalizer)
Creates a new TableauServerConnectionUrlTransformer object.
Declaration
public TableauServerConnectionUrlTransformer(IMigration migration, IDestinationContentReferenceFinderFactory destinationFinderFactory, ILogger<TableauServerConnectionUrlTransformer> logger, ISharedResourcesLocalizer localizer)
Parameters
Type | Name | Description |
---|---|---|
IMigration | migration | The current migration. |
IDestinationContentReferenceFinderFactory | destinationFinderFactory | The destination finder factory. |
ILogger<TableauServerConnectionUrlTransformer> | logger | A logger to use. |
ISharedResourcesLocalizer | localizer | A localizer to user. |
Methods
NeedsXmlTransforming(IPublishableWorkbook)
Finds whether the content item needs any XML changes, returning false prevents file IO from occurring.
Declaration
protected override bool NeedsXmlTransforming(IPublishableWorkbook ctx)
Parameters
Type | Name | Description |
---|---|---|
IPublishableWorkbook | ctx | The content item to inspect. |
Returns
Type | Description |
---|---|
bool | Whether or not the content item needs XML changes. |
Overrides
TransformAsync(IPublishableWorkbook, XDocument, CancellationToken)
Transforms the XML of the content item.
Declaration
public override Task TransformAsync(IPublishableWorkbook ctx, XDocument xml, CancellationToken cancel)
Parameters
Type | Name | Description |
---|---|---|
IPublishableWorkbook | 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. |