예제 #1
0
    /// <summary>
    /// Queries a site for all its users, and for recent content.
    /// Genterates and sends email to all the users
    /// </summary>
    /// <param name="showLogsHere"></param>
    /// <param name="statusLogs"></param>
    public void Execute()
    {
        WorkingListSiteUsers workingList_allKnownUsers = null;
        //==================================================================================
        //Get the data we need to run
        //==================================================================================
        //Generate the URLs we will need
        var siteUrlManager = TableauServerUrls.FromContentUrl(_config.SiteUrl, TaskMasterOptions.RestApiReponsePageSizeDefault);

        //=================================================================================
        //Sign in to the site
        //=================================================================================
        var siteSignIn = new TableauServerSignIn(
            siteUrlManager,
            _config.SiteClientId,
            _config.Secret,
            _statusLogs,
            _config.SiteSignInMode);

        var signInSuccess = siteSignIn.Execute();

        ShowLogs();

        //=================================================================================
        //Get the basic site info
        //=================================================================================
        var downloadSiteInfo = new DownloadSiteInfo(siteSignIn);

        downloadSiteInfo.ExecuteRequest();
        var siteInfo = downloadSiteInfo.Site;

        ShowLogs();
        //=================================================================================
        //Provision the users
        //=================================================================================
        workingList_allKnownUsers = Execute_ProvisionUsers(siteSignIn);
        ShowLogs();

        //=================================================================================
        //Provision the groups
        //=================================================================================
        Execute_ProvisionGroups(siteSignIn, workingList_allKnownUsers);

        //=================================================================================
        //Content ownership changes
        //=================================================================================
        Execute_ProvisionContentOwnershipChanges(siteSignIn, workingList_allKnownUsers);
    }
예제 #2
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="onlineLogin"></param>
    private SiteinfoSite Execute_DownloadSiteInfo(TableauServerSignIn onlineLogin)
    {
        SiteinfoSite site = null;

        _statusLog.AddStatusHeader("Request site info");
        try
        {
            var getSiteInfo = new DownloadSiteInfo(_onlineUrls, onlineLogin);
            getSiteInfo.ExecuteRequest();
            site = getSiteInfo.Site;
        }
        catch (Exception exSite)
        {
            _statusLog.AddError("Error getting site info, " + exSite.ToString());
        }

        return(site);
    }
예제 #3
0
    /// <summary>
    /// Queries a site for all its users, and for recent content.
    /// Genterates and sends email to all the users
    /// </summary>
    /// <param name="showLogsHere"></param>
    /// <param name="statusLogs"></param>
    public void Execute()
    {
        //==================================================================================
        //Get the data we need to run
        //==================================================================================
        //Generate the URLs we will need
        var siteUrlManager = TableauServerUrls.FromContentUrl(_configTableauSecrets.SiteUrl, TaskMasterOptions.RestApiReponsePageSizeDefault);

        //=================================================================================
        //Sign in to the site
        //=================================================================================
        var siteSignIn = new TableauServerSignIn(
            siteUrlManager,
            _configTableauSecrets.SiteClientId,
            _configTableauSecrets.Secret,
            _statusLogs,
            _configTableauSecrets.SiteSignInMode);

        var signInSuccess = siteSignIn.Execute();

        ShowLogs();

        //=================================================================================
        //Get the basic site info
        //=================================================================================
        var downloadSiteInfo = new DownloadSiteInfo(siteSignIn);

        downloadSiteInfo.ExecuteRequest();
        var siteInfo = downloadSiteInfo.Site;

        //===================================================================================
        //Get Groups that map to Tableau Site User Roles from Tableau
        //===================================================================================
        _statusLogs.AddStatus("Tableau: Getting user roles groups");
        GenerateUsersRolesList_FromTableauSite(siteSignIn);

        //===================================================================================
        //Get Groups that map to Tableau Site Groups from Tableau
        //===================================================================================
        _statusLogs.AddStatus("Tableau: Getting user roles groups");
        GenerateGroupsMembersList_FromTableauSite(siteSignIn);
    }
예제 #4
0
    /// <summary>
    ///
    /// </summary>
    /// <param name="onlineLogin"></param>
    private SiteinfoSite Execute_DownloadSiteInfo(TableauServerSignIn onlineLogin)
    {
        SiteinfoSite site = null;

        _statusLog.AddStatusHeader("Request site info");
        try
        {
            var getSiteInfo = new DownloadSiteInfo(_onlineUrls, onlineLogin);
            getSiteInfo.ExecuteRequest();
            site = getSiteInfo.Site;
        }
        catch (Exception exSite)
        {
            _statusLog.AddError("Error getting site info, " + exSite.ToString());
        }

        return site;
    }
예제 #5
0
        protected SiteInfo GetSiteInfo()
        {
            var getSiteInfoRequest = new DownloadSiteInfo(Urls, Login, HttpClientFactory);

            return(getSiteInfoRequest.ExecuteRequest());
        }