public static GenerateCommandLine_SiteExport ( bool showPasswordInUi, string pathToExportDir, string siteUrl, string userName, string password, bool isSiteAdmin, string exportSingleProject, string exportOnlyWithTag, bool removeExportTag, string pathToLogFile, string pathToErrorsFile, bool backgroundKeepAliveRequests, bool logVerbose, bool generateDownloadInfoFiles, string &commandLineOut, CommandLineParser, &parsedCommandLine ) : void | ||
showPasswordInUi | bool | |
pathToExportDir | string | |
siteUrl | string | |
userName | string | |
password | string | |
isSiteAdmin | bool | |
exportSingleProject | string | |
exportOnlyWithTag | string | |
removeExportTag | bool | |
pathToLogFile | string | |
pathToErrorsFile | string | |
backgroundKeepAliveRequests | bool | |
logVerbose | bool | |
generateDownloadInfoFiles | bool | |
commandLineOut | string | Command line as text ready to show the user |
parsedCommandLine | CommandLineParser, | Command line as set of |
Результат | void |
/// <summary> /// Creates the task we use to export a Tableau Server sites content to the local file system /// </summary> /// <returns></returns> private TaskMaster CreateAsyncExportTask(bool showPasswordInUi) { string siteUrl = txtUrlExportFrom.Text; bool useAccessToken = (comboBoxAuthMethodExportFrom.SelectedIndex == 1); string signInUser = txtIdExportFrom.Text; string signInPassword = txtPasswordExportFrom.Text; bool isSiteAdmin = chkExportUserIsAdmin.Checked; string exportOnlySingleProject = txtExportSingleProject.Text.Trim(); string exportOnlyWithTag = txtExportOnlyTagged.Text.Trim(); //---------------------------------------------------------------------- //Sanity test the sign in. If this fails, then there is no point in //moving forward //---------------------------------------------------------------------- bool signInTest = ValidateSignInPossible(siteUrl, useAccessToken, signInUser, signInPassword); if (!signInTest) { return(null); } var onlineUrls = TableauServerUrls.FromContentUrl(siteUrl, TaskMasterOptions.RestApiReponsePageSizeDefault); var nowTime = DateTime.Now; //Local path string localPathForSiteOutput = GeneratePathFromSiteUrl(onlineUrls); localPathForSiteOutput = FileIOHelper.PathDateTimeSubdirectory(localPathForSiteOutput, true, "siteExport", nowTime); //Log file string localPathForLogFile = Path.Combine(localPathForSiteOutput, "siteExport_log.txt"); //Errors file string localPathForErrorsFile = Path.Combine(localPathForSiteOutput, "siteExport_errors.txt"); //----------------------------------------------------------------- //Generate a command line //----------------------------------------------------------------- string commandLineAsText; CommandLineParser commandLineParsed; CommandLineParser.GenerateCommandLine_SiteExport( showPasswordInUi, localPathForSiteOutput, siteUrl, useAccessToken, signInUser, signInPassword, isSiteAdmin, exportOnlySingleProject, exportOnlyWithTag, chkExportRemoveExportTag.Checked, localPathForLogFile, localPathForErrorsFile, chkExportContentsWithKeepAlive.Checked, chkVerboseLog.Checked, chkGenerateDownloadMetadataFiles.Checked, out commandLineAsText, out commandLineParsed); //Show the user the command line, so that they can copy/paste and run it textSiteExportCommandLine.Text = PathHelper.GetApplicaitonPath() + " " + commandLineAsText; //===================================================================== //Create the task //===================================================================== return(TaskMaster.FromCommandLine(commandLineParsed)); }