Exemplo n.º 1
0
    /// <summary>
    /// Constructor
    /// </summary>
    /// <param name="jobName">Name to associate with this work</param>
    /// <param name="onlineUrls"></param>
    /// <param name="userName"></param>
    /// <param name="password"></param>
    /// <param name="taskOptions"></param>
    /// <param name="manualActions"></param>
    public TaskMaster(
        string jobName,
        TableauServerUrls onlineUrls, 
        string userName, 
        string password,
        TaskMasterOptions taskOptions,
        CustomerManualActionManager manualActions = null)
    {
        this.JobName = jobName;

        _manualActions = manualActions;
        if(_manualActions == null)
        {
            _manualActions = new CustomerManualActionManager();
        }
        //Get any export path
        _exportToLocalPath = taskOptions.GetOptionValue(TaskMasterOptions.OptionParameter_PathDownloadTo);
        _onlineUrls = onlineUrls;
        _userName = userName;
        _password = password;

        //Store the status log at the class level where it is accessable
        _statusLog = new TaskStatusLogs();
        //Store the options
        _taskOptions = taskOptions;

        if(_taskOptions.IsOptionSet(TaskMasterOptions.Option_LogVerbose))
        {
            _statusLog.SetStatusLoggingLevel(int.MinValue);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// Constructor
    /// </summary>
    /// <param name="jobName">Name to associate with this work</param>
    /// <param name="onlineUrls"></param>
    /// <param name="userName"></param>
    /// <param name="password"></param>
    /// <param name="taskOptions"></param>
    /// <param name="manualActions"></param>
    public TaskMaster(
        string jobName,
        TableauServerUrls onlineUrls,
        string userName,
        string password,
        TaskMasterOptions taskOptions,
        CustomerManualActionManager manualActions = null)
    {
        this.JobName = jobName;

        _manualActions = manualActions;
        if (_manualActions == null)
        {
            _manualActions = new CustomerManualActionManager();
        }
        //Get any export path
        _exportToLocalPath = taskOptions.GetOptionValue(TaskMasterOptions.OptionParameter_PathDownloadTo);
        _onlineUrls        = onlineUrls;
        _userName          = userName;
        _password          = password;

        //Store the status log at the class level where it is accessable
        _statusLog = new TaskStatusLogs();
        //Store the options
        _taskOptions = taskOptions;


        if (_taskOptions.IsOptionSet(TaskMasterOptions.Option_LogVerbose))
        {
            _statusLog.SetStatusLoggingLevel(int.MinValue);
        }
    }
Exemplo n.º 3
0
        /// <summary>
        /// Sanity cehck for sign in
        /// </summary>
        /// <param name="siteUrl"></param>
        /// <param name="signInUser"></param>
        /// <param name="signInPassword"></param>
        /// <returns></returns>
        private bool ValidateSignInPossible(string siteUrl, bool useAccessToken, string signInUser, string signInPassword)
        {
            var testSignInStatusLog = new TaskStatusLogs();

            testSignInStatusLog.SetStatusLoggingLevel(int.MinValue);
            try
            {
                TableauServerSignIn.VerifySignInPossible(siteUrl, useAccessToken, signInUser, signInPassword, testSignInStatusLog);
            }
            catch
            {
                MessageBox.Show("Sign in to your Tableau Server failed. Please check URL and credentials");
                textBoxStatus.Text = testSignInStatusLog.StatusText;
                textBoxErrors.Text = testSignInStatusLog.ErrorText;
                return(false);
            }
            return(true);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Sanity cehck for sign in 
 /// </summary>
 /// <param name="siteUrl"></param>
 /// <param name="signInUser"></param>
 /// <param name="signInPassword"></param>
 /// <returns></returns>
 private bool ValidateSignInPossible(string siteUrl, string signInUser, string signInPassword)
 {
     var testSignInStatusLog = new TaskStatusLogs();
     testSignInStatusLog.SetStatusLoggingLevel(int.MinValue);
     try
     {
         TableauServerSignIn.VerifySignInPossible(siteUrl, signInUser, signInPassword, testSignInStatusLog);
     }
     catch
     {
         MessageBox.Show("Sign in to your Tableau Server failed. Please check URL and credentials");
         textBoxStatus.Text = testSignInStatusLog.StatusText;
         textBoxErrors.Text = testSignInStatusLog.ErrorText;
         return false;
     }
     return true;
 }