-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from tableau/release/4.0.0
Release 4.0.0
- Loading branch information
Showing
298 changed files
with
13,191 additions
and
4,302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
examples/Csharp.ExampleApplication/Hooks/Transformers/EncryptExtractTransformer.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Logging; | ||
using Tableau.Migration; | ||
using Tableau.Migration.Content; | ||
using Tableau.Migration.Engine.Hooks.Transformers; | ||
using Tableau.Migration.Resources; | ||
|
||
namespace Csharp.ExampleApplication.Hooks.Transformers | ||
{ | ||
#region class | ||
public class EncryptExtractsTransformer<T> : ContentTransformerBase<T> where T : IContentReference, IFileContent, IExtractContent | ||
{ | ||
private readonly ILogger<IContentTransformer<T>>? _logger; | ||
|
||
public EncryptExtractsTransformer(ISharedResourcesLocalizer? localizer, ILogger<IContentTransformer<T>>? logger) : base(localizer, logger) | ||
{ | ||
_logger = logger; | ||
} | ||
|
||
public override async Task<T?> TransformAsync(T itemToTransform, CancellationToken cancel) | ||
{ | ||
itemToTransform.EncryptExtracts = true; | ||
|
||
_logger?.LogInformation( | ||
@"Setting encrypt extract to true for {ContentType} {ContentLocation}", | ||
typeof(T).Name, | ||
itemToTransform.Location); | ||
|
||
return await Task.FromResult(itemToTransform); | ||
} | ||
|
||
public async Task<IPublishableWorkbook?> TransformAsync(IPublishableWorkbook ctx, CancellationToken cancel) | ||
=> await TransformAsync(ctx, cancel); | ||
|
||
public async Task<IPublishableDataSource?> TransformAsync(IPublishableDataSource ctx, CancellationToken cancel) | ||
=> await TransformAsync(ctx, cancel); | ||
} | ||
#endregion | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
examples/Python.ExampleApplication/Hooks/Filters/default_project_filter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from tableau_migration import ( | ||
IProject, | ||
ContentMigrationItem, | ||
ContentFilterBase) | ||
|
||
|
||
class DefaultProjectFilter(ContentFilterBase[IProject]): | ||
def should_migrate(self, item: ContentMigrationItem[IProject]) -> bool: | ||
if item.source_item.name.casefold() == 'Default'.casefold(): | ||
return False | ||
return True |
12 changes: 12 additions & 0 deletions
12
examples/Python.ExampleApplication/Hooks/Filters/unlicensed_user_filter.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from tableau_migration import ( | ||
IUser, | ||
ContentMigrationItem, | ||
ContentFilterBase, | ||
SiteRoles) | ||
|
||
|
||
class UnlicensedUserFilter(ContentFilterBase[IUser]): | ||
def should_migrate(self, item: ContentMigrationItem[IUser]) -> bool: | ||
if item.source_item.license_level.casefold() == SiteRoles.UNLICENSED.casefold(): | ||
return False | ||
return True |
34 changes: 34 additions & 0 deletions
34
...s/Python.ExampleApplication/Hooks/batch_migration_completed/log_migration_batches_hook.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import logging | ||
from typing import TypeVar | ||
from tableau_migration import( | ||
ContentBatchMigrationCompletedHookBase, | ||
IContentBatchMigrationResult, | ||
IUser | ||
) | ||
|
||
T = TypeVar("T") | ||
|
||
class LogMigrationBatchesHook(ContentBatchMigrationCompletedHookBase[T]): | ||
def __init__(self) -> None: | ||
super().__init__() | ||
self._logger = logging.getLogger(__name__) | ||
|
||
def execute(self, ctx: IContentBatchMigrationResult[T]) -> IContentBatchMigrationResult[T]: | ||
|
||
item_status = "" | ||
for item in ctx.item_results: | ||
item_status += "%s: %s".format(item.manifest_entry.source.location, item.manifest_entry.status) | ||
|
||
self._logger.info("%s batch of %d item(s) completed:\n%s", ctx._content_type, ctx.item_results.count, item_status) | ||
|
||
pass | ||
|
||
class LogMigrationBatchesHookForUsers(ContentBatchMigrationCompletedHookBase[IUser]): | ||
def __init__(self) -> None: | ||
super().__init__() | ||
self._content_type = "User"; | ||
|
||
class LogMigrationBatchesHookForGoups(ContentBatchMigrationCompletedHookBase[IUser]): | ||
def __init__(self) -> None: | ||
super().__init__() | ||
self._content_type = "Group"; |
Oops, something went wrong.