public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails)
        {
            ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);

            // force password check to take place before the pages load
            if (!ConfluencePlugin.ConfluenceConnector.isLoggedIn)
            {
                return(exportInformation);
            }

            Page   selectedPage = page;
            bool   openPage     = (page == null) && config.OpenPageAfterUpload;
            string filename     = FilenameHelper.GetFilenameWithoutExtensionFromPattern(coreConfig.OutputFileFilenamePattern, captureDetails);

            if (selectedPage == null)
            {
                ConfluenceUpload confluenceUpload = new ConfluenceUpload(filename);
                Nullable <bool>  dialogResult     = confluenceUpload.ShowDialog();
                if (dialogResult.HasValue && dialogResult.Value)
                {
                    selectedPage = confluenceUpload.SelectedPage;
                    if (confluenceUpload.isOpenPageSelected)
                    {
                        openPage = false;
                    }
                    filename = confluenceUpload.Filename;
                }
            }
            string extension = "." + config.UploadFormat;

            if (!filename.ToLower().EndsWith(extension))
            {
                filename = filename + extension;
            }
            if (selectedPage != null)
            {
                string errorMessage;
                bool   uploaded = upload(surface, selectedPage, filename, out errorMessage);
                if (uploaded)
                {
                    if (openPage)
                    {
                        try {
                            Process.Start(selectedPage.Url);
                        } catch { }
                    }
                    exportInformation.ExportMade = true;
                    exportInformation.Uri        = selectedPage.Url;
                }
                else
                {
                    exportInformation.ErrorMessage = errorMessage;
                }
            }
            ProcessExport(exportInformation, surface);
            return(exportInformation);
        }
Exemplo n.º 2
0
		public ConfluenceSearch(ConfluenceUpload confluenceUpload) {
			this.confluenceUpload = confluenceUpload;
			this.DataContext = this;
			InitializeComponent();
			if (config.SearchSpaceKey == null) {
				this.SpaceComboBox.SelectedItem = Spaces[0];
			} else {
				foreach(Confluence.Space space in Spaces) {
					if (space.Key.Equals(config.SearchSpaceKey)) {
						this.SpaceComboBox.SelectedItem = space;
					}
				}
			}
		}
Exemplo n.º 3
0
 public ConfluenceSearch(ConfluenceUpload confluenceUpload)
 {
     _confluenceUpload = confluenceUpload;
     DataContext       = this;
     InitializeComponent();
     if (ConfluenceConfig.SearchSpaceKey == null)
     {
         SpaceComboBox.SelectedItem = Spaces.FirstOrDefault();
     }
     else
     {
         foreach (var space in Spaces)
         {
             if (space.Key.Equals(ConfluenceConfig.SearchSpaceKey))
             {
                 SpaceComboBox.SelectedItem = space;
             }
         }
     }
 }
Exemplo n.º 4
0
 public ConfluenceSearch(ConfluenceUpload confluenceUpload)
 {
     this.confluenceUpload = confluenceUpload;
     this.DataContext      = this;
     InitializeComponent();
     if (config.SearchSpaceKey == null)
     {
         this.SpaceComboBox.SelectedItem = Spaces[0];
     }
     else
     {
         foreach (Confluence.Space space in Spaces)
         {
             if (space.Key.Equals(config.SearchSpaceKey))
             {
                 this.SpaceComboBox.SelectedItem = space;
             }
         }
     }
 }
Exemplo n.º 5
0
		public override ExportInformation ExportCapture(bool manuallyInitiated, ISurface surface, ICaptureDetails captureDetails) {
			ExportInformation exportInformation = new ExportInformation(this.Designation, this.Description);
			// force password check to take place before the pages load
			if (!ConfluencePlugin.ConfluenceConnector.isLoggedIn) {
				return exportInformation;
			}

			Page selectedPage = page;
			bool openPage = (page == null) && config.OpenPageAfterUpload;
			string filename = FilenameHelper.GetFilenameWithoutExtensionFromPattern(coreConfig.OutputFileFilenamePattern, captureDetails);
			if (selectedPage == null) {
				ConfluenceUpload confluenceUpload = new ConfluenceUpload(filename);
				Nullable<bool> dialogResult = confluenceUpload.ShowDialog();
				if (dialogResult.HasValue && dialogResult.Value) {
					selectedPage = confluenceUpload.SelectedPage;
					if (confluenceUpload.isOpenPageSelected) {
						openPage = false;
					}
					filename = confluenceUpload.Filename;
				}
			}
			string extension = "." + config.UploadFormat;
			if (!filename.ToLower().EndsWith(extension)) {
				filename = filename + extension;
			}
			if (selectedPage != null) {
				string errorMessage;
				bool uploaded = upload(surface, selectedPage, filename, out errorMessage);
				if (uploaded) {
					if (openPage) {
						try {
							Process.Start(selectedPage.Url);
						} catch { }
					}
					exportInformation.ExportMade = true;
					exportInformation.Uri = selectedPage.Url;
				} else {
					exportInformation.ErrorMessage = errorMessage;
				}
			}
			ProcessExport(exportInformation, surface);
			return exportInformation;
		}
Exemplo n.º 6
0
 public ConfluenceTreePicker(ConfluenceUpload confluenceUpload)
 {
     _confluenceConnector = ConfluencePlugin.ConfluenceConnector;
     _confluenceUpload    = confluenceUpload;
     InitializeComponent();
 }
Exemplo n.º 7
0
 public ConfluencePagePicker(ConfluenceUpload confluenceUpload)
 {
     this.confluenceUpload = confluenceUpload;
     this.DataContext      = ConfluenceUtils.GetCurrentPages();
     InitializeComponent();
 }
Exemplo n.º 8
0
		public ConfluenceTreePicker(ConfluenceUpload confluenceUpload) {
			this.confluenceConnector = ConfluencePlugin.ConfluenceConnector;
			this.confluenceUpload = confluenceUpload;
			InitializeComponent();
		}
Exemplo n.º 9
0
		public ConfluencePagePicker(ConfluenceUpload confluenceUpload, List<Page> pagesToPick) {
			this.confluenceUpload = confluenceUpload;
			this.DataContext = pagesToPick;
			InitializeComponent();
		}
Exemplo n.º 10
0
 public ConfluencePagePicker(ConfluenceUpload confluenceUpload, List <Page> pagesToPick)
 {
     _confluenceUpload = confluenceUpload;
     DataContext       = pagesToPick;
     InitializeComponent();
 }