/// <summary> /// Handles onclick event on publication form /// </summary> protected override void OnClick() { PublishForm publishForm = new PublishForm(); if (publishForm.Visible) publishForm.Hide(); else publishForm.ShowDialog(); }
/// <summary> /// Method to initiate publication request /// </summary> private void publish() { displayLogsTxtBox.Text = ""; PublicationParams parameters = new PublicationParams(); parameters.Password = txtPassword.Text.Trim(); parameters.UserName = txtUsername.Text.Trim(); parameters.ServerUrl = txtServer.Text.Trim(); parameters.Service = txtService.Text.Trim(); parameters.LogFilePath = logFilePath; parameters.CurrentWorkDir = workDirectory; us.Params = parameters; System.Windows.Forms.Cursor.Current = Cursors.WaitCursor; pr = new PublicationRequest(parameters); pr.determineEndPoint(); try { IGxApplication catalog = null; if (ArcCatalog.Application != null) { catalog = (IGxApplication)ArcCatalog.Application; } if (ArcMap.Application != null) { catalog = (IGxApplication)ArcMap.Application; } IGxObject pGxObject = catalog.Catalog.SelectedObject; String category = pGxObject.Category; String parentCategory = pGxObject.Parent.Category; StringBuilder sb = new StringBuilder(); sb.AppendLine("************ Metadata Publishing started at " + System.DateTime.Now + " ************"); sb.AppendLine("Publication Parameters "); sb.AppendLine("============================================================"); sb.AppendLine("Metadata Server Url : " + parameters.ServerUrl); sb.AppendLine("Publish Metadata Service Name : " + parameters.Service); sb.AppendLine("Selected Workspace Name : " + pGxObject.FullName); sb.AppendLine("Selected container category : " + category); sb.AppendLine("============================================================"); writeLogs(sb.ToString()); publishMetadata(pGxObject, pr); //sb.AppendLine(displayLogsTxtBox.Text); writeLogs("************ Metadata Publishing completed at " + System.DateTime.Now + " ************"); saveSettings(); System.Windows.Forms.Cursor.Current = Cursors.Default; ShowSuccessMessageBox(StringMessages.PublishSuccessMsg + " " + logFilePath + StringMessages.LogFilePath); } catch (Exception ex) { PublishForm.ShowErrorMessageBox(StringMessages.PublishFailureMsg + " " + logFilePath + StringMessages.LogFilePath); } }
/// <summary> /// Handles onclick event on publication form /// </summary> protected override void OnClick() { PublishForm publishForm = new PublishForm(); if (publishForm.Visible) { publishForm.Hide(); } else { publishForm.ShowDialog(); } }