Example #1
0
  public void loadJobNode(Node arg0) throws LoadJobException {
    try {
      selectionPanel.getClearButton().doClick();
      List fileList = arg0.selectNodes("filelist/file");
      for (int i = 0; fileList != null && i < fileList.size(); i++) {
        Node fileNode = (Node) fileList.get(i);
        if (fileNode != null) {
          Node fileName = (Node) fileNode.selectSingleNode("@name");
          if (fileName != null && fileName.getText().length() > 0) {
            Node filePwd = (Node) fileNode.selectSingleNode("@password");
            selectionPanel
                .getLoader()
                .addFile(
                    new File(fileName.getText()), (filePwd != null) ? filePwd.getText() : null);
          }
        }
      }

      Node fileDestination = (Node) arg0.selectSingleNode("destination/@value");
      if (fileDestination != null) {
        destinationTextField.setText(fileDestination.getText());
      }

      Node fileOverwrite = (Node) arg0.selectSingleNode("overwrite/@value");
      if (fileOverwrite != null) {
        overwriteCheckbox.setSelected(fileOverwrite.getText().equals("true"));
      }

      Node fileCompressed = (Node) arg0.selectSingleNode("compressed/@value");
      if (fileCompressed != null && TRUE.equals(fileCompressed.getText())) {
        outputCompressedCheck.doClick();
      }

      Node filePrefix = (Node) arg0.selectSingleNode("prefix/@value");
      if (filePrefix != null) {
        outPrefixTextField.setText(filePrefix.getText());
      }

      Node pdfVersion = (Node) arg0.selectSingleNode("pdfversion/@value");
      if (pdfVersion != null) {
        for (int i = 0; i < versionCombo.getItemCount(); i++) {
          if (((StringItem) versionCombo.getItemAt(i)).getId().equals(pdfVersion.getText())) {
            versionCombo.setSelectedIndex(i);
            break;
          }
        }
      }

      log.info(GettextResource.gettext(config.getI18nResourceBundle(), "Decrypt section loaded."));
    } catch (Exception ex) {
      log.error(GettextResource.gettext(config.getI18nResourceBundle(), "Error: "), ex);
    }
  }
Example #2
0
 public void resetPanel() {
   ((AbstractPdfSelectionTableModel) selectionPanel.getMainTable().getModel()).clearData();
   destinationTextField.setText("");
   versionCombo.resetComponent();
   outputCompressedCheck.setSelected(false);
   overwriteCheckbox.setSelected(false);
 }
Example #3
0
  public Node getJobNode(Node arg0, boolean savePasswords) throws SaveJobException {
    try {
      if (arg0 != null) {
        Element filelist = ((Element) arg0).addElement("filelist");
        PdfSelectionTableItem[] items = selectionPanel.getTableRows();
        for (int i = 0; i < items.length; i++) {
          Element fileNode = ((Element) filelist).addElement("file");
          fileNode.addAttribute("name", items[i].getInputFile().getAbsolutePath());
          if (savePasswords) {
            fileNode.addAttribute("password", items[i].getPassword());
          }
        }

        Element fileDestination = ((Element) arg0).addElement("destination");
        fileDestination.addAttribute("value", destinationTextField.getText());

        Element fileOverwrite = ((Element) arg0).addElement("overwrite");
        fileOverwrite.addAttribute("value", overwriteCheckbox.isSelected() ? TRUE : FALSE);

        Element fileCompress = ((Element) arg0).addElement("compressed");
        fileCompress.addAttribute("value", outputCompressedCheck.isSelected() ? TRUE : FALSE);

        Element pdfVersion = ((Element) arg0).addElement("pdfversion");
        pdfVersion.addAttribute("value", ((StringItem) versionCombo.getSelectedItem()).getId());

        Element filePrefix = ((Element) arg0).addElement("prefix");
        filePrefix.addAttribute("value", outPrefixTextField.getText());
      }
      return arg0;
    } catch (Exception ex) {
      throw new SaveJobException(ex.getMessage(), ex);
    }
  }