Die Menüführung in FinanzOnline wurde aus technischen Gründen geändert. Da Sie möglicherweise eine veraltete und nicht mehr dem letzten Sicherheitsstandard entsprechende Version Ihres Webbrowsers verwenden, besteht ab diesem Zeitpunkt die Möglichkeit, dass das Menü in FinanzOnline nicht richtig angezeigt werden kann.
+ Elektronisches Lernprogramm zur Handhabung von FinanzOnline und Durchführung der Arbeitnehmerveranlagung
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/BKUOnline/src/main/webapp/index.html b/BKUOnline/src/main/webapp/index.html
index 8f1a338e..bf8b3ae0 100644
--- a/BKUOnline/src/main/webapp/index.html
+++ b/BKUOnline/src/main/webapp/index.html
@@ -49,6 +49,8 @@
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
index 5124914a..4a338f23 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
@@ -17,16 +17,23 @@
package at.gv.egiz.bku.gui;
public class BKUGUIFactory {
+
+ public static final String SIMPLE_GUI = "simple";
+ public static final String ADVANCED_GUI = "advanced";
+
private static BKUGUIFactory instance = new BKUGUIFactory();
private BKUGUIFactory() {
}
- protected BKUGUIFacade createNewGUI() {
+ protected BKUGUIFacade createNewGUI(String style) {
+ if (ADVANCED_GUI.equals(style)) {
+ return new BKUGUI();
+ }
return new SimpleGUI();
}
- public static BKUGUIFacade createGUI() {
- return instance.createNewGUI();
+ public static BKUGUIFacade createGUI(String style) {
+ return instance.createNewGUI(style);
}
}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index 0bdff867..c5736648 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -50,7 +50,7 @@ public class SMCCSTALFactory implements STALFactory {
resourceBundle = ResourceBundle.getBundle(BKUApplet.RESOURCE_BUNDLE_BASE);
}
dialog = new JDialog();
- BKUGUIFacade gui = BKUGUIFactory.createGUI();
+ BKUGUIFacade gui = BKUGUIFactory.createGUI(BKUGUIFactory.ADVANCED_GUI);
gui.init(dialog.getContentPane(), locale.toString(), null);
stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog, resourceBundle);
dialog.setPreferredSize(new Dimension(400, 200));
diff --git a/BKUOnline/src/main/webapp/appletPage.jsp b/BKUOnline/src/main/webapp/appletPage.jsp
index 903c762d..950141c4 100644
--- a/BKUOnline/src/main/webapp/appletPage.jsp
+++ b/BKUOnline/src/main/webapp/appletPage.jsp
@@ -51,11 +51,13 @@
height :<%=height%>
};
var parameters = {
- background : '<%=backgroundImg%>',
+ GuiStyle : 'simple',
+ Background : '<%=backgroundImg%>',
WSDL_URL :'../stal?wsdl',
+ HashDataDisplay : 'external',
HashDataURL : '../hashDataInput',
SessionID : '<%=session.getId()%>',
- redirectURL : '../bkuResult'
+ RedirectURL : '../bkuResult'
};
var version = '1.6.0_02';
deployJava.runApplet(attributes, parameters, version);
--
cgit v1.2.3
From de95f8219adf98710992b6716778b174bc2d2fcc Mon Sep 17 00:00:00 2001
From: clemenso
Date: Mon, 13 Oct 2008 16:43:46 +0000
Subject: BKUGUI / SimpleGUI aligned
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@109 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/src/test/resources/appletTest.html | 2 +-
.../src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 112 +++------------------
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 104 +++----------------
3 files changed, 26 insertions(+), 192 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html
index b8a0770e..472000de 100644
--- a/BKUApplet/src/test/resources/appletTest.html
+++ b/BKUApplet/src/test/resources/appletTest.html
@@ -20,7 +20,7 @@
-
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 53ec1088..64cd9f50 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -67,7 +67,7 @@ public class BKUGUI implements BKUGUIFacade {
private static final Log log = LogFactory.getLog(BKUGUI.class);
public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
- public static final String LOGO_RESOURCE = "/images/logo.png";
+ public static final String DEFAULT_BACKGROUND = "/images/mocca_default.png"; //logo.png";
public static final String HASHDATA_FONT = "Monospaced";
public static final Color ERROR_COLOR = Color.RED;
public static final Color HYPERLINK_COLOR = Color.BLUE;
@@ -192,11 +192,19 @@ public class BKUGUI implements BKUGUIFacade {
protected void initContentPanel(URL background) {
- contentPanel = new JPanel();
+ if (background == null) {
+ background = this.getClass().getResource(DEFAULT_BACKGROUND);
+ }
+ contentPanel = new ImagePanel(background);
+// contentPanel.setBorder(new TitledBorder("content"));
+
// headerPanel = new JPanel();
- mainPanel = new JPanel();
- buttonPanel = new JPanel();
+// headerPanel.setOpaque(false);
+// mainPanel = new JPanel();
+// mainPanel.setOpaque(false);
+// buttonPanel = new JPanel();
+// buttonPanel.setOpaque(false);
// headerPanel.setBorder(new TitledBorder("header"));
// mainPanel.setBorder(new TitledBorder("main"));
@@ -389,16 +397,12 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
-// buttonPanelLayout.linkSize(cancelButton, okButton, signButton, backButton, saveButton);
buttonPanelLayout.setHorizontalGroup(
buttonPanelLayout.createSequentialGroup()
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
buttonPanelLayout.setVerticalGroup(
buttonPanelLayout.createSequentialGroup()
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(cancelButton));
contentPanel.validate();
@@ -452,16 +456,12 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
-// buttonPanelLayout.linkSize(cancelButton, okButton, signButton, backButton, saveButton);
buttonPanelLayout.setHorizontalGroup(
buttonPanelLayout.createSequentialGroup()
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
buttonPanelLayout.setVerticalGroup(
buttonPanelLayout.createSequentialGroup()
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(cancelButton));
contentPanel.validate();
@@ -522,8 +522,8 @@ public class BKUGUI implements BKUGUIFacade {
});
JLabel infoLabel = new JLabel();
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (numRetries < 0) {
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
String pinsizePattern = messages.getString(LABEL_PINSIZE);
String pinSize = String.valueOf(pinSpec.getMinLength());
if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
@@ -593,7 +593,6 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
-// buttonPanelLayout.linkSize(cancelButton, okButton, signButton, backButton, saveButton);
buttonPanelLayout.setHorizontalGroup(
buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
@@ -738,7 +737,6 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
-// buttonPanelLayout.linkSize(cancelButton, okButton, signButton, backButton, saveButton);
buttonPanelLayout.setHorizontalGroup(
buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
@@ -844,16 +842,12 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
-// buttonPanelLayout.linkSize(cancelButton, okButton, signButton, backButton, saveButton);
buttonPanelLayout.setHorizontalGroup(
buttonPanelLayout.createSequentialGroup()
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
buttonPanelLayout.setVerticalGroup(
buttonPanelLayout.createSequentialGroup()
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(okButton));
contentPanel.validate();
@@ -1068,7 +1062,6 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
- // buttonPanelLayout.linkSize(cancelButton, okButton, signButton, backButton, saveButton);
buttonPanelLayout.setHorizontalGroup(
buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
@@ -1211,7 +1204,6 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
- // buttonPanelLayout.linkSize(cancelButton, okButton, signButton, backButton, saveButton);
buttonPanelLayout.setHorizontalGroup(
buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
@@ -1343,82 +1335,4 @@ public class BKUGUI implements BKUGUIFacade {
}
}
}
-
-// private String parseToken(final char[] terminators) {
-// char ch;
-// i1 = pos;
-// i2 = pos;
-// while (hasChar()) {
-// ch = chars[pos];
-// if (isOneOf(ch, terminators)) {
-// break;
-// }
-// i2++;
-// pos++;
-// }
-// return getToken(false);
-// }
-
-// private static String getCharset(String contentType) {
-//
-// StringTokenizer t = new StringTokenizer
-//
-// if (contentType == null) {
-// return "UTF-8";
-// }
-//
-// int pos = 0;
-// int len = contentType.length();
-//
-// while (pos < len) {
-// pos++;
-// String paramName = parseToken(new char[] {
-// '=', separator });
-// }
-//
-// HashMap params = new HashMap();
-// this.chars = chars;
-// this.pos = offset;
-// this.len = length;
-//
-// String paramName = null;
-// String paramValue = null;
-// while (hasChar()) {
-// paramName = parseToken(new char[] {
-// '=', separator });
-// paramValue = null;
-// if (hasChar() && (chars[pos] == '=')) {
-// pos++; // skip '='
-// paramValue = parseQuotedToken(new char[] {
-// separator });
-// }
-// if (hasChar() && (chars[pos] == separator)) {
-// pos++; // skip separator
-// }
-// if ((paramName != null) && (paramName.length() > 0)) {
-// if (this.lowerCaseNames) {
-// paramName = paramName.toLowerCase();
-// }
-// params.put(paramName, paramValue);
-// }
-// }
-// return params;
-//
-//
-//
-// Parser
-// ParameterParser pf = new ParameterParser();
-// pf.setLowerCaseNames(true);
-// Map map = pf.parse(contentType, SEPERATOR);
-// String retVal = (String) map.get(CHAR_SET);
-// if ((retVal == null) && (replaceNullWithDefault)) {
-// if (map.containsKey(APPLICATION_URL_ENCODED)) {
-// // default charset for url encoded data
-// return "UTF-8";
-// }
-// retVal = getDefaultCharset();
-// }
-// return retVal;
-// }
-
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index 8e32d67e..e323d195 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -54,7 +54,6 @@ import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.LayoutStyle;
import javax.swing.SwingUtilities;
-import javax.swing.border.TitledBorder;
import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
import org.apache.commons.logging.Log;
@@ -196,14 +195,15 @@ public class SimpleGUI implements BKUGUIFacade {
if (background == null) {
background = this.getClass().getResource(DEFAULT_BACKGROUND);
}
- contentPanel = new ImagePanel(background);
+ contentPanel = new ImagePanel(background);
// contentPanel.setBorder(new TitledBorder("content"));
// headerPanel = new JPanel();
+// headerPanel.setOpaque(false);
mainPanel = new JPanel();
mainPanel.setOpaque(false);
- buttonPanel = new JPanel(); // new ImagePanel(LOGO_RESOURCE); //new JPanel();
+ buttonPanel = new JPanel();
buttonPanel.setOpaque(false);
// headerPanel.setBorder(new TitledBorder("header"));
@@ -570,13 +570,12 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) //))
- .addComponent(infoLabel));
+ mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
+ .addComponent(infoLabel)));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
@@ -589,7 +588,6 @@ public class SimpleGUI implements BKUGUIFacade {
.addComponent(infoLabel));
// .addGap(signPinLabel.getFont().getSize()));
-
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -731,9 +729,9 @@ public class SimpleGUI implements BKUGUIFacade {
.addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
.addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(infoLabel));
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(infoLabel))));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
@@ -1384,82 +1382,4 @@ public class SimpleGUI implements BKUGUIFacade {
}
}
}
-
-// private String parseToken(final char[] terminators) {
-// char ch;
-// i1 = pos;
-// i2 = pos;
-// while (hasChar()) {
-// ch = chars[pos];
-// if (isOneOf(ch, terminators)) {
-// break;
-// }
-// i2++;
-// pos++;
-// }
-// return getToken(false);
-// }
-
-// private static String getCharset(String contentType) {
-//
-// StringTokenizer t = new StringTokenizer
-//
-// if (contentType == null) {
-// return "UTF-8";
-// }
-//
-// int pos = 0;
-// int len = contentType.length();
-//
-// while (pos < len) {
-// pos++;
-// String paramName = parseToken(new char[] {
-// '=', separator });
-// }
-//
-// HashMap params = new HashMap();
-// this.chars = chars;
-// this.pos = offset;
-// this.len = length;
-//
-// String paramName = null;
-// String paramValue = null;
-// while (hasChar()) {
-// paramName = parseToken(new char[] {
-// '=', separator });
-// paramValue = null;
-// if (hasChar() && (chars[pos] == '=')) {
-// pos++; // skip '='
-// paramValue = parseQuotedToken(new char[] {
-// separator });
-// }
-// if (hasChar() && (chars[pos] == separator)) {
-// pos++; // skip separator
-// }
-// if ((paramName != null) && (paramName.length() > 0)) {
-// if (this.lowerCaseNames) {
-// paramName = paramName.toLowerCase();
-// }
-// params.put(paramName, paramValue);
-// }
-// }
-// return params;
-//
-//
-//
-// Parser
-// ParameterParser pf = new ParameterParser();
-// pf.setLowerCaseNames(true);
-// Map map = pf.parse(contentType, SEPERATOR);
-// String retVal = (String) map.get(CHAR_SET);
-// if ((retVal == null) && (replaceNullWithDefault)) {
-// if (map.containsKey(APPLICATION_URL_ENCODED)) {
-// // default charset for url encoded data
-// return "UTF-8";
-// }
-// retVal = getDefaultCharset();
-// }
-// return retVal;
-// }
-
}
--
cgit v1.2.3
From 43cb317a0eb230205e3c8ba58ae7ce67f9fc5613 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Mon, 13 Oct 2008 16:45:33 +0000
Subject: BKUGUI / SimpleGUI aligned
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@110 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 64cd9f50..4988ff39 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -106,7 +106,7 @@ public class BKUGUI implements BKUGUIFacade {
// protected JPanel iconPanel;
protected JPanel contentPanel;
/** right side content panels and layouts */
-// protected JPanel headerPanel;
+ protected JPanel headerPanel;
protected JPanel mainPanel;
protected JPanel buttonPanel;
/** right side fixed labels */
@@ -199,12 +199,12 @@ public class BKUGUI implements BKUGUIFacade {
// contentPanel.setBorder(new TitledBorder("content"));
-// headerPanel = new JPanel();
-// headerPanel.setOpaque(false);
-// mainPanel = new JPanel();
-// mainPanel.setOpaque(false);
-// buttonPanel = new JPanel();
-// buttonPanel.setOpaque(false);
+ headerPanel = new JPanel();
+ headerPanel.setOpaque(false);
+ mainPanel = new JPanel();
+ mainPanel.setOpaque(false);
+ buttonPanel = new JPanel();
+ buttonPanel.setOpaque(false);
// headerPanel.setBorder(new TitledBorder("header"));
// mainPanel.setBorder(new TitledBorder("main"));
--
cgit v1.2.3
From 07e77c763ae69e690e9b714586dc45ccccc0e4da Mon Sep 17 00:00:00 2001
From: clemenso
Date: Mon, 13 Oct 2008 16:46:34 +0000
Subject: BKUGUI / SimpleGUI aligned
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@111 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 4988ff39..42f9e518 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -106,7 +106,7 @@ public class BKUGUI implements BKUGUIFacade {
// protected JPanel iconPanel;
protected JPanel contentPanel;
/** right side content panels and layouts */
- protected JPanel headerPanel;
+// protected JPanel headerPanel;
protected JPanel mainPanel;
protected JPanel buttonPanel;
/** right side fixed labels */
@@ -199,8 +199,8 @@ public class BKUGUI implements BKUGUIFacade {
// contentPanel.setBorder(new TitledBorder("content"));
- headerPanel = new JPanel();
- headerPanel.setOpaque(false);
+// headerPanel = new JPanel();
+// headerPanel.setOpaque(false);
mainPanel = new JPanel();
mainPanel.setOpaque(false);
buttonPanel = new JPanel();
--
cgit v1.2.3
From e19102048016591ba161453b43a3a47f3d4f180c Mon Sep 17 00:00:00 2001
From: clemenso
Date: Mon, 13 Oct 2008 17:31:43 +0000
Subject: GUI cleanup, BKUGUI HeaderPanel
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@112 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 257 ++++-----------------
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 183 +--------------
2 files changed, 47 insertions(+), 393 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 42f9e518..9cba293a 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -106,19 +106,14 @@ public class BKUGUI implements BKUGUIFacade {
// protected JPanel iconPanel;
protected JPanel contentPanel;
/** right side content panels and layouts */
-// protected JPanel headerPanel;
+ protected JPanel headerPanel;
protected JPanel mainPanel;
protected JPanel buttonPanel;
/** right side fixed labels */
-// protected JLabel titleLabel;
+ protected JLabel titleLabel;
/** remember the pinfield to return to worker */
protected JPasswordField pinField;
-// protected JButton okButton;
-// protected JButton cancelButton;
-// protected JButton signButton;
-// protected JButton saveButton;
-// protected JButton backButton;
protected int buttonSize;
private static final int CHECKBOX_WIDTH = new JCheckBox().getPreferredSize().width;
@@ -199,8 +194,8 @@ public class BKUGUI implements BKUGUIFacade {
// contentPanel.setBorder(new TitledBorder("content"));
-// headerPanel = new JPanel();
-// headerPanel.setOpaque(false);
+ headerPanel = new JPanel();
+ headerPanel.setOpaque(false);
mainPanel = new JPanel();
mainPanel.setOpaque(false);
buttonPanel = new JPanel();
@@ -210,9 +205,9 @@ public class BKUGUI implements BKUGUIFacade {
// mainPanel.setBorder(new TitledBorder("main"));
// buttonPanel.setBorder(new TitledBorder("button"));
-// titleLabel = new JLabel();
-// titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
-// java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
+ titleLabel = new JLabel();
+ titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
+ java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
JButton b = new JButton();
b.setText(messages.getString(BUTTON_CANCEL));
@@ -241,38 +236,35 @@ public class BKUGUI implements BKUGUIFacade {
// buttonSize = saveButton.getPreferredSize().width;
-// GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
-// headerPanel.setLayout(headerPanelLayout);
+ GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
+ headerPanel.setLayout(headerPanelLayout);
//
-// headerPanelLayout.setHorizontalGroup(
-// headerPanelLayout.createSequentialGroup()
-// .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
-// .addContainerGap());
-// headerPanelLayout.setVerticalGroup(
-// headerPanelLayout.createSequentialGroup()
-// .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
+ headerPanelLayout.setHorizontalGroup(
+ headerPanelLayout.createSequentialGroup()
+ .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
+ .addContainerGap());
+ headerPanelLayout.setVerticalGroup(
+ headerPanelLayout.createSequentialGroup()
+ .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
contentPanel.setLayout(contentPanelLayout);
-// contentPanelLayout.setHorizontalGroup(
-// contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); //));
+
contentPanelLayout.setHorizontalGroup(
contentPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(
contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap());
contentPanelLayout.setVerticalGroup(
contentPanelLayout.createSequentialGroup()
.addContainerGap()
-// .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) //, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
@@ -294,7 +286,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_ERROR));
+ titleLabel.setText(messages.getString(TITLE_ERROR));
JLabel waitMsgLabel = new JLabel();
waitMsgLabel.setFont(waitMsgLabel.getFont().deriveFont(waitMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -306,7 +298,6 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(waitMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
@@ -332,22 +323,20 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_WELCOME));
+ titleLabel.setText(messages.getString(TITLE_WELCOME));
JLabel welcomeMsgLabel = new JLabel();
welcomeMsgLabel.setFont(welcomeMsgLabel.getFont().deriveFont(welcomeMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- welcomeMsgLabel.setText(messages.getString(TITLE_WELCOME)); //MESSAGE_WAIT));
+ welcomeMsgLabel.setText(messages.getString(MESSAGE_WAIT));
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(welcomeMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(welcomeMsgLabel));
contentPanel.validate();
@@ -371,7 +360,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_INSERTCARD));
+ titleLabel.setText(messages.getString(TITLE_INSERTCARD));
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -382,11 +371,9 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
JButton cancelButton = new JButton();
@@ -430,22 +417,20 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- insertCardMsgLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED)); //MESSAGE_INSERTCARD));
+ insertCardMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
JButton cancelButton = new JButton();
@@ -483,12 +468,12 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// if (numRetries < 0) {
-// String cardpinTitle = messages.getString(TITLE_CARDPIN);
-// titleLabel.setText(MessageFormat.format(cardpinTitle, new Object[]{pinSpec.getLocalizedName()}));
-// } else {
-// titleLabel.setText(messages.getString(TITLE_RETRY));
-// }
+ if (numRetries < 0) {
+ String cardpinTitle = messages.getString(TITLE_CARDPIN);
+ titleLabel.setText(MessageFormat.format(cardpinTitle, new Object[]{pinSpec.getLocalizedName()}));
+ } else {
+ titleLabel.setText(messages.getString(TITLE_RETRY));
+ }
JButton cancelButton = new JButton();
cancelButton.setText(messages.getString(BUTTON_CANCEL));
@@ -506,7 +491,6 @@ public class BKUGUI implements BKUGUIFacade {
String pinLabel = messages.getString(LABEL_PIN);
cardPinLabel.setText(MessageFormat.format(pinLabel, new Object[]{pinSpec.getLocalizedName()}));
-// JPasswordField cardPINField = new JPasswordField();
pinField = new JPasswordField();
pinField.setText("");
pinField.setDocument(new PINDocument(pinSpec, okButton));
@@ -534,36 +518,6 @@ public class BKUGUI implements BKUGUIFacade {
infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
}
-
-// GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
-// mainPanel.setLayout(mainPanelLayout);
-//
-// mainPanelLayout.setHorizontalGroup(
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addGroup(mainPanelLayout.createSequentialGroup() // .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// // .addComponent(hashDataLabel)
-// // .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
-// .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) //RELATED)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) //TRAILING)
-// .addComponent(infoLabel) //, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)
-// .addComponent(pinField, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)) //))
-// .addContainerGap()));
-//
-// mainPanelLayout.setVerticalGroup(
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addContainerGap() // .addComponent(hashDataLabel).addGap(14, 14, 14)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) //, false)
-// .addComponent(cardPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
-// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(infoLabel).addGap(cardPinLabel.getFont().getSize()))); //10, 10, 10)));
-//
-// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
-// buttonPanel.setLayout(buttonPanelLayout);
-//
-// buttonPanelLayout.setHorizontalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup().addContainerGap(15, Short.MAX_VALUE).addComponent(okButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(cancelButton).addContainerGap()));
-// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(okButton).addComponent(cancelButton)));
-
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
@@ -588,7 +542,6 @@ public class BKUGUI implements BKUGUIFacade {
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(infoLabel));
-// .addGap(signPinLabel.getFont().getSize()));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -645,11 +598,11 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// if (numRetries < 0) {
-// titleLabel.setText(messages.getString(TITLE_SIGN));
-// } else {
-// titleLabel.setText(messages.getString(TITLE_RETRY));
-// }
+ if (numRetries < 0) {
+ titleLabel.setText(messages.getString(TITLE_SIGN));
+ } else {
+ titleLabel.setText(messages.getString(TITLE_RETRY));
+ }
JButton cancelButton = new JButton();
cancelButton.setText(messages.getString(BUTTON_CANCEL));
@@ -732,7 +685,6 @@ public class BKUGUI implements BKUGUIFacade {
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(infoLabel));
-// .addGap(signPinLabel.getFont().getSize()));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -751,49 +703,7 @@ public class BKUGUI implements BKUGUIFacade {
pinField.requestFocusInWindow();
contentPanel.validate();
- }// private ParallelGroup createMainGroup(GroupLayout mainPanelLayout, JLabel hashDataLabel, JLabel signPinLabel, JLabel pinSizeLabel, JLabel errorLabel) {
-// ParallelGroup mainGroup = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
-// mainGroup.addComponent(hashDataLabel);
-// if (errorLabel != null) {
-// mainGroup.addComponent(errorLabel);
-// }
-// mainGroup.addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
-// .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
-// .addComponent(pinSizeLabel)
-// .addComponent(pinField, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)));
-// return mainGroup;
-// }
-// private GroupLayout.SequentialGroup createVerticalMainGroup(GroupLayout mainPanelLayout, JLabel hashDataLabel, JLabel signPinLabel, JLabel pinSizeLabel, JLabel errorLabel) {
-// GroupLayout.SequentialGroup mainGroup = mainPanelLayout.createSequentialGroup();
-// mainGroup.addComponent(hashDataLabel)
-// .addGap(hashDataLabel.getFont().getSize()); //14, 14, 14)
-//
-// if (errorLabel != null) {
-// mainGroup.addComponent(errorLabel)
-// .addGap(errorLabel.getFont().getSize());
-// }
-// mainGroup.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE, false)
-// .addComponent(signPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
-// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(pinSizeLabel)
-// .addGap(signPinLabel.getFont().getSize());
-//
-// return mainGroup;
-//// mainPanelLayout.createSequentialGroup()
-//// .addComponent(hashDataLabel)
-//// .addGap(hashDataLabel.getFont().getSize()) //14, 14, 14)
-//// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE, false)
-//// .addComponent(signPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
-//// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
-//// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-//// .addComponent(pinSizeLabel)
-//// .addGap(signPinLabel.getFont().getSize())
-////
-////
-// }
+ }
});
}
@@ -812,7 +722,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_ERROR));
+ titleLabel.setText(messages.getString(TITLE_ERROR));
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -827,11 +737,9 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
JButton okButton = new JButton();
@@ -870,7 +778,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_ERROR));
+ titleLabel.setText(messages.getString(TITLE_ERROR));
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -885,11 +793,9 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
contentPanel.validate();
@@ -927,11 +833,9 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(waitMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(waitMsgLabel));
contentPanel.validate();
@@ -956,8 +860,6 @@ public class BKUGUI implements BKUGUIFacade {
if (signedReferences.size() == 1) {
-// final HashDataInput signedRef = signedReferences.get(0);
-
if ("text/plain".equals(signedReferences.get(0).getMimeType())) {
ActionListener saveHashDataListener = new ActionListener() {
@@ -1008,7 +910,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_HASHDATA));
+ titleLabel.setText(messages.getString(TITLE_HASHDATA));
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -1040,15 +942,6 @@ public class BKUGUI implements BKUGUIFacade {
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
- // GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- // mainPanel.setLayout(mainPanelLayout);
- //
- // mainPanelLayout.setHorizontalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(refIdLabel).addComponent(hashDataScrollPane, GroupLayout.PREFERRED_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)).addContainerGap()));
- //
- // mainPanelLayout.setVerticalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addComponent(refIdLabel).addGap(refIdLabel.getFont().getSize()).addComponent(hashDataScrollPane).addGap(refIdLabel.getFont().getSize())));
-
JButton backButton = new JButton();
backButton.setText(messages.getString(BUTTON_BACK));
backButton.setActionCommand(cancelCommand);
@@ -1073,15 +966,6 @@ public class BKUGUI implements BKUGUIFacade {
.addComponent(saveButton)
.addComponent(backButton));
-
- // GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- // buttonPanel.setLayout(buttonPanelLayout);
- //
- // buttonPanelLayout.setHorizontalGroup(
- // buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup().addContainerGap(15, Short.MAX_VALUE).addComponent(saveButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(cancelButton).addContainerGap()));
- // buttonPanelLayout.setVerticalGroup(
- // buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(saveButton).addComponent(cancelButton)));
-
contentPanel.validate();
}
});
@@ -1101,7 +985,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_HASHDATA));
+ titleLabel.setText(messages.getString(TITLE_HASHDATA));
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -1135,61 +1019,6 @@ public class BKUGUI implements BKUGUIFacade {
.addComponent(refIdLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hashDataScrollPane, 0, 0, hashDataTable.getPreferredSize().height+3));
- // .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED));
-
-
-
- //
- // GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- // mainPanel.setLayout(mainPanelLayout);
- //
- // mainPanelLayout.setHorizontalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addGroup(mainPanelLayout.createSequentialGroup()
- // .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addComponent(refIdLabel)
- // .addComponent(hashDataScrollPane, GroupLayout.PREFERRED_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE))
- // .addContainerGap()));
- //
- // mainPanelLayout.setVerticalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addGroup(mainPanelLayout.createSequentialGroup()
- // .addComponent(refIdLabel)
- // .addGap(refIdLabel.getFont().getSize())
- // .addComponent(hashDataScrollPane)
- // .addGap(refIdLabel.getFont().getSize())));
-
-
-
-
-
-
-
-
-
-
-
-
- // GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- // buttonPanel.setLayout(buttonPanelLayout);
- //
- // buttonPanelLayout.setHorizontalGroup(
- // buttonPanelLayout.createSequentialGroup()
- //// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- //// .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
- // .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- // .addComponent(saveButton)
- // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- // .addComponent(cancelButton)
- // .addContainerGap()); //);
- // buttonPanelLayout.setVerticalGroup(
- // buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
- // .addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- // .addComponent(saveButton)
- // .addComponent(cancelButton))
- // .addContainerGap()));
-
JButton backButton = new JButton();
backButton.setText(messages.getString(BUTTON_BACK));
@@ -1220,8 +1049,6 @@ public class BKUGUI implements BKUGUIFacade {
});
}
-// private DisposableFileChooser fileDialog;
-
private void showSaveHashDataInputDialog(final List signedRefs, final ActionListener okListener, final String okCommand) {
log.debug("scheduling save hashdatainput dialog");
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index e323d195..3d47e1cd 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -114,11 +114,6 @@ public class SimpleGUI implements BKUGUIFacade {
/** remember the pinfield to return to worker */
protected JPasswordField pinField;
-// protected JButton okButton;
-// protected JButton cancelButton;
-// protected JButton signButton;
-// protected JButton saveButton;
-// protected JButton backButton;
protected int buttonSize;
private static final int CHECKBOX_WIDTH = new JCheckBox().getPreferredSize().width;
@@ -255,16 +250,13 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
contentPanel.setLayout(contentPanelLayout);
-// contentPanelLayout.setHorizontalGroup(
-// contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); //));
+
contentPanelLayout.setHorizontalGroup(
contentPanelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(
contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+// .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap());
@@ -306,7 +298,6 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(waitMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
@@ -336,18 +327,16 @@ public class SimpleGUI implements BKUGUIFacade {
JLabel welcomeMsgLabel = new JLabel();
welcomeMsgLabel.setFont(welcomeMsgLabel.getFont().deriveFont(welcomeMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- welcomeMsgLabel.setText(messages.getString(TITLE_WELCOME)); //MESSAGE_WAIT));
+ welcomeMsgLabel.setText(messages.getString(TITLE_WELCOME));
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(welcomeMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(welcomeMsgLabel));
contentPanel.validate();
@@ -382,11 +371,9 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
// JButton cancelButton = new JButton();
@@ -434,18 +421,16 @@ public class SimpleGUI implements BKUGUIFacade {
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- insertCardMsgLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED)); //MESSAGE_INSERTCARD));
+ insertCardMsgLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(insertCardMsgLabel));
// JButton cancelButton = new JButton();
@@ -507,7 +492,6 @@ public class SimpleGUI implements BKUGUIFacade {
String pinLabel = messages.getString(LABEL_PIN);
cardPinLabel.setText(MessageFormat.format(pinLabel, new Object[]{pinSpec.getLocalizedName()}));
-// JPasswordField cardPINField = new JPasswordField();
pinField = new JPasswordField();
pinField.setText("");
pinField.setDocument(new PINDocument(pinSpec, okButton));
@@ -535,36 +519,6 @@ public class SimpleGUI implements BKUGUIFacade {
infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
}
-
-// GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
-// mainPanel.setLayout(mainPanelLayout);
-//
-// mainPanelLayout.setHorizontalGroup(
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addGroup(mainPanelLayout.createSequentialGroup() // .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// // .addComponent(hashDataLabel)
-// // .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
-// .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED) //RELATED)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) //TRAILING)
-// .addComponent(infoLabel) //, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)
-// .addComponent(pinField, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)) //))
-// .addContainerGap()));
-//
-// mainPanelLayout.setVerticalGroup(
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addContainerGap() // .addComponent(hashDataLabel).addGap(14, 14, 14)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE) //, false)
-// .addComponent(cardPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
-// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(infoLabel).addGap(cardPinLabel.getFont().getSize()))); //10, 10, 10)));
-//
-// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
-// buttonPanel.setLayout(buttonPanelLayout);
-//
-// buttonPanelLayout.setHorizontalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup().addContainerGap(15, Short.MAX_VALUE).addComponent(okButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(cancelButton).addContainerGap()));
-// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(okButton).addComponent(cancelButton)));
-
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
@@ -586,7 +540,6 @@ public class SimpleGUI implements BKUGUIFacade {
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(infoLabel));
-// .addGap(signPinLabel.getFont().getSize()));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -742,7 +695,6 @@ public class SimpleGUI implements BKUGUIFacade {
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(infoLabel));
-// .addGap(signPinLabel.getFont().getSize()));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -772,49 +724,7 @@ public class SimpleGUI implements BKUGUIFacade {
pinField.requestFocusInWindow();
contentPanel.validate();
- }// private ParallelGroup createMainGroup(GroupLayout mainPanelLayout, JLabel hashDataLabel, JLabel signPinLabel, JLabel pinSizeLabel, JLabel errorLabel) {
-// ParallelGroup mainGroup = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
-// mainGroup.addComponent(hashDataLabel);
-// if (errorLabel != null) {
-// mainGroup.addComponent(errorLabel);
-// }
-// mainGroup.addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
-// .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
-// .addComponent(pinSizeLabel)
-// .addComponent(pinField, GroupLayout.DEFAULT_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)));
-// return mainGroup;
-// }
-// private GroupLayout.SequentialGroup createVerticalMainGroup(GroupLayout mainPanelLayout, JLabel hashDataLabel, JLabel signPinLabel, JLabel pinSizeLabel, JLabel errorLabel) {
-// GroupLayout.SequentialGroup mainGroup = mainPanelLayout.createSequentialGroup();
-// mainGroup.addComponent(hashDataLabel)
-// .addGap(hashDataLabel.getFont().getSize()); //14, 14, 14)
-//
-// if (errorLabel != null) {
-// mainGroup.addComponent(errorLabel)
-// .addGap(errorLabel.getFont().getSize());
-// }
-// mainGroup.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE, false)
-// .addComponent(signPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
-// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(pinSizeLabel)
-// .addGap(signPinLabel.getFont().getSize());
-//
-// return mainGroup;
-//// mainPanelLayout.createSequentialGroup()
-//// .addComponent(hashDataLabel)
-//// .addGap(hashDataLabel.getFont().getSize()) //14, 14, 14)
-//// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE, false)
-//// .addComponent(signPinLabel) //, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE)
-//// .addComponent(pinField)) //, GroupLayout.PREFERRED_SIZE, 19, GroupLayout.PREFERRED_SIZE))
-//// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-//// .addComponent(pinSizeLabel)
-//// .addGap(signPinLabel.getFont().getSize())
-////
-////
-// }
+ }
});
}
@@ -848,11 +758,9 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
JButton okButton = new JButton();
@@ -907,11 +815,9 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorMsgLabel));
contentPanel.validate();
@@ -949,11 +855,9 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(waitMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(waitMsgLabel));
contentPanel.validate();
@@ -978,8 +882,6 @@ public class SimpleGUI implements BKUGUIFacade {
if (signedReferences.size() == 1) {
-// final HashDataInput signedRef = signedReferences.get(0);
-
if ("text/plain".equals(signedReferences.get(0).getMimeType())) {
ActionListener saveHashDataListener = new ActionListener() {
@@ -1062,15 +964,6 @@ public class SimpleGUI implements BKUGUIFacade {
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
- // GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- // mainPanel.setLayout(mainPanelLayout);
- //
- // mainPanelLayout.setHorizontalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(refIdLabel).addComponent(hashDataScrollPane, GroupLayout.PREFERRED_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE)).addContainerGap()));
- //
- // mainPanelLayout.setVerticalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(mainPanelLayout.createSequentialGroup().addComponent(refIdLabel).addGap(refIdLabel.getFont().getSize()).addComponent(hashDataScrollPane).addGap(refIdLabel.getFont().getSize())));
-
JButton backButton = new JButton();
backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
backButton.setText(messages.getString(BUTTON_BACK));
@@ -1107,15 +1000,6 @@ public class SimpleGUI implements BKUGUIFacade {
// .addComponent(saveButton)
// .addComponent(backButton));
-
- // GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- // buttonPanel.setLayout(buttonPanelLayout);
- //
- // buttonPanelLayout.setHorizontalGroup(
- // buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup().addContainerGap(15, Short.MAX_VALUE).addComponent(saveButton).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(cancelButton).addContainerGap()));
- // buttonPanelLayout.setVerticalGroup(
- // buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(saveButton).addComponent(cancelButton)));
-
contentPanel.validate();
}
});
@@ -1169,61 +1053,6 @@ public class SimpleGUI implements BKUGUIFacade {
.addComponent(refIdLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(hashDataScrollPane, 0, 0, hashDataTable.getPreferredSize().height+3));
- // .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED));
-
-
-
- //
- // GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- // mainPanel.setLayout(mainPanelLayout);
- //
- // mainPanelLayout.setHorizontalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addGroup(mainPanelLayout.createSequentialGroup()
- // .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addComponent(refIdLabel)
- // .addComponent(hashDataScrollPane, GroupLayout.PREFERRED_SIZE, PREF_SIZE_PINFIELD, Short.MAX_VALUE))
- // .addContainerGap()));
- //
- // mainPanelLayout.setVerticalGroup(
- // mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addGroup(mainPanelLayout.createSequentialGroup()
- // .addComponent(refIdLabel)
- // .addGap(refIdLabel.getFont().getSize())
- // .addComponent(hashDataScrollPane)
- // .addGap(refIdLabel.getFont().getSize())));
-
-
-
-
-
-
-
-
-
-
-
-
- // GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- // buttonPanel.setLayout(buttonPanelLayout);
- //
- // buttonPanelLayout.setHorizontalGroup(
- // buttonPanelLayout.createSequentialGroup()
- //// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- //// .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
- // .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- // .addComponent(saveButton)
- // .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- // .addComponent(cancelButton)
- // .addContainerGap()); //);
- // buttonPanelLayout.setVerticalGroup(
- // buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- // .addGroup(GroupLayout.Alignment.TRAILING, buttonPanelLayout.createSequentialGroup()
- // .addGroup(buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- // .addComponent(saveButton)
- // .addComponent(cancelButton))
- // .addContainerGap()));
-
JButton backButton = new JButton();
backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -1266,8 +1095,6 @@ public class SimpleGUI implements BKUGUIFacade {
}
});
}
-
-// private DisposableFileChooser fileDialog;
private void showSaveHashDataInputDialog(final List signedRefs, final ActionListener okListener, final String okCommand) {
--
cgit v1.2.3
From 11411c3d236e10b237ec1c7a1904e64dc2508551 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 14 Oct 2008 14:47:06 +0000
Subject: GUI retry error msg
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@115 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 7 +
.../src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 143 ++++++++-------------
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 38 ++++++
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 138 ++++++++------------
.../at/gv/egiz/bku/gui/Messages.properties | 1 +
.../gv/egiz/stal/service/impl/STALServiceImpl.java | 10 +-
6 files changed, 164 insertions(+), 173 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index 130749c5..a20a613d 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -103,6 +103,13 @@
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ true
+
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 9cba293a..7e0f0447 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -22,7 +22,6 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.smcc.PINSpec;
import at.gv.egiz.stal.HashDataInput;
-import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Font;
@@ -66,40 +65,7 @@ import org.apache.commons.logging.LogFactory;
public class BKUGUI implements BKUGUIFacade {
private static final Log log = LogFactory.getLog(BKUGUI.class);
- public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
- public static final String DEFAULT_BACKGROUND = "/images/mocca_default.png"; //logo.png";
- public static final String HASHDATA_FONT = "Monospaced";
- public static final Color ERROR_COLOR = Color.RED;
- public static final Color HYPERLINK_COLOR = Color.BLUE;
- private static final String TITLE_WELCOME = "title.welcome";
- private static final String TITLE_INSERTCARD = "title.insertcard";
- private static final String TITLE_CARD_NOT_SUPPORTED = "title.cardnotsupported";
- private static final String TITLE_CARDPIN = "title.cardpin";
- private static final String TITLE_SIGN = "title.sign";
- private static final String TITLE_ERROR = "title.error";
- private static final String TITLE_RETRY = "title.retry";
- private static final String TITLE_WAIT = "title.wait";
- private static final String TITLE_HASHDATA = "title.hashdata";
- private static final String WINDOWTITLE_SAVE = "windowtitle.save";
- private static final String WINDOWTITLE_SAVEDIR = "windowtitle.savedir";
- private static final String WINDOWTITLE_OVERWRITE = "windowtitle.overwrite";
- private static final String MESSAGE_WAIT = "message.wait";
- private static final String MESSAGE_INSERTCARD = "message.insertcard";
- private static final String MESSAGE_HASHDATALINK = "message.hashdatalink";
- private static final String MESSAGE_HASHDATA = "message.hashdata";
- private static final String MESSAGE_HASHDATALIST = "message.hashdatalist";
- private static final String MESSAGE_RETRIES = "message.retries";
- private static final String MESSAGE_OVERWRITE = "message.overwrite";
- private static final String LABEL_PIN = "label.pin";
- private static final String LABEL_PINSIZE = "label.pinsize";
-// private static final String ERROR_NO_HASHDATA = "error.no.hashdata";
- private static final String BUTTON_OK = "button.ok";
- private static final String BUTTON_CANCEL = "button.cancel";
- private static final String BUTTON_BACK = "button.back";
- private static final String BUTTON_SIGN = "button.sign";
- private static final String BUTTON_SAVE = "button.save";
- private static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
protected Container contentPane;
protected ResourceBundle messages;
/** left and right side main panels */
@@ -506,42 +472,47 @@ public class BKUGUI implements BKUGUIFacade {
});
JLabel infoLabel = new JLabel();
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (numRetries < 0) {
- String pinsizePattern = messages.getString(LABEL_PINSIZE);
- String pinSize = String.valueOf(pinSpec.getMinLength());
- if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
- pinSize += "-" + pinSpec.getMaxLength();
- }
- infoLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ String infoPattern = messages.getString(MESSAGE_ENTERPIN);
+ infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {pinSpec.getLocalizedName()}));
} else {
- infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
- infoLabel.setForeground(ERROR_COLOR);
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
+ infoLabel.setForeground(ERROR_COLOR);
+ }
+
+ JLabel pinsizeLabel = new JLabel();
+ pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
+ String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinSize = String.valueOf(pinSpec.getMinLength());
+ if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
+ pinSize += "-" + pinSpec.getMaxLength();
}
+ pinsizeLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
-// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addComponent(hashDataLabel)
-// .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
- .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
- .addComponent(infoLabel)));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
+ .addComponent(pinsizeLabel))));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// .addComponent(hashDataLabel)
-// .addGap(hashDataLabel.getFont().getSize())
+ .addComponent(infoLabel)
+ .addGap(infoLabel.getFont().getSize())
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(cardPinLabel)
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(infoLabel));
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -634,57 +605,57 @@ public class BKUGUI implements BKUGUIFacade {
}
});
- //pinsize or error label
+ JLabel pinsizeLabel = new JLabel();
+ pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
+ String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinSize = String.valueOf(pinSpec.getMinLength());
+ if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
+ pinSize += "-" + pinSpec.getMaxLength();
+ }
+ pinsizeLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
+
JLabel infoLabel = new JLabel();
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (numRetries < 0) {
- String pinsizePattern = messages.getString(LABEL_PINSIZE);
- String pinSize = String.valueOf(pinSpec.getMinLength());
- if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
- pinSize += "-" + pinSpec.getMaxLength();
- }
- infoLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ infoLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
+ infoLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ infoLabel.setForeground(HYPERLINK_COLOR);
+ infoLabel.addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent me) {
+ ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
+ hashdataListener.actionPerformed(e);
+ }
+ });
} else {
- infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
- infoLabel.setForeground(ERROR_COLOR);
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
+ infoLabel.setForeground(ERROR_COLOR);
}
- JLabel hashDataLabel = new JLabel();
- hashDataLabel.setFont(hashDataLabel.getFont().deriveFont(hashDataLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- hashDataLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
- hashDataLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- hashDataLabel.setForeground(HYPERLINK_COLOR);
- hashDataLabel.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseClicked(MouseEvent me) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
- hashdataListener.actionPerformed(e);
- }
- });
-
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(hashDataLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+ .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(infoLabel))));
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(pinsizeLabel))));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(hashDataLabel)
- .addGap(hashDataLabel.getFont().getSize())
+ .addComponent(infoLabel)
+ .addGap(infoLabel.getFont().getSize())
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(signPinLabel)
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(infoLabel));
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 0b617271..a5b7d606 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -18,6 +18,7 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.HashDataInput;
import at.gv.egiz.smcc.PINSpec;
+import java.awt.Color;
import java.awt.Container;
import java.awt.event.ActionListener;
import java.net.URL;
@@ -34,6 +35,43 @@ public interface BKUGUIFacade {
public static final String ERR_WRITE_HASHDATA = "error.write.hashdata";
public static final String ERR_INVALID_HASH = "error.invalid.hash";
+ public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
+ public static final String DEFAULT_BACKGROUND = "/images/mocca_default.png"; //logo.png";
+ public static final String HASHDATA_FONT = "Monospaced";
+ public static final Color ERROR_COLOR = Color.RED;
+ public static final Color HYPERLINK_COLOR = Color.BLUE;
+ public static final String TITLE_WELCOME = "title.welcome";
+ public static final String TITLE_INSERTCARD = "title.insertcard";
+ public static final String TITLE_CARD_NOT_SUPPORTED = "title.cardnotsupported";
+ public static final String TITLE_CARDPIN = "title.cardpin";
+ public static final String TITLE_SIGN = "title.sign";
+ public static final String TITLE_ERROR = "title.error";
+ public static final String TITLE_RETRY = "title.retry";
+ public static final String TITLE_WAIT = "title.wait";
+ public static final String TITLE_HASHDATA = "title.hashdata";
+ public static final String WINDOWTITLE_SAVE = "windowtitle.save";
+ public static final String WINDOWTITLE_SAVEDIR = "windowtitle.savedir";
+ public static final String WINDOWTITLE_OVERWRITE = "windowtitle.overwrite";
+ public static final String MESSAGE_WAIT = "message.wait";
+ public static final String MESSAGE_INSERTCARD = "message.insertcard";
+ public static final String MESSAGE_ENTERPIN = "message.enterpin";
+ public static final String MESSAGE_HASHDATALINK = "message.hashdatalink";
+ public static final String MESSAGE_HASHDATA = "message.hashdata";
+ public static final String MESSAGE_HASHDATALIST = "message.hashdatalist";
+ public static final String MESSAGE_RETRIES = "message.retries";
+ public static final String MESSAGE_OVERWRITE = "message.overwrite";
+ public static final String LABEL_PIN = "label.pin";
+ public static final String LABEL_PINSIZE = "label.pinsize";
+// public static final String ERROR_NO_HASHDATA = "error.no.hashdata";
+
+ public static final String BUTTON_OK = "button.ok";
+ public static final String BUTTON_CANCEL = "button.cancel";
+ public static final String BUTTON_BACK = "button.back";
+ public static final String BUTTON_SIGN = "button.sign";
+ public static final String BUTTON_SAVE = "button.save";
+ public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
+
+
public void init(Container contentPane, String localeString, URL background);
public void showWelcomeDialog();
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index 3d47e1cd..c37704e2 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -22,7 +22,6 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.smcc.PINSpec;
import at.gv.egiz.stal.HashDataInput;
-import java.awt.Color;
import java.awt.Container;
import java.awt.Cursor;
import java.awt.Font;
@@ -66,40 +65,7 @@ import org.apache.commons.logging.LogFactory;
public class SimpleGUI implements BKUGUIFacade {
private static final Log log = LogFactory.getLog(SimpleGUI.class);
- public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
- public static final String DEFAULT_BACKGROUND = "/images/mocca_default.png"; //logo.png";
- public static final String HASHDATA_FONT = "Monospaced";
- public static final Color ERROR_COLOR = Color.RED;
- public static final Color HYPERLINK_COLOR = Color.BLUE;
- private static final String TITLE_WELCOME = "title.welcome";
- private static final String TITLE_INSERTCARD = "title.insertcard";
- private static final String TITLE_CARD_NOT_SUPPORTED = "title.cardnotsupported";
- private static final String TITLE_CARDPIN = "title.cardpin";
- private static final String TITLE_SIGN = "title.sign";
- private static final String TITLE_ERROR = "title.error";
- private static final String TITLE_RETRY = "title.retry";
- private static final String TITLE_WAIT = "title.wait";
- private static final String TITLE_HASHDATA = "title.hashdata";
- private static final String WINDOWTITLE_SAVE = "windowtitle.save";
- private static final String WINDOWTITLE_SAVEDIR = "windowtitle.savedir";
- private static final String WINDOWTITLE_OVERWRITE = "windowtitle.overwrite";
- private static final String MESSAGE_WAIT = "message.wait";
- private static final String MESSAGE_INSERTCARD = "message.insertcard";
- private static final String MESSAGE_HASHDATALINK = "message.hashdatalink";
- private static final String MESSAGE_HASHDATA = "message.hashdata";
- private static final String MESSAGE_HASHDATALIST = "message.hashdatalist";
- private static final String MESSAGE_RETRIES = "message.retries";
- private static final String MESSAGE_OVERWRITE = "message.overwrite";
- private static final String LABEL_PIN = "label.pin";
- private static final String LABEL_PINSIZE = "label.pinsize";
-// private static final String ERROR_NO_HASHDATA = "error.no.hashdata";
- private static final String BUTTON_OK = "button.ok";
- private static final String BUTTON_CANCEL = "button.cancel";
- private static final String BUTTON_BACK = "button.back";
- private static final String BUTTON_SIGN = "button.sign";
- private static final String BUTTON_SAVE = "button.save";
- private static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
protected Container contentPane;
protected ResourceBundle messages;
/** left and right side main panels */
@@ -507,39 +473,47 @@ public class SimpleGUI implements BKUGUIFacade {
});
JLabel infoLabel = new JLabel();
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD, infoLabel.getFont().getSize()-2));
if (numRetries < 0) {
- String pinsizePattern = messages.getString(LABEL_PINSIZE);
- String pinSize = String.valueOf(pinSpec.getMinLength());
- if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
- pinSize += "-" + pinSpec.getMaxLength();
- }
- infoLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ String infoPattern = messages.getString(MESSAGE_ENTERPIN);
+ infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {pinSpec.getLocalizedName()}));
} else {
- infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
- infoLabel.setForeground(ERROR_COLOR);
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
+ infoLabel.setForeground(ERROR_COLOR);
+ }
+
+ JLabel pinsizeLabel = new JLabel();
+ pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
+ String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinSize = String.valueOf(pinSpec.getMinLength());
+ if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
+ pinSize += "-" + pinSpec.getMaxLength();
}
+ pinsizeLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
- .addComponent(infoLabel)));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
+ .addComponent(pinsizeLabel))));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
-// .addComponent(hashDataLabel)
-// .addGap(hashDataLabel.getFont().getSize())
+ .addComponent(infoLabel)
+ .addGap(infoLabel.getFont().getSize())
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(cardPinLabel)
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(infoLabel));
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -644,57 +618,57 @@ public class SimpleGUI implements BKUGUIFacade {
}
});
- //pinsize or error label
+ JLabel pinsizeLabel = new JLabel();
+ pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
+ String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinSize = String.valueOf(pinSpec.getMinLength());
+ if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
+ pinSize += "-" + pinSpec.getMaxLength();
+ }
+ pinsizeLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
+
JLabel infoLabel = new JLabel();
- infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD, infoLabel.getFont().getSize()-2));
if (numRetries < 0) {
- String pinsizePattern = messages.getString(LABEL_PINSIZE);
- String pinSize = String.valueOf(pinSpec.getMinLength());
- if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
- pinSize += "-" + pinSpec.getMaxLength();
- }
- infoLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+ infoLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
+ infoLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ infoLabel.setForeground(HYPERLINK_COLOR);
+ infoLabel.addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent me) {
+ ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
+ hashdataListener.actionPerformed(e);
+ }
+ });
} else {
- infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
- infoLabel.setForeground(ERROR_COLOR);
+ infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
+ infoLabel.setForeground(ERROR_COLOR);
}
- JLabel hashDataLabel = new JLabel();
- hashDataLabel.setFont(hashDataLabel.getFont().deriveFont(hashDataLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- hashDataLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
- hashDataLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- hashDataLabel.setForeground(HYPERLINK_COLOR);
- hashDataLabel.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseClicked(MouseEvent me) {
- ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, hashdataCommand);
- hashdataListener.actionPerformed(e);
- }
- });
-
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(hashDataLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addGroup(GroupLayout.Alignment.TRAILING, mainPanelLayout.createSequentialGroup()
+ .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
.addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(infoLabel))));
+ .addComponent(pinsizeLabel))));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(hashDataLabel)
- .addGap(hashDataLabel.getFont().getSize())
+ .addComponent(infoLabel)
+ .addGap(infoLabel.getFont().getSize())
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(signPinLabel)
.addComponent(pinField))
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(infoLabel));
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index e7716ae9..d0e4726e 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -27,6 +27,7 @@ windowtitle.savedir=Signaturdaten in Verzeichnis speichern
windowtitle.overwrite=Datei \u00FCberschreiben?
message.wait=Bitte warten...
message.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
+message.enterpin=Bitte {0} eingeben
message.hashdatalink=Signaturdaten anzeigen...
message.hashdata=Ein Signaturdatenobjekt:
#message.hashdata=Referenz Id: {0}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java
index 55e66685..99398fe6 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALServiceImpl.java
@@ -314,15 +314,15 @@ public class STALServiceImpl implements STALPortType {
log.info("Received TestSession GetNextRequest(ErrorResponse), returning QuitRequest");
response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(new QuitRequestType());
} else {
- log.info("Received TestSession GetNextRequest, returning InfoboxReadRequest ");
- SignRequestType sig = new SignRequestType();
- sig.setKeyIdentifier("SecureSignatureKeypair");
- sig.setSignedInfo("id('signed-data-object-0-1214921968-27971781-13578')/node()H1IePEEfGQ2SG03H6LTzw1TpCuM=yV6Q+I60buqR4mMaxA7fi+CV35A=".getBytes());
- response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(sig);
+ log.info("Received TestSession GetNextRequest, returning SignRequest and 3 InfoboxReadRequests ");
InfoboxReadRequestType req = new InfoboxReadRequestType();
req.setInfoboxIdentifier("IdentityLink");
req.setDomainIdentifier("hansiwurzel");
response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req);
+ SignRequestType sig = new SignRequestType();
+ sig.setKeyIdentifier("SecureSignatureKeypair");
+ sig.setSignedInfo("id('signed-data-object-0-1214921968-27971781-13578')/node()H1IePEEfGQ2SG03H6LTzw1TpCuM=yV6Q+I60buqR4mMaxA7fi+CV35A=".getBytes());
+ response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(sig);
req = new InfoboxReadRequestType();
req.setInfoboxIdentifier("CertifiedKeypair");
response.getInfoboxReadRequestOrSignRequestOrQuitRequest().add(req);
--
cgit v1.2.3
From d56504bc815d41ac9142967915b7e6224c2cf529 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Wed, 15 Oct 2008 13:41:21 +0000
Subject: remove hashdatainputproxy
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@119 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../at/gv/egiz/bku/online/applet/BKUWorker.java | 5 ----
.../gv/egiz/stal/impl/ByteArrayHashDataInput.java | 31 ++++++++++++++++++++++
.../at/gv/egiz/bku/gui/Messages.properties | 2 +-
.../stal/service/impl/STALRequestBrokerImpl.java | 9 +++----
.../at/gv/egiz/stal/util/HashDataInputProxy.java | 2 +-
5 files changed, 36 insertions(+), 13 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
index 350925ce..3f64de3d 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
@@ -154,11 +154,6 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
return;
}
-// //TODO factory for SignRequestHandler providing either WebServiceHDISignRequestHandler or ExternalHDIDisplaySignRequestHandler
-// AppletContext ctx = parent.getAppletContext();
-// log.debug("register SignRequestHandler for HashDataURL " + hashDataURL);
-// addRequestHandler(at.gv.egiz.stal.SignRequest.class, new ExternalDisplaySignRequestHandler(ctx, hashDataURL));
-
try {
String sessionId = parent.getMyAppletParameter(BKUApplet.SESSION_ID);
if (sessionId == null) {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
index b0285345..2b5ee7e7 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
@@ -7,7 +7,11 @@ package at.gv.egiz.stal.impl;
import at.gv.egiz.stal.HashDataInput;
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
import java.io.InputStream;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
*
@@ -15,6 +19,8 @@ import java.io.InputStream;
*/
public class ByteArrayHashDataInput implements HashDataInput {
+ private static final Log log = LogFactory.getLog(ByteArrayHashDataInput.class);
+
protected byte[] hashData;
protected String id;
protected String mimeType;
@@ -30,6 +36,31 @@ public class ByteArrayHashDataInput implements HashDataInput {
this.encoding = encoding;
}
+ /**
+ * caches the hashdata input's stream
+ * @param hdi to be cached
+ */
+ public ByteArrayHashDataInput(HashDataInput hdi) {
+ if (hdi == null) {
+ throw new NullPointerException("HashDataInput not provided.");
+ }
+ InputStream is = hdi.getHashDataInput();
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ try {
+ byte[] buffer = new byte[1024];
+ for (int i = is.read(buffer); i > -1; i = is.read(buffer)) {
+ baos.write(buffer, 0, i);
+ }
+ this.hashData = baos.toByteArray();
+ } catch (IOException ex) {
+ log.error("Failed to cache provided HashDataInput: " + ex.getMessage(), ex);
+ this.hashData = new byte[0];
+ }
+ this.id = hdi.getReferenceId();
+ this.mimeType = hdi.getMimeType();
+ this.encoding = hdi.getEncoding();
+ }
+
@Override
public String getReferenceId() {
return id;
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index d0e4726e..a38e2cf8 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -35,7 +35,7 @@ message.hashdatalist={0} Signaturdatenobjekte:
message.retries=Noch {0} Versuch(e)
message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
label.pin={0}:
-label.pinsize={0} stellig
+label.pinsize=({0} stellig)
button.ok=OK
button.cancel=Abbrechen
button.back=Zur\u00FCck
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
index 03c7c601..7f4a9273 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
@@ -32,7 +32,6 @@ import at.gv.egiz.stal.service.types.QuitRequestType;
import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
import at.gv.egiz.stal.service.types.SignRequestType;
-import at.gv.egiz.stal.util.HashDataInputProxy;
import at.gv.egiz.stal.util.STALTranslator;
import java.util.ArrayList;
import java.util.Collections;
@@ -42,7 +41,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
- * An instance of STALRequestBroker is shared between a producer threads (SLCommand)
+ * An instance of STALRequestBroker is shared between a producer thread (SLCommand)
* and multiple consumer threads (STALService).
* This implementation assures that handleRequest is executed only once the previous invocation returned.
* The BindingProcessor assures that a new SLCommand calls handleRequest() only once
@@ -109,10 +108,8 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
req.setKeyIdentifier(((SignRequest) stalRequest).getKeyIdentifier());
req.setSignedInfo(((SignRequest) stalRequest).getSignedInfo());
requests.add(req);
- for (HashDataInput hdi : ((SignRequest) stalRequest).getHashDataInput()) {
- hashDataInputs.add(new HashDataInputProxy(hdi));
- }
- //hashDataInputs.addAll(((SignRequest) stalRequest).getHashDataInput());
+ //DataObjectHashDataInput with reference caching enabled DataObject
+ hashDataInputs.addAll(((SignRequest) stalRequest).getHashDataInput());
break;
} else if (stalRequest instanceof InfoboxReadRequest) {
log.trace("Received InfoboxReadRequest");
diff --git a/STALService/src/main/java/at/gv/egiz/stal/util/HashDataInputProxy.java b/STALService/src/main/java/at/gv/egiz/stal/util/HashDataInputProxy.java
index dda20968..01d207d2 100644
--- a/STALService/src/main/java/at/gv/egiz/stal/util/HashDataInputProxy.java
+++ b/STALService/src/main/java/at/gv/egiz/stal/util/HashDataInputProxy.java
@@ -13,7 +13,7 @@ import at.gv.egiz.stal.HashDataInput;
/**
* Enables multiple read requests.
- *
+ * @deprecated use at.gv.egiz.stal.impl.ByteArrayHashDataInput
*/
public class HashDataInputProxy implements HashDataInput {
--
cgit v1.2.3
From 73c8f359ff94b382324665ca981b0640cc9f058f Mon Sep 17 00:00:00 2001
From: clemenso
Date: Thu, 16 Oct 2008 13:11:22 +0000
Subject: Background Chipperling
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@123 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 2 +-
.../src/main/resources/images/BackgroundChipperling.png | Bin 0 -> 3367 bytes
.../src/main/resources/images/BackgroundMocca.png | Bin 0 -> 1287 bytes
3 files changed, 1 insertion(+), 1 deletion(-)
create mode 100644 BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png
create mode 100644 BKUCommonGUI/src/main/resources/images/BackgroundMocca.png
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index a5b7d606..ced74834 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -36,7 +36,7 @@ public interface BKUGUIFacade {
public static final String ERR_INVALID_HASH = "error.invalid.hash";
public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
- public static final String DEFAULT_BACKGROUND = "/images/mocca_default.png"; //logo.png";
+ public static final String DEFAULT_BACKGROUND = "/images/BackgroundChipperling.png";
public static final String HASHDATA_FONT = "Monospaced";
public static final Color ERROR_COLOR = Color.RED;
public static final Color HYPERLINK_COLOR = Color.BLUE;
diff --git a/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png b/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png
new file mode 100644
index 00000000..a4791a7f
Binary files /dev/null and b/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png differ
diff --git a/BKUCommonGUI/src/main/resources/images/BackgroundMocca.png b/BKUCommonGUI/src/main/resources/images/BackgroundMocca.png
new file mode 100644
index 00000000..349d9ff0
Binary files /dev/null and b/BKUCommonGUI/src/main/resources/images/BackgroundMocca.png differ
--
cgit v1.2.3
From 990e50c61d1b92dbd0e063fe6811783c2d479e42 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 28 Oct 2008 10:56:44 +0000
Subject: ProcessingContext removed old background imgs
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@125 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../src/main/resources/images/chipperling_only.png | Bin 3291 -> 0 bytes
BKUCommonGUI/src/main/resources/images/logo.png | Bin 4035 -> 0 bytes
BKUCommonGUI/src/main/resources/images/mocca.png | Bin 1450 -> 0 bytes
.../main/resources/images/mocca_chipperling.png | Bin 4103 -> 0 bytes
.../src/main/resources/images/mocca_default.png | Bin 1287 -> 0 bytes
.../src/main/resources/images/mocca_tiny.png | Bin 1025 -> 0 bytes
BKUOnline/src/main/webapp/META-INF/context.xml | 4 +-
.../egiz/bku/binding/BindingProcessorManager.java | 172 +++++++++++----------
.../bku/binding/BindingProcessorManagerImpl.java | 153 +++++++++++-------
.../at/gv/egiz/bku/binding/ProcessingContext.java | 39 +++++
10 files changed, 221 insertions(+), 147 deletions(-)
delete mode 100644 BKUCommonGUI/src/main/resources/images/chipperling_only.png
delete mode 100644 BKUCommonGUI/src/main/resources/images/logo.png
delete mode 100644 BKUCommonGUI/src/main/resources/images/mocca.png
delete mode 100644 BKUCommonGUI/src/main/resources/images/mocca_chipperling.png
delete mode 100644 BKUCommonGUI/src/main/resources/images/mocca_default.png
delete mode 100644 BKUCommonGUI/src/main/resources/images/mocca_tiny.png
create mode 100644 bkucommon/src/main/java/at/gv/egiz/bku/binding/ProcessingContext.java
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/resources/images/chipperling_only.png b/BKUCommonGUI/src/main/resources/images/chipperling_only.png
deleted file mode 100644
index 57063b9a..00000000
Binary files a/BKUCommonGUI/src/main/resources/images/chipperling_only.png and /dev/null differ
diff --git a/BKUCommonGUI/src/main/resources/images/logo.png b/BKUCommonGUI/src/main/resources/images/logo.png
deleted file mode 100644
index eee4be4f..00000000
Binary files a/BKUCommonGUI/src/main/resources/images/logo.png and /dev/null differ
diff --git a/BKUCommonGUI/src/main/resources/images/mocca.png b/BKUCommonGUI/src/main/resources/images/mocca.png
deleted file mode 100644
index 881a65c1..00000000
Binary files a/BKUCommonGUI/src/main/resources/images/mocca.png and /dev/null differ
diff --git a/BKUCommonGUI/src/main/resources/images/mocca_chipperling.png b/BKUCommonGUI/src/main/resources/images/mocca_chipperling.png
deleted file mode 100644
index 4ee2d054..00000000
Binary files a/BKUCommonGUI/src/main/resources/images/mocca_chipperling.png and /dev/null differ
diff --git a/BKUCommonGUI/src/main/resources/images/mocca_default.png b/BKUCommonGUI/src/main/resources/images/mocca_default.png
deleted file mode 100644
index 349d9ff0..00000000
Binary files a/BKUCommonGUI/src/main/resources/images/mocca_default.png and /dev/null differ
diff --git a/BKUCommonGUI/src/main/resources/images/mocca_tiny.png b/BKUCommonGUI/src/main/resources/images/mocca_tiny.png
deleted file mode 100644
index 1f125d9b..00000000
Binary files a/BKUCommonGUI/src/main/resources/images/mocca_tiny.png and /dev/null differ
diff --git a/BKUOnline/src/main/webapp/META-INF/context.xml b/BKUOnline/src/main/webapp/META-INF/context.xml
index cd11ce8e..f38215a1 100644
--- a/BKUOnline/src/main/webapp/META-INF/context.xml
+++ b/BKUOnline/src/main/webapp/META-INF/context.xml
@@ -15,5 +15,5 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-
+
+
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManager.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManager.java
index aaf81e51..9cad95a4 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManager.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManager.java
@@ -14,92 +14,94 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package at.gv.egiz.bku.binding;
-
+package at.gv.egiz.bku.binding;
+
import java.net.MalformedURLException;
-import java.util.Locale;
-import java.util.Set;
-
-import at.gv.egiz.bku.slcommands.SLCommandInvoker;
-import at.gv.egiz.stal.STALFactory;
-
-/**
- * Central player that handles the protocol binding.
- *
- * @author wbauer
- *
- */
-public interface BindingProcessorManager {
-
- /**
- * FactoryMethod creating a new BindingProcessor object.
- * The created binding processor must be passed to the process method to execute.
- *
- * @param urlString
- * the source url
- * @param aSessionId
- * optional an external sessionId (e.g. http session) could be
- * provided. This parameter may be null.
- * @param locale the locale used for user interaction, may be null
- */
- public BindingProcessor createBindingProcessor(String urlString,
- String aSessionId, Locale locale) throws MalformedURLException;
-
- /**
- * FactoryMethod creating a new BindingProcessor object.
- * The created binding processor must be passed to the process method to execute.
- *
- * @param protcol
- * the source url
- * @param aSessionId
- * optional an external sessionId (e.g. http session) could be
- * provided. This parameter may be null.
- */
- public BindingProcessor createBindingProcessor(String urlString,
- String aSessionId) throws MalformedURLException;
-
-
- /**
- * Gets the binding processor with a certain id. The binding processor must be passed to the
- * process method before it is managed and thus returned by this method.
- * @param aId must not be null
- * @return null if the binding processor was not "processed" before.
- */
- public BindingProcessor getBindingProcessor(Id aId);
-
- /**
- * Sets the STAL factory that is used for creating STAL objects that are used by BindingProcessor objects.
- * For each new BindingProcessor a new STAL object is created.
- * @param aStalFactory the factory to be used. Must not be null.
- */
- public void setSTALFactory(STALFactory aStalFactory);
-
- /**
- * Sets the invoker to be used.
- * @param invoker
- */
- public void setSLCommandInvoker(SLCommandInvoker invoker);
-
- /**
- * Schedules the provided binding processor for processing and immediately returns.
- *
- * @param aBindingProcessor
- */
- public void process(BindingProcessor aBindingProcessor);
-
- /**
- * Removes a formerly added (by calling the process method) binding processor.
- * @param bindingProcessor must not be null
- */
- public void removeBindingProcessor(Id sessionId);
-
- /**
- * A set of all managed binding processors.
- * @return
- */
- public Set getManagedIds();
-
+import java.util.Locale;
+import java.util.Set;
+
+import at.gv.egiz.bku.slcommands.SLCommandInvoker;
+import at.gv.egiz.stal.STALFactory;
+
+/**
+ * Central player that handles the protocol binding.
+ *
+ * @author wbauer
+ *
+ */
+public interface BindingProcessorManager {
+
+ /**
+ * FactoryMethod creating a new BindingProcessor object.
+ * The created binding processor must be passed to the process method to execute.
+ *
+ * @param urlString
+ * the source url
+ * @param aSessionId
+ * optional an external sessionId (e.g. http session) could be
+ * provided. This parameter may be null.
+ * @param locale the locale used for user interaction, may be null
+ */
+ public BindingProcessor createBindingProcessor(String urlString,
+ String aSessionId, Locale locale) throws MalformedURLException;
+
+ /**
+ * FactoryMethod creating a new BindingProcessor object.
+ * The created binding processor must be passed to the process method to execute.
+ *
+ * @param protcol
+ * the source url
+ * @param aSessionId
+ * optional an external sessionId (e.g. http session) could be
+ * provided. This parameter may be null.
+ */
+ public BindingProcessor createBindingProcessor(String urlString,
+ String aSessionId) throws MalformedURLException;
+
+
+ /**
+ * Gets the binding processor with a certain id. The binding processor must be passed to the
+ * process method before it is managed and thus returned by this method.
+ * @param aId must not be null
+ * @return null if the binding processor was not "processed" before.
+ */
+ public BindingProcessor getBindingProcessor(Id aId);
+
+ /**
+ * Sets the STAL factory that is used for creating STAL objects that are used by BindingProcessor objects.
+ * For each new BindingProcessor a new STAL object is created.
+ * @param aStalFactory the factory to be used. Must not be null.
+ */
+ public void setSTALFactory(STALFactory aStalFactory);
+
+ /**
+ * Sets the invoker to be used.
+ * @param invoker
+ */
+ public void setSLCommandInvoker(SLCommandInvoker invoker);
+
+ /**
+ * Creates a processing context,
+ * schedules the provided binding processor for processing and
+ * immediately returns the context.
+ *
+ * @param aBindingProcessor
+ */
+ public ProcessingContext process(BindingProcessor aBindingProcessor);
+
+ /**
+ * Removes a formerly added (by calling the process method) binding processor.
+ * @param bindingProcessor must not be null
+ */
+ public void removeBindingProcessor(Id sessionId);
+
+ /**
+ * A set of all managed binding processors.
+ * @return
+ */
+ public Set getManagedIds();
+
public void shutdown();
- public void shutdownNow();
+ public void shutdownNow();
}
\ No newline at end of file
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java
index 11f5a160..cc1b7532 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java
@@ -53,8 +53,9 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
private STALFactory stalFactory;
private SLCommandInvoker commandInvokerClass;
private ExecutorService executorService;
- private Map bindingProcessorMap = Collections
- .synchronizedMap(new HashMap());
+ private Map contextMap = Collections.synchronizedMap(new HashMap());
+// private Map bindingProcessorMap = Collections
+// .synchronizedMap(new HashMap());
/**
* Container to hold a Future and Bindingprocessor object as map value.
@@ -62,39 +63,39 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
* @author wbauer
* @see BindingProcessorManagerImpl#bindingProcessorMap
*/
- static class MapEntityWrapper {
- private Future> future;
- private BindingProcessor bindingProcessor;
-
- public MapEntityWrapper(Future> future, BindingProcessor bindingProcessor) {
- if ((bindingProcessor == null) || (future == null)) {
- throw new NullPointerException("Argument must not be null");
- }
- this.bindingProcessor = bindingProcessor;
- this.future = future;
- }
-
- public Future> getFuture() {
- return future;
- }
-
- public BindingProcessor getBindingProcessor() {
- return bindingProcessor;
- }
-
- public int hashCode() {
- return bindingProcessor.getId().hashCode();
- }
-
- public boolean equals(Object other) {
- if (other instanceof MapEntityWrapper) {
- MapEntityWrapper o = (MapEntityWrapper) other;
- return (o.bindingProcessor.getId().equals(bindingProcessor.getId()));
- } else {
- return false;
- }
- }
- }
+// static class MapEntityWrapper {
+// private Future> future;
+// private BindingProcessor bindingProcessor;
+//
+// public MapEntityWrapper(Future> future, BindingProcessor bindingProcessor) {
+// if ((bindingProcessor == null) || (future == null)) {
+// throw new NullPointerException("Argument must not be null");
+// }
+// this.bindingProcessor = bindingProcessor;
+// this.future = future;
+// }
+//
+// public Future> getFuture() {
+// return future;
+// }
+//
+// public BindingProcessor getBindingProcessor() {
+// return bindingProcessor;
+// }
+//
+// public int hashCode() {
+// return bindingProcessor.getId().hashCode();
+// }
+//
+// public boolean equals(Object other) {
+// if (other instanceof MapEntityWrapper) {
+// MapEntityWrapper o = (MapEntityWrapper) other;
+// return (o.bindingProcessor.getId().equals(bindingProcessor.getId()));
+// } else {
+// return false;
+// }
+// }
+// }
/**
*
@@ -157,17 +158,24 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
public void shutdownNow() {
log.info("Shutting down the BindingProcessorManager NOW!");
executorService.shutdownNow();
- log.debug("Number of binding prcessors currently managed: "
- + bindingProcessorMap.size());
+ log.debug("Number of binding contexts currently managed: "
+ + contextMap.size());
+// + bindingProcessorMap.size());
if (log.isDebugEnabled()) {
- for (Iterator it = bindingProcessorMap.values()
- .iterator(); it.hasNext();) {
- MapEntityWrapper entry = it.next();
- log.debug(entry.getBindingProcessor().getId() + ": isDone: "
- + entry.getFuture().isDone());
- log.debug(entry.getBindingProcessor().getId() + ": isCanceled: "
- + entry.getFuture().isCancelled());
+ for (ProcessingContext ctx : contextMap.values()) {
+ Id bpId = ctx.getBindingProcessor().getId();
+ Future future = ctx.getFuture();
+ log.debug(bpId + " cancelled: " + future.isCancelled());
+ log.debug(bpId + " done: " + future.isDone());
}
+// for (Iterator it = bindingProcessorMap.values()
+// .iterator(); it.hasNext();) {
+// MapEntityWrapper entry = it.next();
+// log.debug(entry.getBindingProcessor().getId() + ": isDone: "
+// + entry.getFuture().isDone());
+// log.debug(entry.getBindingProcessor().getId() + ": isCanceled: "
+// + entry.getFuture().isCancelled());
+// }
}
}
@@ -216,17 +224,22 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
* @return the bindingprocessor object for this id or null if no
* bindingprocessor was found.
*/
+ @Override
public BindingProcessor getBindingProcessor(Id aId) {
- if (bindingProcessorMap.get(aId) != null) {
- return bindingProcessorMap.get(aId).getBindingProcessor();
+// if (bindingProcessorMap.get(aId) != null) {
+// return bindingProcessorMap.get(aId).getBindingProcessor();
+ ProcessingContext ctx = contextMap.get(aId);
+ if (ctx != null) {
+ return ctx.getBindingProcessor();
} else {
return null;
}
}
- /**
- *
+ /**
+ *
*/
+ @Override
public void setSTALFactory(STALFactory aStalFactory) {
if (aStalFactory == null) {
throw new NullPointerException("Cannot set STALFactory to null");
@@ -236,12 +249,17 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
/**
* Causes the BindingProcessorManager to manage the provided BindingProcessor
+ * Creates a processing context,
+ * schedules the provided binding processor for processing and
+ * immediately returns the context.
*
* @param aBindingProcessor
* must not be null
*/
- public void process(BindingProcessor aBindingProcessor) {
- if (bindingProcessorMap.containsKey(aBindingProcessor.getId())) {
+ @Override
+ public ProcessingContext process(BindingProcessor aBindingProcessor) {
+ if (contextMap.containsKey(aBindingProcessor.getId())) {
+// if (bindingProcessorMap.containsKey(aBindingProcessor.getId())) {
log.fatal("Clashing ids, cannot process bindingprocessor with id:"
+ aBindingProcessor.getId());
throw new SLRuntimeException(
@@ -250,8 +268,11 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
}
log.debug("processing bindingprocessor: " + aBindingProcessor.getId());
Future> f = executorService.submit(aBindingProcessor);
- bindingProcessorMap.put(aBindingProcessor.getId(), new MapEntityWrapper(f,
- aBindingProcessor));
+ ProcessingContext ctx = new ProcessingContext(aBindingProcessor, f);
+ contextMap.put(aBindingProcessor.getId(), ctx);
+// bindingProcessorMap.put(aBindingProcessor.getId(), new MapEntityWrapper(f,
+// aBindingProcessor));
+ return ctx;
}
@Override
@@ -262,26 +283,38 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
@Override
public void removeBindingProcessor(Id sessionId) {
log.debug("Removing binding processor: " + sessionId);
- MapEntityWrapper wrapper = bindingProcessorMap.get(sessionId);
- if (wrapper == null) {
+ ProcessingContext ctx = contextMap.get(sessionId);
+ if (ctx == null) {
return;
}
- Future> f = wrapper.getFuture();
+ Future f = ctx.getFuture();
+
+// MapEntityWrapper wrapper = bindingProcessorMap.get(sessionId);
+// if (wrapper == null) {
+// return;
+// }
+// Future> f = wrapper.getFuture();
if (!f.isDone()) {
f.cancel(true);
}
- bindingProcessorMap.remove(sessionId);
+ contextMap.remove(sessionId);
+// bindingProcessorMap.remove(sessionId);
}
@Override
public Set getManagedIds() {
Set result = new HashSet();
- synchronized (bindingProcessorMap) {
- for (Iterator it = bindingProcessorMap.keySet().iterator(); it
- .hasNext();) {
- result.add(it.next());
+ synchronized (contextMap) {
+ for (Id id : contextMap.keySet()) {
+ result.add(id);
}
}
+// synchronized (bindingProcessorMap) {
+// for (Iterator it = bindingProcessorMap.keySet().iterator(); it
+// .hasNext();) {
+// result.add(it.next());
+// }
+// }
return result;
}
}
\ No newline at end of file
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/ProcessingContext.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/ProcessingContext.java
new file mode 100644
index 00000000..ae7f01eb
--- /dev/null
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/ProcessingContext.java
@@ -0,0 +1,39 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+
+package at.gv.egiz.bku.binding;
+
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.concurrent.Future;
+
+/**
+ * BindingContext?
+ * RequestBindingContext?
+ *
+ * @author clemens
+ */
+public class ProcessingContext {
+
+ public static final String BINDING_PROCESSOR = "binding.processor";
+ public static final String FUTURE = "future";
+
+ protected Map properties = new Hashtable();
+
+ public ProcessingContext(BindingProcessor bp, Future future) {
+ properties.put(BINDING_PROCESSOR, bp);
+ properties.put(FUTURE, future);
+ }
+
+
+
+ public BindingProcessor getBindingProcessor() {
+ return (BindingProcessor) properties.get(BINDING_PROCESSOR);
+ }
+
+ public Future getFuture() {
+ return (Future) properties.get(FUTURE);
+ }
+}
--
cgit v1.2.3
From c2ae3db1bc6dcb8ba3eb3461c05e293917c004ca Mon Sep 17 00:00:00 2001
From: mcentner
Date: Thu, 30 Oct 2008 10:33:29 +0000
Subject: Updated SMCC to use exclusive access and to throw exceptions upon
locked or not activated cards. Improved locale support in the security layer
request and response processing. Fixed issue in STAL which prevented the use
of RSA-SHA1 signatures. Added additional parameters to the applet test pages.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@128 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../main/java/at/gv/egiz/bku/gui/PinDocument.java | 2 +-
.../egiz/bku/online/webapp/BKURequestHandler.java | 20 +-
BKUOnline/src/main/webapp/HTTP-ohne.html | 11 +-
BKUOnline/src/main/webapp/appletPage.jsp | 29 +-
.../at/gv/egiz/stal/util/JCEAlgorithmNames.java | 4 +-
.../gv/egiz/bku/binding/HTTPBindingProcessor.java | 3 +-
.../gv/egiz/bku/slcommands/SLCommandContext.java | 17 +-
.../impl/CreateXMLSignatureCommandImpl.java | 4 +-
.../egiz/bku/slcommands/impl/ErrorResultImpl.java | 42 ++-
.../slcommands/impl/InfoboxReadCommandImpl.java | 2 +-
.../gv/egiz/bku/slcommands/impl/SLResultImpl.java | 8 +-
.../bku/slcommands/impl/ErrorResultImplTest.java | 3 +-
smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java | 348 ++++++++++++---------
.../at/gv/egiz/smcc/AbstractSignatureCard.java | 169 +++++++---
.../at/gv/egiz/smcc/FileNotFoundException.java | 38 +++
.../main/java/at/gv/egiz/smcc/LockedException.java | 38 +++
.../at/gv/egiz/smcc/NotActivatedException.java | 44 +++
.../src/main/java/at/gv/egiz/smcc/STARCOSCard.java | 339 ++++++++++++--------
smcc/src/main/java/at/gv/egiz/smcc/SWCard.java | 79 ++++-
.../at/gv/egiz/smcc/SignatureCardException.java | 2 +-
.../java/at/gv/egiz/smcc/SignatureCardFactory.java | 223 +++++++++++--
.../java/at/gv/egiz/smcc/util/SmartCardIO.java | 3 +-
.../test/java/at/gv/egiz/smcc/STARCOSCardTest.java | 92 ++++++
.../bku/smccstal/InfoBoxReadRequestHandler.java | 8 +
.../gv/egiz/bku/smccstal/SignRequestHandler.java | 10 +-
25 files changed, 1149 insertions(+), 389 deletions(-)
create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/FileNotFoundException.java
create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/LockedException.java
create mode 100644 smcc/src/main/java/at/gv/egiz/smcc/NotActivatedException.java
create mode 100644 smcc/src/test/java/at/gv/egiz/smcc/STARCOSCardTest.java
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java
index 8ae9d7a3..2054ae86 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java
@@ -46,7 +46,7 @@ class PINDocument extends PlainDocument {
@Override
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
- if (pinSpec.getMaxLength() >= (getLength() + str.length())) {
+ if (pinSpec.getMaxLength() < 0 || pinSpec.getMaxLength() >= (getLength() + str.length())) {
boolean matches = true;
for (int i = 0; i < str.length(); i++) {
Matcher m = pinPattern.matcher(str.substring(i, i + 1));
diff --git a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
index 6f3b9d7f..9092e3f9 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/bku/online/webapp/BKURequestHandler.java
@@ -44,6 +44,8 @@ import at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage;
*/
public class BKURequestHandler extends SpringBKUServlet {
+ private static final long serialVersionUID = 1L;
+
public final static String REDIRECT_URL = "appletPage.jsp";
protected Log log = LogFactory.getLog(BKURequestHandler.class);
@@ -105,6 +107,8 @@ public class BKURequestHandler extends SpringBKUServlet {
String width = getStringFromStream(bindingProcessor.getFormData("appletWidth"), charset);
String height = getStringFromStream(bindingProcessor.getFormData("appletHeight"), charset);
String background = getStringFromStream(bindingProcessor.getFormData("appletBackground"), charset);
+ String guiStyle = getStringFromStream(bindingProcessor.getFormData("appletGuiStyle"), charset);
+ String hashDataDisplay = getStringFromStream(bindingProcessor.getFormData("appletHashDataDisplay"), charset);
if (width != null) {
try {
log.trace("Found applet width parameter: " + width);
@@ -124,12 +128,16 @@ public class BKURequestHandler extends SpringBKUServlet {
}
}
if (background != null) {
- try {
- log.trace("Found applet background parameter: " + background);
- session.setAttribute("appletBackground", background);
- } catch (NumberFormatException nfe) {
- log.warn(nfe);
- }
+ log.trace("Found applet background parameter: " + background);
+ session.setAttribute("appletBackground", background);
+ }
+ if (guiStyle != null) {
+ log.trace("Found applet GUI style parameter: " + guiStyle);
+ session.setAttribute("appletGuiStyle", guiStyle);
+ }
+ if (hashDataDisplay != null) {
+ log.trace("Found applet hash data display parameter: " + hashDataDisplay);
+ session.setAttribute("appletHashDataDisplay", hashDataDisplay);
}
resp.sendRedirect(REDIRECT_URL);
diff --git a/BKUOnline/src/main/webapp/HTTP-ohne.html b/BKUOnline/src/main/webapp/HTTP-ohne.html
index 1923113e..044432ce 100644
--- a/BKUOnline/src/main/webapp/HTTP-ohne.html
+++ b/BKUOnline/src/main/webapp/HTTP-ohne.html
@@ -92,8 +92,17 @@ legend {
name="appletHeight" value="130" id="appletHeight">
+
+
+ simple
+ advanced
+
+
+
+ external
+ internal
+
-
-
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 7e0f0447..27841d1c 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -41,6 +41,7 @@ import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
@@ -66,6 +67,8 @@ public class BKUGUI implements BKUGUIFacade {
private static final Log log = LogFactory.getLog(BKUGUI.class);
+ protected HelpMouseListener helpListener;
+
protected Container contentPane;
protected ResourceBundle messages;
/** left and right side main panels */
@@ -89,7 +92,7 @@ public class BKUGUI implements BKUGUIFacade {
* @param localeString may be null
*/
@Override
- public void init(final Container contentPane, String localeString, final URL background) {
+ public void init(final Container contentPane, String localeString, final URL background, ActionListener helpListener) {
if (localeString != null) {
messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, new Locale(localeString));
@@ -98,6 +101,7 @@ public class BKUGUI implements BKUGUIFacade {
}
this.contentPane = contentPane;
+ registerHelpListener(helpListener);
try {
@@ -175,6 +179,11 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
+ JLabel helpLabel = new JLabel();
+ helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
+ helpLabel.addMouseListener(helpListener);
+ helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+
JButton b = new JButton();
b.setText(messages.getString(BUTTON_CANCEL));
if (b.getPreferredSize().width > buttonSize)
@@ -204,15 +213,17 @@ public class BKUGUI implements BKUGUIFacade {
GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
headerPanel.setLayout(headerPanelLayout);
-//
+
headerPanelLayout.setHorizontalGroup(
headerPanelLayout.createSequentialGroup()
- .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
- .addContainerGap());
+ .addComponent(titleLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel));
headerPanelLayout.setVerticalGroup(
- headerPanelLayout.createSequentialGroup()
- .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
-
+ headerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING) //SequentialGroup()
+ .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
+ .addComponent(helpLabel));
+
GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
contentPanel.setLayout(contentPanelLayout);
@@ -234,7 +245,7 @@ public class BKUGUI implements BKUGUIFacade {
.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) //, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addContainerGap()); //);
+ .addContainerGap());
}
@Override
@@ -291,6 +302,8 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setText(messages.getString(TITLE_WELCOME));
+ helpListener.setHelpTopic(HELP_WELCOME);
+
JLabel welcomeMsgLabel = new JLabel();
welcomeMsgLabel.setFont(welcomeMsgLabel.getFont().deriveFont(welcomeMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
welcomeMsgLabel.setText(messages.getString(MESSAGE_WAIT));
@@ -300,10 +313,10 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(welcomeMsgLabel));
+ .addComponent(welcomeMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(welcomeMsgLabel));
+ .addComponent(welcomeMsgLabel));
contentPanel.validate();
@@ -328,6 +341,8 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setText(messages.getString(TITLE_INSERTCARD));
+ helpListener.setHelpTopic(HELP_INSERTCARD);
+
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
insertCardMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
@@ -385,6 +400,8 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ helpListener.setHelpTopic(HELP_CARDNOTSUPPORTED);
+
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
insertCardMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
@@ -476,10 +493,12 @@ public class BKUGUI implements BKUGUIFacade {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
String infoPattern = messages.getString(MESSAGE_ENTERPIN);
infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {pinSpec.getLocalizedName()}));
+ helpListener.setHelpTopic(HELP_CARDPIN);
} else {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
}
JLabel pinsizeLabel = new JLabel();
@@ -496,7 +515,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
@@ -506,13 +525,13 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel)
- .addGap(infoLabel.getFont().getSize())
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(cardPinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel));
+ .addComponent(infoLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(cardPinLabel)
+ .addComponent(pinField))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -628,10 +647,12 @@ public class BKUGUI implements BKUGUIFacade {
hashdataListener.actionPerformed(e);
}
});
+ helpListener.setHelpTopic(HELP_SIGNPIN);
} else {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
}
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
@@ -640,22 +661,22 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(pinsizeLabel))));
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(pinsizeLabel))));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
.addComponent(infoLabel)
- .addGap(infoLabel.getFont().getSize())
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(signPinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel));
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(signPinLabel)
+ .addComponent(pinField))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -695,6 +716,8 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setText(messages.getString(TITLE_ERROR));
+ helpListener.setHelpTopic(errorMsgKey);
+
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -708,10 +731,10 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
+ .addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
+ .addComponent(errorMsgLabel));
JButton okButton = new JButton();
okButton.setText(messages.getString(BUTTON_OK));
@@ -751,6 +774,8 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setText(messages.getString(TITLE_ERROR));
+ helpListener.setHelpTopic(errorMsgKey);
+
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -764,10 +789,10 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
+ .addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
+ .addComponent(errorMsgLabel));
contentPanel.validate();
}
@@ -791,6 +816,8 @@ public class BKUGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_WAIT));
+ helpListener.setHelpTopic(HELP_WAIT);
+
JLabel waitMsgLabel = new JLabel();
waitMsgLabel.setFont(waitMsgLabel.getFont().deriveFont(waitMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (waitMessage != null) {
@@ -804,10 +831,10 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(waitMsgLabel));
+ .addComponent(waitMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(waitMsgLabel));
+ .addComponent(waitMsgLabel));
contentPanel.validate();
}
@@ -883,6 +910,8 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setText(messages.getString(TITLE_HASHDATA));
+ helpListener.setHelpTopic(HELP_HASHDATA);
+
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
refIdLabel.setText(messages.getString(MESSAGE_HASHDATA)); //MessageFormat.format(refIdLabelPattern, new Object[]{refId}));
@@ -904,14 +933,14 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(refIdLabel)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+ .addComponent(refIdLabel)
+ .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(refIdLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+ .addComponent(refIdLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
JButton backButton = new JButton();
backButton.setText(messages.getString(BUTTON_BACK));
@@ -958,6 +987,8 @@ public class BKUGUI implements BKUGUIFacade {
titleLabel.setText(messages.getString(TITLE_HASHDATA));
+ helpListener.setHelpTopic(HELP_HASHDATALIST);
+
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
String refIdLabelPattern = messages.getString(MESSAGE_HASHDATALIST);
@@ -982,15 +1013,15 @@ public class BKUGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(refIdLabel)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+ .addComponent(refIdLabel)
+ .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(refIdLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(hashDataScrollPane, 0, 0, hashDataTable.getPreferredSize().height+3));
-
+ .addComponent(refIdLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(hashDataScrollPane, 0, 0, hashDataTable.getPreferredSize().height+3));
+
JButton backButton = new JButton();
backButton.setText(messages.getString(BUTTON_BACK));
backButton.setActionCommand(cancelCommand);
@@ -1133,4 +1164,19 @@ public class BKUGUI implements BKUGUIFacade {
}
}
}
+
+ private void registerHelpListener(ActionListener helpListener) {
+ if (helpListener != null) {
+ this.helpListener = new HelpMouseListener(helpListener);
+ } else {
+ log.error("no help listener provided, will not be able to display help");
+ this.helpListener = new HelpMouseListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ log.error("no help listener registered (requested help topic: " + e.getActionCommand() + ")");
+ }
+ });
+ }
+ }
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index ced74834..6c157e76 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -37,6 +37,7 @@ public interface BKUGUIFacade {
public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
public static final String DEFAULT_BACKGROUND = "/images/BackgroundChipperling.png";
+ public static final String HELP_IMG = "/images/help.png";
public static final String HASHDATA_FONT = "Monospaced";
public static final Color ERROR_COLOR = Color.RED;
public static final Color HYPERLINK_COLOR = Color.BLUE;
@@ -63,6 +64,15 @@ public interface BKUGUIFacade {
public static final String LABEL_PIN = "label.pin";
public static final String LABEL_PINSIZE = "label.pinsize";
// public static final String ERROR_NO_HASHDATA = "error.no.hashdata";
+ public static final String HELP_WELCOME = "help.welcome";
+ public static final String HELP_WAIT = "help.wait";
+ public static final String HELP_CARDNOTSUPPORTED = "help.cardnotsupported";
+ public static final String HELP_INSERTCARD = "help.insertcard";
+ public static final String HELP_CARDPIN = "help.cardpin";
+ public static final String HELP_SIGNPIN = "help.signpin";
+ public static final String HELP_RETRY = "help.retry";
+ public static final String HELP_HASHDATA = "help.hashdata";
+ public static final String HELP_HASHDATALIST = "help.hashdatalist";
public static final String BUTTON_OK = "button.ok";
public static final String BUTTON_CANCEL = "button.cancel";
@@ -72,9 +82,9 @@ public interface BKUGUIFacade {
public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
- public void init(Container contentPane, String localeString, URL background);
+ public void init(Container contentPane, String localeString, URL background, ActionListener helpListener);
- public void showWelcomeDialog();
+ public void showWelcomeDialog();
/**
* MOA-ID only
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
new file mode 100644
index 00000000..6d814f01
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
@@ -0,0 +1,33 @@
+package at.gv.egiz.bku.gui;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class HelpMouseListener extends MouseAdapter {
+
+ protected static final Log log = LogFactory.getLog(HelpMouseListener.class);
+
+ protected ActionListener externalHelpListener;
+ protected String locale;
+ protected String topic;
+
+ public HelpMouseListener(ActionListener externalHelpListener) {
+ super();
+ this.externalHelpListener = externalHelpListener;
+ }
+
+ public void setHelpTopic(String topic) {
+ log.trace("setting help topic: " + topic);
+ this.topic = topic;
+ }
+
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, topic);
+ externalHelpListener.actionPerformed(e);
+ }
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index c37704e2..29913d2a 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -41,6 +41,7 @@ import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
@@ -65,6 +66,8 @@ import org.apache.commons.logging.LogFactory;
public class SimpleGUI implements BKUGUIFacade {
private static final Log log = LogFactory.getLog(SimpleGUI.class);
+
+ protected HelpMouseListener helpListener;
protected Container contentPane;
protected ResourceBundle messages;
@@ -77,6 +80,7 @@ public class SimpleGUI implements BKUGUIFacade {
protected JPanel buttonPanel;
/** right side fixed labels */
// protected JLabel titleLabel;
+ protected JLabel helpLabel;
/** remember the pinfield to return to worker */
protected JPasswordField pinField;
@@ -89,7 +93,7 @@ public class SimpleGUI implements BKUGUIFacade {
* @param localeString may be null
*/
@Override
- public void init(final Container contentPane, String localeString, final URL background) {
+ public void init(final Container contentPane, String localeString, final URL background, ActionListener helpListener) {
if (localeString != null) {
messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, new Locale(localeString));
@@ -98,7 +102,8 @@ public class SimpleGUI implements BKUGUIFacade {
}
this.contentPane = contentPane;
-
+ registerHelpListener(helpListener);
+
try {
log.debug("scheduling gui initialization");
@@ -131,7 +136,7 @@ public class SimpleGUI implements BKUGUIFacade {
throw new RuntimeException("Failed to init GUI: " + ex.getMessage());
}
}
-
+
// protected void initIconPanel() {
// iconPanel = new JPanel();
// JLabel iconLabel = new JLabel();
@@ -151,7 +156,7 @@ public class SimpleGUI implements BKUGUIFacade {
// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); //);
// }
- protected void initContentPanel(URL background) {
+ protected void initContentPanel(URL background) {
if (background == null) {
background = this.getClass().getResource(DEFAULT_BACKGROUND);
@@ -175,6 +180,11 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
// java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
+ helpLabel = new JLabel();
+ helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
+ helpLabel.addMouseListener(helpListener);
+ helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+
JButton b = new JButton();
// b.setText(messages.getString(BUTTON_CANCEL));
// if (b.getPreferredSize().width > buttonSize)
@@ -207,8 +217,7 @@ public class SimpleGUI implements BKUGUIFacade {
//
// headerPanelLayout.setHorizontalGroup(
// headerPanelLayout.createSequentialGroup()
-// .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
-// .addContainerGap());
+// .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
// headerPanelLayout.setVerticalGroup(
// headerPanelLayout.createSequentialGroup()
// .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
@@ -234,7 +243,7 @@ public class SimpleGUI implements BKUGUIFacade {
.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) //, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addContainerGap()); //);
+ .addContainerGap());
}
@Override
@@ -291,6 +300,8 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_WELCOME));
+ helpListener.setHelpTopic(HELP_WELCOME);
+
JLabel welcomeMsgLabel = new JLabel();
welcomeMsgLabel.setFont(welcomeMsgLabel.getFont().deriveFont(welcomeMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
welcomeMsgLabel.setText(messages.getString(TITLE_WELCOME));
@@ -299,12 +310,16 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(welcomeMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(welcomeMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(welcomeMsgLabel));
-
+ .addComponent(helpLabel)
+ .addComponent(welcomeMsgLabel));
+
contentPanel.validate();
}
@@ -328,6 +343,8 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_INSERTCARD));
+ helpListener.setHelpTopic(HELP_INSERTCARD);
+
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
insertCardMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
@@ -336,10 +353,14 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
.addComponent(insertCardMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
+ .addComponent(helpLabel)
.addComponent(insertCardMsgLabel));
// JButton cancelButton = new JButton();
@@ -385,6 +406,8 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ helpListener.setHelpTopic(HELP_CARDNOTSUPPORTED);
+
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
insertCardMsgLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
@@ -393,12 +416,16 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
.addComponent(insertCardMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
+ .addComponent(helpLabel)
.addComponent(insertCardMsgLabel));
-
+
// JButton cancelButton = new JButton();
// cancelButton.setText(messages.getString(BUTTON_CANCEL));
// cancelButton.addActionListener(cancelListener);
@@ -477,10 +504,12 @@ public class SimpleGUI implements BKUGUIFacade {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
String infoPattern = messages.getString(MESSAGE_ENTERPIN);
infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {pinSpec.getLocalizedName()}));
+ helpListener.setHelpTopic(HELP_CARDPIN);
} else {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
}
JLabel pinsizeLabel = new JLabel();
@@ -497,7 +526,10 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
@@ -507,13 +539,15 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel)
- .addGap(infoLabel.getFont().getSize())
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(cardPinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel));
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel)
+ .addComponent(helpLabel))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(cardPinLabel)
+ .addComponent(pinField))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -580,7 +614,7 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-
+
// if (numRetries < 0) {
// titleLabel.setText(messages.getString(TITLE_SIGN));
// } else {
@@ -626,7 +660,7 @@ public class SimpleGUI implements BKUGUIFacade {
pinSize += "-" + pinSpec.getMaxLength();
}
pinsizeLabel.setText(MessageFormat.format(pinsizePattern, new Object[]{pinSize}));
-
+
JLabel infoLabel = new JLabel();
if (numRetries < 0) {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -641,10 +675,12 @@ public class SimpleGUI implements BKUGUIFacade {
hashdataListener.actionPerformed(e);
}
});
+ helpListener.setHelpTopic(HELP_SIGNPIN);
} else {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
+ helpListener.setHelpTopic(HELP_RETRY);
}
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
@@ -652,23 +688,28 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(pinsizeLabel))));
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(pinsizeLabel))));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(infoLabel)
- .addGap(infoLabel.getFont().getSize())
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(signPinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel));
+ .addComponent(helpLabel))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(signPinLabel)
+ .addComponent(pinField))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -719,6 +760,8 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_ERROR));
+ helpListener.setHelpTopic(errorMsgKey);
+
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -731,12 +774,16 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
-
+ .addComponent(helpLabel)
+ .addComponent(errorMsgLabel));
+
JButton okButton = new JButton();
okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
okButton.setText(messages.getString(BUTTON_OK));
@@ -776,6 +823,8 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_ERROR));
+ helpListener.setHelpTopic(errorMsgKey);
+
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -788,11 +837,15 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(errorMsgLabel));
+ .addComponent(helpLabel)
+ .addComponent(errorMsgLabel));
contentPanel.validate();
}
@@ -816,6 +869,8 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_WAIT));
+ helpListener.setHelpTopic(HELP_WAIT);
+
JLabel waitMsgLabel = new JLabel();
waitMsgLabel.setFont(waitMsgLabel.getFont().deriveFont(waitMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (waitMessage != null) {
@@ -828,11 +883,15 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(waitMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(waitMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(waitMsgLabel));
+ .addComponent(helpLabel)
+ .addComponent(waitMsgLabel));
contentPanel.validate();
}
@@ -907,6 +966,8 @@ public class SimpleGUI implements BKUGUIFacade {
buttonPanel.removeAll();
// titleLabel.setText(messages.getString(TITLE_HASHDATA));
+
+ helpListener.setHelpTopic(HELP_HASHDATA);
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -929,14 +990,19 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(refIdLabel)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(refIdLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(refIdLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(refIdLabel)
+ .addComponent(helpLabel))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
JButton backButton = new JButton();
backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -995,6 +1061,8 @@ public class SimpleGUI implements BKUGUIFacade {
// titleLabel.setText(messages.getString(TITLE_HASHDATA));
+ helpListener.setHelpTopic(HELP_HASHDATALIST);
+
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
String refIdLabelPattern = messages.getString(MESSAGE_HASHDATALIST);
@@ -1019,14 +1087,19 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(refIdLabel)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(refIdLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(refIdLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(hashDataScrollPane, 0, 0, hashDataTable.getPreferredSize().height+3));
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(refIdLabel)
+ .addComponent(helpLabel))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(hashDataScrollPane, 0, 0, hashDataTable.getPreferredSize().height+3));
JButton backButton = new JButton();
backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -1183,4 +1256,19 @@ public class SimpleGUI implements BKUGUIFacade {
}
}
}
+
+ private void registerHelpListener(ActionListener helpListener) {
+ if (helpListener != null) {
+ this.helpListener = new HelpMouseListener(helpListener);
+ } else {
+ log.error("no help listener provided, will not be able to display help");
+ this.helpListener = new HelpMouseListener(new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ log.error("no help listener registered (requested help topic: " + e.getActionCommand() + ")");
+ }
+ });
+ }
+ }
}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index a38e2cf8..5a427360 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -26,12 +26,12 @@ windowtitle.save=Signaturdaten speichern
windowtitle.savedir=Signaturdaten in Verzeichnis speichern
windowtitle.overwrite=Datei \u00FCberschreiben?
message.wait=Bitte warten...
-message.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
-message.enterpin=Bitte {0} eingeben
-message.hashdatalink=Signaturdaten anzeigen...
-message.hashdata=Ein Signaturdatenobjekt:
+message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
+message.enterpin={0} eingeben
+message.hashdatalink=Signaturdaten anzeigen
+message.hashdata=Signaturdaten:
#message.hashdata=Referenz Id: {0}
-message.hashdatalist={0} Signaturdatenobjekte:
+message.hashdatalist={0} Signaturdaten:
message.retries=Noch {0} Versuch(e)
message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
label.pin={0}:
diff --git a/BKUCommonGUI/src/main/resources/images/help.png b/BKUCommonGUI/src/main/resources/images/help.png
new file mode 100644
index 00000000..4ed65a97
Binary files /dev/null and b/BKUCommonGUI/src/main/resources/images/help.png differ
diff --git a/BKUOnline/src/main/webapp/appletPage.jsp b/BKUOnline/src/main/webapp/appletPage.jsp
index ffb67828..8ddbed13 100644
--- a/BKUOnline/src/main/webapp/appletPage.jsp
+++ b/BKUOnline/src/main/webapp/appletPage.jsp
@@ -52,9 +52,10 @@
var parameters = {
GuiStyle : '<%=guiStyle%>',
Background : '<%=backgroundImg%>',
- WSDL_URL : '../stal?wsdl',
- HashDataDisplay : '<%=hashDataDisplay%>',
- HashDataURL : '../hashDataInput',
+ WSDL_URL :'../stal?wsdl',
+ HelpURL : '../help',
+ HashDataDisplay : 'external',
+ HashDataURL : '../hashDataInput',
SessionID : '<%=session.getId()%>',
RedirectURL : '../bkuResult'
};
--
cgit v1.2.3
From 8479ef50c84e8998f7909074df6a23c2ff0aa5b0 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Fri, 31 Oct 2008 12:33:18 +0000
Subject: Help Icon
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@132 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/nb-configuration.xml | 6 ++++++
.../applet/ExternalDisplaySignRequestHandler.java | 16 ++++++++++++++--
.../gv/egiz/bku/online/applet/ExternalHelpListener.java | 17 +++++++++++++++--
.../bku/online/applet/InternalSSLSocketFactory.java | 4 ----
.../bku/online/applet/WebServiceSignRequestHandler.java | 1 +
.../src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 1 +
.../src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java | 1 +
.../java/at/gv/egiz/bku/gui/HashDataTableModel.java | 1 +
.../main/java/at/gv/egiz/bku/gui/HelpMouseListener.java | 17 +++++++++++++++++
.../src/main/java/at/gv/egiz/bku/gui/ImagePanel.java | 16 ++++++++++++++--
.../src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 5 +----
.../src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java | 2 +-
.../java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java | 4 ++--
.../java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java | 2 +-
14 files changed, 75 insertions(+), 18 deletions(-)
create mode 100644 BKUApplet/nb-configuration.xml
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/nb-configuration.xml b/BKUApplet/nb-configuration.xml
new file mode 100644
index 00000000..352a03be
--- /dev/null
+++ b/BKUApplet/nb-configuration.xml
@@ -0,0 +1,6 @@
+
+
+
+ bka
+
+
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java
index 2ac1bc62..2c9fde71 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java
@@ -1,6 +1,18 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package at.gv.egiz.bku.online.applet;
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java
index 4d6d5851..f92a6963 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java
@@ -1,7 +1,20 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
+
package at.gv.egiz.bku.online.applet;
import java.applet.AppletContext;
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java
index fa3587e4..c3417d63 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/InternalSSLSocketFactory.java
@@ -14,10 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
package at.gv.egiz.bku.online.applet;
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java
index b417fd33..ddbe76bf 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package at.gv.egiz.bku.online.applet;
import java.security.DigestException;
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 6c157e76..872f1874 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.HashDataInput;
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
index 4a338f23..87676026 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package at.gv.egiz.bku.gui;
public class BKUGUIFactory {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
index 1a833f48..aea85523 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
@@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.HashDataInput;
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
index 6d814f01..531884d1 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package at.gv.egiz.bku.gui;
import java.awt.event.ActionEvent;
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
index e9c270ce..1185cf53 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
@@ -1,6 +1,18 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package at.gv.egiz.bku.gui;
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index 29913d2a..195db27a 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -14,10 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
+
package at.gv.egiz.bku.gui;
import at.gv.egiz.smcc.PINSpec;
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
index 308be642..c32a237a 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
@@ -40,7 +40,7 @@ public class BKUGUITest {
BKUGUI gui = new BKUGUI();
Container contentPane = testFrame.getContentPane();
contentPane.setPreferredSize(new Dimension(380, 150));
- gui.init(contentPane, null, null);
+ gui.init(contentPane, null, null, null);
BKUGUIWorker worker = new BKUGUIWorker();
worker.init(gui);
testFrame.pack();
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
index d12be9ac..8a850549 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
@@ -37,8 +37,8 @@ public class BKUGuiProxy implements BKUGUIFacade {
}
@Override
- public void init(Container contentPane, String localeString, URL bgImage) {
- delegate.init(contentPane, localeString, bgImage);
+ public void init(Container contentPane, String localeString, URL bgImage, ActionListener helpListener) {
+ delegate.init(contentPane, localeString, bgImage, helpListener);
}
@Override
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index e1d434e3..df5c2b28 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -48,7 +48,7 @@ public class SMCCSTALFactory implements STALFactory {
}
dialog = new JDialog();
BKUGUIFacade gui = BKUGUIFactory.createGUI(BKUGUIFactory.ADVANCED_GUI);
- gui.init(dialog.getContentPane(), locale.toString(), null);
+ gui.init(dialog.getContentPane(), locale.toString(), null, null);
stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog, resourceBundle);
dialog.setPreferredSize(new Dimension(400, 200));
dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
--
cgit v1.2.3
From afad7e7920c5418e10c70cb88f967076d290ff1d Mon Sep 17 00:00:00 2001
From: mcentner
Date: Fri, 31 Oct 2008 14:48:17 +0000
Subject: Changed applet background image.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@135 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../main/resources/images/BackgroundChipperling.png | Bin 3367 -> 1544 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png b/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png
index a4791a7f..5cb64674 100644
Binary files a/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png and b/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png differ
--
cgit v1.2.3
From 35096aca11df113631a982554e85a22fff350813 Mon Sep 17 00:00:00 2001
From: mcentner
Date: Fri, 31 Oct 2008 15:28:06 +0000
Subject: Changed applet background image.
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@136 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../main/resources/images/BackgroundChipperling.png | Bin 1544 -> 2041 bytes
1 file changed, 0 insertions(+), 0 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png b/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png
index 5cb64674..5097aa6b 100644
Binary files a/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png and b/BKUCommonGUI/src/main/resources/images/BackgroundChipperling.png differ
--
cgit v1.2.3
From 4032e46810c24dc3f013de296a2133f4651696b9 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Fri, 31 Oct 2008 15:30:34 +0000
Subject: local HelpListener card locked/not activated
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@137 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../egiz/bku/online/applet/AppletHelpListener.java | 46 ++++++++
.../at/gv/egiz/bku/online/applet/BKUApplet.java | 4 +-
.../bku/online/applet/ExternalHelpListener.java | 83 --------------
.../at/gv/egiz/bku/gui/AbstractHelpListener.java | 84 +++++++++++++++
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 2 +
.../at/gv/egiz/bku/gui/Messages.properties | 4 +-
BKULocal/pom.xml | 119 ++++++++++-----------
.../gv/egiz/bku/local/gui/LocalHelpListener.java | 41 +++++++
.../at/gv/egiz/bku/local/stal/SMCCSTALFactory.java | 11 +-
BKUOnline/src/main/webapp/HTTP-ohne.html | 2 +-
.../bku/smccstal/InfoBoxReadRequestHandler.java | 7 ++
.../gv/egiz/bku/smccstal/SignRequestHandler.java | 6 ++
12 files changed, 260 insertions(+), 149 deletions(-)
create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
create mode 100644 BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
new file mode 100644
index 00000000..a0305eb4
--- /dev/null
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.online.applet;
+
+import at.gv.egiz.bku.gui.AbstractHelpListener;
+import java.applet.AppletContext;
+import java.net.URL;
+
+/**
+ *
+ * @author clemens
+ */
+public class AppletHelpListener extends AbstractHelpListener {
+
+ protected AppletContext ctx;
+
+ public AppletHelpListener(AppletContext ctx, URL helpURL, String locale) {
+ super(helpURL, locale);
+ if (ctx == null) {
+ throw new RuntimeException("no applet context provided");
+ }
+ this.ctx = ctx;
+ }
+
+ @Override
+ public void showDocument(URL helpDocument) throws Exception {
+ ctx.showDocument(helpDocument, "_blank");
+ }
+
+
+}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 470534da..2b0188bb 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -82,10 +82,10 @@ public class BKUApplet extends JApplet {
}
String guiStyle = getMyAppletParameter(GUI_STYLE);
BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle);
- ExternalHelpListener helpListener = null;
+ AppletHelpListener helpListener = null;
try {
URL helpURL = getMyAppletParameterURL(HELP_URL);
- helpListener = new ExternalHelpListener(getAppletContext(), helpURL, localeString);
+ helpListener = new AppletHelpListener(getAppletContext(), helpURL, localeString);
} catch (MalformedURLException ex) {
log.error("invalid help URL: " + ex.getMessage());
}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java
deleted file mode 100644
index f92a6963..00000000
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package at.gv.egiz.bku.online.applet;
-
-import java.applet.AppletContext;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.net.MalformedURLException;
-import java.net.URL;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- *
- * @author clemens
- */
-public class ExternalHelpListener implements ActionListener {
-
- protected final static Log log = LogFactory.getLog(ExternalHelpListener.class);
- protected AppletContext ctx;
- protected String helpURLBase;
- protected String locale;
-
- public ExternalHelpListener(AppletContext ctx, URL helpURL, String locale) {
- if (ctx == null) {
- throw new RuntimeException("no applet context provided");
- }
- if (helpURL == null || "".equals(helpURL)) {
- throw new RuntimeException("no help URL provided");
- }
- this.ctx = ctx;
- this.helpURLBase = helpURL.toString();
- this.locale = locale;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- log.debug("received help action: " + e.getActionCommand());
- URL helpURL;
- try {
- String urlString = helpURLBase;
- if (locale != null) {
- urlString = appendParameter(urlString, "locale", locale);
- }
- if (e.getActionCommand() != null && !"".equals(e.getActionCommand())) {
- urlString = appendParameter(urlString, "topic", e.getActionCommand());
- }
- helpURL = new URL(urlString);
- } catch (MalformedURLException ex) {
- try {
- log.error("failed to create help URL: " + ex.getMessage());
- helpURL = new URL(helpURLBase);
- } catch (MalformedURLException ex1) {
- log.error("failed to create default help URL, requested help will not be displayed");
- return;
- }
- }
- ctx.showDocument(helpURL, "_blank");
- }
-
- private String appendParameter(String url, String paramName, String paramValue) {
- if (url.indexOf('?') < 0) {
- return url + "?" + paramName + "=" + paramValue;
- } else {
- return url + "&" + paramName + "=" + paramValue;
- }
- }
-}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
new file mode 100644
index 00000000..68d61bef
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.gui;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public abstract class AbstractHelpListener implements ActionListener {
+
+ protected final static Log log = LogFactory.getLog(AbstractHelpListener.class);
+ protected String helpURLBase;
+ protected String locale;
+
+ public AbstractHelpListener(URL baseURL, String locale) {
+ if (baseURL == null || "".equals(baseURL)) {
+ throw new RuntimeException("no help URL provided");
+ }
+ this.helpURLBase = baseURL.toString();
+ this.locale = locale;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ log.debug("received help action: " + e.getActionCommand());
+ URL helpURL;
+ try {
+ String urlString = helpURLBase;
+ if (locale != null) {
+ urlString = appendParameter(urlString, "locale", locale);
+ }
+ if (e.getActionCommand() != null && !"".equals(e.getActionCommand())) {
+ urlString = appendParameter(urlString, "topic", e.getActionCommand());
+ }
+ helpURL = new URL(urlString);
+ } catch (MalformedURLException ex) {
+ try {
+ log.error("failed to create help URL: " + ex.getMessage());
+ helpURL = new URL(helpURLBase);
+ } catch (MalformedURLException ex1) {
+ log.error("failed to create default help URL, requested help will not be displayed");
+ return;
+ }
+ }
+ try {
+ showDocument(helpURL);
+ } catch (Exception ex) {
+ log.error("could not display help document " + helpURL + ": " + ex.getMessage());
+ }
+ }
+
+ private String appendParameter(String url, String paramName, String paramValue) {
+ if (url.indexOf('?') < 0) {
+ return url + "?" + paramName + "=" + paramValue;
+ } else {
+ return url + "&" + paramName + "=" + paramValue;
+ }
+ }
+
+ public abstract void showDocument(URL helpDocument) throws Exception;
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 872f1874..4ef1b7d9 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -35,6 +35,8 @@ public interface BKUGUIFacade {
public static final String ERR_DISPLAY_HASHDATA = "error.display.hashdata";
public static final String ERR_WRITE_HASHDATA = "error.write.hashdata";
public static final String ERR_INVALID_HASH = "error.invalid.hash";
+ public static final String ERR_CARD_LOCKED = "error.card.locked";
+ public static final String ERR_CARD_NOTACTIVATED = "error.card.notactivated";
public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
public static final String DEFAULT_BACKGROUND = "/images/BackgroundChipperling.png";
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 5a427360..1f51de77 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -58,4 +58,6 @@ error.ws.unreachable=Das Web-Service ist nicht erreichbar: {0}
error.pcsc=Java(TM) scheint keine PC/SC Schnittstelle f\u00FCr den Smartcard-Zugriff zur Verf\u00FCgung zu stellen.
error.cardterminal=Es konnte kein Smartcard-Leser gefunden werden.
Entweder ist kein Leser angeschlossen oder kein PC/SC Treiber installiert.
error.unknown=Leider trat ein Fehler auf: {0}
-error.test=Fehler1 {0} - Fehler2 {1}
\ No newline at end of file
+error.test=Fehler1 {0} - Fehler2 {1}
+error.card.locked=B\u00FCrgerkarte ist gesperrt
+error.card.notactivated=B\u00FCrgerkartenfunktion ist nicht aktiviert
\ No newline at end of file
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index 204fa6b9..03a6a10b 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -1,25 +1,22 @@
-
-
- bku
- at.gv.egiz
- 1.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz
- BKULocal
- war
- BKU Local
- 1.0-SNAPSHOT
-
+
+
+ bku
+ at.gv.egiz
+ 1.0-SNAPSHOT
+
+ 4.0.0
+ at.gv.egiz
+ BKULocal
+ war
+ BKU Local
+ 1.0-SNAPSHOTscm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocalscm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocalscm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
-
+
@@ -27,15 +24,11 @@
2.0.2
-
- true
-
+ true
-
- ${project.version}-r${buildNumber}
-
+ ${project.version}-r${buildNumber}
@@ -59,47 +52,47 @@
-
-
-
- at.gv.egiz
- STAL
- 1.0-SNAPSHOT
-
-
- at.gv.egiz
- bkucommon
- 1.0-SNAPSHOT
-
-
- at.gv.egiz
- smcc
- 1.0-SNAPSHOT
+
+
+
+ at.gv.egiz
+ STAL
+ 1.0-SNAPSHOT
+
+
+ at.gv.egiz
+ bkucommon
+ 1.0-SNAPSHOT
+
+
+ at.gv.egiz
+ smcc
+ 1.0-SNAPSHOTat.gv.egizsmccSTAL1.0-SNAPSHOT
-
-
- org.springframework
- spring-core
- 2.5.5
-
-
- javax.servlet
- servlet-api
- 2.5
- provided
-
-
- org.springframework
- spring-web
- 2.5.5
-
-
- commons-logging
- commons-logging
+
+
+ org.springframework
+ spring-core
+ 2.5.5
+
+
+ javax.servlet
+ servlet-api
+ 2.5
+ provided
+
+
+ org.springframework
+ spring-web
+ 2.5.5
+
+
+ commons-logging
+ commons-loggingat.gv.egiz
@@ -110,6 +103,10 @@
at.gv.egizBKUViewer1.0-SNAPSHOT
-
-
-
\ No newline at end of file
+
+
+
+
+ Tomcat60
+
+
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
new file mode 100644
index 00000000..ebec9c65
--- /dev/null
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.local.gui;
+
+import at.gv.egiz.bku.gui.AbstractHelpListener;
+import java.awt.Desktop;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class LocalHelpListener extends AbstractHelpListener {
+
+ public LocalHelpListener(URL baseURL, String locale) {
+ super(baseURL, locale);
+ }
+
+ @Override
+ public void showDocument(URL helpDocument) throws IOException, URISyntaxException {
+ Desktop.getDesktop().browse(helpDocument.toURI());
+ }
+
+}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index df5c2b28..d3530332 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -18,6 +18,7 @@ package at.gv.egiz.bku.local.stal;
import java.awt.Dimension;
import java.awt.Toolkit;
+import java.net.MalformedURLException;
import java.util.Locale;
import java.util.ResourceBundle;
@@ -26,9 +27,11 @@ import javax.swing.WindowConstants;
import at.gv.egiz.bku.gui.BKUGUIFacade;
import at.gv.egiz.bku.gui.BKUGUIFactory;
+import at.gv.egiz.bku.local.gui.LocalHelpListener;
import at.gv.egiz.bku.online.applet.BKUApplet;
import at.gv.egiz.stal.STAL;
import at.gv.egiz.stal.STALFactory;
+import java.net.URL;
public class SMCCSTALFactory implements STALFactory {
@@ -48,7 +51,13 @@ public class SMCCSTALFactory implements STALFactory {
}
dialog = new JDialog();
BKUGUIFacade gui = BKUGUIFactory.createGUI(BKUGUIFactory.ADVANCED_GUI);
- gui.init(dialog.getContentPane(), locale.toString(), null, null);
+ LocalHelpListener helpListener =null;
+ try {
+ helpListener = new LocalHelpListener(new URL("http://localhost:3495/help"), "en");
+ } catch (MalformedURLException ex) {
+ ex.printStackTrace();
+ }
+ gui.init(dialog.getContentPane(), locale.toString(), null, helpListener);
stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog, resourceBundle);
dialog.setPreferredSize(new Dimension(400, 200));
dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
diff --git a/BKUOnline/src/main/webapp/HTTP-ohne.html b/BKUOnline/src/main/webapp/HTTP-ohne.html
index 044432ce..47c059f2 100644
--- a/BKUOnline/src/main/webapp/HTTP-ohne.html
+++ b/BKUOnline/src/main/webapp/HTTP-ohne.html
@@ -98,7 +98,7 @@ legend {
advanced
-
+
external
internal
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java
index cfac8cf5..cfc5c4bd 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java
@@ -16,6 +16,7 @@
*/
package at.gv.egiz.bku.smccstal;
+import at.gv.egiz.bku.gui.BKUGUIFacade;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -104,9 +105,15 @@ public class InfoBoxReadRequestHandler extends AbstractRequestHandler implements
}
} catch (NotActivatedException e) {
log.info("Citizen card not activated.", e);
+ gui.showErrorDialog(BKUGUIFacade.ERR_CARD_NOTACTIVATED, null, this, null);
+ waitForAction();
+ gui.showWaitDialog(null);
return new ErrorResponse(6001);
} catch (LockedException e) {
log.info("Citizen card locked.", e);
+ gui.showErrorDialog(BKUGUIFacade.ERR_CARD_LOCKED, null, this, null);
+ waitForAction();
+ gui.showWaitDialog(null);
return new ErrorResponse(6001);
} catch (CancelledException cx) {
log.debug("User cancelled request", cx);
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
index 466ec2a9..dbc70bff 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
@@ -94,9 +94,15 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen
return stalResp;
} catch (NotActivatedException e) {
log.info("Citizen card not activated.", e);
+ gui.showErrorDialog(BKUGUIFacade.ERR_CARD_NOTACTIVATED, null, this, null);
+ waitForAction();
+ gui.showWaitDialog(null);
return new ErrorResponse(6001);
} catch (LockedException e) {
log.info("Citizen card locked.", e);
+ gui.showErrorDialog(BKUGUIFacade.ERR_CARD_LOCKED, null, this, null);
+ waitForAction();
+ gui.showWaitDialog(null);
return new ErrorResponse(6001);
} catch (CancelledException cx) {
log.debug("User cancelled request");
--
cgit v1.2.3
From 9829de9c9b19dcca15676aaf9737195cc059a66c Mon Sep 17 00:00:00 2001
From: clemenso
Date: Mon, 3 Nov 2008 09:37:14 +0000
Subject: local HelpListener DesktopAPI
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@138 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../egiz/bku/online/applet/AppletHelpListener.java | 3 +-
.../at/gv/egiz/bku/online/applet/BKUApplet.java | 6 ++--
.../at/gv/egiz/bku/gui/AbstractHelpListener.java | 7 +++--
.../gv/egiz/bku/local/gui/LocalHelpListener.java | 20 +++++++++---
.../at/gv/egiz/bku/local/stal/SMCCSTALFactory.java | 30 +++++++++++++-----
.../egiz/bku/local/webapp/BKURequestHandler.java | 5 +--
.../src/main/webapp/WEB-INF/applicationContext.xml | 36 ++++++++++++----------
7 files changed, 69 insertions(+), 38 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
index a0305eb4..4040431f 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
@@ -20,6 +20,7 @@ package at.gv.egiz.bku.online.applet;
import at.gv.egiz.bku.gui.AbstractHelpListener;
import java.applet.AppletContext;
import java.net.URL;
+import java.util.Locale;
/**
*
@@ -29,7 +30,7 @@ public class AppletHelpListener extends AbstractHelpListener {
protected AppletContext ctx;
- public AppletHelpListener(AppletContext ctx, URL helpURL, String locale) {
+ public AppletHelpListener(AppletContext ctx, URL helpURL, Locale locale) {
super(helpURL, locale);
if (ctx == null) {
throw new RuntimeException("no applet context provided");
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 2b0188bb..50d66d80 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -65,9 +65,11 @@ public class BKUApplet extends JApplet {
log.debug("Called init()");
HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance());
String localeString = getMyAppletParameter(LOCALE_PARAM_KEY);
+ Locale locale = null;
if (localeString != null) {
+ locale = new Locale(localeString);
resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE,
- new Locale(localeString));
+ locale);
} else {
resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE);
}
@@ -85,7 +87,7 @@ public class BKUApplet extends JApplet {
AppletHelpListener helpListener = null;
try {
URL helpURL = getMyAppletParameterURL(HELP_URL);
- helpListener = new AppletHelpListener(getAppletContext(), helpURL, localeString);
+ helpListener = new AppletHelpListener(getAppletContext(), helpURL, locale);
} catch (MalformedURLException ex) {
log.error("invalid help URL: " + ex.getMessage());
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
index 68d61bef..6e3167c1 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
@@ -21,6 +21,7 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.net.MalformedURLException;
import java.net.URL;
+import java.util.Locale;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -32,9 +33,9 @@ public abstract class AbstractHelpListener implements ActionListener {
protected final static Log log = LogFactory.getLog(AbstractHelpListener.class);
protected String helpURLBase;
- protected String locale;
+ protected Locale locale;
- public AbstractHelpListener(URL baseURL, String locale) {
+ public AbstractHelpListener(URL baseURL, Locale locale) {
if (baseURL == null || "".equals(baseURL)) {
throw new RuntimeException("no help URL provided");
}
@@ -49,7 +50,7 @@ public abstract class AbstractHelpListener implements ActionListener {
try {
String urlString = helpURLBase;
if (locale != null) {
- urlString = appendParameter(urlString, "locale", locale);
+ urlString = appendParameter(urlString, "locale", locale.toString());
}
if (e.getActionCommand() != null && !"".equals(e.getActionCommand())) {
urlString = appendParameter(urlString, "topic", e.getActionCommand());
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
index ebec9c65..e32c9c3d 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
@@ -14,7 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
package at.gv.egiz.bku.local.gui;
import at.gv.egiz.bku.gui.AbstractHelpListener;
@@ -22,6 +21,7 @@ import java.awt.Desktop;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
+import java.util.Locale;
/**
*
@@ -29,13 +29,25 @@ import java.net.URL;
*/
public class LocalHelpListener extends AbstractHelpListener {
- public LocalHelpListener(URL baseURL, String locale) {
+ protected Desktop desktop;
+
+ public LocalHelpListener(URL baseURL, Locale locale) {
super(baseURL, locale);
+ if (Desktop.isDesktopSupported()) {
+ desktop = Desktop.getDesktop();
+ }
}
@Override
public void showDocument(URL helpDocument) throws IOException, URISyntaxException {
- Desktop.getDesktop().browse(helpDocument.toURI());
+ if (desktop == null) {
+ log.error("Failed to open default browser: Desktop API not available (libgnome installed?)");
+ } else {
+ if (!desktop.isSupported(Desktop.Action.BROWSE)) {
+ log.error("Failed to open default browser: The system provides the Desktop API, but does not support the BROWSE action");
+ } else {
+ Desktop.getDesktop().browse(helpDocument.toURI());
+ }
+ }
}
-
}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index d3530332..4cc7bcd3 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -32,30 +32,38 @@ import at.gv.egiz.bku.online.applet.BKUApplet;
import at.gv.egiz.stal.STAL;
import at.gv.egiz.stal.STALFactory;
import java.net.URL;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
public class SMCCSTALFactory implements STALFactory {
- private Locale locale;
+ protected static final Log log = LogFactory.getLog(SMCCSTALFactory.class);
+ protected String helpURL;
+ protected Locale locale;
@Override
public STAL createSTAL() {
-
+
SMCCSTAL stal;
JDialog dialog;
ResourceBundle resourceBundle;
if (locale != null) {
resourceBundle = ResourceBundle.getBundle(BKUApplet.RESOURCE_BUNDLE_BASE,
- locale);
+ locale);
} else {
resourceBundle = ResourceBundle.getBundle(BKUApplet.RESOURCE_BUNDLE_BASE);
}
dialog = new JDialog();
BKUGUIFacade gui = BKUGUIFactory.createGUI(BKUGUIFactory.ADVANCED_GUI);
- LocalHelpListener helpListener =null;
+ LocalHelpListener helpListener = null;
try {
- helpListener = new LocalHelpListener(new URL("http://localhost:3495/help"), "en");
+ if (helpURL != null) {
+ helpListener = new LocalHelpListener(new URL(helpURL), locale);
+ } else {
+ log.warn("no HELP URL configured, help system disabled");
+ }
} catch (MalformedURLException ex) {
- ex.printStackTrace();
+ log.error("failed to configure help listener: " + ex.getMessage(), ex);
}
gui.init(dialog.getContentPane(), locale.toString(), null, helpListener);
stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog, resourceBundle);
@@ -72,7 +80,7 @@ public class SMCCSTALFactory implements STALFactory {
frameSize.width = screenSize.width;
}
dialog.setLocation((screenSize.width - frameSize.width) / 2,
- (screenSize.height - frameSize.height) / 2);
+ (screenSize.height - frameSize.height) / 2);
return stal;
}
@@ -80,4 +88,12 @@ public class SMCCSTALFactory implements STALFactory {
public void setLocale(Locale locale) {
this.locale = locale;
}
+
+ public String getHelpURL() {
+ return helpURL;
+ }
+
+ public void setHelpURL(String helpURL) {
+ this.helpURL = helpURL;
+ }
}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java
index f19b86b5..62705d1e 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/BKURequestHandler.java
@@ -16,7 +16,6 @@
*/
package at.gv.egiz.bku.local.webapp;
-import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Iterator;
@@ -30,12 +29,10 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.springframework.web.HttpRequestHandler;
import at.gv.egiz.bku.binding.BindingProcessorManager;
import at.gv.egiz.bku.binding.HTTPBindingProcessor;
import at.gv.egiz.bku.binding.HttpUtil;
-import at.gv.egiz.bku.utils.StreamUtil;
import at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage;
public abstract class BKURequestHandler extends HttpServlet {
@@ -68,7 +65,7 @@ public abstract class BKURequestHandler extends HttpServlet {
bindingProcessor.setHTTPHeaders(headerMap);
bindingProcessor.consumeRequestStream(req.getInputStream());
- // fixxme just for testing
+ // fixxme just for testing
bindingProcessor.run();
if (bindingProcessor.getRedirectURL() != null) {
resp.sendRedirect(bindingProcessor.getRedirectURL());
diff --git a/BKULocal/src/main/webapp/WEB-INF/applicationContext.xml b/BKULocal/src/main/webapp/WEB-INF/applicationContext.xml
index a951f056..3191f82f 100644
--- a/BKULocal/src/main/webapp/WEB-INF/applicationContext.xml
+++ b/BKULocal/src/main/webapp/WEB-INF/applicationContext.xml
@@ -1,25 +1,27 @@
-
+
+ scope="singleton">
+
+
Date: Mon, 3 Nov 2008 12:36:42 +0000
Subject: localization
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@140 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../at/gv/egiz/bku/online/applet/BKUApplet.java | 20 ++---
.../at/gv/egiz/bku/online/applet/BKUWorker.java | 17 ++--
.../at/gv/egiz/bku/online/applet/images/logo.png | Bin 4035 -> 0 bytes
.../src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 11 ++-
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 9 ++-
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 11 ++-
.../at/gv/egiz/bku/gui/Messages.properties | 86 ++++++++++-----------
.../at/gv/egiz/bku/gui/Messages_de.properties | 62 +++++++++++++++
.../at/gv/egiz/bku/local/stal/BKUGuiProxy.java | 10 ++-
.../java/at/gv/egiz/bku/local/stal/SMCCSTAL.java | 6 +-
.../at/gv/egiz/bku/local/stal/SMCCSTALFactory.java | 16 ++--
11 files changed, 156 insertions(+), 92 deletions(-)
delete mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png
create mode 100644 BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 50d66d80..bde055ec 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -40,7 +40,6 @@ public class BKUApplet extends JApplet {
private static Log log = LogFactory.getLog(BKUApplet.class);
public static final String GUI_STYLE = "GuiStyle";
- public final static String RESOURCE_BUNDLE_BASE = "at/gv/egiz/bku/online/applet/Messages";
public final static String LOCALE_PARAM_KEY = "Locale";
public final static String LOGO_URL_KEY = "LogoURL";
public final static String WSDL_URL = "WSDL_URL";
@@ -52,7 +51,6 @@ public class BKUApplet extends JApplet {
public static final String REDIRECT_URL = "RedirectURL";
public static final String REDIRECT_TARGET = "RedirectTarget";
public static final String HASHDATA_DISPLAY_INTERNAL = "internal";
- protected ResourceBundle resourceBundle;
protected BKUWorker worker;
protected Thread workerThread;
@@ -64,14 +62,9 @@ public class BKUApplet extends JApplet {
log.info("Welcome to MOCCA\n");
log.debug("Called init()");
HttpsURLConnection.setDefaultSSLSocketFactory(InternalSSLSocketFactory.getInstance());
- String localeString = getMyAppletParameter(LOCALE_PARAM_KEY);
- Locale locale = null;
- if (localeString != null) {
- locale = new Locale(localeString);
- resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE,
- locale);
- } else {
- resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE);
+ String locale = getMyAppletParameter(LOCALE_PARAM_KEY);
+ if (locale != null) {
+ this.setLocale(new Locale(locale));
}
String backgroundString = getMyAppletParameter(BACKGROUND_PARAM);
URL background = null;
@@ -84,15 +77,16 @@ public class BKUApplet extends JApplet {
}
String guiStyle = getMyAppletParameter(GUI_STYLE);
BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle);
+ log.debug("setting GUI locale to " + getLocale());
AppletHelpListener helpListener = null;
try {
URL helpURL = getMyAppletParameterURL(HELP_URL);
- helpListener = new AppletHelpListener(getAppletContext(), helpURL, locale);
+ helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale());
} catch (MalformedURLException ex) {
log.error("invalid help URL: " + ex.getMessage());
}
- gui.init(getContentPane(), localeString, background, helpListener);
- worker = new BKUWorker(gui, this, resourceBundle);
+ gui.init(getContentPane(), getLocale(), background, helpListener);
+ worker = new BKUWorker(gui, this);
}
@Override
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
index 78f3dc12..843f6c4c 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUWorker.java
@@ -48,7 +48,6 @@ import at.gv.egiz.stal.service.types.ObjectFactory;
import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
import at.gv.egiz.stal.util.STALTranslator;
-import javax.naming.ConfigurationException;
public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
ActionListener, SMCCSTALRequestHandler {
@@ -57,25 +56,22 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
protected BKUGUIFacade gui;
protected BKUApplet parent;
private STALPortType stalPort;
-// private URL hashDataURL;
protected List actionCommandList = new ArrayList();
protected Boolean actionPerformed = false;
protected boolean finished = false;
- protected ResourceBundle errorMessages;
/**
*
* @param gui
* must not be null
*/
- public BKUWorker(BKUGUIFacade gui, BKUApplet parent,
- ResourceBundle errorMessageBundle) {
- if ((gui == null) || (parent == null) || (errorMessageBundle == null)) {
+ public BKUWorker(BKUGUIFacade gui, BKUApplet parent) {
+ if (gui == null || parent == null) {
throw new NullPointerException("Parameter must not be set to null");
}
this.gui = gui;
+ this.locale = gui.getLocale();
this.parent = parent;
- this.errorMessages = errorMessageBundle;
addRequestHandler(QuitRequest.class, this);
// register SignRequestHandler once we have a webservice port
}
@@ -86,9 +82,9 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
* @param gui
* @param errorMessageBundle
*/
- protected BKUWorker(BKUGUIFacade gui, ResourceBundle errorMessageBundle) {
+ protected BKUWorker(BKUGUIFacade gui) {
this.gui = gui;
- this.errorMessages = errorMessageBundle;
+ this.locale = gui.getLocale();
addRequestHandler(QuitRequest.class, this);
}
@@ -342,8 +338,7 @@ public class BKUWorker extends AbstractSMCCSTAL implements Runnable,
}
break;
case SMCCHelper.CARD_FOUND:
- // gui.showWaitDialog(null);
- signatureCard = smccHelper.getSignatureCard(errorMessages.getLocale());
+ signatureCard = smccHelper.getSignatureCard(locale);
return false;
}
smccHelper.update(3000);
diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png
deleted file mode 100644
index eee4be4f..00000000
Binary files a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/images/logo.png and /dev/null differ
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 27841d1c..9f733a14 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -92,10 +92,10 @@ public class BKUGUI implements BKUGUIFacade {
* @param localeString may be null
*/
@Override
- public void init(final Container contentPane, String localeString, final URL background, ActionListener helpListener) {
+ public void init(final Container contentPane, Locale locale, final URL background, ActionListener helpListener) {
- if (localeString != null) {
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, new Locale(localeString));
+ if (locale != null) {
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, locale);
} else {
messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
}
@@ -248,6 +248,11 @@ public class BKUGUI implements BKUGUIFacade {
.addContainerGap());
}
+ @Override
+ public Locale getLocale() {
+ return messages.getLocale();
+ }
+
@Override
public void showLoginDialog(ActionListener loginListener, String actionCommand) {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 4ef1b7d9..6655cf64 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -24,6 +24,7 @@ import java.awt.Container;
import java.awt.event.ActionListener;
import java.net.URL;
import java.util.List;
+import java.util.Locale;
public interface BKUGUIFacade {
@@ -85,7 +86,13 @@ public interface BKUGUIFacade {
public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
- public void init(Container contentPane, String localeString, URL background, ActionListener helpListener);
+ public void init(Container contentPane, Locale locale, URL background, ActionListener helpListener);
+
+ /**
+ *
+ * @return the locale of the message bundle (what if no message bundle could be loaded for the requested locale?)
+ */
+ public Locale getLocale();
public void showWelcomeDialog();
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index 195db27a..a005292e 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -90,10 +90,10 @@ public class SimpleGUI implements BKUGUIFacade {
* @param localeString may be null
*/
@Override
- public void init(final Container contentPane, String localeString, final URL background, ActionListener helpListener) {
+ public void init(final Container contentPane, Locale locale, final URL background, ActionListener helpListener) {
- if (localeString != null) {
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, new Locale(localeString));
+ if (locale != null) {
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, locale);
} else {
messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
}
@@ -243,6 +243,11 @@ public class SimpleGUI implements BKUGUIFacade {
.addContainerGap());
}
+ @Override
+ public Locale getLocale() {
+ return messages.getLocale();
+ }
+
@Override
public void showLoginDialog(ActionListener loginListener, String actionCommand) {
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 1f51de77..2e6b7b14 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -13,51 +13,49 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-title.welcome=Willkommen
-title.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
-title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
-title.cardpin={0} eingeben
-title.sign=Signatur erstellen
-title.error=Ein Fehler trat auf
-title.retry=Falscher PIN
-title.wait=Bitte warten
-title.hashdata=Signaturdaten
-windowtitle.save=Signaturdaten speichern
-windowtitle.savedir=Signaturdaten in Verzeichnis speichern
-windowtitle.overwrite=Datei \u00FCberschreiben?
-message.wait=Bitte warten...
-message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
-message.enterpin={0} eingeben
-message.hashdatalink=Signaturdaten anzeigen
-message.hashdata=Signaturdaten:
-#message.hashdata=Referenz Id: {0}
-message.hashdatalist={0} Signaturdaten:
-message.retries=Noch {0} Versuch(e)
-message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
+title.welcome=Welcome
+title.insertcard=Please insert your citizen-card into the reader
+title.cardnotsupported=This card is not supported
+title.cardpin=Enter {0}
+title.sign=Create signature
+title.error=Error
+title.retry=Wrong PIN
+title.wait=Please wait
+title.hashdata=Signature data
+windowtitle.save=Save signature data
+windowtitle.savedir=Save signature data to directory
+windowtitle.overwrite=Overwrite file?
+message.wait=Please wait...
+message.insertcard=Please insert your citizen-card into the reader
+message.enterpin=Enter {0}
+message.hashdatalink=Display signature data
+message.hashdata=Signature data:
+message.hashdatalist={0} signature data objects:
+message.retries={0} tries left
+message.overwrite=Overwrite {0}?
label.pin={0}:
-label.pinsize=({0} stellig)
+label.pinsize=({0} digits)
button.ok=OK
-button.cancel=Abbrechen
-button.back=Zur\u00FCck
-button.sign=Signieren
-button.save=Speichern...
-mimetype.desc.xml=XML-Dateien (.xml)
-mimetype.desc.html=HTML-Dateien (.html, .htm)
-mimetype.desc.xhtml=XHTML-Dateien (.xhtml)
-mimetype.desc.txt=Textdateien (.txt)
-mimetype.desc.pdf=Adobe PDF-Dateien (.pdf)
-mimetype.desc.bin=Bin\u00E4rdateien (.bin)
-save.hashdatainput.prefix=Signaturdaten
+button.cancel=Cancel
+button.back=Back
+button.sign=Sign
+button.save=Save...
+mimetype.desc.xml=XML-files (.xml)
+mimetype.desc.html=HTML-files (.html, .htm)
+mimetype.desc.xhtml=XHTML-files (.xhtml)
+mimetype.desc.txt=Textfiles (.txt)
+mimetype.desc.pdf=Adobe PDF-files (.pdf)
+mimetype.desc.bin=Binary files (.bin)
+save.hashdatainput.prefix=signaturedata
# Error Messages
-error.no.hashdata=Keine Signaturdaten verf\u00FCgbar: {0}
-error.display.hashdata=Signaturdaten konnten nicht dargestellt werden: {0}
-error.write.hashdata=Die Signaturdaten konnten nicht gespeichert werden: {0}
-error.invalid.hash=Die Signaturdaten sind ung\u00FCltig: {0}
-error.ws.unreachable=Das Web-Service ist nicht erreichbar: {0}
-error.pcsc=Java(TM) scheint keine PC/SC Schnittstelle f\u00FCr den Smartcard-Zugriff zur Verf\u00FCgung zu stellen.
-error.cardterminal=Es konnte kein Smartcard-Leser gefunden werden.
Entweder ist kein Leser angeschlossen oder kein PC/SC Treiber installiert.
-error.unknown=Leider trat ein Fehler auf: {0}
-error.test=Fehler1 {0} - Fehler2 {1}
-error.card.locked=B\u00FCrgerkarte ist gesperrt
-error.card.notactivated=B\u00FCrgerkartenfunktion ist nicht aktiviert
\ No newline at end of file
+error.no.hashdata=No signature data available: {0}
+error.display.hashdata=Could not display signature data: {0}
+error.write.hashdata=Could not save signature data: {0}
+error.invalid.hash=Invalid signature data: {0}
+error.ws.unreachable=Web-service unreachable: {0}
+error.pcsc=No PC/SC interface for smartcard access provided
+error.cardterminal=Could not find smartcard reader
+error.unknown=An error occured: {0}
+error.card.locked=Citizen-card is locked
+error.card.notactivated=Citizen-card not activated
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties
new file mode 100644
index 00000000..af0cb016
--- /dev/null
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties
@@ -0,0 +1,62 @@
+# Copyright 2008 Federal Chancellery Austria and
+# Graz University of Technology
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+title.welcome=Willkommen
+title.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
+title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
+title.cardpin={0} eingeben
+title.sign=Signatur erstellen
+title.error=Fehler
+title.retry=Falscher PIN
+title.wait=Bitte warten
+title.hashdata=Signaturdaten
+windowtitle.save=Signaturdaten speichern
+windowtitle.savedir=Signaturdaten in Verzeichnis speichern
+windowtitle.overwrite=Datei \u00FCberschreiben?
+message.wait=Bitte warten...
+message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
+message.enterpin={0} eingeben
+message.hashdatalink=Signaturdaten anzeigen
+message.hashdata=Signaturdaten:
+message.hashdatalist={0} Signaturdaten:
+message.retries=Noch {0} Versuch(e)
+message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
+label.pin={0}:
+label.pinsize=({0} stellig)
+button.ok=OK
+button.cancel=Abbrechen
+button.back=Zur\u00FCck
+button.sign=Signieren
+button.save=Speichern...
+mimetype.desc.xml=XML-Dateien (.xml)
+mimetype.desc.html=HTML-Dateien (.html, .htm)
+mimetype.desc.xhtml=XHTML-Dateien (.xhtml)
+mimetype.desc.txt=Textdateien (.txt)
+mimetype.desc.pdf=Adobe PDF-Dateien (.pdf)
+mimetype.desc.bin=Bin\u00E4rdateien (.bin)
+save.hashdatainput.prefix=Signaturdaten
+
+# Error Messages
+error.no.hashdata=Keine Signaturdaten verf\u00FCgbar: {0}
+error.display.hashdata=Signaturdaten konnten nicht dargestellt werden: {0}
+error.write.hashdata=Die Signaturdaten konnten nicht gespeichert werden: {0}
+error.invalid.hash=Die Signaturdaten sind ung\u00FCltig: {0}
+error.ws.unreachable=Das Web-Service ist nicht erreichbar: {0}
+error.pcsc=Java(TM) scheint keine PC/SC Schnittstelle f\u00FCr den Smartcard-Zugriff zur Verf\u00FCgung zu stellen.
+error.cardterminal=Es konnte kein Smartcard-Leser gefunden werden.
Entweder ist kein Leser angeschlossen oder kein PC/SC Treiber installiert.
+error.unknown=Leider trat ein Fehler auf: {0}
+error.test=Fehler1 {0} - Fehler2 {1}
+error.card.locked=B\u00FCrgerkarte ist gesperrt
+error.card.notactivated=B\u00FCrgerkartenfunktion ist nicht aktiviert
\ No newline at end of file
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
index 8a850549..44cae8a0 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
@@ -10,6 +10,7 @@ import java.awt.event.WindowEvent;
import java.net.URL;
import java.util.List;
+import java.util.Locale;
import javax.swing.JDialog;
import at.gv.egiz.bku.gui.BKUGUIFacade;
@@ -37,8 +38,13 @@ public class BKUGuiProxy implements BKUGUIFacade {
}
@Override
- public void init(Container contentPane, String localeString, URL bgImage, ActionListener helpListener) {
- delegate.init(contentPane, localeString, bgImage, helpListener);
+ public void init(Container contentPane, Locale locale, URL bgImage, ActionListener helpListener) {
+ delegate.init(contentPane, locale, bgImage, helpListener);
+ }
+
+ @Override
+ public Locale getLocale() {
+ return delegate.getLocale();
}
@Override
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTAL.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTAL.java
index 1bbb2e3c..6bf37c40 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTAL.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTAL.java
@@ -1,7 +1,6 @@
package at.gv.egiz.bku.local.stal;
import java.util.List;
-import java.util.ResourceBundle;
import javax.swing.JDialog;
@@ -16,9 +15,8 @@ public class SMCCSTAL extends BKUWorker {
private JDialog container;
- public SMCCSTAL(BKUGUIFacade gui, JDialog container,
- ResourceBundle errorMessageBundle) {
- super(gui, errorMessageBundle);
+ public SMCCSTAL(BKUGUIFacade gui, JDialog container) {
+ super(gui);
this.container = container;
addRequestHandler(SignRequest.class, new LocalSignRequestHandler());
}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index 4cc7bcd3..ad7b9646 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -28,7 +28,6 @@ import javax.swing.WindowConstants;
import at.gv.egiz.bku.gui.BKUGUIFacade;
import at.gv.egiz.bku.gui.BKUGUIFactory;
import at.gv.egiz.bku.local.gui.LocalHelpListener;
-import at.gv.egiz.bku.online.applet.BKUApplet;
import at.gv.egiz.stal.STAL;
import at.gv.egiz.stal.STALFactory;
import java.net.URL;
@@ -45,28 +44,23 @@ public class SMCCSTALFactory implements STALFactory {
public STAL createSTAL() {
SMCCSTAL stal;
- JDialog dialog;
- ResourceBundle resourceBundle;
+ JDialog dialog = new JDialog();
if (locale != null) {
- resourceBundle = ResourceBundle.getBundle(BKUApplet.RESOURCE_BUNDLE_BASE,
- locale);
- } else {
- resourceBundle = ResourceBundle.getBundle(BKUApplet.RESOURCE_BUNDLE_BASE);
+ dialog.setLocale(locale);
}
- dialog = new JDialog();
BKUGUIFacade gui = BKUGUIFactory.createGUI(BKUGUIFactory.ADVANCED_GUI);
LocalHelpListener helpListener = null;
try {
if (helpURL != null) {
- helpListener = new LocalHelpListener(new URL(helpURL), locale);
+ helpListener = new LocalHelpListener(new URL(helpURL), dialog.getLocale());
} else {
log.warn("no HELP URL configured, help system disabled");
}
} catch (MalformedURLException ex) {
log.error("failed to configure help listener: " + ex.getMessage(), ex);
}
- gui.init(dialog.getContentPane(), locale.toString(), null, helpListener);
- stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog, resourceBundle);
+ gui.init(dialog.getContentPane(), dialog.getLocale(), null, helpListener);
+ stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog);
dialog.setPreferredSize(new Dimension(400, 200));
dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
dialog.setTitle("MOCCA");
--
cgit v1.2.3
From 4d27cbd65e358f9ae778b6911e8de527e86f6bda Mon Sep 17 00:00:00 2001
From: mcentner
Date: Mon, 3 Nov 2008 14:31:47 +0000
Subject: Localization default language set to German (de).
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@141 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../gv/egiz/bku/online/applet/Messages.properties | 58 -------------
.../egiz/bku/online/applet/Messages_de.properties | 42 ---------
.../at/gv/egiz/bku/gui/Messages.properties | 85 ++++++++++---------
.../at/gv/egiz/bku/gui/Messages_de.properties | 62 --------------
.../at/gv/egiz/bku/gui/Messages_en.properties | 62 ++++++++++++++
.../slexceptions/SLExceptionMessages_de.properties | 99 ----------------------
.../main/java/at/gv/egiz/smcc/util/SMCCHelper.java | 4 +-
.../resources/at/gv/egiz/smcc/ACOSCard.properties | 2 +-
.../at/gv/egiz/smcc/ACOSCard_de.properties | 21 -----
.../at/gv/egiz/smcc/ACOSCard_en.properties | 21 -----
.../at/gv/egiz/smcc/STARCOSCard.properties | 4 +-
.../at/gv/egiz/smcc/STARCOSCard_de.properties | 20 -----
.../at/gv/egiz/smcc/STARCOSCard_en.properties | 20 -----
13 files changed, 110 insertions(+), 390 deletions(-)
delete mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties
delete mode 100644 BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties
delete mode 100644 BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties
create mode 100644 BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
delete mode 100644 bkucommon/src/main/resources/at/gv/egiz/bku/slexceptions/SLExceptionMessages_de.properties
delete mode 100644 smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_de.properties
delete mode 100644 smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_en.properties
delete mode 100644 smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_de.properties
delete mode 100644 smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_en.properties
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties
deleted file mode 100644
index 752004e8..00000000
--- a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages.properties
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# -------- BEGIN bootstrap applet -----------#
-java16required=This Applet requires Java 1.6 or higher to run. \
- Please download and install a recent version of Java. \
-
-# -------- END bootstrap applet -----------#
-
-
-applet.name=Online Citicen Card Environment (CCE)
-
-nopcscsupport=The Java plattform does not seem to provide \
-a PC/SC interface to acces a smartcard.
-
-nocardterminal=Can not find a connected smartcard reader.\
-
Either there is no smartcard reader connected, or \
- no PC/SC driver is installed for a connected smartcard reader.
-
-insertcard=Please insert your citicen card (B\u00FCrgerkarte) into your \
- smartcard reader.
-
-unsupportedcard=The inserted smartcard is not supported.\
-
Please insert your citicen card (B\u00FCrgerkarte) \
- into your smartcard reader.
-
-enterpin=Please enter {0} \(min {1}, max {2} digits\).
-
-enterpinretries=Please enter {0} \(min {1}, max {2} digits, {3} retries left\).
-
-pinwrong=Entered PIN is wrong.
-
-button.ok=Ok
-
-button.cancel=Cancel
-
-status.findpcsc=Looking for PC/SC support
-
-status.findsupportedcard=Looking for a supported smartcard
-
-failed.WS=Webservice cannot be reached.
\ No newline at end of file
diff --git a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties b/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties
deleted file mode 100644
index e6b815e9..00000000
--- a/BKUApplet/src/main/resources/at/gv/egiz/bku/online/applet/Messages_de.properties
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# -------- BEGIN bootstrap applet -----------#
-java16required=Dieses Applet ben\u00F6tigt Java Version 1.6 oder h\u00F6her. \
- Bitte installieren sie eine aktulle Version von Java. \
-
-
-failedtostart=Das Applet konnte nicht gestartet werden. \
-
{0}
-# -------- END bootstrap applet -----------#
-
-applet.name=Online B\u00FCrgerkartenumgebung (BKU)
-
-nopcscsupport=Die Java-Installation stellt keine \
- PC/SC-Schnittstelle zum Zugriff auf eine Chipkarte zur Verf\u00FCgung.
-
-nocardterminal=Es konnte kein Chipkartenleser gefunden werden.\
-
Entweder, es ist kein Chipkartenleser angeschlossen, oder \
- f\u00FCr den angeschlossenen Chipkartenleser ist kein PC/SC-Treiber \
- installiert.
-
-insertcard=Bitte stecken Sie ihre B\u00FCrgerkarte in den Chipkartenleser.
-
-unsupportedcard=Die gesteckte Chipkarte wird nicht unterst\u00FCtzt.\
-
Bitte stecken Sie ihre B\u00FCrgerkare in den Chipkartenleser
-
-failed.WS=Das Webservice kann nicht erreicht werden.
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 2e6b7b14..aeabc5c1 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -13,49 +13,50 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-title.welcome=Welcome
-title.insertcard=Please insert your citizen-card into the reader
-title.cardnotsupported=This card is not supported
-title.cardpin=Enter {0}
-title.sign=Create signature
-title.error=Error
-title.retry=Wrong PIN
-title.wait=Please wait
-title.hashdata=Signature data
-windowtitle.save=Save signature data
-windowtitle.savedir=Save signature data to directory
-windowtitle.overwrite=Overwrite file?
-message.wait=Please wait...
-message.insertcard=Please insert your citizen-card into the reader
-message.enterpin=Enter {0}
-message.hashdatalink=Display signature data
-message.hashdata=Signature data:
-message.hashdatalist={0} signature data objects:
-message.retries={0} tries left
-message.overwrite=Overwrite {0}?
+title.welcome=Willkommen
+title.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
+title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
+title.cardpin={0} eingeben
+title.sign=Signatur erstellen
+title.error=Fehler
+title.retry=Falscher PIN
+title.wait=Bitte warten
+title.hashdata=Signaturdaten
+windowtitle.save=Signaturdaten speichern
+windowtitle.savedir=Signaturdaten in Verzeichnis speichern
+windowtitle.overwrite=Datei \u00FCberschreiben?
+message.wait=Bitte warten...
+message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
+message.enterpin={0} eingeben
+message.hashdatalink=Signaturdaten anzeigen
+message.hashdata=Signaturdaten:
+message.hashdatalist={0} Signaturdaten:
+message.retries=Noch {0} Versuch(e)
+message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
label.pin={0}:
-label.pinsize=({0} digits)
+label.pinsize=({0} stellig)
button.ok=OK
-button.cancel=Cancel
-button.back=Back
-button.sign=Sign
-button.save=Save...
-mimetype.desc.xml=XML-files (.xml)
-mimetype.desc.html=HTML-files (.html, .htm)
-mimetype.desc.xhtml=XHTML-files (.xhtml)
-mimetype.desc.txt=Textfiles (.txt)
-mimetype.desc.pdf=Adobe PDF-files (.pdf)
-mimetype.desc.bin=Binary files (.bin)
-save.hashdatainput.prefix=signaturedata
+button.cancel=Abbrechen
+button.back=Zur\u00FCck
+button.sign=Signieren
+button.save=Speichern...
+mimetype.desc.xml=XML-Dateien (.xml)
+mimetype.desc.html=HTML-Dateien (.html, .htm)
+mimetype.desc.xhtml=XHTML-Dateien (.xhtml)
+mimetype.desc.txt=Textdateien (.txt)
+mimetype.desc.pdf=Adobe PDF-Dateien (.pdf)
+mimetype.desc.bin=Bin\u00E4rdateien (.bin)
+save.hashdatainput.prefix=Signaturdaten
# Error Messages
-error.no.hashdata=No signature data available: {0}
-error.display.hashdata=Could not display signature data: {0}
-error.write.hashdata=Could not save signature data: {0}
-error.invalid.hash=Invalid signature data: {0}
-error.ws.unreachable=Web-service unreachable: {0}
-error.pcsc=No PC/SC interface for smartcard access provided
-error.cardterminal=Could not find smartcard reader
-error.unknown=An error occured: {0}
-error.card.locked=Citizen-card is locked
-error.card.notactivated=Citizen-card not activated
\ No newline at end of file
+error.no.hashdata=Keine Signaturdaten verf\u00FCgbar: {0}
+error.display.hashdata=Signaturdaten konnten nicht dargestellt werden: {0}
+error.write.hashdata=Die Signaturdaten konnten nicht gespeichert werden: {0}
+error.invalid.hash=Die Signaturdaten sind ung\u00FCltig: {0}
+error.ws.unreachable=Das Web-Service ist nicht erreichbar: {0}
+error.pcsc=Es konnte keine PC/SC Schnittstelle gefunden werden
+error.cardterminal=Es konnte kein Smartcard-Leser gefunden werden
+error.unknown=Leider trat ein Fehler auf: {0}
+error.test=Fehler1 {0} - Fehler2 {1}
+error.card.locked=B\u00FCrgerkarte ist gesperrt
+error.card.notactivated=B\u00FCrgerkartenfunktion ist nicht aktiviert
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties
deleted file mode 100644
index af0cb016..00000000
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_de.properties
+++ /dev/null
@@ -1,62 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-title.welcome=Willkommen
-title.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
-title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
-title.cardpin={0} eingeben
-title.sign=Signatur erstellen
-title.error=Fehler
-title.retry=Falscher PIN
-title.wait=Bitte warten
-title.hashdata=Signaturdaten
-windowtitle.save=Signaturdaten speichern
-windowtitle.savedir=Signaturdaten in Verzeichnis speichern
-windowtitle.overwrite=Datei \u00FCberschreiben?
-message.wait=Bitte warten...
-message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
-message.enterpin={0} eingeben
-message.hashdatalink=Signaturdaten anzeigen
-message.hashdata=Signaturdaten:
-message.hashdatalist={0} Signaturdaten:
-message.retries=Noch {0} Versuch(e)
-message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
-label.pin={0}:
-label.pinsize=({0} stellig)
-button.ok=OK
-button.cancel=Abbrechen
-button.back=Zur\u00FCck
-button.sign=Signieren
-button.save=Speichern...
-mimetype.desc.xml=XML-Dateien (.xml)
-mimetype.desc.html=HTML-Dateien (.html, .htm)
-mimetype.desc.xhtml=XHTML-Dateien (.xhtml)
-mimetype.desc.txt=Textdateien (.txt)
-mimetype.desc.pdf=Adobe PDF-Dateien (.pdf)
-mimetype.desc.bin=Bin\u00E4rdateien (.bin)
-save.hashdatainput.prefix=Signaturdaten
-
-# Error Messages
-error.no.hashdata=Keine Signaturdaten verf\u00FCgbar: {0}
-error.display.hashdata=Signaturdaten konnten nicht dargestellt werden: {0}
-error.write.hashdata=Die Signaturdaten konnten nicht gespeichert werden: {0}
-error.invalid.hash=Die Signaturdaten sind ung\u00FCltig: {0}
-error.ws.unreachable=Das Web-Service ist nicht erreichbar: {0}
-error.pcsc=Java(TM) scheint keine PC/SC Schnittstelle f\u00FCr den Smartcard-Zugriff zur Verf\u00FCgung zu stellen.
-error.cardterminal=Es konnte kein Smartcard-Leser gefunden werden.
Entweder ist kein Leser angeschlossen oder kein PC/SC Treiber installiert.
-error.unknown=Leider trat ein Fehler auf: {0}
-error.test=Fehler1 {0} - Fehler2 {1}
-error.card.locked=B\u00FCrgerkarte ist gesperrt
-error.card.notactivated=B\u00FCrgerkartenfunktion ist nicht aktiviert
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
new file mode 100644
index 00000000..3b8ac1bc
--- /dev/null
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -0,0 +1,62 @@
+# Copyright 2008 Federal Chancellery Austria and
+# Graz University of Technology
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+title.welcome=Welcome
+title.insertcard=Please insert your citizen-card into the reader
+title.cardnotsupported=This card is not supported
+title.cardpin=Enter {0}
+title.sign=Create signature
+title.error=Error
+title.retry=Wrong PIN
+title.wait=Please wait
+title.hashdata=Signature data
+windowtitle.save=Save signature data
+windowtitle.savedir=Save signature data to directory
+windowtitle.overwrite=Overwrite file?
+message.wait=Please wait...
+message.insertcard=Please insert your citizen-card into the reader
+message.enterpin=Enter {0}
+message.hashdatalink=Display signature data
+message.hashdata=Signature data:
+message.hashdatalist={0} signature data objects:
+message.retries={0} tries left
+message.overwrite=Overwrite {0}?
+label.pin={0}:
+label.pinsize=({0} digits)
+button.ok=OK
+button.cancel=Cancel
+button.back=Back
+button.sign=Sign
+button.save=Save...
+mimetype.desc.xml=XML-files (.xml)
+mimetype.desc.html=HTML-files (.html, .htm)
+mimetype.desc.xhtml=XHTML-files (.xhtml)
+mimetype.desc.txt=Textfiles (.txt)
+mimetype.desc.pdf=Adobe PDF-files (.pdf)
+mimetype.desc.bin=Binary files (.bin)
+save.hashdatainput.prefix=signaturedata
+
+# Error Messages
+error.no.hashdata=No signature data available: {0}
+error.display.hashdata=Could not display signature data: {0}
+error.write.hashdata=Could not save signature data: {0}
+error.invalid.hash=Invalid signature data: {0}
+error.ws.unreachable=Web-service unreachable: {0}
+error.pcsc=No PC/SC interface for smartcard access provided
+error.cardterminal=Could not find smartcard reader
+error.unknown=An error occured: {0}
+error.test=Error1 {0} - Error2 {1}
+error.card.locked=Citizen-card is locked
+error.card.notactivated=Citizen-card not activated
\ No newline at end of file
diff --git a/bkucommon/src/main/resources/at/gv/egiz/bku/slexceptions/SLExceptionMessages_de.properties b/bkucommon/src/main/resources/at/gv/egiz/bku/slexceptions/SLExceptionMessages_de.properties
deleted file mode 100644
index 73409c8b..00000000
--- a/bkucommon/src/main/resources/at/gv/egiz/bku/slexceptions/SLExceptionMessages_de.properties
+++ /dev/null
@@ -1,99 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-test.noerror=Das ist eine Test-Fehlermeldung. Es ist kein Fehler aufgetreten.
-
-ec1000=Unklassifizierter Fehler.
-ec2000=Unklassifizierter Fehler in der Transportbindung.
-ec2001=HTTP/HTTPS-Bindung: DataURL kann nicht aufgelst werden.
-ec2002=HTTP/HTTPS-Bindung: StylesheetURL kann nicht aufgelst werden.
-ec2003=HTTP/HTTPS-Bindung: RedirectURL kann nicht aufgelst werden.
-ec2004=HTTP/HTTPS-Bindung: Parameter XMLRequest fehlt.
-ec2005=HTTP/HTTPS-Bindung: Unbekannte Kodierung der Parameter.
-ec2006=HTTP/HTTPS-Bindung: Fehlerhafte Kodierung der Parameter.
-ec2007=HTTP/HTTPS-Bindung: DataURL-Server sendet Fehler oder unerwartete Antwort.
-ec2008=HTTP/HTTPS-Bindung: Fehler im Stylesheet, der von der StylesheetURL bezogen wurde.
-ec2009=HTTP/HTTPS-Bindung: HTTP-Anfrage an lokale BKU wurde an unerlaubte URL gerichtet.
-ec2010=HTTPS-Bindung: Fehler beim Aufbau der TLS-Verbindung.
-ec3000=Unklassifizierter Fehler in der XML-Struktur der Befehlsanfrage.
-ec3001=XML-Struktur der Befehlsanfrage ist nicht wohlgeformt.
-ec3002=XML-Struktur der Befehlsanfrage entspricht nicht dem Schema des Security-Layers.
-ec3003=XML-Struktur der Befehlsanfrage enthlt eine unerlaubte Kombination aus optionalen Elementen oder Attributen.
-ec3004=XML-Struktur enthlt ein Element oder Attribut, dessen Syntax nicht der Spezifikation des Security-Layer entspricht.
-ec3005=Protokollversion des Security-Layer wird nicht untersttzt.
-ec4000=Unklassifizierter Fehler in der Befehlsabarbeitung.
-ec4001=Unbekannter Keyboxbezeichner.
-ec4002=Unbekannter Infoboxbezeichner.
-ec4003=Zu signierendes Datum kann nicht aufgelst werden.
-ec4004=Ergnzungsobjekt kann nicht aufgelst werden.
-ec4005=Zu verschlsselndes Datum kann nicht aufgelst werden.
-ec4006=Algorithmus (Signatur, Verschlsselung, Digest, Kanonisierung, Transformation) wird nicht untersttzt.
-ec4007=Fehler bei der Algorithmusausfhrung (Signatur, Verschlsselung, Digest, Kanonisierung, Transformation).
-ec4008=Fehler beim Parsen der CMS-Nachricht.
-ec4009=Kein passender Entschlsselungsschlssel vorhanden.
-ec4010=Parameter des Infobox-Befehls passen nicht zum Typ der Infobox.
-ec4011=Befehl ist nicht implementiert.
-ec4100=XML-Dokument, in das die Signatur integriert werden soll, kann nicht aufgelst werden.
-ec4101=XML-Dokument, in das die Signatur integriert werden soll, kann nicht geparst werden.
-ec4102=Signatur kann nicht am spezifizierten Ort in das bestehende XML-Dokument integriert werden.
-ec4103=Signatorzertifikat ist nicht in der CMS-Signatur enthalten.
-ec4104=Signierte Daten sind weder in der CMS-Signatur noch im XML-Request enthalten.
-ec4105=XML-Dokument, das die zu prfende Signatur enthlt, kann nicht aufgelst werden.
-ec4106=XML-Dokument, das die zu prfende Signatur enthlt, kann nicht geparst werden.
-ec4107=Am spezifizierten Ort innerhalb des XML-Dokuments befindet sich keine XML-Signatur.
-ec4108=Verschlsseltes Datum kann nicht am spezifizierten Ort in das bestehende XML-Dokument eingefgt werden.
-ec4109=Bestehendes XML-Dokument ist notwendig, aber nicht vorhanden.
-ec4110=Bestehendes XML-Dokument kann nicht aufgelst werden.
-ec4111=Bestehendes XML-Dokument kann nicht geparst werden.
-ec4112=Verschlsselte Datenverschlsselungsschlssel knnen nicht am spezifizierten Ort in das bestehende XML-Dokument eingefgt werden.
-ec4113=Zu entschlsselnde Daten sind weder in der CMS-Nachricht noch im XML-Request enthalten.
-ec4114=Zu entschlsselndes XML-Dokument kann nicht aufgelst werden.
-ec4115=Zu entschlsselndes XML-Dokument kann nicht geparst werden.
-ec4116=Zumindest ein spezifiziertes Verschlsselungselement kann nicht im zu entschlsselnden XML-Dokument gefunden werden.
-ec4117=Kein Verschlsselungselement fr Binrantwort vorhanden.
-ec4118=Zu hashendes Datum kann nicht aufgelst werden.
-ec4119=Datum, fr das der Hashwert zu prfen ist, kann nicht aufgelst werden.
-ec4120=Gewhlter Infoboxbezeichner bereits vergeben.
-ec4121=Infobox mit spezifiziertem Bezeichner existiert nicht.
-ec4122=Inhalt der ausgewhlten Infobox kann nicht als XML dargestellt werden.
-ec4123=Assoziatives Array: Zum spezifizierten Schlssel existiert kein Eintrag.
-ec4500=Die Sitzung ist abgelaufen.
-ec5000=Unklassifizierter Fehler in der Anzeigekomponente.
-ec5001=Anzeige von Daten des in der Befehlsanfrage angegebenen Mime-Types wird nicht untersttzt.
-ec5002=Zeichenkodierung der anzuzeigenden Daten ist fehlerhaft oder wird nicht untersttzt.
-ec5003=Anzuzeigende Daten enhalten nicht untersttzte Zeichen.
-ec5004=Standardanzeigeformat: HTML ist nicht spezifikationskonform.
-ec5005=Standardanzeigeformat: CSS ist nicht spezifikationskonform.
-ec5006=Standardanzeigeformat: Format eines eingebundenen Bildes ist nicht spezifikationskonform.
-ec5007=Standardanzeigeformat: Signatur ber eingebundene Bilder fehlt oder ist nicht spezifikationskonform.
-ec6000=Unklassifizierter Abbruch durch den Brger.
-ec6001=Abbruch durch den Brger ber die Benutzerschnittstelle.
-ec6002=Abbruch auf Grund mangelnder Rechte zur Befehlsausfhrung.
-
-# 3xxx
-#
-
-ec3000.unclassified=Unklassifizierter Fehler in der XML-Struktur der Befehlsanfrage. {0}
-ec3002.invalid=XML-Struktur der Befehlsanfrage entspricht nicht dem Schema des Security-Layers. {0}
-
-# 4xxx
-#
-
-ec4000.infobox.invalid=Die Infobox '{0}' enthlt ungltige Daten.
-ec4000.idlink.transfomation.failed=Die komprimierte Personenbindung konnte mit dem Stylesheet {0} nicht transformiert werden.
-ec4002.infobox.unknown=Unbekannter Infoboxbezeichner {0}.
-ec4003.not.resolved=Zu signierendes Datum kann nicht aufgelst werden (URI={0}).
-ec4011.notimplemented=Befehl {0} ist nicht implementiert.
-
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java b/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java
index 15971497..4dae7975 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/util/SMCCHelper.java
@@ -87,7 +87,7 @@ public class SMCCHelper {
ATR atr = newCards.get(cardTerminal).getATR();
log.trace("Found supported card (" + signatureCard.toString() + ") "
+ "in terminal '" + cardTerminal.getName() + "', ATR = "
- + toString(atr.getHistoricalBytes()) + ".");
+ + toString(atr.getBytes()) + ".");
resultCode = CARD_FOUND;
break;
@@ -97,7 +97,7 @@ public class SMCCHelper {
ATR atr = c.getATR();
log.info("Found unsupported card" + " in terminal '"
+ cardTerminal.getName() + "', ATR = "
- + toString(atr.getHistoricalBytes()) + ".");
+ + toString(atr.getBytes()) + ".");
} else {
log.info("Found unsupported card in terminal '"
+ cardTerminal.getName() + "' without ATR");
diff --git a/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard.properties b/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard.properties
index 9142841c..d2bbe4f9 100644
--- a/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard.properties
+++ b/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard.properties
@@ -17,5 +17,5 @@
# and open the template in the editor.
dec.pin.name=Geheimhaltungs-PIN
-sig.pin.name=Signature-PIN
+sig.pin.name=Signatur-PIN
inf.pin.name=Infobox-PIN
diff --git a/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_de.properties b/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_de.properties
deleted file mode 100644
index d2bbe4f9..00000000
--- a/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_de.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# To change this template, choose Tools | Templates
-# and open the template in the editor.
-
-dec.pin.name=Geheimhaltungs-PIN
-sig.pin.name=Signatur-PIN
-inf.pin.name=Infobox-PIN
diff --git a/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_en.properties b/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_en.properties
deleted file mode 100644
index 9142841c..00000000
--- a/smcc/src/main/resources/at/gv/egiz/smcc/ACOSCard_en.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# To change this template, choose Tools | Templates
-# and open the template in the editor.
-
-dec.pin.name=Geheimhaltungs-PIN
-sig.pin.name=Signature-PIN
-inf.pin.name=Infobox-PIN
diff --git a/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard.properties b/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard.properties
index 77935333..6fa5f0fa 100644
--- a/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard.properties
+++ b/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard.properties
@@ -16,5 +16,5 @@
# To change this template, choose Tools | Templates
# and open the template in the editor.
-sig.pin.name=Signature-PIN
-card.pin.name=Card-PIN
+sig.pin.name=Signatur-PIN
+card.pin.name=Karten-PIN
diff --git a/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_de.properties b/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_de.properties
deleted file mode 100644
index 6fa5f0fa..00000000
--- a/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_de.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# To change this template, choose Tools | Templates
-# and open the template in the editor.
-
-sig.pin.name=Signatur-PIN
-card.pin.name=Karten-PIN
diff --git a/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_en.properties b/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_en.properties
deleted file mode 100644
index 77935333..00000000
--- a/smcc/src/main/resources/at/gv/egiz/smcc/STARCOSCard_en.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2008 Federal Chancellery Austria and
-# Graz University of Technology
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# To change this template, choose Tools | Templates
-# and open the template in the editor.
-
-sig.pin.name=Signature-PIN
-card.pin.name=Card-PIN
--
cgit v1.2.3
From 9fcce6749092eb6c5d266dd1dd7099e88014fbd7 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 4 Nov 2008 12:03:15 +0000
Subject: simplegui messages on top
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@143 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 6 +-
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 93 ++++++++++++----------
.../bku/binding/BindingProcessorManagerImpl.java | 5 +-
smcc/pom.xml | 35 +-------
4 files changed, 59 insertions(+), 80 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index 9f733a14..cb99a872 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -14,10 +14,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
package at.gv.egiz.bku.gui;
import at.gv.egiz.smcc.PINSpec;
@@ -819,7 +815,7 @@ public class BKUGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_WAIT));
+ titleLabel.setText(messages.getString(TITLE_WAIT));
helpListener.setHelpTopic(HELP_WAIT);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index a005292e..6bf6df84 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -312,15 +312,14 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
+ mainPanelLayout.createSequentialGroup()
+ .addComponent(welcomeMsgLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(welcomeMsgLabel));
+ .addComponent(helpLabel));
mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(helpLabel)
- .addComponent(welcomeMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(welcomeMsgLabel)
+ .addComponent(helpLabel));
contentPanel.validate();
@@ -355,15 +354,14 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
+ mainPanelLayout.createSequentialGroup()
+ .addComponent(insertCardMsgLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(insertCardMsgLabel));
+ .addComponent(helpLabel));
mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(helpLabel)
- .addComponent(insertCardMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(insertCardMsgLabel)
+ .addComponent(helpLabel));
// JButton cancelButton = new JButton();
// cancelButton.setText(messages.getString(BUTTON_CANCEL));
@@ -418,15 +416,14 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
+ mainPanelLayout.createSequentialGroup()
+ .addComponent(insertCardMsgLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(insertCardMsgLabel));
+ .addComponent(helpLabel));
mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(helpLabel)
- .addComponent(insertCardMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(insertCardMsgLabel)
+ .addComponent(helpLabel));
// JButton cancelButton = new JButton();
// cancelButton.setText(messages.getString(BUTTON_CANCEL));
@@ -764,6 +761,11 @@ public class SimpleGUI implements BKUGUIFacade {
helpListener.setHelpTopic(errorMsgKey);
+ JLabel errorTitleLabel = new JLabel();
+ errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ errorTitleLabel.setText(messages.getString(TITLE_ERROR));
+ errorTitleLabel.setForeground(ERROR_COLOR);
+
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -778,12 +780,15 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(errorTitleLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
.addComponent(helpLabel))
.addComponent(errorMsgLabel));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addComponent(helpLabel)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(errorTitleLabel)
+ .addComponent(helpLabel))
.addComponent(errorMsgLabel));
JButton okButton = new JButton();
@@ -827,27 +832,34 @@ public class SimpleGUI implements BKUGUIFacade {
helpListener.setHelpTopic(errorMsgKey);
+ JLabel errorTitleLabel = new JLabel();
+ errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ errorTitleLabel.setText(messages.getString(TITLE_ERROR));
+ errorTitleLabel.setForeground(ERROR_COLOR);
+
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
JLabel errorMsgLabel = new JLabel();
errorMsgLabel.setFont(errorMsgLabel.getFont().deriveFont(errorMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
errorMsgLabel.setText(errorMsg);
- errorMsgLabel.setForeground(ERROR_COLOR);
-
+
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(errorMsgLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(helpLabel)
- .addComponent(errorMsgLabel));
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(errorTitleLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(errorMsgLabel));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createSequentialGroup()
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(errorTitleLabel)
+ .addComponent(helpLabel))
+ .addComponent(errorMsgLabel));
contentPanel.validate();
}
@@ -885,16 +897,15 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.setLayout(mainPanelLayout);
mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
+ mainPanelLayout.createSequentialGroup()
+ .addComponent(waitMsgLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(waitMsgLabel));
+ .addComponent(helpLabel));
mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(helpLabel)
- .addComponent(waitMsgLabel));
-
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(waitMsgLabel)
+ .addComponent(helpLabel));
+
contentPanel.validate();
}
});
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java
index cc1b7532..9757f7cc 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/binding/BindingProcessorManagerImpl.java
@@ -285,16 +285,19 @@ public class BindingProcessorManagerImpl implements BindingProcessorManager {
log.debug("Removing binding processor: " + sessionId);
ProcessingContext ctx = contextMap.get(sessionId);
if (ctx == null) {
+ log.warn("no processing context to remove for session " + sessionId);
return;
}
Future f = ctx.getFuture();
-
+
// MapEntityWrapper wrapper = bindingProcessorMap.get(sessionId);
// if (wrapper == null) {
// return;
// }
// Future> f = wrapper.getFuture();
+
if (!f.isDone()) {
+ log.trace("canceling " + sessionId);
f.cancel(true);
}
contextMap.remove(sessionId);
diff --git a/smcc/pom.xml b/smcc/pom.xml
index 3e3dfe14..9fa81387 100644
--- a/smcc/pom.xml
+++ b/smcc/pom.xml
@@ -1,6 +1,5 @@
-
+bkuat.gv.egiz
@@ -15,36 +14,6 @@
http://bku.egiz.gv.at
-
- maven-jar-plugin
-
-
-
- sign
-
-
-
-
-
- false
- false
-
- false
-
-
- test-applet signer
- keystore.ks
- storepass
- keypass
- true
-
-
-
- maven-compiler-plugin
-
- UTF-8
-
- maven-resources-plugin
@@ -70,4 +39,4 @@
iaik_jce_full_signed
-->
-
\ No newline at end of file
+
--
cgit v1.2.3
From 3049d65de7c8ca9c25756db5648b6f268d675df9 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 4 Nov 2008 12:24:39 +0000
Subject: error foreground color remove showLoginDialog()
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@145 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 37 ---------------------
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 7 ++--
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 38 ----------------------
3 files changed, 2 insertions(+), 80 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index cb99a872..d96d22c8 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -249,43 +249,6 @@ public class BKUGUI implements BKUGUIFacade {
return messages.getLocale();
}
- @Override
- public void showLoginDialog(ActionListener loginListener, String actionCommand) {
-
- log.debug("scheduling login dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("show login dialog");
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
- titleLabel.setText(messages.getString(TITLE_ERROR));
-
- JLabel waitMsgLabel = new JLabel();
- waitMsgLabel.setFont(waitMsgLabel.getFont().deriveFont(waitMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- waitMsgLabel.setText("LoginDialog not supported yet.");
- waitMsgLabel.setForeground(ERROR_COLOR);
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(waitMsgLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(waitMsgLabel));
-
- contentPanel.validate();
- }
- });
- }
-
@Override
public void showWelcomeDialog() {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 6655cf64..ad489c2e 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -97,12 +97,9 @@ public interface BKUGUIFacade {
public void showWelcomeDialog();
/**
- * MOA-ID only
- * @param loginListener
+ *
+ * @param waitMessage if null, a simple 'wait' text is displayed
*/
- public void showLoginDialog(ActionListener loginListener, String actionCommand);
-
- /** optional wait message */
public void showWaitDialog(String waitMessage);
public void showInsertCardDialog(ActionListener cancelListener, String actionCommand);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index 6bf6df84..f2a8466b 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -248,43 +248,6 @@ public class SimpleGUI implements BKUGUIFacade {
return messages.getLocale();
}
- @Override
- public void showLoginDialog(ActionListener loginListener, String actionCommand) {
-
- log.debug("scheduling login dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("show login dialog");
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
-// titleLabel.setText(messages.getString(TITLE_ERROR));
-
- JLabel waitMsgLabel = new JLabel();
- waitMsgLabel.setFont(waitMsgLabel.getFont().deriveFont(waitMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- waitMsgLabel.setText("LoginDialog not supported yet.");
- waitMsgLabel.setForeground(ERROR_COLOR);
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(waitMsgLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(waitMsgLabel));
-
- contentPanel.validate();
- }
- });
- }
-
@Override
public void showWelcomeDialog() {
@@ -772,7 +735,6 @@ public class SimpleGUI implements BKUGUIFacade {
JLabel errorMsgLabel = new JLabel();
errorMsgLabel.setFont(errorMsgLabel.getFont().deriveFont(errorMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
errorMsgLabel.setText(errorMsg);
- errorMsgLabel.setForeground(ERROR_COLOR);
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
--
cgit v1.2.3
From 2cf6fcb31e85b0e3b367121219932ec86b205da8 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Wed, 5 Nov 2008 14:42:05 +0000
Subject: help jsp
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@151 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../at/gv/egiz/bku/online/applet/BKUApplet.java | 2 +-
.../at/gv/egiz/bku/gui/AbstractHelpListener.java | 45 +++++++++-------------
BKUOnline/src/main/webapp/WEB-INF/web.xml | 11 ++++--
BKUOnline/src/main/webapp/appletPage.jsp | 2 +-
BKUOnline/src/main/webapp/help.jsp | 7 ++++
BKUOnline/src/main/webapp/helpfiles/index.html | 17 ++++++++
6 files changed, 53 insertions(+), 31 deletions(-)
create mode 100644 BKUOnline/src/main/webapp/help.jsp
create mode 100644 BKUOnline/src/main/webapp/helpfiles/index.html
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index f3eecdf9..4eab7e89 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -89,7 +89,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider {
URL backgroundImgURL = null;
URL helpURL = null;
try {
- helpURL = getURLParameter(HELP_URL, getAppletParameter(SESSION_ID));
+ helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID));
} catch (MalformedURLException ex) {
log.warn("failed to load help URL, disabling help: " + ex.getMessage());
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
index 6e3167c1..a249a376 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java
@@ -32,39 +32,22 @@ import org.apache.commons.logging.LogFactory;
public abstract class AbstractHelpListener implements ActionListener {
protected final static Log log = LogFactory.getLog(AbstractHelpListener.class);
- protected String helpURLBase;
+// protected String helpURLBase;
+ protected URL baseURL;
protected Locale locale;
public AbstractHelpListener(URL baseURL, Locale locale) {
if (baseURL == null || "".equals(baseURL)) {
throw new RuntimeException("no help URL provided");
}
- this.helpURLBase = baseURL.toString();
+ this.baseURL = baseURL;
this.locale = locale;
}
@Override
public void actionPerformed(ActionEvent e) {
log.debug("received help action: " + e.getActionCommand());
- URL helpURL;
- try {
- String urlString = helpURLBase;
- if (locale != null) {
- urlString = appendParameter(urlString, "locale", locale.toString());
- }
- if (e.getActionCommand() != null && !"".equals(e.getActionCommand())) {
- urlString = appendParameter(urlString, "topic", e.getActionCommand());
- }
- helpURL = new URL(urlString);
- } catch (MalformedURLException ex) {
- try {
- log.error("failed to create help URL: " + ex.getMessage());
- helpURL = new URL(helpURLBase);
- } catch (MalformedURLException ex1) {
- log.error("failed to create default help URL, requested help will not be displayed");
- return;
- }
- }
+ URL helpURL = constructHelpURL(baseURL, e.getActionCommand());
try {
showDocument(helpURL);
} catch (Exception ex) {
@@ -72,12 +55,22 @@ public abstract class AbstractHelpListener implements ActionListener {
}
}
- private String appendParameter(String url, String paramName, String paramValue) {
- if (url.indexOf('?') < 0) {
- return url + "?" + paramName + "=" + paramValue;
- } else {
- return url + "&" + paramName + "=" + paramValue;
+ private URL constructHelpURL(URL baseURL, String helpItem) {
+ URL helpURL = baseURL;
+ log.trace("constructing help URL: " + helpURL);
+ try {
+ if (locale != null) {
+ helpURL = new URL(helpURL, locale.toString() + "/");
+ log.trace("constructing help URL: " + helpURL);
+ }
+ if (helpItem != null && !"".equals(helpItem)) {
+ helpURL = new URL(helpURL, helpItem + ".html");
+ log.trace("constructing help URL: " + helpURL);
+ }
+ } catch (MalformedURLException ex) {
+ log.error("Failed to construct help URL for help item " + helpItem + ": " + ex.getMessage());
}
+ return helpURL;
}
public abstract void showDocument(URL helpDocument) throws Exception;
diff --git a/BKUOnline/src/main/webapp/WEB-INF/web.xml b/BKUOnline/src/main/webapp/WEB-INF/web.xml
index 6b2ec35c..f6fdbefc 100644
--- a/BKUOnline/src/main/webapp/WEB-INF/web.xml
+++ b/BKUOnline/src/main/webapp/WEB-INF/web.xml
@@ -52,6 +52,10 @@
HashDataInputServletat.gv.egiz.bku.online.webapp.HashDataInputServlet
+
+ help
+ /help.jsp
+ BKUServlet/http-security-layer-request
@@ -68,9 +72,10 @@
HashDataInputServlet/hashDataInput
-
-
-
+
+ help
+ /help/*
+
diff --git a/BKUOnline/src/main/webapp/appletPage.jsp b/BKUOnline/src/main/webapp/appletPage.jsp
index 8ddbed13..ff52fe51 100644
--- a/BKUOnline/src/main/webapp/appletPage.jsp
+++ b/BKUOnline/src/main/webapp/appletPage.jsp
@@ -53,7 +53,7 @@
GuiStyle : '<%=guiStyle%>',
Background : '<%=backgroundImg%>',
WSDL_URL :'../stal?wsdl',
- HelpURL : '../help',
+ HelpURL : '../help/',
HashDataDisplay : 'external',
HashDataURL : '../hashDataInput',
SessionID : '<%=session.getId()%>',
diff --git a/BKUOnline/src/main/webapp/help.jsp b/BKUOnline/src/main/webapp/help.jsp
new file mode 100644
index 00000000..29343171
--- /dev/null
+++ b/BKUOnline/src/main/webapp/help.jsp
@@ -0,0 +1,7 @@
+<%--
+ Document : help
+ Created on : 05.11.2008, 10:55:52
+ Author : Clemens Orthacker
+--%>
+
+
diff --git a/BKUOnline/src/main/webapp/helpfiles/index.html b/BKUOnline/src/main/webapp/helpfiles/index.html
new file mode 100644
index 00000000..84db59c6
--- /dev/null
+++ b/BKUOnline/src/main/webapp/helpfiles/index.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
No help item provided
+
+
+
--
cgit v1.2.3
From 1a459eb89e4e91308e1022abb8ddd0cae1d8e619 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Thu, 6 Nov 2008 12:24:24 +0000
Subject: error msg ws.unreachable dummy helplistener
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@153 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 6 +++---
.../src/main/resources/at/gv/egiz/bku/gui/Messages.properties | 3 ++-
.../java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java | 1 -
3 files changed, 5 insertions(+), 5 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 482273b0..829cc79d 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -83,9 +83,10 @@ public class BKUApplet extends JApplet implements AppletParameterProvider {
String locale = getAppletParameter(LOCALE_PARAM_KEY);
String guiStyle = getAppletParameter(GUI_STYLE);
URL backgroundImgURL = null;
- URL helpURL = null;
+ AppletHelpListener helpListener = null;
try {
- helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID));
+ URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID));
+ helpListener = new AppletHelpListener(helpURL, getLocale()); //getAppletContext(),
} catch (MalformedURLException ex) {
log.warn("failed to load help URL, disabling help: " + ex.getMessage());
}
@@ -101,7 +102,6 @@ public class BKUApplet extends JApplet implements AppletParameterProvider {
log.debug("setting locale to " + getLocale());
BKUGUIFacade gui = BKUGUIFactory.createGUI(guiStyle);
- AppletHelpListener helpListener = new AppletHelpListener(helpURL, getLocale()); //getAppletContext(),
gui.init(getContentPane(), getLocale(), backgroundImgURL, helpListener);
worker = new AppletBKUWorker(gui, getAppletContext(), this);
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index aeabc5c1..2dc03491 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -53,7 +53,8 @@ error.no.hashdata=Keine Signaturdaten verf\u00FCgbar: {0}
error.display.hashdata=Signaturdaten konnten nicht dargestellt werden: {0}
error.write.hashdata=Die Signaturdaten konnten nicht gespeichert werden: {0}
error.invalid.hash=Die Signaturdaten sind ung\u00FCltig: {0}
-error.ws.unreachable=Das Web-Service ist nicht erreichbar: {0}
+error.ws.unreachable=Der Server ist nicht erreichbar
+#error.ws.unreachable=Das Web-Service ist nicht erreichbar: {0}
error.pcsc=Es konnte keine PC/SC Schnittstelle gefunden werden
error.cardterminal=Es konnte kein Smartcard-Leser gefunden werden
error.unknown=Leider trat ein Fehler auf: {0}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
index d5702e0e..19a56502 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
@@ -25,7 +25,6 @@ import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import at.gv.egiz.bku.smccstal.SMCCSTALRequestHandler;
import at.gv.egiz.bku.smccstal.SignRequestHandler;
import at.gv.egiz.stal.HashDataInput;
import at.gv.egiz.stal.STALRequest;
--
cgit v1.2.3
From 82c59c9d862d3ee9ad43fdc1509d0b5a61cc107c Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 11 Nov 2008 12:15:15 +0000
Subject: Frame HashData Display Interrupt in waitForAction (applet closed)
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@161 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../gv/egiz/bku/online/applet/AppletBKUWorker.java | 12 +-
.../bku/online/applet/AppletHashDataDisplay.java | 167 +++++++++++++
.../egiz/bku/online/applet/AppletHelpListener.java | 33 +--
.../at/gv/egiz/bku/online/applet/BKUApplet.java | 4 +-
.../bku/online/applet/BrowserHashDataDisplay.java | 52 +++++
.../applet/ExternalDisplaySignRequestHandler.java | 66 ------
.../bku/online/applet/JDialogHashDataDisplay.java | 221 ++++++++++++++++++
.../applet/WebServiceSignRequestHandler.java | 164 -------------
BKUApplet/src/main/resources/simplelog.properties | 2 +-
BKUApplet/src/test/resources/appletTest.html | 4 +-
.../src/main/java/at/gv/egiz/bku/gui/BKUGUI.java | 2 +-
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 5 +-
.../java/at/gv/egiz/bku/gui/HashDataViewer.java | 260 +++++++++++++++++++++
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 38 ++-
.../at/gv/egiz/bku/gui/Messages.properties | 2 +
.../at/gv/egiz/bku/gui/Messages_en.properties | 2 +
.../gv/egiz/bku/local/gui/LocalHelpListener.java | 1 -
.../bku/local/stal/LocalSignRequestHandler.java | 4 +-
BKUOnline/src/main/webapp/HTTP-ohne.html | 5 +-
BKUOnline/src/main/webapp/appletPage.jsp | 4 +-
20 files changed, 773 insertions(+), 275 deletions(-)
create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java
create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java
delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java
create mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java
delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
index cf842d55..8e88c012 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
@@ -31,6 +31,7 @@ import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
import at.gv.egiz.stal.util.STALTranslator;
import java.applet.AppletContext;
+import java.awt.Dimension;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
@@ -194,12 +195,15 @@ public class AppletBKUWorker extends AbstractBKUWorker implements Runnable {
String hashDataDisplayStyle = params.getAppletParameter(BKUApplet.HASHDATA_DISPLAY);
if (BKUApplet.HASHDATA_DISPLAY_INTERNAL.equals(hashDataDisplayStyle)) {
log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL);
- addRequestHandler(SignRequest.class, new WebServiceSignRequestHandler(stalPort, sessionId));
- } else {
- //if (HASHDATADISPLAY_EXTERNAL.equals(displayStyle)) {
+ addRequestHandler(SignRequest.class, new AppletHashDataDisplay(stalPort, sessionId));
+ } else if (BKUApplet.HASHDATA_DISPLAY_BROWSER.equals(hashDataDisplayStyle)) {
URL hashDataURL = params.getURLParameter(BKUApplet.HASHDATA_URL, sessionId);
log.debug("register SignRequestHandler for HashDataURL " + hashDataURL);
- addRequestHandler(SignRequest.class, new ExternalDisplaySignRequestHandler(hashDataURL)); //
+ addRequestHandler(SignRequest.class, new BrowserHashDataDisplay(ctx, hashDataURL));
+ } else {
+ //BKUApplet.HASHDATA_DISPLAY_FRAME
+ log.debug("register SignRequestHandler for STAL port " + BKUApplet.WSDL_URL);
+ addRequestHandler(SignRequest.class, new JDialogHashDataDisplay(stalPort, sessionId, new Dimension(400, 300), locale));
}
}
}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java
new file mode 100644
index 00000000..b77485d9
--- /dev/null
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHashDataDisplay.java
@@ -0,0 +1,167 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.online.applet;
+
+import java.security.DigestException;
+import java.security.MessageDigest;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.smccstal.SignRequestHandler;
+import at.gv.egiz.stal.HashDataInput;
+import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
+import at.gv.egiz.stal.service.STALPortType;
+import at.gv.egiz.stal.service.types.GetHashDataInputResponseType;
+import at.gv.egiz.stal.service.types.GetHashDataInputType;
+import at.gv.egiz.stal.signedinfo.DigestMethodType;
+import at.gv.egiz.stal.signedinfo.ReferenceType;
+
+/**
+ * A SignRequesthandler displaying hashdata inputs in the applet
+ * (only plaintext data is displayed, other hashdata inputs may be saved to disk).
+ *
+ * @author Clemens Orthacker
+ */
+public class AppletHashDataDisplay extends SignRequestHandler {
+
+ private static final Log log = LogFactory.getLog(AppletHashDataDisplay.class);
+ STALPortType stalPort;
+ String sessId;
+
+ public AppletHashDataDisplay(STALPortType stalPort, String sessId) {
+ if (stalPort == null || sessId == null) {
+ throw new NullPointerException("STAL port must not be null");
+ }
+ this.sessId = sessId;
+ this.stalPort = stalPort;
+ }
+
+ @Override
+ public void displayHashDataInputs(List signedReferences) throws Exception {
+
+ GetHashDataInputType request = new GetHashDataInputType();
+ request.setSessionId(sessId);
+
+ HashMap idSignedRefMap = new HashMap();
+ for (ReferenceType signedRef : signedReferences) {
+ //don't get Manifest, QualifyingProperties, ...
+ if (signedRef.getType() == null) {
+ String signedRefId = signedRef.getId();
+ if (signedRefId != null) {
+ if (log.isTraceEnabled()) {
+ log.trace("requesting hashdata input for reference " + signedRefId);
+ }
+ idSignedRefMap.put(signedRefId, signedRef);
+ GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference();
+ ref.setID(signedRefId);
+ request.getReference().add(ref);
+
+ } else {
+ throw new Exception("Cannot resolve HashDataInput for reference without Id attribute");
+ }
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId);
+ }
+ GetHashDataInputResponseType response = stalPort.getHashDataInput(request);
+ ArrayList hashDataInputs = new ArrayList();
+
+ //hashdata inputs returned from service
+ HashMap idRefMap = new HashMap();
+ for (GetHashDataInputResponseType.Reference reference : response.getReference()) {
+ String id = reference.getID();
+ byte[] hdi = reference.getValue();
+ if (hdi == null) {
+ throw new Exception("Did not receive hashdata input for reference " + id);
+ }
+ idRefMap.put(id, reference);
+ }
+
+ for (String signedRefId : idSignedRefMap.keySet()) {
+ log.info("validating hashdata input for reference " + signedRefId);
+
+ GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId);
+ if (reference == null) {
+ throw new Exception("No hashdata input for reference " + signedRefId + " returned by service");
+ }
+
+// }
+//
+// for (GetHashDataInputResponseType.Reference reference : response.getReference()) {
+//
+// String id = reference.getID();
+ byte[] hdi = reference.getValue();
+ String mimeType = reference.getMimeType();
+ String encoding = reference.getEncoding();
+
+ if (hdi == null) {
+ throw new Exception("No hashdata input provided for reference " + signedRefId);
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")");
+ }
+
+ ReferenceType dsigRef = idSignedRefMap.get(signedRefId);
+ DigestMethodType dm = dsigRef.getDigestMethod();
+
+ if (dm == null) {
+ throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm");
+ }
+ String mdAlg = dm.getAlgorithm();
+ if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg))
+ mdAlg = "SHA-1";
+ else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg))
+ mdAlg = "SHA-256";
+ else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg))
+ mdAlg = "SHA-224";
+ else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg))
+ mdAlg = "SHA-224";
+ else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg))
+ mdAlg = "SHA-384";
+ else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg))
+ mdAlg = "SHA-512";
+ else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg))
+ mdAlg = "MD2";
+ else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg))
+ mdAlg = "MD5";
+ else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg))
+ mdAlg = "RipeMD-160";
+ else {
+ throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg);
+ }
+ MessageDigest md = MessageDigest.getInstance(mdAlg);
+ byte[] hdiDigest = md.digest(hdi);
+ if (log.isDebugEnabled())
+ log.debug("Comparing digest values... ");
+ if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) {
+ log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue()));
+ throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue()));
+ }
+ hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding));
+ }
+
+ gui.showHashDataInputDialog(hashDataInputs, false, this, "ok");
+ }
+}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
index 743dc7ef..5d199872 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java
@@ -18,45 +18,28 @@
package at.gv.egiz.bku.online.applet;
import at.gv.egiz.bku.gui.AbstractHelpListener;
-import java.awt.Desktop;
+import java.applet.AppletContext;
import java.net.URL;
import java.util.Locale;
/**
- * Now uses java.awt.Desktop, which deprecates
- * the distinction between local and applet help listener
- * TODO: integrate in AbstractHelpListener
*
- * @deprecated
- * @author clemens
+ * @author Clemens Orthacker
*/
public class AppletHelpListener extends AbstractHelpListener {
-// protected AppletContext ctx;
- protected Desktop desktop;
+ protected AppletContext ctx;
- public AppletHelpListener(URL helpURL, Locale locale) {
+ public AppletHelpListener(AppletContext ctx, URL helpURL, Locale locale) {
super(helpURL, locale);
-// if (ctx == null) {
-// throw new RuntimeException("no applet context provided");
-// }
-// this.ctx = ctx;
- if (Desktop.isDesktopSupported()) {
- this.desktop = Desktop.getDesktop();
+ if (ctx == null) {
+ throw new RuntimeException("no applet context provided");
}
+ this.ctx = ctx;
}
@Override
public void showDocument(URL helpDocument) throws Exception {
-// ctx.showDocument(helpDocument, "_blank");
- if (desktop == null) {
- log.error("Failed to open default browser: Desktop API not available (libgnome installed?)");
- } else {
- if (!desktop.isSupported(Desktop.Action.BROWSE)) {
- log.error("Failed to open default browser: The system provides the Desktop API, but does not support the BROWSE action");
- } else {
- Desktop.getDesktop().browse(helpDocument.toURI());
- }
- }
+ ctx.showDocument(helpDocument, "_blank");
}
}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 829cc79d..9d640dee 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -52,6 +52,8 @@ public class BKUApplet extends JApplet implements AppletParameterProvider {
public static final String REDIRECT_URL = "RedirectURL";
public static final String REDIRECT_TARGET = "RedirectTarget";
public static final String HASHDATA_DISPLAY_INTERNAL = "internal";
+ public static final String HASHDATA_DISPLAY_BROWSER = "browser";
+ public static final String HASHDATA_DISPLAY_FRAME = "frame";
/**
* STAL WSDL namespace and service name
@@ -86,7 +88,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider {
AppletHelpListener helpListener = null;
try {
URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID));
- helpListener = new AppletHelpListener(helpURL, getLocale()); //getAppletContext(),
+ helpListener = new AppletHelpListener(getAppletContext(), helpURL, getLocale());
} catch (MalformedURLException ex) {
log.warn("failed to load help URL, disabling help: " + ex.getMessage());
}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java
new file mode 100644
index 00000000..c30921da
--- /dev/null
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BrowserHashDataDisplay.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.online.applet;
+
+import java.net.URL;
+import java.util.List;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import at.gv.egiz.bku.smccstal.SignRequestHandler;
+import at.gv.egiz.stal.signedinfo.ReferenceType;
+import java.applet.AppletContext;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class BrowserHashDataDisplay extends SignRequestHandler {
+
+ private static final Log log = LogFactory.getLog(BrowserHashDataDisplay.class);
+
+ protected AppletContext ctx;
+ protected URL hashDataURL;
+
+ public BrowserHashDataDisplay(AppletContext ctx, URL hashDataURL) {
+ this.ctx = ctx;
+ this.hashDataURL = hashDataURL;
+ }
+
+ @Override
+ public void displayHashDataInputs(List signedReferences) throws Exception {
+ //TODO pass reference Id's to servlet (TODO servlet)
+ log.debug("displaying hashdata inputs at " + hashDataURL);
+ ctx.showDocument(hashDataURL, "_blank");
+ }
+}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java
deleted file mode 100644
index e4567a6c..00000000
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalDisplaySignRequestHandler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package at.gv.egiz.bku.online.applet;
-
-import java.net.URL;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import at.gv.egiz.bku.smccstal.SignRequestHandler;
-import at.gv.egiz.stal.signedinfo.ReferenceType;
-import java.awt.Desktop;
-
-/**
- *
- * @author Clemens Orthacker
- */
-public class ExternalDisplaySignRequestHandler extends SignRequestHandler {
-
- private static final Log log = LogFactory.getLog(ExternalDisplaySignRequestHandler.class);
-
-// AppletContext ctx;
- protected URL hashDataURL;
- protected Desktop desktop;
-
- public ExternalDisplaySignRequestHandler(URL hashDataURL) {
-// this.ctx = ctx;
- this.hashDataURL = hashDataURL;
- if (Desktop.isDesktopSupported()) {
- desktop = Desktop.getDesktop();
- }
- }
-
- @Override
- public void displayHashDataInputs(List signedReferences) throws Exception {
- //TODO pass reference Id's to servlet (TODO servlet)
- log.debug("displaying hashdata inputs at " + hashDataURL);
-// ctx.showDocument(hashDataURL, "_blank");
- if (desktop == null) {
- log.error("Failed to open default browser: Desktop API not available (libgnome installed?)");
- } else {
- if (!desktop.isSupported(Desktop.Action.BROWSE)) {
- log.error("Failed to open default browser: The system provides the Desktop API, but does not support the BROWSE action");
- } else {
- Desktop.getDesktop().browse(hashDataURL.toURI());
- }
- }
- }
-
-}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java
new file mode 100644
index 00000000..1f0eda90
--- /dev/null
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/JDialogHashDataDisplay.java
@@ -0,0 +1,221 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.online.applet;
+
+import at.gv.egiz.bku.smccstal.SignRequestHandler;
+import at.gv.egiz.stal.HashDataInput;
+import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
+import at.gv.egiz.stal.service.GetHashDataInputFault;
+import at.gv.egiz.stal.service.STALPortType;
+import at.gv.egiz.stal.service.types.GetHashDataInputResponseType;
+import at.gv.egiz.stal.service.types.GetHashDataInputType;
+import at.gv.egiz.stal.signedinfo.ReferenceType;
+import java.awt.Dimension;
+import java.security.DigestException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class JDialogHashDataDisplay extends SignRequestHandler {
+
+ private static final Log log = LogFactory.getLog(JDialogHashDataDisplay.class);
+ protected STALPortType stalPort;
+ protected String sessId;
+// protected HashDataViewer viewer;
+
+ public JDialogHashDataDisplay(STALPortType stalPort, String sessId, Dimension viewerSize, Locale locale) {
+ if (stalPort == null || sessId == null) {
+ throw new NullPointerException("STAL port must not be null");
+ }
+ this.sessId = sessId;
+ this.stalPort = stalPort;
+// this.viewer = new HashDataViewer(viewerSize, locale);
+ }
+
+ @Override
+ public void displayHashDataInputs(List signedReferences) throws DigestException, Exception {
+
+ List hdi = getHashDataInput(signedReferences);
+ final List verifiedHashDataInputs = verifyHashDataInput(signedReferences, hdi);
+
+ if (verifiedHashDataInputs.size() > 1) {
+ gui.showHashDataInputDialog(verifiedHashDataInputs, false, this, "ok");
+ } else if (verifiedHashDataInputs.size() == 1) {
+ gui.showHashDataInputDialog(verifiedHashDataInputs, true, this, "ok");
+// SwingUtilities.invokeLater(new Runnable() {
+//
+// @Override
+// public void run() {
+// viewer.displayHashData(verifiedHashDataInputs.get(0));
+// }
+// });
+
+ } else {
+ log.error("No hashdata input to display");
+ }
+
+ }
+
+ /**
+ * Get all hashdata inputs that contain an ID attribute and no Type attribute.
+ * @param signedReferences
+ * @return
+ * @throws at.gv.egiz.stal.service.GetHashDataInputFault
+ */
+ private List getHashDataInput(List signedReferences) throws GetHashDataInputFault, Exception {
+ GetHashDataInputType request = new GetHashDataInputType();
+ request.setSessionId(sessId);
+
+// HashMap idSignedRefMap = new HashMap();
+ for (ReferenceType signedRef : signedReferences) {
+ //don't get Manifest, QualifyingProperties, ...
+ if (signedRef.getType() == null) {
+ String signedRefId = signedRef.getId();
+ if (signedRefId != null) {
+ if (log.isTraceEnabled()) {
+ log.trace("requesting hashdata input for reference " + signedRefId);
+ }
+// idSignedRefMap.put(signedRefId, signedRef);
+ GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference();
+ ref.setID(signedRefId);
+ request.getReference().add(ref);
+
+ } else {
+ throw new Exception("Cannot resolve HashDataInput for reference without Id attribute");
+ }
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("WebService call GetHashDataInput for " + request.getReference().size() + " references in session " + sessId);
+ }
+ GetHashDataInputResponseType response = stalPort.getHashDataInput(request);
+ return response.getReference();
+ }
+
+ /**
+ * Verifies all signed references and returns STAL HashDataInputs
+ * @param signedReferences
+ * @param hashDataInputs
+ * @return
+ * @throws java.security.DigestException
+ * @throws java.security.NoSuchAlgorithmException
+ * @throws Exception if no hashdata input is provided for a signed reference
+ */
+ private List verifyHashDataInput(List signedReferences, List hashDataInputs) throws DigestException, NoSuchAlgorithmException, Exception {
+
+ ArrayList verifiedHashDataInputs = new ArrayList();
+
+ //hashdata inputs returned from service
+// HashMap idRefMap = new HashMap();
+// for (GetHashDataInputResponseType.Reference hashDataInput : hashDataInputs) {
+// String id = hashDataInput.getID();
+// byte[] hdi = hashDataInput.getValue();
+// if (hdi == null) {
+// throw new Exception("Did not receive hashdata input for reference " + id);
+// }
+// idRefMap.put(id, hashDataInput);
+// }
+
+ for (ReferenceType signedRef : signedReferences) {
+ if (signedRef.getType() == null) {
+ log.info("Verifying digest for signed reference " + signedRef.getId());
+
+ String signedRefId = signedRef.getId();
+ byte[] signedDigest = signedRef.getDigestValue();
+ String signedDigestAlg = null;
+ if (signedRef.getDigestMethod() != null) {
+ signedDigestAlg = signedRef.getDigestMethod().getAlgorithm();
+ } else {
+ throw new NoSuchAlgorithmException("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm");
+ }
+
+ GetHashDataInputResponseType.Reference hashDataInput = null; //idRefMap.get(signedRefId);
+ for (GetHashDataInputResponseType.Reference hdi : hashDataInputs) {
+ if (signedRefId.equals(hdi.getID())) {
+ hashDataInput = hdi;
+ }
+ }
+ if (hashDataInput == null) {
+ throw new Exception("No hashdata input for reference " + signedRefId + " returned by service");
+ }
+
+ byte[] hdi = hashDataInput.getValue();
+ String mimeType = hashDataInput.getMimeType();
+ String encoding = hashDataInput.getEncoding();
+
+ if (hdi == null) {
+ throw new Exception("No hashdata input for reference " + signedRefId + " provided by service");
+ }
+ if (log.isDebugEnabled()) {
+ log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")");
+ }
+
+ byte[] hashDataInputDigest = digest(hdi, signedDigestAlg);
+
+ if (log.isDebugEnabled()) {
+ log.debug("Comparing digest values... ");
+ }
+ log.warn("DISABLED DIGEST VERIFICATION FOR DEBUGGING");
+// if (!Arrays.equals(hashDataInputDigest, signedDigest)) {
+// log.error("Bad digest value for reference " + signedRefId);
+// throw new DigestException("Bad digest value for reference " + signedRefId);
+// }
+
+ verifiedHashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding));
+ }
+ }
+
+ return verifiedHashDataInputs;
+ }
+
+ //TODO
+ private byte[] digest(byte[] hashDataInput, String mdAlg) throws NoSuchAlgorithmException {
+ if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg)) {
+ mdAlg = "SHA-1";
+ } else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg)) {
+ mdAlg = "SHA-256";
+ } else if ("http://www.w3.org/2001/04/xmlenc#sha224".equals(mdAlg)) {
+ mdAlg = "SHA-224";
+ } else if ("http://www.w3.org/2001/04/xmldsig-more#sha224".equals(mdAlg)) {
+ mdAlg = "SHA-224";
+ } else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg)) {
+ mdAlg = "SHA-384";
+ } else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg)) {
+ mdAlg = "SHA-512";
+ } else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg)) {
+ mdAlg = "MD2";
+ } else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg)) {
+ mdAlg = "MD5";
+ } else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg)) {
+ mdAlg = "RipeMD-160";
+ } else {
+ throw new NoSuchAlgorithmException("Failed to verify digest value: unsupported digest algorithm " + mdAlg);
+ }
+
+ MessageDigest md = MessageDigest.getInstance(mdAlg);
+ return md.digest(hashDataInput);
+ }
+}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java
deleted file mode 100644
index 014065f2..00000000
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/WebServiceSignRequestHandler.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package at.gv.egiz.bku.online.applet;
-
-import java.security.DigestException;
-import java.security.MessageDigest;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import at.gv.egiz.bku.smccstal.SignRequestHandler;
-import at.gv.egiz.stal.HashDataInput;
-import at.gv.egiz.stal.impl.ByteArrayHashDataInput;
-import at.gv.egiz.stal.service.STALPortType;
-import at.gv.egiz.stal.service.types.GetHashDataInputResponseType;
-import at.gv.egiz.stal.service.types.GetHashDataInputType;
-import at.gv.egiz.stal.signedinfo.DigestMethodType;
-import at.gv.egiz.stal.signedinfo.ReferenceType;
-
-/**
- * @author clemens
- */
-public class WebServiceSignRequestHandler extends SignRequestHandler {
-
- private static final Log log = LogFactory.getLog(WebServiceSignRequestHandler.class);
- STALPortType stalPort;
- String sessId;
-
- public WebServiceSignRequestHandler(STALPortType stalPort, String sessId) {
- if (stalPort == null || sessId == null) {
- throw new NullPointerException("STAL port must not be null");
- }
- this.sessId = sessId;
- this.stalPort = stalPort;
- }
-
- @Override
- public void displayHashDataInputs(List signedReferences) throws Exception {
-
- GetHashDataInputType request = new GetHashDataInputType();
- request.setSessionId(sessId);
-
- HashMap idSignedRefMap = new HashMap();
- for (ReferenceType signedRef : signedReferences) {
- //don't get Manifest, QualifyingProperties, ...
- if (signedRef.getType() == null) {
- String signedRefId = signedRef.getId();
- if (signedRefId != null) {
- if (log.isTraceEnabled()) {
- log.trace("requesting hashdata input for reference " + signedRefId);
- }
- idSignedRefMap.put(signedRefId, signedRef);
- GetHashDataInputType.Reference ref = new GetHashDataInputType.Reference();
- ref.setID(signedRefId);
- request.getReference().add(ref);
-
- } else {
- throw new Exception("Cannot resolve HashDataInput for reference without Id attribute");
- }
- }
- }
-
- if (log.isDebugEnabled()) {
- log.debug("Calling GetHashDataInput for " + request.getReference().size() + " references in session " + sessId);
- }
- GetHashDataInputResponseType response = stalPort.getHashDataInput(request);
- ArrayList hashDataInputs = new ArrayList();
-
- //hashdata inputs returned from service
- HashMap idRefMap = new HashMap();
- for (GetHashDataInputResponseType.Reference reference : response.getReference()) {
- String id = reference.getID();
- byte[] hdi = reference.getValue();
- if (hdi == null) {
- throw new Exception("Did not receive hashdata input for reference " + id);
- }
- idRefMap.put(id, reference);
- }
-
- for (String signedRefId : idSignedRefMap.keySet()) {
- log.info("validating hashdata input for reference " + signedRefId);
-
- GetHashDataInputResponseType.Reference reference = idRefMap.get(signedRefId);
- if (reference == null) {
- throw new Exception("No hashdata input for reference " + signedRefId + " returned by service");
- }
-
-// }
-//
-// for (GetHashDataInputResponseType.Reference reference : response.getReference()) {
-//
-// String id = reference.getID();
- byte[] hdi = reference.getValue();
- String mimeType = reference.getMimeType();
- String encoding = reference.getEncoding();
-
- if (hdi == null) {
- throw new Exception("No hashdata input provided for reference " + signedRefId);
- }
- if (log.isDebugEnabled()) {
- log.debug("Got HashDataInput " + signedRefId + " (" + mimeType + ";" + encoding + ")");
- }
-
- ReferenceType dsigRef = idSignedRefMap.get(signedRefId);
- DigestMethodType dm = dsigRef.getDigestMethod();
-
- if (dm == null) {
- throw new Exception("Failed to verify digest value for reference " + signedRefId + ": no digest algorithm");
- }
- String mdAlg = dm.getAlgorithm();
- if ("http://www.w3.org/2000/09/xmldsig#sha1".equals(mdAlg))
- mdAlg = "SHA-1";
- else if ("http://www.w3.org/2001/04/xmlenc#sha256".equals(mdAlg))
- mdAlg = "SHA-256";
- else if ("http://www.w3.org/2001/04/xmlenc#sha224 ".equals(mdAlg))
- mdAlg = "SHA-224";
- else if ("http://www.w3.org/2001/04/xmldsig-more#sha224 ".equals(mdAlg))
- mdAlg = "SHA-224";
- else if ("http://www.w3.org/2001/04/xmldsig-more#sha384".equals(mdAlg))
- mdAlg = "SHA-384";
- else if ("http://www.w3.org/2001/04/xmlenc#sha512".equals(mdAlg))
- mdAlg = "SHA-512";
- else if ("http://www.w3.org/2001/04/xmldsig-more#md2 ".equals(mdAlg))
- mdAlg = "MD2";
- else if ("http://www.w3.org/2001/04/xmldsig-more#md5".equals(mdAlg))
- mdAlg = "MD5";
- else if ("http://www.w3.org/2001/04/xmlenc#ripemd160 ".equals(mdAlg))
- mdAlg = "RipeMD-160";
- else {
- throw new Exception("Failed to verify digest value for reference " + signedRefId + ": unsupported digest algorithm " + mdAlg);
- }
- MessageDigest md = MessageDigest.getInstance(mdAlg);
- byte[] hdiDigest = md.digest(hdi);
- if (log.isDebugEnabled())
- log.debug("Comparing digest values... ");
- if (!Arrays.equals(hdiDigest, dsigRef.getDigestValue())) {
- log.error("digest values differ: " + new String(hdiDigest) + ", " + new String(dsigRef.getDigestValue()));
- throw new DigestException("Bad digest value for reference " + signedRefId + ": " + new String(dsigRef.getDigestValue()));
- }
- hashDataInputs.add(new ByteArrayHashDataInput(hdi, signedRefId, mimeType, encoding));
- }
-
- gui.showHashDataInputDialog(hashDataInputs, this, "ok");
- }
-}
diff --git a/BKUApplet/src/main/resources/simplelog.properties b/BKUApplet/src/main/resources/simplelog.properties
index d62508cf..51be76a8 100644
--- a/BKUApplet/src/main/resources/simplelog.properties
+++ b/BKUApplet/src/main/resources/simplelog.properties
@@ -15,7 +15,7 @@
# Logging detail level,
# Must be one of ("trace", "debug", "info", "warn", "error", or "fatal").
-org.apache.commons.logging.simplelog.defaultlog=debug
+org.apache.commons.logging.simplelog.defaultlog=trace
# Logs the Log instance used
org.apache.commons.logging.simplelog.showlogname=true
#Logs the class name with package(or Path)
diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html
index 5aec1998..1ba88e47 100644
--- a/BKUApplet/src/test/resources/appletTest.html
+++ b/BKUApplet/src/test/resources/appletTest.html
@@ -20,11 +20,11 @@
-
+
-
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index d96d22c8..d661c71a 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -814,7 +814,7 @@ public class BKUGUI implements BKUGUIFacade {
}
@Override
- public void showHashDataInputDialog(final List signedReferences, final ActionListener okListener, final String okCommand) {
+ public void showHashDataInputDialog(final List signedReferences, boolean standalone, final ActionListener okListener, final String okCommand) {
if (signedReferences == null) {
showErrorDialog(messages.getString(ERR_NO_HASHDATA), new Object[] {"No SignedReferences provided"}, okListener, okCommand);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index ad489c2e..38638b5d 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -57,6 +57,7 @@ public interface BKUGUIFacade {
public static final String WINDOWTITLE_SAVE = "windowtitle.save";
public static final String WINDOWTITLE_SAVEDIR = "windowtitle.savedir";
public static final String WINDOWTITLE_OVERWRITE = "windowtitle.overwrite";
+ public static final String WINDOWTITLE_VIEWER = "windowtitle.viewer";
public static final String MESSAGE_WAIT = "message.wait";
public static final String MESSAGE_INSERTCARD = "message.insertcard";
public static final String MESSAGE_ENTERPIN = "message.enterpin";
@@ -77,12 +78,14 @@ public interface BKUGUIFacade {
public static final String HELP_RETRY = "help.retry";
public static final String HELP_HASHDATA = "help.hashdata";
public static final String HELP_HASHDATALIST = "help.hashdatalist";
+ public static final String HELP_HASHDATAVIEWER = "help.hashdataviewer";
public static final String BUTTON_OK = "button.ok";
public static final String BUTTON_CANCEL = "button.cancel";
public static final String BUTTON_BACK = "button.back";
public static final String BUTTON_SIGN = "button.sign";
public static final String BUTTON_SAVE = "button.save";
+ public static final String BUTTON_CLOSE = "button.close";
public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
@@ -116,7 +119,7 @@ public interface BKUGUIFacade {
public char[] getPin();
- public void showHashDataInputDialog(List signedReferences, ActionListener okListener, String actionCommand);
+ public void showHashDataInputDialog(List signedReferences, boolean standalone, ActionListener okListener, String actionCommand);
// public void showPlainTextHashDataInputDialog(String text, ActionListener saveListener, String saveCommand, ActionListener cancelListener, String cancelCommand);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
new file mode 100644
index 00000000..3db06e19
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
@@ -0,0 +1,260 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import at.gv.egiz.stal.HashDataInput;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.ResourceBundle;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.LayoutStyle;
+import javax.swing.text.Document;
+import javax.swing.text.EditorKit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class HashDataViewer extends JDialog
+ implements ActionListener, WindowListener {
+
+ public static final String PLAINTEXT_FONT = "Monospaced";
+
+ protected static final Log log = LogFactory.getLog(HashDataViewer.class);
+ private static HashDataViewer dialog;
+
+ public static void showDialog(Component frameComp, List signedReferences, ResourceBundle messages, ActionListener saveListener, String saveCommand, HelpMouseListener helpListener) {
+
+ log.info("******************* SHOW HASHDATA DIALOG");
+
+ Frame frame = JOptionPane.getFrameForComponent(frameComp);
+
+ dialog = new HashDataViewer(frame, signedReferences.get(0), messages, saveListener, saveCommand, helpListener);
+ dialog.addWindowListener(dialog);
+ dialog.setVisible(true);
+
+ }
+
+ private HashDataViewer(Frame frame, HashDataInput hashData, ResourceBundle messages, ActionListener saveListener, String saveCommand, HelpMouseListener helpListener) {
+ super(frame, messages.getString(BKUGUIFacade.WINDOWTITLE_VIEWER), true);
+
+ JPanel viewerPanel = createViewerPanel(messages, hashData, helpListener);
+ JPanel buttonPanel = createButtonPanel(messages, saveListener, saveCommand);
+
+
+ Container contentPane = getContentPane();
+ contentPane.setPreferredSize(new Dimension(400, 300));
+
+ GroupLayout mainLayout = new GroupLayout(contentPane);
+ contentPane.setLayout(mainLayout);
+
+ mainLayout.setHorizontalGroup(
+ mainLayout.createSequentialGroup()
+ .addContainerGap()
+ .addGroup(
+ mainLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addContainerGap());
+ mainLayout.setVerticalGroup(
+ mainLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addContainerGap());
+
+ pack();
+ setLocationRelativeTo(frame);
+ }
+
+ private JPanel createViewerPanel(ResourceBundle messages, HashDataInput hashData, HelpMouseListener helpListener) {
+ String mimeType = hashData.getMimeType();
+ String encoding = hashData.getEncoding();
+
+ log.debug("display hashdata: " + mimeType + ";" + encoding);
+
+ if (mimeType == null) {
+ mimeType = "text/plain";
+ }
+ if (encoding == null) {
+ encoding = "UTF-8";
+ }
+
+ JEditorPane viewer = new JEditorPane();
+ viewer.setEditable(false);
+ viewer.setContentType(mimeType);
+ if ("text/plain".equals(mimeType)) {
+ viewer.setFont(new Font(PLAINTEXT_FONT, viewer.getFont().getStyle(), viewer.getFont().getSize()));
+ }
+
+ EditorKit editorKit = viewer.getEditorKit();
+ Document document = editorKit.createDefaultDocument();
+
+ Reader reader;
+ try {
+ reader = new InputStreamReader(hashData.getHashDataInput(), encoding);
+ viewer.read(reader, document);
+ } catch (Exception ex) {
+ String p = messages.getString(BKUGUIFacade.ERR_DISPLAY_HASHDATA);
+ viewer.setText(MessageFormat.format(p, ex.getMessage()));
+ }
+
+ JScrollPane scrollPane = new JScrollPane(viewer);
+// scrollPane.setPreferredSize(new Dimension(400, 300));
+ scrollPane.setPreferredSize(viewer.getPreferredSize());
+ scrollPane.setAlignmentX(LEFT_ALIGNMENT);
+
+ JLabel viewerTitle = new JLabel();
+ viewerTitle.setText(messages.getString(BKUGUIFacade.TITLE_HASHDATA));
+ viewerTitle.setFont(viewerTitle.getFont().deriveFont(viewerTitle.getFont().getStyle() | java.awt.Font.BOLD));
+ viewerTitle.setLabelFor(viewer);
+
+ JLabel helpLabel = new JLabel();
+ helpListener.setHelpTopic(BKUGUIFacade.HELP_HASHDATAVIEWER);
+ helpLabel.setIcon(new ImageIcon(getClass().getResource(BKUGUIFacade.HELP_IMG)));
+ helpLabel.addMouseListener(helpListener);
+ helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+
+ JPanel viewerPanel = new JPanel();
+ GroupLayout viewerPanelLayout = new GroupLayout(viewerPanel);
+ viewerPanel.setLayout(viewerPanelLayout);
+
+ viewerPanelLayout.setHorizontalGroup(
+ viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(viewerPanelLayout.createSequentialGroup()
+ .addComponent(viewerTitle)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel))
+ .addComponent(scrollPane)); //, 0, 0, Short.MAX_VALUE));
+
+ viewerPanelLayout.setVerticalGroup(
+ viewerPanelLayout.createSequentialGroup()
+ .addGroup(viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(viewerTitle)
+ .addComponent(helpLabel))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(scrollPane)); //, 0, 0, Short.MAX_VALUE));
+
+// viewerPanel.setLayout(new BoxLayout(viewerPanel, BoxLayout.PAGE_AXIS));
+// JLabel title = new JLabel(messages.getString(BKUGUIFacade.TITLE_HASHDATA));
+// title.setLabelFor(viewer);
+// viewerPanel.add(title);
+// viewerPanel.add(Box.createRigidArea(new Dimension(0, 5)));
+// viewerPanel.add(scrollPane);
+// viewerPanel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
+
+ return viewerPanel;
+ }
+
+ private JPanel createButtonPanel(ResourceBundle messages, ActionListener saveListener, String saveCommand) {
+ JButton closeButton = new JButton();
+ closeButton.setText(messages.getString(BKUGUIFacade.BUTTON_CLOSE));
+ closeButton.addActionListener(this);
+
+ JButton saveButton = new JButton();
+ saveButton.setText(messages.getString(BKUGUIFacade.BUTTON_SAVE));
+ saveButton.setActionCommand(saveCommand);
+ saveButton.addActionListener(saveListener);
+
+ int buttonSize = closeButton.getPreferredSize().width;
+ if (saveButton.getPreferredSize().width > buttonSize) {
+ buttonSize = saveButton.getPreferredSize().width;
+ }
+
+ JPanel buttonPanel = new JPanel();
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createSequentialGroup().addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(saveButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(closeButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(saveButton).addComponent(closeButton));
+
+ return buttonPanel;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+// if ("close".equals(e.getActionCommand())) {
+ HashDataViewer.dialog.setVisible(false);
+// HashDataViewer.dialog.dispose();
+ }
+
+ @Override
+ public void windowOpened(WindowEvent e) {
+ log.debug("WINDOW OPENED");
+ }
+
+ @Override
+ public void windowClosing(WindowEvent e) {
+ log.debug("WINDOW CLOSING");
+ }
+
+ @Override
+ public void windowClosed(WindowEvent e) {
+ log.debug("WINDOW CLOSED");
+ }
+
+ @Override
+ public void windowIconified(WindowEvent e) {
+ log.debug("WINDOW ICONIFIED");
+ }
+
+ @Override
+ public void windowDeiconified(WindowEvent e) {
+ }
+
+ @Override
+ public void windowActivated(WindowEvent e) {
+ log.debug("WINDOW ACTIVATED");
+ }
+
+ @Override
+ public void windowDeactivated(WindowEvent e) {
+ log.debug("WINDOW DEACTIVATED");
+ }
+
+
+
+
+
+
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index f2a8466b..583dae0f 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -882,14 +882,25 @@ public class SimpleGUI implements BKUGUIFacade {
}
@Override
- public void showHashDataInputDialog(final List signedReferences, final ActionListener okListener, final String okCommand) {
+ public void showHashDataInputDialog(final List signedReferences, boolean standalone, final ActionListener okListener, final String okCommand) {
if (signedReferences == null) {
showErrorDialog(messages.getString(ERR_NO_HASHDATA), new Object[] {"No SignedReferences provided"}, okListener, okCommand);
}
if (signedReferences.size() == 1) {
-
+
+ if (standalone) {
+ ActionListener saveHashDataListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
+ }
+ };
+ showHashDataViewer(signedReferences, saveHashDataListener, "save");
+
+ } else {
if ("text/plain".equals(signedReferences.get(0).getMimeType())) {
ActionListener saveHashDataListener = new ActionListener() {
@@ -910,7 +921,7 @@ public class SimpleGUI implements BKUGUIFacade {
} else {
showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
}
-
+ }
} else {
final HashDataTableModel tableModel = new HashDataTableModel(signedReferences);
@@ -926,6 +937,27 @@ public class SimpleGUI implements BKUGUIFacade {
}
}
+ /**
+ * TODO
+ * @param hashDataText
+ * @param saveListener
+ * @param saveCommand
+ */
+ private void showHashDataViewer(final List signedReferences, final ActionListener saveListener, final String saveCommand) {
+ log.debug("scheduling plaintext hashdatainput dialog");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("show plaintext hashdatainput dialog");
+
+ HashDataViewer.showDialog(contentPane, signedReferences, messages, saveListener, saveCommand, helpListener);
+ }
+ });
+ }
+
private void showPlainTextHashDataInputDialog(final String hashDataText, final ActionListener saveListener, final String saveCommand, final ActionListener cancelListener, final String cancelCommand) {
log.debug("scheduling plaintext hashdatainput dialog");
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 2dc03491..c47242b2 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -25,6 +25,7 @@ title.hashdata=Signaturdaten
windowtitle.save=Signaturdaten speichern
windowtitle.savedir=Signaturdaten in Verzeichnis speichern
windowtitle.overwrite=Datei \u00FCberschreiben?
+windowtitle.viewer=Signaturedaten
message.wait=Bitte warten...
message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
message.enterpin={0} eingeben
@@ -40,6 +41,7 @@ button.cancel=Abbrechen
button.back=Zur\u00FCck
button.sign=Signieren
button.save=Speichern...
+button.close=Schlie\u00DFen
mimetype.desc.xml=XML-Dateien (.xml)
mimetype.desc.html=HTML-Dateien (.html, .htm)
mimetype.desc.xhtml=XHTML-Dateien (.xhtml)
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index 3b8ac1bc..c7cc9084 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -25,6 +25,7 @@ title.hashdata=Signature data
windowtitle.save=Save signature data
windowtitle.savedir=Save signature data to directory
windowtitle.overwrite=Overwrite file?
+windowtitle.viewer=Signature data
message.wait=Please wait...
message.insertcard=Please insert your citizen-card into the reader
message.enterpin=Enter {0}
@@ -40,6 +41,7 @@ button.cancel=Cancel
button.back=Back
button.sign=Sign
button.save=Save...
+button.close=Close
mimetype.desc.xml=XML-files (.xml)
mimetype.desc.html=HTML-files (.html, .htm)
mimetype.desc.xhtml=XHTML-files (.xhtml)
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
index 2251a474..e32c9c3d 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
@@ -25,7 +25,6 @@ import java.util.Locale;
/**
*
- * @deprecated see AppletHelpListener
* @author Clemens Orthacker
*/
public class LocalHelpListener extends AbstractHelpListener {
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
index 19a56502..19e6a657 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
@@ -53,7 +53,7 @@ public class LocalSignRequestHandler extends SignRequestHandler {
*/
@SuppressWarnings("unchecked")
@Override
- public STALResponse handleRequest(STALRequest request) {
+ public STALResponse handleRequest(STALRequest request) throws InterruptedException {
if (request instanceof SignRequest) {
SignRequest signReq = (SignRequest) request;
hashDataInputs = signReq.getHashDataInput();
@@ -109,7 +109,7 @@ public class LocalSignRequestHandler extends SignRequestHandler {
log.error("dsig:SignedInfo does not contain a data reference");
throw new Exception("dsig:SignedInfo does not contain a data reference");
}
- gui.showHashDataInputDialog(selectedHashDataInputs, this, "ok");
+ gui.showHashDataInputDialog(selectedHashDataInputs, false, this, "ok");
}
private ByteArrayHashDataInput getByteArrayHashDataInput(HashDataInput hashDataInput) throws IOException {
diff --git a/BKUOnline/src/main/webapp/HTTP-ohne.html b/BKUOnline/src/main/webapp/HTTP-ohne.html
index 47c059f2..112a1d92 100644
--- a/BKUOnline/src/main/webapp/HTTP-ohne.html
+++ b/BKUOnline/src/main/webapp/HTTP-ohne.html
@@ -99,8 +99,9 @@ legend {
- external
- internal
+ Frame
+ Browser
+ Applet
\ No newline at end of file
diff --git a/STALService/src/main/java/at/gv/egiz/stal/util/HashDataInputProxy.java b/STALService/src/main/java/at/gv/egiz/stal/util/HashDataInputProxy.java
deleted file mode 100644
index 01d207d2..00000000
--- a/STALService/src/main/java/at/gv/egiz/stal/util/HashDataInputProxy.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package at.gv.egiz.stal.util;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import at.gv.egiz.bku.utils.StreamUtil;
-import at.gv.egiz.stal.HashDataInput;
-
-/**
- * Enables multiple read requests.
- * @deprecated use at.gv.egiz.stal.impl.ByteArrayHashDataInput
- */
-public class HashDataInputProxy implements HashDataInput {
-
- private static Log log = LogFactory.getLog(HashDataInputProxy.class);
-
- private HashDataInput delegate;
- private byte[] hashInput;
-
- /**
- *
- * @param delegate
- * != null
- */
- public HashDataInputProxy(HashDataInput delegate) {
- if (delegate == null) {
- throw new NullPointerException("Constructor argument must not be null");
- }
- this.delegate = delegate;
- }
-
- @Override
- public String getEncoding() {
- return delegate.getEncoding();
- }
-
- @Override
- public InputStream getHashDataInput() {
- if (hashInput == null) {
- ByteArrayOutputStream os = new ByteArrayOutputStream();
- try {
- StreamUtil.copyStream(delegate.getHashDataInput(), os);
- hashInput = os.toByteArray();
- } catch (IOException e) {
- log.error("Cannot access hashdatainput stream", e);
- hashInput = new byte[0];
- }
- }
- return new ByteArrayInputStream(hashInput);
- }
-
- @Override
- public String getMimeType() {
- return delegate.getMimeType();
- }
-
- @Override
- public String getReferenceId() {
- return delegate.getReferenceId();
- }
-
-}
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/HashDataInputDisplay.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/HashDataInputDisplay.java
index f79a2027..59700d4a 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/HashDataInputDisplay.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/HashDataInputDisplay.java
@@ -1,6 +1,18 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
*/
package at.gv.egiz.bku.smccstal;
@@ -14,7 +26,11 @@ import java.util.List;
*/
public interface HashDataInputDisplay {
+
/**
+ * TODO: (see AbstractHelpListener)
+ *
+ *
* Displays the hashdata inputs for all provided dsig:SignedReferences.
* Implementations may verify the digest value if necessary.
* (LocalSignRequestHandler operates on DataObjectHashDataInput,
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
index 6c30a68a..77ee45b6 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
@@ -192,7 +192,7 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen
- class STALPinProvider implements PINProvider, ActionListener {
+ class STALPinProvider implements PINProvider {
protected SignedInfoType signedInfo;
protected List hashDataInputs;
@@ -230,10 +230,10 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen
displayHashDataInputs(signedInfo.getReference());
} catch (DigestException ex) {
log.error("Bad digest value: " + ex.getMessage());
- gui.showErrorDialog(BKUGUIFacade.ERR_INVALID_HASH, new Object[] {ex.getMessage()});
+ gui.showErrorDialog(BKUGUIFacade.ERR_INVALID_HASH, new Object[] {ex.getMessage()}, SignRequestHandler.this, "error");
} catch (Exception ex) {
log.error("Could not display hashdata inputs: " + ex.getMessage());
- gui.showErrorDialog(BKUGUIFacade.ERR_DISPLAY_HASHDATA, new Object[] {ex.getMessage()}, SignRequestHandler.this, "ok");
+ gui.showErrorDialog(BKUGUIFacade.ERR_DISPLAY_HASHDATA, new Object[] {ex.getMessage()}, SignRequestHandler.this, "error");
}
// OLD HASHDATA DISPLAY (in applet),
@@ -261,13 +261,15 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen
return new String(gui.getPin());
} else if (actionCommand.equals("ok")) {
showSignaturePINDialog(spec, retries);
+ } else if (actionCommand.equals("error")) {
+ return null;
}
} while (true);
}
- @Override
- public void actionPerformed(ActionEvent e) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
+// @Override
+// public void actionPerformed(ActionEvent e) {
+// throw new UnsupportedOperationException("Not supported yet.");
+// }
}
}
--
cgit v1.2.3
From 547d2ac46ea1feb323fd945de690b8ee0ca9c5f3 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Thu, 13 Nov 2008 18:33:03 +0000
Subject: FRAME HashDataDisplay FRAME Help
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@167 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java | 3 +++
1 file changed, 3 insertions(+)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java
index cd04ad98..e643c876 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java
@@ -151,6 +151,9 @@ public class ViewerDialog extends JDialog
InputStream content = hashData.getHashDataInput();
String mimeType = hashData.getMimeType();
String encoding = hashData.getEncoding();
+ if (encoding == null) {
+ encoding = "UTF-8";
+ }
JPanel hashDataPanel = createViewerPanel(messages.getString(BKUGUIFacade.MESSAGE_HASHDATA), content, mimeType, encoding, helpListener);
JPanel buttonPanel = createButtonPanel(saveListener, saveCommand);
--
cgit v1.2.3
From fef61ddc786960015c6fc416d4ad2d5d0f2048d1 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Thu, 13 Nov 2008 20:56:23 +0000
Subject: bugfix openwindow blocked bugfix helpTopic always hashdataviewer
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@168 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../at/gv/egiz/bku/online/applet/BKUApplet.java | 2 +-
.../bku/online/applet/DefaultHelpListener.java | 38 +--
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 1 +
.../java/at/gv/egiz/bku/gui/HashDataViewer.java | 288 +++++++++++++++++
.../java/at/gv/egiz/bku/gui/HelpMouseListener.java | 10 +-
.../main/java/at/gv/egiz/bku/gui/HelpViewer.java | 211 ++++++++++++
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 3 +-
.../main/java/at/gv/egiz/bku/gui/ViewerDialog.java | 357 ---------------------
.../at/gv/egiz/bku/gui/Messages.properties | 1 +
.../at/gv/egiz/bku/gui/Messages_en.properties | 1 +
.../gv/egiz/bku/local/gui/LocalHelpListener.java | 2 +-
.../at/gv/egiz/bku/local/stal/BKUGuiProxy.java | 18 +-
12 files changed, 531 insertions(+), 401 deletions(-)
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
delete mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index b4407b22..4b49c5d5 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -90,7 +90,7 @@ public class BKUApplet extends JApplet implements AppletParameterProvider {
try {
URL helpURL = getURLParameter(HELP_URL); //, getAppletParameter(SESSION_ID));
// helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale());
- helpListener = new DefaultHelpListener(helpURL, getLocale());
+ helpListener = new DefaultHelpListener(getAppletContext(), helpURL, getLocale());
} catch (MalformedURLException ex) {
log.warn("failed to load help URL, disabling help: " + ex.getMessage());
}
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java
index 9876ef7e..6eec5665 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java
@@ -16,49 +16,28 @@
*/
package at.gv.egiz.bku.online.applet;
+import at.gv.egiz.bku.gui.HelpViewer;
import at.gv.egiz.bku.gui.AbstractHelpListener;
-import at.gv.egiz.bku.gui.ViewerDialog;
-import java.io.InputStream;
+import java.applet.AppletContext;
import java.net.URL;
-import java.net.URLConnection;
import java.util.Locale;
import javax.swing.SwingUtilities;
/**
- * This class depends on BKU utils, and therefore is not part of BKUCommonGUI
*
* @author Clemens Orthacker
*/
public class DefaultHelpListener extends AbstractHelpListener {
- public DefaultHelpListener(URL helpURL, Locale locale) {
+ protected AppletContext ctx;
+
+ public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) {
super(helpURL, locale);
+ this.ctx = ctx;
}
@Override
- public void showDocument(URL helpURL, final String helpTopic) throws Exception {
- log.debug("open connection " + helpURL);
- URLConnection conn = helpURL.openConnection();
-
- log.debug("show help document " + conn.getContentType()); // + ";" + conn.getContentEncoding());
-
-// Charset cs;
-// if (conn.getContentEncoding() == null) {
-// cs = Charset.forName("UTF-8");
-// } else {
-// try {
-// cs = Charset.forName(conn.getContentEncoding());
-// } catch (Exception ex) {
-// log.debug("charset " + conn.getContentEncoding() + " not supported, assuming UTF-8: " + ex.getMessage());
-// cs = Charset.forName("UTF-8");
-// }
-// }
-
-// InputStreamReader isr = new InputStreamReader(conn.getInputStream(), cs);
-// final Reader content = new BufferedReader(isr);
- final InputStream content = conn.getInputStream();
- final String mimeType = conn.getContentType();
-
+ public void showDocument(final URL helpURL, final String helpTopic) throws Exception {
log.debug("schedule help dialog");
SwingUtilities.invokeLater(new Runnable() {
@@ -68,10 +47,9 @@ public class DefaultHelpListener extends AbstractHelpListener {
log.debug("show help dialog");
- ViewerDialog.showHelp(null, helpTopic, content, mimeType, messages);
+ HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages);
}
});
-// gui.showHelpDialog(helpDocument.getStream(), mimetype, encoding);
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 2daf3300..c7032f90 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -38,6 +38,7 @@ public interface BKUGUIFacade {
public static final String ERR_CARD_LOCKED = "error.card.locked";
public static final String ERR_CARD_NOTACTIVATED = "error.card.notactivated";
public static final String ERR_VIEWER = "error.viewer";
+ public static final String ERR_EXTERNAL_LINK = "error.external.link";
public static final String MESSAGES_BUNDLE = "at/gv/egiz/bku/gui/Messages";
public static final String DEFAULT_BACKGROUND = "/images/BackgroundChipperling.png";
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
new file mode 100644
index 00000000..8883098a
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
@@ -0,0 +1,288 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import at.gv.egiz.stal.HashDataInput;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.io.BufferedReader;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.nio.charset.Charset;
+import java.text.MessageFormat;
+import java.util.List;
+import java.util.ResourceBundle;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.LayoutStyle;
+import javax.swing.text.Document;
+import javax.swing.text.EditorKit;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class HashDataViewer extends JDialog
+ implements ActionListener {
+
+ public static final String PLAINTEXT_FONT = "Monospaced";
+ protected static final Log log = LogFactory.getLog(HashDataViewer.class);
+
+ private static HashDataViewer dialog;
+
+ protected ResourceBundle messages;
+
+ /**
+ *
+ * @param signedReferences currently, only one hashdata input (the first in the list) is displayed
+ */
+ public static void showHashDataInput(List hashDataInputs,
+ ResourceBundle messages,
+ ActionListener saveListener,
+ String saveCommand,
+ ActionListener helpListener) {
+ showHashDataInput(null, hashDataInputs, messages, saveListener, saveCommand, helpListener);
+ }
+
+ /**
+ *
+ * @param frameComp owner
+ */
+ public static void showHashDataInput(Component frameComp,
+ List hashDataInputs,
+ ResourceBundle messages,
+ ActionListener saveListener,
+ String saveCommand,
+ ActionListener helpListener) {
+
+ Frame frame = null;
+ if (frameComp != null) {
+ JOptionPane.getFrameForComponent(frameComp);
+ }
+ dialog = new HashDataViewer(frame,
+ messages,
+ hashDataInputs,
+ saveListener,
+ saveCommand,
+ helpListener);
+ dialog.setVisible(true);
+ }
+
+ private HashDataViewer(Frame frame,
+ ResourceBundle messages,
+ List hashDataInputs,
+ ActionListener saveListener,
+ String saveCommand,
+ ActionListener helpListener) {
+ super(frame, messages.getString(BKUGUIFacade.WINDOWTITLE_VIEWER), true);
+ this.messages = messages;
+
+ HashDataInput hashData = hashDataInputs.get(0);
+
+ Charset cs;
+ if (hashData.getEncoding() == null) {
+ cs = Charset.forName("UTF-8");
+ } else {
+ try {
+ cs = Charset.forName(hashData.getEncoding());
+ } catch (Exception ex) {
+ log.debug("charset " + hashData.getEncoding() + " not supported, assuming UTF-8: " + ex.getMessage());
+ cs = Charset.forName("UTF-8");
+ }
+ }
+
+
+ InputStreamReader isr = new InputStreamReader(hashData.getHashDataInput(), cs);
+ Reader content = new BufferedReader(isr);
+
+ JPanel hashDataPanel = createViewerPanel(
+ messages.getString(BKUGUIFacade.MESSAGE_HASHDATA),
+ content,
+ hashData.getMimeType(),
+ helpListener);
+ JPanel buttonPanel = createButtonPanel(saveListener, saveCommand);
+ initContentPane(new Dimension(600, 400), hashDataPanel, buttonPanel);
+
+ pack();
+ if (frame != null) {
+ setLocationRelativeTo(frame);
+ } else {
+ setLocationByPlatform(true);
+ }
+ }
+
+ private void initContentPane(Dimension preferredSize, JPanel viewerPanel, JPanel buttonPanel) {
+ Container contentPane = getContentPane();
+ contentPane.setPreferredSize(preferredSize);
+
+ GroupLayout mainLayout = new GroupLayout(contentPane);
+ contentPane.setLayout(mainLayout);
+
+ mainLayout.setHorizontalGroup(
+ mainLayout.createSequentialGroup().addContainerGap().addGroup(
+ mainLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap());
+ mainLayout.setVerticalGroup(
+ mainLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addContainerGap());
+ }
+
+ /**
+ *
+ * @param messages
+ * @param content
+ * @param mimeType defaults to text/plain if null
+ * @param encoding must be null if document contains charset declaration (e.g. HTML page), otherwise the parser crashes
+ * @param helpListener may be null
+ * @return
+ */
+ private JPanel createViewerPanel(String viewerLabelText,
+ Reader content,
+ String mimeType,
+ final ActionListener helpListener) {
+ log.debug("viewer dialog: " + mimeType);
+
+ if (mimeType == null) {
+ mimeType = "text/plain";
+ } else if ("application/xhtml+xml".equals(mimeType)) {
+ mimeType = "text/html";
+ }
+
+ JEditorPane viewer = new JEditorPane();
+ viewer.setEditable(false);
+ viewer.setContentType(mimeType);
+ if ("text/plain".equals(mimeType)) {
+ viewer.setFont(new Font(PLAINTEXT_FONT, viewer.getFont().getStyle(), viewer.getFont().getSize()));
+ }
+
+ EditorKit editorKit = viewer.getEditorKit();
+ Document document = editorKit.createDefaultDocument();
+// document.putProperty("IgnoreCharsetDirective", new Boolean(true));
+
+ try {
+ viewer.read(content, document);
+ content.close();
+ } catch (Exception ex) {
+ log.error(ex.getMessage(), ex);
+ String p = messages.getString(BKUGUIFacade.ERR_VIEWER);
+ viewer.setText(MessageFormat.format(p, ex.getMessage()));
+ }
+
+ JScrollPane scrollPane = new JScrollPane(viewer);
+ scrollPane.setPreferredSize(viewer.getPreferredSize());
+ scrollPane.setAlignmentX(LEFT_ALIGNMENT);
+ viewer.setCaretPosition(0);
+
+ JLabel viewerLabel = new JLabel();
+ viewerLabel.setText(viewerLabelText);
+ viewerLabel.setFont(viewerLabel.getFont().deriveFont(viewerLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ viewerLabel.setLabelFor(viewer);
+
+ JPanel viewerPanel = new JPanel();
+ GroupLayout viewerPanelLayout = new GroupLayout(viewerPanel);
+ viewerPanel.setLayout(viewerPanelLayout);
+
+ if (helpListener != null) {
+ JLabel helpLabel = new JLabel();
+ helpLabel.setIcon(new ImageIcon(getClass().getResource(BKUGUIFacade.HELP_IMG)));
+ helpLabel.addMouseListener(new MouseAdapter() {
+
+ @Override
+ public void mouseClicked(MouseEvent arg0) {
+ ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, BKUGUIFacade.HELP_HASHDATAVIEWER);
+ helpListener.actionPerformed(e);
+ }
+ });
+ helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ viewerPanelLayout.setHorizontalGroup(
+ viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(viewerPanelLayout.createSequentialGroup().addComponent(viewerLabel).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE).addComponent(helpLabel)).addComponent(scrollPane)); //, 0, 0, Short.MAX_VALUE));
+ viewerPanelLayout.setVerticalGroup(
+ viewerPanelLayout.createSequentialGroup()
+ .addGroup(viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(viewerLabel)
+ .addComponent(helpLabel))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(scrollPane));
+ } else {
+ viewerPanelLayout.setHorizontalGroup(
+ viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(viewerLabel)
+ .addComponent(scrollPane));
+ viewerPanelLayout.setVerticalGroup(
+ viewerPanelLayout.createSequentialGroup()
+ .addComponent(viewerLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(scrollPane));
+
+ }
+
+ return viewerPanel;
+ }
+
+ private JPanel createButtonPanel(ActionListener saveListener, String saveCommand) {
+ JButton closeButton = new JButton();
+ closeButton.setText(messages.getString(BKUGUIFacade.BUTTON_CLOSE));
+ closeButton.addActionListener(this);
+
+ JButton saveButton = new JButton();
+ saveButton.setText(messages.getString(BKUGUIFacade.BUTTON_SAVE));
+ saveButton.setActionCommand(saveCommand);
+ saveButton.addActionListener(saveListener);
+
+ int buttonSize = closeButton.getPreferredSize().width;
+ if (saveButton.getPreferredSize().width > buttonSize) {
+ buttonSize = saveButton.getPreferredSize().width;
+ }
+
+ JPanel buttonPanel = new JPanel();
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createSequentialGroup().addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(saveButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(closeButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(saveButton).addComponent(closeButton));
+
+ return buttonPanel;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ HashDataViewer.dialog.setVisible(false);
+ }
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
index 531884d1..b7bbe971 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpMouseListener.java
@@ -28,23 +28,27 @@ public class HelpMouseListener extends MouseAdapter {
protected static final Log log = LogFactory.getLog(HelpMouseListener.class);
- protected ActionListener externalHelpListener;
+ protected ActionListener helpListener;
protected String locale;
protected String topic;
public HelpMouseListener(ActionListener externalHelpListener) {
super();
- this.externalHelpListener = externalHelpListener;
+ this.helpListener = externalHelpListener;
}
public void setHelpTopic(String topic) {
log.trace("setting help topic: " + topic);
this.topic = topic;
}
+
+ public ActionListener getActionListener() {
+ return helpListener;
+ }
@Override
public void mouseClicked(MouseEvent arg0) {
ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, topic);
- externalHelpListener.actionPerformed(e);
+ helpListener.actionPerformed(e);
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
new file mode 100644
index 00000000..42ca2090
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import at.gv.egiz.bku.gui.*;
+import java.applet.AppletContext;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.IOException;
+import java.net.URL;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import javax.swing.GroupLayout;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JEditorPane;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.LayoutStyle;
+import javax.swing.SwingUtilities;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class HelpViewer extends JDialog
+ implements ActionListener {
+
+ protected static final Log log = LogFactory.getLog(HelpViewer.class);
+ private static HelpViewer dialog;
+ protected ResourceBundle messages;
+ protected AppletContext ctx;
+
+ /**
+ *
+ * @param ctx external links are opened via ctx.showDocument()
+ * @param helpURL
+ * @param helpTopic
+ * @param messages
+ */
+ public static void showHelpDialog(AppletContext ctx,
+ URL helpURL,
+ String helpTopic,
+ ResourceBundle messages) {
+ showHelpDialog(null, ctx, helpURL, helpTopic, messages);
+ }
+
+ public static void showHelpDialog(URL helpURL,
+ String helpTopic,
+ ResourceBundle messages) {
+ showHelpDialog(null, null, helpURL, helpTopic, messages);
+ }
+
+ public static void showHelpDialog(Component owner,
+ AppletContext ctx,
+ URL helpURL,
+ String helpTopic,
+ ResourceBundle messages) {
+
+ Frame frame = null;
+ if (owner != null) {
+ JOptionPane.getFrameForComponent(owner);
+ }
+ dialog = new HelpViewer(frame, messages, ctx, helpURL, helpTopic);
+ dialog.setVisible(true);
+ }
+
+ private HelpViewer(Frame frame,
+ ResourceBundle messages,
+ AppletContext ctx,
+ URL helpURL,
+ String helpTopic) {
+ super(frame, messages.getString(BKUGUIFacade.WINDOWTITLE_HELP), true);
+ this.messages = messages;
+ this.ctx = ctx;
+
+ String p = messages.getString(BKUGUIFacade.MESSAGE_HELP);
+ String helpItem = messages.getString(helpTopic);
+ String viewerLabel = MessageFormat.format(p, new Object[]{helpItem});
+
+ JPanel helpPanel = createViewerPanel(viewerLabel, helpURL);
+ JPanel buttonPanel = createButtonPanel();
+
+ initContentPane(new Dimension(600, 400), helpPanel, buttonPanel);
+ pack();
+ if (frame != null) {
+ setLocationRelativeTo(frame);
+ } else {
+ setLocationByPlatform(true);
+ }
+ }
+
+ private void initContentPane(Dimension preferredSize, JPanel viewerPanel, JPanel buttonPanel) {
+ Container contentPane = getContentPane();
+ contentPane.setPreferredSize(preferredSize);
+
+ GroupLayout mainLayout = new GroupLayout(contentPane);
+ contentPane.setLayout(mainLayout);
+
+ mainLayout.setHorizontalGroup(
+ mainLayout.createSequentialGroup().addContainerGap().addGroup(
+ mainLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap());
+ mainLayout.setVerticalGroup(
+ mainLayout.createSequentialGroup().addContainerGap().addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addContainerGap());
+ }
+
+ private JPanel createViewerPanel(String viewerLabelText, URL helpURL) {
+ log.debug("viewer dialog: " + helpURL.toString());
+
+ final JEditorPane viewer = new JEditorPane();
+ viewer.setEditable(false);
+ try {
+ viewer.setPage(helpURL);
+ viewer.addHyperlinkListener(new HyperlinkListener() {
+
+ @Override
+ public void hyperlinkUpdate(HyperlinkEvent e) {
+ final URL url = e.getURL();
+ if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
+ if (ctx != null) {
+ log.debug("open external link in help viewer: " + url);
+ ctx.showDocument(url, "_blank");
+ } else {
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ String msgP = messages.getString(BKUGUIFacade.ERR_EXTERNAL_LINK);
+ String msg = MessageFormat.format(msgP, url);
+ String title = messages.getString(BKUGUIFacade.TITLE_ERROR);
+ JOptionPane.showMessageDialog(rootPane, msg, title, JOptionPane.ERROR_MESSAGE);
+ }
+ });
+ }
+ }
+ }
+ });
+ } catch (IOException ex) {
+ String p = messages.getString(BKUGUIFacade.ERR_VIEWER);
+ viewer.setText(MessageFormat.format(p, new Object[]{ex.getMessage()}));
+ }
+
+ JScrollPane scrollPane = new JScrollPane(viewer);
+ scrollPane.setPreferredSize(viewer.getPreferredSize());
+ scrollPane.setAlignmentX(LEFT_ALIGNMENT);
+ viewer.setCaretPosition(0);
+
+ JLabel viewerLabel = new JLabel();
+ viewerLabel.setText(viewerLabelText);
+ viewerLabel.setFont(viewerLabel.getFont().deriveFont(viewerLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ viewerLabel.setLabelFor(viewer);
+
+ JPanel viewerPanel = new JPanel();
+ GroupLayout viewerPanelLayout = new GroupLayout(viewerPanel);
+ viewerPanel.setLayout(viewerPanelLayout);
+
+ viewerPanelLayout.setHorizontalGroup(
+ viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(viewerLabel).addComponent(scrollPane));
+ viewerPanelLayout.setVerticalGroup(
+ viewerPanelLayout.createSequentialGroup().addComponent(viewerLabel).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(scrollPane));
+
+ return viewerPanel;
+ }
+
+ private JPanel createButtonPanel() {
+ JButton closeButton = new JButton();
+ closeButton.setText(messages.getString(BKUGUIFacade.BUTTON_CLOSE));
+ closeButton.addActionListener(this);
+
+ JPanel buttonPanel = new JPanel();
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createSequentialGroup().addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(closeButton));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createSequentialGroup().addComponent(closeButton));
+ return buttonPanel;
+ }
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ HelpViewer.dialog.setVisible(false);
+ }
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index 6250dd0e..a810d34c 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -954,7 +954,8 @@ public class SimpleGUI implements BKUGUIFacade {
log.debug("show plaintext hashdatainput dialog");
- ViewerDialog.showHashDataInput(contentPane, signedReferences, messages, saveListener, saveCommand, helpListener);
+ ActionListener l = helpListener.getActionListener();
+ HashDataViewer.showHashDataInput(contentPane, signedReferences, messages, saveListener, saveCommand, l);
}
});
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java
deleted file mode 100644
index e643c876..00000000
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ViewerDialog.java
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package at.gv.egiz.bku.gui;
-
-import at.gv.egiz.stal.HashDataInput;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.Frame;
-import java.awt.Point;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.Reader;
-import java.net.URL;
-import java.net.URLConnection;
-import java.nio.charset.Charset;
-import java.text.MessageFormat;
-import java.util.List;
-import java.util.ResourceBundle;
-import javax.swing.GroupLayout;
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JEditorPane;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.LayoutStyle;
-import javax.swing.text.Document;
-import javax.swing.text.EditorKit;
-import javax.swing.text.html.HTMLDocument;
-import javax.swing.text.html.HTMLEditorKit;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-/**
- *
- * @author Clemens Orthacker
- */
-public class ViewerDialog extends JDialog
- implements ActionListener {
-
- public static final String PLAINTEXT_FONT = "Monospaced";
- protected static final Log log = LogFactory.getLog(ViewerDialog.class);
-// private ViewerDialog dialog;
-
- protected ResourceBundle messages;
-
- /**
- *
- * @param frameComp
- * @param signedReferences currently, only one hashdata input (the first in the list) is displayed
- * @param messages
- * @param saveListener
- * @param saveCommand
- * @param helpListener
- */
- public static void showHashDataInput(Component frameComp,
- List hashDataInputs,
- ResourceBundle messages,
- ActionListener saveListener,
- String saveCommand,
- HelpMouseListener helpListener) {
-
- Frame frame = null;
- if (frameComp != null) {
- JOptionPane.getFrameForComponent(frameComp);
- }
- ViewerDialog viewer = new ViewerDialog(frame,
- messages,
- hashDataInputs,
- saveListener,
- saveCommand,
- helpListener);
- viewer.setVisible(true);
- }
-
- public static void showHelp(Component frameComp,
- String helpTopic,
-// Reader helpDocument,
- InputStream helpDocument,
- String mimeType,
- ResourceBundle messages) {
-
- Frame frame = null;
- if (frameComp != null) {
- JOptionPane.getFrameForComponent(frameComp);
- }
- ViewerDialog viewer = new ViewerDialog(frame, messages, helpTopic, helpDocument, mimeType);
- viewer.setVisible(true);
- }
-
- /**
- * TODO make encoding aware!
- * @param frame
- * @param title
- * @param messages
- * @param hashDataInputs
- * @param saveListener
- * @param saveCommand
- * @param helpListener
- */
- private ViewerDialog(Frame frame,
- ResourceBundle messages,
- List hashDataInputs,
- ActionListener saveListener,
- String saveCommand,
- HelpMouseListener helpListener) {
- super(frame, messages.getString(BKUGUIFacade.WINDOWTITLE_VIEWER), true);
- this.messages = messages;
-
- HashDataInput hashData = hashDataInputs.get(0);
-
-// Charset cs;
-// if (hashData.getEncoding() == null) {
-// cs = Charset.forName("UTF-8");
-// } else {
-// try {
-// cs = Charset.forName(hashData.getEncoding());
-// } catch (Exception ex) {
-// log.debug("charset " + hashData.getEncoding() + " not supported, assuming UTF-8: " + ex.getMessage());
-// cs = Charset.forName("UTF-8");
-// }
-// }
-
-// InputStreamReader isr = new InputStreamReader(hashData.getHashDataInput(), cs);
-// Reader content = new BufferedReader(isr);
- InputStream content = hashData.getHashDataInput();
- String mimeType = hashData.getMimeType();
- String encoding = hashData.getEncoding();
- if (encoding == null) {
- encoding = "UTF-8";
- }
-
- JPanel hashDataPanel = createViewerPanel(messages.getString(BKUGUIFacade.MESSAGE_HASHDATA), content, mimeType, encoding, helpListener);
- JPanel buttonPanel = createButtonPanel(saveListener, saveCommand);
- initContentPane(new Dimension(600, 400), hashDataPanel, buttonPanel);
-
- pack();
- if (frame != null) {
- setLocationRelativeTo(frame);
- } else {
- setLocationByPlatform(true);
- }
- }
-
- private ViewerDialog(Frame frame,
- ResourceBundle messages,
- String helpTopic,
-// Reader helpDocument,
- InputStream helpDocument,
- String mimeType) {
- super(frame, messages.getString(BKUGUIFacade.WINDOWTITLE_HELP), true);
- this.messages = messages;
-
- String p = messages.getString(BKUGUIFacade.MESSAGE_HELP);
- String helpItem = messages.getString(helpTopic);
- String viewerLabel = MessageFormat.format(p, new Object[] {helpItem});
-
- JPanel helpPanel = createViewerPanel(viewerLabel, helpDocument, mimeType, null, null);
- JPanel buttonPanel = createButtonPanel();
-
- initContentPane(new Dimension(600, 400), helpPanel, buttonPanel);
- pack();
- if (frame != null) {
- setLocationRelativeTo(frame);
- } else {
- setLocationByPlatform(true);
- }
- }
-
- private void initContentPane(Dimension preferredSize, JPanel viewerPanel, JPanel buttonPanel) {
- Container contentPane = getContentPane();
- contentPane.setPreferredSize(preferredSize);
-
- GroupLayout mainLayout = new GroupLayout(contentPane);
- contentPane.setLayout(mainLayout);
-
- mainLayout.setHorizontalGroup(
- mainLayout.createSequentialGroup().addContainerGap().addGroup(
- mainLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)).addContainerGap());
- mainLayout.setVerticalGroup(
- mainLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(viewerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(buttonPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addContainerGap());
- }
-
- /**
- *
- * @param messages
- * @param content
- * @param mimeType defaults to text/plain if null
- * @param encoding must be null if document contains charset declaration (e.g. HTML page), otherwise the parser crashes
- * @param helpListener may be null
- * @return
- */
- private JPanel createViewerPanel(String viewerLabelText, InputStream content, String mimeType, String encoding, HelpMouseListener helpListener) {
- log.debug("viewer dialog: " + mimeType);
-
- if (mimeType == null) {
- mimeType = "text/plain";
- } else if ("application/xhtml+xml".equals(mimeType)) {
- mimeType = "text/html";
- }
-
- JEditorPane viewer = new JEditorPane();
- viewer.setEditable(false);
- viewer.setContentType(mimeType);
- if ("text/plain".equals(mimeType)) {
- viewer.setFont(new Font(PLAINTEXT_FONT, viewer.getFont().getStyle(), viewer.getFont().getSize()));
- }
-
- EditorKit editorKit = viewer.getEditorKit();
- Document document = editorKit.createDefaultDocument();
-// document.putProperty("IgnoreCharsetDirective", new Boolean(true));
-
- try {
- if (encoding != null) {
- BufferedReader contentReader = new BufferedReader(new InputStreamReader(content, encoding));
- viewer.read(contentReader, document);
- contentReader.close();
- } else {
- // charset declaration in content
- viewer.read(content, document);
- content.close();
- }
- } catch (Exception ex) {
- log.error(ex.getMessage(), ex);
- String p = messages.getString(BKUGUIFacade.ERR_VIEWER);
- viewer.setText(MessageFormat.format(p, ex.getMessage()));
- }
-
- JScrollPane scrollPane = new JScrollPane(viewer);
- scrollPane.setPreferredSize(viewer.getPreferredSize());
- scrollPane.setAlignmentX(LEFT_ALIGNMENT);
- viewer.setCaretPosition(0);
-
- JLabel viewerLabel = new JLabel();
- viewerLabel.setText(viewerLabelText);
- viewerLabel.setFont(viewerLabel.getFont().deriveFont(viewerLabel.getFont().getStyle() | java.awt.Font.BOLD));
- viewerLabel.setLabelFor(viewer);
-
- JPanel viewerPanel = new JPanel();
- GroupLayout viewerPanelLayout = new GroupLayout(viewerPanel);
- viewerPanel.setLayout(viewerPanelLayout);
-
- if (helpListener != null) {
- JLabel helpLabel = new JLabel();
- helpListener.setHelpTopic(BKUGUIFacade.HELP_HASHDATAVIEWER);
- helpLabel.setIcon(new ImageIcon(getClass().getResource(BKUGUIFacade.HELP_IMG)));
- helpLabel.addMouseListener(helpListener);
- helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- viewerPanelLayout.setHorizontalGroup(
- viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(viewerPanelLayout.createSequentialGroup().addComponent(viewerLabel).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE).addComponent(helpLabel)).addComponent(scrollPane)); //, 0, 0, Short.MAX_VALUE));
- viewerPanelLayout.setVerticalGroup(
- viewerPanelLayout.createSequentialGroup()
- .addGroup(viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(viewerLabel)
- .addComponent(helpLabel))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(scrollPane));
- } else {
- viewerPanelLayout.setHorizontalGroup(
- viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(viewerLabel)
- .addComponent(scrollPane));
- viewerPanelLayout.setVerticalGroup(
- viewerPanelLayout.createSequentialGroup()
- .addComponent(viewerLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(scrollPane));
-
- }
-
- return viewerPanel;
- }
-
- private JPanel createButtonPanel() {
- JButton closeButton = new JButton();
- closeButton.setText(messages.getString(BKUGUIFacade.BUTTON_CLOSE));
- closeButton.addActionListener(this);
-
- JPanel buttonPanel = new JPanel();
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- buttonPanelLayout.setHorizontalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(closeButton));
- buttonPanelLayout.setVerticalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addComponent(closeButton));
- return buttonPanel;
- }
-
- private JPanel createButtonPanel(ActionListener saveListener, String saveCommand) {
- JButton closeButton = new JButton();
- closeButton.setText(messages.getString(BKUGUIFacade.BUTTON_CLOSE));
- closeButton.addActionListener(this);
-
- JButton saveButton = new JButton();
- saveButton.setText(messages.getString(BKUGUIFacade.BUTTON_SAVE));
- saveButton.setActionCommand(saveCommand);
- saveButton.addActionListener(saveListener);
-
- int buttonSize = closeButton.getPreferredSize().width;
- if (saveButton.getPreferredSize().width > buttonSize) {
- buttonSize = saveButton.getPreferredSize().width;
- }
-
- JPanel buttonPanel = new JPanel();
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
-
- buttonPanelLayout.setHorizontalGroup(
- buttonPanelLayout.createSequentialGroup().addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE).addComponent(saveButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(closeButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
- buttonPanelLayout.setVerticalGroup(
- buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(saveButton).addComponent(closeButton));
-
- return buttonPanel;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-// if ("close".equals(e.getActionCommand())) {
-// ViewerDialog.dialog.setVisible(false);
-// HashDataViewer.dialog.dispose();
- this.setVisible(false);
- }
-}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index ba20471d..6c049c85 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -67,6 +67,7 @@ error.test=Fehler1 {0} - Fehler2 {1}
error.card.locked=B\u00FCrgerkarte ist gesperrt
error.card.notactivated=B\u00FCrgerkartenfunktion ist nicht aktiviert
error.viewer=Der Inhalt kann nicht dargestellt werden: {0}
+error.external.link=Externer Link {0} wird nicht ge\u00F6ffnet
# Help Topics
help.welcome=Startseite
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index edc5371d..80dc4234 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -65,6 +65,7 @@ error.test=Error1 {0} - Error2 {1}
error.card.locked=Citizen-card is locked
error.card.notactivated=Citizen-card not activated
error.viewer=Failed to display contents: {0}
+error.external.link=Externer Link {0} wird nicht ge\u00F6ffnet
# Help Topics
help.welcome=Welcome page
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
index e32c9c3d..d551ae0d 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java
@@ -39,7 +39,7 @@ public class LocalHelpListener extends AbstractHelpListener {
}
@Override
- public void showDocument(URL helpDocument) throws IOException, URISyntaxException {
+ public void showDocument(URL helpDocument, String helpTopic) throws IOException, URISyntaxException {
if (desktop == null) {
log.error("Failed to open default browser: Desktop API not available (libgnome installed?)");
} else {
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
index 39e997b7..fb8f2432 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
@@ -84,14 +84,6 @@ public class BKUGuiProxy implements BKUGUIFacade {
delegate.showErrorDialog(errorMsgKey, errorMsgParams);
}
- @Override
- public void showHashDataInputDialog(List signedReferences,
- ActionListener okListener, String actionCommand) {
- showDialog();
- delegate.showHashDataInputDialog(signedReferences, okListener,
- actionCommand);
- }
-
@Override
public void showInsertCardDialog(ActionListener cancelListener,
String actionCommand) {
@@ -131,4 +123,14 @@ public class BKUGuiProxy implements BKUGUIFacade {
showDialog();
delegate.showWelcomeDialog();
}
+
+ @Override
+ public void showHashDataInputDialog(List signedReferences,
+ boolean externalDisplay,
+ ActionListener okListener,
+ String okCommand) {
+ showDialog();
+ delegate.showHashDataInputDialog(signedReferences, externalDisplay, okListener,
+ okCommand);
+ }
}
--
cgit v1.2.3
From f09efb78459c7cd49ca4e28d92f170833e7ee32d Mon Sep 17 00:00:00 2001
From: clemenso
Date: Fri, 14 Nov 2008 16:30:28 +0000
Subject: git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@172
8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../gv/egiz/bku/online/applet/AppletBKUWorker.java | 1 -
.../at/gv/egiz/bku/online/applet/BKUApplet.java | 5 +-
.../bku/online/applet/DefaultHelpListener.java | 55 --------------
BKUApplet/src/test/resources/appletTest.html | 4 +-
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 1 +
.../at/gv/egiz/bku/gui/DefaultHelpListener.java | 62 ++++++++++++++++
.../java/at/gv/egiz/bku/gui/HashDataViewer.java | 15 +++-
.../main/java/at/gv/egiz/bku/gui/HelpViewer.java | 5 +-
.../main/java/at/gv/egiz/bku/gui/ImagePanel.java | 4 +-
.../main/java/at/gv/egiz/bku/gui/SimpleGUI.java | 6 ++
.../egiz/bku/gui/html/RestrictedHTMLEditorKit.java | 49 +++++++++++++
.../gv/egiz/bku/gui/html/RestrictedImageView.java | 67 +++++++++++++++++
.../at/gv/egiz/bku/gui/Messages.properties | 4 +-
.../at/gv/egiz/bku/gui/Messages_en.properties | 3 +-
BKUCommonGUI/src/main/resources/images/help.png | Bin 303 -> 441 bytes
.../src/main/resources/images/help_orig.png | Bin 0 -> 303 bytes
.../at/gv/egiz/bku/local/stal/SMCCSTALFactory.java | 7 +-
BKULocal/src/main/webapp/WEB-INF/web.xml | 40 ++++++----
BKULocal/src/main/webapp/help.jsp | 29 ++++++++
.../webapp/helpfiles/de/error.card.locked.html | 46 ++++++++++++
.../main/webapp/helpfiles/de/error.card.locked.png | Bin 0 -> 1325 bytes
.../helpfiles/de/error.card.notactivated.html | 43 +++++++++++
.../helpfiles/de/error.card.notactivated.png | Bin 0 -> 1419 bytes
.../webapp/helpfiles/de/error.cardterminal.html | 42 +++++++++++
.../webapp/helpfiles/de/error.cardterminal.png | Bin 0 -> 1490 bytes
.../src/main/webapp/helpfiles/de/error.pcsc.html | 40 ++++++++++
.../src/main/webapp/helpfiles/de/error.pcsc.png | Bin 0 -> 3684 bytes
.../webapp/helpfiles/de/error.ws.unreachable.html | 39 ++++++++++
.../webapp/helpfiles/de/error.ws.unreachable.png | Bin 0 -> 2561 bytes
.../webapp/helpfiles/de/help.cardnotsupported.html | 47 ++++++++++++
.../webapp/helpfiles/de/help.cardnotsupported.png | Bin 0 -> 1113 bytes
.../src/main/webapp/helpfiles/de/help.cardpin.html | 41 +++++++++++
.../src/main/webapp/helpfiles/de/help.cardpin1.png | Bin 0 -> 1334 bytes
.../src/main/webapp/helpfiles/de/help.cardpin2.png | Bin 0 -> 1324 bytes
.../webapp/helpfiles/de/help.hashdataviewer.html | 39 ++++++++++
.../webapp/helpfiles/de/help.hashdataviewer.png | Bin 0 -> 11310 bytes
.../main/webapp/helpfiles/de/help.insertcard.html | 42 +++++++++++
.../main/webapp/helpfiles/de/help.insertcard.png | Bin 0 -> 1207 bytes
.../src/main/webapp/helpfiles/de/help.retry.html | 40 ++++++++++
.../src/main/webapp/helpfiles/de/help.retry.png | Bin 0 -> 1711 bytes
.../main/webapp/helpfiles/de/help.signpin-1.png | Bin 0 -> 12818 bytes
.../src/main/webapp/helpfiles/de/help.signpin.html | 45 ++++++++++++
.../src/main/webapp/helpfiles/de/help.signpin.png | Bin 0 -> 1511 bytes
.../src/main/webapp/helpfiles/de/help.wait.html | 39 ++++++++++
.../src/main/webapp/helpfiles/de/help.wait.png | Bin 0 -> 981 bytes
.../src/main/webapp/helpfiles/de/help.welcome.html | 40 ++++++++++
.../src/main/webapp/helpfiles/de/help.welcome.png | Bin 0 -> 2152 bytes
BKULocal/src/main/webapp/helpfiles/help.css | 81 +++++++++++++++++++++
BKULocal/src/main/webapp/helpfiles/index.html | 17 +++++
.../src/main/webapp/img/BackgroundChipperling.png | Bin 0 -> 2041 bytes
BKUOnline/src/main/webapp/img/BackgroundMocca.png | Bin 0 -> 1287 bytes
51 files changed, 910 insertions(+), 88 deletions(-)
delete mode 100644 BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedImageView.java
create mode 100644 BKUCommonGUI/src/main/resources/images/help_orig.png
create mode 100644 BKULocal/src/main/webapp/help.jsp
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.card.locked.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.card.locked.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.card.notactivated.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.card.notactivated.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.pcsc.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.pcsc.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.cardpin.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.cardpin1.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.cardpin2.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.insertcard.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.insertcard.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.retry.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.retry.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.signpin-1.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.signpin.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.signpin.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.wait.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.wait.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.welcome.html
create mode 100644 BKULocal/src/main/webapp/helpfiles/de/help.welcome.png
create mode 100644 BKULocal/src/main/webapp/helpfiles/help.css
create mode 100644 BKULocal/src/main/webapp/helpfiles/index.html
create mode 100644 BKUOnline/src/main/webapp/img/BackgroundChipperling.png
create mode 100644 BKUOnline/src/main/webapp/img/BackgroundMocca.png
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
index db88c037..f862360b 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletBKUWorker.java
@@ -31,7 +31,6 @@ import at.gv.egiz.stal.service.types.RequestType;
import at.gv.egiz.stal.service.types.ResponseType;
import at.gv.egiz.stal.util.STALTranslator;
import java.applet.AppletContext;
-import java.awt.Dimension;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
index 4b49c5d5..7963768e 100644
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
+++ b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java
@@ -16,6 +16,7 @@
*/
package at.gv.egiz.bku.online.applet;
+import at.gv.egiz.bku.gui.DefaultHelpListener;
import at.gv.egiz.bku.gui.AbstractHelpListener;
import java.net.MalformedURLException;
import java.net.URL;
@@ -92,12 +93,12 @@ public class BKUApplet extends JApplet implements AppletParameterProvider {
// helpListener = new BrowserHelpListener(getAppletContext(), helpURL, getLocale());
helpListener = new DefaultHelpListener(getAppletContext(), helpURL, getLocale());
} catch (MalformedURLException ex) {
- log.warn("failed to load help URL, disabling help: " + ex.getMessage());
+ log.warn("failed to load help URL: " + ex.getMessage() + ", disabling help");
}
try {
backgroundImgURL = getURLParameter(BACKGROUND_PARAM);
} catch (MalformedURLException ex) {
- log.info("failed to load applet background image, using default: " + ex.getMessage());
+ log.warn("failed to load applet background image: " + ex.getMessage() + ", using default");
}
if (locale != null) {
diff --git a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java b/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java
deleted file mode 100644
index 6eec5665..00000000
--- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/DefaultHelpListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package at.gv.egiz.bku.online.applet;
-
-import at.gv.egiz.bku.gui.HelpViewer;
-import at.gv.egiz.bku.gui.AbstractHelpListener;
-import java.applet.AppletContext;
-import java.net.URL;
-import java.util.Locale;
-import javax.swing.SwingUtilities;
-
-/**
- *
- * @author Clemens Orthacker
- */
-public class DefaultHelpListener extends AbstractHelpListener {
-
- protected AppletContext ctx;
-
- public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) {
- super(helpURL, locale);
- this.ctx = ctx;
- }
-
- @Override
- public void showDocument(final URL helpURL, final String helpTopic) throws Exception {
- log.debug("schedule help dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("show help dialog");
-
- HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages);
-
- }
- });
- }
-}
diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html
index 1ba88e47..eaf6376d 100644
--- a/BKUApplet/src/test/resources/appletTest.html
+++ b/BKUApplet/src/test/resources/appletTest.html
@@ -21,9 +21,9 @@
archive="../BKUApplet-1.0-SNAPSHOT.jar, ../test-libs/commons-logging-1.1.1.jar , ../test-libs/iaik_jce_me4se-3.04.jar"
width=300 height=200>
-
+
-
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index c7032f90..87982c79 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -89,6 +89,7 @@ public interface BKUGUIFacade {
public static final String BUTTON_SAVE = "button.save";
public static final String BUTTON_CLOSE = "button.close";
public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
+ public static final String ALT_HELP = "alt.help";
public void init(Container contentPane, Locale locale, URL background, ActionListener helpListener);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
new file mode 100644
index 00000000..ba968a48
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
@@ -0,0 +1,62 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package at.gv.egiz.bku.gui;
+
+import java.applet.AppletContext;
+import java.net.URL;
+import java.util.Locale;
+import javax.swing.SwingUtilities;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class DefaultHelpListener extends AbstractHelpListener {
+
+ protected AppletContext ctx;
+
+ public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) {
+ super(helpURL, locale);
+ this.ctx = ctx;
+ }
+
+ public DefaultHelpListener(URL helpURL, Locale locale) {
+ super(helpURL, locale);
+ this.ctx = null;
+ }
+
+ @Override
+ public void showDocument(final URL helpURL, final String helpTopic) throws Exception {
+ log.debug("schedule help dialog");
+
+ SwingUtilities.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ log.debug("show help dialog");
+
+ if (ctx == null) {
+ HelpViewer.showHelpDialog(helpURL, helpTopic, messages);
+
+ } else {
+ HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages);
+ }
+ }
+ });
+ }
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
index 8883098a..31887bde 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
@@ -16,6 +16,7 @@
*/
package at.gv.egiz.bku.gui;
+import at.gv.egiz.bku.gui.html.RestrictedHTMLEditorKit;
import at.gv.egiz.stal.HashDataInput;
import java.awt.Component;
import java.awt.Container;
@@ -23,6 +24,7 @@ import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Frame;
+import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@@ -47,6 +49,11 @@ import javax.swing.JScrollPane;
import javax.swing.LayoutStyle;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
+import javax.swing.text.Element;
+import javax.swing.text.ViewFactory;
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.HTMLEditorKit;
+import javax.swing.text.html.ImageView;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -184,11 +191,14 @@ public class HashDataViewer extends JDialog
}
JEditorPane viewer = new JEditorPane();
- viewer.setEditable(false);
- viewer.setContentType(mimeType);
+
if ("text/plain".equals(mimeType)) {
viewer.setFont(new Font(PLAINTEXT_FONT, viewer.getFont().getStyle(), viewer.getFont().getSize()));
+// } else if ("text/html".equals(mimeType)) {
+// viewer.setEditorKitForContentType("text/html", new RestrictedHTMLEditorKit());
}
+ viewer.setEditable(false);
+ viewer.setContentType(mimeType);
EditorKit editorKit = viewer.getEditorKit();
Document document = editorKit.createDefaultDocument();
@@ -220,6 +230,7 @@ public class HashDataViewer extends JDialog
if (helpListener != null) {
JLabel helpLabel = new JLabel();
helpLabel.setIcon(new ImageIcon(getClass().getResource(BKUGUIFacade.HELP_IMG)));
+ helpLabel.getAccessibleContext().setAccessibleName(messages.getString(BKUGUIFacade.ALT_HELP));
helpLabel.addMouseListener(new MouseAdapter() {
@Override
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
index 42ca2090..173254e7 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
@@ -16,7 +16,6 @@
*/
package at.gv.egiz.bku.gui;
-import at.gv.egiz.bku.gui.*;
import java.applet.AppletContext;
import java.awt.Component;
import java.awt.Container;
@@ -30,7 +29,6 @@ import java.net.URL;
import java.text.MessageFormat;
import java.util.ResourceBundle;
import javax.swing.GroupLayout;
-import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JEditorPane;
@@ -136,6 +134,7 @@ public class HelpViewer extends JDialog
final JEditorPane viewer = new JEditorPane();
viewer.setEditable(false);
try {
+ viewer.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
viewer.setPage(helpURL);
viewer.addHyperlinkListener(new HyperlinkListener() {
@@ -165,7 +164,7 @@ public class HelpViewer extends JDialog
String p = messages.getString(BKUGUIFacade.ERR_VIEWER);
viewer.setText(MessageFormat.format(p, new Object[]{ex.getMessage()}));
}
-
+ viewer.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
JScrollPane scrollPane = new JScrollPane(viewer);
scrollPane.setPreferredSize(viewer.getPreferredSize());
scrollPane.setAlignmentX(LEFT_ALIGNMENT);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
index 1185cf53..271c0b65 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/ImagePanel.java
@@ -24,8 +24,8 @@ import javax.swing.ImageIcon;
import javax.swing.JPanel;
/**
- *
- * @author clemens
+ *
+ * @author Clemens Orthacker
*/
public class ImagePanel extends JPanel {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index a810d34c..bb568b75 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -158,6 +158,11 @@ public class SimpleGUI implements BKUGUIFacade {
if (background == null) {
background = this.getClass().getResource(DEFAULT_BACKGROUND);
}
+ if ("file".equals(background.getProtocol())) {
+ log.warn("local background image not allowed: " + background);
+ background = this.getClass().getResource(DEFAULT_BACKGROUND);
+ }
+ log.debug("loading background " + background);
contentPanel = new ImagePanel(background);
// contentPanel.setBorder(new TitledBorder("content"));
@@ -179,6 +184,7 @@ public class SimpleGUI implements BKUGUIFacade {
helpLabel = new JLabel();
helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
+ helpLabel.getAccessibleContext().setAccessibleName(messages.getString(ALT_HELP));
helpLabel.addMouseListener(helpListener);
helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java
new file mode 100644
index 00000000..680bf1a4
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedHTMLEditorKit.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.gui.html;
+
+import javax.swing.text.Element;
+import javax.swing.text.StyleConstants;
+import javax.swing.text.View;
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.HTMLEditorKit;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class RestrictedHTMLEditorKit extends HTMLEditorKit {
+
+
+ public static class RestrictedHTMLFactory extends HTMLFactory {
+
+ @Override
+ public View create(Element elem) {
+ Object o =
+ elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
+ if (o instanceof HTML.Tag) {
+ HTML.Tag kind = (HTML.Tag) o;
+ if (kind == HTML.Tag.IMG)
+ return new RestrictedImageView(elem);
+ }
+ return super.create( elem );
+ }
+
+ }
+
+}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedImageView.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedImageView.java
new file mode 100644
index 00000000..b1aa35db
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/html/RestrictedImageView.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.gui.html;
+
+import javax.swing.text.Element;
+import javax.swing.text.html.HTML;
+import javax.swing.text.html.ImageView;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+/**
+ * ImageViewer.refreshImage() (and loadImage()) is private :-(
+ */
+ public class RestrictedImageView extends ImageView {
+
+ public RestrictedImageView(Element elem) {
+ super(elem);
+ }
+
+// @Override
+// public Image getImage() {
+// int s = state;
+// if ((s & RELOAD_IMAGE_FLAG) != 0) {
+// refreshImage();
+// }
+// s = state;
+// if ((s & RELOAD_FLAG) != 0) {
+// synchronized(this) {
+// state = (state | RELOAD_FLAG) ^ RELOAD_FLAG;
+// }
+// setPropertiesFromAttributes();
+// }
+// return super.getImage();
+// }
+
+ /**
+ * check whether this URL corresponds to the data URI scheme
+ * (and the referenced content is directly included in the document).
+ * @return
+ */
+ private boolean isDataURI() {
+ String src = (String)getElement().getAttributes().
+ getAttribute(HTML.Attribute.SRC);
+ if (src == null) {
+ return false;
+ }
+
+ return src.toLowerCase().startsWith("data");
+ }
+ }
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 6c049c85..5f62c05a 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -31,7 +31,8 @@ message.wait=Bitte warten...
message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
message.enterpin={0} eingeben
message.hashdatalink=Signaturdaten anzeigen
-message.hashdata=Dies ist eine Voransicht des zu signierenden Inhaltes. F\u00FCr Details siehe Hilfe.
+message.hashdata=Hinweis: Dies ist eine Voransicht des zu signierenden Inhalts. F\u00FCr eine standardkonforme Darstellung siehe Hilfe (i).
+#message.hashdata=Dies ist eine Voransicht des zu signierenden Inhaltes. F\u00FCr Details siehe Hilfe (i).
#verwenden sie bitte die von ihrem System zur Verf\u00FCgung gestellte {0} Anwendung.
message.hashdatalist={0} Signaturdaten:
message.retries=Noch {0} Versuch(e)
@@ -52,6 +53,7 @@ mimetype.desc.txt=Textdateien (.txt)
mimetype.desc.pdf=Adobe PDF-Dateien (.pdf)
mimetype.desc.bin=Bin\u00E4rdateien (.bin)
save.hashdatainput.prefix=Signaturdaten
+alt.help=Hilfe
# Error Messages
error.no.hashdata=Keine Signaturdaten verf\u00FCgbar: {0}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index 80dc4234..d963fd5f 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -31,7 +31,7 @@ message.wait=Please wait...
message.insertcard=Please insert your citizen-card into the reader
message.enterpin=Enter {0}
message.hashdatalink=Display signature data
-message.hashdata=Signature data:
+message.hashdata=Remark: This is a preview of the data to-be signed. For standards compliant display see help.
message.hashdatalist={0} signature data objects:
message.retries={0} tries left
message.overwrite=Overwrite {0}?
@@ -51,6 +51,7 @@ mimetype.desc.txt=Textfiles (.txt)
mimetype.desc.pdf=Adobe PDF-files (.pdf)
mimetype.desc.bin=Binary files (.bin)
save.hashdatainput.prefix=signaturedata
+alt.help=help
# Error Messages
error.no.hashdata=No signature data available: {0}
diff --git a/BKUCommonGUI/src/main/resources/images/help.png b/BKUCommonGUI/src/main/resources/images/help.png
index 5d6da3bf..d1c36c33 100644
Binary files a/BKUCommonGUI/src/main/resources/images/help.png and b/BKUCommonGUI/src/main/resources/images/help.png differ
diff --git a/BKUCommonGUI/src/main/resources/images/help_orig.png b/BKUCommonGUI/src/main/resources/images/help_orig.png
new file mode 100644
index 00000000..5d6da3bf
Binary files /dev/null and b/BKUCommonGUI/src/main/resources/images/help_orig.png differ
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index ad7b9646..cad8cfb6 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -27,7 +27,7 @@ import javax.swing.WindowConstants;
import at.gv.egiz.bku.gui.BKUGUIFacade;
import at.gv.egiz.bku.gui.BKUGUIFactory;
-import at.gv.egiz.bku.local.gui.LocalHelpListener;
+import at.gv.egiz.bku.gui.DefaultHelpListener;
import at.gv.egiz.stal.STAL;
import at.gv.egiz.stal.STALFactory;
import java.net.URL;
@@ -49,10 +49,11 @@ public class SMCCSTALFactory implements STALFactory {
dialog.setLocale(locale);
}
BKUGUIFacade gui = BKUGUIFactory.createGUI(BKUGUIFactory.ADVANCED_GUI);
- LocalHelpListener helpListener = null;
+ DefaultHelpListener helpListener = null;
try {
if (helpURL != null) {
- helpListener = new LocalHelpListener(new URL(helpURL), dialog.getLocale());
+// helpListener = new LocalHelpListener(new URL(helpURL), dialog.getLocale());
+ helpListener = new DefaultHelpListener(new URL(helpURL), locale);
} else {
log.warn("no HELP URL configured, help system disabled");
}
diff --git a/BKULocal/src/main/webapp/WEB-INF/web.xml b/BKULocal/src/main/webapp/WEB-INF/web.xml
index 64f9a581..36087d17 100644
--- a/BKULocal/src/main/webapp/WEB-INF/web.xml
+++ b/BKULocal/src/main/webapp/WEB-INF/web.xml
@@ -1,20 +1,20 @@
-
+
http-security-layer-request
@@ -36,6 +36,10 @@
BKUServletat.gv.egiz.bku.local.webapp.SpringBKUServlet
+
+ help
+ /help.jsp
+ BKUServlet/http-security-layer-request
@@ -44,6 +48,10 @@
BKUServlet/https-security-layer-request
+
+ help
+ /help/*
+
diff --git a/BKULocal/src/main/webapp/help.jsp b/BKULocal/src/main/webapp/help.jsp
new file mode 100644
index 00000000..72781e38
--- /dev/null
+++ b/BKULocal/src/main/webapp/help.jsp
@@ -0,0 +1,29 @@
+
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<%@ page import="java.util.Locale"%>
+<%
+ String pathInfo[] = (request.getPathInfo() != null) ? request
+ .getPathInfo().split("/") : new String[] {};
+ String language = pathInfo[1].split("_")[0];
+ String filename = pathInfo[2];
+ String path = "/helpfiles/" + language.toLowerCase() + "/" + filename;
+ System.out.println(path);
+%>
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.card.locked.html b/BKULocal/src/main/webapp/helpfiles/de/error.card.locked.html
new file mode 100644
index 00000000..c72ae275
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/error.card.locked.html
@@ -0,0 +1,46 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Fehler: Bürgerkarte ist gesperrt
+
Die Bürgerkartenfunktion auf der gesteckten Chipkarte ist gesperrt. Es stehen keine weiteren Versuche zur Eingabe einer PIN zur Verfügung, da zu oft eine falsche PIN eingegeben wurde.
+
Bitte wenden sie sich an den Aussteller der Karte.
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.card.notactivated.png b/BKULocal/src/main/webapp/helpfiles/de/error.card.notactivated.png
new file mode 100644
index 00000000..dd48f92b
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/error.card.notactivated.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.html b/BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.html
new file mode 100644
index 00000000..c93bba48
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.html
@@ -0,0 +1,42 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Fehler: Es konnte kein Kartenleser gefunden werden.
+
Für den Zugriff auf die Bürgerkarte ist ein Chipkartenleser erforderlich. Es werden grundsätzlich alle Kartenleser unterstützt, die über die PC/SC-Schnittstelle angesprochen werden können und im Betriebssystem erfolgreich installiert wurden. Es können mehrere unterstützte Kartenleser gleichzeitig angeschlossen werden.
+
Kartenleser die, die nicht über die PC/SC-Schnittstelle angesprochen werden können (z.B. Kartenleser für die nur CT-API-Treiber verfügbar sind) werden nicht unterstützt.
+
+
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.png b/BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.png
new file mode 100644
index 00000000..4276347d
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/error.cardterminal.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.pcsc.html b/BKULocal/src/main/webapp/helpfiles/de/error.pcsc.html
new file mode 100644
index 00000000..44129e40
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/error.pcsc.html
@@ -0,0 +1,40 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Fehler: Es konnte keine PC/SC-Schnittstelle gefunden werden
+
Die Software für den Zugriff auf die Bürgerkarte konnte keine PC/SC-Schnittstelle für den Zugriff auf Kartenleser erkennen. Das Betriebssystem scheint keine PC/SC-Schnittstelle zur Verfügung zu stellen.
+
Unter Betriebssystemen die PCSC-Lite verwenden (Linux u.a.) tritt dieses Problem auch auf, wenn kein Kartenleser angeschlossen ist und daher der entsprechende Dienst nicht gestartet wurde oder wenn die entsprechende Bibliothek nicht zur Verfügung steht (weitere Informationen).
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.pcsc.png b/BKULocal/src/main/webapp/helpfiles/de/error.pcsc.png
new file mode 100644
index 00000000..94940733
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/error.pcsc.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.html b/BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.html
new file mode 100644
index 00000000..c0f2c762
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.html
@@ -0,0 +1,39 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Fehler: Der Server ist nicht erreichbar
+
Die Software zum Zugriff auf die Bürgerkarte konnte den Server nicht erreichen. Möglicherweise besteht derzeit ein Problem mit dem Dienst. Probieren Sie es daher zu einem späteren Zeitpunkt nochmal. Sollte das Problem dauerhaft bestehen, wenden Sie sich bitte an den Betreiber der Anwendung.
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.png b/BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.png
new file mode 100644
index 00000000..2570a01f
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/error.ws.unreachable.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.html b/BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.html
new file mode 100644
index 00000000..c647bf72
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.html
@@ -0,0 +1,47 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Die Karte wird nicht unterstützt
+
Die im Kartenleser gesteckte Chipkarte wird nicht unterstützt.
+
Bitte stecken Sie eine unterstützte Chipkarte (Bürgerkarte) in den Kartenleser. Derzeit werden die folgenden Chipkarten unterstützt:
a-sign premium
+ Chipkarte der A-Trust GmbH bzw. diverse andere Chipkarten mit der Aufschrift 'a-sign premium'.
+
+
Sind mehrere unterstützte Kartenleser angeschlossen, stecken sie eine unterstützte Chipkarte (Bürgerkarte) in einen der angeschlossenen Kartenleser. Wird die Chipkarte erkannt wechselt die Bildschirmanzeige. Wird die Chipkarte nicht erkannt, wird der Kartenleser möglicherweise nicht unterstützt. Stecken Sie die Chipkarte daher in einen anderen Kartenleser.
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.png b/BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.png
new file mode 100644
index 00000000..23f6e2af
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.cardnotsupported.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.cardpin.html b/BKULocal/src/main/webapp/helpfiles/de/help.cardpin.html
new file mode 100644
index 00000000..dc678fd0
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.cardpin.html
@@ -0,0 +1,41 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Lesen von Informationen von der Chipkarte
+
Sie werden aufgefordert ihre Karten-PIN bzw. Infobox-PIN (abhängig von der verwendeten Bürgerkarte) einzugeben um das Auslesen von Informationen zur Identifikation (Personenbindung) bzw. Vollmachten zu ermöglichen.
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.cardpin1.png b/BKULocal/src/main/webapp/helpfiles/de/help.cardpin1.png
new file mode 100644
index 00000000..4e1c2de8
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.cardpin1.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.cardpin2.png b/BKULocal/src/main/webapp/helpfiles/de/help.cardpin2.png
new file mode 100644
index 00000000..cc5e599e
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.cardpin2.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.html b/BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.html
new file mode 100644
index 00000000..f7cf15df
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.html
@@ -0,0 +1,39 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Anzeige der Signaturdaten
+
Dieses Fenster zeigt die zu signierenden Daten an. Dies können entweder reine Textdaten oder XHTML sein. Im Falle von XHML erhalten Sie den Hinweis, dass es sich bei den dargestellten Daten nur um eine Voransicht handelt. Um die Daten standardkonform darzustellen, müssen diese abgespeichert und mit einem geeigneten XHTML Betrachter geöffnen werden.
+
In jedem Fall können die zu signierenden abgespeichert werden.
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.png b/BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.png
new file mode 100644
index 00000000..83004322
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.hashdataviewer.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.insertcard.html b/BKULocal/src/main/webapp/helpfiles/de/help.insertcard.html
new file mode 100644
index 00000000..0bfc6230
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.insertcard.html
@@ -0,0 +1,42 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Bitte die Bürgerkarte in den Kartenleser stecken
+
Die Software für den Zugriff auf die Bürgerkarte hat einen oder mehrere unterstützte Kartenleser gefunden.
+
Bitte stecken Sie nun ihre Bürgerkarte in den Kartenleser. Wird die Karte erkannt, welchselt die Bildschirmanzeige.
+
Sollten Sie mehrere Kartenleser angeschlossen haben, wählen Sie einen beliebigen aus. Wird die Karte im ausgewählten Kartenleser nicht erkannt, wird dieser Kartenleser eventuell nicht unterstützt. Probieren Sie es daher in einem anderen Kartenleser nochmal.
+
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.insertcard.png b/BKULocal/src/main/webapp/helpfiles/de/help.insertcard.png
new file mode 100644
index 00000000..9930fcb4
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.insertcard.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.retry.html b/BKULocal/src/main/webapp/helpfiles/de/help.retry.html
new file mode 100644
index 00000000..110d761f
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.retry.html
@@ -0,0 +1,40 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Falsche PIN
+
Die eingegebene PIN war falsch. Bitte geben Sie die korrekte PIN ein.
+
Die Anzahl der noch möglichen Versuche wird angezeigt.
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.retry.png b/BKULocal/src/main/webapp/helpfiles/de/help.retry.png
new file mode 100644
index 00000000..4cab2430
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.retry.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.signpin-1.png b/BKULocal/src/main/webapp/helpfiles/de/help.signpin-1.png
new file mode 100644
index 00000000..1c5c8570
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.signpin-1.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.signpin.html b/BKULocal/src/main/webapp/helpfiles/de/help.signpin.html
new file mode 100644
index 00000000..9ff79f3b
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.signpin.html
@@ -0,0 +1,45 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Erstellen einer elektronischen Signatur
+
Sie werden aufgefordert die Signatur-PIN einzugeben, um eine elektronische Signatur zu erstellen.
+
+
+
Klicken Sie auf 'Signaturdaten anzeigen' um die zu signierenden Daten anzuzeigen.
+
Geben Sie im Formularfeld die Signatur-PIN ein.
+
Klicken Sie auf die Schaltfläche 'Signieren' um die elektronische Signatur zu erstellen.
+
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.signpin.png b/BKULocal/src/main/webapp/helpfiles/de/help.signpin.png
new file mode 100644
index 00000000..6ffbf8df
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.signpin.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.wait.html b/BKULocal/src/main/webapp/helpfiles/de/help.wait.html
new file mode 100644
index 00000000..ed3db1b8
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.wait.html
@@ -0,0 +1,39 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Bitte warten ...
+
Die Software für den Zugriff auf die Bürgerkarte ist damit beschäftigt, einen Befehl auszuführen bzw. auf einen neuen Befehl vom Server zu warten.
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.wait.png b/BKULocal/src/main/webapp/helpfiles/de/help.wait.png
new file mode 100644
index 00000000..812da0bd
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.wait.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.welcome.html b/BKULocal/src/main/webapp/helpfiles/de/help.welcome.html
new file mode 100644
index 00000000..9796a206
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/de/help.welcome.html
@@ -0,0 +1,40 @@
+
+
+
+
+Untitled Document
+
+
+
+
+
+
+
+
+
Online-Hilfe
+
+
+
+
Hinweis: Das Bildschirmfoto oben kann von der Darstellung in der Webseite abweichen.
+
+
+
Willkommen
+
Die Anzeige "Willkommen" erfolgt unmittelbar nachdem die Software für den Zugriff auf die Bürgerkarte erfolgreich im Browser geladen wurde.
+
Die Software versucht nun eine Verbindung mit dem Server aufzunehmen um Befehle für den Zugriff auf die Bürgerkarte zu erhalten.
+
+
+
+
+
+
diff --git a/BKULocal/src/main/webapp/helpfiles/de/help.welcome.png b/BKULocal/src/main/webapp/helpfiles/de/help.welcome.png
new file mode 100644
index 00000000..0be05a78
Binary files /dev/null and b/BKULocal/src/main/webapp/helpfiles/de/help.welcome.png differ
diff --git a/BKULocal/src/main/webapp/helpfiles/help.css b/BKULocal/src/main/webapp/helpfiles/help.css
new file mode 100644
index 00000000..28f9767b
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/help.css
@@ -0,0 +1,81 @@
+@charset "UTF-8";
+body {
+ font: 100% Verdana, Arial, Helvetica, sans-serif;
+ background: #666666;
+ margin: 0; /* it's good practice to zero the margin and padding of the body element to account for differing browser defaults */
+ padding: 0;
+ text-align: center; /* this centers the container in IE 5* browsers. The text is then set to the left aligned default in the #container selector */
+ color: #000000;
+}
+
+/* Tips for Elastic layouts
+1. Since the elastic layouts overall sizing is based on the user's default fonts size, they are more unpredictable. Used correctly, they are also more accessible for those that need larger fonts size since the line length remains proportionate.
+2. Sizing of divs in this layout are based on the 100% font size in the body element. If you decrease the text size overall by using a font-size: 80% on the body element or the #container, remember that the entire layout will downsize proportionately. You may want to increase the widths of the various divs to compensate for this.
+3. If font sizing is changed in differing amounts on each div instead of on the overall design (ie: #sidebar1 is given a 70% font size and #mainContent is given an 85% font size), this will proportionately change each of the divs overall size. You may want to adjust based on your final font sizing.
+*/
+.twoColElsLtHdr #container {
+ width: 46em; /* this width will create a container that will fit in an 800px browser window if text is left at browser default font sizes */
+ background: #FFFFFF;
+ margin: 0 auto; /* the auto margins (in conjunction with a width) center the page */
+ border: 1px solid #000000;
+ text-align: left; /* this overrides the text-align: center on the body element. */
+}
+.twoColElsLtHdr #header {
+ background: #DDDDDD;
+ padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear beneath it. If an image is used in the #header instead of text, you may want to remove the padding. */
+}
+.twoColElsLtHdr #header h1 {
+ margin: 0; /* zeroing the margin of the last element in the #header div will avoid margin collapse - an unexplainable space between divs. If the div has a border around it, this is not necessary as that also avoids the margin collapse */
+ padding: 10px 0; /* using padding instead of margin will allow you to keep the element away from the edges of the div */
+}
+
+/* Tips for sidebar1:
+1. Be aware that if you set a font-size value on this div, the overall width of the div will be adjusted accordingly.
+2. Since we are working in ems, it's best not to use padding on the sidebar itself. It will be added to the width for standards compliant browsers creating an unknown actual width.
+3. Space between the side of the div and the elements within it can be created by placing a left and right margin on those elements as seen in the ".twoColElsLtHdr #sidebar1 p" rule.
+*/
+.twoColElsLtHdr #sidebar1 {
+ float: left;
+ width: 210px;
+ padding: 15px 0; /* top and bottom padding create visual space within this div */
+ background-color: #FFFFFF;
+}
+.twoColElsLtHdr #sidebar1 h3, .twoColElsLtHdr #sidebar1 p {
+ margin-left: 10px; /* the left and right margin should be given to every element that will be placed in the side columns */
+ margin-right: 10px;
+}
+
+/* Tips for mainContent:
+1. If you give this #mainContent div a font-size value different than the #sidebar1 div, the margins of the #mainContent div will be based on its font-size and the width of the #sidebar1 div will be based on its font-size. You may wish to adjust the values of these divs.
+2. The space between the mainContent and sidebar1 is created with the left margin on the mainContent div. No matter how much content the sidebar1 div contains, the column space will remain. You can remove this left margin if you want the #mainContent div's text to fill the #sidebar1 space when the content in #sidebar1 ends.
+3. To avoid float drop, you may need to test to determine the approximate maximum image/element size since this layout is based on the user's font sizing combined with the values you set. However, if the user has their browser font size set lower than normal, less space will be available in the #mainContent div than you may see on testing.
+4. In the Internet Explorer Conditional Comment below, the zoom property is used to give the mainContent "hasLayout." This avoids several IE-specific bugs that may occur.
+*/
+.twoColElsLtHdr #mainContent {
+ margin: 0 1.5em 0 15em; /* the right margin can be given in ems or pixels. It creates the space down the right side of the page. */
+ padding: 0 10px;
+}
+.twoColElsLtHdr #footer {
+ padding: 0 10px; /* this padding matches the left alignment of the elements in the divs that appear above it. */
+ background:#DDDDDD;
+}
+.twoColElsLtHdr #footer p {
+ margin: 0; /* zeroing the margins of the first element in the footer will avoid the possibility of margin collapse - a space between divs */
+ padding: 10px 0; /* padding on this element will create space, just as the the margin would have, without the margin collapse issue */
+}
+
+/* Miscellaneous classes for reuse */
+.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
+ float: right;
+ margin-left: 8px;
+}
+.fltlft { /* this class can be used to float an element left in your page */
+ float: left;
+ margin-right: 8px;
+}
+.clearfloat { /* this class should be placed on a div or break element and should be the final element before the close of a container that should fully contain a float */
+ clear:both;
+ height:0;
+ font-size: 1px;
+ line-height: 0px;
+}
\ No newline at end of file
diff --git a/BKULocal/src/main/webapp/helpfiles/index.html b/BKULocal/src/main/webapp/helpfiles/index.html
new file mode 100644
index 00000000..49aaed66
--- /dev/null
+++ b/BKULocal/src/main/webapp/helpfiles/index.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
Default help page if no help item is provided
+
+
+
diff --git a/BKUOnline/src/main/webapp/img/BackgroundChipperling.png b/BKUOnline/src/main/webapp/img/BackgroundChipperling.png
new file mode 100644
index 00000000..5097aa6b
Binary files /dev/null and b/BKUOnline/src/main/webapp/img/BackgroundChipperling.png differ
diff --git a/BKUOnline/src/main/webapp/img/BackgroundMocca.png b/BKUOnline/src/main/webapp/img/BackgroundMocca.png
new file mode 100644
index 00000000..349d9ff0
Binary files /dev/null and b/BKUOnline/src/main/webapp/img/BackgroundMocca.png differ
--
cgit v1.2.3
From e77343708ec9b74aed7256d72982e4fce4be80d8 Mon Sep 17 00:00:00 2001
From: wbauer
Date: Sat, 15 Nov 2008 10:34:45 +0000
Subject: Release 1.0
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@175 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 14 +++++++-------
BKUCommonGUI/pom.xml | 8 ++++----
BKULocal/pom.xml | 14 +++++++-------
BKUOnline/pom.xml | 14 +++++++-------
BKUOnline/src/main/webapp/appletPage.jsp | 2 +-
BKUViewer/pom.xml | 6 +++---
STAL/pom.xml | 4 ++--
STALService/pom.xml | 6 +++---
bkucommon/pom.xml | 8 ++++----
pom.xml | 2 +-
smcc/pom.xml | 4 ++--
smccSTAL/pom.xml | 10 +++++-----
utils/pom.xml | 4 ++--
13 files changed, 48 insertions(+), 48 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index a20a613d..eaaa5820 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -3,13 +3,13 @@
bkuat.gv.egiz
- 1.0-SNAPSHOT
+ 1.04.0.0at.gv.egizBKUAppletBKU Applet
- 1.0-SNAPSHOT
+ 1.0
@@ -116,27 +116,27 @@
at.gv.egizsmcc
- 1.0-SNAPSHOT
+ 1.0at.gv.egizSTAL
- 1.0-SNAPSHOT
+ 1.0at.gv.egizSTALService
- 1.0-SNAPSHOT
+ 1.0at.gv.egizsmccSTAL
- 1.0-SNAPSHOT
+ 1.0at.gv.egizBKUCommonGUI
- 1.0-SNAPSHOT
+ 1.0commons-logging
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index 8c08ba6e..1aea89f6 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -3,23 +3,23 @@
bkuat.gv.egiz
- 1.0-SNAPSHOT
+ 1.04.0.0at.gv.egizBKUCommonGUIBKU Common GUI
- 1.0-SNAPSHOT
+ 1.0at.gv.egizsmcc
- 1.0-SNAPSHOT
+ 1.0at.gv.egizSTAL
- 1.0-SNAPSHOT
+ 1.0compile
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index 03a6a10b..36503ca0 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -3,7 +3,7 @@
bkuat.gv.egiz
- 1.0-SNAPSHOT
+ 1.04.0.0at.gv.egiz
@@ -57,22 +57,22 @@
at.gv.egizSTAL
- 1.0-SNAPSHOT
+ 1.0at.gv.egizbkucommon
- 1.0-SNAPSHOT
+ 1.0at.gv.egizsmcc
- 1.0-SNAPSHOT
+ 1.0at.gv.egizsmccSTAL
- 1.0-SNAPSHOT
+ 1.0org.springframework
@@ -97,12 +97,12 @@
at.gv.egizBKUApplet
- 1.0-SNAPSHOT
+ 1.0at.gv.egizBKUViewer
- 1.0-SNAPSHOT
+ 1.0
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index 5cdf5356..a1d92390 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -4,14 +4,14 @@
bkuat.gv.egiz
- 1.0-SNAPSHOT
+ 1.04.0.0at.gv.egizBKUOnlinewarBKU Online
- 1.0-SNAPSHOT
+ 1.0
@@ -25,12 +25,12 @@
at.gv.egizbkucommon
- 1.0-SNAPSHOT
+ 1.0at.gv.egizBKUViewer
- 1.0-SNAPSHOT
+ 1.0commons-logging
@@ -55,14 +55,14 @@
at.gv.egizSTALService
- 1.0-SNAPSHOT
+ 1.0compileat.gv.egizBKUApplet
- 1.0-SNAPSHOT
+ 1.0provided
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
index d661c71a..f68f2ece 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUI.java
@@ -87,8 +87,8 @@ public class BKUGUI implements BKUGUIFacade {
* @param contentPane
* @param localeString may be null
*/
- @Override
- public void init(final Container contentPane, Locale locale, final URL background, ActionListener helpListener) {
+// @Override
+ public void init(final Container contentPane, Locale locale, Style guiStyle, final URL background, ActionListener helpListener) {
if (locale != null) {
messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, locale);
@@ -814,7 +814,7 @@ public class BKUGUI implements BKUGUIFacade {
}
@Override
- public void showHashDataInputDialog(final List signedReferences, boolean standalone, final ActionListener okListener, final String okCommand) {
+ public void showHashDataInputDialog(final List signedReferences, final ActionListener okListener, final String okCommand) {
if (signedReferences == null) {
showErrorDialog(messages.getString(ERR_NO_HASHDATA), new Object[] {"No SignedReferences provided"}, okListener, okCommand);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 87982c79..2dbba730 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -91,7 +91,9 @@ public interface BKUGUIFacade {
public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
public static final String ALT_HELP = "alt.help";
- public void init(Container contentPane, Locale locale, URL background, ActionListener helpListener);
+ public enum Style { simple, advanced };
+
+// public void init(Container contentPane, Locale locale, Style guiStyle, URL background, ActionListener helpListener);
/**
*
@@ -128,7 +130,7 @@ public interface BKUGUIFacade {
* @param okListener
* @param okCommand
*/
- public void showHashDataInputDialog(List signedReferences, boolean externalDisplay, ActionListener okListener, String okCommand);
+ public void showHashDataInputDialog(List signedReferences, ActionListener okListener, String okCommand);
/**
* TODO pull out from BKUGUIFacade. (or make this strictly an applet internal version)
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
index 87676026..f4981614 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFactory.java
@@ -17,24 +17,29 @@
package at.gv.egiz.bku.gui;
+import java.awt.Container;
+import java.awt.event.ActionListener;
+import java.net.URL;
+import java.util.Locale;
+
public class BKUGUIFactory {
public static final String SIMPLE_GUI = "simple";
public static final String ADVANCED_GUI = "advanced";
- private static BKUGUIFactory instance = new BKUGUIFactory();
+// private static BKUGUIFactory instance = new BKUGUIFactory();
- private BKUGUIFactory() {
- }
+// private BKUGUIFactory() {
+// }
+//
+// protected BKUGUIFacade createNewGUI(Container contentPane, Locale locale, String style, URL background, ActionListener helpListener) {
+//
+// }
- protected BKUGUIFacade createNewGUI(String style) {
+ public static BKUGUIFacade createGUI(Container contentPane, Locale locale, String style, URL background, ActionListener helpListener) {
if (ADVANCED_GUI.equals(style)) {
- return new BKUGUI();
+ return new SimpleGUI(contentPane, locale, BKUGUIFacade.Style.advanced, background, helpListener);
}
- return new SimpleGUI();
- }
-
- public static BKUGUIFacade createGUI(String style) {
- return instance.createNewGUI(style);
+ return new SimpleGUI(contentPane, locale, BKUGUIFacade.Style.simple, background, helpListener);
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
index ba968a48..f03bf158 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
@@ -17,6 +17,7 @@
package at.gv.egiz.bku.gui;
import java.applet.AppletContext;
+import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.Locale;
import javax.swing.SwingUtilities;
@@ -29,34 +30,56 @@ public class DefaultHelpListener extends AbstractHelpListener {
protected AppletContext ctx;
+ /**
+ *
+ * @param ctx open external links via applet context
+ * @param helpURL
+ * @param locale
+ */
public DefaultHelpListener(AppletContext ctx, URL helpURL, Locale locale) {
super(helpURL, locale);
this.ctx = ctx;
}
+ /**
+ * external links in help document are not opened
+ * @param helpURL
+ * @param locale
+ */
public DefaultHelpListener(URL helpURL, Locale locale) {
super(helpURL, locale);
this.ctx = null;
}
+ /**
+ * blocks until help viewer returns (is closed)
+ * @param helpURL
+ * @param helpTopic
+ */
@Override
- public void showDocument(final URL helpURL, final String helpTopic) throws Exception {
- log.debug("schedule help dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
+ public void showDocument(final URL helpURL, final String helpTopic) {
+// try {
+ log.debug("schedule help dialog");
+
+// SwingUtilities.invokeAndWait(new Runnable() {
+ SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
-
+
log.debug("show help dialog");
-
+
if (ctx == null) {
HelpViewer.showHelpDialog(helpURL, helpTopic, messages);
-
} else {
HelpViewer.showHelpDialog(ctx, helpURL, helpTopic, messages);
}
}
});
+// } catch (InterruptedException ex) {
+// log.error("Failed to display HelpViewer: " + ex.getMessage(), ex);
+// } catch (InvocationTargetException ex) {
+// log.error("Failed to display HelpViewer: " + ex.getMessage(), ex);
+// }
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
index 31887bde..7b77faeb 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
@@ -16,7 +16,6 @@
*/
package at.gv.egiz.bku.gui;
-import at.gv.egiz.bku.gui.html.RestrictedHTMLEditorKit;
import at.gv.egiz.stal.HashDataInput;
import java.awt.Component;
import java.awt.Container;
@@ -49,11 +48,6 @@ import javax.swing.JScrollPane;
import javax.swing.LayoutStyle;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
-import javax.swing.text.Element;
-import javax.swing.text.ViewFactory;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.HTMLEditorKit;
-import javax.swing.text.html.ImageView;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
index 173254e7..0fef3f75 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HelpViewer.java
@@ -105,7 +105,7 @@ public class HelpViewer extends JDialog
JPanel helpPanel = createViewerPanel(viewerLabel, helpURL);
JPanel buttonPanel = createButtonPanel();
- initContentPane(new Dimension(600, 400), helpPanel, buttonPanel);
+ initContentPane(new Dimension(600, 600), helpPanel, buttonPanel);
pack();
if (frame != null) {
setLocationRelativeTo(frame);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
index bb568b75..d4d6efef 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/SimpleGUI.java
@@ -32,6 +32,7 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.text.MessageFormat;
import java.util.List;
@@ -40,7 +41,6 @@ import java.util.ResourceBundle;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
-import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
@@ -51,7 +51,6 @@ import javax.swing.JTable;
import javax.swing.JTextArea;
import javax.swing.LayoutStyle;
import javax.swing.SwingUtilities;
-import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -69,38 +68,60 @@ public class SimpleGUI implements BKUGUIFacade {
protected Container contentPane;
protected ResourceBundle messages;
/** left and right side main panels */
-// protected JPanel iconPanel;
+ protected JPanel iconPanel;
protected JPanel contentPanel;
/** right side content panels and layouts */
-// protected JPanel headerPanel;
+ protected JPanel headerPanel;
protected JPanel mainPanel;
protected JPanel buttonPanel;
/** right side fixed labels */
-// protected JLabel titleLabel;
+ protected JLabel titleLabel;
protected JLabel helpLabel;
/** remember the pinfield to return to worker */
protected JPasswordField pinField;
protected int buttonSize;
-// private static final int CHECKBOX_WIDTH = new JCheckBox().getPreferredSize().width;
+ /** gui style config (default 'simple') */
+ protected boolean renderHeaderPanel = false;
+ protected boolean renderIconPanel = false;
+ protected boolean renderCancelButton = false;
/**
+ * set contentPane
+ * init message bundle
+ * configure the style
+ * register the help listener
+ * create GUI (on event-dispatching thread)
+ *
* @param contentPane
- * @param localeString may be null
+ * @param locale
+ * @param guiStyle
+ * @param background
+ * @param helpListener
*/
- @Override
- public void init(final Container contentPane, Locale locale, final URL background, ActionListener helpListener) {
+ public SimpleGUI(Container contentPane, Locale locale, Style guiStyle, URL background, ActionListener helpListener) {
+ this.contentPane = contentPane;
- if (locale != null) {
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, locale);
- } else {
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
- }
+ if (locale != null) {
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, locale);
+ } else {
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
+ }
+
+ if (guiStyle == Style.advanced) {
+ renderHeaderPanel = true;
+ renderIconPanel = false;
+ renderCancelButton = true;
+ }
+
+ registerHelpListener(helpListener);
+
+ createGUI(background);
+ }
+
+ private void createGUI(final URL background) {
- this.contentPane = contentPane;
- registerHelpListener(helpListener);
-
try {
log.debug("scheduling gui initialization");
@@ -112,21 +133,28 @@ public class SimpleGUI implements BKUGUIFacade {
log.debug("initializing gui");
-// initIconPanel();
+ if (renderIconPanel) {
+ initIconPanel(background);
+ initContentPanel(null);
+ } else {
initContentPanel(background);
-
- GroupLayout layout = new GroupLayout(contentPane);
- contentPane.setLayout(layout);
+ }
+
+ GroupLayout layout = new GroupLayout(contentPane);
+ contentPane.setLayout(layout);
+
+ if (renderIconPanel) {
+ layout.setHorizontalGroup(layout.createSequentialGroup()
+ .addComponent(iconPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
+ layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(iconPanel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
+ } else {
layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(contentPanel));
layout.setVerticalGroup(layout.createSequentialGroup().addComponent(contentPanel));
-// layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addGroup(layout.createSequentialGroup()
-// .addComponent(iconPanel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
-// layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addComponent(iconPanel, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(contentPanel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
+ }
}
});
} catch (Exception ex) {
@@ -134,119 +162,113 @@ public class SimpleGUI implements BKUGUIFacade {
}
}
-// protected void initIconPanel() {
-// iconPanel = new JPanel();
-// JLabel iconLabel = new JLabel();
-// iconLabel.setIcon(new ImageIcon(getClass().getResource(LOGO_RESOURCE))); // NOI18N
-//
-// GroupLayout iconPanelLayout = new GroupLayout(iconPanel);
-// iconPanel.setLayout(iconPanelLayout);
-// iconPanelLayout.setHorizontalGroup(
-// iconPanelLayout.createSequentialGroup()
-// .addContainerGap()
-// .addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, iconLabel.getPreferredSize().width, GroupLayout.PREFERRED_SIZE)
-// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); //);
-// iconPanelLayout.setVerticalGroup(
-// iconPanelLayout.createSequentialGroup()
-// .addContainerGap()
-// .addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, iconLabel.getPreferredSize().height, GroupLayout.PREFERRED_SIZE)
-// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); //);
-// }
+ protected void initIconPanel(URL background) {
+ if (background == null) {
+ background = getClass().getResource(DEFAULT_BACKGROUND);
+ }
+ if ("file".equals(background.getProtocol())) {
+ log.warn("file:// background images not permitted: " + background);
+ background = getClass().getResource(DEFAULT_BACKGROUND);
+ }
+ log.debug("loading icon panel background " + background);
+
+ iconPanel = new JPanel();
+ JLabel iconLabel = new JLabel();
+ iconLabel.setIcon(new ImageIcon(background));
+
+ GroupLayout iconPanelLayout = new GroupLayout(iconPanel);
+ iconPanel.setLayout(iconPanelLayout);
+ iconPanelLayout.setHorizontalGroup(
+ iconPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
+ // no gap here (contentPanel has containerGap)
+ iconPanelLayout.setVerticalGroup(
+ iconPanelLayout.createSequentialGroup()
+ .addContainerGap()
+ .addComponent(iconLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
+ }
protected void initContentPanel(URL background) {
if (background == null) {
- background = this.getClass().getResource(DEFAULT_BACKGROUND);
+ background = getClass().getResource(DEFAULT_BACKGROUND);
}
if ("file".equals(background.getProtocol())) {
- log.warn("local background image not allowed: " + background);
- background = this.getClass().getResource(DEFAULT_BACKGROUND);
+ log.warn("file:// background images not permitted: " + background);
+ background = getClass().getResource(DEFAULT_BACKGROUND);
}
log.debug("loading background " + background);
contentPanel = new ImagePanel(background);
-// contentPanel.setBorder(new TitledBorder("content"));
-
-// headerPanel = new JPanel();
-// headerPanel.setOpaque(false);
- mainPanel = new JPanel();
- mainPanel.setOpaque(false);
- buttonPanel = new JPanel();
- buttonPanel.setOpaque(false);
-
-// headerPanel.setBorder(new TitledBorder("header"));
-// mainPanel.setBorder(new TitledBorder("main"));
-// buttonPanel.setBorder(new TitledBorder("button"));
-
-// titleLabel = new JLabel();
-// titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
-// java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
-
- helpLabel = new JLabel();
- helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
- helpLabel.getAccessibleContext().setAccessibleName(messages.getString(ALT_HELP));
- helpLabel.addMouseListener(helpListener);
- helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-
- JButton b = new JButton();
-// b.setText(messages.getString(BUTTON_CANCEL));
-// if (b.getPreferredSize().width > buttonSize)
-// buttonSize = b.getPreferredSize().width;
- b.setText(messages.getString(BUTTON_OK));
- if (b.getPreferredSize().width > buttonSize)
- buttonSize = b.getPreferredSize().width;
- b.setText(messages.getString(BUTTON_SIGN));
- if (b.getPreferredSize().width > buttonSize)
- buttonSize = b.getPreferredSize().width;
- b.setText(messages.getString(BUTTON_BACK));
- if (b.getPreferredSize().width > buttonSize)
- buttonSize = b.getPreferredSize().width;
-// b.setText(messages.getString(BUTTON_SAVE));
-// if (b.getPreferredSize().width > buttonSize)
-// buttonSize = b.getPreferredSize().width;
-
-// if (cancelButton.getPreferredSize().width > buttonSize)
-// buttonSize = cancelButton.getPreferredSize().width;
-// if (signButton.getPreferredSize().width > buttonSize)
-// buttonSize = signButton.getPreferredSize().width;
-// if (backButton.getPreferredSize().width > buttonSize)
-// buttonSize = backButton.getPreferredSize().width;
-// if (saveButton.getPreferredSize().width > buttonSize)
-// buttonSize = saveButton.getPreferredSize().width;
+ mainPanel = new JPanel();
+ mainPanel.setOpaque(false);
+ buttonPanel = new JPanel();
+ buttonPanel.setOpaque(false);
+ helpLabel = new JLabel();
+ helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
+ helpLabel.getAccessibleContext().setAccessibleName(messages.getString(ALT_HELP));
+ helpLabel.addMouseListener(helpListener);
+ helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+
+ buttonSize = initButtonSize(messages, renderCancelButton);
-// GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
-// headerPanel.setLayout(headerPanelLayout);
-//
-// headerPanelLayout.setHorizontalGroup(
-// headerPanelLayout.createSequentialGroup()
-// .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
-// headerPanelLayout.setVerticalGroup(
-// headerPanelLayout.createSequentialGroup()
-// .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE));
-
-
- GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
- contentPanel.setLayout(contentPanelLayout);
-
- contentPanelLayout.setHorizontalGroup(
- contentPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(
- contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
-// .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addContainerGap());
- contentPanelLayout.setVerticalGroup(
- contentPanelLayout.createSequentialGroup()
- .addContainerGap()
-// .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED) //, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addContainerGap());
+ if (renderHeaderPanel) {
+ headerPanel = new JPanel();
+ headerPanel.setOpaque(false);
+
+ titleLabel = new JLabel();
+ titleLabel.setFont(titleLabel.getFont().deriveFont(titleLabel.getFont().getStyle() |
+ java.awt.Font.BOLD, titleLabel.getFont().getSize() + 2));
+
+ GroupLayout headerPanelLayout = new GroupLayout(headerPanel);
+ headerPanel.setLayout(headerPanelLayout);
+
+ headerPanelLayout.setHorizontalGroup(
+ headerPanelLayout.createSequentialGroup()
+ .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel));
+ headerPanelLayout.setVerticalGroup(
+ headerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(titleLabel, 0, GroupLayout.PREFERRED_SIZE, Short.MAX_VALUE)
+ .addComponent(helpLabel));
+ }
+
+ GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
+ contentPanel.setLayout(contentPanelLayout);
+
+ GroupLayout.ParallelGroup horizontalContentInner = contentPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+ if (renderHeaderPanel) {
+ horizontalContentInner
+ .addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
+ }
+ horizontalContentInner
+ .addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE);
+ GroupLayout.SequentialGroup horizontalContentOuter = contentPanelLayout.createSequentialGroup();
+ if (!renderIconPanel) {
+ horizontalContentOuter
+ .addContainerGap();
+ }
+ horizontalContentOuter
+ .addGroup(horizontalContentInner)
+ .addContainerGap();
+ contentPanelLayout.setHorizontalGroup(horizontalContentOuter);
+
+ GroupLayout.SequentialGroup verticalContent = contentPanelLayout.createSequentialGroup();
+ verticalContent.addContainerGap();
+ if (renderHeaderPanel) {
+ verticalContent.addComponent(headerPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
+ }
+ verticalContent.addComponent(mainPanel, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
+ .addComponent(buttonPanel, 0, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addContainerGap();
+ contentPanelLayout.setVerticalGroup(verticalContent);
}
@Override
@@ -269,26 +291,35 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_WELCOME));
-
helpListener.setHelpTopic(HELP_WELCOME);
JLabel welcomeMsgLabel = new JLabel();
welcomeMsgLabel.setFont(welcomeMsgLabel.getFont().deriveFont(welcomeMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- welcomeMsgLabel.setText(messages.getString(TITLE_WELCOME));
-
+
+ if (renderHeaderPanel) {
+ titleLabel.setText(messages.getString(TITLE_WELCOME));
+ welcomeMsgLabel.setText(messages.getString(MESSAGE_WAIT));
+ } else {
+ welcomeMsgLabel.setText(messages.getString(TITLE_WELCOME));
+ }
+
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(welcomeMsgLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(welcomeMsgLabel)
- .addComponent(helpLabel));
+ GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(welcomeMsgLabel);
+ GroupLayout.Group messageVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(welcomeMsgLabel);
+ if (!renderHeaderPanel) {
+ messageHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel);
+ messageVertical
+ .addComponent(helpLabel);
+ }
+
+ mainPanelLayout.setHorizontalGroup(messageHorizontal);
+ mainPanelLayout.setVerticalGroup(messageVertical);
contentPanel.validate();
@@ -311,8 +342,10 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_INSERTCARD));
-
+ if (renderHeaderPanel) {
+ titleLabel.setText(messages.getString(TITLE_INSERTCARD));
+ }
+
helpListener.setHelpTopic(HELP_INSERTCARD);
JLabel insertCardMsgLabel = new JLabel();
@@ -322,31 +355,39 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(insertCardMsgLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(insertCardMsgLabel)
- .addComponent(helpLabel));
+ GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(insertCardMsgLabel);
+ GroupLayout.ParallelGroup messageVertical = mainPanelLayout.createParallelGroup()
+ .addComponent(insertCardMsgLabel);
-// JButton cancelButton = new JButton();
-// cancelButton.setText(messages.getString(BUTTON_CANCEL));
-// cancelButton.addActionListener(cancelListener);
-// cancelButton.setActionCommand(cancelCommand);
-//
-// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
-// buttonPanel.setLayout(buttonPanelLayout);
-//
-// buttonPanelLayout.setHorizontalGroup(
-// buttonPanelLayout.createSequentialGroup()
-// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
-// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createSequentialGroup()
-// .addComponent(cancelButton));
+ if (!renderHeaderPanel) {
+ messageHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel);
+ messageVertical
+ .addComponent(helpLabel);
+ }
+
+ mainPanelLayout.setHorizontalGroup(messageHorizontal);
+ mainPanelLayout.setVerticalGroup(messageVertical);
+
+ if (renderCancelButton) {
+ JButton cancelButton = new JButton();
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.addActionListener(cancelListener);
+ cancelButton.setActionCommand(cancelCommand);
+
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
+
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createSequentialGroup()
+ .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createSequentialGroup()
+ .addComponent(cancelButton));
+ }
contentPanel.validate();
}
@@ -373,48 +414,89 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ JLabel insertCardMsgLabel = new JLabel();
+ insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+
+ if (renderHeaderPanel) {
+ titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ insertCardMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
+ } else {
+ insertCardMsgLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ }
helpListener.setHelpTopic(HELP_CARDNOTSUPPORTED);
- JLabel insertCardMsgLabel = new JLabel();
- insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- insertCardMsgLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+ mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(insertCardMsgLabel);
+ GroupLayout.Group messageVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(insertCardMsgLabel);
+ if (!renderHeaderPanel) {
+ messageHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel);
+ messageVertical
+ .addComponent(helpLabel);
+ }
+
+ mainPanelLayout.setHorizontalGroup(messageHorizontal);
+ mainPanelLayout.setVerticalGroup(messageVertical);
+
+ if (renderCancelButton) {
+ JButton cancelButton = new JButton();
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.addActionListener(cancelListener);
+ cancelButton.setActionCommand(cancelCommand);
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
+ GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
+ buttonPanel.setLayout(buttonPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(insertCardMsgLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(insertCardMsgLabel)
- .addComponent(helpLabel));
-
-// JButton cancelButton = new JButton();
-// cancelButton.setText(messages.getString(BUTTON_CANCEL));
-// cancelButton.addActionListener(cancelListener);
-// cancelButton.setActionCommand(cancelCommand);
-//
-// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
-// buttonPanel.setLayout(buttonPanelLayout);
-//
-// buttonPanelLayout.setHorizontalGroup(
-// buttonPanelLayout.createSequentialGroup()
-// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
-// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createSequentialGroup()
-// .addComponent(cancelButton));
-
- contentPanel.validate();
+ buttonPanelLayout.setHorizontalGroup(
+ buttonPanelLayout.createSequentialGroup()
+ .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
+ buttonPanelLayout.setVerticalGroup(
+ buttonPanelLayout.createSequentialGroup()
+ .addComponent(cancelButton));
+ }
+
+ contentPanel.validate();
}
});
}
+ private static int initButtonSize(ResourceBundle messages, boolean renderCancelButton) {
+
+ int buttonSize = 0;
+
+ JButton b = new JButton();
+ b.setText(messages.getString(BUTTON_OK));
+ if (b.getPreferredSize().width > buttonSize) {
+ buttonSize = b.getPreferredSize().width;
+ }
+ b.setText(messages.getString(BUTTON_SIGN));
+ if (b.getPreferredSize().width > buttonSize) {
+ buttonSize = b.getPreferredSize().width;
+ }
+ b.setText(messages.getString(BUTTON_BACK));
+ if (b.getPreferredSize().width > buttonSize) {
+ buttonSize = b.getPreferredSize().width;
+ }
+ b.setText(messages.getString(BUTTON_SAVE));
+ if (b.getPreferredSize().width > buttonSize) {
+ buttonSize = b.getPreferredSize().width;
+ }
+ if (renderCancelButton) {
+ b.setText(messages.getString(BUTTON_CANCEL));
+ if (b.getPreferredSize().width > buttonSize) {
+ buttonSize = b.getPreferredSize().width;
+ }
+ }
+ return buttonSize;
+ }
+
private void showCardPINDialog(final PINSpec pinSpec, final int numRetries, final ActionListener okListener, final String okCommand, final ActionListener cancelListener, final String cancelCommand) {
log.debug("scheduling card-pin dialog");
@@ -429,17 +511,14 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// if (numRetries < 0) {
-// String cardpinTitle = messages.getString(TITLE_CARDPIN);
-// titleLabel.setText(MessageFormat.format(cardpinTitle, new Object[]{pinSpec.getLocalizedName()}));
-// } else {
-// titleLabel.setText(messages.getString(TITLE_RETRY));
-// }
-
-// JButton cancelButton = new JButton();
-// cancelButton.setText(messages.getString(BUTTON_CANCEL));
-// cancelButton.setActionCommand(cancelCommand);
-// cancelButton.addActionListener(cancelListener);
+ if (renderHeaderPanel) {
+ if (numRetries < 0) {
+ String cardpinTitle = messages.getString(TITLE_CARDPIN);
+ titleLabel.setText(MessageFormat.format(cardpinTitle, new Object[]{pinSpec.getLocalizedName()}));
+ } else {
+ titleLabel.setText(messages.getString(TITLE_RETRY));
+ }
+ }
JButton okButton = new JButton();
okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -492,55 +571,73 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addGroup(mainPanelLayout.createSequentialGroup()
+ GroupLayout.ParallelGroup mainHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+ GroupLayout.SequentialGroup pinHorizontal = mainPanelLayout.createSequentialGroup()
.addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
.addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
- .addComponent(pinsizeLabel))));
-
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel)
- .addComponent(helpLabel))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(cardPinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel));
+ .addComponent(pinsizeLabel));
+
+ GroupLayout.SequentialGroup mainVertical = mainPanelLayout.createSequentialGroup();
+
+ if (!renderHeaderPanel) {
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(infoLabel) //, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel); //, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ mainHorizontal
+ .addGroup(infoHorizontal)
+ .addGroup(pinHorizontal);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel)
+ .addComponent(helpLabel);
+ mainVertical
+ .addGroup(infoVertical)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
+ } else {
+ mainHorizontal
+ .addGroup(pinHorizontal);
+ }
+ mainVertical
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(cardPinLabel)
+ .addComponent(pinField))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel);
+
+ mainPanelLayout.setHorizontalGroup(mainHorizontal);
+ mainPanelLayout.setVerticalGroup(mainVertical);
+
+
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
- buttonPanelLayout.setHorizontalGroup(
- buttonPanelLayout.createSequentialGroup()
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
- buttonPanelLayout.setVerticalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addComponent(okButton));
-
-// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
-// buttonPanel.setLayout(buttonPanelLayout);
-//
-// buttonPanelLayout.setHorizontalGroup(
-// buttonPanelLayout.createSequentialGroup()
-// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
-// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
-// .addComponent(okButton)
-// .addComponent(cancelButton));
+ .addComponent(okButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
+ GroupLayout.Group buttonVertical;
+
+ if (renderCancelButton) {
+ JButton cancelButton = new JButton();
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+
+ buttonHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
+ buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(okButton)
+ .addComponent(cancelButton);
+ } else {
+ buttonVertical = buttonPanelLayout.createSequentialGroup()
+ .addComponent(okButton);
+ }
+
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
pinField.requestFocusInWindow();
contentPanel.validate();
@@ -583,16 +680,13 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// if (numRetries < 0) {
-// titleLabel.setText(messages.getString(TITLE_SIGN));
-// } else {
-// titleLabel.setText(messages.getString(TITLE_RETRY));
-// }
-
-// JButton cancelButton = new JButton();
-// cancelButton.setText(messages.getString(BUTTON_CANCEL));
-// cancelButton.setActionCommand(cancelCommand);
-// cancelButton.addActionListener(cancelListener);
+ if (renderHeaderPanel) {
+ if (numRetries < 0) {
+ titleLabel.setText(messages.getString(TITLE_SIGN));
+ } else {
+ titleLabel.setText(messages.getString(TITLE_RETRY));
+ }
+ }
JButton signButton = new JButton();
signButton.setFont(signButton.getFont().deriveFont(signButton.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -653,13 +747,23 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
+
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(infoLabel);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel);
+
+ if (!renderHeaderPanel) {
+ infoHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel); //, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
+ infoVertical
+ .addComponent(helpLabel);
+ }
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
+ .addGroup(infoHorizontal)
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
@@ -669,9 +773,7 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel)
- .addComponent(helpLabel))
+ .addGroup(infoVertical)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
.addComponent(signPinLabel)
@@ -682,27 +784,31 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
- buttonPanelLayout.setHorizontalGroup(
- buttonPanelLayout.createSequentialGroup()
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(signButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
- buttonPanelLayout.setVerticalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addComponent(signButton));
-
-// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
-// buttonPanel.setLayout(buttonPanelLayout);
-//
-// buttonPanelLayout.setHorizontalGroup(
-// buttonPanelLayout.createSequentialGroup()
-// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(signButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
-// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
-// .addComponent(signButton)
-// .addComponent(cancelButton));
+ .addComponent(signButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
+ GroupLayout.Group buttonVertical;
+
+ if (renderCancelButton) {
+ JButton cancelButton = new JButton();
+ cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setActionCommand(cancelCommand);
+ cancelButton.addActionListener(cancelListener);
+
+ buttonHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cancelButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
+
+ buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(signButton)
+ .addComponent(cancelButton);
+ } else {
+ buttonVertical = buttonPanelLayout.createSequentialGroup()
+ .addComponent(signButton);
+ }
+
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
pinField.requestFocusInWindow();
contentPanel.validate();
@@ -726,15 +832,12 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_ERROR));
+ if (renderHeaderPanel) {
+ titleLabel.setText(messages.getString(TITLE_ERROR));
+ }
helpListener.setHelpTopic(errorMsgKey);
- JLabel errorTitleLabel = new JLabel();
- errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
- errorTitleLabel.setText(messages.getString(TITLE_ERROR));
- errorTitleLabel.setForeground(ERROR_COLOR);
-
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -745,19 +848,30 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(errorTitleLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(errorMsgLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(errorTitleLabel)
- .addComponent(helpLabel))
- .addComponent(errorMsgLabel));
+ GroupLayout.ParallelGroup mainHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+ GroupLayout.SequentialGroup mainVertical = mainPanelLayout.createSequentialGroup();
+
+ if (!renderHeaderPanel) {
+ JLabel errorTitleLabel = new JLabel();
+ errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ errorTitleLabel.setText(messages.getString(TITLE_ERROR));
+ errorTitleLabel.setForeground(ERROR_COLOR);
+
+ mainHorizontal
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(errorTitleLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel));
+ mainVertical
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(errorTitleLabel)
+ .addComponent(helpLabel));
+ }
+
+ mainPanelLayout.setHorizontalGroup(mainHorizontal
+ .addComponent(errorMsgLabel));
+ mainPanelLayout.setVerticalGroup(mainVertical
+ .addComponent(errorMsgLabel));
JButton okButton = new JButton();
okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
@@ -796,15 +910,12 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_ERROR));
+ if (renderHeaderPanel) {
+ titleLabel.setText(messages.getString(TITLE_ERROR));
+ }
helpListener.setHelpTopic(errorMsgKey);
- JLabel errorTitleLabel = new JLabel();
- errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
- errorTitleLabel.setText(messages.getString(TITLE_ERROR));
- errorTitleLabel.setForeground(ERROR_COLOR);
-
String errorMsgPattern = messages.getString(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
@@ -815,20 +926,32 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+
+ GroupLayout.ParallelGroup mainHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+ GroupLayout.SequentialGroup mainVertical = mainPanelLayout.createSequentialGroup();
+
+ if (!renderHeaderPanel) {
+ JLabel errorTitleLabel = new JLabel();
+ errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ errorTitleLabel.setText(messages.getString(TITLE_ERROR));
+ errorTitleLabel.setForeground(ERROR_COLOR);
+
+ mainHorizontal
.addGroup(mainPanelLayout.createSequentialGroup()
.addComponent(errorTitleLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(errorMsgLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
+ .addComponent(helpLabel));
+ mainVertical
.addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addComponent(errorTitleLabel)
- .addComponent(helpLabel))
- .addComponent(errorMsgLabel));
+ .addComponent(helpLabel));
+ }
+ mainPanelLayout.setHorizontalGroup(mainHorizontal
+ .addComponent(errorMsgLabel));
+ mainPanelLayout.setVerticalGroup(mainVertical
+ .addComponent(errorMsgLabel));
+
contentPanel.validate();
}
});
@@ -849,8 +972,10 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_WAIT));
-
+ if (renderHeaderPanel) {
+ titleLabel.setText(messages.getString(TITLE_WAIT));
+ }
+
helpListener.setHelpTopic(HELP_WAIT);
JLabel waitMsgLabel = new JLabel();
@@ -864,15 +989,20 @@ public class SimpleGUI implements BKUGUIFacade {
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createSequentialGroup()
- .addComponent(waitMsgLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(waitMsgLabel)
- .addComponent(helpLabel));
+ GroupLayout.SequentialGroup messageHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(waitMsgLabel);
+ GroupLayout.ParallelGroup messageVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(waitMsgLabel);
+
+ if (!renderHeaderPanel) {
+ messageHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel);
+ messageVertical
+ .addComponent(helpLabel);
+ }
+ mainPanelLayout.setHorizontalGroup(messageHorizontal);
+ mainPanelLayout.setVerticalGroup(messageVertical);
contentPanel.validate();
}
@@ -887,50 +1017,58 @@ public class SimpleGUI implements BKUGUIFacade {
return null;
}
+ /**
+ * TODO handle multiple references in HashDataViewer
+ * @param signedReferences
+ * @param okListener
+ * @param okCommand
+ */
@Override
- public void showHashDataInputDialog(final List signedReferences, boolean standalone, final ActionListener okListener, final String okCommand) {
+ public void showHashDataInputDialog(final List signedReferences, final ActionListener okListener, final String okCommand) {
if (signedReferences == null) {
showErrorDialog(messages.getString(ERR_NO_HASHDATA), new Object[] {"No SignedReferences provided"}, okListener, okCommand);
+ return;
}
+ ActionListener saveHashDataListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
+ }
+ };
+
if (signedReferences.size() == 1) {
- if (standalone) {
- ActionListener saveHashDataListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
- }
- };
- showHashDataViewer(signedReferences, saveHashDataListener, "save");
+// if (standalone) {
- } else {
- if ("text/plain".equals(signedReferences.get(0).getMimeType())) {
-
- ActionListener saveHashDataListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
- }
- };
-
- try {
- String hashDataText = getText(signedReferences.get(0));
- showPlainTextHashDataInputDialog(hashDataText, saveHashDataListener, "save", okListener, okCommand);
- } catch (IOException ex) {
- showErrorDialog(messages.getString(ERR_NO_HASHDATA), new Object[] {ex.getMessage()}, okListener, okCommand);
- }
+ showHashDataViewer(signedReferences, saveHashDataListener, "save");
- } else {
- showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
- }
- }
+// } else {
+// if ("text/plain".equals(signedReferences.get(0).getMimeType())) {
+//
+// ActionListener saveHashDataListener = new ActionListener() {
+//
+// @Override
+// public void actionPerformed(ActionEvent e) {
+// showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
+// }
+// };
+//
+// try {
+// String hashDataText = getText(signedReferences.get(0));
+// showPlainTextHashDataInputDialog(hashDataText, saveHashDataListener, "save", okListener, okCommand);
+// } catch (IOException ex) {
+// showErrorDialog(messages.getString(ERR_NO_HASHDATA), new Object[] {ex.getMessage()}, okListener, okCommand);
+// }
+//
+// } else {
+// showSaveHashDataInputDialog(signedReferences, okListener, okCommand);
+// }
+// }
} else {
- SimpleHashDataTableModel tableModel = new SimpleHashDataTableModel(signedReferences);
// final HashDataTableModel tableModel = new HashDataTableModel(signedReferences);
//
// ActionListener saveHashDataListener = new ActionListener() {
@@ -940,128 +1078,112 @@ public class SimpleGUI implements BKUGUIFacade {
// showSaveHashDataInputDialog(tableModel.getSelectedHashData(), okListener, okCommand);
// }
// };
- showMultipleHashDataInputDialog(tableModel, okListener, okCommand);
+
+ SimpleHashDataTableModel tableModel = new SimpleHashDataTableModel(signedReferences);
+ showMultipleHashDataInputDialog(tableModel, okListener, okCommand, saveHashDataListener, "save");
}
}
/**
- * TODO
+ * blocks until dialog returns (is closed)
* @param hashDataText
* @param saveListener
* @param saveCommand
*/
private void showHashDataViewer(final List signedReferences, final ActionListener saveListener, final String saveCommand) {
- log.debug("scheduling plaintext hashdatainput dialog");
-
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("show plaintext hashdatainput dialog");
-
- ActionListener l = helpListener.getActionListener();
- HashDataViewer.showHashDataInput(contentPane, signedReferences, messages, saveListener, saveCommand, l);
- }
- });
- }
-
- private void showPlainTextHashDataInputDialog(final String hashDataText, final ActionListener saveListener, final String saveCommand, final ActionListener cancelListener, final String cancelCommand) {
-
- log.debug("scheduling plaintext hashdatainput dialog");
- SwingUtilities.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("show plaintext hashdatainput dialog");
-
- mainPanel.removeAll();
- buttonPanel.removeAll();
-
-// titleLabel.setText(messages.getString(TITLE_HASHDATA));
-
- helpListener.setHelpTopic(HELP_HASHDATA);
-
- JLabel refIdLabel = new JLabel();
- refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- refIdLabel.setText(messages.getString(MESSAGE_HASHDATA)); //MessageFormat.format(refIdLabelPattern, new Object[]{refId}));
-
- JTextArea hashDataTextArea = new JTextArea(hashDataText);
- hashDataTextArea.setEditable(false);
-// hashDataTextArea.setColumns(1);
-// hashDataTextArea.setRows(1);
- hashDataTextArea.setFont(new Font(HASHDATA_FONT, hashDataTextArea.getFont().getStyle(), hashDataTextArea.getFont().getSize()));
-// hashDataScrollPane.setViewportView(hashDataTextArea);
-// hashDataScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); //HORIZONTAL_SCROLLBAR_NEVER);
- hashDataTextArea.setLineWrap(true);
- hashDataTextArea.setWrapStyleWord(true);
-
- JScrollPane hashDataScrollPane = new JScrollPane(hashDataTextArea);
-
- GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(refIdLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel))
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
-
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(refIdLabel)
- .addComponent(helpLabel))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
-
- JButton backButton = new JButton();
- backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- backButton.setText(messages.getString(BUTTON_BACK));
- backButton.setActionCommand(cancelCommand);
- backButton.addActionListener(cancelListener);
+ try {
+ log.debug("scheduling plaintext hashdatainput dialog");
-// JButton saveButton = new JButton();
-// saveButton.setText(messages.getString(BUTTON_SAVE));
-// saveButton.setActionCommand(saveCommand);
-// saveButton.addActionListener(saveListener);
+ SwingUtilities.invokeAndWait(new Runnable() {
- GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
- buttonPanel.setLayout(buttonPanelLayout);
+ @Override
+ public void run() {
- buttonPanelLayout.setHorizontalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(backButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
- buttonPanelLayout.setVerticalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addComponent(backButton));
+ log.debug("show plaintext hashdatainput dialog");
+ ActionListener l = helpListener.getActionListener();
+ HashDataViewer.showHashDataInput(contentPane, signedReferences, messages, saveListener, saveCommand, l);
+ }
+ });
+
+ } catch (InterruptedException ex) {
+ log.error("Failed to display HashDataViewer: " + ex.getMessage());
+ } catch (InvocationTargetException ex) {
+ log.error("Failed to display HashDataViewer: " + ex.getMessage());
+ }
+ }
+
+// private void showPlainTextHashDataInputDialog(final String hashDataText, final ActionListener saveListener, final String saveCommand, final ActionListener cancelListener, final String cancelCommand) {
+//
+// log.debug("scheduling plaintext hashdatainput dialog");
+//
+// SwingUtilities.invokeLater(new Runnable() {
+//
+// @Override
+// public void run() {
+//
+// log.debug("show plaintext hashdatainput dialog");
+//
+// mainPanel.removeAll();
+// buttonPanel.removeAll();
+//
+// helpListener.setHelpTopic(HELP_HASHDATA);
+//
+// JLabel refIdLabel = new JLabel();
+// refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
+// refIdLabel.setText(messages.getString(MESSAGE_HASHDATA)); //MessageFormat.format(refIdLabelPattern, new Object[]{refId}));
+//
+// JTextArea hashDataTextArea = new JTextArea(hashDataText);
+// hashDataTextArea.setEditable(false);
+// hashDataTextArea.setFont(new Font(HASHDATA_FONT, hashDataTextArea.getFont().getStyle(), hashDataTextArea.getFont().getSize()));
+// hashDataTextArea.setLineWrap(true);
+// hashDataTextArea.setWrapStyleWord(true);
+//
+// JScrollPane hashDataScrollPane = new JScrollPane(hashDataTextArea);
+//
+// GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
+// mainPanel.setLayout(mainPanelLayout);
+//
+// mainPanelLayout.setHorizontalGroup(
+// mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+// .addGroup(mainPanelLayout.createSequentialGroup()
+// .addComponent(refIdLabel)
+// .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+// .addComponent(helpLabel))
+// .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+//
+// mainPanelLayout.setVerticalGroup(
+// mainPanelLayout.createSequentialGroup()
+// .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+// .addComponent(refIdLabel)
+// .addComponent(helpLabel))
+// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+// .addComponent(hashDataScrollPane, 0, 0, Short.MAX_VALUE));
+//
+// JButton backButton = new JButton();
+// backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
+// backButton.setText(messages.getString(BUTTON_BACK));
+// backButton.setActionCommand(cancelCommand);
+// backButton.addActionListener(cancelListener);
+//
// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
// buttonPanel.setLayout(buttonPanelLayout);
//
// buttonPanelLayout.setHorizontalGroup(
// buttonPanelLayout.createSequentialGroup()
// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(saveButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
// .addComponent(backButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
-// .addComponent(saveButton)
-// .addComponent(backButton));
-
- contentPanel.validate();
- }
- });
- }
+// buttonPanelLayout.createSequentialGroup()
+// .addComponent(backButton));
+//
+// contentPanel.validate();
+// }
+// });
+// }
- private void showMultipleHashDataInputDialog(final TableModel signedReferences, final ActionListener cancelListener, final String cancelCommand) {
-// , final ActionListener saveListener, final String saveCommand
+ private void showMultipleHashDataInputDialog(final TableModel signedReferences, final ActionListener cancelListener, final String cancelCommand, final ActionListener saveListener, final String saveCommand) {
log.debug("scheduling multiple hashdatainput dialog");
@@ -1075,8 +1197,10 @@ public class SimpleGUI implements BKUGUIFacade {
mainPanel.removeAll();
buttonPanel.removeAll();
-// titleLabel.setText(messages.getString(TITLE_HASHDATA));
-
+ if (renderHeaderPanel) {
+ titleLabel.setText(messages.getString(TITLE_HASHDATA));
+ }
+
helpListener.setHelpTopic(HELP_HASHDATALIST);
JLabel refIdLabel = new JLabel();
@@ -1124,36 +1248,31 @@ public class SimpleGUI implements BKUGUIFacade {
backButton.setActionCommand(cancelCommand);
backButton.addActionListener(cancelListener);
-// JButton saveButton = new JButton();
-// saveButton.setText(messages.getString(BUTTON_SAVE));
-// saveButton.setActionCommand(saveCommand);
-// saveButton.addActionListener(saveListener);
-
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
- buttonPanelLayout.setHorizontalGroup(
- buttonPanelLayout.createSequentialGroup()
+ GroupLayout.SequentialGroup buttonHorizontal = buttonPanelLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(backButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
- buttonPanelLayout.setVerticalGroup(
- buttonPanelLayout.createSequentialGroup()
- .addComponent(backButton));
-
-
-// GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
-// buttonPanel.setLayout(buttonPanelLayout);
-//
-// buttonPanelLayout.setHorizontalGroup(
-// buttonPanelLayout.createSequentialGroup()
-// .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
-// .addComponent(saveButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE)
-// .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
-// .addComponent(backButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE));
-// buttonPanelLayout.setVerticalGroup(
-// buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
-// .addComponent(saveButton)
-// .addComponent(backButton));
+ .addComponent(backButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
+ GroupLayout.ParallelGroup buttonVertical = buttonPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(backButton);
+
+ if (renderCancelButton) {
+ //render save button
+ JButton saveButton = new JButton();
+ saveButton.setText(messages.getString(BUTTON_SAVE));
+ saveButton.setActionCommand(saveCommand);
+ saveButton.addActionListener(saveListener);
+
+ buttonHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(backButton, GroupLayout.PREFERRED_SIZE, buttonSize, GroupLayout.PREFERRED_SIZE);
+ buttonVertical
+ .addComponent(saveButton);
+ }
+
+ buttonPanelLayout.setHorizontalGroup(buttonHorizontal);
+ buttonPanelLayout.setVerticalGroup(buttonVertical);
contentPanel.validate();
}
@@ -1243,36 +1362,36 @@ public class SimpleGUI implements BKUGUIFacade {
});
}
- private static String getText(HashDataInput hdi) throws IOException {
- ByteArrayOutputStream baos = null;
- try {
- InputStream hashDataIS = hdi.getHashDataInput();
- if (hashDataIS == null) {
- log.error("No HashDataInput stream for reference " + hdi.getReferenceId());
- return null;
- } else {
- baos = new ByteArrayOutputStream(hashDataIS.available());
- int c;
- while ((c = hashDataIS.read()) != -1) {
- baos.write(c);
- }
- String encoding = hdi.getEncoding();
- if (encoding == null) {
- //default for URL-encoded
- encoding = "UTF-8";
- }
- return baos.toString(encoding);
- }
- } catch (IOException ex) {
- log.error("Failed to read HashDataInput for reference " + hdi.getReferenceId() + ": " + ex.getMessage());
- throw ex;
- } finally {
- try {
- baos.close();
- } catch (IOException ex) {
- }
- }
- }
+// private static String getText(HashDataInput hdi) throws IOException {
+// ByteArrayOutputStream baos = null;
+// try {
+// InputStream hashDataIS = hdi.getHashDataInput();
+// if (hashDataIS == null) {
+// log.error("No HashDataInput stream for reference " + hdi.getReferenceId());
+// return null;
+// } else {
+// baos = new ByteArrayOutputStream(hashDataIS.available());
+// int c;
+// while ((c = hashDataIS.read()) != -1) {
+// baos.write(c);
+// }
+// String encoding = hdi.getEncoding();
+// if (encoding == null) {
+// //default for URL-encoded
+// encoding = "UTF-8";
+// }
+// return baos.toString(encoding);
+// }
+// } catch (IOException ex) {
+// log.error("Failed to read HashDataInput for reference " + hdi.getReferenceId() + ": " + ex.getMessage());
+// throw ex;
+// } finally {
+// try {
+// baos.close();
+// } catch (IOException ex) {
+// }
+// }
+// }
private void registerHelpListener(ActionListener helpListener) {
if (helpListener != null) {
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 5f62c05a..b5a74ac1 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -14,7 +14,7 @@
# limitations under the License.
title.welcome=Willkommen
-title.insertcard=Bitte B\u00FCrgerkarte in den Kartenleser stecken
+title.insertcard=Keine B\u00FCrgerkarte gefunden
title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
title.cardpin={0} eingeben
title.sign=Signatur erstellen
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index d963fd5f..94464982 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -14,7 +14,7 @@
# limitations under the License.
title.welcome=Welcome
-title.insertcard=Please insert your citizen-card into the reader
+title.insertcard=No citizen-card found
title.cardnotsupported=This card is not supported
title.cardpin=Enter {0}
title.sign=Create signature
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
index c32a237a..b57e1923 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
@@ -32,15 +32,16 @@ import org.junit.Test;
*
* @author clemens
*/
+@Ignore
public class BKUGUITest {
- @Ignore
+ @Test
public void testBKUGUI() {
JFrame testFrame = new JFrame("BKUGUITest");
BKUGUI gui = new BKUGUI();
Container contentPane = testFrame.getContentPane();
contentPane.setPreferredSize(new Dimension(380, 150));
- gui.init(contentPane, null, null, null);
+ gui.init(contentPane, null, BKUGUIFacade.Style.advanced, null, null);
BKUGUIWorker worker = new BKUGUIWorker();
worker.init(gui);
testFrame.pack();
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index af1368e5..e4936067 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -43,7 +43,7 @@ public class BKUGUIWorker implements Runnable {
@Override
public void run() {
- try {
+// try {
final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Signatur-PIN");
@@ -176,7 +176,7 @@ public class BKUGUIWorker implements Runnable {
// signedRefs.add(signedRef4);
// signedRefs.add(signedRef4);
// signedRefs = Collections.singletonList(signedRef1);
- gui.showHashDataInputDialog(signedRefs, true, returnListener, "return");
+ gui.showHashDataInputDialog(signedRefs, returnListener, "return");
}
};
@@ -184,64 +184,64 @@ public class BKUGUIWorker implements Runnable {
gui.showWelcomeDialog();
- Thread.sleep(2000);
-
- gui.showWaitDialog(null);
-
- Thread.sleep(1000);
-
- gui.showWaitDialog("test");
-
- Thread.sleep(1000);
-
-
- gui.showInsertCardDialog(cancelListener, "cancel");
-
- Thread.sleep(2000);
-
- gui.showCardNotSupportedDialog(cancelListener, "cancel");
-
- Thread.sleep(2000);
-
- PINSpec cardPinSpec = new PINSpec(4, 4, "[0-9]", "Karten-PIN");
-
- gui.showCardPINDialog(cardPinSpec, okListener, "ok", cancelListener, "cancel");
-
- Thread.sleep(2000);
-
- gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
-
- Thread.sleep(4000);
-
- gui.showSignaturePINRetryDialog(signPinSpec, 2, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
-
- Thread.sleep(2000);
-
- gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {"Testfehler"}, null, null);
-
- Thread.sleep(2000);
-
- gui.showErrorDialog("error.test", new Object[] {"Testfehler", "noch ein TestFehler"});
-
- Thread.sleep(2000);
-
- gui.showErrorDialog("error.no.hashdata", null);
-
- Thread.sleep(2000);
-
- gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {"Testfehler"});
-
- Thread.sleep(2000);
-
- gui.showErrorDialog("error.unknown", null);
+// Thread.sleep(2000);
+//
+// gui.showWaitDialog(null);
+//
+// Thread.sleep(1000);
+//
+// gui.showWaitDialog("test");
+//
+// Thread.sleep(1000);
+//
+//
+// gui.showInsertCardDialog(cancelListener, "cancel");
+//
+// Thread.sleep(2000);
+//
+// gui.showCardNotSupportedDialog(cancelListener, "cancel");
+//
+// Thread.sleep(2000);
+//
+// PINSpec cardPinSpec = new PINSpec(4, 4, "[0-9]", "Karten-PIN");
+//
+// gui.showCardPINDialog(cardPinSpec, okListener, "ok", cancelListener, "cancel");
+//
+// Thread.sleep(2000);
+//
+// gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
+//
+// Thread.sleep(4000);
+//
+// gui.showSignaturePINRetryDialog(signPinSpec, 2, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
+//
+// Thread.sleep(2000);
+//
+// gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {"Testfehler"}, null, null);
+//
+// Thread.sleep(2000);
+//
+// gui.showErrorDialog("error.test", new Object[] {"Testfehler", "noch ein TestFehler"});
+//
+// Thread.sleep(2000);
+//
+// gui.showErrorDialog("error.no.hashdata", null);
+//
+// Thread.sleep(2000);
+//
+// gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, new Object[] {"Testfehler"});
+//
+// Thread.sleep(2000);
+//
+// gui.showErrorDialog("error.unknown", null);
// gui.showTextPlainHashDataInput("hallo,\n welt!", "12345", null, "cancel", null, "save");
// gui.showTextPlainHashDataInput("hallo,\n welt!", "12345", null, "cancel", null, "save");
// Thread.sleep(2000);
- } catch (InterruptedException ex) {
- ex.printStackTrace();
- }
+// } catch (InterruptedException ex) {
+// ex.printStackTrace();
+// }
}
}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
index fb8f2432..eaa4d6ad 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java
@@ -37,10 +37,10 @@ public class BKUGuiProxy implements BKUGUIFacade {
return delegate.getPin();
}
- @Override
- public void init(Container contentPane, Locale locale, URL bgImage, ActionListener helpListener) {
- delegate.init(contentPane, locale, bgImage, helpListener);
- }
+// @Override
+// public void init(Container contentPane, Locale locale, URL bgImage, ActionListener helpListener) {
+// delegate.init(contentPane, locale, bgImage, helpListener);
+// }
@Override
public Locale getLocale() {
@@ -126,11 +126,9 @@ public class BKUGuiProxy implements BKUGUIFacade {
@Override
public void showHashDataInputDialog(List signedReferences,
- boolean externalDisplay,
ActionListener okListener,
String okCommand) {
showDialog();
- delegate.showHashDataInputDialog(signedReferences, externalDisplay, okListener,
- okCommand);
+ delegate.showHashDataInputDialog(signedReferences, okListener, okCommand);
}
}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
index 19e6a657..bfce0f0d 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSignRequestHandler.java
@@ -109,7 +109,7 @@ public class LocalSignRequestHandler extends SignRequestHandler {
log.error("dsig:SignedInfo does not contain a data reference");
throw new Exception("dsig:SignedInfo does not contain a data reference");
}
- gui.showHashDataInputDialog(selectedHashDataInputs, false, this, "ok");
+ gui.showHashDataInputDialog(selectedHashDataInputs, this, "ok");
}
private ByteArrayHashDataInput getByteArrayHashDataInput(HashDataInput hashDataInput) throws IOException {
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
index cad8cfb6..7012fec0 100644
--- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
+++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java
@@ -48,7 +48,6 @@ public class SMCCSTALFactory implements STALFactory {
if (locale != null) {
dialog.setLocale(locale);
}
- BKUGUIFacade gui = BKUGUIFactory.createGUI(BKUGUIFactory.ADVANCED_GUI);
DefaultHelpListener helpListener = null;
try {
if (helpURL != null) {
@@ -60,7 +59,11 @@ public class SMCCSTALFactory implements STALFactory {
} catch (MalformedURLException ex) {
log.error("failed to configure help listener: " + ex.getMessage(), ex);
}
- gui.init(dialog.getContentPane(), dialog.getLocale(), null, helpListener);
+ BKUGUIFacade gui = BKUGUIFactory.createGUI(dialog.getContentPane(),
+ dialog.getLocale(),
+ BKUGUIFactory.ADVANCED_GUI,
+ null,
+ helpListener);
stal = new SMCCSTAL(new BKUGuiProxy(dialog, gui), dialog);
dialog.setPreferredSize(new Dimension(400, 200));
dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
diff --git a/BKUOnline/src/main/webapp/HTTP-ohne.html b/BKUOnline/src/main/webapp/HTTP-ohne.html
index 112a1d92..607fa5d4 100644
--- a/BKUOnline/src/main/webapp/HTTP-ohne.html
+++ b/BKUOnline/src/main/webapp/HTTP-ohne.html
@@ -101,7 +101,7 @@ legend {
Frame
Browser
- Applet
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index 9d23315c..38247174 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -38,6 +38,8 @@ import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.swing.CellRendererPane;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
@@ -50,8 +52,12 @@ import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.LayoutStyle;
+import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import javax.swing.table.TableCellRenderer;
+import javax.swing.table.TableColumn;
import javax.swing.table.TableModel;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -1013,80 +1019,75 @@ public class BKUGUIImpl implements BKUGUIFacade {
}
if (signedReferences.size() == 1) {
- ActionListener saveHashDataListener = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- HashDataInput hdi = signedReferences.get(0);
- showSaveHashDataInputDialog(Collections.singletonList(hdi), okListener, okCommand);
- }
- };
- showHashDataViewer(signedReferences.get(0), saveHashDataListener, "save");
+ try {
+ log.debug("scheduling hashdata viewer");
+
+ SwingUtilities.invokeAndWait(new Runnable() {
+
+ @Override
+ public void run() {
+ ActionListener saveHashDataListener = new ActionListener() {
+
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ HashDataInput hdi = signedReferences.get(0);
+ showSaveHashDataInputDialog(Collections.singletonList(hdi), okListener, okCommand);
+ }
+ };
+ showHashDataViewer(signedReferences.get(0), saveHashDataListener, "save");
+ }
+ });
+
+ } catch (InterruptedException ex) {
+ log.error("Failed to display HashDataViewer: " + ex.getMessage());
+ } catch (InvocationTargetException ex) {
+ log.error("Failed to display HashDataViewer: " + ex.getMessage());
+ }
} else {
- HashDataTableModel tableModel = new HashDataTableModel(signedReferences);
- showSignedReferencesListDialog(tableModel, okListener, okCommand);
+ showSignedReferencesListDialog(signedReferences, okListener, okCommand);
}
}
/**
* Opens HashDataViewer on mouse clicked event
*/
- public class HashDataMouseListener extends MouseAdapter {
-
- private HashDataInput hashData;
-
- public void setHashData(HashDataInput hashData) {
- this.hashData = hashData;
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- ActionListener saveListener = new ActionListener() {
-
- @Override
- public void actionPerformed(ActionEvent e) {
- showSaveHashDataInputDialog(Collections.singletonList(hashData), null, null);
- }
- };
- showHashDataViewer(hashData, saveListener, "save");
- super.mouseClicked(e);
- }
-
-
-
- }
+// public class HashDataMouseListener extends MouseAdapter {
+//
+// private HashDataInput hashData;
+//
+// public void setHashData(HashDataInput hashData) {
+// this.hashData = hashData;
+// }
+//
+// @Override
+// public void mouseClicked(MouseEvent e) {
+// ActionListener saveListener = new ActionListener() {
+//
+// @Override
+// public void actionPerformed(ActionEvent e) {
+// showSaveHashDataInputDialog(Collections.singletonList(hashData), null, null);
+// }
+// };
+// showHashDataViewer(hashData, saveListener, "save");
+// super.mouseClicked(e);
+// }
+// }
/**
- * blocks until dialog returns (is closed)
+ * has to be called from event dispatcher thread
* @param hashDataText
* @param saveListener
* @param saveCommand
*/
private void showHashDataViewer(final HashDataInput hashDataInput, final ActionListener saveListener, final String saveCommand) {
- try {
- log.debug("scheduling plaintext hashdatainput dialog");
-
- // avoid double-clicks on hashdata link
- SwingUtilities.invokeAndWait(new Runnable() {
-
- @Override
- public void run() {
-
- log.debug("show plaintext hashdatainput dialog");
+ log.debug("show hashdata viewer");
- ActionListener l = helpListener.getActionListener();
- HashDataViewer.showHashDataInput(contentPane, hashDataInput, messages, saveListener, saveCommand, l);
- }
- });
-
- } catch (InterruptedException ex) {
- log.error("Failed to display HashDataViewer: " + ex.getMessage());
- } catch (InvocationTargetException ex) {
- log.error("Failed to display HashDataViewer: " + ex.getMessage());
- }
+ ActionListener l = helpListener.getActionListener();
+ HashDataViewer.showHashDataInput(contentPane, hashDataInput, messages, saveListener, saveCommand, l);
}
- private void showSignedReferencesListDialog(final HashDataTableModel signedReferences, final ActionListener backListener, final String backCommand) {
+ private void showSignedReferencesListDialog(final List signedReferences, final ActionListener backListener, final String backCommand) {
log.debug("scheduling signed references list dialog");
@@ -1109,21 +1110,40 @@ public class BKUGUIImpl implements BKUGUIFacade {
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
String refIdLabelPattern = messages.getString(MESSAGE_HASHDATALIST);
- refIdLabel.setText(MessageFormat.format(refIdLabelPattern, new Object[]{signedReferences.getRowCount()}));
+ refIdLabel.setText(MessageFormat.format(refIdLabelPattern, new Object[]{signedReferences.size()}));
- JTable hashDataTable = new JTable(signedReferences);
- hashDataTable.setDefaultRenderer(HashDataInput.class, signedReferences.getRenderer());
-
+ HashDataTableModel tableModel = new HashDataTableModel(signedReferences);
+ JTable hashDataTable = new JTable(tableModel);
+// hashDataTable.setDefaultRenderer(HashDataInput.class, signedReferences.getRenderer());
hashDataTable.setTableHeader(null);
- // hashDataTable.setShowVerticalLines(false);
- hashDataTable.setRowSelectionAllowed(true);
-// TableColumn selectCol = hashDataTable.getColumnModel().getColumn(1);
-// selectCol.setMinWidth(CHECKBOX_WIDTH);
-// selectCol.setMaxWidth(CHECKBOX_WIDTH);
+
+ hashDataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ hashDataTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ @Override
+ public void valueChanged(final ListSelectionEvent e) {
+ //invoke later to allow thread to paint selection background
+ SwingUtilities.invokeLater(new Runnable() {
-// hashDataTable.setPreferredScrollableViewportSize(mainPanel.getPreferredSize());
+ @Override
+ public void run() {
+ ListSelectionModel lsm = (ListSelectionModel) e.getSource();
+ int selectionIdx = lsm.getMinSelectionIndex();
+ if (selectionIdx >= 0) {
+ final HashDataInput selection = signedReferences.get(selectionIdx);
+ showHashDataViewer(selection, new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ showSaveHashDataInputDialog(Collections.singletonList(selection), null, null);
+ }
+ }, "save");
+ }
+ }
+ });
+ }
+ });
+
JScrollPane hashDataScrollPane = new JScrollPane(hashDataTable);
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
@@ -1174,6 +1194,12 @@ public class BKUGUIImpl implements BKUGUIFacade {
});
}
+ /**
+ *
+ * @param signedRefs
+ * @param okListener may be null
+ * @param okCommand
+ */
private void showSaveHashDataInputDialog(final List signedRefs, final ActionListener okListener, final String okCommand) {
log.debug("scheduling save hashdatainput dialog");
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
index a6709860..9a43e99d 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
@@ -17,21 +17,8 @@
package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.HashDataInput;
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
import java.util.List;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableCellRenderer;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -43,17 +30,15 @@ class HashDataTableModel extends DefaultTableModel {
protected static final Log log = LogFactory.getLog(HashDataTableModel.class);
- protected Class[] types = new Class[]{HashDataInput.class};
+ protected Class[] types = new Class[]{ String.class, String.class };
protected List hashDataInputs;
- private HashDataLinkRenderer renderer;
public HashDataTableModel(List hashDataInputs) {
- super(0, 1);
+ super(0, 2);
this.hashDataInputs = hashDataInputs;
for (HashDataInput hdi : hashDataInputs) {
- addRow(new Object[]{hdi});
+ addRow(new Object[]{hdi.getReferenceId(), hdi.getMimeType()});
}
- this.renderer = new HashDataLinkRenderer();
}
@Override
@@ -66,46 +51,45 @@ class HashDataTableModel extends DefaultTableModel {
return false;
}
-
-
- public HashDataLinkRenderer getRenderer() {
- return renderer;
- }
+// public HashDataInput getValue(int rowIndex) {
+// return hashDataInputs.get(rowIndex);
+// }
+//
- public class HashDataLinkRenderer extends JLabel
- implements TableCellRenderer {
-// extends DefaultTableCellRenderer {
-
-// protected ActionListener saveHashDataListener;
+// public class HashDataLinkRenderer extends JLabel
+// implements TableCellRenderer {
+//// extends DefaultTableCellRenderer {
+//
+//// protected ActionListener saveHashDataListener;
+////
+//// public HashDataLinkRenderer(ActionListener saveHashDataListener) {
+//// this.saveHashDataListener = saveHashDataListener;
+//// }
+//
+// @Override
+// public Component getTableCellRendererComponent(JTable table,
+// Object value,
+// boolean isSelected,
+// boolean hasFocus,
+// final int row,
+// int column) {
+// final HashDataInput hdi = (HashDataInput) value;
+// log.debug("render hashdatainput " + hdi.getReferenceId() + " - (" + row + "," + column + ") " + isSelected + hasFocus);
+// setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+// setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD));
+// setText(hdi.getReferenceId() + " (" + hdi.getMimeType() + ")");
+// addMouseListener(new MouseAdapter() {
+//
+// @Override
+// public void mouseClicked(MouseEvent e) {
+// log.debug("received mouseclick on " + hdi.getReferenceId());
+//// saveHashDataListener.actionPerformed();
+// JOptionPane.showInputDialog(hashDataInputs.get(row).getReferenceId());
+// }
+//
+// });
//
-// public HashDataLinkRenderer(ActionListener saveHashDataListener) {
-// this.saveHashDataListener = saveHashDataListener;
+// return this;
// }
-
- @Override
- public Component getTableCellRendererComponent(JTable table,
- Object value,
- boolean isSelected,
- boolean hasFocus,
- final int row,
- int column) {
- final HashDataInput hdi = (HashDataInput) value;
- log.debug("render hashdatainput " + hdi.getReferenceId() + " - (" + row + "," + column + ") " + isSelected + hasFocus);
- setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD));
- setText(hdi.getReferenceId() + " (" + hdi.getMimeType() + ")");
- addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseClicked(MouseEvent e) {
- log.debug("received mouseclick on " + hdi.getReferenceId());
-// saveHashDataListener.actionPerformed();
- JOptionPane.showInputDialog(hashDataInputs.get(row).getReferenceId());
- }
-
- });
-
- return this;
- }
- }
+// }
}
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
index db66bd52..263c3c04 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
@@ -16,6 +16,7 @@
*/
package at.gv.egiz.bku.gui;
+import at.gv.egiz.bku.gui.html.RestrictedHTMLEditorKit;
import at.gv.egiz.stal.HashDataInput;
import java.awt.Component;
import java.awt.Container;
@@ -45,6 +46,7 @@ import javax.swing.JScrollPane;
import javax.swing.LayoutStyle;
import javax.swing.text.Document;
import javax.swing.text.EditorKit;
+import javax.swing.text.StyledEditorKit;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -182,9 +184,11 @@ public class HashDataViewer extends JDialog
JEditorPane viewer = new JEditorPane();
if ("text/plain".equals(mimeType)) {
+ //line wrapping, etc.
+ viewer.setEditorKit(new StyledEditorKit());
viewer.setFont(new Font(PLAINTEXT_FONT, viewer.getFont().getStyle(), viewer.getFont().getSize()));
// } else if ("text/html".equals(mimeType)) {
-// viewer.setEditorKitForContentType("text/html", new RestrictedHTMLEditorKit());
+// viewer.setEditorKit(new RestrictedHTMLEditorKit());
}
viewer.setEditable(false);
viewer.setContentType(mimeType);
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index 82b42d0f..fec097f5 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -81,7 +81,7 @@ public class BKUGUIWorker implements Runnable {
};
HashDataInput signedRef1 = new ByteArrayHashDataInput(
"Ich bin ein einfacher Text mit Umlauten: öäüßéç@€\n123\n456\n\tHello, world!\n\nlkjsd\nnksdjf".getBytes(),
- "ref-id-000000001",
+ "ref-id-0000000000000000000000001",
"text/plain",
"UTF-8");
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
index 26905f50..d041a8cb 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java
@@ -48,7 +48,6 @@ import at.gv.egiz.stal.SignResponse;
import at.gv.egiz.stal.signedinfo.ObjectFactory;
import at.gv.egiz.stal.signedinfo.SignedInfoType;
import at.gv.egiz.stal.util.JCEAlgorithmNames;
-import java.awt.event.ActionListener;
import java.security.DigestException;
import java.util.List;
@@ -128,9 +127,6 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen
return true;
}
-// @Override
-// public String providePIN(PINSpec spec, int retries) {
-
class STALPinProvider implements PINProvider {
protected SignedInfoType signedInfo;
@@ -178,7 +174,7 @@ public abstract class SignRequestHandler extends AbstractRequestHandler implemen
} else if (actionCommand.equals("sign")) {
retryCounter++;
return new String(gui.getPin());
- } else if (actionCommand.equals("ok")) {
+ } else if (actionCommand.equals("hashDataDone")) {
showSignaturePINDialog(spec, retries);
} else if (actionCommand.equals("error")) {
return null;
--
cgit v1.2.3
From d8901c075f9deb663e0edd640672ed620ffb4610 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Wed, 19 Nov 2008 16:14:57 +0000
Subject: GUI bugfixes and cleanup
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@181 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/src/test/resources/appletTest.html | 3 +-
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 26 +-----
.../main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 103 +++++++++------------
.../at/gv/egiz/bku/gui/DefaultHelpListener.java | 4 +
.../at/gv/egiz/bku/gui/HashDataTableModel.java | 47 +---------
.../java/at/gv/egiz/bku/gui/HashDataViewer.java | 1 -
.../java/at/gv/egiz/bku/gui/HyperlinkRenderer.java | 38 ++++++++
.../at/gv/egiz/bku/gui/Messages.properties | 3 +-
.../at/gv/egiz/bku/gui/Messages_en.properties | 15 +--
9 files changed, 101 insertions(+), 139 deletions(-)
create mode 100644 BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/src/test/resources/appletTest.html b/BKUApplet/src/test/resources/appletTest.html
index 2570e021..cc7c2bd7 100644
--- a/BKUApplet/src/test/resources/appletTest.html
+++ b/BKUApplet/src/test/resources/appletTest.html
@@ -20,7 +20,8 @@
-
+
+
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 2dbba730..7d912f11 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -19,9 +19,7 @@ package at.gv.egiz.bku.gui;
import at.gv.egiz.stal.HashDataInput;
import at.gv.egiz.smcc.PINSpec;
import java.awt.Color;
-import java.awt.Container;
import java.awt.event.ActionListener;
-import java.net.URL;
import java.util.List;
import java.util.Locale;
@@ -71,7 +69,6 @@ public interface BKUGUIFacade {
public static final String MESSAGE_HELP = "message.help";
public static final String LABEL_PIN = "label.pin";
public static final String LABEL_PINSIZE = "label.pinsize";
-// public static final String ERROR_NO_HASHDATA = "error.no.hashdata";
public static final String HELP_WELCOME = "help.welcome";
public static final String HELP_WAIT = "help.wait";
public static final String HELP_CARDNOTSUPPORTED = "help.cardnotsupported";
@@ -95,17 +92,13 @@ public interface BKUGUIFacade {
// public void init(Container contentPane, Locale locale, Style guiStyle, URL background, ActionListener helpListener);
- /**
- *
- * @return the locale of the message bundle (what if no message bundle could be loaded for the requested locale?)
- */
public Locale getLocale();
public void showWelcomeDialog();
/**
*
- * @param waitMessage if null, a simple 'wait' text is displayed
+ * @param waitMessage if null, a simple 'please wait' text is displayed
*/
public void showWaitDialog(String waitMessage);
@@ -123,25 +116,8 @@ public interface BKUGUIFacade {
public char[] getPin();
- /**
- * TODO move to HashDataDisplay implementations
- * @param signedReferences
- * @param externalDisplay
- * @param okListener
- * @param okCommand
- */
public void showHashDataInputDialog(List signedReferences, ActionListener okListener, String okCommand);
- /**
- * TODO pull out from BKUGUIFacade. (or make this strictly an applet internal version)
- * Problem: if standalone flag is provided, we also need the actionlistener..
- * @param helpDocument
- * @param mimeType
- * @param encoding
- */
-// public void showHelpDialog(InputStream helpDocument, String mimeType, String encoding); //, boolean standalone); //, ActionListener okListener, String okCommand);
-
-// public void showPlainTextHashDataInputDialog(String text, ActionListener saveListener, String saveCommand, ActionListener cancelListener, String cancelCommand);
public void showErrorDialog(String errorMsgKey, Object[] errorMsgParams, ActionListener okListener, String actionCommand);
public void showErrorDialog(String errorMsgKey, Object[] errorMsgParams);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index 38247174..a190b9c0 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -26,6 +26,8 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionAdapter;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
@@ -554,44 +556,37 @@ public class BKUGUIImpl implements BKUGUIFacade {
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
- GroupLayout.ParallelGroup mainHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
- GroupLayout.SequentialGroup pinHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
- .addComponent(pinsizeLabel));
-
- GroupLayout.SequentialGroup mainVertical = mainPanelLayout.createSequentialGroup();
+ GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(infoLabel);
+ GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(infoLabel);
if (!renderHeaderPanel) {
- GroupLayout.SequentialGroup infoHorizontal = mainPanelLayout.createSequentialGroup()
- .addComponent(infoLabel) //, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
+ infoHorizontal
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel); //, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- mainHorizontal
- .addGroup(infoHorizontal)
- .addGroup(pinHorizontal);
- GroupLayout.ParallelGroup infoVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(infoLabel)
.addComponent(helpLabel);
- mainVertical
- .addGroup(infoVertical)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED);
- } else {
- mainHorizontal
- .addGroup(pinHorizontal);
- }
-
- mainVertical
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(cardPinLabel)
- .addComponent(pinField))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel);
+ infoVertical
+ .addComponent(helpLabel);
+ }
- mainPanelLayout.setHorizontalGroup(mainHorizontal);
- mainPanelLayout.setVerticalGroup(mainVertical);
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(infoHorizontal)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
+ .addComponent(pinsizeLabel))));
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createSequentialGroup()
+ .addGroup(infoVertical)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(cardPinLabel)
+ .addComponent(pinField))
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel));
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
@@ -1048,31 +1043,6 @@ public class BKUGUIImpl implements BKUGUIFacade {
}
}
- /**
- * Opens HashDataViewer on mouse clicked event
- */
-// public class HashDataMouseListener extends MouseAdapter {
-//
-// private HashDataInput hashData;
-//
-// public void setHashData(HashDataInput hashData) {
-// this.hashData = hashData;
-// }
-//
-// @Override
-// public void mouseClicked(MouseEvent e) {
-// ActionListener saveListener = new ActionListener() {
-//
-// @Override
-// public void actionPerformed(ActionEvent e) {
-// showSaveHashDataInputDialog(Collections.singletonList(hashData), null, null);
-// }
-// };
-// showHashDataViewer(hashData, saveListener, "save");
-// super.mouseClicked(e);
-// }
-// }
-
/**
* has to be called from event dispatcher thread
* @param hashDataText
@@ -1113,10 +1083,23 @@ public class BKUGUIImpl implements BKUGUIFacade {
refIdLabel.setText(MessageFormat.format(refIdLabelPattern, new Object[]{signedReferences.size()}));
HashDataTableModel tableModel = new HashDataTableModel(signedReferences);
- JTable hashDataTable = new JTable(tableModel);
-// hashDataTable.setDefaultRenderer(HashDataInput.class, signedReferences.getRenderer());
+ final JTable hashDataTable = new JTable(tableModel);
+ hashDataTable.setDefaultRenderer(HashDataInput.class, new HyperlinkRenderer());
hashDataTable.setTableHeader(null);
+ // not possible to add mouse listener to TableCellRenderer
+ hashDataTable.addMouseMotionListener(new MouseMotionAdapter() {
+
+ @Override
+ public void mouseMoved(MouseEvent e) {
+ if (hashDataTable.columnAtPoint(e.getPoint()) == 0) {
+ hashDataTable.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ } else {
+ hashDataTable.setCursor(Cursor.getDefaultCursor());
+ }
+ }
+ });
+
hashDataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
hashDataTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
index 502f93ec..3c8c7d6c 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/DefaultHelpListener.java
@@ -27,6 +27,10 @@ import javax.swing.SwingUtilities;
*/
public class DefaultHelpListener extends AbstractHelpListener {
+ /**
+ * applet context to open external links in help pages,
+ * if null, no external links will be opened
+ */
protected AppletContext ctx;
/**
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
index 9a43e99d..b0f51a78 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
@@ -30,14 +30,15 @@ class HashDataTableModel extends DefaultTableModel {
protected static final Log log = LogFactory.getLog(HashDataTableModel.class);
- protected Class[] types = new Class[]{ String.class, String.class };
+ /** HashDataInput in first column, register hyperlinkrenderer only here */
+ protected Class[] types = new Class[]{ HashDataInput.class, String.class };
protected List hashDataInputs;
public HashDataTableModel(List hashDataInputs) {
super(0, 2);
this.hashDataInputs = hashDataInputs;
for (HashDataInput hdi : hashDataInputs) {
- addRow(new Object[]{hdi.getReferenceId(), hdi.getMimeType()});
+ addRow(new Object[]{ hdi, hdi.getMimeType()});
}
}
@@ -50,46 +51,4 @@ class HashDataTableModel extends DefaultTableModel {
public boolean isCellEditable(int rowIndex, int columnIndex) {
return false;
}
-
-// public HashDataInput getValue(int rowIndex) {
-// return hashDataInputs.get(rowIndex);
-// }
-//
-
-// public class HashDataLinkRenderer extends JLabel
-// implements TableCellRenderer {
-//// extends DefaultTableCellRenderer {
-//
-//// protected ActionListener saveHashDataListener;
-////
-//// public HashDataLinkRenderer(ActionListener saveHashDataListener) {
-//// this.saveHashDataListener = saveHashDataListener;
-//// }
-//
-// @Override
-// public Component getTableCellRendererComponent(JTable table,
-// Object value,
-// boolean isSelected,
-// boolean hasFocus,
-// final int row,
-// int column) {
-// final HashDataInput hdi = (HashDataInput) value;
-// log.debug("render hashdatainput " + hdi.getReferenceId() + " - (" + row + "," + column + ") " + isSelected + hasFocus);
-// setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
-// setFont(getFont().deriveFont(getFont().getStyle() & ~java.awt.Font.BOLD));
-// setText(hdi.getReferenceId() + " (" + hdi.getMimeType() + ")");
-// addMouseListener(new MouseAdapter() {
-//
-// @Override
-// public void mouseClicked(MouseEvent e) {
-// log.debug("received mouseclick on " + hdi.getReferenceId());
-//// saveHashDataListener.actionPerformed();
-// JOptionPane.showInputDialog(hashDataInputs.get(row).getReferenceId());
-// }
-//
-// });
-//
-// return this;
-// }
-// }
}
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
index 263c3c04..777e8960 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
@@ -184,7 +184,6 @@ public class HashDataViewer extends JDialog
JEditorPane viewer = new JEditorPane();
if ("text/plain".equals(mimeType)) {
- //line wrapping, etc.
viewer.setEditorKit(new StyledEditorKit());
viewer.setFont(new Font(PLAINTEXT_FONT, viewer.getFont().getStyle(), viewer.getFont().getSize()));
// } else if ("text/html".equals(mimeType)) {
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
new file mode 100644
index 00000000..f983706e
--- /dev/null
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.bku.gui;
+
+import at.gv.egiz.stal.HashDataInput;
+import javax.swing.table.DefaultTableCellRenderer;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class HyperlinkRenderer extends DefaultTableCellRenderer {
+
+ /**
+ * cannot change mouse cursor here, do in jTable
+ * @param value
+ */
+ @Override
+ protected void setValue(Object value) {
+ super.setText("" + ((HashDataInput) value).getReferenceId() + "");
+ setForeground(BKUGUIFacade.HYPERLINK_COLOR);
+ }
+}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index b5a74ac1..88119fe2 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -16,7 +16,8 @@
title.welcome=Willkommen
title.insertcard=Keine B\u00FCrgerkarte gefunden
title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
-title.cardpin={0} eingeben
+#title.cardpin={0} eingeben
+title.cardpin=Karte wird gelesen
title.sign=Signatur erstellen
title.error=Fehler
title.retry=Falscher PIN
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index 94464982..63c8bf77 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -14,9 +14,10 @@
# limitations under the License.
title.welcome=Welcome
-title.insertcard=No citizen-card found
+title.insertcard=No citizencard found
title.cardnotsupported=This card is not supported
-title.cardpin=Enter {0}
+#title.cardpin=Enter {0}
+title.cardpin=Reading card
title.sign=Create signature
title.error=Error
title.retry=Wrong PIN
@@ -28,7 +29,7 @@ windowtitle.overwrite=Overwrite file?
windowtitle.viewer=Signature data
windowtitle.help=Help
message.wait=Please wait...
-message.insertcard=Please insert your citizen-card into the reader
+message.insertcard=Please insert your citizencard into the reader
message.enterpin=Enter {0}
message.hashdatalink=Display signature data
message.hashdata=Remark: This is a preview of the data to-be signed. For standards compliant display see help.
@@ -63,16 +64,16 @@ error.pcsc=No PC/SC interface for smartcard access provided
error.cardterminal=Could not find smartcard reader
error.unknown=An error occured: {0}
error.test=Error1 {0} - Error2 {1}
-error.card.locked=Citizen-card is locked
-error.card.notactivated=Citizen-card not activated
+error.card.locked=Citizencard is locked
+error.card.notactivated=Citizencard not activated
error.viewer=Failed to display contents: {0}
error.external.link=Externer Link {0} wird nicht ge\u00F6ffnet
# Help Topics
help.welcome=Welcome page
help.wait=Wait screen
-help.cardnotsupported=Unsupported citizen card
-help.insertcard=No citizen card found
+help.cardnotsupported=Unsupported citizencard
+help.insertcard=No citizencard found
help.cardpin=Pin entry
help.signpin=Signature pin entry
help.retry=Wrong Pin
--
cgit v1.2.3
From 62d5372507c673be5303f5f78b1555178a9fe87b Mon Sep 17 00:00:00 2001
From: clemenso
Date: Wed, 19 Nov 2008 16:15:42 +0000
Subject: GUI bugfixes and cleanup
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@182 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../at/gv/egiz/stal/impl/ByteArrayHashDataInput.java | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
index 2b5ee7e7..6ca9a0b2 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/stal/impl/ByteArrayHashDataInput.java
@@ -1,8 +1,19 @@
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
+* Copyright 2008 Federal Chancellery Austria and
+* Graz University of Technology
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
package at.gv.egiz.stal.impl;
import at.gv.egiz.stal.HashDataInput;
--
cgit v1.2.3
From d127f2c5ccc96eb44eeacf46bb76feebe100361f Mon Sep 17 00:00:00 2001
From: mcentner
Date: Mon, 24 Nov 2008 12:50:24 +0000
Subject: git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@189
8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUCommonGUI/pom.xml | 11 +++++++++++
STAL/pom.xml | 11 +++++++++++
pom.xml | 9 ++++++++-
smcc/pom.xml | 13 ++++++++++++-
smccSTAL/pom.xml | 11 +++++++++++
5 files changed, 53 insertions(+), 2 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index 1aea89f6..c620746f 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -23,6 +23,17 @@
compile
+
+
+
+ maven-compiler-plugin
+ org.apache.maven.plugins
+
+ false
+
+
+
+
-
+
diff --git a/smccSTAL/pom.xml b/smccSTAL/pom.xml
index d4a523b1..5c03cffd 100644
--- a/smccSTAL/pom.xml
+++ b/smccSTAL/pom.xml
@@ -11,6 +11,17 @@
smccSTALsmcc STAL1.0
+
+
+
+ maven-compiler-plugin
+ org.apache.maven.plugins
+
+ false
+
+
+
+ at.gv.egiz
--
cgit v1.2.3
From b93f035e2c9df0ad430300c4f755b775a4aa1ed3 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Mon, 24 Nov 2008 13:37:11 +0000
Subject: xhtml warning
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@192 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 3 +-
.../main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 15 +++--
.../java/at/gv/egiz/bku/gui/HashDataViewer.java | 72 +++++++++++-----------
.../at/gv/egiz/bku/gui/Messages.properties | 3 +-
.../at/gv/egiz/bku/gui/Messages_en.properties | 3 +-
.../test/java/at/gv/egiz/bku/gui/BKUGUITest.java | 6 +-
.../test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java | 5 +-
7 files changed, 59 insertions(+), 48 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 7d912f11..d3cb76f2 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -62,11 +62,12 @@ public interface BKUGUIFacade {
public static final String MESSAGE_INSERTCARD = "message.insertcard";
public static final String MESSAGE_ENTERPIN = "message.enterpin";
public static final String MESSAGE_HASHDATALINK = "message.hashdatalink";
- public static final String MESSAGE_HASHDATA = "message.hashdata";
+// public static final String MESSAGE_HASHDATA = "message.hashdata";
public static final String MESSAGE_HASHDATALIST = "message.hashdatalist";
public static final String MESSAGE_RETRIES = "message.retries";
public static final String MESSAGE_OVERWRITE = "message.overwrite";
public static final String MESSAGE_HELP = "message.help";
+ public static final String WARNING_XHTML = "warning.xhtml";
public static final String LABEL_PIN = "label.pin";
public static final String LABEL_PINSIZE = "label.pinsize";
public static final String HELP_WELCOME = "help.welcome";
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index a190b9c0..c786a291 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -208,13 +208,16 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (background == null) {
background = getClass().getResource(DEFAULT_BACKGROUND);
}
- if ("file".equals(background.getProtocol())) {
- log.warn("file:// background images not permitted: " + background);
- background = getClass().getResource(DEFAULT_BACKGROUND);
+ if (background == null) {
+ contentPanel = new JPanel();
+ } else {
+ if ("file".equals(background.getProtocol())) {
+ log.warn("file:// background images not permitted: " + background);
+ background = getClass().getResource(DEFAULT_BACKGROUND);
+ }
+ log.debug("loading background " + background);
+ contentPanel = new ImagePanel(background);
}
- log.debug("loading background " + background);
- contentPanel = new ImagePanel(background);
-
mainPanel = new JPanel();
mainPanel.setOpaque(false);
buttonPanel = new JPanel();
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
index 777e8960..6c097b2a 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataViewer.java
@@ -125,9 +125,7 @@ public class HashDataViewer extends JDialog
InputStreamReader isr = new InputStreamReader(hashDataInput.getHashDataInput(), cs);
Reader content = new BufferedReader(isr);
- JPanel hashDataPanel = createViewerPanel(
- messages.getString(BKUGUIFacade.MESSAGE_HASHDATA),
- content,
+ JPanel hashDataPanel = createViewerPanel(content,
hashDataInput.getMimeType(),
helpListener);
JPanel buttonPanel = createButtonPanel(saveListener, saveCommand);
@@ -169,29 +167,28 @@ public class HashDataViewer extends JDialog
* @param helpListener may be null
* @return
*/
- private JPanel createViewerPanel(String viewerLabelText,
- Reader content,
+ private JPanel createViewerPanel(Reader content,
String mimeType,
final ActionListener helpListener) {
- log.debug("viewer dialog: " + mimeType);
if (mimeType == null) {
mimeType = "text/plain";
- } else if ("application/xhtml+xml".equals(mimeType)) {
- mimeType = "text/html";
}
+ log.debug("viewer dialog: " + mimeType);
JEditorPane viewer = new JEditorPane();
+ viewer.setEditable(false);
+ viewer.setContentType(mimeType);
if ("text/plain".equals(mimeType)) {
viewer.setEditorKit(new StyledEditorKit());
viewer.setFont(new Font(PLAINTEXT_FONT, viewer.getFont().getStyle(), viewer.getFont().getSize()));
// } else if ("text/html".equals(mimeType)) {
// viewer.setEditorKit(new RestrictedHTMLEditorKit());
+ } else if ("application/xhtml+xml".equals(mimeType)) {
+ viewer.setContentType("text/html");
}
- viewer.setEditable(false);
- viewer.setContentType(mimeType);
-
+
EditorKit editorKit = viewer.getEditorKit();
Document document = editorKit.createDefaultDocument();
// document.putProperty("IgnoreCharsetDirective", new Boolean(true));
@@ -210,15 +207,23 @@ public class HashDataViewer extends JDialog
scrollPane.setAlignmentX(LEFT_ALIGNMENT);
viewer.setCaretPosition(0);
- JLabel viewerLabel = new JLabel();
- viewerLabel.setText(viewerLabelText);
- viewerLabel.setFont(viewerLabel.getFont().deriveFont(viewerLabel.getFont().getStyle() | java.awt.Font.BOLD));
- viewerLabel.setLabelFor(viewer);
-
JPanel viewerPanel = new JPanel();
GroupLayout viewerPanelLayout = new GroupLayout(viewerPanel);
viewerPanel.setLayout(viewerPanelLayout);
+ GroupLayout.SequentialGroup infoHorizontal = viewerPanelLayout.createSequentialGroup();
+ GroupLayout.ParallelGroup infoVertical = viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
+
+ if ("application/xhtml+xml".equals(mimeType)) {
+ JLabel viewerLabel = new JLabel();
+ viewerLabel.setText(messages.getString(BKUGUIFacade.WARNING_XHTML));
+ viewerLabel.setFont(viewerLabel.getFont().deriveFont(viewerLabel.getFont().getStyle() | java.awt.Font.BOLD));
+ viewerLabel.setLabelFor(viewer);
+
+ infoHorizontal.addComponent(viewerLabel);
+ infoVertical.addComponent(viewerLabel);
+ }
+
if (helpListener != null) {
JLabel helpLabel = new JLabel();
helpLabel.setIcon(new ImageIcon(getClass().getResource(BKUGUIFacade.HELP_IMG)));
@@ -232,27 +237,24 @@ public class HashDataViewer extends JDialog
}
});
helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- viewerPanelLayout.setHorizontalGroup(
- viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(viewerPanelLayout.createSequentialGroup().addComponent(viewerLabel).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE).addComponent(helpLabel)).addComponent(scrollPane)); //, 0, 0, Short.MAX_VALUE));
- viewerPanelLayout.setVerticalGroup(
- viewerPanelLayout.createSequentialGroup()
- .addGroup(viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(viewerLabel)
- .addComponent(helpLabel))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(scrollPane));
- } else {
- viewerPanelLayout.setHorizontalGroup(
- viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(viewerLabel)
- .addComponent(scrollPane));
- viewerPanelLayout.setVerticalGroup(
- viewerPanelLayout.createSequentialGroup()
- .addComponent(viewerLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(scrollPane));
+ infoHorizontal
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(helpLabel);
+ infoVertical
+ .addComponent(helpLabel);
}
+
+ viewerPanelLayout.setHorizontalGroup(
+ viewerPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(infoHorizontal)
+ .addComponent(scrollPane));
+ viewerPanelLayout.setVerticalGroup(
+ viewerPanelLayout.createSequentialGroup()
+ .addGroup(infoVertical)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(scrollPane));
+
return viewerPanel;
}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 88119fe2..a7363421 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -32,13 +32,14 @@ message.wait=Bitte warten...
message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
message.enterpin={0} eingeben
message.hashdatalink=Signaturdaten anzeigen
-message.hashdata=Hinweis: Dies ist eine Voransicht des zu signierenden Inhalts. F\u00FCr eine standardkonforme Darstellung siehe Hilfe (i).
+#message.hashdata=Hinweis: Dies ist eine Voransicht des zu signierenden Inhalts. F\u00FCr eine standardkonforme Darstellung siehe Hilfe (i).
#message.hashdata=Dies ist eine Voransicht des zu signierenden Inhaltes. F\u00FCr Details siehe Hilfe (i).
#verwenden sie bitte die von ihrem System zur Verf\u00FCgung gestellte {0} Anwendung.
message.hashdatalist={0} Signaturdaten:
message.retries=Noch {0} Versuch(e)
message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
message.help=Hilfe zu {0}
+warning.xhtml=Hinweis: Dies ist eine Voransicht des zu signierenden Inhalts. F\u00FCr eine standardkonforme Darstellung siehe Hilfe (i).
label.pin={0}:
label.pinsize=({0} stellig)
button.ok=OK
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index 63c8bf77..7aae8eae 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -32,11 +32,12 @@ message.wait=Please wait...
message.insertcard=Please insert your citizencard into the reader
message.enterpin=Enter {0}
message.hashdatalink=Display signature data
-message.hashdata=Remark: This is a preview of the data to-be signed. For standards compliant display see help.
+#message.hashdata=Remark: This is a preview of the data to-be signed. For standards compliant display see help.
message.hashdatalist={0} signature data objects:
message.retries={0} tries left
message.overwrite=Overwrite {0}?
message.help=Help topic {0}
+warning.xhtml=Remark: This is a preview of the data to-be signed. For standards compliant display see help.
label.pin={0}:
label.pinsize=({0} digits)
button.ok=OK
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
index 0d2712dd..bc4bdb97 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
@@ -32,15 +32,15 @@ import org.junit.Test;
*
* @author clemens
*/
-//@Ignore
+@Ignore
public class BKUGUITest {
@Test
public void testBKUGUI() {
JFrame testFrame = new JFrame("BKUGUITest");
Container contentPane = testFrame.getContentPane();
- contentPane.setPreferredSize(new Dimension(380, 150));
- BKUGUIFacade gui = BKUGUIFactory.createGUI(contentPane, null, BKUGUIFacade.Style.advanced, null, null);
+ contentPane.setPreferredSize(new Dimension(190, 130));
+ BKUGUIFacade gui = BKUGUIFactory.createGUI(contentPane, null, BKUGUIFacade.Style.simple, null, null);
BKUGUIWorker worker = new BKUGUIWorker();
worker.init(gui);
testFrame.pack();
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index fec097f5..4d97f9fb 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -147,10 +147,13 @@ public class BKUGUIWorker implements Runnable {
//
// Thread.sleep(2000);
//
- gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
+// gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
//
// Thread.sleep(4000);
//
+
+ gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, null, null);
+
// gui.showSignaturePINRetryDialog(signPinSpec, 2, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
//
// Thread.sleep(2000);
--
cgit v1.2.3
From 11c83e13e032738ee927f22196dc9ca43589a8a4 Mon Sep 17 00:00:00 2001
From: mcentner
Date: Mon, 24 Nov 2008 14:11:39 +0000
Subject: Version set to 1.0.0
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@193 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 14 +++++++-------
BKUCommonGUI/pom.xml | 8 ++++----
BKULocal/pom.xml | 14 +++++++-------
BKULocalApp/pom.xml | 8 ++++----
BKUOnline/pom.xml | 10 +++++-----
BKUOnline/src/main/webapp/appletPage.jsp | 2 +-
BKUViewer/pom.xml | 6 +++---
STAL/pom.xml | 4 ++--
STALService/pom.xml | 8 ++++----
bkucommon/pom.xml | 8 ++++----
pom.xml | 6 +++---
smcc/pom.xml | 4 ++--
smccSTAL/pom.xml | 10 +++++-----
utils/pom.xml | 8 ++++----
14 files changed, 55 insertions(+), 55 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index eaaa5820..10cfa53a 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -3,13 +3,13 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizBKUAppletBKU Applet
- 1.0
+ 1.0.0-SNAPSHOT
@@ -116,27 +116,27 @@
at.gv.egizsmcc
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizSTAL
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizSTALService
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizsmccSTAL
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizBKUCommonGUI
- 1.0
+ 1.0.0-SNAPSHOTcommons-logging
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index c620746f..1cedb84d 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -3,23 +3,23 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizBKUCommonGUIBKU Common GUI
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizsmcc
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizSTAL
- 1.0
+ 1.0.0-SNAPSHOTcompile
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index 36503ca0..48b6d590 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -3,14 +3,14 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizBKULocalwarBKU Local
- 1.0-SNAPSHOT
+ 1.0.0-SNAPSHOTscm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
@@ -57,22 +57,22 @@
at.gv.egizSTAL
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizbkucommon
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizsmcc
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizsmccSTAL
- 1.0
+ 1.0.0-SNAPSHOTorg.springframework
@@ -102,7 +102,7 @@
at.gv.egizBKUViewer
- 1.0
+ 1.0.0-SNAPSHOT
diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml
index f05aeba0..4476f3b5 100644
--- a/BKULocalApp/pom.xml
+++ b/BKULocalApp/pom.xml
@@ -3,13 +3,13 @@
bkuat.gv.egiz
- 1.0-SNAPSHOT
+ 1.0.0-SNAPSHOT4.0.0at.gv.egiz.bkuBKULocalAppBKU Local App
- 1.0-SNAPSHOT
+ 1.0.0-SNAPSHOT
@@ -77,13 +77,13 @@
at.gv.egizBKULocal
- 1.0-SNAPSHOT
+ 1.0.0-SNAPSHOTwarutilsat.gv.egiz
- 1.0-SNAPSHOT
+ 1.0.0-SNAPSHOTcompile
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index a1d92390..cee17e20 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -4,14 +4,14 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizBKUOnlinewarBKU Online
- 1.0
+ 1.0.0-SNAPSHOT
@@ -25,12 +25,12 @@
at.gv.egizbkucommon
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizBKUViewer
- 1.0
+ 1.0.0-SNAPSHOTcommons-logging
@@ -62,7 +62,7 @@
at.gv.egizBKUApplet
- 1.0
+ 1.0.0-SNAPSHOTprovided
\ No newline at end of file
diff --git a/bkucommon/pom.xml b/bkucommon/pom.xml
index 60c31a02..076f516c 100644
--- a/bkucommon/pom.xml
+++ b/bkucommon/pom.xml
@@ -4,24 +4,24 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizbkucommonBKU Common
- 1.0
+ 1.0.0-SNAPSHOThttp://maven.apache.orgat.gv.egizutils
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizSTAL
- 1.0
+ 1.0.0-SNAPSHOTcommons-logging
diff --git a/pom.xml b/pom.xml
index 54413a62..fa86e771 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
at.gv.egizbkupom
- 1.0
+ 1.0.0-SNAPSHOTBKUhttp://bku.egiz.gv.at
@@ -97,7 +97,7 @@
org.apache.maven.pluginsmaven-release-plugin
- 2.0-beta-7
+ 2.0-beta-8
@@ -211,7 +211,7 @@
iaikiaik_pki
- 1.0-SNAPSHOT
+ 1.0-MOCCAcompile
diff --git a/smcc/pom.xml b/smcc/pom.xml
index 39af114f..ba1ffcce 100644
--- a/smcc/pom.xml
+++ b/smcc/pom.xml
@@ -3,14 +3,14 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizsmccsmccjar
- 1.0
+ 1.0.0-SNAPSHOThttp://bku.egiz.gv.at
diff --git a/smccSTAL/pom.xml b/smccSTAL/pom.xml
index 5c03cffd..78ba1aea 100644
--- a/smccSTAL/pom.xml
+++ b/smccSTAL/pom.xml
@@ -4,13 +4,13 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizsmccSTALsmcc STAL
- 1.0
+ 1.0.0-SNAPSHOT
@@ -26,17 +26,17 @@
at.gv.egizSTAL
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizsmcc
- 1.0
+ 1.0.0-SNAPSHOTat.gv.egizBKUCommonGUI
- 1.0
+ 1.0.0-SNAPSHOTiaik
diff --git a/utils/pom.xml b/utils/pom.xml
index b980470d..871dbb0a 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -4,14 +4,14 @@
bkuat.gv.egiz
- 1.0
+ 1.0.0-SNAPSHOT4.0.0at.gv.egizutilsBKU Utilsjar
- 1.0
+ 1.0.0-SNAPSHOThttp://bku.egiz.gv.at
@@ -53,10 +53,10 @@
add dependencies to determine build order of BKU modules | (scope
provided -> don't include dependencies in assembly) at.gv.egiz
- slbinding1.0-SNAPSHOT
+ slbinding1.0.0-SNAPSHOTOTprovidedat.gv.egizidlink
- 1.0-SNAPSHOTprovided
+ provided
-
-
-
-
- maven-jar-plugin
-
-
-
- sign
-
-
-
-
-
- false
- false
-
- false
- true
-
-
- test-applet signer
- ./keystore.ks
- storepass
- keypass
- true
-
-
-
- maven-dependency-plugin
-
-
- copytestlibs
-
- copy
-
-
-
-
- commons-logging
- commons-logging
-
-
- iaik
- iaik_jce_me4se
-
-
- ${project.build.directory}/test-libs
-
-
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
-
- true
-
-
-
-
-
-
- at.gv.egiz
- smcc
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- STAL
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- STALService
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- smccSTAL
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- BKUCommonGUI
- 1.0.0-SNAPSHOT
-
-
- commons-logging
- commons-logging
-
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz
+ BKUApplet
+ BKU Applet
+ 1.0.1
+
+
+
+ maven-dependency-plugin
+
+
+ unpack
+
+ unpack-dependencies
+
+
+ at.gv.egiz
+ true
+ ${project.build.outputDirectory}
+ META-INF\/
+
+
+
+
+ maven-jar-plugin
+
+
+
+ sign
+
+
+
+
+
+ false
+ false
+
+ false
+ true
+
+
+ test-applet signer
+ ./keystore.ks
+ storepass
+ keypass
+ true
+
+
+
+ maven-dependency-plugin
+
+
+ copytestlibs
+
+ copy
+
+
+
+
+ commons-logging
+ commons-logging
+
+
+ iaik
+ iaik_jce_me4se
+
+
+ ${project.build.directory}/test-libs
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+
+ true
+
+
+
+
+
+
+ at.gv.egiz
+ smcc
+ 1.0.1
+
+
+ at.gv.egiz
+ STAL
+ 1.0.1
+
+
+ at.gv.egiz
+ STALService
+ 1.0.1
+
+
+ at.gv.egiz
+ smccSTAL
+ 1.0.1
+
+
+ at.gv.egiz
+ BKUCommonGUI
+ 1.0.1
+
+
+ commons-logging
+ commons-logging
+
+
+
\ No newline at end of file
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index 1cedb84d..3ae1717d 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -1,39 +1,38 @@
-
-
-
- bku
- at.gv.egiz
- 1.0.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz
- BKUCommonGUI
- BKU Common GUI
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- smcc
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- STAL
- 1.0.0-SNAPSHOT
- compile
-
-
-
-
-
- maven-compiler-plugin
- org.apache.maven.plugins
-
- false
-
-
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz
+ BKUCommonGUI
+ BKU Common GUI
+ 1.0.1
+
+
+ at.gv.egiz
+ smcc
+ 1.0.1
+
+
+ at.gv.egiz
+ STAL
+ 1.0.1
+ compile
+
+
+
+
+
+ maven-compiler-plugin
+ org.apache.maven.plugins
+
+ false
+
+
+
+
-
+
+
\ No newline at end of file
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index 54de31b2..3cf9b0cd 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -1,112 +1,111 @@
-
-
-
- bku
- at.gv.egiz
- 1.0.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz
- BKULocal
- war
- BKU Local
- 1.0.0-SNAPSHOT
-
-
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
-
-
-
-
- maven-war-plugin
- 2.0.2
-
-
- true
-
-
-
- ${project.version}-r${buildNumber}
-
-
-
-
-
- org.codehaus.mojo
- maven-buildnumber-plugin
- 0.9.6
-
-
- validate
-
- create
-
-
-
-
- false
- false
-
-
-
-
-
-
-
- at.gv.egiz
- STAL
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- bkucommon
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- smcc
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- smccSTAL
- 1.0.0-SNAPSHOT
-
-
- org.springframework
- spring-core
- 2.5.5
-
-
- javax.servlet
- servlet-api
- 2.5
- provided
-
-
- org.springframework
- spring-web
- 2.5.5
-
-
- commons-logging
- commons-logging
-
-
- at.gv.egiz
- BKUApplet
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- BKUViewer
- 1.0.0-SNAPSHOT
-
-
-
-
- Tomcat60
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz
+ BKULocal
+ war
+ BKU Local
+ 1.0.1
+
+
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKULocal
+
+
+
+
+ maven-war-plugin
+ 2.0.2
+
+
+ true
+
+
+
+ ${project.version}-r${buildNumber}
+
+
+
+
+
+ org.codehaus.mojo
+ maven-buildnumber-plugin
+ 0.9.6
+
+
+ validate
+
+ create
+
+
+
+
+ false
+ false
+
+
+
+
+
+
+
+ at.gv.egiz
+ STAL
+ 1.0.1
+
+
+ at.gv.egiz
+ bkucommon
+ 1.0.1
+
+
+ at.gv.egiz
+ smcc
+ 1.0.1
+
+
+ at.gv.egiz
+ smccSTAL
+ 1.0.1
+
+
+ org.springframework
+ spring-core
+ 2.5.5
+
+
+ javax.servlet
+ servlet-api
+ 2.5
+ provided
+
+
+ org.springframework
+ spring-web
+ 2.5.5
+
+
+ commons-logging
+ commons-logging
+
+
+ at.gv.egiz
+ BKUApplet
+ 1.0.1
+
+
+ at.gv.egiz
+ BKUViewer
+ 1.0.1
+
+
+
+
+ Tomcat60
+
+
\ No newline at end of file
diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml
index 4476f3b5..2a5b8d19 100644
--- a/BKULocalApp/pom.xml
+++ b/BKULocalApp/pom.xml
@@ -1,101 +1,100 @@
-
-
- bku
- at.gv.egiz
- 1.0.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz.bku
- BKULocalApp
- BKU Local App
- 1.0.0-SNAPSHOT
-
-
-
-
-
- maven-compiler-plugin
- org.apache.maven.plugins
- 2.0.2
-
- 1.6
- 1.6
- true
- true
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
-
-
-
- true
- at.gv.egiz.bku.local.app.BKULauncher
-
-
- development
- ${pom.url}
- splash.png
-
-
-
-
-
- maven-dependency-plugin
-
-
- copy-dependencies
- package
-
- copy-dependencies
-
-
- ${project.build.directory}
- false
- false
- true
-
-
-
-
-
-
-
-
-
-
- commons-logging
- commons-logging
- 1.1.1
- compile
-
-
- at.gv.egiz
- BKULocal
- 1.0.0-SNAPSHOT
- war
-
-
- utils
- at.gv.egiz
- 1.0.0-SNAPSHOT
- compile
-
-
- commons-cli
- commons-cli
- 1.0
-
-
- org.mortbay.jetty
- jetty
- 6.1.10
-
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz.bku
+ BKULocalApp
+ BKU Local App
+ 1.0.1
+
+
+
+
+
+ maven-compiler-plugin
+ org.apache.maven.plugins
+ 2.0.2
+
+ 1.6
+ 1.6
+ true
+ true
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-jar-plugin
+
+
+
+ true
+ at.gv.egiz.bku.local.app.BKULauncher
+
+
+ development
+ ${pom.url}
+ splash.png
+
+
+
+
+
+ maven-dependency-plugin
+
+
+ copy-dependencies
+ package
+
+ copy-dependencies
+
+
+ ${project.build.directory}
+ false
+ false
+ true
+
+
+
+
+
+
+
+
+
+
+ commons-logging
+ commons-logging
+ 1.1.1
+ compile
+
+
+ at.gv.egiz
+ BKULocal
+ 1.0.1
+ war
+
+
+ utils
+ at.gv.egiz
+ 1.0.1
+ compile
+
+
+ commons-cli
+ commons-cli
+ 1.0
+
+
+ org.mortbay.jetty
+ jetty
+ 6.1.10
+
+
+
\ No newline at end of file
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index 0704cc12..7bee3a02 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -1,222 +1,219 @@
-
-
-
- bku
- at.gv.egiz
- 1.0.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz
- BKUOnline
- war
- BKU Online
- 1.0.0-SNAPSHOT
-
-
-
- tlc
- TLC Repository
- http://commons.ucalgary.ca/pub/m2
-
-
-
-
-
- at.gv.egiz
- bkucommon
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- BKUViewer
- 1.0.0-SNAPSHOT
-
-
- commons-logging
- commons-logging
-
-
- org.springframework
- spring-core
- 2.5.5
-
-
- javax.servlet
- servlet-api
- 2.5
- provided
-
-
- org.springframework
- spring-web
- 2.5.5
-
-
- at.gv.egiz
- STALService
- 1.0.0-SNAPSHOT
- compile
-
-
-
- at.gv.egiz
- BKUApplet
- 1.0.0-SNAPSHOT
- provided
-
-
- at.gv.egiz
- STALService
- 1.0.0-SNAPSHOT
-
-
-
-
- com.sun.xml.ws
- jaxws-rt
- 2.1.4
-
-
-
-
-
- Tomcat60
-
-
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKUOnline
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKUOnline
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKUOnline
-
-
-
-
- maven-dependency-plugin
-
-
- copyapplet-dependencies
-
- copy-dependencies
-
-
- ${project.build.directory}/${project.build.finalName}/applet
-
- at.gv.egiz
- BKUApplet
- true
-
-
-
- copyapplet
-
- copy
-
-
- ${project.build.directory}/${project.build.finalName}/applet
-
-
- commons-logging
- commons-logging
-
-
- iaik
- iaik_jce_me4se
-
-
-
-
-
-
-
-
-
- maven-war-plugin
- 2.0.2
-
-
-
- true
-
-
-
-
-
- ${project.version}-r${buildNumber}
-
-
-
-
-
-
- org.codehaus.mojo
- maven-buildnumber-plugin
- 0.9.6
-
-
- validate
-
- create
-
-
-
-
- false
- false
-
-
-
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz
+ BKUOnline
+ war
+ BKU Online
+ 1.0.1
+
+
+
+ tlc
+ TLC Repository
+ http://commons.ucalgary.ca/pub/m2
+
+
+
+
+
+ at.gv.egiz
+ bkucommon
+ 1.0.1
+
+
+ at.gv.egiz
+ BKUViewer
+ 1.0.1
+
+
+ commons-logging
+ commons-logging
+
+
+ org.springframework
+ spring-core
+ 2.5.5
+
+
+ javax.servlet
+ servlet-api
+ 2.5
+ provided
+
+
+ org.springframework
+ spring-web
+ 2.5.5
+
+
+ at.gv.egiz
+ STALService
+ 1.0.1
+ compile
+
+
+
+ at.gv.egiz
+ BKUApplet
+ 1.0.1
+ provided
+
+
+ at.gv.egiz
+ STALService
+ 1.0.1
+
+
+
+
+ com.sun.xml.ws
+ jaxws-rt
+ 2.1.4
+
+
+
+
+
+ Tomcat60
+
+
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKUOnline
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKUOnline
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKUOnline
+
+
+
+
+ maven-dependency-plugin
+
+
+ copyapplet-dependencies
+
+ copy-dependencies
+
+
+ ${project.build.directory}/${project.build.finalName}/applet
+
+ at.gv.egiz
+ BKUApplet
+ true
+
+
+
+ copyapplet
+
+ copy
+
+
+ ${project.build.directory}/${project.build.finalName}/applet
+
+
+ commons-logging
+ commons-logging
+
+
+ iaik
+ iaik_jce_me4se
+
+
+
+
+
+
+
+
+
+ maven-war-plugin
+ 2.0.2
+
+
+
+ true
+
+
+
+
+
+ ${project.version}-r${buildNumber}
+
+
+
+
+
+
+ org.codehaus.mojo
+ maven-buildnumber-plugin
+ 0.9.6
+
+
+ validate
+
+ create
+
+
+
+
+ false
+ false
+
+
+
+
+
\ No newline at end of file
diff --git a/BKUViewer/pom.xml b/BKUViewer/pom.xml
index 5af7c057..2af2a6cf 100644
--- a/BKUViewer/pom.xml
+++ b/BKUViewer/pom.xml
@@ -1,21 +1,20 @@
-
+bkuat.gv.egiz
- 1.0.0-SNAPSHOT
+ 1.0.14.0.0at.gv.egizBKUViewerBKU viewer components
- 1.0.0-SNAPSHOT
+ 1.0.1at.gv.egizbkucommon
- 1.0.0-SNAPSHOT
+ 1.0.1commons-logging
diff --git a/STAL/pom.xml b/STAL/pom.xml
index 884c86a2..a1e76cd7 100644
--- a/STAL/pom.xml
+++ b/STAL/pom.xml
@@ -1,15 +1,15 @@
-
+bkuat.gv.egiz
- 1.0.0-SNAPSHOT
+ 1.0.14.0.0at.gv.egizSTALSTAL
- 1.0.0-SNAPSHOT
+ 1.0.1commons-logging
diff --git a/STALService/pom.xml b/STALService/pom.xml
index aa8ce064..51d2c6d8 100644
--- a/STALService/pom.xml
+++ b/STALService/pom.xml
@@ -1,22 +1,21 @@
-
+bkuat.gv.egiz
- 1.0.0-SNAPSHOT
+ 1.0.14.0.0at.gv.egizSTALServiceSTAL Service
- 1.0.0-SNAPSHOT
+ 1.0.1at.gv.egizSTAL
- 1.0.0-SNAPSHOT
+ 1.0.1
+ true
+ true
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 39528296..cc8387db 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,231 +1,224 @@
-
-
- 4.0.0
- at.gv.egiz
- bku
- pom
- 1.0.0-SNAPSHOT
- BKU
- http://bku.egiz.gv.at
-
- utils
- bkucommon
- STAL
- BKUOnline
- smcc
- BKULocal
- BKUApplet
- smccSTAL
- STALService
- BKUCommonGUI
- BKUViewer
- BKULocalApp
-
-
-
- mcentner
- Martin Centner
- mcentner@egiz.gv.at
-
-
- wbauer
- Wolfgang Bauer
- wbauer@egiz.gv.at
-
-
- corthacker
- Clemens Orthacker
- corthacker@egiz.gv.at
-
-
-
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk
- scm:svn:svn+ssh://svn.egovlabs.gv.at/svnroot/mocca/trunk
- svn://svn.egovlabs.gv.at/svnroot/mocca/trunk
-
-
- E-Government Innovation Center (EGIZ)
- http://www.egiz.gv.at
-
-
-
-
-
- maven-compiler-plugin
- org.apache.maven.plugins
- 2.0.2
-
-
- 1.6
- 1.6
- true
- true
- UTF-8
-
-
-
- maven-resources-plugin
-
- UTF-8
-
-
-
- maven-assembly-plugin
- org.apache.maven.plugins
- 2.2-beta-2
-
-
- maven-dependency-plugin
- org.apache.maven.plugins
- 2.0
-
-
-
- jaxws-maven-plugin
- org.codehaus.mojo
- 1.10
-
-
- org.apache.maven.plugins
- maven-release-plugin
- 2.0-beta-7
-
-
-
-
-
- maven-assembly-plugin
-
-
- ${basedir}/src/main/assemblies/assembly-test.xml
-
-
-
-
-
-
-
-
-
- mocca-egovlabs
- MOCCA EGovLabs
- http://mocca.egovlabs.gv.at/m2/repository/
-
-
- maven2-repository.dev.java.net
- Java.net Repository for Maven 2
- http://download.java.net/maven/2/
-
-
- maven1-repository.dev.java.net
- Java.net Repository for Maven 1
- http://download.java.net/maven/1/
- legacy
-
-
-
-
- log4j
- log4j
- runtime
-
-
- junit
- junit
- test
-
-
-
-
-
- log4j
- log4j
- 1.2.12
- runtime
-
-
- commons-logging
- commons-logging
- 1.1.1
- compile
-
-
- junit
- junit
- 4.4
- test
-
-
- xerces
- xercesImpl
- 2.9.1
-
-
- xalan
- xalan
- 2.7.0
-
-
- iaik
- iaik_jce_full_signed
- 3.16
- compile
-
-
- iaik
- iaik_jce_me4se
- 3.04
-
-
- iaik
- iaik_ecc_signed
- 2.15
-
-
- iaik
- iaik_xsect
- 1.14
-
-
- iaik
- iaik_pki
- 1.0-MOCCA
- compile
-
-
- commons-fileupload
- commons-fileupload
- 1.2.1
- compile
-
-
- commons-httpclient
- commons-httpclient
- 3.1
- compile
-
-
-
+
+ 4.0.0
+ at.gv.egiz
+ bku
+ pom
+ 1.0.1
+ BKU
+ http://bku.egiz.gv.at
+
+ utils
+ bkucommon
+ STAL
+ BKUOnline
+ smcc
+ BKULocal
+ BKUApplet
+ smccSTAL
+ STALService
+ BKUCommonGUI
+ BKUViewer
+ BKULocalApp
+
+
+
+ mcentner
+ Martin Centner
+ mcentner@egiz.gv.at
+
+
+ wbauer
+ Wolfgang Bauer
+ wbauer@egiz.gv.at
+
+
+ corthacker
+ Clemens Orthacker
+ corthacker@egiz.gv.at
+
+
+
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1
+ scm:svn:svn+ssh://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1
+ svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1
+
+
+ E-Government Innovation Center (EGIZ)
+ http://www.egiz.gv.at
+
+
+
+
+
+ maven-compiler-plugin
+ org.apache.maven.plugins
+ 2.0.2
+
+
+ 1.6
+ 1.6
+ true
+ true
+ UTF-8
+
+
+
+ maven-resources-plugin
+
+ UTF-8
+
+
+
+ maven-assembly-plugin
+ org.apache.maven.plugins
+ 2.2-beta-2
+
+
+ maven-dependency-plugin
+ org.apache.maven.plugins
+ 2.0
+
+
+
+ jaxws-maven-plugin
+ org.codehaus.mojo
+ 1.10
+
+
+ org.apache.maven.plugins
+ maven-release-plugin
+ 2.0-beta-7
+
+
+
+
+
+ maven-assembly-plugin
+
+
+ ${basedir}/src/main/assemblies/assembly-test.xml
+
+
+
+
+
+
+
+
+
+ mocca-egovlabs
+ MOCCA EGovLabs
+ http://mocca.egovlabs.gv.at/m2/repository/
+
+
+ maven2-repository.dev.java.net
+ Java.net Repository for Maven 2
+ http://download.java.net/maven/2/
+
+
+ maven1-repository.dev.java.net
+ Java.net Repository for Maven 1
+ http://download.java.net/maven/1/
+ legacy
+
+
+
+
+ log4j
+ log4j
+ runtime
+
+
+ junit
+ junit
+ test
+
+
+
+
+
+ log4j
+ log4j
+ 1.2.12
+ runtime
+
+
+ commons-logging
+ commons-logging
+ 1.1.1
+ compile
+
+
+ junit
+ junit
+ 4.4
+ test
+
+
+ xerces
+ xercesImpl
+ 2.9.1
+
+
+ xalan
+ xalan
+ 2.7.0
+
+
+ iaik
+ iaik_jce_full_signed
+ 3.16
+ compile
+
+
+ iaik
+ iaik_jce_me4se
+ 3.04
+
+
+ iaik
+ iaik_ecc_signed
+ 2.15
+
+
+ iaik
+ iaik_xsect
+ 1.14
+
+
+ iaik
+ iaik_pki
+ 1.0-MOCCA
+ compile
+
+
+ commons-fileupload
+ commons-fileupload
+ 1.2.1
+ compile
+
+
+ commons-httpclient
+ commons-httpclient
+ 3.1
+ compile
+
+
+
\ No newline at end of file
diff --git a/smcc/pom.xml b/smcc/pom.xml
index ba1ffcce..ffdba367 100644
--- a/smcc/pom.xml
+++ b/smcc/pom.xml
@@ -1,43 +1,42 @@
-
-
-
- bku
- at.gv.egiz
- 1.0.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz
- smcc
- smcc
- jar
- 1.0.0-SNAPSHOT
- http://bku.egiz.gv.at
-
-
-
- maven-compiler-plugin
- org.apache.maven.plugins
-
- false
-
-
-
-
-
-
- commons-logging
- commons-logging
-
-
- junit
- junit
- 3.8.1
- test
-
-
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz
+ smcc
+ smcc
+ jar
+ 1.0.1
+ http://bku.egiz.gv.at
+
+
+
+ maven-compiler-plugin
+ org.apache.maven.plugins
+
+ false
+
+
+
+
+
+
+ commons-logging
+ commons-logging
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+
+
\ No newline at end of file
diff --git a/smccSTAL/pom.xml b/smccSTAL/pom.xml
index 78ba1aea..6729f3f0 100644
--- a/smccSTAL/pom.xml
+++ b/smccSTAL/pom.xml
@@ -1,50 +1,48 @@
-
-
-
- bku
- at.gv.egiz
- 1.0.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz
- smccSTAL
- smcc STAL
- 1.0.0-SNAPSHOT
-
-
-
- maven-compiler-plugin
- org.apache.maven.plugins
-
- false
-
-
-
-
-
-
- at.gv.egiz
- STAL
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- smcc
- 1.0.0-SNAPSHOT
-
-
- at.gv.egiz
- BKUCommonGUI
- 1.0.0-SNAPSHOT
-
-
- iaik
- iaik_jce_me4se
-
-
- commons-logging
- commons-logging
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz
+ smccSTAL
+ smcc STAL
+ 1.0.1
+
+
+
+ maven-compiler-plugin
+ org.apache.maven.plugins
+
+ false
+
+
+
+
+
+
+ at.gv.egiz
+ STAL
+ 1.0.1
+
+
+ at.gv.egiz
+ smcc
+ 1.0.1
+
+
+ at.gv.egiz
+ BKUCommonGUI
+ 1.0.1
+
+
+ iaik
+ iaik_jce_me4se
+
+
+ commons-logging
+ commons-logging
+
+
\ No newline at end of file
diff --git a/utils/pom.xml b/utils/pom.xml
index 871dbb0a..b0769293 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -1,77 +1,72 @@
-
-
-
- bku
- at.gv.egiz
- 1.0.0-SNAPSHOT
-
- 4.0.0
- at.gv.egiz
- utils
- BKU Utils
- jar
- 1.0.0-SNAPSHOT
- http://bku.egiz.gv.at
-
-
-
-
-
-
-
- commons-logging
- commons-logging
-
-
- iaik
- iaik_jce_full_signed
-
-
- iaik
- iaik_ecc_signed
-
-
- iaik
- iaik_xsect
-
-
-
-
-
+
+
+ bku
+ at.gv.egiz
+ 1.0.1
+
+ 4.0.0
+ at.gv.egiz
+ utils
+ BKU Utils
+ jar
+ 1.0.1
+ http://bku.egiz.gv.at
+
+
+
+
+
+
+
+ commons-logging
+ commons-logging
+
+
+ iaik
+ iaik_jce_full_signed
+
+
+ iaik
+ iaik_ecc_signed
+
+
+ iaik
+ iaik_xsect
+
+
+
+
+
\ No newline at end of file
--
cgit v1.2.3
From 86962d8745b41a6cdb9fd95496176e698c0f6a9c Mon Sep 17 00:00:00 2001
From: mcentner
Date: Tue, 25 Nov 2008 07:47:48 +0000
Subject: [maven-release-plugin] prepare for next development iteration
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@203 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 14 +++++++-------
BKUCommonGUI/pom.xml | 8 ++++----
BKULocal/pom.xml | 22 +++++++++++-----------
BKULocalApp/pom.xml | 8 ++++----
BKUOnline/pom.xml | 20 ++++++++++----------
BKUViewer/pom.xml | 6 +++---
STAL/pom.xml | 4 ++--
STALService/pom.xml | 6 +++---
bkucommon/pom.xml | 8 ++++----
pom.xml | 8 ++++----
smcc/pom.xml | 4 ++--
smccSTAL/pom.xml | 10 +++++-----
utils/pom.xml | 4 ++--
13 files changed, 61 insertions(+), 61 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index 6f900ad3..1d880919 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.1
+ 1.0.1-SNAPSHOT4.0.0at.gv.egizBKUAppletBKU Applet
- 1.0.1
+ 1.0.1-SNAPSHOT
@@ -117,27 +117,27 @@
at.gv.egizsmcc
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizSTAL
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizSTALService
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizsmccSTAL
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizBKUCommonGUI
- 1.0.1
+ 1.0.1-SNAPSHOTcommons-logging
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index 3ae1717d..21518416 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -2,23 +2,23 @@
bkuat.gv.egiz
- 1.0.1
+ 1.0.1-SNAPSHOT4.0.0at.gv.egizBKUCommonGUIBKU Common GUI
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizsmcc
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizSTAL
- 1.0.1
+ 1.0.1-SNAPSHOTcompile
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index 3cf9b0cd..9fe36269 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -2,19 +2,19 @@
bkuat.gv.egiz
- 1.0.1
+ 1.0.1-SNAPSHOT4.0.0at.gv.egizBKULocalwarBKU Local
- 1.0.1
+ 1.0.1-SNAPSHOT
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.1/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
@@ -56,22 +56,22 @@
at.gv.egizSTAL
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizbkucommon
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizsmcc
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizsmccSTAL
- 1.0.1
+ 1.0.1-SNAPSHOTorg.springframework
@@ -96,12 +96,12 @@
at.gv.egizBKUApplet
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizBKUViewer
- 1.0.1
+ 1.0.1-SNAPSHOT
diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml
index 2a5b8d19..c0d406b3 100644
--- a/BKULocalApp/pom.xml
+++ b/BKULocalApp/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.1
+ 1.0.1-SNAPSHOT4.0.0at.gv.egiz.bkuBKULocalAppBKU Local App
- 1.0.1
+ 1.0.1-SNAPSHOT
@@ -76,13 +76,13 @@
at.gv.egizBKULocal
- 1.0.1
+ 1.0.1-SNAPSHOTwarutilsat.gv.egiz
- 1.0.1
+ 1.0.1-SNAPSHOTcompile
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index 7bee3a02..88cdf9e8 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -2,14 +2,14 @@
bkuat.gv.egiz
- 1.0.1
+ 1.0.1-SNAPSHOT4.0.0at.gv.egizBKUOnlinewarBKU Online
- 1.0.1
+ 1.0.1-SNAPSHOT
@@ -23,12 +23,12 @@
at.gv.egizbkucommon
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizBKUViewer
- 1.0.1
+ 1.0.1-SNAPSHOTcommons-logging
@@ -53,20 +53,20 @@
at.gv.egizSTALService
- 1.0.1
+ 1.0.1-SNAPSHOTcompileat.gv.egizBKUApplet
- 1.0.1
+ 1.0.1-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizBKUApplet
- 1.0.1-SNAPSHOT
+ 1.0.2providedat.gv.egizSTALService
- 1.0.1-SNAPSHOT
+ 1.0.2at.gv.egizBKUApplet
- 1.0.2
+ 1.0.2-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizBKUApplet
- 1.0.2-SNAPSHOT
+ 1.0.1-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.2-SNAPSHOT
+ 1.0.1-SNAPSHOTat.gv.egizBKUApplet
- 1.0.1-SNAPSHOT
+ 1.0.1providedat.gv.egizSTALService
- 1.0.1-SNAPSHOT
+ 1.0.1at.gv.egizBKUApplet
- 1.0.1
+ 1.0.1-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.1
+ 1.0.1-SNAPSHOTat.gv.egizBKUApplet
- 1.0.1-SNAPSHOT
+ 1.0.1providedat.gv.egizSTALService
- 1.0.1-SNAPSHOT
+ 1.0.1at.gv.egizBKUApplet
- 1.0.1
+ 1.0.2-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.1
+ 1.0.2-SNAPSHOTat.gv.egizBKUApplet
- 1.0.2-SNAPSHOT
+ 1.0.2providedat.gv.egizSTALService
- 1.0.2-SNAPSHOT
+ 1.0.2
+ 1.61.61.6true
@@ -86,8 +84,7 @@
+ jaxws-maven-pluginorg.codehaus.mojo
@@ -109,8 +106,7 @@
+ ${basedir}/src/main/assemblies/assembly-server.xml
+
diff --git a/smcc/pom.xml b/smcc/pom.xml
index 62c60e75..a973c809 100644
--- a/smcc/pom.xml
+++ b/smcc/pom.xml
@@ -2,14 +2,14 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizsmccsmccjar
- 1.0.2-SNAPSHOT
+ 1.0.2http://bku.egiz.gv.at
diff --git a/smccSTAL/pom.xml b/smccSTAL/pom.xml
index 3fa65d19..7d4334bd 100644
--- a/smccSTAL/pom.xml
+++ b/smccSTAL/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizsmccSTALsmcc STAL
- 1.0.2-SNAPSHOT
+ 1.0.2
@@ -24,17 +24,17 @@
at.gv.egizSTAL
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizsmcc
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizBKUCommonGUI
- 1.0.2-SNAPSHOT
+ 1.0.2iaik
diff --git a/utils/pom.xml b/utils/pom.xml
index b183ea03..52fa6917 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -2,14 +2,14 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizutilsBKU Utilsjar
- 1.0.2-SNAPSHOT
+ 1.0.2http://bku.egiz.gv.at
--
cgit v1.2.3
From ce598ba5142ff7673085dd90865f9323d69574be Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 20 Jan 2009 16:56:08 +0000
Subject: [maven-release-plugin] rollback the release of bku-1.0.2
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@274 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 14 +++++++-------
BKUCommonGUI/pom.xml | 8 ++++----
BKULocal/pom.xml | 22 +++++++++++-----------
BKULocalApp/pom.xml | 8 ++++----
BKUOnline/pom.xml | 20 ++++++++++----------
BKUViewer/pom.xml | 6 +++---
STAL/pom.xml | 4 ++--
STALExt/pom.xml | 8 ++++----
STALService/pom.xml | 6 +++---
bkucommon/pom.xml | 8 ++++----
pom.xml | 23 ++++++++++++++---------
smcc/pom.xml | 4 ++--
smccSTAL/pom.xml | 10 +++++-----
utils/pom.xml | 4 ++--
14 files changed, 75 insertions(+), 70 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index 49159c5e..8947daa0 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egizBKUAppletBKU Applet
- 1.0.2
+ 1.0.2-SNAPSHOT
@@ -117,27 +117,27 @@
at.gv.egizsmcc
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizSTAL
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizSTALService
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizsmccSTAL
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizBKUCommonGUI
- 1.0.2
+ 1.0.2-SNAPSHOTcommons-logging
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index 64b93904..ff993fa2 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -2,23 +2,23 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egizBKUCommonGUIBKU Common GUI
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizsmcc
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizSTAL
- 1.0.2
+ 1.0.2-SNAPSHOTcompile
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index d49ef4d7..6b3b7fc8 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -2,19 +2,19 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egizBKULocalwarBKU Local
- 1.0.1
+ 1.0.2-SNAPSHOT
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/bku-1.0.2/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/bku-1.0.2/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/bku-1.0.2/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
@@ -56,22 +56,22 @@
at.gv.egizSTAL
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizbkucommon
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizsmcc
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizsmccSTAL
- 1.0.2
+ 1.0.2-SNAPSHOTorg.springframework
@@ -96,12 +96,12 @@
at.gv.egizBKUApplet
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizBKUViewer
- 1.0.2
+ 1.0.2-SNAPSHOT
diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml
index e253ab46..f2280e29 100644
--- a/BKULocalApp/pom.xml
+++ b/BKULocalApp/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egiz.bkuBKULocalAppBKU Local App
- 1.0.1
+ 1.0.2-SNAPSHOT
@@ -76,13 +76,13 @@
at.gv.egizBKULocal
- 1.0.1
+ 1.0.2-SNAPSHOTwarutilsat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOTcompile
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index 85209fa9..e5db2e55 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -3,14 +3,14 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egizBKUOnlinewarBKU Online
- 1.0.2
+ 1.0.2-SNAPSHOT
@@ -24,12 +24,12 @@
at.gv.egizbkucommon
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizBKUViewer
- 1.0.2
+ 1.0.2-SNAPSHOTcommons-logging
@@ -53,20 +53,20 @@
at.gv.egizSTALService
- 1.0.2
+ 1.0.2-SNAPSHOTcompileat.gv.egizBKUApplet
- 1.0.2
+ 1.0.2-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.2
+ 1.0.2-SNAPSHOT
+ 1.61.61.6true
@@ -84,7 +86,8 @@
+ jaxws-maven-pluginorg.codehaus.mojo
@@ -106,7 +109,8 @@
+ ${basedir}/src/main/assemblies/assembly-server.xml
+
diff --git a/smcc/pom.xml b/smcc/pom.xml
index a973c809..62c60e75 100644
--- a/smcc/pom.xml
+++ b/smcc/pom.xml
@@ -2,14 +2,14 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egizsmccsmccjar
- 1.0.2
+ 1.0.2-SNAPSHOThttp://bku.egiz.gv.at
diff --git a/smccSTAL/pom.xml b/smccSTAL/pom.xml
index 7d4334bd..3fa65d19 100644
--- a/smccSTAL/pom.xml
+++ b/smccSTAL/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egizsmccSTALsmcc STAL
- 1.0.2
+ 1.0.2-SNAPSHOT
@@ -24,17 +24,17 @@
at.gv.egizSTAL
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizsmcc
- 1.0.2
+ 1.0.2-SNAPSHOTat.gv.egizBKUCommonGUI
- 1.0.2
+ 1.0.2-SNAPSHOTiaik
diff --git a/utils/pom.xml b/utils/pom.xml
index 52fa6917..b183ea03 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -2,14 +2,14 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.2-SNAPSHOT4.0.0at.gv.egizutilsBKU Utilsjar
- 1.0.2
+ 1.0.2-SNAPSHOThttp://bku.egiz.gv.at
--
cgit v1.2.3
From 3f673f19aa8c4aec3d40d98731de289cbb7e79c6 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 20 Jan 2009 17:01:02 +0000
Subject: [maven-release-plugin] prepare release mocca-1.0.2
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@275 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 14 +++++++-------
BKUCommonGUI/pom.xml | 8 ++++----
BKULocal/pom.xml | 22 +++++++++++-----------
BKULocalApp/pom.xml | 8 ++++----
BKUOnline/pom.xml | 20 ++++++++++----------
BKUViewer/pom.xml | 6 +++---
STAL/pom.xml | 4 ++--
STALExt/pom.xml | 8 ++++----
STALService/pom.xml | 6 +++---
bkucommon/pom.xml | 8 ++++----
pom.xml | 23 +++++++++--------------
smcc/pom.xml | 4 ++--
smccSTAL/pom.xml | 10 +++++-----
utils/pom.xml | 4 ++--
14 files changed, 70 insertions(+), 75 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index 8947daa0..49159c5e 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizBKUAppletBKU Applet
- 1.0.2-SNAPSHOT
+ 1.0.2
@@ -117,27 +117,27 @@
at.gv.egizsmcc
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizSTAL
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizSTALService
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizsmccSTAL
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizBKUCommonGUI
- 1.0.2-SNAPSHOT
+ 1.0.2commons-logging
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index ff993fa2..64b93904 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -2,23 +2,23 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizBKUCommonGUIBKU Common GUI
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizsmcc
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizSTAL
- 1.0.2-SNAPSHOT
+ 1.0.2compile
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index 6b3b7fc8..e147a6ad 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -2,19 +2,19 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizBKULocalwarBKU Local
- 1.0.2-SNAPSHOT
+ 1.0.1
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.2/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.2/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.2/BKULocal
@@ -56,22 +56,22 @@
at.gv.egizSTAL
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizbkucommon
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizsmcc
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizsmccSTAL
- 1.0.2-SNAPSHOT
+ 1.0.2org.springframework
@@ -96,12 +96,12 @@
at.gv.egizBKUApplet
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizBKUViewer
- 1.0.2-SNAPSHOT
+ 1.0.2
diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml
index f2280e29..e253ab46 100644
--- a/BKULocalApp/pom.xml
+++ b/BKULocalApp/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egiz.bkuBKULocalAppBKU Local App
- 1.0.2-SNAPSHOT
+ 1.0.1
@@ -76,13 +76,13 @@
at.gv.egizBKULocal
- 1.0.2-SNAPSHOT
+ 1.0.1warutilsat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.2compile
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index e5db2e55..cfc5507e 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -3,14 +3,14 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizBKUOnlinewarBKU Online
- 1.0.2-SNAPSHOT
+ 1.0.2
@@ -24,12 +24,12 @@
at.gv.egizbkucommon
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizBKUViewer
- 1.0.2-SNAPSHOT
+ 1.0.2commons-logging
@@ -53,20 +53,20 @@
at.gv.egizSTALService
- 1.0.2-SNAPSHOT
+ 1.0.2compileat.gv.egizBKUApplet
- 1.0.2-SNAPSHOT
+ 1.0.2providedat.gv.egizSTALService
- 1.0.2-SNAPSHOT
+ 1.0.2
+ 1.61.61.6true
@@ -86,8 +84,7 @@
+ jaxws-maven-pluginorg.codehaus.mojo
@@ -109,8 +106,7 @@
+ ${basedir}/src/main/assemblies/assembly-server.xml
+
diff --git a/smcc/pom.xml b/smcc/pom.xml
index 62c60e75..a973c809 100644
--- a/smcc/pom.xml
+++ b/smcc/pom.xml
@@ -2,14 +2,14 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizsmccsmccjar
- 1.0.2-SNAPSHOT
+ 1.0.2http://bku.egiz.gv.at
diff --git a/smccSTAL/pom.xml b/smccSTAL/pom.xml
index 3fa65d19..7d4334bd 100644
--- a/smccSTAL/pom.xml
+++ b/smccSTAL/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizsmccSTALsmcc STAL
- 1.0.2-SNAPSHOT
+ 1.0.2
@@ -24,17 +24,17 @@
at.gv.egizSTAL
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizsmcc
- 1.0.2-SNAPSHOT
+ 1.0.2at.gv.egizBKUCommonGUI
- 1.0.2-SNAPSHOT
+ 1.0.2iaik
diff --git a/utils/pom.xml b/utils/pom.xml
index b183ea03..52fa6917 100644
--- a/utils/pom.xml
+++ b/utils/pom.xml
@@ -2,14 +2,14 @@
bkuat.gv.egiz
- 1.0.2-SNAPSHOT
+ 1.0.24.0.0at.gv.egizutilsBKU Utilsjar
- 1.0.2-SNAPSHOT
+ 1.0.2http://bku.egiz.gv.at
--
cgit v1.2.3
From ce977ee25ede5535beaf72bd0555c0984d5741bf Mon Sep 17 00:00:00 2001
From: clemenso
Date: Tue, 20 Jan 2009 17:01:18 +0000
Subject: [maven-release-plugin] prepare for next development iteration
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@277 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 14 +++++++-------
BKUCommonGUI/pom.xml | 8 ++++----
BKULocal/pom.xml | 22 +++++++++++-----------
BKULocalApp/pom.xml | 8 ++++----
BKUOnline/pom.xml | 20 ++++++++++----------
BKUViewer/pom.xml | 6 +++---
STAL/pom.xml | 4 ++--
STALExt/pom.xml | 6 +++---
STALService/pom.xml | 6 +++---
bkucommon/pom.xml | 8 ++++----
pom.xml | 8 ++++----
smcc/pom.xml | 4 ++--
smccSTAL/pom.xml | 10 +++++-----
utils/pom.xml | 4 ++--
14 files changed, 64 insertions(+), 64 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index 49159c5e..303a44ff 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.3-SNAPSHOT4.0.0at.gv.egizBKUAppletBKU Applet
- 1.0.2
+ 1.0.3-SNAPSHOT
@@ -117,27 +117,27 @@
at.gv.egizsmcc
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizSTAL
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizSTALService
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizsmccSTAL
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizBKUCommonGUI
- 1.0.2
+ 1.0.3-SNAPSHOTcommons-logging
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index 64b93904..fc99b6bb 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -2,23 +2,23 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.3-SNAPSHOT4.0.0at.gv.egizBKUCommonGUIBKU Common GUI
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizsmcc
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizSTAL
- 1.0.2
+ 1.0.3-SNAPSHOTcompile
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index e147a6ad..ab1b9fb9 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -2,19 +2,19 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.3-SNAPSHOT4.0.0at.gv.egizBKULocalwarBKU Local
- 1.0.1
+ 1.0.3-SNAPSHOT
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.2/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.2/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.2/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
@@ -56,22 +56,22 @@
at.gv.egizSTAL
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizbkucommon
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizsmcc
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizsmccSTAL
- 1.0.2
+ 1.0.3-SNAPSHOTorg.springframework
@@ -96,12 +96,12 @@
at.gv.egizBKUApplet
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizBKUViewer
- 1.0.2
+ 1.0.3-SNAPSHOT
diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml
index e253ab46..10035ee5 100644
--- a/BKULocalApp/pom.xml
+++ b/BKULocalApp/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.3-SNAPSHOT4.0.0at.gv.egiz.bkuBKULocalAppBKU Local App
- 1.0.1
+ 1.0.3-SNAPSHOT
@@ -76,13 +76,13 @@
at.gv.egizBKULocal
- 1.0.1
+ 1.0.3-SNAPSHOTwarutilsat.gv.egiz
- 1.0.2
+ 1.0.3-SNAPSHOTcompile
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index cfc5507e..d705ee3d 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -3,14 +3,14 @@
bkuat.gv.egiz
- 1.0.2
+ 1.0.3-SNAPSHOT4.0.0at.gv.egizBKUOnlinewarBKU Online
- 1.0.2
+ 1.0.3-SNAPSHOT
@@ -24,12 +24,12 @@
at.gv.egizbkucommon
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizBKUViewer
- 1.0.2
+ 1.0.3-SNAPSHOTcommons-logging
@@ -53,20 +53,20 @@
at.gv.egizSTALService
- 1.0.2
+ 1.0.3-SNAPSHOTcompileat.gv.egizBKUApplet
- 1.0.2
+ 1.0.3-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.2
+ 1.0.3-SNAPSHOTat.gv.egizBKUApplet
- 1.0.3-SNAPSHOT
+ 1.0.3providedat.gv.egizSTALService
- 1.0.3-SNAPSHOT
+ 1.0.3at.gv.egizBKUApplet
- 1.0.3
+ 1.0.4-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.3
+ 1.0.4-SNAPSHOT
-
-
+
+
-
-
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 5ee0058f..51906616 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -63,9 +63,11 @@ public interface BKUGUIFacade {
public static final String MESSAGE_INSERTCARD = "message.insertcard";
public static final String MESSAGE_ENTERPIN = "message.enterpin";
public static final String MESSAGE_HASHDATALINK = "message.hashdatalink";
+ public static final String MESSAGE_HASHDATALINK_TINY = "message.hashdatalink.tiny";
// public static final String MESSAGE_HASHDATA = "message.hashdata";
public static final String MESSAGE_HASHDATALIST = "message.hashdatalist";
public static final String MESSAGE_RETRIES = "message.retries";
+ public static final String MESSAGE_LAST_RETRY = "message.retries.last";
public static final String MESSAGE_OVERWRITE = "message.overwrite";
public static final String MESSAGE_HELP = "message.help";
public static final String WARNING_XHTML = "warning.xhtml";
@@ -90,7 +92,7 @@ public interface BKUGUIFacade {
public static final String SAVE_HASHDATAINPUT_PREFIX = "save.hashdatainput.prefix";
public static final String ALT_HELP = "alt.help";
- public enum Style { simple, advanced };
+ public enum Style { tiny, simple, advanced };
// public void init(Container contentPane, Locale locale, Style guiStyle, URL background, ActionListener helpListener);
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index d61c9a03..1e63c8d7 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -53,6 +53,7 @@ import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTable;
+import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
@@ -69,6 +70,10 @@ public class BKUGUIImpl implements BKUGUIFacade {
private static final Log log = LogFactory.getLog(BKUGUIImpl.class);
+ protected enum PinLabelPosition {
+ LEFT, ABOVE
+ }
+
protected HelpMouseListener helpListener;
protected Container contentPane;
@@ -92,6 +97,9 @@ public class BKUGUIImpl implements BKUGUIFacade {
protected boolean renderHeaderPanel = false;
protected boolean renderIconPanel = false;
protected boolean renderCancelButton = false;
+ protected boolean shortText = false;
+ protected PinLabelPosition pinLabelPos = PinLabelPosition.LEFT;
+ protected boolean renderRefId = false;
/**
* set contentPane
@@ -125,6 +133,10 @@ public class BKUGUIImpl implements BKUGUIFacade {
renderHeaderPanel = true;
renderIconPanel = false;
renderCancelButton = true;
+ renderRefId = true;
+ } else if (guiStyle == Style.tiny) {
+ shortText = true;
+ pinLabelPos = PinLabelPosition.ABOVE;
}
registerHelpListener(helpListener);
@@ -537,11 +549,21 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (numRetries < 0) {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
String infoPattern = messages.getString(MESSAGE_ENTERPIN);
- infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {pinSpec.getLocalizedName()}));
+ if (shortText) {
+ infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {"PIN"}));
+ } else {
+ infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {pinSpec.getLocalizedName()}));
+ }
helpListener.setHelpTopic(HELP_CARDPIN);
} else {
+ String retryPattern;
+ if (numRetries < 2) {
+ retryPattern = messages.getString(MESSAGE_LAST_RETRY);
+ } else {
+ retryPattern = messages.getString(MESSAGE_RETRIES);
+ }
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
- infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
+ infoLabel.setText(MessageFormat.format(retryPattern, new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
helpListener.setHelpTopic(HELP_RETRY);
}
@@ -570,27 +592,47 @@ public class BKUGUIImpl implements BKUGUIFacade {
infoVertical
.addComponent(helpLabel);
}
-
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(infoHorizontal)
+
+ GroupLayout.Group pinHorizontal;
+ GroupLayout.Group pinVertical;
+
+ if (pinLabelPos == PinLabelPosition.ABOVE) {
+ pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) //))
- .addComponent(pinsizeLabel))));
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createSequentialGroup()
- .addGroup(infoVertical)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
+ pinVertical = mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(cardPinLabel)
- .addComponent(pinField))
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
+ } else {
+ pinHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(cardPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(pinsizeLabel));
-
-
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(pinsizeLabel));
+ pinVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(cardPinLabel)
+ .addComponent(pinField);
+ }
+
+ mainPanelLayout.setHorizontalGroup(
+ mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addGroup(infoHorizontal)
+ .addGroup(pinHorizontal));
+
+ mainPanelLayout.setVerticalGroup(
+ mainPanelLayout.createSequentialGroup()
+ .addGroup(infoVertical)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(pinVertical)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinsizeLabel));
+
+
GroupLayout buttonPanelLayout = new GroupLayout(buttonPanel);
buttonPanel.setLayout(buttonPanelLayout);
@@ -707,7 +749,11 @@ public class BKUGUIImpl implements BKUGUIFacade {
JLabel infoLabel = new JLabel();
if (numRetries < 0) {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- infoLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
+ if (shortText) {
+ infoLabel.setText(messages.getString(MESSAGE_HASHDATALINK_TINY));
+ } else {
+ infoLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
+ }
infoLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
infoLabel.setForeground(HYPERLINK_COLOR);
infoLabel.addMouseListener(new MouseAdapter() {
@@ -720,8 +766,14 @@ public class BKUGUIImpl implements BKUGUIFacade {
});
helpListener.setHelpTopic(HELP_SIGNPIN);
} else {
+ String retryPattern;
+ if (numRetries < 2) {
+ retryPattern = messages.getString(MESSAGE_LAST_RETRY);
+ } else {
+ retryPattern = messages.getString(MESSAGE_RETRIES);
+ }
+ infoLabel.setText(MessageFormat.format(retryPattern, new Object[]{String.valueOf(numRetries)}));
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
- infoLabel.setText(MessageFormat.format(messages.getString(MESSAGE_RETRIES), new Object[]{String.valueOf(numRetries)}));
infoLabel.setForeground(ERROR_COLOR);
helpListener.setHelpTopic(HELP_RETRY);
}
@@ -737,28 +789,48 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (!renderHeaderPanel) {
infoHorizontal
.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
- .addComponent(helpLabel); //, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
+ .addComponent(helpLabel);
infoVertical
.addComponent(helpLabel);
}
+ GroupLayout.Group pinHorizontal;
+ GroupLayout.Group pinVertical;
+
+ if (pinLabelPos == PinLabelPosition.ABOVE) {
+ pinHorizontal = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
+ .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addGroup(mainPanelLayout.createSequentialGroup()
+ .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 0, Short.MAX_VALUE)
+ .addComponent(pinsizeLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE));
+
+ pinVertical = mainPanelLayout.createSequentialGroup()
+ .addComponent(signPinLabel)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE);
+ } else {
+ pinHorizontal = mainPanelLayout.createSequentialGroup()
+ .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
+ .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
+ .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(pinsizeLabel));
+ pinVertical = mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
+ .addComponent(signPinLabel)
+ .addComponent(pinField);
+ }
+
mainPanelLayout.setHorizontalGroup(
mainPanelLayout.createParallelGroup(GroupLayout.Alignment.LEADING)
.addGroup(infoHorizontal)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addComponent(signPinLabel, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(pinField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(pinsizeLabel))));
+ .addGroup(pinHorizontal));
mainPanelLayout.setVerticalGroup(
mainPanelLayout.createSequentialGroup()
.addGroup(infoVertical)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(mainPanelLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(signPinLabel)
- .addComponent(pinField))
+ .addGroup(pinVertical)
.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
.addComponent(pinsizeLabel));
@@ -1084,9 +1156,9 @@ public class BKUGUIImpl implements BKUGUIFacade {
String refIdLabelPattern = messages.getString(MESSAGE_HASHDATALIST);
refIdLabel.setText(MessageFormat.format(refIdLabelPattern, new Object[]{signedReferences.size()}));
- HashDataTableModel tableModel = new HashDataTableModel(signedReferences);
+ HashDataTableModel tableModel = new HashDataTableModel(signedReferences, renderRefId);
final JTable hashDataTable = new JTable(tableModel);
- hashDataTable.setDefaultRenderer(HashDataInput.class, new HyperlinkRenderer());
+ hashDataTable.setDefaultRenderer(HashDataInput.class, new HyperlinkRenderer(renderRefId));
hashDataTable.setTableHeader(null);
// not possible to add mouse listener to TableCellRenderer
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
index b0f51a78..70842102 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HashDataTableModel.java
@@ -31,14 +31,23 @@ class HashDataTableModel extends DefaultTableModel {
protected static final Log log = LogFactory.getLog(HashDataTableModel.class);
/** HashDataInput in first column, register hyperlinkrenderer only here */
- protected Class[] types = new Class[]{ HashDataInput.class, String.class };
+ protected Class[] types;
protected List hashDataInputs;
-
- public HashDataTableModel(List hashDataInputs) {
- super(0, 2);
+
+ public HashDataTableModel(List hashDataInputs, boolean twoColLayout) {
+ super(0, (twoColLayout) ? 2 : 1);
this.hashDataInputs = hashDataInputs;
- for (HashDataInput hdi : hashDataInputs) {
- addRow(new Object[]{ hdi, hdi.getMimeType()});
+
+ if (twoColLayout) {
+ types = new Class[] { HashDataInput.class, String.class };
+ for (HashDataInput hdi : hashDataInputs) {
+ addRow(new Object[] { hdi, hdi.getMimeType() });
+ }
+ } else {
+ types = new Class[] { HashDataInput.class };
+ for (HashDataInput hdi : hashDataInputs) {
+ addRow(new Object[] { hdi });
+ }
}
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
index f983706e..16024fcc 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/HyperlinkRenderer.java
@@ -26,13 +26,25 @@ import javax.swing.table.DefaultTableCellRenderer;
*/
public class HyperlinkRenderer extends DefaultTableCellRenderer {
+ protected boolean renderReferenceId;
+
+ public HyperlinkRenderer(boolean renderReferenceId) {
+ this.renderReferenceId = renderReferenceId;
+ }
+
/**
* cannot change mouse cursor here, do in jTable
* @param value
*/
@Override
protected void setValue(Object value) {
- super.setText("" + ((HashDataInput) value).getReferenceId() + "");
+ String hrefText;
+ if (renderReferenceId) {
+ hrefText = ((HashDataInput) value).getReferenceId();
+ } else {
+ hrefText = ((HashDataInput) value).getMimeType();
+ }
+ super.setText("" + hrefText + "");
setForeground(BKUGUIFacade.HYPERLINK_COLOR);
}
}
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index d2b47a9d..4562fda5 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -32,11 +32,13 @@ message.wait=Bitte warten...
message.insertcard=Bitte die B\u00FCrgerkarte in den Kartenleser stecken
message.enterpin={0} eingeben
message.hashdatalink=Signaturdaten anzeigen
+message.hashdatalink.tiny=Signaturdaten
#message.hashdata=Hinweis: Dies ist eine Voransicht des zu signierenden Inhalts. F\u00FCr eine standardkonforme Darstellung siehe Hilfe (i).
#message.hashdata=Dies ist eine Voransicht des zu signierenden Inhaltes. F\u00FCr Details siehe Hilfe (i).
#verwenden sie bitte die von ihrem System zur Verf\u00FCgung gestellte {0} Anwendung.
message.hashdatalist={0} Signaturdaten:
-message.retries=Noch {0} Versuch(e)
+message.retries.last=Letzter Versuch!
+message.retries=Noch {0} Versuche
message.overwrite=M\u00F6chten Sie das existierende Dokument {0} \u00FCberschreiben?
message.help=Hilfe zu {0}
warning.xhtml=Hinweis: Dies ist eine Voransicht des zu signierenden Inhalts. F\u00FCr eine standardkonforme Darstellung siehe Hilfe (i).
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
index 524a2a98..0faa3dba 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages_en.properties
@@ -32,8 +32,10 @@ message.wait=Please wait...
message.insertcard=Please insert your citizen card into the reader
message.enterpin=Enter {0}
message.hashdatalink=Display signature data
+message.hashdatalink.tiny=signature data
#message.hashdata=Remark: This is a preview of the data to-be signed. For standards compliant display see help.
message.hashdatalist={0} signature data objects:
+message.retries.last=Last try!
message.retries={0} tries left
message.overwrite=Overwrite {0}?
message.help=Help topic {0}
@@ -60,7 +62,8 @@ error.no.hashdata=No signature data available: {0}
error.display.hashdata=Could not display signature data: {0}
error.write.hashdata=Could not save signature data: {0}
error.invalid.hash=Invalid signature data: {0}
-error.ws.unreachable=Web-service unreachable: {0}
+error.ws.unreachable=Server unreachable
+#error.ws.unreachable=Web-service unreachable: {0}
error.pcsc=No PC/SC interface for smartcard access provided
error.cardterminal=Could not find smartcard reader
error.unknown=An error occured: {0}
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
index bc4bdb97..d413f812 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUITest.java
@@ -39,8 +39,8 @@ public class BKUGUITest {
public void testBKUGUI() {
JFrame testFrame = new JFrame("BKUGUITest");
Container contentPane = testFrame.getContentPane();
- contentPane.setPreferredSize(new Dimension(190, 130));
- BKUGUIFacade gui = BKUGUIFactory.createGUI(contentPane, null, BKUGUIFacade.Style.simple, null, null);
+ contentPane.setPreferredSize(new Dimension(170, 150));
+ BKUGUIFacade gui = BKUGUIFactory.createGUI(contentPane, null, BKUGUIFacade.Style.tiny, null, null);
BKUGUIWorker worker = new BKUGUIWorker();
worker.init(gui);
testFrame.pack();
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index 4d97f9fb..73aaab46 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -142,17 +142,17 @@ public class BKUGUIWorker implements Runnable {
// Thread.sleep(2000);
//
// PINSpec cardPinSpec = new PINSpec(4, 4, "[0-9]", "Karten-PIN");
-//
+//
// gui.showCardPINDialog(cardPinSpec, okListener, "ok", cancelListener, "cancel");
//
// Thread.sleep(2000);
//
-// gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
+ gui.showSignaturePINDialog(signPinSpec, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
//
// Thread.sleep(4000);
//
- gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, null, null);
+// gui.showErrorDialog(BKUGUIFacade.ERR_NO_PCSC, null, null, null);
// gui.showSignaturePINRetryDialog(signPinSpec, 2, signListener, "sign", cancelListener, "cancel", hashdataListener, "hashdata");
//
--
cgit v1.2.3
From bd34234d256ef1f81c6daba2de33ed68ccc790f1 Mon Sep 17 00:00:00 2001
From: clemenso
Date: Fri, 23 Jan 2009 14:04:04 +0000
Subject: [maven-release-plugin] prepare release mocca-1.0.4-fon
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@287 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
BKUApplet/pom.xml | 14 +++++++-------
BKUCommonGUI/pom.xml | 8 ++++----
BKULocal/pom.xml | 22 +++++++++++-----------
BKULocalApp/pom.xml | 8 ++++----
BKUOnline/pom.xml | 20 ++++++++++----------
BKUViewer/pom.xml | 6 +++---
STAL/pom.xml | 4 ++--
STALExt/pom.xml | 6 +++---
STALService/pom.xml | 6 +++---
bkucommon/pom.xml | 8 ++++----
pom.xml | 8 ++++----
smcc/pom.xml | 4 ++--
smccSTAL/pom.xml | 10 +++++-----
utils/pom.xml | 4 ++--
14 files changed, 64 insertions(+), 64 deletions(-)
(limited to 'BKUCommonGUI')
diff --git a/BKUApplet/pom.xml b/BKUApplet/pom.xml
index 4491ff3a..cfae6716 100644
--- a/BKUApplet/pom.xml
+++ b/BKUApplet/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.4-SNAPSHOT
+ 1.0.44.0.0at.gv.egizBKUAppletBKU Applet
- 1.0.4-SNAPSHOT
+ 1.0.4
@@ -110,27 +110,27 @@
at.gv.egizsmcc
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizSTAL
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizSTALService
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizsmccSTAL
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizBKUCommonGUI
- 1.0.4-SNAPSHOT
+ 1.0.4commons-logging
diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml
index 32d39042..9088a711 100644
--- a/BKUCommonGUI/pom.xml
+++ b/BKUCommonGUI/pom.xml
@@ -2,23 +2,23 @@
bkuat.gv.egiz
- 1.0.4-SNAPSHOT
+ 1.0.44.0.0at.gv.egizBKUCommonGUIBKU Common GUI
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizsmcc
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizSTAL
- 1.0.4-SNAPSHOT
+ 1.0.4compile
diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml
index 0572fcb2..8b5fe405 100644
--- a/BKULocal/pom.xml
+++ b/BKULocal/pom.xml
@@ -2,19 +2,19 @@
bkuat.gv.egiz
- 1.0.4-SNAPSHOT
+ 1.0.44.0.0at.gv.egizBKULocalwarBKU Local
- 1.0.4-SNAPSHOT
+ 1.0.1
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
- scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.4-fon/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.4-fon/BKULocal
+ scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/tags/mocca-1.0.4-fon/BKULocal
@@ -56,22 +56,22 @@
at.gv.egizSTAL
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizbkucommon
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizsmcc
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizsmccSTAL
- 1.0.4-SNAPSHOT
+ 1.0.4org.springframework
@@ -96,12 +96,12 @@
at.gv.egizBKUApplet
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizBKUViewer
- 1.0.4-SNAPSHOT
+ 1.0.4
diff --git a/BKULocalApp/pom.xml b/BKULocalApp/pom.xml
index ac56c906..0e552bf0 100644
--- a/BKULocalApp/pom.xml
+++ b/BKULocalApp/pom.xml
@@ -2,13 +2,13 @@
bkuat.gv.egiz
- 1.0.4-SNAPSHOT
+ 1.0.44.0.0at.gv.egiz.bkuBKULocalAppBKU Local App
- 1.0.4-SNAPSHOT
+ 1.0.1
@@ -76,13 +76,13 @@
at.gv.egizBKULocal
- 1.0.4-SNAPSHOT
+ 1.0.1warutilsat.gv.egiz
- 1.0.4-SNAPSHOT
+ 1.0.4compile
diff --git a/BKUOnline/pom.xml b/BKUOnline/pom.xml
index c5c77546..18c5d122 100644
--- a/BKUOnline/pom.xml
+++ b/BKUOnline/pom.xml
@@ -3,14 +3,14 @@
bkuat.gv.egiz
- 1.0.4-SNAPSHOT
+ 1.0.44.0.0at.gv.egizBKUOnlinewarBKU Online
- 1.0.4-SNAPSHOT
+ 1.0.4
@@ -24,12 +24,12 @@
at.gv.egizbkucommon
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizBKUViewer
- 1.0.4-SNAPSHOT
+ 1.0.4commons-logging
@@ -53,20 +53,20 @@
at.gv.egizSTALService
- 1.0.4-SNAPSHOT
+ 1.0.4compileat.gv.egizBKUApplet
- 1.0.4-SNAPSHOT
+ 1.0.4providedat.gv.egizSTALService
- 1.0.4-SNAPSHOT
+ 1.0.4at.gv.egizBKUApplet
- 1.0.4
+ 1.0.5-SNAPSHOTprovidedat.gv.egizSTALService
- 1.0.4
+ 1.0.5-SNAPSHOT
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index f564c07a..1d5a2cf4 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -38,9 +38,6 @@ import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.CellRendererPane;
import javax.swing.GroupLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
@@ -51,7 +48,6 @@ import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTable;
-import javax.swing.JTextField;
import javax.swing.LayoutStyle;
import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
@@ -1064,7 +1060,9 @@ public class BKUGUIImpl implements BKUGUIFacade {
@Override
public char[] getPin() {
if (pinField != null) {
- return pinField.getPassword();
+ char[] pin = pinField.getPassword();
+ pinField = null;
+ return pin;
}
return null;
}
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java
index 2054ae86..87b636f0 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/PinDocument.java
@@ -22,6 +22,7 @@ import java.util.regex.Pattern;
import javax.swing.JButton;
import javax.swing.text.AttributeSet;
import javax.swing.text.BadLocationException;
+import javax.swing.text.Document;
import javax.swing.text.PlainDocument;
/**
@@ -30,9 +31,10 @@ import javax.swing.text.PlainDocument;
*/
class PINDocument extends PlainDocument {
- private PINSpec pinSpec;
- private Pattern pinPattern;
- private JButton enterButton;
+ protected PINSpec pinSpec;
+ protected Pattern pinPattern;
+ protected JButton enterButton;
+ protected Document compareTo;
public PINDocument(PINSpec pinSpec, JButton enterButton) {
this.pinSpec = pinSpec;
@@ -44,6 +46,11 @@ class PINDocument extends PlainDocument {
this.enterButton = enterButton;
}
+ public PINDocument(PINSpec pinSpec, JButton enterButton, Document compareTo) {
+ this(pinSpec, enterButton);
+ this.compareTo = compareTo;
+ }
+
@Override
public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {
if (pinSpec.getMaxLength() < 0 || pinSpec.getMaxLength() >= (getLength() + str.length())) {
@@ -58,12 +65,23 @@ class PINDocument extends PlainDocument {
super.insertString(offs, str, a);
}
}
- enterButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ if (enterButton != null) {
+ enterButton.setEnabled(getLength() >= pinSpec.getMinLength() && compare());
+ }
}
@Override
public void remove(int offs, int len) throws BadLocationException {
super.remove(offs, len);
- enterButton.setEnabled(getLength() >= pinSpec.getMinLength());
+ if (enterButton != null) {
+ enterButton.setEnabled(getLength() >= pinSpec.getMinLength() && compare());
+ }
+ }
+
+ private boolean compare() throws BadLocationException {
+ if (compareTo == null) {
+ return true;
+ }
+ return compareTo.getText(0, compareTo.getLength()).equals(getText(0, getLength()));
}
}
\ No newline at end of file
diff --git a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
index 8436a730..1e0bc9f5 100644
--- a/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
+++ b/BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties
@@ -20,7 +20,7 @@ title.cardnotsupported=Die Karte wird nicht unterst\u00FCtzt
title.cardpin=Karte wird gelesen
title.sign=Signatur erstellen
title.error=Fehler
-title.retry=Falscher PIN
+title.retry=Falsche PIN
title.wait=Bitte warten
title.hashdata=Signaturdaten
windowtitle.save=Signaturdaten speichern
@@ -84,7 +84,7 @@ help.cardnotsupported=Nicht unterst\u00FCtzte B\u00FCrgerkarte
help.insertcard=Keine B\u00FCrgerkarte im Kartenleser
help.cardpin=Pineingabe
help.signpin=Signatur-Pineingabe
-help.retry=Falscher Pin
+help.retry=Falsche Pin
help.hashdata=Signierte Inhalte
help.hashdatalist=Signierte Inhalte
help.hashdataviewer=Anzeige signierter Inhalte
\ No newline at end of file
diff --git a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
index 73aaab46..08ecaa7f 100644
--- a/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
+++ b/BKUCommonGUI/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java
@@ -46,7 +46,7 @@ public class BKUGUIWorker implements Runnable {
public void run() {
// try {
- final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Signatur-PIN");
+ final PINSpec signPinSpec = new PINSpec(6, 10, "[0-9]", "Signatur-PIN", (byte) 0x81, null);
final ActionListener cancelListener = new ActionListener() {
diff --git a/STALExt/src/main/java/at/gv/egiz/stal/ext/ActivatePINRequest.java b/STALExt/src/main/java/at/gv/egiz/stal/ext/ActivatePINRequest.java
deleted file mode 100644
index f2039388..00000000
--- a/STALExt/src/main/java/at/gv/egiz/stal/ext/ActivatePINRequest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package at.gv.egiz.stal.ext;
-
-import at.gv.egiz.stal.STALRequest;
-
-/**
- *
- * @author Clemens Orthacker
- */
-public class ActivatePINRequest extends STALRequest {
-
-}
diff --git a/STALExt/src/main/java/at/gv/egiz/stal/ext/ChangePINRequest.java b/STALExt/src/main/java/at/gv/egiz/stal/ext/ChangePINRequest.java
deleted file mode 100644
index ea508146..00000000
--- a/STALExt/src/main/java/at/gv/egiz/stal/ext/ChangePINRequest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package at.gv.egiz.stal.ext;
-
-import at.gv.egiz.stal.STALRequest;
-
-/**
- *
- * @author Clemens Orthacker
- */
-public class ChangePINRequest extends STALRequest {
-
-}
diff --git a/STALExt/src/main/java/at/gv/egiz/stal/ext/PINManagementRequest.java b/STALExt/src/main/java/at/gv/egiz/stal/ext/PINManagementRequest.java
new file mode 100644
index 00000000..87c53e24
--- /dev/null
+++ b/STALExt/src/main/java/at/gv/egiz/stal/ext/PINManagementRequest.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.stal.ext;
+
+import at.gv.egiz.stal.STALRequest;
+
+/**
+ * Dummy STAL request to trigger PIN Management. (no proper STAL requests
+ * for PIN activation, unblocking)
+ *
+ *
+ * @author Clemens Orthacker
+ */
+public class PINManagementRequest extends STALRequest {
+
+}
diff --git a/STALExt/src/main/java/at/gv/egiz/stal/ext/PINManagementResponse.java b/STALExt/src/main/java/at/gv/egiz/stal/ext/PINManagementResponse.java
new file mode 100644
index 00000000..b8b90604
--- /dev/null
+++ b/STALExt/src/main/java/at/gv/egiz/stal/ext/PINManagementResponse.java
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.stal.ext;
+
+import at.gv.egiz.stal.STALResponse;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public class PINManagementResponse extends STALResponse {
+
+}
diff --git a/STALExt/src/main/java/at/gv/egiz/stal/ext/UnblockPINRequest.java b/STALExt/src/main/java/at/gv/egiz/stal/ext/UnblockPINRequest.java
deleted file mode 100644
index 543de31c..00000000
--- a/STALExt/src/main/java/at/gv/egiz/stal/ext/UnblockPINRequest.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright 2008 Federal Chancellery Austria and
- * Graz University of Technology
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package at.gv.egiz.stal.ext;
-
-import at.gv.egiz.stal.STALRequest;
-
-/**
- *
- * @author Clemens Orthacker
- */
-public class UnblockPINRequest extends STALRequest {
-
-}
diff --git a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/DataObject.java b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/DataObject.java
index ae4918ce..b64306aa 100644
--- a/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/DataObject.java
+++ b/bkucommon/src/main/java/at/gv/egiz/bku/slcommands/impl/xsect/DataObject.java
@@ -14,98 +14,105 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package at.gv.egiz.bku.slcommands.impl.xsect;
-
-import iaik.xml.crypto.dom.DOMCryptoContext;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.SequenceInputStream;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.net.URISyntaxException;
-import java.nio.charset.Charset;
-import java.security.InvalidAlgorithmParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.util.ArrayList;
+package at.gv.egiz.bku.slcommands.impl.xsect;
+
+import iaik.xml.crypto.dom.DOMCryptoContext;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.SequenceInputStream;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.net.URISyntaxException;
+import java.nio.charset.Charset;
+import java.security.InvalidAlgorithmParameterException;
+import java.security.NoSuchAlgorithmException;
+import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.crypto.MarshalException;
-import javax.xml.crypto.dom.DOMStructure;
-import javax.xml.crypto.dsig.CanonicalizationMethod;
-import javax.xml.crypto.dsig.DigestMethod;
-import javax.xml.crypto.dsig.Reference;
-import javax.xml.crypto.dsig.Transform;
-import javax.xml.crypto.dsig.XMLObject;
-import javax.xml.crypto.dsig.spec.TransformParameterSpec;
-import javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec;
-import javax.xml.crypto.dsig.spec.XPathType;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.w3c.dom.DOMConfiguration;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.DocumentFragment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-import org.w3c.dom.bootstrap.DOMImplementationRegistry;
-import org.w3c.dom.ls.DOMImplementationLS;
-import org.w3c.dom.ls.LSException;
-import org.w3c.dom.ls.LSInput;
-import org.w3c.dom.ls.LSOutput;
-import org.w3c.dom.ls.LSParser;
-import org.w3c.dom.ls.LSSerializer;
-
-import at.buergerkarte.namespaces.securitylayer._1.Base64XMLLocRefOptRefContentType;
-import at.buergerkarte.namespaces.securitylayer._1.DataObjectInfoType;
-import at.buergerkarte.namespaces.securitylayer._1.MetaInfoType;
-import at.buergerkarte.namespaces.securitylayer._1.TransformsInfoType;
-import at.gv.egiz.bku.binding.HttpUtil;
-import at.gv.egiz.bku.slexceptions.SLCommandException;
-import at.gv.egiz.bku.slexceptions.SLRequestException;
-import at.gv.egiz.bku.slexceptions.SLRuntimeException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.crypto.MarshalException;
+import javax.xml.crypto.dom.DOMStructure;
+import javax.xml.crypto.dsig.CanonicalizationMethod;
+import javax.xml.crypto.dsig.DigestMethod;
+import javax.xml.crypto.dsig.Reference;
+import javax.xml.crypto.dsig.Transform;
+import javax.xml.crypto.dsig.XMLObject;
+import javax.xml.crypto.dsig.spec.TransformParameterSpec;
+import javax.xml.crypto.dsig.spec.XPathFilter2ParameterSpec;
+import javax.xml.crypto.dsig.spec.XPathType;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3._2000._09.xmldsig_.TransformType;
+import org.w3._2000._09.xmldsig_.TransformsType;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSException;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSParser;
+import org.w3c.dom.ls.LSSerializer;
+
+import at.buergerkarte.namespaces.securitylayer._1.Base64XMLLocRefOptRefContentType;
+import at.buergerkarte.namespaces.securitylayer._1.DataObjectInfoType;
+import at.buergerkarte.namespaces.securitylayer._1.MetaInfoType;
+import at.buergerkarte.namespaces.securitylayer._1.TransformsInfoType;
+import at.gv.egiz.bku.binding.HttpUtil;
+import at.gv.egiz.bku.slexceptions.SLCommandException;
+import at.gv.egiz.bku.slexceptions.SLRequestException;
+import at.gv.egiz.bku.slexceptions.SLRuntimeException;
import at.gv.egiz.bku.slexceptions.SLViewerException;
-import at.gv.egiz.bku.utils.urldereferencer.StreamData;
-import at.gv.egiz.bku.utils.urldereferencer.URLDereferencer;
+import at.gv.egiz.bku.utils.urldereferencer.StreamData;
+import at.gv.egiz.bku.utils.urldereferencer.URLDereferencer;
import at.gv.egiz.bku.viewer.ValidationException;
import at.gv.egiz.bku.viewer.Validator;
import at.gv.egiz.bku.viewer.ValidatorFactory;
-import at.gv.egiz.dom.DOMUtils;
-import at.gv.egiz.slbinding.impl.XMLContentType;
-
-/**
- * This class represents a DataObject of an XML-Signature
- * created by the security layer command CreateXMLSignature.
- *
- * @author mcentner
- */
-public class DataObject {
-
- /**
- * Logging facility.
- */
- private static Log log = LogFactory.getLog(DataObject.class);
-
- /**
- * DOM Implementation.
- */
- private static final String DOM_LS_3_0 = "LS 3.0";
-
- /**
- * The array of the default preferred MIME type order.
- */
- private static final String[] DEFAULT_PREFFERED_MIME_TYPES =
- new String[] {
+import at.gv.egiz.dom.DOMUtils;
+import at.gv.egiz.marshal.NamespacePrefix;
+import at.gv.egiz.marshal.NamespacePrefixMapperImpl;
+import at.gv.egiz.slbinding.impl.XMLContentType;
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * This class represents a DataObject of an XML-Signature
+ * created by the security layer command CreateXMLSignature.
+ *
+ * @author mcentner
+ */
+public class DataObject {
+
+ /**
+ * Logging facility.
+ */
+ private static Log log = LogFactory.getLog(DataObject.class);
+
+ /**
+ * DOM Implementation.
+ */
+ private static final String DOM_LS_3_0 = "LS 3.0";
+
+ /**
+ * The array of the default preferred MIME type order.
+ */
+ private static final String[] DEFAULT_PREFFERED_MIME_TYPES =
+ new String[] {
"text/plain",
- "application/xhtml+xml"
+ "application/xhtml+xml"
};
/**
@@ -149,87 +156,87 @@ public class DataObject {
validMimeTypes = mediaTypes;
}
- /**
- * The DOM implementation used.
- */
- private DOMImplementationLS domImplLS;
-
- /**
- * The signature context.
- */
- private SignatureContext ctx;
-
- /**
- * The Reference for this DataObject.
- */
- private XSECTReference reference;
-
- /**
- * The XMLObject for this DataObject.
- */
- private XMLObject xmlObject;
-
- /**
- * The MIME-Type of the digest input.
- */
- private String mimeType;
-
- /**
- * An optional description of the digest input.
- */
- private String description;
-
- /**
- * Creates a new instance.
- *
- * @param document the document of the target signature
- */
- public DataObject(SignatureContext signatureContext) {
- this.ctx = signatureContext;
-
- DOMImplementationRegistry registry;
- try {
- registry = DOMImplementationRegistry.newInstance();
- } catch (Exception e) {
- log.error("Failed to get DOMImplementationRegistry.", e);
- throw new SLRuntimeException("Failed to get DOMImplementationRegistry.");
- }
-
- domImplLS = (DOMImplementationLS) registry.getDOMImplementation(DOM_LS_3_0);
- if (domImplLS == null) {
- log.error("Failed to get DOMImplementation " + DOM_LS_3_0);
- throw new SLRuntimeException("Failed to get DOMImplementation " + DOM_LS_3_0);
- }
-
- }
-
- /**
- * @return the reference
- */
- public Reference getReference() {
- return reference;
- }
-
- /**
- * @return the xmlObject
- */
- public XMLObject getXmlObject() {
- return xmlObject;
- }
-
- /**
- * @return the mimeType
- */
- public String getMimeType() {
- return mimeType;
- }
-
- /**
- * @return the description
- */
- public String getDescription() {
- return description;
- }
+ /**
+ * The DOM implementation used.
+ */
+ private DOMImplementationLS domImplLS;
+
+ /**
+ * The signature context.
+ */
+ private SignatureContext ctx;
+
+ /**
+ * The Reference for this DataObject.
+ */
+ private XSECTReference reference;
+
+ /**
+ * The XMLObject for this DataObject.
+ */
+ private XMLObject xmlObject;
+
+ /**
+ * The MIME-Type of the digest input.
+ */
+ private String mimeType;
+
+ /**
+ * An optional description of the digest input.
+ */
+ private String description;
+
+ /**
+ * Creates a new instance.
+ *
+ * @param document the document of the target signature
+ */
+ public DataObject(SignatureContext signatureContext) {
+ this.ctx = signatureContext;
+
+ DOMImplementationRegistry registry;
+ try {
+ registry = DOMImplementationRegistry.newInstance();
+ } catch (Exception e) {
+ log.error("Failed to get DOMImplementationRegistry.", e);
+ throw new SLRuntimeException("Failed to get DOMImplementationRegistry.");
+ }
+
+ domImplLS = (DOMImplementationLS) registry.getDOMImplementation(DOM_LS_3_0);
+ if (domImplLS == null) {
+ log.error("Failed to get DOMImplementation " + DOM_LS_3_0);
+ throw new SLRuntimeException("Failed to get DOMImplementation " + DOM_LS_3_0);
+ }
+
+ }
+
+ /**
+ * @return the reference
+ */
+ public Reference getReference() {
+ return reference;
+ }
+
+ /**
+ * @return the xmlObject
+ */
+ public XMLObject getXmlObject() {
+ return xmlObject;
+ }
+
+ /**
+ * @return the mimeType
+ */
+ public String getMimeType() {
+ return mimeType;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
public void validateHashDataInput() throws SLViewerException {
@@ -293,823 +300,920 @@ public class DataObject {
}
}
-
- /**
- * Configures this DataObject with the information provided within the given
- * sl:DataObjectInfo.
- *
- * @param dataObjectInfo
- * the sl:DataObjectInfo
- *
- * @throws SLCommandException
- * if configuring this DataObject with the information provided in
- * the sl:DataObjectInfo fails.
- * @throws SLRequestException
- * if the information provided in the sl:DataObjectInfo
- * does not conform to the security layer specification.
- * @throws NullPointerException
- * if dataObjectInfo is null
- */
- public void setDataObjectInfo(DataObjectInfoType dataObjectInfo) throws SLCommandException, SLRequestException {
-
- Base64XMLLocRefOptRefContentType dataObject = dataObjectInfo.getDataObject();
- String structure = dataObjectInfo.getStructure();
-
- // select and unmarshal an appropriate transformation path if provided
- // and set the final data meta information
- XSECTTransforms transforms = createTransformsAndSetFinalDataMetaInfo(dataObjectInfo.getTransformsInfo());
-
- if ("enveloping".equals(structure)) {
-
- // configure this DataObject as an enveloped DataObject
- setEnvelopedDataObject(dataObject, transforms);
-
- } else if ("detached".equals(structure)) {
-
- // configure this DataObject as an detached DataObject
- setDetachedDataObject(dataObject, transforms);
-
- }
- // other values are not allowed by the schema and are therefore ignored
-
- }
-
- /**
- * Configures this DataObject as an enveloped DataObject with the information
- * provided within the given sl:DataObject.
- *
- * @param dataObject
- * the sl:DataObject
- * @param transforms
- * an optional Transforms element (may be
- * null)
- *
- * @throws SLCommandException
- * if configuring this DataObject with the information provided in
- * the sl:DataObject fails.
- * @throws SLRequestException
- * if the information provided in the sl:DataObject
- * does not conform to the security layer specification.
- * @throws NullPointerException
- * if dataObject is null
- */
- private void setEnvelopedDataObject(
- Base64XMLLocRefOptRefContentType dataObject, XSECTTransforms transforms)
- throws SLCommandException, SLRequestException {
-
- String reference = dataObject.getReference();
- if (reference == null) {
- //
- // case A
- //
- // The Reference attribute is not used; the content of sl:DataObject represents the data object.
- // If the data object is XML-coded (the sl:XMLContent element is used in sl:DataObject), then it
- // must be incorporated in the signature structure as parsed XML.
- //
-
- if (dataObject.getBase64Content() != null) {
-
- log.debug("Adding DataObject (Base64Content) without a reference URI.");
-
- // create XMLObject
- XMLObject xmlObject = createXMLObject(new ByteArrayInputStream(dataObject.getBase64Content()));
-
- setXMLObjectAndReferenceBase64(xmlObject, transforms);
-
- } else if (dataObject.getXMLContent() != null) {
-
- log.debug("Adding DataObject (XMLContent) without a reference URI.");
-
- // create XMLObject
- DocumentFragment content = parseDataObject((XMLContentType) dataObject.getXMLContent());
- XMLObject xmlObject = createXMLObject(content);
-
- setXMLObjectAndReferenceXML(xmlObject, transforms);
-
- } else if (dataObject.getLocRefContent() != null) {
-
- log.debug("Adding DataObject (LocRefContent) without a reference URI.");
-
- setEnvelopedDataObject(dataObject.getLocRefContent(), transforms);
-
- } else {
-
- // not allowed
- log.info("XML structure of the command request contains an " +
- "invalid combination of optional elements or attributes. " +
- "DataObject of structure='enveloped' without a reference must contain content.");
- throw new SLRequestException(3003);
-
- }
-
- } else {
-
- if (dataObject.getBase64Content() == null &&
- dataObject.getXMLContent() == null &&
- dataObject.getLocRefContent() == null) {
-
- //
- // case B
- //
- // The Reference attribute contains a URI that must be resolved by the
- // Citizen Card Environment to obtain the data object.
- // The content of sl:DataObject remains empty
- //
-
- log.debug("Adding DataObject from reference URI '" + reference + "'.");
-
- setEnvelopedDataObject(reference, transforms);
-
- } else {
-
- // not allowed
- log.info("XML structure of the command request contains an " +
- "invalid combination of optional elements or attributes. " +
- "DataObject of structure='enveloped' with reference must not contain content.");
- throw new SLRequestException(3003);
-
- }
-
-
- }
-
- }
-
- /**
- * Configures this DataObject as an enveloped DataObject with the content to
- * be dereferenced from the given reference.
- *
- * @param reference
- * the reference URI
- * @param transforms
- * an optional Transforms element (may be
- * null)
- *
- * @throws SLCommandException
- * if dereferencing the given reference fails, or if
- * configuring this DataObject with the data dereferenced from the
- * given reference fails.
- * @throws NullPointerException
- * if reference is null
- */
- private void setEnvelopedDataObject(String reference, XSECTTransforms transforms) throws SLCommandException {
-
- if (reference == null) {
- throw new NullPointerException("Argument 'reference' must not be null.");
- }
-
- // dereference URL
- URLDereferencer dereferencer = URLDereferencer.getInstance();
-
- StreamData streamData;
- try {
- streamData = dereferencer.dereference(reference, ctx.getDereferencerContext());
- } catch (IOException e) {
- log.info("Failed to dereference XMLObject from '" + reference + "'.", e);
- throw new SLCommandException(4110);
- }
-
- Node childNode;
-
- String contentType = streamData.getContentType();
- if (contentType.startsWith("text/xml")) {
-
- // If content type is text/xml parse content.
- String charset = HttpUtil.getCharset(contentType, true);
-
- Document doc = parseDataObject(streamData.getStream(), charset);
-
- childNode = doc.getDocumentElement();
-
- if (childNode == null) {
- log.info("Failed to parse XMLObject from '" + reference + "'.");
- throw new SLCommandException(4111);
- }
-
- XMLObject xmlObject = createXMLObject(childNode);
-
- setXMLObjectAndReferenceXML(xmlObject, transforms);
-
- } else {
-
- // Include content Base64 encoded.
- XMLObject xmlObject = createXMLObject(streamData.getStream());
-
- setXMLObjectAndReferenceBase64(xmlObject, transforms);
-
- }
-
- }
-
- /**
- * Configures this DataObject as an detached DataObject with the information
- * provided in the given sl:DataObject and optionally
- * transforms.
- *
- * @param dataObject
- * the sl:DataObject
- * @param transforms
- * an optional Transforms object, may be null
- *
- * @throws SLCommandException
- * if configuring this DataObject with the information provided in
- * the sl:DataObject fails.
- * @throws SLRequestException
- * if the information provided in the sl:DataObject
- * does not conform to the security layer specification.
- * @throws NullPointerException
- * if dataObject is null
- */
- private void setDetachedDataObject(
- Base64XMLLocRefOptRefContentType dataObject, XSECTTransforms transforms)
- throws SLCommandException, SLRequestException {
-
- String referenceURI = dataObject.getReference();
-
- if (referenceURI == null) {
-
- // not allowed
- log.info("XML structure of the command request contains an " +
- "invalid combination of optional elements or attributes. " +
- "DataObject of structure='detached' must contain a reference.");
- throw new SLRequestException(3003);
-
- } else {
-
- DigestMethod dm;
- try {
- dm = ctx.getAlgorithmMethodFactory().createDigestMethod(ctx);
- } catch (NoSuchAlgorithmException e) {
- log.error("Failed to get DigestMethod.", e);
- throw new SLCommandException(4006);
- } catch (InvalidAlgorithmParameterException e) {
- log.error("Failed to get DigestMethod.", e);
- throw new SLCommandException(4006);
- }
-
- String idValue = ctx.getIdValueFactory().createIdValue("Reference");
-
- reference = new XSECTReference(referenceURI, dm, transforms, null, idValue);
-
- // case D:
- //
- // The Reference attribute contains a URI that is used by the Citizen Card
- // Environment to code the reference to the data object as part of the XML
- // signature (attribute URI in the dsig:Reference) element. The content of
- // sl:DataObject represents the data object.
-
- if (dataObject.getLocRefContent() != null) {
- String locRef = dataObject.getLocRefContent();
- try {
- this.reference.setDereferencer(new LocRefDereferencer(ctx.getDereferencerContext(), locRef));
- } catch (URISyntaxException e) {
- log.info("Invalid URI '" + locRef + "' in DataObject.", e);
- throw new SLCommandException(4003);
- } catch (IllegalArgumentException e) {
- log.info("LocRef URI of '" + locRef + "' not supported in DataObject. ", e);
- throw new SLCommandException(4003);
- }
- } else if (dataObject.getBase64Content() != null) {
- byte[] base64Content = dataObject.getBase64Content();
- this.reference.setDereferencer(new ByteArrayDereferencer(base64Content));
- } else if (dataObject.getXMLContent() != null) {
- XMLContentType xmlContent = (XMLContentType) dataObject.getXMLContent();
- byte[] bytes = xmlContent.getRedirectedStream().toByteArray();
- this.reference.setDereferencer(new ByteArrayDereferencer(bytes));
- } else {
-
- // case C:
- //
- // The Reference attribute contains a URI that must be resolved by the
- // Citizen Card Environment to obtain the data object. The Reference
- // attribute contains a URI that is used by the Citizen Card Environment
- // to code the reference to the data object as part of the XML signature
- // (attribute URI in the dsig:Reference) element. The content of
- // sl:DataObject remains empty.
-
- }
-
- }
- }
-
- /**
- * Returns the preferred sl:TransformInfo from the given list of
- * transformInfos, or null if none of the given
- * transformInfos is preferred over the others.
- *
- * @param transformsInfos
- * a list of sl:TransformInfos
- *
- * @return the selected sl:TransformInfo or null, if
- * none is preferred over the others
- */
- private TransformsInfoType selectPreferredTransformsInfo(List transformsInfos) {
-
- Map mimeTypes = new HashMap();
-
- StringBuilder debugString = null;
- if (log.isDebugEnabled()) {
- debugString = new StringBuilder();
- debugString.append("Got " + transformsInfos.size() + " TransformsInfo(s):");
- }
-
- for (TransformsInfoType transformsInfoType : transformsInfos) {
- MetaInfoType finalDataMetaInfo = transformsInfoType.getFinalDataMetaInfo();
- String mimeType = finalDataMetaInfo.getMimeType();
- String description = finalDataMetaInfo.getDescription();
- mimeTypes.put(mimeType, transformsInfoType);
- if (debugString != null) {
- debugString.append("\n FinalDataMetaInfo: MIME-Type=");
- debugString.append(mimeType);
- if (description != null) {
- debugString.append(" ");
- debugString.append(description);
- }
- }
- }
-
- if (debugString != null) {
- log.debug(debugString);
- }
-
- // look for preferred transform
- for (String mimeType : DEFAULT_PREFFERED_MIME_TYPES) {
- if (mimeTypes.containsKey(mimeType)) {
- return mimeTypes.get(mimeType);
- }
- }
-
- // no preferred transform
- return null;
-
- }
-
- /**
- * Create an instance of ds:Transforms from the given
- * sl:TransformsInfo.
- *
- * @param transformsInfo
- * the sl:TransformsInfo
- *
- * @return a corresponding unmarshalled ds:Transforms, or
- * null if the given sl:TransformsInfo does
- * not contain a dsig:Transforms element
- *
- * @throws SLRequestException
- * if the ds:Transforms in the given
- * transformsInfo are not valid or cannot be parsed.
- *
- * @throws MarshalException
- * if the ds:Transforms in the given
- * transformsInfo cannot be unmarshalled.
- */
- private XSECTTransforms createTransforms(TransformsInfoType transformsInfo) throws SLRequestException, MarshalException {
-
- ByteArrayOutputStream redirectedStream = ((at.gv.egiz.slbinding.impl.TransformsInfoType) transformsInfo).getRedirectedStream();
- byte[] transformBytes = (redirectedStream != null) ? redirectedStream.toByteArray() : null;
-
- if (transformBytes != null && transformBytes.length > 0) {
-
- // debug
- if (log.isTraceEnabled()) {
- StringBuilder sb = new StringBuilder();
- sb.append("Trying to parse transforms:\n");
- sb.append(new String(transformBytes, Charset.forName("UTF-8")));
- log.trace(sb);
- }
-
- DOMImplementationLS domImplLS = DOMUtils.getDOMImplementationLS();
- LSInput input = domImplLS.createLSInput();
- input.setByteStream(new ByteArrayInputStream(transformBytes));
-
- LSParser parser = domImplLS.createLSParser(
- DOMImplementationLS.MODE_SYNCHRONOUS, null);
- DOMConfiguration domConfig = parser.getDomConfig();
- SimpleDOMErrorHandler errorHandler = new SimpleDOMErrorHandler();
- domConfig.setParameter("error-handler", errorHandler);
- domConfig.setParameter("validate", Boolean.FALSE);
-
- Document document;
- try {
- document = parser.parse(input);
- } catch (DOMException e) {
- log.info("Failed to parse dsig:Transforms.", e);
- throw new SLRequestException(3002);
- } catch (LSException e) {
- log.info("Failed to parse dsig:Transforms.", e);
- throw new SLRequestException(3002);
- }
-
- // adopt ds:Transforms
- Element documentElement = document.getDocumentElement();
- Node adoptedTransforms = ctx.getDocument().adoptNode(documentElement);
-
- DOMCryptoContext context = new DOMCryptoContext();
-
- // unmarshall ds:Transforms
- return new XSECTTransforms(context, adoptedTransforms);
-
- } else {
- return null;
- }
-
- }
-
- /**
- * Sets the mimeType and the description value
- * for this DataObject.
- *
- * @param metaInfoType the sl:FinalMetaDataInfo
- *
- * @throws NullPointerException if metaInfoType is null
- */
- private void setFinalDataMetaInfo(MetaInfoType metaInfoType) {
-
- this.mimeType = metaInfoType.getMimeType();
- this.description = metaInfoType.getDescription();
-
- }
-
- /**
- * Selects an appropriate transformation path (if present) from the given list
- * of sl:TransformInfos, sets the corresponding final data meta info and
- * returns the corresponding unmarshalled ds:Transforms.
- *
- * @param transformsInfos the sl:TransformInfos
- *
- * @return the unmarshalled ds:Transforms, or null if
- * no transformation path has been selected.
- *
- * @throws SLRequestException if the given list ds:TransformsInfo contains
- * an invalid ds:Transforms element, or no suitable transformation path
- * can be found.
- */
- private XSECTTransforms createTransformsAndSetFinalDataMetaInfo(
- List transformsInfos) throws SLRequestException {
-
- TransformsInfoType preferredTransformsInfo = selectPreferredTransformsInfo(transformsInfos);
- // try preferred transform
- if (preferredTransformsInfo != null) {
-
- try {
- XSECTTransforms transforms = createTransforms(preferredTransformsInfo);
- setFinalDataMetaInfo(preferredTransformsInfo.getFinalDataMetaInfo());
- return transforms;
- } catch (MarshalException e) {
-
- String mimeType = preferredTransformsInfo.getFinalDataMetaInfo().getMimeType();
- log.info("Failed to unmarshal preferred transformation path (MIME-Type="
- + mimeType + ").", e);
-
- }
-
- }
-
- // look for another suitable transformation path
- for (TransformsInfoType transformsInfoType : transformsInfos) {
-
- try {
- XSECTTransforms transforms = createTransforms(transformsInfoType);
- setFinalDataMetaInfo(transformsInfoType.getFinalDataMetaInfo());
- return transforms;
- } catch (MarshalException e) {
-
- String mimeType = transformsInfoType.getFinalDataMetaInfo().getMimeType();
- log.info("Failed to unmarshal transformation path (MIME-Type="
- + mimeType + ").", e);
- }
-
- }
-
- // no suitable transformation path found
- throw new SLRequestException(3003);
-
- }
-
- /**
- * Create an XMLObject with the Base64 encoding of the given
- * content.
- *
- * @param content
- * the to-be Base64 encoded content
- * @return an XMLObject with the Base64 encoded content
- */
- private XMLObject createXMLObject(InputStream content) {
-
- Text textNode;
- try {
- textNode = at.gv.egiz.dom.DOMUtils.createBase64Text(content, ctx.getDocument());
- } catch (IOException e) {
- log.error(e);
- throw new SLRuntimeException(e);
- }
-
- DOMStructure structure = new DOMStructure(textNode);
-
- String idValue = ctx.getIdValueFactory().createIdValue("Object");
-
- return ctx.getSignatureFactory().newXMLObject(Collections.singletonList(structure), idValue, null, null);
-
- }
-
- /**
- * Create an XMLObject with the given content node.
- *
- * @param content the content node
- *
- * @return an XMLObject with the given content
- */
- private XMLObject createXMLObject(Node content) {
-
- String idValue = ctx.getIdValueFactory().createIdValue("Object");
-
- List structures = Collections.singletonList(new DOMStructure(content));
-
- return ctx.getSignatureFactory().newXMLObject(structures, idValue, null, null);
-
- }
-
- /**
- * Sets the given xmlObject and creates and sets a corresponding
- * Reference.
- *
- * A transform to Base64-decode the xmlObject's content is inserted at the top
- * of to the optional transforms if given, or to a newly created
- * Transforms element if transforms is
- * null.
- *
- * @param xmlObject
- * the XMLObject
- * @param transforms
- * an optional Transforms element (may be
- * null)
- *
- * @throws SLCommandException
- * if creating the Reference fails
- * @throws NullPointerException
- * if xmlObject is null
- */
- private void setXMLObjectAndReferenceBase64(XMLObject xmlObject, XSECTTransforms transforms) throws SLCommandException {
-
- // create reference URI
- //
- // NOTE: the ds:Object can be referenced directly, as the Base64 transform
- // operates on the text() of the input nodelist.
- //
- String referenceURI = "#" + xmlObject.getId();
-
- // create Base64 Transform
- Transform transform;
- try {
- transform = ctx.getSignatureFactory().newTransform(Transform.BASE64, (TransformParameterSpec) null);
- } catch (NoSuchAlgorithmException e) {
- // algorithm must be present
- throw new SLRuntimeException(e);
- } catch (InvalidAlgorithmParameterException e) {
- // algorithm does not take parameters
- throw new SLRuntimeException(e);
- }
-
- if (transforms == null) {
- transforms = new XSECTTransforms(Collections.singletonList(transform));
- } else {
- transforms.insertTransform(transform);
- }
-
- DigestMethod dm;
- try {
- dm = ctx.getAlgorithmMethodFactory().createDigestMethod(ctx);
- } catch (NoSuchAlgorithmException e) {
- log.error("Failed to get DigestMethod.", e);
- throw new SLCommandException(4006);
- } catch (InvalidAlgorithmParameterException e) {
- log.error("Failed to get DigestMethod.", e);
- throw new SLCommandException(4006);
- }
- String id = ctx.getIdValueFactory().createIdValue("Reference");
-
- this.xmlObject = xmlObject;
- this.reference = new XSECTReference(referenceURI, dm, transforms, null, id);
-
- }
-
- /**
- * Sets the given xmlObject and creates and sets a corresponding
- * Reference.
- *
- * A transform to select the xmlObject's content is inserted at the top of to
- * the optional transforms if given, or to a newly created
- * Transforms element if transforms is
- * null.
- *
- *
- * @param xmlObject
- * the XMLObject
- * @param transforms
- * an optional Transforms element (may be
- * null)
- *
- * @throws SLCommandException
- * if creating the Reference fails
- * @throws NullPointerException
- * if xmlObject is null
- */
- private void setXMLObjectAndReferenceXML(XMLObject xmlObject, XSECTTransforms transforms) throws SLCommandException {
-
- // create reference URI
- String referenceURI = "#" + xmlObject.getId();
-
- // create Transform to select ds:Object's children
- Transform xpathTransform;
- Transform c14nTransform;
- try {
-
- XPathType xpath = new XPathType("id(\"" + xmlObject.getId() + "\")/node()", XPathType.Filter.INTERSECT);
- List xpaths = Collections.singletonList(xpath);
- XPathFilter2ParameterSpec params = new XPathFilter2ParameterSpec(xpaths);
-
- xpathTransform = ctx.getSignatureFactory().newTransform(Transform.XPATH2, params);
-
- // add exclusive canonicalization to avoid signing the namespace context of the ds:Object
- c14nTransform = ctx.getSignatureFactory().newTransform(CanonicalizationMethod.EXCLUSIVE, (TransformParameterSpec) null);
-
- } catch (NoSuchAlgorithmException e) {
- // algorithm must be present
- throw new SLRuntimeException(e);
- } catch (InvalidAlgorithmParameterException e) {
- // params must be appropriate
- throw new SLRuntimeException(e);
- }
-
- if (transforms == null) {
- List newTransfroms = new ArrayList();
- newTransfroms.add(xpathTransform);
- newTransfroms.add(c14nTransform);
- transforms = new XSECTTransforms(newTransfroms);
- } else {
- transforms.insertTransform(xpathTransform);
- }
-
- DigestMethod dm;
- try {
- dm = ctx.getAlgorithmMethodFactory().createDigestMethod(ctx);
- } catch (NoSuchAlgorithmException e) {
- log.error("Failed to get DigestMethod.", e);
- throw new SLCommandException(4006);
- } catch (InvalidAlgorithmParameterException e) {
- log.error("Failed to get DigestMethod.", e);
- throw new SLCommandException(4006);
- }
- String id = ctx.getIdValueFactory().createIdValue("Reference");
-
- this.xmlObject = xmlObject;
- this.reference = new XSECTReference(referenceURI, dm, transforms, null, id);
-
- }
-
- /**
- * Parses the given xmlContent and returns a corresponding
- * document fragment.
- *
- *
- * The to-be parsed content is surrounded by ... elements to
- * allow for mixed (e.g. Text and Element) content in XMLContent.
- *
- *
- * @param xmlContent
- * the XMLContent to-be parsed
- *
- * @return a document fragment containing the parsed nodes
- *
- * @throws SLCommandException
- * if parsing the given xmlContent fails
- *
- * @throws NullPointerException
- * if xmlContent is null
- */
- private DocumentFragment parseDataObject(XMLContentType xmlContent) throws SLCommandException {
-
- ByteArrayOutputStream redirectedStream = xmlContent.getRedirectedStream();
-
- // Note: We can assume a fixed character encoding of UTF-8 for the
- // content of the redirect stream as the content has already been parsed
- // and serialized again to the redirect stream.
-
- List inputStreams = new ArrayList();
- try {
- // dummy start element
- inputStreams.add(new ByteArrayInputStream("".getBytes("UTF-8")));
-
- // content
- inputStreams.add(new ByteArrayInputStream(redirectedStream.toByteArray()));
-
- // dummy end element
- inputStreams.add(new ByteArrayInputStream("".getBytes("UTF-8")));
- } catch (UnsupportedEncodingException e) {
- throw new SLRuntimeException(e);
- }
-
- SequenceInputStream inputStream = new SequenceInputStream(Collections.enumeration(inputStreams));
-
- // parse DataObject
- Document doc = parseDataObject(inputStream, "UTF-8");
-
- Element documentElement = doc.getDocumentElement();
-
- if (documentElement == null ||
- !"dummy".equals(documentElement.getLocalName())) {
- log.info("Failed to parse DataObject XMLContent.");
- throw new SLCommandException(4111);
- }
-
- DocumentFragment fragment = doc.createDocumentFragment();
- while (documentElement.getFirstChild() != null) {
- fragment.appendChild(documentElement.getFirstChild());
- }
-
- // log parsed document
- if (log.isTraceEnabled()) {
-
- StringWriter writer = new StringWriter();
-
- writer.write("DataObject:\n");
-
- LSOutput output = domImplLS.createLSOutput();
- output.setCharacterStream(writer);
- output.setEncoding("UTF-8");
- LSSerializer serializer = domImplLS.createLSSerializer();
- serializer.getDomConfig().setParameter("xml-declaration", Boolean.FALSE);
- serializer.write(fragment, output);
-
- log.trace(writer.toString());
- }
-
- return fragment;
-
- }
-
- /**
- * Parses the given inputStream using the given
- * encoding and returns the parsed document.
- *
- * @param inputStream
- * the to-be parsed input
- *
- * @param encoding
- * the encoding to be used for parsing the given
- * inputStream
- *
- * @return the parsed document
- *
- * @throws SLCommandException
- * if parsing the inputStream fails.
- *
- * @throws NullPointerException
- * if inputStram is null
- */
- private Document parseDataObject(InputStream inputStream, String encoding) throws SLCommandException {
-
- LSInput input = domImplLS.createLSInput();
- input.setByteStream(inputStream);
-
- if (encoding != null) {
- input.setEncoding(encoding);
- }
-
- LSParser parser = domImplLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS, null);
- DOMConfiguration domConfig = parser.getDomConfig();
- SimpleDOMErrorHandler errorHandler = new SimpleDOMErrorHandler();
- domConfig.setParameter("error-handler", errorHandler);
- domConfig.setParameter("validate", Boolean.FALSE);
-
- Document doc;
- try {
- doc = parser.parse(input);
- } catch (DOMException e) {
- log.info("Existing XML document cannot be parsed.", e);
- throw new SLCommandException(4111);
- } catch (LSException e) {
- log.info("Existing XML document cannot be parsed. ", e);
- throw new SLCommandException(4111);
- }
-
- if (errorHandler.hasErrors()) {
- // log errors
- if (log.isInfoEnabled()) {
- List errorMessages = errorHandler.getErrorMessages();
- StringBuffer sb = new StringBuffer();
- for (String errorMessage : errorMessages) {
- sb.append(" ");
- sb.append(errorMessage);
- }
- log.info("Existing XML document cannot be parsed. " + sb.toString());
- }
- throw new SLCommandException(4111);
- }
-
- return doc;
-
- }
-
-
-}
+
+ /**
+ * Configures this DataObject with the information provided within the given
+ * sl:DataObjectInfo.
+ *
+ * @param dataObjectInfo
+ * the sl:DataObjectInfo
+ *
+ * @throws SLCommandException
+ * if configuring this DataObject with the information provided in
+ * the sl:DataObjectInfo fails.
+ * @throws SLRequestException
+ * if the information provided in the sl:DataObjectInfo
+ * does not conform to the security layer specification.
+ * @throws NullPointerException
+ * if dataObjectInfo is null
+ */
+ public void setDataObjectInfo(DataObjectInfoType dataObjectInfo) throws SLCommandException, SLRequestException {
+
+ Base64XMLLocRefOptRefContentType dataObject = dataObjectInfo.getDataObject();
+ String structure = dataObjectInfo.getStructure();
+
+ // select and unmarshal an appropriate transformation path if provided
+ // and set the final data meta information
+ XSECTTransforms transforms = createTransformsAndSetFinalDataMetaInfo(dataObjectInfo.getTransformsInfo());
+
+ if ("enveloping".equals(structure)) {
+
+ // configure this DataObject as an enveloped DataObject
+ setEnvelopedDataObject(dataObject, transforms);
+
+ } else if ("detached".equals(structure)) {
+
+ // configure this DataObject as an detached DataObject
+ setDetachedDataObject(dataObject, transforms);
+
+ }
+ // other values are not allowed by the schema and are therefore ignored
+
+ }
+
+ private byte[] getTransformsBytes(at.gv.egiz.slbinding.impl.TransformsInfoType ti) {
+ return ti.getRedirectedStream().toByteArray();
+// byte[] transformsBytes = ti.getRedirectedStream().toByteArray();
+//
+// if (transformsBytes == null || transformsBytes.length == 0) {
+// return null;
+// }
+//
+// String dsigPrefix = ti.getNamespaceContext().getNamespaceURI("http://www.w3.org/2000/09/xmldsig#");
+// byte[] pre, post;
+// if (dsigPrefix == null) {
+// log.trace("XMLDSig not declared in outside dsig:Transforms");
+// pre = "".getBytes();
+// post = "".getBytes();
+// } else {
+// log.trace("XMLDSig bound to prefix " + dsigPrefix);
+// pre = ("").getBytes();
+// post = "".getBytes();
+// }
+//
+// byte[] workaround = new byte[pre.length + transformsBytes.length + post.length];
+// System.arraycopy(pre, 0, workaround, 0, pre.length);
+// System.arraycopy(transformsBytes, 0, workaround, pre.length, transformsBytes.length);
+// System.arraycopy(post, 0, workaround, pre.length + transformsBytes.length, post.length);
+// return workaround;
+ }
+
+ /**
+ * Configures this DataObject as an enveloped DataObject with the information
+ * provided within the given sl:DataObject.
+ *
+ * @param dataObject
+ * the sl:DataObject
+ * @param transforms
+ * an optional Transforms element (may be
+ * null)
+ *
+ * @throws SLCommandException
+ * if configuring this DataObject with the information provided in
+ * the sl:DataObject fails.
+ * @throws SLRequestException
+ * if the information provided in the sl:DataObject
+ * does not conform to the security layer specification.
+ * @throws NullPointerException
+ * if dataObject is null
+ */
+ private void setEnvelopedDataObject(
+ Base64XMLLocRefOptRefContentType dataObject, XSECTTransforms transforms)
+ throws SLCommandException, SLRequestException {
+
+ String reference = dataObject.getReference();
+ if (reference == null) {
+ //
+ // case A
+ //
+ // The Reference attribute is not used; the content of sl:DataObject represents the data object.
+ // If the data object is XML-coded (the sl:XMLContent element is used in sl:DataObject), then it
+ // must be incorporated in the signature structure as parsed XML.
+ //
+
+ if (dataObject.getBase64Content() != null) {
+
+ log.debug("Adding DataObject (Base64Content) without a reference URI.");
+
+ // create XMLObject
+ XMLObject xmlObject = createXMLObject(new ByteArrayInputStream(dataObject.getBase64Content()));
+
+ setXMLObjectAndReferenceBase64(xmlObject, transforms);
+
+ } else if (dataObject.getXMLContent() != null) {
+
+ log.debug("Adding DataObject (XMLContent) without a reference URI.");
+
+ // create XMLObject
+ DocumentFragment content = parseDataObject((XMLContentType) dataObject.getXMLContent());
+ XMLObject xmlObject = createXMLObject(content);
+
+ setXMLObjectAndReferenceXML(xmlObject, transforms);
+
+ } else if (dataObject.getLocRefContent() != null) {
+
+ log.debug("Adding DataObject (LocRefContent) without a reference URI.");
+
+ setEnvelopedDataObject(dataObject.getLocRefContent(), transforms);
+
+ } else {
+
+ // not allowed
+ log.info("XML structure of the command request contains an " +
+ "invalid combination of optional elements or attributes. " +
+ "DataObject of structure='enveloped' without a reference must contain content.");
+ throw new SLRequestException(3003);
+
+ }
+
+ } else {
+
+ if (dataObject.getBase64Content() == null &&
+ dataObject.getXMLContent() == null &&
+ dataObject.getLocRefContent() == null) {
+
+ //
+ // case B
+ //
+ // The Reference attribute contains a URI that must be resolved by the
+ // Citizen Card Environment to obtain the data object.
+ // The content of sl:DataObject remains empty
+ //
+
+ log.debug("Adding DataObject from reference URI '" + reference + "'.");
+
+ setEnvelopedDataObject(reference, transforms);
+
+ } else {
+
+ // not allowed
+ log.info("XML structure of the command request contains an " +
+ "invalid combination of optional elements or attributes. " +
+ "DataObject of structure='enveloped' with reference must not contain content.");
+ throw new SLRequestException(3003);
+
+ }
+
+
+ }
+
+ }
+
+ /**
+ * Configures this DataObject as an enveloped DataObject with the content to
+ * be dereferenced from the given reference.
+ *
+ * @param reference
+ * the reference URI
+ * @param transforms
+ * an optional Transforms element (may be
+ * null)
+ *
+ * @throws SLCommandException
+ * if dereferencing the given reference fails, or if
+ * configuring this DataObject with the data dereferenced from the
+ * given reference fails.
+ * @throws NullPointerException
+ * if reference is null
+ */
+ private void setEnvelopedDataObject(String reference, XSECTTransforms transforms) throws SLCommandException {
+
+ if (reference == null) {
+ throw new NullPointerException("Argument 'reference' must not be null.");
+ }
+
+ // dereference URL
+ URLDereferencer dereferencer = URLDereferencer.getInstance();
+
+ StreamData streamData;
+ try {
+ streamData = dereferencer.dereference(reference, ctx.getDereferencerContext());
+ } catch (IOException e) {
+ log.info("Failed to dereference XMLObject from '" + reference + "'.", e);
+ throw new SLCommandException(4110);
+ }
+
+ Node childNode;
+
+ String contentType = streamData.getContentType();
+ if (contentType.startsWith("text/xml")) {
+
+ // If content type is text/xml parse content.
+ String charset = HttpUtil.getCharset(contentType, true);
+
+ Document doc = parseDataObject(streamData.getStream(), charset);
+
+ childNode = doc.getDocumentElement();
+
+ if (childNode == null) {
+ log.info("Failed to parse XMLObject from '" + reference + "'.");
+ throw new SLCommandException(4111);
+ }
+
+ XMLObject xmlObject = createXMLObject(childNode);
+
+ setXMLObjectAndReferenceXML(xmlObject, transforms);
+
+ } else {
+
+ // Include content Base64 encoded.
+ XMLObject xmlObject = createXMLObject(streamData.getStream());
+
+ setXMLObjectAndReferenceBase64(xmlObject, transforms);
+
+ }
+
+ }
+
+ /**
+ * Configures this DataObject as an detached DataObject with the information
+ * provided in the given sl:DataObject and optionally
+ * transforms.
+ *
+ * @param dataObject
+ * the sl:DataObject
+ * @param transforms
+ * an optional Transforms object, may be null
+ *
+ * @throws SLCommandException
+ * if configuring this DataObject with the information provided in
+ * the sl:DataObject fails.
+ * @throws SLRequestException
+ * if the information provided in the sl:DataObject
+ * does not conform to the security layer specification.
+ * @throws NullPointerException
+ * if dataObject is null
+ */
+ private void setDetachedDataObject(
+ Base64XMLLocRefOptRefContentType dataObject, XSECTTransforms transforms)
+ throws SLCommandException, SLRequestException {
+
+ String referenceURI = dataObject.getReference();
+
+ if (referenceURI == null) {
+
+ // not allowed
+ log.info("XML structure of the command request contains an " +
+ "invalid combination of optional elements or attributes. " +
+ "DataObject of structure='detached' must contain a reference.");
+ throw new SLRequestException(3003);
+
+ } else {
+
+ DigestMethod dm;
+ try {
+ dm = ctx.getAlgorithmMethodFactory().createDigestMethod(ctx);
+ } catch (NoSuchAlgorithmException e) {
+ log.error("Failed to get DigestMethod.", e);
+ throw new SLCommandException(4006);
+ } catch (InvalidAlgorithmParameterException e) {
+ log.error("Failed to get DigestMethod.", e);
+ throw new SLCommandException(4006);
+ }
+
+ String idValue = ctx.getIdValueFactory().createIdValue("Reference");
+
+ reference = new XSECTReference(referenceURI, dm, transforms, null, idValue);
+
+ // case D:
+ //
+ // The Reference attribute contains a URI that is used by the Citizen Card
+ // Environment to code the reference to the data object as part of the XML
+ // signature (attribute URI in the dsig:Reference) element. The content of
+ // sl:DataObject represents the data object.
+
+ if (dataObject.getLocRefContent() != null) {
+ String locRef = dataObject.getLocRefContent();
+ try {
+ this.reference.setDereferencer(new LocRefDereferencer(ctx.getDereferencerContext(), locRef));
+ } catch (URISyntaxException e) {
+ log.info("Invalid URI '" + locRef + "' in DataObject.", e);
+ throw new SLCommandException(4003);
+ } catch (IllegalArgumentException e) {
+ log.info("LocRef URI of '" + locRef + "' not supported in DataObject. ", e);
+ throw new SLCommandException(4003);
+ }
+ } else if (dataObject.getBase64Content() != null) {
+ byte[] base64Content = dataObject.getBase64Content();
+ this.reference.setDereferencer(new ByteArrayDereferencer(base64Content));
+ } else if (dataObject.getXMLContent() != null) {
+ XMLContentType xmlContent = (XMLContentType) dataObject.getXMLContent();
+ byte[] bytes = xmlContent.getRedirectedStream().toByteArray();
+ this.reference.setDereferencer(new ByteArrayDereferencer(bytes));
+ } else {
+
+ // case C:
+ //
+ // The Reference attribute contains a URI that must be resolved by the
+ // Citizen Card Environment to obtain the data object. The Reference
+ // attribute contains a URI that is used by the Citizen Card Environment
+ // to code the reference to the data object as part of the XML signature
+ // (attribute URI in the dsig:Reference) element. The content of
+ // sl:DataObject remains empty.
+
+ }
+
+ }
+ }
+
+ /**
+ * Returns the preferred sl:TransformInfo from the given list of
+ * transformInfos, or null if none of the given
+ * transformInfos is preferred over the others.
+ *
+ * @param transformsInfos
+ * a list of sl:TransformInfos
+ *
+ * @return the selected sl:TransformInfo or null, if
+ * none is preferred over the others
+ */
+ private TransformsInfoType selectPreferredTransformsInfo(List transformsInfos) {
+
+ Map mimeTypes = new HashMap();
+
+ StringBuilder debugString = null;
+ if (log.isDebugEnabled()) {
+ debugString = new StringBuilder();
+ debugString.append("Got " + transformsInfos.size() + " TransformsInfo(s):");
+ }
+
+ for (TransformsInfoType transformsInfoType : transformsInfos) {
+ MetaInfoType finalDataMetaInfo = transformsInfoType.getFinalDataMetaInfo();
+ String mimeType = finalDataMetaInfo.getMimeType();
+ String description = finalDataMetaInfo.getDescription();
+ mimeTypes.put(mimeType, transformsInfoType);
+ if (debugString != null) {
+ debugString.append("\n FinalDataMetaInfo: MIME-Type=");
+ debugString.append(mimeType);
+ if (description != null) {
+ debugString.append(" ");
+ debugString.append(description);
+ }
+ }
+ }
+
+ if (debugString != null) {
+ log.debug(debugString);
+ }
+
+ // look for preferred transform
+ for (String mimeType : DEFAULT_PREFFERED_MIME_TYPES) {
+ if (mimeTypes.containsKey(mimeType)) {
+ return mimeTypes.get(mimeType);
+ }
+ }
+
+ // no preferred transform
+ return null;
+
+ }
+
+ /**
+ * Create an instance of ds:Transforms from the given
+ * sl:TransformsInfo.
+ *
+ * @param transformsInfo
+ * the sl:TransformsInfo
+ *
+ * @return a corresponding unmarshalled ds:Transforms, or
+ * null if the given sl:TransformsInfo does
+ * not contain a dsig:Transforms element
+ *
+ * @throws SLRequestException
+ * if the ds:Transforms in the given
+ * transformsInfo are not valid or cannot be parsed.
+ *
+ * @throws MarshalException
+ * if the ds:Transforms in the given
+ * transformsInfo cannot be unmarshalled.
+ */
+ private XSECTTransforms createTransforms(TransformsInfoType transformsInfo) throws SLRequestException, MarshalException {
+
+ byte[] transforms = getTransformsBytes((at.gv.egiz.slbinding.impl.TransformsInfoType) transformsInfo);
+
+ if (transforms != null && transforms.length > 0) {
+ // debug
+ if (log.isTraceEnabled()) {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Trying to parse transforms:\n");
+ sb.append(new String(transforms, Charset.forName("UTF-8")));
+ log.trace(sb);
+ }
+
+ DOMImplementationLS domImplLS = DOMUtils.getDOMImplementationLS();
+ LSInput input = domImplLS.createLSInput();
+ input.setByteStream(new ByteArrayInputStream(transforms));
+
+ LSParser parser = domImplLS.createLSParser(
+ DOMImplementationLS.MODE_SYNCHRONOUS, null);
+ DOMConfiguration domConfig = parser.getDomConfig();
+ SimpleDOMErrorHandler errorHandler = new SimpleDOMErrorHandler();
+ domConfig.setParameter("error-handler", errorHandler);
+ domConfig.setParameter("validate", Boolean.FALSE);
+
+ Document document;
+ try {
+ document = parser.parse(input);
+ } catch (DOMException e) {
+ log.info("Failed to parse dsig:Transforms.", e);
+ throw new SLRequestException(3002);
+ } catch (LSException e) {
+ log.info("Failed to parse dsig:Transforms.", e);
+ throw new SLRequestException(3002);
+ }
+
+ // adopt ds:Transforms
+ Element transformsElt = document.getDocumentElement();
+ Node adoptedTransforms = ctx.getDocument().adoptNode(transformsElt);
+
+ DOMCryptoContext context = new DOMCryptoContext();
+
+ // unmarshall ds:Transforms
+ return new XSECTTransforms(context, adoptedTransforms);
+
+ } else {
+ return null;
+ }
+
+
+// TransformsType transformsType = transformsInfo.getTransforms();
+// if (transformsType == null) {
+// return null;
+// }
+// List transformList = transformsType.getTransform();
+//
+// DOMImplementationLS domImplLS = DOMUtils.getDOMImplementationLS();
+//// Document transformsDoc = ((DOMImplementation) domImplLS).createDocument("http://www.w3.org/2000/09/xmldsig#", "Transforms", null);
+//// Element transforms = transformsDoc.getDocumentElement();
+// Document transformsDoc = DOMUtils.createDocument();
+// Element transforms = transformsDoc.createElementNS(
+// "http://www.w3.org/2000/09/xmldsig#",
+// Signature.XMLDSIG_PREFIX + ":Transforms");
+// transformsDoc.appendChild(transforms);
+//
+// for (TransformType transformType : transformList) {
+// log.trace("found " + transformType.getClass().getName());
+// Element transform = transformsDoc.createElementNS(
+// "http://www.w3.org/2000/09/xmldsig#",
+// Signature.XMLDSIG_PREFIX + ":Transform");
+// String algorithm = transformType.getAlgorithm();
+// if (algorithm != null) {
+// log.trace("found algorithm " + algorithm);
+// transform.setAttribute("Algorithm", algorithm);
+// }
+//
+// at.gv.egiz.slbinding.impl.TransformType t = (at.gv.egiz.slbinding.impl.TransformType) transformType;
+// byte[] redirectedBytes = t.getRedirectedStream().toByteArray();
+// if (redirectedBytes != null && redirectedBytes.length > 0) {
+// if (log.isTraceEnabled()) {
+// StringBuilder sb = new StringBuilder();
+// sb.append("Trying to parse dsig:Transform:\n");
+// sb.append(new String(redirectedBytes, Charset.forName("UTF-8")));
+// log.trace(sb);
+// }
+// LSInput input = domImplLS.createLSInput();
+// input.setByteStream(new ByteArrayInputStream(redirectedBytes));
+//
+// LSParser parser = domImplLS.createLSParser(
+// DOMImplementationLS.MODE_SYNCHRONOUS, null);
+// DOMConfiguration domConfig = parser.getDomConfig();
+// SimpleDOMErrorHandler errorHandler = new SimpleDOMErrorHandler();
+// domConfig.setParameter("error-handler", errorHandler);
+// domConfig.setParameter("validate", Boolean.FALSE);
+//
+// try {
+// Document redirectedDoc = parser.parse(input);
+// Node redirected = transformsDoc.adoptNode(redirectedDoc.getDocumentElement());
+// transform.appendChild(redirected);
+//
+// //not supported by Xerces2.9.1
+//// Node redirected = parser.parseWithContext(input, transform, LSParser.ACTION_APPEND_AS_CHILDREN);
+//
+// } catch (DOMException e) {
+// log.info("Failed to parse dsig:Transform.", e);
+// throw new SLRequestException(3002);
+// } catch (LSException e) {
+// log.info("Failed to parse dsig:Transform.", e);
+// throw new SLRequestException(3002);
+// }
+// }
+// transforms.appendChild(transform);
+// }
+//
+// //adopt ds:Transforms
+// Node adoptedTransforms = ctx.getDocument().adoptNode(transforms);
+// DOMCryptoContext context = new DOMCryptoContext();
+//
+// // unmarshall ds:Transforms
+// return new XSECTTransforms(context, adoptedTransforms);
+
+ }
+
+ /**
+ * Sets the mimeType and the description value
+ * for this DataObject.
+ *
+ * @param metaInfoType the sl:FinalMetaDataInfo
+ *
+ * @throws NullPointerException if metaInfoType is null
+ */
+ private void setFinalDataMetaInfo(MetaInfoType metaInfoType) {
+
+ this.mimeType = metaInfoType.getMimeType();
+ this.description = metaInfoType.getDescription();
+
+ }
+
+ /**
+ * Selects an appropriate transformation path (if present) from the given list
+ * of sl:TransformInfos, sets the corresponding final data meta info and
+ * returns the corresponding unmarshalled ds:Transforms.
+ *
+ * @param transformsInfos the sl:TransformInfos
+ *
+ * @return the unmarshalled ds:Transforms, or null if
+ * no transformation path has been selected.
+ *
+ * @throws SLRequestException if the given list ds:TransformsInfo contains
+ * an invalid ds:Transforms element, or no suitable transformation path
+ * can be found.
+ */
+ private XSECTTransforms createTransformsAndSetFinalDataMetaInfo(
+ List transformsInfos) throws SLRequestException {
+
+ TransformsInfoType preferredTransformsInfo = selectPreferredTransformsInfo(transformsInfos);
+ // try preferred transform
+ if (preferredTransformsInfo != null) {
+
+ try {
+ XSECTTransforms transforms = createTransforms(preferredTransformsInfo);
+ setFinalDataMetaInfo(preferredTransformsInfo.getFinalDataMetaInfo());
+ return transforms;
+ } catch (MarshalException e) {
+
+ String mimeType = preferredTransformsInfo.getFinalDataMetaInfo().getMimeType();
+ log.info("Failed to unmarshal preferred transformation path (MIME-Type="
+ + mimeType + ").", e);
+
+ }
+
+ }
+
+ // look for another suitable transformation path
+ for (TransformsInfoType transformsInfoType : transformsInfos) {
+
+ try {
+ XSECTTransforms transforms = createTransforms(transformsInfoType);
+ setFinalDataMetaInfo(transformsInfoType.getFinalDataMetaInfo());
+ return transforms;
+ } catch (MarshalException e) {
+
+ String mimeType = transformsInfoType.getFinalDataMetaInfo().getMimeType();
+ log.info("Failed to unmarshal transformation path (MIME-Type="
+ + mimeType + ").", e);
+ }
+
+ }
+
+ // no suitable transformation path found
+ throw new SLRequestException(3003);
+
+ }
+
+ /**
+ * Create an XMLObject with the Base64 encoding of the given
+ * content.
+ *
+ * @param content
+ * the to-be Base64 encoded content
+ * @return an XMLObject with the Base64 encoded content
+ */
+ private XMLObject createXMLObject(InputStream content) {
+
+ Text textNode;
+ try {
+ textNode = at.gv.egiz.dom.DOMUtils.createBase64Text(content, ctx.getDocument());
+ } catch (IOException e) {
+ log.error(e);
+ throw new SLRuntimeException(e);
+ }
+
+ DOMStructure structure = new DOMStructure(textNode);
+
+ String idValue = ctx.getIdValueFactory().createIdValue("Object");
+
+ return ctx.getSignatureFactory().newXMLObject(Collections.singletonList(structure), idValue, null, null);
+
+ }
+
+ /**
+ * Create an XMLObject with the given content node.
+ *
+ * @param content the content node
+ *
+ * @return an XMLObject with the given content
+ */
+ private XMLObject createXMLObject(Node content) {
+
+ String idValue = ctx.getIdValueFactory().createIdValue("Object");
+
+ List structures = Collections.singletonList(new DOMStructure(content));
+
+ return ctx.getSignatureFactory().newXMLObject(structures, idValue, null, null);
+
+ }
+
+ /**
+ * Sets the given xmlObject and creates and sets a corresponding
+ * Reference.
+ *
+ * A transform to Base64-decode the xmlObject's content is inserted at the top
+ * of to the optional transforms if given, or to a newly created
+ * Transforms element if transforms is
+ * null.
+ *
+ * @param xmlObject
+ * the XMLObject
+ * @param transforms
+ * an optional Transforms element (may be
+ * null)
+ *
+ * @throws SLCommandException
+ * if creating the Reference fails
+ * @throws NullPointerException
+ * if xmlObject is null
+ */
+ private void setXMLObjectAndReferenceBase64(XMLObject xmlObject, XSECTTransforms transforms) throws SLCommandException {
+
+ // create reference URI
+ //
+ // NOTE: the ds:Object can be referenced directly, as the Base64 transform
+ // operates on the text() of the input nodelist.
+ //
+ String referenceURI = "#" + xmlObject.getId();
+
+ // create Base64 Transform
+ Transform transform;
+ try {
+ transform = ctx.getSignatureFactory().newTransform(Transform.BASE64, (TransformParameterSpec) null);
+ } catch (NoSuchAlgorithmException e) {
+ // algorithm must be present
+ throw new SLRuntimeException(e);
+ } catch (InvalidAlgorithmParameterException e) {
+ // algorithm does not take parameters
+ throw new SLRuntimeException(e);
+ }
+
+ if (transforms == null) {
+ transforms = new XSECTTransforms(Collections.singletonList(transform));
+ } else {
+ transforms.insertTransform(transform);
+ }
+
+ DigestMethod dm;
+ try {
+ dm = ctx.getAlgorithmMethodFactory().createDigestMethod(ctx);
+ } catch (NoSuchAlgorithmException e) {
+ log.error("Failed to get DigestMethod.", e);
+ throw new SLCommandException(4006);
+ } catch (InvalidAlgorithmParameterException e) {
+ log.error("Failed to get DigestMethod.", e);
+ throw new SLCommandException(4006);
+ }
+ String id = ctx.getIdValueFactory().createIdValue("Reference");
+
+ this.xmlObject = xmlObject;
+ this.reference = new XSECTReference(referenceURI, dm, transforms, null, id);
+
+ }
+
+ /**
+ * Sets the given xmlObject and creates and sets a corresponding
+ * Reference.
+ *
+ * A transform to select the xmlObject's content is inserted at the top of to
+ * the optional transforms if given, or to a newly created
+ * Transforms element if transforms is
+ * null.
+ *
+ *
+ * @param xmlObject
+ * the XMLObject
+ * @param transforms
+ * an optional Transforms element (may be
+ * null)
+ *
+ * @throws SLCommandException
+ * if creating the Reference fails
+ * @throws NullPointerException
+ * if xmlObject is null
+ */
+ private void setXMLObjectAndReferenceXML(XMLObject xmlObject, XSECTTransforms transforms) throws SLCommandException {
+
+ // create reference URI
+ String referenceURI = "#" + xmlObject.getId();
+
+ // create Transform to select ds:Object's children
+ Transform xpathTransform;
+ Transform c14nTransform;
+ try {
+
+ XPathType xpath = new XPathType("id(\"" + xmlObject.getId() + "\")/node()", XPathType.Filter.INTERSECT);
+ List xpaths = Collections.singletonList(xpath);
+ XPathFilter2ParameterSpec params = new XPathFilter2ParameterSpec(xpaths);
+
+ xpathTransform = ctx.getSignatureFactory().newTransform(Transform.XPATH2, params);
+
+ // add exclusive canonicalization to avoid signing the namespace context of the ds:Object
+ c14nTransform = ctx.getSignatureFactory().newTransform(CanonicalizationMethod.EXCLUSIVE, (TransformParameterSpec) null);
+
+ } catch (NoSuchAlgorithmException e) {
+ // algorithm must be present
+ throw new SLRuntimeException(e);
+ } catch (InvalidAlgorithmParameterException e) {
+ // params must be appropriate
+ throw new SLRuntimeException(e);
+ }
+
+ if (transforms == null) {
+ List newTransfroms = new ArrayList();
+ newTransfroms.add(xpathTransform);
+ newTransfroms.add(c14nTransform);
+ transforms = new XSECTTransforms(newTransfroms);
+ } else {
+ transforms.insertTransform(xpathTransform);
+ }
+
+ DigestMethod dm;
+ try {
+ dm = ctx.getAlgorithmMethodFactory().createDigestMethod(ctx);
+ } catch (NoSuchAlgorithmException e) {
+ log.error("Failed to get DigestMethod.", e);
+ throw new SLCommandException(4006);
+ } catch (InvalidAlgorithmParameterException e) {
+ log.error("Failed to get DigestMethod.", e);
+ throw new SLCommandException(4006);
+ }
+ String id = ctx.getIdValueFactory().createIdValue("Reference");
+
+ this.xmlObject = xmlObject;
+ this.reference = new XSECTReference(referenceURI, dm, transforms, null, id);
+
+ }
+
+ /**
+ * Parses the given xmlContent and returns a corresponding
+ * document fragment.
+ *
+ *
+ * The to-be parsed content is surrounded by ... elements to
+ * allow for mixed (e.g. Text and Element) content in XMLContent.
+ *
Mit meiner elektronischen Signatur beantrage ich,
+
+ , geboren am . . , in der Rolle als (OID***= ), den Zugang zur gesicherten Anwendung.
+
+
Datum und Uhrzeit: . . , :
+ :
+
+
+
HPI(**):
+
+
+
wbPK(*):
+
+
+
+
Ich bin weiters ermächtigt als von
+ , geboren am . .
+
+ ,
+ , in deren Auftrag zu handeln.
+
wbPK(*) des Vollmachtgebers:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(*) wbPK: Das wirtschaftsbereichsspezifische
+ Personenkennzeichen wird aus den jeweiligen
+ Stammzahlen des Bürgers und des Wirtschaftsunternehmens
+ berechnet und ermöglicht eine eindeutige Zuordnung des
+ Bürgers zum Wirtschaftsunternehmen.
+
+
+
(**) HPI: Der eHealth Professional
+ Identifier wird aus den jeweiligen Stammzahlen
+ der Gesundheitsdiensteanbieterinnen /
+ Gesundheitsdiensteanbieter berechnet und ermöglicht eine
+ eindeutige Zuordnung der Gesundheitsdiensteanbieterin /
+ des Gesundheitsdiensteanbieters im
+ Gesundheitsbereich.
+
+
+
(***) OID: Object Identifier sind
+ standardisierte Objekt-Bezeichner und beschreiben
+ eindeutig die Rollen des GDA-Token Inhabers.
Mit meiner elektronischen Signatur beantrage ich,
+
+ , geboren am . . , in der Rolle als (OID***= ), den Zugang zur gesicherten Anwendung.
+
+
Datum und Uhrzeit: . . , :
+ :
+
+
+
HPI(**):
+
+
+
wbPK(*):
+
+
+
+
Ich bin weiters ermächtigt als von
+ , geboren am . .
+
+ ,
+ , in deren Auftrag zu handeln.
+
wbPK(*) des Vollmachtgebers:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
(*) wbPK: Das wirtschaftsbereichsspezifische
+ Personenkennzeichen wird aus den jeweiligen
+ Stammzahlen des Bürgers und des Wirtschaftsunternehmens
+ berechnet und ermöglicht eine eindeutige Zuordnung des
+ Bürgers zum Wirtschaftsunternehmen.
+
+
+
(**) HPI: Der eHealth Professional Identifier
+ wird aus den jeweiligen Stammzahlen der
+ Gesundheitsdiensteanbieterinnen /
+ Gesundheitsdiensteanbieter berechnet und ermöglicht eine
+ eindeutige Zuordnung der Gesundheitsdiensteanbieterin /
+ des Gesundheitsdiensteanbieters im
+ Gesundheitsbereich.
+
+
+
(***) OID: Object Identifier sind standardisierte
+ Objekt-Bezeichner und beschreiben eindeutig die Rollen
+ des GDA-Token Inhabers.
+
+
+
+
+
+
+
+
+
+ text/html
+
+
+
+
+
+
+
+
+
+ Mit meiner elektronischen Signatur beantrage ich,
+
+ , geboren am
+
+ .
+
+ .
+
+ ,
+
+ in der Rolle als
+
+ (OID***=
+ )
+ ,
+
+ den Zugang zur gesicherten Anwendung.
+
Datum und Uhrzeit:
+
+ .
+
+ .
+
+ ,
+
+ :
+
+ :
+
+
+
+
HPI(**):
+
+
+
+
+
wbPK(*):
+
+
+
+
+
Ich bin weiters ermächtigt als
+
+ von
+
+
+ , geboren am
+
+ .
+
+ .
+
+
+
+ ,
+
+
+ , in deren Auftrag zu handeln.
+
+
+
wbPK(*) des Vollmachtgebers:
+
+
+
+
+
+
(*) wbPK: Das wirtschaftsbereichsspezifische Personenkennzeichen wird aus den jeweiligen Stammzahlen des Bürgers und des Wirtschaftsunternehmens berechnet und ermöglicht eine eindeutige Zuordnung des Bürgers zum Wirtschaftsunternehmen.
+
+
+
(**) HPI: Der eHealth Professional Identifier wird aus den jeweiligen Stammzahlen der Gesundheitsdiensteanbieterinnen / Gesundheitsdiensteanbieter berechnet und ermöglicht eine eindeutige Zuordnung der Gesundheitsdiensteanbieterin / des Gesundheitsdiensteanbieters im Gesundheitsbereich.
+
+
+
(***) OID: Object Identifier sind standardisierte Objekt-Bezeichner und beschreiben eindeutig die Rollen des GDA-Token Inhabers.
+
+
+
+
+
+
+ not(text())
+
+
+
+ text/plain
+
+
+
+
+
+
+
+
+
+ https://demo.egiz.gv.at/exchange-moa-id-auth/
+
+
+
+
+ LTpz8VYzns2jrx0J8Gm/R/nAhxA=
+ urn:publicid:gv.at:wbpk+FN+TODO
+
+
+
+
+ https://apps.egiz.gv.at/urlaubsschein-frontend/moaid-login
+
+
+ 1971-11-10
+
+
+
+
+
+ /saml:Assertion
+
+
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java b/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java
index 13c57686..86223854 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/ACOSCard.java
@@ -30,8 +30,6 @@ package at.gv.egiz.smcc;
import java.nio.charset.Charset;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.smartcardio.CardChannel;
import javax.smartcardio.CardException;
import javax.smartcardio.CommandAPDU;
@@ -41,7 +39,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class ACOSCard extends AbstractSignatureCard implements SignatureCard {
-
+
private static Log log = LogFactory.getLog(ACOSCard.class);
public static final byte[] AID_DEC = new byte[] { (byte) 0xA0, (byte) 0x00,
@@ -100,8 +98,15 @@ public class ACOSCard extends AbstractSignatureCard implements SignatureCard {
(byte) 0x01 // RSA // TODO: Not verified yet
};
+ private static final int PINSPEC_INF = 0;
+ private static final int PINSPEC_DEC = 1;
+ private static final int PINSPEC_SIG = 2;
+
public ACOSCard() {
super("at/gv/egiz/smcc/ACOSCard");
+ pinSpecs.add(PINSPEC_INF, new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("inf.pin.name"), KID_PIN_INF, null));
+ pinSpecs.add(PINSPEC_DEC, new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("dec.pin.name"), KID_PIN_DEC, null));
+ pinSpecs.add(PINSPEC_SIG, new PINSpec(6, 10, "[0-9]", getResourceBundle().getString("sig.pin.name"), KID_PIN_SIG, null));
}
/* (non-Javadoc)
@@ -165,7 +170,8 @@ public class ACOSCard extends AbstractSignatureCard implements SignatureCard {
try {
if ("IdentityLink".equals(infobox)) {
- PINSpec spec = new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("inf.pin.name"));
+ PINSpec spec = pinSpecs.get(PINSPEC_INF);
+ //new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("inf.pin.name"));
int retries = -1;
String pin = null;
@@ -219,7 +225,8 @@ public class ACOSCard extends AbstractSignatureCard implements SignatureCard {
if (KeyboxName.SECURE_SIGNATURE_KEYPAIR.equals(keyboxName)) {
- PINSpec spec = new PINSpec(6, 10, "[0-9]", getResourceBundle().getString("sig.pin.name"));
+ PINSpec spec = pinSpecs.get(PINSPEC_SIG);
+ //new PINSpec(6, 10, "[0-9]", getResourceBundle().getString("sig.pin.name"));
int retries = -1;
String pin = null;
@@ -260,7 +267,8 @@ public class ACOSCard extends AbstractSignatureCard implements SignatureCard {
} else if (KeyboxName.CERITIFIED_KEYPAIR.equals(keyboxName)) {
- PINSpec spec = new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("dec.pin.name"));
+ PINSpec spec = pinSpecs.get(PINSPEC_DEC);
+ //new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("dec.pin.name"));
int retries = -1;
String pin = null;
@@ -321,11 +329,6 @@ public class ACOSCard extends AbstractSignatureCard implements SignatureCard {
0x00, fid, 256));
}
- @Override
- public byte[] getKIDs() {
- return new byte[] { KID_PIN_DEC, KID_PIN_INF, KID_PIN_SIG };
- }
-
@Override
public int verifyPIN(String pin, byte kid) throws LockedException, NotActivatedException, SignatureCardException {
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/AbstractSignatureCard.java b/smcc/src/main/java/at/gv/egiz/smcc/AbstractSignatureCard.java
index 67f090a5..cb068725 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/AbstractSignatureCard.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/AbstractSignatureCard.java
@@ -31,7 +31,11 @@ package at.gv.egiz.smcc;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
import java.util.Locale;
+import java.util.Map;
import java.util.ResourceBundle;
import javax.smartcardio.ATR;
@@ -49,6 +53,8 @@ public abstract class AbstractSignatureCard implements SignatureCard {
private static Log log = LogFactory.getLog(AbstractSignatureCard.class);
+ protected List pinSpecs = new ArrayList();
+
private ResourceBundle i18n;
private String resourceBundleName;
@@ -433,4 +439,8 @@ public abstract class AbstractSignatureCard implements SignatureCard {
}
}
+ @Override
+ public List getPINSpecs() {
+ return pinSpecs;
+ }
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/PINSpec.java b/smcc/src/main/java/at/gv/egiz/smcc/PINSpec.java
index 0852d664..d180ddf0 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/PINSpec.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/PINSpec.java
@@ -35,23 +35,40 @@ public class PINSpec {
String name_;
+ byte kid_;
+
+ byte[] context_aid_;
+
+ /**
+ *
+ * @param minLenght
+ * @param maxLength
+ * @param rexepPattern
+ * @param resourceBundle
+ * @param name
+ * @param kid the keyId for this pin
+ */
public PINSpec(int minLenght, int maxLength, String rexepPattern,
- ResourceBundle resourceBundle, String name) {
+ ResourceBundle resourceBundle, String name, byte kid, byte[] contextAID) {
minLength_ = minLenght;
maxLength_ = maxLength;
rexepPattern_ = rexepPattern;
resourceBundle_ = resourceBundle;
name_ = name;
+ kid_ = kid;
+ context_aid_ = contextAID;
}
public PINSpec(int minLenght, int maxLength, String rexepPattern,
- String name) {
+ String name, byte kid, byte[] contextAID) {
minLength_ = minLenght;
maxLength_ = maxLength;
rexepPattern_ = rexepPattern;
name_ = name;
+ kid_ = kid;
+ context_aid_ = contextAID;
}
@@ -75,7 +92,14 @@ public class PINSpec {
public String getRexepPattern() {
return rexepPattern_;
}
-
+
+ public byte getKID() {
+ return kid_;
+ }
+
+ public byte[] getContextAID() {
+ return context_aid_;
+ }
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java b/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
index e80c6683..ae43629e 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/STARCOSCard.java
@@ -29,10 +29,8 @@
package at.gv.egiz.smcc;
import java.math.BigInteger;
-import java.util.ArrayList;
import java.util.Arrays;
-import java.util.List;
import javax.smartcardio.CardChannel;
import javax.smartcardio.CardException;
import javax.smartcardio.CommandAPDU;
@@ -42,7 +40,7 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class STARCOSCard extends AbstractSignatureCard implements SignatureCard {
-
+
/**
* Logging facility.
*/
@@ -155,12 +153,17 @@ public class STARCOSCard extends AbstractSignatureCard implements SignatureCard
};
public static final byte KID_PIN_CARD = (byte) 0x01;
-
+
+ private static final int PINSPEC_CARD = 0;
+ private static final int PINSPEC_SS = 1;
+
/**
* Creates an new instance.
*/
public STARCOSCard() {
super("at/gv/egiz/smcc/STARCOSCard");
+ pinSpecs.add(PINSPEC_CARD, new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("card.pin.name"), KID_PIN_CARD, null));
+ pinSpecs.add(PINSPEC_SS, new PINSpec(6, 10, "[0-9]", getResourceBundle().getString("sig.pin.name"), KID_PIN_SS, AID_DF_SS));
}
@Override
@@ -210,7 +213,8 @@ public class STARCOSCard extends AbstractSignatureCard implements SignatureCard
try {
if ("IdentityLink".equals(infobox)) {
- PINSpec spec = new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("card.pin.name"));
+ PINSpec spec = pinSpecs.get(PINSPEC_CARD);
+ //new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("card.pin.name"));
int retries = -1;
String pin = null;
@@ -302,7 +306,8 @@ public class STARCOSCard extends AbstractSignatureCard implements SignatureCard
if (KeyboxName.SECURE_SIGNATURE_KEYPAIR.equals(keyboxName)) {
- PINSpec spec = new PINSpec(6, 10, "[0-9]", getResourceBundle().getString("sig.pin.name"));
+ PINSpec spec = pinSpecs.get(PINSPEC_SS);
+ //new PINSpec(6, 10, "[0-9]", getResourceBundle().getString("sig.pin.name"));
int retries = -1;
String pin = null;
@@ -334,7 +339,8 @@ public class STARCOSCard extends AbstractSignatureCard implements SignatureCard
} else if (KeyboxName.CERITIFIED_KEYPAIR.equals(keyboxName)) {
- PINSpec spec = new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("card.pin.name"));
+ PINSpec spec = pinSpecs.get(PINSPEC_CARD);
+ //new PINSpec(4, 4, "[0-9]", getResourceBundle().getString("card.pin.name"));
int retries = -1;
String pin = null;
@@ -455,11 +461,6 @@ public class STARCOSCard extends AbstractSignatureCard implements SignatureCard
}
}
- @Override
- public byte[] getKIDs() {
- return new byte[] { KID_PIN_CARD, KID_PIN_SS };
- }
-
/**
* VERIFY PIN
*
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java b/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java
index bad7ccf6..8dc4ac2a 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/SWCard.java
@@ -36,9 +36,13 @@ import java.security.cert.Certificate;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
+import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
import java.util.Locale;
+import java.util.Map;
import javax.smartcardio.Card;
import javax.smartcardio.CardTerminal;
@@ -311,7 +315,7 @@ public class SWCard implements SignatureCard {
if (password == null) {
- PINSpec pinSpec = new PINSpec(0, -1, ".", "KeyStore-Password");
+ PINSpec pinSpec = new PINSpec(0, -1, ".", "KeyStore-Password", (byte) 0x01, null);
password = provider.providePIN(pinSpec, -1);
@@ -390,13 +394,13 @@ public class SWCard implements SignatureCard {
}
@Override
- public byte[] getKIDs() {
- return null;
+ public int verifyPIN(String pin, byte kid) throws LockedException, NotActivatedException, SignatureCardException {
+ return -1;
}
@Override
- public int verifyPIN(String pin, byte kid) throws LockedException, NotActivatedException, SignatureCardException {
- return -1;
+ public List getPINSpecs() {
+ return new ArrayList();
}
}
diff --git a/smcc/src/main/java/at/gv/egiz/smcc/SignatureCard.java b/smcc/src/main/java/at/gv/egiz/smcc/SignatureCard.java
index 1ec35b78..1e5e09c8 100644
--- a/smcc/src/main/java/at/gv/egiz/smcc/SignatureCard.java
+++ b/smcc/src/main/java/at/gv/egiz/smcc/SignatureCard.java
@@ -31,6 +31,7 @@ package at.gv.egiz.smcc;
import java.util.List;
import java.util.Locale;
+import java.util.Map;
import javax.smartcardio.Card;
import javax.smartcardio.CardTerminal;
@@ -118,10 +119,10 @@ public interface SignatureCard {
PINProvider provider) throws SignatureCardException, InterruptedException;
/**
- * get the KIDs for the availabel PINs
+ * Get the KIDs for all available PINs and the corresponding PINSpecs
* @return array of KIDs
*/
- public byte[] getKIDs();
+ public List getPINSpecs();
/**
*
diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractBKUWorker.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractBKUWorker.java
index e10ba8f9..b6c5a8ca 100644
--- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractBKUWorker.java
+++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractBKUWorker.java
@@ -102,6 +102,9 @@ public abstract class AbstractBKUWorker extends AbstractSMCCSTAL implements Acti
@Override
protected boolean waitForCard() {
+ if (signatureCard != null) {
+ return false;
+ }
SMCCHelper smccHelper = new SMCCHelper();
actionCommandList.clear();
actionCommandList.add("cancel");
diff --git a/smccSTAL/src/test/java/at/gv/egiz/smcc/AbstractSMCCSTALTest.java b/smccSTAL/src/test/java/at/gv/egiz/smcc/AbstractSMCCSTALTest.java
index a5f8a771..a5d6df23 100644
--- a/smccSTAL/src/test/java/at/gv/egiz/smcc/AbstractSMCCSTALTest.java
+++ b/smccSTAL/src/test/java/at/gv/egiz/smcc/AbstractSMCCSTALTest.java
@@ -86,15 +86,16 @@ public class AbstractSMCCSTALTest extends AbstractSMCCSTAL implements
}
- @Override
- public byte[] getKIDs() {
- return null;
- }
@Override
public int verifyPIN(String pin, byte kid) throws LockedException, NotActivatedException, SignatureCardException {
return 0;
}
+
+ @Override
+ public List getPINSpecs() {
+ return new ArrayList();
+ }
};
return false;
diff --git a/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefix.java b/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefix.java
new file mode 100644
index 00000000..c03f17cd
--- /dev/null
+++ b/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefix.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package at.gv.egiz.marshal;
+
+/**
+ *
+ * @author Clemens Orthacker
+ */
+public interface NamespacePrefix {
+ String CARDCHANNEL_PREFIX = "cc";
+ String ECDSA_PREFIX = "ecdsa";
+ String PERSONDATA_PREFIX = "pr";
+ String SAML10_PREFIX = "saml";
+ String SL_PREFIX = "sl";
+ String XADES_PREFIX = "xades";
+ String XMLDSIG_PREFIX = "xmldsig";
+ String XSI_PREFIX = "xsi";
+
+}
diff --git a/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java b/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java
index a08c1188..519f6b1f 100644
--- a/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java
+++ b/utils/src/main/java/at/gv/egiz/marshal/NamespacePrefixMapperImpl.java
@@ -36,35 +36,35 @@ public class NamespacePrefixMapperImpl extends NamespacePrefixMapper {
log.trace("prefix for namespace " + namespaceUri + " requested");
}
if ("http://www.w3.org/2001/XMLSchema-instance".equals(namespaceUri)) {
- return "xsi";
+ return NamespacePrefix.XSI_PREFIX;
}
if ("http://www.w3.org/2000/09/xmldsig#".equals(namespaceUri)) {
- return "dsig";
+ return NamespacePrefix.XMLDSIG_PREFIX;
}
if ("http://www.buergerkarte.at/namespaces/securitylayer/1.2#".equals(namespaceUri)) {
- return "sl";
+ return NamespacePrefix.SL_PREFIX;
}
if ("http://www.buergerkarte.at/cardchannel".equals(namespaceUri)) {
- return "cc";
+ return NamespacePrefix.CARDCHANNEL_PREFIX;
}
if ("http://www.w3.org/2001/04/xmldsig-more#".equals(namespaceUri)) {
- return "ecdsa";
+ return NamespacePrefix.ECDSA_PREFIX;
}
if ("http://reference.e-government.gv.at/namespace/persondata/20020228#".equals(namespaceUri)) {
- return "pr";
+ return NamespacePrefix.PERSONDATA_PREFIX;
}
if ("urn:oasis:names:tc:SAML:1.0:assertion".equals(namespaceUri)) {
- return "saml";
+ return NamespacePrefix.SAML10_PREFIX;
}
if ("http://uri.etsi.org/01903/v1.1.1#".equals(namespaceUri)) {
- return "xades";
+ return NamespacePrefix.XADES_PREFIX;
}
return suggestion;
diff --git a/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java b/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java
index d2a7fb30..14c5ba48 100644
--- a/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java
+++ b/utils/src/main/java/at/gv/egiz/slbinding/RedirectEventFilter.java
@@ -1,19 +1,19 @@
/*
-* Copyright 2008 Federal Chancellery Austria and
-* Graz University of Technology
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*/
+ * Copyright 2008 Federal Chancellery Austria and
+ * Graz University of Technology
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
@@ -33,79 +33,84 @@ import javax.xml.stream.events.XMLEvent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+/*
+ * TODO: don't set redirect stream from caller (caller does not know whether redirection will be triggered)
+ * rather create on trigger and pass to caller
+ */
public class RedirectEventFilter implements EventFilter {
- public static final String DEFAULT_ENCODING = "UTF-8";
- private static Log log = LogFactory.getLog(RedirectEventFilter.class);
- protected XMLEventWriter redirectWriter = null;
- protected Set redirectTriggers = null;
- private int depth = -1;
- protected NamespaceContext currentNamespaceContext = null;
+ public static final String DEFAULT_ENCODING = "UTF-8";
+ private static Log log = LogFactory.getLog(RedirectEventFilter.class);
+ protected XMLEventWriter redirectWriter = null;
+ protected Set redirectTriggers = null;
+ private int depth = -1;
+ protected NamespaceContext currentNamespaceContext = null;
- /**
- * Event redirection is disabled, set a redirect stream to enable.
- */
- public RedirectEventFilter() {
- redirectWriter = null;
- // redirectTriggers = null;
- }
+ /**
+ * Event redirection is disabled, set a redirect stream to enable.
+ */
+ public RedirectEventFilter() {
+ redirectWriter = null;
+ // redirectTriggers = null;
+ }
- /**
- *
- * @param redirectStream
- * if null, no events are redirected
- * @param redirectTriggers
- * if null, all events are redirected
- */
- public RedirectEventFilter(OutputStream redirectStream, String encoding)
- throws XMLStreamException { // , List redirectTriggers
- if (redirectStream != null) {
- XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
- if (encoding == null) {
- encoding = DEFAULT_ENCODING;
- }
- this.redirectWriter = outputFactory.createXMLEventWriter(redirectStream,
+ /**
+ *
+ * @param redirectStream
+ * if null, no events are redirected
+ * @param redirectTriggers
+ * if null, all events are redirected
+ */
+ public RedirectEventFilter(OutputStream redirectStream, String encoding)
+ throws XMLStreamException { // , List redirectTriggers
+ if (redirectStream != null) {
+ XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+ if (encoding == null) {
+ encoding = DEFAULT_ENCODING;
+ }
+ this.redirectWriter = outputFactory.createXMLEventWriter(redirectStream,
encoding);
- }
- // this.redirectTriggers = redirectTriggers;
}
+ // this.redirectTriggers = redirectTriggers;
+ }
- /**
- * All startElement events occuring in the redirectTriggers list will trigger
- * redirection of the entire (sub-)fragment.
- *
- * @param event
- * @return false if an event is redirected
- */
- @Override
- public boolean accept(XMLEvent event) {
- int eventType = event.getEventType();
+ /**
+ * All startElement events occuring in the redirectTriggers list will trigger
+ * redirection of the entire (sub-)fragment.
+ *
+ * @param event
+ * @return false if an event is redirected
+ */
+ @Override
+ public boolean accept(XMLEvent event) {
+ int eventType = event.getEventType();
- if (eventType == XMLStreamConstants.START_ELEMENT) {
- currentNamespaceContext = event.asStartElement().getNamespaceContext();
- }
- if (redirectWriter == null) {
- return true;
- }
- if (eventType == XMLStreamConstants.START_ELEMENT) {
- if (depth >= 0 || triggersRedirect(event.asStartElement().getName())) {
- depth++;
- }
- } else if (eventType == XMLStreamConstants.END_ELEMENT) {
- if (depth >= 0 && --depth < 0) {
- // redirect the end element of the trigger,
- // but do not redirect the end element of the calling type
- if (redirectTriggers != null) {
- redirectEvent(event);
- return false;
- }
- }
- }
- if (depth >= 0) { //|| (depth == 0 && redirectTriggers == null)) {
- redirectEvent(event);
- return false;
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ //hopefully, this is a copy
+ currentNamespaceContext = event.asStartElement().getNamespaceContext();
+ }
+ if (redirectWriter == null) {
+ return true;
+ }
+ if (eventType == XMLStreamConstants.START_ELEMENT) {
+ if (depth >= 0 || triggersRedirect(event.asStartElement().getName())) {
+ depth++;
+ }
+ } else if (eventType == XMLStreamConstants.END_ELEMENT) {
+ if (depth >= 0 && --depth < 0) {
+ // redirect the end element of the trigger,
+ // but do not redirect the end element of the calling type
+ if (redirectTriggers != null) {
+ redirectEvent(event);
+ return false;
}
- return true; // depth < 0;
+ }
+ }
+ if (depth >= 0) { //|| (depth == 0 && redirectTriggers == null)) {
+ redirectEvent(event);
+ return false;
+ }
+ return true; // depth < 0;
// switch (event.getEventType()) {
// case XMLStreamConstants.START_ELEMENT:
@@ -132,128 +137,130 @@ public class RedirectEventFilter implements EventFilter {
// return false;
// }
// return true; // depth < 0;
- }
+ }
- /**
- * @param startElt
- * @return true if the set of triggers contains startElement
- * (or no triggers are registered, i.e. everything is redirected)
- */
- private boolean triggersRedirect(QName startElement) {
- if (redirectTriggers != null) {
- return redirectTriggers.contains(startElement);
- }
- return true;
+ /**
+ * @param startElt
+ * @return true if the set of triggers contains startElement
+ * (or no triggers are registered, i.e. everything is redirected)
+ */
+ private boolean triggersRedirect(QName startElement) {
+ if (redirectTriggers != null) {
+ return redirectTriggers.contains(startElement);
}
+ return true;
+ }
- private void redirectEvent(XMLEvent event) {
- try {
- if (log.isTraceEnabled()) {
- log.trace("redirecting StAX event " + event);
- }
- redirectWriter.add(event);
- } catch (XMLStreamException ex) {
- ex.printStackTrace();
- }
+ private void redirectEvent(XMLEvent event) {
+ try {
+ if (log.isTraceEnabled()) {
+ log.trace("redirecting StAX event " + event);
+ }
+ redirectWriter.add(event);
+ } catch (XMLStreamException ex) {
+ ex.printStackTrace();
}
+ }
- /**
- * Enable/disable redirection of all events from now on.
- * The redirected events will be UTF-8 encoded and written to the stream.
- *
- * @param redirectstream
- * if null, redirection is disabled
- */
- public void setRedirectStream(OutputStream redirectStream) throws XMLStreamException {
- setRedirectStream(redirectStream, DEFAULT_ENCODING, null);
- }
+ /**
+ * Enable/disable redirection of all events from now on.
+ * The redirected events will be UTF-8 encoded and written to the stream.
+ *
+ * @param redirectstream
+ * if null, redirection is disabled
+ */
+ public void setRedirectStream(OutputStream redirectStream) throws XMLStreamException {
+ setRedirectStream(redirectStream, DEFAULT_ENCODING, null);
+ }
- /**
- * Enable/disable redirection of all events from now on.
- *
- * @param redirectStream if null, redirection is disabled
- * @param encoding The encoding for the redirect stream
- * @throws javax.xml.stream.XMLStreamException
- */
- public void setRedirectStream(OutputStream redirectStream, String encoding) throws XMLStreamException {
- setRedirectStream(redirectStream, encoding, null);
- }
+ /**
+ * Enable/disable redirection of all events from now on.
+ *
+ * @param redirectStream if null, redirection is disabled
+ * @param encoding The encoding for the redirect stream
+ * @throws javax.xml.stream.XMLStreamException
+ */
+ public void setRedirectStream(OutputStream redirectStream, String encoding) throws XMLStreamException {
+ setRedirectStream(redirectStream, encoding, null);
+ }
- /**
- * Enable/disable redirection of all (child) elements contained in redirect triggers.
- * The redirected events will be UTF-8 encoded and written to the stream.
- *
- * @param redirectstream
- * if null, redirection is disabled
- * @param redirectTriggers elements that trigger the redirection
- */
- public void setRedirectStream(OutputStream redirectStream, Set redirectTriggers) throws XMLStreamException {
- setRedirectStream(redirectStream, DEFAULT_ENCODING, redirectTriggers);
- }
+ /**
+ * Enable/disable redirection of all (child) elements contained in redirect triggers.
+ * The redirected events will be UTF-8 encoded and written to the stream.
+ *
+ * @param redirectstream
+ * if null, redirection is disabled
+ * @param redirectTriggers elements that trigger the redirection
+ */
+ public void setRedirectStream(OutputStream redirectStream, Set redirectTriggers) throws XMLStreamException {
+ setRedirectStream(redirectStream, DEFAULT_ENCODING, redirectTriggers);
+ }
- /**
- * Enable/disable redirection of all (child) elements contained in redirect triggers.
- *
- * @param redirectstream
- * if null, redirection is disabled
- * @param encoding The encoding for the redirect stream
- * @param redirectTriggers elements that trigger the redirection
- */
- public void setRedirectStream(OutputStream redirectStream, String encoding, Set redirectTriggers) throws XMLStreamException {
- if (redirectStream != null) {
- XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
- if (encoding == null) {
- encoding = DEFAULT_ENCODING;
- }
- redirectWriter = outputFactory.createXMLEventWriter(redirectStream,
+ /**
+ * Enable/disable redirection of all (child) elements contained in redirect triggers.
+ *
+ * TODO: don't set redirect stream from caller (caller does not know whether redirection will be triggered)
+ * rather create on trigger and pass to caller
+ * @param redirectstream
+ * if null, redirection is disabled
+ * @param encoding The encoding for the redirect stream
+ * @param redirectTriggers elements that trigger the redirection
+ */
+ public void setRedirectStream(OutputStream redirectStream, String encoding, Set redirectTriggers) throws XMLStreamException {
+ if (redirectStream != null) {
+ XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+ if (encoding == null) {
+ encoding = DEFAULT_ENCODING;
+ }
+ redirectWriter = outputFactory.createXMLEventWriter(redirectStream,
encoding);
- if (redirectTriggers == null) {
- // start redirecting
- depth = 0;
- }
- this.redirectTriggers = redirectTriggers;
- } else {
- redirectWriter = null;
- this.redirectTriggers = null;
- }
+ if (redirectTriggers == null) {
+ // start redirecting
+ depth = 0;
+ }
+ this.redirectTriggers = redirectTriggers;
+ } else {
+ redirectWriter = null;
+ this.redirectTriggers = null;
}
+ }
- /**
- * Enable/disable redirection of fragments (defined by elements in
- * redirectTriggers)
- *
- * @param redirectStream
- * if null, redirection is disabled
- * @param redirectTriggers
- * All startElement events occuring in this list will trigger
- * redirection of the entire fragment. If null, all events are
- * redirected
- */
- // public void setRedirectStream(OutputStream redirectStream, List
- // redirectTriggers) throws XMLStreamException {
- // if (redirectStream != null) {
- // XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
- // redirectWriter = outputFactory.createXMLEventWriter(redirectStream);
- // } else {
- // redirectWriter = null;
- // }
- // this.redirectTriggers = (redirectStream == null) ? null : redirectTriggers;
- // }
- /**
- * flushes the internal EventWriter
- *
- * @throws javax.xml.stream.XMLStreamException
- */
- public void flushRedirectStream() throws XMLStreamException {
- redirectWriter.flush();
- }
+ /**
+ * Enable/disable redirection of fragments (defined by elements in
+ * redirectTriggers)
+ *
+ * @param redirectStream
+ * if null, redirection is disabled
+ * @param redirectTriggers
+ * All startElement events occuring in this list will trigger
+ * redirection of the entire fragment. If null, all events are
+ * redirected
+ */
+ // public void setRedirectStream(OutputStream redirectStream, List
+ // redirectTriggers) throws XMLStreamException {
+ // if (redirectStream != null) {
+ // XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
+ // redirectWriter = outputFactory.createXMLEventWriter(redirectStream);
+ // } else {
+ // redirectWriter = null;
+ // }
+ // this.redirectTriggers = (redirectStream == null) ? null : redirectTriggers;
+ // }
+ /**
+ * flushes the internal EventWriter
+ *
+ * @throws javax.xml.stream.XMLStreamException
+ */
+ public void flushRedirectStream() throws XMLStreamException {
+ redirectWriter.flush();
+ }
- /**
- * the namespaceContext of the last startelement event read
- *
- * @return
- */
- public NamespaceContext getCurrentNamespaceContext() {
- return currentNamespaceContext;
- }
+ /**
+ * the namespaceContext of the last startelement event read
+ *
+ * @return
+ */
+ public NamespaceContext getCurrentNamespaceContext() {
+ return currentNamespaceContext;
+ }
}
diff --git a/utils/src/main/java/at/gv/egiz/slbinding/impl/TransformsInfoType.java b/utils/src/main/java/at/gv/egiz/slbinding/impl/TransformsInfoType.java
index b4e988f0..1180e9fa 100644
--- a/utils/src/main/java/at/gv/egiz/slbinding/impl/TransformsInfoType.java
+++ b/utils/src/main/java/at/gv/egiz/slbinding/impl/TransformsInfoType.java
@@ -25,6 +25,7 @@ import java.io.ByteArrayOutputStream;
import java.util.HashSet;
import java.util.Set;
import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.namespace.NamespaceContext;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLStreamException;
import org.apache.commons.logging.Log;
diff --git a/utils/src/main/java/at/gv/egiz/slbinding/impl/XMLContentType.java b/utils/src/main/java/at/gv/egiz/slbinding/impl/XMLContentType.java
index c32542aa..eb147f88 100644
--- a/utils/src/main/java/at/gv/egiz/slbinding/impl/XMLContentType.java
+++ b/utils/src/main/java/at/gv/egiz/slbinding/impl/XMLContentType.java
@@ -35,7 +35,7 @@ import org.apache.commons.logging.LogFactory;
public class XMLContentType extends at.buergerkarte.namespaces.securitylayer._1.XMLContentType implements RedirectCallback {
@XmlTransient
- private static Log log = LogFactory.getLog(TransformsInfoType.class);
+ private static Log log = LogFactory.getLog(XMLContentType.class);
@XmlTransient
protected ByteArrayOutputStream redirectOS = null;
diff --git a/utils/src/main/java/org/w3/_2000/_09/xmldsig_/ObjectFactory.java b/utils/src/main/java/org/w3/_2000/_09/xmldsig_/ObjectFactory.java
index 4ab376f1..fae77451 100644
--- a/utils/src/main/java/org/w3/_2000/_09/xmldsig_/ObjectFactory.java
+++ b/utils/src/main/java/org/w3/_2000/_09/xmldsig_/ObjectFactory.java
@@ -167,6 +167,7 @@ public class ObjectFactory {
*
*/
public TransformType createTransformType() {
+// return new at.gv.egiz.slbinding.impl.TransformType();
return new TransformType();
}
diff --git a/utils/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java b/utils/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java
index 584baf80..c7044c4c 100644
--- a/utils/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java
+++ b/utils/src/main/java/org/w3/_2000/_09/xmldsig_/TransformsType.java
@@ -57,7 +57,7 @@ import javax.xml.bind.annotation.XmlType;
})
public class TransformsType {
- @XmlElement(name = "Transform", required = true)
+ @XmlElement(name = "Transform", required = true) //, type=at.gv.egiz.slbinding.impl.TransformType.class)
protected List transform;
/**
diff --git a/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java b/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java
index 99d353ac..7c8c206a 100644
--- a/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java
+++ b/utils/src/test/java/at/gv/egiz/slbinding/RedirectTest.java
@@ -52,6 +52,8 @@ import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import static org.junit.Assert.*;
+import org.w3._2000._09.xmldsig_.TransformType;
+import org.w3._2000._09.xmldsig_.TransformsType;
/**
*
@@ -131,11 +133,34 @@ public class RedirectTest {
Iterator tiIt = transformsInfos.iterator();
while (tiIt.hasNext()) {
at.gv.egiz.slbinding.impl.TransformsInfoType ti = (at.gv.egiz.slbinding.impl.TransformsInfoType) tiIt.next();
+// TransformsInfoType ti = tiIt.next();
assertNotNull(ti);
- System.out.println("found at.gv.egiz.slbinding.impl.TransformsInfoType TransformsInfo");
+ System.out.println("found sl:TransformsInfo: " + ti.getClass().getName()); //at.gv.egiz.slbinding.impl.TransformsInfoType TransformsInfo");
+// TransformsType ts = ti.getTransforms();
+// assertNotNull(ts);
+// System.out.println("found dsig:Transforms " + ts.getClass().getName()); //org.w3._2000._09.xmldsig_.TransformsType dsig:Transforms");
+// List tL = ts.getTransform();
+// assertNotNull(tL);
+// System.out.println("found " + tL.size() + " org.w3._2000._09.xmldsig_.TransformType dsig:Transform");
+// for (TransformType t : tL) {
+// if (t instanceof at.gv.egiz.slbinding.impl.TransformType) {
+// System.out.println("found at.gv.egiz.slbinding.impl.TransformType");
+// byte[] redirectedBytes = ((at.gv.egiz.slbinding.impl.TransformType) t).getRedirectedStream().toByteArray();
+// if (redirectedBytes != null && redirectedBytes.length > 0) {
+// System.out.println("reading redirected stream...");
+// os.write("--- redirected Transform ---".getBytes());
+// os.write(redirectedBytes);
+// os.write("\n".getBytes());
+// } else {
+// System.out.println("no redirected stream");
+// }
+// }
+// }
+
ByteArrayOutputStream dsigTransforms = ti.getRedirectedStream();
+ os.write("--- redirected TransformsInfo content ---".getBytes());
os.write(dsigTransforms.toByteArray());
- os.write("\n".getBytes());
+ os.write("\n---".getBytes());
MetaInfoType mi = ti.getFinalDataMetaInfo();
assertNotNull(mi);
diff --git a/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt b/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt
index 31be50b7..fc0e4f14 100644
--- a/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt
+++ b/utils/src/test/requests/CreateXMLSignatureRequest02.xml_redirect.txt
@@ -1,4 +1,4 @@
-
+--- redirected TransformsInfo content ---
@@ -82,7 +82,7 @@
-
+------ redirected TransformsInfo content ---
@@ -162,3 +162,4 @@
+---
\ No newline at end of file
--
cgit v1.2.3
From 4387153c6f65b55d576e1890c5b582237227369e Mon Sep 17 00:00:00 2001
From: clemenso
Date: Fri, 27 Feb 2009 18:10:57 +0000
Subject: 1.1-rc2
git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@310 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4
---
.../main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java | 18 ++
.../java/at/gv/egiz/bku/gui/PINManagementGUI.java | 73 +++++---
.../at/gv/egiz/bku/gui/PINManagementGUIFacade.java | 3 +-
.../java/at/gv/egiz/bku/gui/PINStatusRenderer.java | 2 +-
.../bku/online/applet/PINManagementBKUWorker.java | 5 +-
.../smccstal/ext/PINManagementRequestHandler.java | 105 ++++++-----
.../gv/egiz/bku/gui/ActivationMessages.properties | 1 +
.../egiz/bku/gui/ActivationMessages_en.properties | 13 +-
.../main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 4 +
.../main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java | 198 ++++++++++++---------
.../stal/service/impl/STALRequestBrokerImpl.java | 4 -
BKUOnline/src/main/webapp/PINManagement.jsp | 79 ++++++++
BKUOnline/src/main/webapp/SLRequestForm.html | 155 ++++++++++++++++
BKUOnline/src/main/webapp/css/applet.css | 1 -
BKUOnline/src/main/webapp/css/main.css | 48 +++++
BKUOnline/src/main/webapp/index.html | 57 ++----
BKUOnline/src/main/webapp/slRequestForm.html | 154 ----------------
STAL/src/main/java/at/gv/egiz/stal/STAL.java | 2 +-
.../bku/binding/BindingProcessorManagerImpl.java | 2 +-
.../at/gv/egiz/bku/smccstal/AbstractBKUWorker.java | 4 +-
.../at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java | 18 +-
21 files changed, 572 insertions(+), 374 deletions(-)
create mode 100644 BKUOnline/src/main/webapp/PINManagement.jsp
create mode 100644 BKUOnline/src/main/webapp/SLRequestForm.html
create mode 100644 BKUOnline/src/main/webapp/css/main.css
delete mode 100644 BKUOnline/src/main/webapp/slRequestForm.html
(limited to 'BKUCommonGUI')
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java
index 4059f0e2..ac9ab78b 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java
@@ -40,6 +40,12 @@ public class CardMgmtGUI extends BKUGUIImpl {
AbstractHelpListener helpListener) {
super(contentPane, locale, guiStyle, backgroundImgURL, helpListener);
+ }
+
+ @Override
+ protected void loadMessageBundle(Locale locale) {
+ super.loadMessageBundle(locale);
+
if (locale != null) {
Locale lang = new Locale(locale.getLanguage().substring(0,2));
log.debug("loading applet resources for language: " + lang.toString());
@@ -47,6 +53,18 @@ public class CardMgmtGUI extends BKUGUIImpl {
} else {
cardmgmtMessages = ResourceBundle.getBundle(CARDMGMT_MESSAGES_BUNDLE);
}
+ }
+
+ @Override
+ protected String getMessage(String key) {
+ if (super.hasMessage(key)) {
+ return super.getMessage(key);
+ }
+ return cardmgmtMessages.getString(key);
+ }
+ @Override
+ protected boolean hasMessage(String key) {
+ return (cardmgmtMessages.containsKey(key) || super.hasMessage(key));
}
}
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java
index 8eef8aea..1276f2d0 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java
@@ -39,13 +39,17 @@ import javax.swing.ListSelectionModel;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
/**
* TODO pull out ResourceBundle to common superclass for activationGUI and pinMgmtGUI
* @author Clemens Orthacker
*/
-public class PINManagementGUI extends ActivationGUI implements PINManagementGUIFacade {
+public class PINManagementGUI extends CardMgmtGUI implements PINManagementGUIFacade {
+ protected static final Log log = LogFactory.getLog(PINManagementGUI.class);
+
/** remember the pinfield to return to worker */
protected JPasswordField oldPinField;
/** remember the pinSpec to return to worker */
@@ -70,7 +74,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
}
@Override
- public PINSpec getSelectedPIN() {
+ public PINSpec getSelectedPINSpec() {
return pinSpec;
}
@@ -100,11 +104,11 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (renderHeaderPanel) {
- titleLabel.setText(cardmgmtMessages.getString(TITLE_PINMGMT));
- String infoPattern = cardmgmtMessages.getString(MESSAGE_PINMGMT);
+ titleLabel.setText(getMessage(TITLE_PINMGMT));
+ String infoPattern = getMessage(MESSAGE_PINMGMT);
mgmtLabel.setText(MessageFormat.format(infoPattern, pins.size()));
} else {
- mgmtLabel.setText(cardmgmtMessages.getString(TITLE_PINMGMT));
+ mgmtLabel.setText(getMessage(TITLE_PINMGMT));
}
final PINStatusTableModel tableModel = new PINStatusTableModel(pins);
@@ -146,19 +150,19 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
STATUS status = (STATUS) tableModel.getValueAt(selectionIdx, 1);
if (status == STATUS.NOT_ACTIV) {
- activateButton.setText(cardmgmtMessages.getString(BUTTON_ACTIVATE));
+ activateButton.setText(getMessage(BUTTON_ACTIVATE));
activateButton.setEnabled(true);
activateButton.setActionCommand(activateCmd);
} else if (status == STATUS.BLOCKED) {
- activateButton.setText(cardmgmtMessages.getString(BUTTON_UNBLOCK));
+ activateButton.setText(getMessage(BUTTON_UNBLOCK));
activateButton.setEnabled(true);
activateButton.setActionCommand(unblockCmd);
} else if (status == STATUS.ACTIV) {
- activateButton.setText(cardmgmtMessages.getString(BUTTON_CHANGE));
+ activateButton.setText(getMessage(BUTTON_CHANGE));
activateButton.setEnabled(true);
activateButton.setActionCommand(changeCmd);
} else {
- activateButton.setText(cardmgmtMessages.getString(BUTTON_ACTIVATE));
+ activateButton.setText(getMessage(BUTTON_ACTIVATE));
activateButton.setEnabled(false);
}
}
@@ -200,7 +204,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
JButton cancelButton = new JButton();
cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setText(getMessage(BUTTON_CLOSE));
cancelButton.setActionCommand(cancelCmd);
cancelButton.addActionListener(cancelListener);
@@ -266,27 +270,27 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
mgmtLabel.setFont(mgmtLabel.getFont().deriveFont(mgmtLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (renderHeaderPanel) {
- titleLabel.setText(cardmgmtMessages.getString(TITLE));
- String mgmtPattern = cardmgmtMessages.getString(MESSAGE_MGMT);
+ titleLabel.setText(getMessage(TITLE));
+ String mgmtPattern = getMessage(MESSAGE_MGMT);
if (shortText) {
mgmtLabel.setText(MessageFormat.format(mgmtPattern, "PIN"));
} else {
mgmtLabel.setText(MessageFormat.format(mgmtPattern, pinSpec.getLocalizedName()));
}
} else {
- mgmtLabel.setText(cardmgmtMessages.getString(TITLE));
+ mgmtLabel.setText(getMessage(TITLE));
}
JButton okButton = new JButton();
okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- okButton.setText(messages.getString(BUTTON_OK));
+ okButton.setText(getMessage(BUTTON_OK));
okButton.setEnabled(false);
okButton.setActionCommand(okCommand);
okButton.addActionListener(okListener);
JLabel pinLabel = new JLabel();
pinLabel.setFont(pinLabel.getFont().deriveFont(pinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String pinLabelPattern = (changePin) ? cardmgmtMessages.getString(LABEL_NEW_PIN) : messages.getString(LABEL_PIN);
+ String pinLabelPattern = (changePin) ? getMessage(LABEL_NEW_PIN) : getMessage(LABEL_PIN);
pinLabel.setText(MessageFormat.format(pinLabelPattern, new Object[]{pinSpec.getLocalizedName()}));
final JPasswordField repeatPinField = new JPasswordField();
@@ -305,7 +309,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
});
JLabel repeatPinLabel = new JLabel();
repeatPinLabel.setFont(pinLabel.getFont());
- String repeatPinLabelPattern = cardmgmtMessages.getString(LABEL_REPEAT_PIN);
+ String repeatPinLabelPattern = getMessage(LABEL_REPEAT_PIN);
repeatPinLabel.setText(MessageFormat.format(repeatPinLabelPattern, new Object[]{pinSpec.getLocalizedName()}));
repeatPinField.setText("");
@@ -325,7 +329,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
if (changePin) {
oldPinLabel = new JLabel();
oldPinLabel.setFont(oldPinLabel.getFont().deriveFont(oldPinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String oldPinLabelPattern = cardmgmtMessages.getString(LABEL_OLD_PIN);
+ String oldPinLabelPattern = getMessage(LABEL_OLD_PIN);
oldPinLabel.setText(MessageFormat.format(oldPinLabelPattern, new Object[]{pinSpec.getLocalizedName()}));
oldPinField = new JPasswordField();
@@ -345,7 +349,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
JLabel pinsizeLabel = new JLabel();
pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
- String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinsizePattern = getMessage(LABEL_PINSIZE);
String pinSize = String.valueOf(pinSpec.getMinLength());
if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
pinSize += "-" + pinSpec.getMaxLength();
@@ -468,7 +472,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
JButton cancelButton = new JButton();
cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
cancelButton.setActionCommand(cancelCommand);
cancelButton.addActionListener(cancelListener);
@@ -522,12 +526,12 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
buttonPanel.removeAll();
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_ERROR));
+ titleLabel.setText(getMessage(TITLE_ERROR));
}
helpListener.setHelpTopic(HELP_PINMGMT);
- String errorMsgPattern = cardmgmtMessages.getString(ERR_UNBLOCK);
+ String errorMsgPattern = getMessage(ERR_UNBLOCK);
String errorMsg = MessageFormat.format(errorMsgPattern, pin.getLocalizedName());
JLabel errorMsgLabel = new JLabel();
@@ -543,7 +547,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
if (!renderHeaderPanel) {
JLabel errorTitleLabel = new JLabel();
errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
- errorTitleLabel.setText(messages.getString(TITLE_ERROR));
+ errorTitleLabel.setText(getMessage(TITLE_ERROR));
errorTitleLabel.setForeground(ERROR_COLOR);
mainHorizontal
@@ -564,7 +568,7 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
JButton okButton = new JButton();
okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- okButton.setText(messages.getString(BUTTON_OK));
+ okButton.setText(getMessage(BUTTON_OK));
okButton.setActionCommand(cancelCommand);
okButton.addActionListener(cancelListener);
@@ -584,5 +588,28 @@ public class PINManagementGUI extends ActivationGUI implements PINManagementGUIF
});
}
+ @Override
+ protected int initButtonSize() {
+ int bs = super.initButtonSize();
+ JButton b = new JButton();
+ b.setText(getMessage(BUTTON_ACTIVATE));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_CHANGE));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_UNBLOCK));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_CANCEL));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+
+ return bs;
+ }
}
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java
index 2a8f28d2..ffdc230d 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java
@@ -43,6 +43,7 @@ public interface PINManagementGUIFacade extends BKUGUIFacade {
public static final String ERR_ACTIVATE = "err.activate";
public static final String ERR_CHANGE = "err.change";
public static final String ERR_UNBLOCK = "err.unblock";
+ public static final String ERR_RETRIES = "err.retries";
public static final String BUTTON_ACTIVATE = "button.activate";
public static final String BUTTON_UNBLOCK = "button.unblock";
@@ -73,5 +74,5 @@ public interface PINManagementGUIFacade extends BKUGUIFacade {
public char[] getOldPin();
- public PINSpec getSelectedPIN();
+ public PINSpec getSelectedPINSpec();
}
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java
index 2f8852ff..4cb84b77 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java
@@ -31,7 +31,7 @@ import org.apache.commons.logging.LogFactory;
*/
public class PINStatusRenderer extends DefaultTableCellRenderer {
- private static final Log log = LogFactory.getLog(PINStatusRenderer.class);
+// private static final Log log = LogFactory.getLog(PINStatusRenderer.class);
public static final Color RED = new Color(0.9f, 0.0f, 0.0f);
public static final Color GREEN = new Color(0.0f, 0.8f, 0.0f);
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java
index ffd83e42..85892026 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/PINManagementBKUWorker.java
@@ -25,8 +25,6 @@ import at.gv.egiz.stal.ext.PINManagementRequest;
import at.gv.egiz.stal.ext.PINManagementResponse;
import java.util.Collections;
import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
/**
* This BKU Worker does not connect to STAL webservice
@@ -52,8 +50,9 @@ public class PINManagementBKUWorker extends AppletBKUWorker {
if (responses.size() == 1) {
STALResponse response = responses.get(0);
if (response instanceof PINManagementResponse) {
- log.debug("PIN management dialog finished");
+ log.debug("PIN management dialog terminated");
} else if (response instanceof ErrorResponse) {
+ log.debug("PIN management dialog terminated with error");
showErrorDialog(BKUGUIFacade.ERR_UNKNOWN, null);
} else {
throw new RuntimeException("Invalid STAL response: " + response.getClass().getName());
diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/PINManagementRequestHandler.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/PINManagementRequestHandler.java
index fcef3191..851bff21 100644
--- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/PINManagementRequestHandler.java
+++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/PINManagementRequestHandler.java
@@ -22,6 +22,7 @@ import at.gv.egiz.bku.gui.PINManagementGUIFacade.STATUS;
import at.gv.egiz.bku.smccstal.AbstractRequestHandler;
import at.gv.egiz.smcc.PINSpec;
import at.gv.egiz.smcc.SignatureCardException;
+import at.gv.egiz.smcc.VerificationFailedException;
import at.gv.egiz.smcc.util.SMCCHelper;
import at.gv.egiz.stal.ErrorResponse;
import at.gv.egiz.stal.STALRequest;
@@ -31,6 +32,8 @@ import at.gv.egiz.stal.ext.PINManagementResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import javax.smartcardio.Card;
import javax.smartcardio.CardChannel;
import javax.smartcardio.CardException;
@@ -45,7 +48,6 @@ import org.apache.commons.logging.LogFactory;
*/
public class PINManagementRequestHandler extends AbstractRequestHandler {
- public static final String ERR_NOPIN_SELECTED = "err.no.pin.selected";
protected static final Log log = LogFactory.getLog(PINManagementRequestHandler.class);
// protected ResourceBundle messages;
@@ -70,7 +72,7 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
} else if ("back".equals(actionCommand)) {
showPINManagementDialog(gui);
} else {
- PINSpec selectedPIN = gui.getSelectedPIN();
+ PINSpec selectedPIN = gui.getSelectedPINSpec();
if (selectedPIN == null) {
throw new RuntimeException("no PIN selected for activation/change");
@@ -99,6 +101,11 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
byte[] pin = encodePIN(gui.getPin()); //new byte[]{(byte) 0x25, (byte) 0x40};
changePIN(selectedPIN.getKID(), selectedPIN.getContextAID(), oldPin, pin);
showPINManagementDialog(gui);
+ } catch (VerificationFailedException ex) {
+ log.error("failed to change " + selectedPIN.getLocalizedName() + ": " + ex.getMessage());
+ gui.showErrorDialog(PINManagementGUIFacade.ERR_RETRIES,
+ new Object[] {selectedPIN.getLocalizedName(), ex.getRetries()},
+ this, "back");
} catch (SignatureCardException ex) {
log.error("failed to change " + selectedPIN.getLocalizedName() + ": " + ex.getMessage());
gui.showErrorDialog(PINManagementGUIFacade.ERR_CHANGE,
@@ -132,8 +139,8 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
* @throws at.gv.egiz.smcc.SignatureCardException
*/
private void activatePIN(byte kid, byte[] contextAID, byte[] pin) throws SignatureCardException {
+ Card icc = card.getCard();
try {
- Card icc = card.getCard();
icc.beginExclusive();
CardChannel channel = icc.getBasicChannel();
@@ -141,6 +148,7 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
CommandAPDU selectAPDU = new CommandAPDU(0x00, 0xa4, 0x04, 0x0c, contextAID);
ResponseAPDU responseAPDU = channel.transmit(selectAPDU);
if (responseAPDU.getSW() != 0x9000) {
+ icc.endExclusive();
String msg = "Failed to activate PIN " + SMCCHelper.toString(new byte[]{kid}) +
": Failed to select AID " + SMCCHelper.toString(contextAID) +
": " + SMCCHelper.toString(responseAPDU.getBytes());
@@ -150,8 +158,9 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
}
if (pin.length > 7) {
- log.error("Invalid PIN");
- throw new SignatureCardException("Invalid PIN");
+ icc.endExclusive();
+ log.error("PIN too long");
+ throw new SignatureCardException("PIN too long");
}
byte length = (byte) (0x20 | pin.length * 2);
@@ -166,24 +175,27 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
ResponseAPDU responseAPDU = channel.transmit(verifyAPDU);
if (responseAPDU.getSW() != 0x9000) {
+ icc.endExclusive();
String msg = "Failed to activate PIN " + SMCCHelper.toString(new byte[]{kid}) + ": " + SMCCHelper.toString(responseAPDU.getBytes());
log.error(msg);
throw new SignatureCardException(msg);
}
-
-
icc.endExclusive();
-
-
} catch (CardException ex) {
- log.error("Failed to get PIN status: " + ex.getMessage());
- throw new SignatureCardException("Failed to get PIN status", ex);
+ log.error("Failed to activate PIN: " + ex.getMessage());
+ throw new SignatureCardException(ex.getMessage(), ex);
+ } finally {
+ try {
+ icc.endExclusive();
+ } catch (CardException ex) {
+ log.trace("failed to end exclusive card access");
+ }
}
}
- private void changePIN(byte kid, byte[] contextAID, byte[] oldPIN, byte[] newPIN) throws SignatureCardException {
+ private void changePIN(byte kid, byte[] contextAID, byte[] oldPIN, byte[] newPIN) throws SignatureCardException, VerificationFailedException {
+ Card icc = card.getCard();
try {
- Card icc = card.getCard();
icc.beginExclusive();
CardChannel channel = icc.getBasicChannel();
@@ -191,6 +203,7 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
CommandAPDU selectAPDU = new CommandAPDU(0x00, 0xa4, 0x04, 0x0c, contextAID);
ResponseAPDU responseAPDU = channel.transmit(selectAPDU);
if (responseAPDU.getSW() != 0x9000) {
+ icc.endExclusive();
String msg = "Failed to change PIN " + SMCCHelper.toString(new byte[]{kid}) +
": Failed to select AID " + SMCCHelper.toString(contextAID) +
": " + SMCCHelper.toString(responseAPDU.getBytes());
@@ -200,8 +213,9 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
}
if (oldPIN.length > 7 || newPIN.length > 7) {
- log.error("Invalid PIN");
- throw new SignatureCardException("Invalid PIN");
+ icc.endExclusive();
+ log.error("PIN too long");
+ throw new SignatureCardException("PIN too long");
}
byte oldLength = (byte) (0x20 | oldPIN.length * 2);
byte newLength = (byte) (0x20 | newPIN.length * 2);
@@ -220,49 +234,43 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
CommandAPDU verifyAPDU = new CommandAPDU(apdu);
ResponseAPDU responseAPDU = channel.transmit(verifyAPDU);
+ if (responseAPDU.getSW1() == 0x63 && responseAPDU.getSW2() >> 4 == 0xc) {
+ icc.endExclusive();
+ int retries = responseAPDU.getSW2() & 0x0f;
+ log.error("Wrong PIN, " + retries + " tries left");
+ throw new VerificationFailedException(retries);
+ }
if (responseAPDU.getSW() != 0x9000) {
- String msg = "Failed to change PIN " + SMCCHelper.toString(new byte[]{kid}) + ": " + SMCCHelper.toString(responseAPDU.getBytes());
+ icc.endExclusive();
+ String msg = "Failed to change PIN "
+ + SMCCHelper.toString(new byte[]{kid}) + ": "
+ + SMCCHelper.toString(responseAPDU.getBytes());
log.error(msg);
throw new SignatureCardException(msg);
}
-
-
- icc.endExclusive();
-
+
} catch (CardException ex) {
- log.error("Failed to get PIN status: " + ex.getMessage());
- throw new SignatureCardException("Failed to get PIN status", ex);
+ log.error("Failed to change PIN: " + ex.getMessage());
+ throw new SignatureCardException(ex.getMessage(), ex);
+ } finally {
+ try {
+ icc.endExclusive();
+ } catch (CardException ex) {
+ log.trace("failed to end exclusive card access");
+ }
}
}
public Map getPINStatuses() throws SignatureCardException {
+ Card icc = card.getCard();
try {
- Card icc = card.getCard();
icc.beginExclusive();
CardChannel channel = icc.getBasicChannel();
HashMap pinStatuses = new HashMap();
List pins = card.getPINSpecs();
- //select DF_SichereSignatur 00 A4 04 0C 08 D0 40 00 00 17 00 12 01
-// CommandAPDU selectAPDU = new CommandAPDU(new byte[]{(byte) 0x00, (byte) 0xa4, (byte) 0x04, (byte) 0x0c, (byte) 0x08,
-// (byte) 0xd0, (byte) 0x40, (byte) 0x00, (byte) 0x00, (byte) 0x17, (byte) 0x00, (byte) 0x12, (byte) 0x01});
-// ResponseAPDU rAPDU = channel.transmit(selectAPDU);
-// log.debug("SELECT FILE DF_SichereSignatur: " + SMCCHelper.toString(rAPDU.getBytes()));
-
- //select DF_SIG DF 70
-// CommandAPDU selectAPDU = new CommandAPDU(new byte[]{(byte) 0x00, (byte) 0xa4, (byte) 0x00, (byte) 0x0c, (byte) 0x02,
-// (byte) 0xdf, (byte) 0x70 });
-// ResponseAPDU rAPDU = channel.transmit(selectAPDU);
-// log.debug("SELECT FILE DF_SIG: " + SMCCHelper.toString(rAPDU.getBytes()));
-
- //select DF_DEC DF 71
-// CommandAPDU selectAPDU = new CommandAPDU(new byte[]{(byte) 0x00, (byte) 0xa4, (byte) 0x04, (byte) 0x0c, (byte) 0x08,
-// (byte) 0xd0, (byte) 0x40, (byte) 0x00, (byte) 0x00, (byte) 0x17, (byte) 0x00, (byte) 0x12, (byte) 0x01});
-// ResponseAPDU rAPDU = channel.transmit(selectAPDU);
-// log.debug("SELECT FILE DF_SichereSignatur: " + SMCCHelper.toString(rAPDU.getBytes()));
-
for (PINSpec pinSpec : pins) {
byte kid = pinSpec.getKID();
byte[] contextAID = pinSpec.getContextAID();
@@ -271,6 +279,7 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
CommandAPDU selectAPDU = new CommandAPDU(0x00, 0xa4, 0x04, 0x0c, contextAID);
ResponseAPDU responseAPDU = channel.transmit(selectAPDU);
if (responseAPDU.getSW() != 0x9000) {
+ icc.endExclusive();
String msg = "Failed to activate PIN " + SMCCHelper.toString(new byte[]{kid}) +
": Failed to select AID " + SMCCHelper.toString(contextAID) +
": " + SMCCHelper.toString(responseAPDU.getBytes());
@@ -296,13 +305,19 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
pinStatuses.put(pinSpec, status);
}
- icc.endExclusive();
+// icc.endExclusive();
return pinStatuses;
} catch (CardException ex) {
log.error("Failed to get PIN status: " + ex.getMessage());
- throw new SignatureCardException("Failed to get PIN status", ex);
+ throw new SignatureCardException(ex.getMessage(), ex);
+ } finally {
+ try {
+ icc.endExclusive();
+ } catch (CardException ex) {
+ log.trace("failed to end exclusive card access");
+ }
}
}
@@ -312,7 +327,7 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
for (int i = 0; i < length; i++) {
pin[i] = (byte) (16*Character.digit(pinChars[i*2], 16) + Character.digit(pinChars[i*2+1], 16));
}
- log.trace("***** " + SMCCHelper.toString(pin) + " ******");
+// log.trace("***** " + SMCCHelper.toString(pin) + " ******");
return pin;
}
@@ -324,7 +339,7 @@ public class PINManagementRequestHandler extends AbstractRequestHandler {
this, "cancel");
} catch (SignatureCardException ex) {
gui.showErrorDialog(BKUGUIFacade.ERR_UNKNOWN_WITH_PARAM,
- new Object[]{"FAILED TO GET PIN STATUSES: " + ex.getMessage()},
+ new Object[]{ex.getMessage()},
this, "cancel");
}
}
diff --git a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties b/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties
index e51044af..b6099db6 100644
--- a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties
+++ b/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties
@@ -41,6 +41,7 @@ help.pin.mgmt=help.pin.mgmt
err.activate=Beim Aktivieren der {0} trat ein Fehler auf.
err.change=Beim \u00C4ndern der {0} trat ein Fehler auf.
err.unblock=Das Entsperren der {0} wird nicht unterst\u00FCtzt.
+err.retries=Falscher {0}, noch {1} Versuche
status.not.active=NICHT AKTIV
status.active=AKTIV
diff --git a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties b/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties
index 1cf4a102..40332826 100644
--- a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties
+++ b/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties
@@ -38,11 +38,12 @@ button.unblock=Unblock
help.activation=help.activation
help.pin.mgmt=help.pin.mgmt
-err.activate=An error occured during activation of {0}.
-err.change=An error occured during changing of {0}.
+err.activate=An error occured during the activation of {0}.
+err.change=An error occured during the changing of {0}.
err.unblock=Unblocking of {0} is not supported.
+err.retries=Wrong {0}, {1} tries remaining
-status.not.active=Not active
-status.active=Active
-status.blocked=Blocked
-status.unknown=Unknown
+status.not.active=NOT ACTIVE
+status.active=ACTIVE
+status.blocked=BLOCKED
+status.unknown=UNKNOWN
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
index 6fd29ba9..ae91670a 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java
@@ -97,6 +97,10 @@ public interface BKUGUIFacade {
// public void init(Container contentPane, Locale locale, Style guiStyle, URL background, ActionListener helpListener);
+ /**
+ * BKUWorker needs to init signature card with locale
+ * @return
+ */
public Locale getLocale();
public void showWelcomeDialog();
diff --git a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
index 1d5a2cf4..ca597701 100644
--- a/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
+++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIImpl.java
@@ -115,13 +115,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
ActionListener helpListener) {
this.contentPane = contentPane;
- if (locale != null) {
- Locale lang = new Locale(locale.getLanguage().substring(0,2));
- log.debug("loading applet resources for language: " + lang.toString());
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, lang);
- } else {
- messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
- }
+ loadMessageBundle(locale);
if (guiStyle == Style.advanced) {
renderHeaderPanel = true;
@@ -230,11 +224,11 @@ public class BKUGUIImpl implements BKUGUIFacade {
helpLabel = new JLabel();
helpLabel.setIcon(new ImageIcon(getClass().getResource(HELP_IMG)));
- helpLabel.getAccessibleContext().setAccessibleName(messages.getString(ALT_HELP));
+ helpLabel.getAccessibleContext().setAccessibleName(getMessage(ALT_HELP));
helpLabel.addMouseListener(helpListener);
helpLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
- buttonSize = initButtonSize(messages, renderCancelButton);
+ buttonSize = initButtonSize();
if (renderHeaderPanel) {
headerPanel = new JPanel();
@@ -292,11 +286,33 @@ public class BKUGUIImpl implements BKUGUIFacade {
contentPanelLayout.setVerticalGroup(verticalContent);
}
+ /**
+ * BKUWorker inits signaturecard with locale
+ * @return
+ */
@Override
public Locale getLocale() {
return messages.getLocale();
}
+ /**
+ * to be overridden by subclasses providing additional resource messages
+ * @param key
+ * @return
+ */
+ protected String getMessage(String key) {
+ return messages.getString(key);
+ }
+
+ /**
+ * to be overridden by subclasses providing additional resource messages
+ * @param key
+ * @return
+ */
+ protected boolean hasMessage(String key) {
+ return messages.containsKey(key);
+ }
+
@Override
public void showWelcomeDialog() {
@@ -318,10 +334,10 @@ public class BKUGUIImpl implements BKUGUIFacade {
welcomeMsgLabel.setFont(welcomeMsgLabel.getFont().deriveFont(welcomeMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_WELCOME));
- welcomeMsgLabel.setText(messages.getString(MESSAGE_WAIT));
+ titleLabel.setText(getMessage(TITLE_WELCOME));
+ welcomeMsgLabel.setText(getMessage(MESSAGE_WAIT));
} else {
- welcomeMsgLabel.setText(messages.getString(TITLE_WELCOME));
+ welcomeMsgLabel.setText(getMessage(TITLE_WELCOME));
}
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
@@ -364,14 +380,14 @@ public class BKUGUIImpl implements BKUGUIFacade {
buttonPanel.removeAll();
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_INSERTCARD));
+ titleLabel.setText(getMessage(TITLE_INSERTCARD));
}
helpListener.setHelpTopic(HELP_INSERTCARD);
JLabel insertCardMsgLabel = new JLabel();
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- insertCardMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
+ insertCardMsgLabel.setText(getMessage(MESSAGE_INSERTCARD));
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
mainPanel.setLayout(mainPanelLayout);
@@ -395,7 +411,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (renderCancelButton) {
JButton cancelButton = new JButton();
cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
cancelButton.addActionListener(cancelListener);
cancelButton.setActionCommand(cancelCommand);
@@ -440,10 +456,10 @@ public class BKUGUIImpl implements BKUGUIFacade {
insertCardMsgLabel.setFont(insertCardMsgLabel.getFont().deriveFont(insertCardMsgLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
- insertCardMsgLabel.setText(messages.getString(MESSAGE_INSERTCARD));
+ titleLabel.setText(getMessage(TITLE_CARD_NOT_SUPPORTED));
+ insertCardMsgLabel.setText(getMessage(MESSAGE_INSERTCARD));
} else {
- insertCardMsgLabel.setText(messages.getString(TITLE_CARD_NOT_SUPPORTED));
+ insertCardMsgLabel.setText(getMessage(TITLE_CARD_NOT_SUPPORTED));
}
helpListener.setHelpTopic(HELP_CARDNOTSUPPORTED);
@@ -469,7 +485,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (renderCancelButton) {
JButton cancelButton = new JButton();
cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
cancelButton.addActionListener(cancelListener);
cancelButton.setActionCommand(cancelCommand);
@@ -506,23 +522,23 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (renderHeaderPanel) {
if (numRetries < 0) {
- String cardpinTitle = messages.getString(TITLE_CARDPIN);
+ String cardpinTitle = getMessage(TITLE_CARDPIN);
titleLabel.setText(MessageFormat.format(cardpinTitle, new Object[]{pinSpec.getLocalizedName()}));
} else {
- titleLabel.setText(messages.getString(TITLE_RETRY));
+ titleLabel.setText(getMessage(TITLE_RETRY));
}
}
JButton okButton = new JButton();
okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- okButton.setText(messages.getString(BUTTON_OK));
+ okButton.setText(getMessage(BUTTON_OK));
okButton.setEnabled(false);
okButton.setActionCommand(okCommand);
okButton.addActionListener(okListener);
JLabel cardPinLabel = new JLabel();
cardPinLabel.setFont(cardPinLabel.getFont().deriveFont(cardPinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String pinLabel = messages.getString(LABEL_PIN);
+ String pinLabel = getMessage(LABEL_PIN);
cardPinLabel.setText(MessageFormat.format(pinLabel, new Object[]{pinSpec.getLocalizedName()}));
pinField = new JPasswordField();
@@ -542,7 +558,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
JLabel infoLabel = new JLabel();
if (numRetries < 0) {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String infoPattern = messages.getString(MESSAGE_ENTERPIN);
+ String infoPattern = getMessage(MESSAGE_ENTERPIN);
if (shortText) {
infoLabel.setText(MessageFormat.format(infoPattern, new Object[] {"PIN"}));
} else {
@@ -552,9 +568,9 @@ public class BKUGUIImpl implements BKUGUIFacade {
} else {
String retryPattern;
if (numRetries < 2) {
- retryPattern = messages.getString(MESSAGE_LAST_RETRY);
+ retryPattern = getMessage(MESSAGE_LAST_RETRY);
} else {
- retryPattern = messages.getString(MESSAGE_RETRIES);
+ retryPattern = getMessage(MESSAGE_RETRIES);
}
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
infoLabel.setText(MessageFormat.format(retryPattern, new Object[]{String.valueOf(numRetries)}));
@@ -564,7 +580,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
JLabel pinsizeLabel = new JLabel();
pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
- String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinsizePattern = getMessage(LABEL_PINSIZE);
String pinSize = String.valueOf(pinSpec.getMinLength());
if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
pinSize += "-" + pinSpec.getMaxLength();
@@ -638,7 +654,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (renderCancelButton) {
JButton cancelButton = new JButton();
cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
cancelButton.setActionCommand(cancelCommand);
cancelButton.addActionListener(cancelListener);
@@ -699,22 +715,22 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (renderHeaderPanel) {
if (numRetries < 0) {
- titleLabel.setText(messages.getString(TITLE_SIGN));
+ titleLabel.setText(getMessage(TITLE_SIGN));
} else {
- titleLabel.setText(messages.getString(TITLE_RETRY));
+ titleLabel.setText(getMessage(TITLE_RETRY));
}
}
JButton signButton = new JButton();
signButton.setFont(signButton.getFont().deriveFont(signButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- signButton.setText(messages.getString(BUTTON_SIGN));
+ signButton.setText(getMessage(BUTTON_SIGN));
signButton.setEnabled(false);
signButton.setActionCommand(signCommand);
signButton.addActionListener(signListener);
JLabel signPinLabel = new JLabel();
signPinLabel.setFont(signPinLabel.getFont().deriveFont(signPinLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String pinLabel = messages.getString(LABEL_PIN);
+ String pinLabel = getMessage(LABEL_PIN);
signPinLabel.setText(MessageFormat.format(pinLabel, new Object[]{pinSpec.getLocalizedName()}));
pinField = new JPasswordField();
@@ -733,7 +749,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
JLabel pinsizeLabel = new JLabel();
pinsizeLabel.setFont(pinsizeLabel.getFont().deriveFont(pinsizeLabel.getFont().getStyle() & ~java.awt.Font.BOLD, pinsizeLabel.getFont().getSize()-2));
- String pinsizePattern = messages.getString(LABEL_PINSIZE);
+ String pinsizePattern = getMessage(LABEL_PINSIZE);
String pinSize = String.valueOf(pinSpec.getMinLength());
if (pinSpec.getMinLength() != pinSpec.getMaxLength()) {
pinSize += "-" + pinSpec.getMaxLength();
@@ -744,9 +760,9 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (numRetries < 0) {
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
if (shortText) {
- infoLabel.setText(messages.getString(MESSAGE_HASHDATALINK_TINY));
+ infoLabel.setText(getMessage(MESSAGE_HASHDATALINK_TINY));
} else {
- infoLabel.setText(messages.getString(MESSAGE_HASHDATALINK));
+ infoLabel.setText(getMessage(MESSAGE_HASHDATALINK));
}
infoLabel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
infoLabel.setForeground(HYPERLINK_COLOR);
@@ -762,9 +778,9 @@ public class BKUGUIImpl implements BKUGUIFacade {
} else {
String retryPattern;
if (numRetries < 2) {
- retryPattern = messages.getString(MESSAGE_LAST_RETRY);
+ retryPattern = getMessage(MESSAGE_LAST_RETRY);
} else {
- retryPattern = messages.getString(MESSAGE_RETRIES);
+ retryPattern = getMessage(MESSAGE_RETRIES);
}
infoLabel.setText(MessageFormat.format(retryPattern, new Object[]{String.valueOf(numRetries)}));
infoLabel.setFont(infoLabel.getFont().deriveFont(infoLabel.getFont().getStyle() | java.awt.Font.BOLD));
@@ -839,7 +855,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (renderCancelButton) {
JButton cancelButton = new JButton();
cancelButton.setFont(cancelButton.getFont().deriveFont(cancelButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- cancelButton.setText(messages.getString(BUTTON_CANCEL));
+ cancelButton.setText(getMessage(BUTTON_CANCEL));
cancelButton.setActionCommand(cancelCommand);
cancelButton.addActionListener(cancelListener);
@@ -881,12 +897,12 @@ public class BKUGUIImpl implements BKUGUIFacade {
buttonPanel.removeAll();
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_ERROR));
+ titleLabel.setText(getMessage(TITLE_ERROR));
}
helpListener.setHelpTopic(errorMsgKey);
- String errorMsgPattern = messages.getString(errorMsgKey);
+ String errorMsgPattern = getMessage(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
JLabel errorMsgLabel = new JLabel();
@@ -902,7 +918,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (!renderHeaderPanel) {
JLabel errorTitleLabel = new JLabel();
errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
- errorTitleLabel.setText(messages.getString(TITLE_ERROR));
+ errorTitleLabel.setText(getMessage(TITLE_ERROR));
errorTitleLabel.setForeground(ERROR_COLOR);
mainHorizontal
@@ -923,7 +939,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
JButton okButton = new JButton();
okButton.setFont(okButton.getFont().deriveFont(okButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- okButton.setText(messages.getString(BUTTON_OK));
+ okButton.setText(getMessage(BUTTON_OK));
okButton.setActionCommand(okCommand);
okButton.addActionListener(okListener);
@@ -959,12 +975,12 @@ public class BKUGUIImpl implements BKUGUIFacade {
buttonPanel.removeAll();
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_ERROR));
+ titleLabel.setText(getMessage(TITLE_ERROR));
}
helpListener.setHelpTopic(errorMsgKey);
- String errorMsgPattern = messages.getString(errorMsgKey);
+ String errorMsgPattern = getMessage(errorMsgKey);
String errorMsg = MessageFormat.format(errorMsgPattern, errorMsgParams);
JLabel errorMsgLabel = new JLabel();
@@ -981,7 +997,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (!renderHeaderPanel) {
JLabel errorTitleLabel = new JLabel();
errorTitleLabel.setFont(errorTitleLabel.getFont().deriveFont(errorTitleLabel.getFont().getStyle() | java.awt.Font.BOLD));
- errorTitleLabel.setText(messages.getString(TITLE_ERROR));
+ errorTitleLabel.setText(getMessage(TITLE_ERROR));
errorTitleLabel.setForeground(ERROR_COLOR);
mainHorizontal
@@ -1021,7 +1037,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
buttonPanel.removeAll();
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_WAIT));
+ titleLabel.setText(getMessage(TITLE_WAIT));
}
helpListener.setHelpTopic(HELP_WAIT);
@@ -1031,7 +1047,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
if (waitMessage != null) {
waitMsgLabel.setText("" + waitMessage + "");
} else {
- waitMsgLabel.setText(messages.getString(MESSAGE_WAIT));
+ waitMsgLabel.setText(getMessage(MESSAGE_WAIT));
}
GroupLayout mainPanelLayout = new GroupLayout(mainPanel);
@@ -1079,7 +1095,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
final String okCommand) {
if (signedReferences == null) {
- showErrorDialog(messages.getString(ERR_NO_HASHDATA), new Object[] {"No SignedReferences provided"}, okListener, okCommand);
+ showErrorDialog(getMessage(ERR_NO_HASHDATA), new Object[] {"No SignedReferences provided"}, okListener, okCommand);
return;
}
@@ -1142,14 +1158,14 @@ public class BKUGUIImpl implements BKUGUIFacade {
buttonPanel.removeAll();
if (renderHeaderPanel) {
- titleLabel.setText(messages.getString(TITLE_HASHDATA));
+ titleLabel.setText(getMessage(TITLE_HASHDATA));
}
helpListener.setHelpTopic(HELP_HASHDATALIST);
JLabel refIdLabel = new JLabel();
refIdLabel.setFont(refIdLabel.getFont().deriveFont(refIdLabel.getFont().getStyle() & ~java.awt.Font.BOLD));
- String refIdLabelPattern = messages.getString(MESSAGE_HASHDATALIST);
+ String refIdLabelPattern = getMessage(MESSAGE_HASHDATALIST);
refIdLabel.setText(MessageFormat.format(refIdLabelPattern, new Object[]{signedReferences.size()}));
HashDataTableModel tableModel = new HashDataTableModel(signedReferences, renderRefId);
@@ -1229,7 +1245,7 @@ public class BKUGUIImpl implements BKUGUIFacade {
JButton backButton = new JButton();
backButton.setFont(backButton.getFont().deriveFont(backButton.getFont().getStyle() & ~java.awt.Font.BOLD));
- backButton.setText(messages.getString(BUTTON_BACK));
+ backButton.setText(getMessage(BUTTON_BACK));
backButton.setActionCommand(backCommand);
backButton.addActionListener(backListener);
@@ -1271,15 +1287,15 @@ public class BKUGUIImpl implements BKUGUIFacade {
fileDialog.setDialogType(JFileChooser.SAVE_DIALOG);
fileDialog.setFileHidingEnabled(true);
if (signedRefs.size() == 1) {
- fileDialog.setDialogTitle(messages.getString(WINDOWTITLE_SAVE));
+ fileDialog.setDialogTitle(getMessage(WINDOWTITLE_SAVE));
fileDialog.setFileSelectionMode(JFileChooser.FILES_ONLY);
String mimeType = signedRefs.get(0).getMimeType();
MimeFilter mimeFilter = new MimeFilter(mimeType, messages);
fileDialog.setFileFilter(mimeFilter);
- String filename = messages.getString(SAVE_HASHDATAINPUT_PREFIX) + MimeFilter.getExtension(mimeType);
+ String filename = getMessage(SAVE_HASHDATAINPUT_PREFIX) + MimeFilter.getExtension(mimeType);
fileDialog.setSelectedFile(new File(userHome, filename));
} else {
- fileDialog.setDialogTitle(messages.getString(WINDOWTITLE_SAVEDIR));
+ fileDialog.setDialogTitle(getMessage(WINDOWTITLE_SAVEDIR));
fileDialog.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
}
@@ -1292,14 +1308,14 @@ public class BKUGUIImpl implements BKUGUIFacade {
String id = hashDataInput.getReferenceId();
File file;
if (f.isDirectory()) {
- String filename = messages.getString(SAVE_HASHDATAINPUT_PREFIX) + '_' + id + MimeFilter.getExtension(mimeType);
+ String filename = getMessage(SAVE_HASHDATAINPUT_PREFIX) + '_' + id + MimeFilter.getExtension(mimeType);
file = new File(f, filename);
} else {
file = f;
}
if (file.exists()) {
- String ovrwrt = messages.getString(MESSAGE_OVERWRITE);
- int overwrite = JOptionPane.showConfirmDialog(fileDialog, MessageFormat.format(ovrwrt, file), messages.getString(WINDOWTITLE_OVERWRITE), JOptionPane.OK_CANCEL_OPTION);
+ String ovrwrt = getMessage(MESSAGE_OVERWRITE);
+ int overwrite = JOptionPane.showConfirmDialog(fileDialog, MessageFormat.format(ovrwrt, file), getMessage(WINDOWTITLE_OVERWRITE), JOptionPane.OK_CANCEL_OPTION);
if (overwrite != JOptionPane.OK_OPTION) {
continue;
}
@@ -1352,34 +1368,50 @@ public class BKUGUIImpl implements BKUGUIFacade {
});
}
}
-
- private static int initButtonSize(ResourceBundle messages, boolean renderCancelButton) {
- int buttonSize = 0;
-
- JButton b = new JButton();
- b.setText(messages.getString(BUTTON_OK));
- if (b.getPreferredSize().width > buttonSize) {
- buttonSize = b.getPreferredSize().width;
- }
- b.setText(messages.getString(BUTTON_SIGN));
- if (b.getPreferredSize().width > buttonSize) {
- buttonSize = b.getPreferredSize().width;
- }
- b.setText(messages.getString(BUTTON_BACK));
- if (b.getPreferredSize().width > buttonSize) {
- buttonSize = b.getPreferredSize().width;
- }
- b.setText(messages.getString(BUTTON_SAVE));
- if (b.getPreferredSize().width > buttonSize) {
- buttonSize = b.getPreferredSize().width;
+ /**
+ * Called from constructor.
+ * Subclasses may override this method to ensure the message bundle is loaded
+ * once initButtonSize (called from constructor as well) is called.
+ * (Only relevant if initButtonSize is overridden as well)
+ * @param locale
+ */
+ protected void loadMessageBundle(Locale locale) {
+ if (locale != null) {
+ Locale lang = new Locale(locale.getLanguage().substring(0, 2));
+ log.debug("loading applet resources for language: " + lang.toString());
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE, lang);
+ } else {
+ messages = ResourceBundle.getBundle(MESSAGES_BUNDLE);
+ }
}
- if (renderCancelButton) {
- b.setText(messages.getString(BUTTON_CANCEL));
- if (b.getPreferredSize().width > buttonSize) {
- buttonSize = b.getPreferredSize().width;
+
+ protected int initButtonSize() {
+ int bs = 0;
+
+ JButton b = new JButton();
+ b.setText(getMessage(BUTTON_OK));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_SIGN));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_BACK));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ b.setText(getMessage(BUTTON_SAVE));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
+ if (renderCancelButton) {
+ b.setText(getMessage(BUTTON_CANCEL));
+ if (b.getPreferredSize().width > bs) {
+ bs = b.getPreferredSize().width;
+ }
}
+ return bs;
}
- return buttonSize;
- }
}
diff --git a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
index 81b70b7c..9a9bd444 100644
--- a/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
+++ b/BKUOnline/src/main/java/at/gv/egiz/stal/service/impl/STALRequestBrokerImpl.java
@@ -315,10 +315,6 @@ public class STALRequestBrokerImpl implements STALRequestBroker {
}
}
- @Override
- public void setLocale(Locale locale) {
- }
-
private List> createSingleQuitRequest() {
QuitRequestType quitT = of.createQuitRequestType();
JAXBElement quit = of.createGetNextRequestResponseTypeQuitRequest(quitT);
diff --git a/BKUOnline/src/main/webapp/PINManagement.jsp b/BKUOnline/src/main/webapp/PINManagement.jsp
new file mode 100644
index 00000000..0f08f64b
--- /dev/null
+++ b/BKUOnline/src/main/webapp/PINManagement.jsp
@@ -0,0 +1,79 @@
+
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"
+ import="at.gv.egiz.org.apache.tomcat.util.http.AcceptLanguage"%>
+
+
+
+
+
+ MOCCA PIN Management
+
+
+
+
+
+
+
+
+ <%
+ String locale = request.getParameter("locale");
+ if (locale == null) {
+ String acceptLanguage = request.getHeader("Accept-Language");
+ locale = AcceptLanguage.getLocale(acceptLanguage).toString();
+ }
+ String widthP = request.getParameter("appletWidth");
+ String heightP = request.getParameter("appletHeight");
+ int width = (widthP == null) ? 295
+ : Integer.parseInt(widthP);
+ int height = (heightP == null) ? 195
+ : Integer.parseInt(heightP);
+ String guiStyle = request.getParameter("appletGuiStyle");
+ if (guiStyle == null) {
+ guiStyle = "advanced";
+ }
+ String backgroundImg = request.getParameter("appletBackground");
+ %>
+
+
+
+
diff --git a/BKUOnline/src/main/webapp/SLRequestForm.html b/BKUOnline/src/main/webapp/SLRequestForm.html
new file mode 100644
index 00000000..2aed5298
--- /dev/null
+++ b/BKUOnline/src/main/webapp/SLRequestForm.html
@@ -0,0 +1,155 @@
+
+
+
+
+ Security-Layer v1.2 Request Formular
+
+
+
+
+
+
+