Beispiel #1
0
        private void Exportbutton_Click(object sender, EventArgs e)
        {
            ApiHandler.InitializeExport();

            if (MultiExportSetNameBox.Text.IndexOfAny(Path.GetInvalidFileNameChars()) >= 0)
            {
                MessageBox.Show("The export set name contains invalid characters");
                return;
            }

            if (PubSelCountLabel.Text == "0")
            {
                MessageBox.Show("Please select one or more publications first");
                return;
            }
            if (MultiExportSetNameBox.Text == "")
            {
                MessageBox.Show("Please enter a name for the export set");
                return;
            }
            FolderBrowserDialog fbd = new FolderBrowserDialog();

            if (fbd.ShowDialog() == DialogResult.OK)
            {
                int c = 0;
                ApiHandler.exportSetName = MultiExportSetNameBox.Text;
                string ExportPath = fbd.SelectedPath + "\\" + MultiExportSetNameBox.Text;
                ApiHandler.SetExportPath(ExportPath);
                //string ExportPathOriginals = ExportPath + "\\Originals";
                string ExportPathFiles = ExportPath + "\\Files";

                if (Directory.Exists(ExportPath))
                {
                    MessageBox.Show("Folder:\n" + ExportPath + "\n already exists.");
                    return;
                }
                DirectoryInfo di = Directory.CreateDirectory(ExportPath);
                //DirectoryInfo dio = Directory.CreateDirectory(ExportPathOriginals);
                DirectoryInfo dif = Directory.CreateDirectory(ExportPathFiles);

                for (int i = 0; i < PublicationsListBox.Items.Count; i++)
                {
                    if (PublicationsListBox.GetItemChecked(i))
                    {
                        PurePublication SelectedPublication = (PurePublication)PublicationsListBox.Items[i];
                        ApiHandler.enqueueExportItem(SelectedPublication.UUID);
                    }
                }
                ApiHandler.exportPublicationSet();
            }
        }
Beispiel #2
0
 private void ShowInRecordConversionButton_Click(object sender, EventArgs e)
 {
     if (PublicationsListBox.SelectedItem != null)
     {
         PurePublication SelectedPublication = (PurePublication)PublicationsListBox.SelectedItem;
         PubIDBox.Text = SelectedPublication.UUID;
         tabControl1.SelectTab(3);
         ConversionXSLTGoButton.PerformClick();
     }
     else
     {
         MessageBox.Show("Please select a record from the list");
     }
 }