From 4c7de71d04ef0a54d8968d785a1a07498f8d612e Mon Sep 17 00:00:00 2001 From: Nathan Kinder Date: Wed, 14 Aug 2013 12:45:58 -0700 Subject: [PATCH] Ticket 47467 - Improve CRL import dialog text The CRL/CKL import dialog doesn't give any information about the required format for the CRL/CKL file. This patch improves the text to state that the file should be in PEM format and it needs to exist in the server security directory. The message was also tweaked slightly to indicate that a filename should be specified as opposed to a path. I didn't want to make the message too long, but this at least provides a hint. If a path is entered, the security CGI returns a detailed error messages stating that full and absolute paths are not allowed as well as the expected file location. --- .../client/security/InstallCRLDialog.java | 21 +++++++++++++++++++-- .../client/security/securityResource.properties | 7 ++++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/com/netscape/management/client/security/InstallCRLDialog.java b/src/com/netscape/management/client/security/InstallCRLDialog.java index a2c7e2b..bcc6d31 100644 --- a/src/com/netscape/management/client/security/InstallCRLDialog.java +++ b/src/com/netscape/management/client/security/InstallCRLDialog.java @@ -90,8 +90,17 @@ class InstallCRLDialog extends AbstractDialog implements SuiConstants { setTitle(resource.getString("InstallCRLDialog", "title")); + // Create a text area that looks like a multi-line label. + JTextArea description = new JTextArea(resource.getString("InstallCRLDialog", "description")); + description.setLineWrap(true); + description.setWrapStyleWord(true); + description.setMargin(UIManager.getInsets("Label.margin")); + description.setBackground(UIManager.getColor("Label.background")); + description.setForeground(UIManager.getColor("Label.foreground")); + description.setFont(UIManager.getFont("Label.font")); + JLabel enterFile = new JLabel(resource.getString("InstallCRLDialog", "enterFilename")); - enterFile.setLabelFor(filename); + enterFile.setLabelFor(filename); crl = new JRadioButton(resource.getString("InstallCRLDialog", "crl"), true); krl = new JRadioButton(resource.getString("InstallCRLDialog", "krl"), false); ButtonGroup g = new ButtonGroup(); @@ -102,12 +111,18 @@ class InstallCRLDialog extends AbstractDialog implements SuiConstants { int y = 0; - GridBagUtil.constrain(getContentPane(), enterFile, + GridBagUtil.constrain(getContentPane(), description, 0, y, 1, 1, 1.0, 0.0, GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, 0, 0, COMPONENT_SPACE, 0); + GridBagUtil.constrain(getContentPane(), enterFile, + 0, ++y, 1, 1, + 1.0, 0.0, + GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, + 0, 0, COMPONENT_SPACE, 0); + GridBagUtil.constrain(getContentPane(), filename, 0, ++y, 1, 1, @@ -127,7 +142,9 @@ class InstallCRLDialog extends AbstractDialog implements SuiConstants { GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, 0, 0, 0, 0); + // We need to pack twice to prevent our text area from being truncated. pack(); + pack(); setResizable(false); } diff --git a/src/com/netscape/management/client/security/securityResource.properties b/src/com/netscape/management/client/security/securityResource.properties index d1dc5c5..a6dfd22 100644 --- a/src/com/netscape/management/client/security/securityResource.properties +++ b/src/com/netscape/management/client/security/securityResource.properties @@ -163,9 +163,10 @@ EditTrustDialog-trustServerLabel=Making connections to other servers. (Server Au # Install CRL InstallCRLDialog-help=admin InstallCRLDialog-title=Add CRL/CKL -InstallCRLDialog-enterFilename=Enter CRL/CKL file: -InstallCRLDialog-crl=File contain a Certificate Revocation List (CRL) -InstallCRLDialog-krl=File contain a Compromised Key List (CKL) +InstallCRLDialog-description=This adds a CRL/CKL from a PEM formatted file. The CRL/CKL file must reside in the server security directory. +InstallCRLDialog-enterFilename=Enter CRL/CKL filename: +InstallCRLDialog-crl=File contains a Certificate Revocation List (CRL) +InstallCRLDialog-krl=File contains a Compromised Key List (CKL) # Certificate Info - Detail Certificate Info -- 1.7.11.7