diff options
39 files changed, 530 insertions, 289 deletions
diff --git a/BKUApplet/src/main/java/META-INF/MANIFEST.MF b/BKUApplet/src/main/java/META-INF/MANIFEST.MF deleted file mode 100644 index 5e949512..00000000 --- a/BKUApplet/src/main/java/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0
-Class-Path:
-
diff --git a/BKUAppletExt/pom.xml b/BKUAppletExt/pom.xml index 79fc5600..98502ab2 100644 --- a/BKUAppletExt/pom.xml +++ b/BKUAppletExt/pom.xml @@ -31,6 +31,16 @@ <artifactId>BKUApplet</artifactId> <version>1.2.2-SNAPSHOT</version> </dependency> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>BKUGuiExt</artifactId> + <version>1.2.2-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>smccSTALExt</artifactId> + <version>1.2.2-SNAPSHOT</version> + </dependency> </dependencies> <build> <plugins> diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java index 68f0cb72..cfd1e200 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java +++ b/BKUAppletExt/src/main/java/at/gv/egiz/bku/online/applet/ActivationApplet.java @@ -22,7 +22,7 @@ import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIFacade.Style; import at.gv.egiz.bku.online.applet.BKUApplet; import at.gv.egiz.bku.smccstal.AbstractSMCCSTAL; -import at.gv.egiz.bku.smccstal.ext.CardMgmtRequestHandler; +import at.gv.egiz.bku.smccstal.CardMgmtRequestHandler; import at.gv.egiz.stal.ext.APDUScriptRequest; import at.gv.egiz.stal.service.STALPortType; import at.gv.egiz.stal.service.translator.STALTranslator; 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 81b635f8..d06c2865 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 @@ -18,11 +18,16 @@ package at.gv.egiz.bku.online.applet; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.PINManagementGUIFacade; -import at.gv.egiz.bku.smccstal.ext.PINManagementRequestHandler; +import at.gv.egiz.bku.smccstal.PINManagementRequestHandler; import at.gv.egiz.stal.ErrorResponse; +import at.gv.egiz.stal.InfoboxReadRequest; +import at.gv.egiz.stal.QuitRequest; +import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; +import at.gv.egiz.stal.SignRequest; import at.gv.egiz.stal.ext.PINManagementRequest; import at.gv.egiz.stal.ext.PINManagementResponse; +import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -36,7 +41,8 @@ public class PINManagementBKUWorker extends AppletBKUWorker { public PINManagementBKUWorker(BKUApplet applet, PINManagementGUIFacade gui) { super(applet, gui); - handlerMap.clear(); + removeRequestHandler(InfoboxReadRequest.class); + removeRequestHandler(SignRequest.class); addRequestHandler(PINManagementRequest.class, new PINManagementRequestHandler()); } @@ -46,7 +52,11 @@ public class PINManagementBKUWorker extends AppletBKUWorker { BKUGUIFacade.MESSAGE_WELCOME); try { - List<STALResponse> responses = handleRequest(Collections.singletonList(new PINManagementRequest())); + + ArrayList<STALRequest> reqs = new ArrayList<STALRequest>(); + reqs.add(new PINManagementRequest()); + reqs.add(new QuitRequest()); + List<STALResponse> responses = handleRequest(reqs); if (responses.size() == 1) { STALResponse response = responses.get(0); diff --git a/BKUCommonGUI/pom.xml b/BKUCommonGUI/pom.xml index 393a5756..ef6e6692 100644 --- a/BKUCommonGUI/pom.xml +++ b/BKUCommonGUI/pom.xml @@ -7,7 +7,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>at.gv.egiz</groupId> <artifactId>BKUCommonGUI</artifactId> - <name>BKU Common GUI</name> + <name>BKU GUI</name> <version>1.2.2-SNAPSHOT</version> <dependencies> <dependency> 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 de9a91b9..2663e8bf 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 @@ -132,7 +132,7 @@ public class BKUGUIImpl implements BKUGUIFacade { log.debug("scheduling gui initialization"); - SwingUtilities.invokeAndWait(new Runnable() { + SwingUtilities.invokeLater(new Runnable() { @Override public void run() { diff --git a/BKUGuiExt/pom.xml b/BKUGuiExt/pom.xml new file mode 100644 index 00000000..87520232 --- /dev/null +++ b/BKUGuiExt/pom.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>bku</artifactId> + <groupId>at.gv.egiz</groupId> + <version>1.2.2-SNAPSHOT</version> + </parent> + <groupId>at.gv.egiz</groupId> + <artifactId>BKUGuiExt</artifactId> + <version>1.2.2-SNAPSHOT</version> + <name>BKU GUI Extension</name> + <dependencies> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>STALXService</artifactId> + <version>1.2.2-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>smccSTAL</artifactId> + <version>1.2.2-SNAPSHOT</version> + </dependency> + </dependencies> +</project> + diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java index 8134ac5f..c8927e1e 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUI.java @@ -16,6 +16,7 @@ */ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.*; import java.awt.Container; import java.awt.Cursor; import java.awt.event.ActionListener; diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java index 860a1097..3fc14d04 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/ActivationGUIFacade.java @@ -16,6 +16,7 @@ */ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.*; import java.awt.event.ActionListener; /** diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java index ac9ab78b..c8e1826c 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/CardMgmtGUI.java @@ -17,6 +17,7 @@ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.*; import java.awt.Container; import java.net.URL; import java.util.Locale; diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java index 3b77daa5..3d503510 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUI.java @@ -17,6 +17,7 @@ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.*; import at.gv.egiz.smcc.PINSpec; import java.awt.Container; import java.awt.Cursor; diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java index f99bcfd1..297173d9 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINManagementGUIFacade.java @@ -17,6 +17,7 @@ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.*; import at.gv.egiz.smcc.PINSpec; import java.awt.event.ActionListener; import java.util.Map; diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java index e3d73e1f..e3d73e1f 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINSpecRenderer.java diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java index 83ff74f2..83ff74f2 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusRenderer.java diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java index 052c13b2..052c13b2 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java +++ b/BKUGuiExt/src/main/java/at/gv/egiz/bku/gui/PINStatusTableModel.java diff --git a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties index 977d6e3a..977d6e3a 100644 --- a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties +++ b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages.properties diff --git a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties index 7f01971b..7f01971b 100644 --- a/BKUAppletExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties +++ b/BKUGuiExt/src/main/resources/at/gv/egiz/bku/gui/ActivationMessages_en.properties diff --git a/BKUAppletExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java index 95c5c678..49ae577b 100644 --- a/BKUAppletExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/ActivationGuiTest.java @@ -21,6 +21,7 @@ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.*; import java.awt.Container; import java.awt.Dimension; import javax.swing.JFrame; diff --git a/BKUAppletExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java index b01abe72..74ea8952 100644 --- a/BKUAppletExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java +++ b/BKUGuiExt/src/test/java/at/gv/egiz/bku/gui/BKUGUIWorker.java @@ -20,6 +20,7 @@ */ package at.gv.egiz.bku.gui; +import at.gv.egiz.bku.gui.*; import at.gv.egiz.smcc.PINSpec; import at.gv.egiz.stal.HashDataInput; import at.gv.egiz.stal.impl.ByteArrayHashDataInput; diff --git a/BKULocal/pom.xml b/BKULocal/pom.xml index 9704b7db..81cb3df8 100644 --- a/BKULocal/pom.xml +++ b/BKULocal/pom.xml @@ -94,6 +94,21 @@ <version>1.2.2-SNAPSHOT</version> </dependency> <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>BKUGuiExt</artifactId> + <version>1.2.2-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>smccSTALExt</artifactId> + <version>1.2.2-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>BKUViewer</artifactId> + <version>1.2.2-SNAPSHOT</version> + </dependency> + <dependency> <artifactId>BKUHelp</artifactId> <groupId>at.gv.egiz</groupId> <version>1.0</version> @@ -117,16 +132,6 @@ <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> </dependency> - <dependency> - <groupId>at.gv.egiz</groupId> - <artifactId>BKUApplet</artifactId> - <version>1.2.2-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>at.gv.egiz</groupId> - <artifactId>BKUViewer</artifactId> - <version>1.2.2-SNAPSHOT</version> - </dependency> </dependencies> <properties> diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/GUIProxy.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/GUIProxy.java new file mode 100644 index 00000000..38dd04d9 --- /dev/null +++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/gui/GUIProxy.java @@ -0,0 +1,55 @@ +/* + * 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.BKUGUIFacade; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import javax.swing.JFrame; + +/** + * + * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at> + */ +public class GUIProxy implements InvocationHandler { + + JFrame frame; + BKUGUIFacade delegate; + + static public Object newInstance(BKUGUIFacade gui, JFrame frame, Class[] interfaces) { + return java.lang.reflect.Proxy.newProxyInstance(gui.getClass().getClassLoader(), + interfaces, + new GUIProxy(gui, frame)); + } + + private GUIProxy(BKUGUIFacade delegate, JFrame frame) { + this.frame = frame; + this.delegate = delegate; + } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { + + if (method.getName().startsWith("show")) { + frame.setVisible(true); + frame.toFront(); + return method.invoke(delegate, args); + } else { //if (method.getName().startsWith("get")) { + return method.invoke(delegate, args); + } + } +} 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 deleted file mode 100644 index c724c071..00000000 --- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/BKUGuiProxy.java +++ /dev/null @@ -1,156 +0,0 @@ -package at.gv.egiz.bku.local.stal;
-
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import java.util.Locale;
-import javax.swing.JDialog;
-
-import at.gv.egiz.bku.gui.BKUGUIFacade;
-import at.gv.egiz.smcc.PINSpec;
-import at.gv.egiz.stal.HashDataInput;
-import javax.swing.JFrame;
-
-public class BKUGuiProxy implements BKUGUIFacade {
-
- private BKUGUIFacade delegate;
- private JFrame dialog;
-
- public BKUGuiProxy(JFrame dialog, BKUGUIFacade delegate) {
- this.delegate = delegate;
- this.dialog = dialog;
- }
-
- private void showDialog() {
- dialog.setVisible(true);
- dialog.setAlwaysOnTop(true);
- }
-
- @Override
- public char[] getPin() {
- return delegate.getPin();
- }
-
-// @Override
-// 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
-// public void showCardNotSupportedDialog(ActionListener cancelListener,
-// String actionCommand) {
-// showDialog();
-// delegate.showCardNotSupportedDialog(cancelListener, actionCommand);
-// }
-//
-// @Override
-// public void showCardPINDialog(PINSpec pinSpec, ActionListener okListener,
-// String okCommand, ActionListener cancelListener, String cancelCommand) {
-// showDialog();
-// delegate.showCardPINDialog(pinSpec, okListener, okCommand, cancelListener,
-// cancelCommand);
-// }
-//
- @Override
- public void showCardPINDialog(PINSpec pinSpec, int numRetries,
- ActionListener okListener, String okCommand,
- ActionListener cancelListener, String cancelCommand) {
- showDialog();
- delegate.showCardPINDialog(pinSpec, numRetries, okListener, okCommand,
- cancelListener, cancelCommand);
- }
-
- @Override
- public void showErrorDialog(String errorMsgKey, Object[] errorMsgParams, ActionListener okListener,
- String actionCommand) {
- showDialog();
- delegate.showErrorDialog(errorMsgKey, errorMsgParams, okListener, actionCommand);
- }
-
- @Override
- public void showErrorDialog(String errorMsgKey, Object[] errorMsgParams) {
- showDialog();
- delegate.showErrorDialog(errorMsgKey, errorMsgParams);
- }
-
-// @Override
-// public void showInsertCardDialog(ActionListener cancelListener,
-// String actionCommand) {
-// showDialog();
-// delegate.showInsertCardDialog(cancelListener, actionCommand);
-// }
-//
-// @Override
-// public void showSignaturePINDialog(PINSpec pinSpec,
-// ActionListener signListener, String signCommand,
-// ActionListener cancelListener, String cancelCommand,
-// ActionListener hashdataListener, String hashdataCommand) {
-// showDialog();
-// delegate.showSignaturePINDialog(pinSpec, signListener, signCommand,
-// cancelListener, cancelCommand, hashdataListener, hashdataCommand);
-// }
-//
- @Override
- public void showSignaturePINDialog(PINSpec pinSpec, int numRetries,
- ActionListener okListener, String okCommand,
- ActionListener cancelListener, String cancelCommand,
- ActionListener hashdataListener, String hashdataCommand) {
- showDialog();
- delegate.showSignaturePINDialog(pinSpec, numRetries, okListener,
- okCommand, cancelListener, cancelCommand, hashdataListener,
- hashdataCommand);
- }
-//
-// @Override
-// public void showWaitDialog(String waitMessage) {
-// showDialog();
-// delegate.showWaitDialog(waitMessage);
-// }
-//
-// @Override
-// public void showWelcomeDialog() {
-// showDialog();
-// delegate.showWelcomeDialog();
-// }
-
- @Override
- public void showSecureViewer(List<HashDataInput> signedReferences,
- ActionListener okListener,
- String okCommand) {
- showDialog();
- delegate.showSecureViewer(signedReferences, okListener, okCommand);
- }
-
- @Override
- public void showMessageDialog(String titleKey,
- String msgKey, Object[] msgParams,
- String buttonKey, ActionListener okListener, String okCommand) {
- showDialog();
- delegate.showMessageDialog(titleKey, msgKey, msgParams, buttonKey, okListener, okCommand);
- }
-
- @Override
- public void showMessageDialog(String titleKey, String msgKey, Object[] msgParams) {
- showDialog();
- delegate.showMessageDialog(titleKey, msgKey, msgParams);
- }
-
- @Override
- public void showMessageDialog(String titleKey, String msgKey) {
- showDialog();
- delegate.showMessageDialog(titleKey, msgKey);
- }
-
- @Override
- public void showPinpadSignaturePINDialog(PINSpec pinSpec, int numRetries,
- ActionListener viewerListener, String viewerCommand) {
- showDialog();
- delegate.showPinpadSignaturePINDialog(pinSpec, numRetries,
- viewerListener, viewerCommand);
- }
-}
diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalBKUWorker.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalBKUWorker.java index ca4d35d1..75f71be6 100644 --- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalBKUWorker.java +++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalBKUWorker.java @@ -18,11 +18,13 @@ package at.gv.egiz.bku.local.stal; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.smccstal.AbstractBKUWorker; +import at.gv.egiz.bku.smccstal.PINManagementRequestHandler; import at.gv.egiz.stal.QuitRequest; import at.gv.egiz.stal.STALRequest; import at.gv.egiz.stal.STALResponse; import at.gv.egiz.stal.SignRequest; +import at.gv.egiz.stal.ext.PINManagementRequest; import java.util.List; import javax.swing.JFrame; @@ -39,16 +41,18 @@ public class LocalBKUWorker extends AbstractBKUWorker { this.container = container; addRequestHandler(SignRequest.class, new LocalSignRequestHandler(new LocalSecureViewer(gui))); + addRequestHandler(PINManagementRequest.class, new PINManagementRequestHandler()); } + /** does not change container's visibility (use quit request to close) */ @Override public List<STALResponse> handleRequest(List<? extends STALRequest> requestList) { signatureCard = null; List<STALResponse> responses = super.handleRequest(requestList); - // container.setVisible(false); return responses; } + /** overrides handle quit from abstract bku worker, make container invisible */ @Override public STALResponse handleRequest(STALRequest request) { if (request instanceof QuitRequest) { diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java index 4c9554e2..712fb969 100644 --- a/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java +++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/stal/LocalSTALFactory.java @@ -24,6 +24,9 @@ import java.util.Locale; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.bku.gui.BKUGUIImpl; +import at.gv.egiz.bku.gui.PINManagementGUI; +import at.gv.egiz.bku.gui.PINManagementGUIFacade; +import at.gv.egiz.bku.local.gui.GUIProxy; import at.gv.egiz.bku.local.gui.LocalHelpListener; import at.gv.egiz.stal.STAL; import at.gv.egiz.stal.STALFactory; @@ -33,10 +36,16 @@ import javax.swing.JRootPane; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +/** + * Creates a PINManagementGUI and a LocalBKUWorker, which in turn registers + * PINManagementRequestHandler from smccSTALExt. + * The RequestHandler expects PINManagementGUIFacade, therefore BKUGUIProxy has to implement the extended GUI. + * @author clemens + */ public class LocalSTALFactory implements STALFactory { protected static final Log log = LogFactory.getLog(LocalSTALFactory.class); - protected static final Dimension PREFERRED_SIZE = new Dimension(300, 189); + protected static final Dimension PREFERRED_SIZE = new Dimension(318, 200); protected String helpURL; protected Locale locale; @@ -47,7 +56,7 @@ public class LocalSTALFactory implements STALFactory { //http://java.sun.com/docs/books/tutorial/uiswing/misc/focus.html // use undecorated JFrame instead of JWindow, // which creates an invisible owning frame and therefore cannot getFocusInWindow() - JFrame dialog = new JFrame(); + JFrame dialog = new JFrame("Bürgerkarte"); dialog.setUndecorated(true); dialog.getRootPane().setWindowDecorationStyle(JRootPane.NONE); @@ -64,12 +73,13 @@ public class LocalSTALFactory implements STALFactory { } catch (MalformedURLException ex) { log.error("failed to configure help listener: " + ex.getMessage(), ex); } - BKUGUIFacade gui = new BKUGUIImpl(dialog.getContentPane(), + PINManagementGUIFacade gui = new PINManagementGUI(dialog.getContentPane(), dialog.getLocale(), BKUGUIFacade.Style.advanced, null, helpListener); - stal = new LocalBKUWorker(new BKUGuiProxy(dialog, gui), dialog); + BKUGUIFacade proxy = (BKUGUIFacade) GUIProxy.newInstance(gui, dialog, new Class[] { PINManagementGUIFacade.class} ); + stal = new LocalBKUWorker(proxy, dialog); dialog.setPreferredSize(PREFERRED_SIZE); dialog.pack(); Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); diff --git a/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.java new file mode 100644 index 00000000..89e526ac --- /dev/null +++ b/BKULocal/src/main/java/at/gv/egiz/bku/local/webapp/PINManagementServlet.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.local.webapp; + +import at.gv.egiz.bku.local.stal.LocalSTALFactory; +import at.gv.egiz.marshal.MarshallerFactory; +import at.gv.egiz.stal.QuitRequest; +import at.gv.egiz.stal.STALRequest; +import at.gv.egiz.stal.STALResponse; +import at.gv.egiz.stal.ext.PINManagementRequest; +import at.gv.egiz.stal.ext.PINManagementResponse; +import java.io.IOException; +import java.io.PrintWriter; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import org.apache.regexp.REUtil; + +/** + * PINManagementBKUWorker for non-applet version + * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at> + */ +public class PINManagementServlet extends HttpServlet { + +// static JAXBContext stalCtx; + + /** + * Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + protected void processRequest(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + + LocalSTALFactory sf = new LocalSTALFactory(); + + ArrayList<STALRequest> stalReqs = new ArrayList<STALRequest>(); + stalReqs.add(new PINManagementRequest()); + stalReqs.add(new QuitRequest()); + + List<STALResponse> stalResps = sf.createSTAL().handleRequest(stalReqs); + + String redirect = request.getParameter("redirect"); + if (redirect != null) { + String referer = request.getHeader("Referer"); + if (referer != null) { + redirect = new URL(new URL(referer), redirect).toExternalForm(); + } + response.sendRedirect(redirect); + } else { + response.setStatus(HttpServletResponse.SC_OK); +// if (stalResps.get(0) != null) { +// PrintWriter out = response.getWriter(); +// try { +// response.setContentType("text/xml;charset=UTF-8"); +// // cannot directly marshal STALResponse, no ObjectFactory in at.gv.egiz.stal +// if (stalCtx == null) { +// stalCtx = JAXBContext.newInstance("at.gv.egiz.stal:at.gv.egiz.stal.ext"); +// } +// Marshaller m = MarshallerFactory.createMarshaller(stalCtx); +// m.marshal(stalResps.get(0), out); +// out.close(); +// } catch (JAXBException ex) { +// throw new ServletException("Failed to marshal STAL response", ex); +// } finally { +// out.close(); +// } +// } else { +// throw new ServletException("internal error"); +// } + } + + +// try { +// out.println("<html>"); +// out.println("<head>"); +// out.println("<title>Servlet PINManagementServlet</title>"); +// out.println("</head>"); +// out.println("<body>"); +// out.println("<h1>Servlet PINManagementServlet at " + request.getContextPath() + "</h1>"); +// out.println("<p>" + stalResps.size() + " responses:<ul>"); +// for (STALResponse resp : stalResps) { +// out.println(" <li>" + resp.getClass()); +// } +// Enumeration<String> headers = request.getHeaderNames(); +// out.println("</ul></p><p> headers: <ul>"); +// while (headers.hasMoreElements()) { +// String header = headers.nextElement(); +// out.println("<li> " + header + ": " + request.getHeader(header)); +// } +// Enumeration<String> params = request.getParameterNames(); +// out.println("</ul></p><p> params: <ul>"); +// while (params.hasMoreElements()) { +// String param = params.nextElement(); +// out.println("<li> " + param + ": " + request.getParameter(param)); +// } +// out.println("</ul></p></body>"); +// out.println("</html>"); +// } finally { +// out.close(); +// } + } + + // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> + /** + * Handles the HTTP <code>GET</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Handles the HTTP <code>POST</code> method. + * @param request servlet request + * @param response servlet response + * @throws ServletException if a servlet-specific error occurs + * @throws IOException if an I/O error occurs + */ + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + processRequest(request, response); + } + + /** + * Returns a short description of the servlet. + * @return a String containing servlet description + */ + @Override + public String getServletInfo() { + return "Short description"; + }// </editor-fold> +} diff --git a/BKULocal/src/main/webapp/WEB-INF/web.xml b/BKULocal/src/main/webapp/WEB-INF/web.xml index 8e696570..83f33d9e 100644 --- a/BKULocal/src/main/webapp/WEB-INF/web.xml +++ b/BKULocal/src/main/webapp/WEB-INF/web.xml @@ -40,6 +40,10 @@ <servlet-name>help</servlet-name> <jsp-file>/help.jsp</jsp-file> </servlet> + <servlet> + <servlet-name>PINManagementServlet</servlet-name> + <servlet-class>at.gv.egiz.bku.local.webapp.PINManagementServlet</servlet-class> + </servlet> <servlet-mapping> <servlet-name>BKUServlet</servlet-name> <url-pattern>/http-security-layer-request</url-pattern> @@ -53,7 +57,11 @@ <url-pattern>/help/*</url-pattern> </servlet-mapping> <!-- Begin BKU Config --> - + + <servlet-mapping> + <servlet-name>PINManagementServlet</servlet-name> + <url-pattern>/PINManagement</url-pattern> + </servlet-mapping> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> diff --git a/BKULocal/src/main/webapp/index.html b/BKULocal/src/main/webapp/index.html index 215eec80..537c154a 100644 --- a/BKULocal/src/main/webapp/index.html +++ b/BKULocal/src/main/webapp/index.html @@ -23,7 +23,12 @@ </head> <body> <h1>BKU Web Start - Willkommen</h1> - <p>Diese Seite installiert das MOCCA Zertifikat in ihrem Browser. + <div> + <p>Diese Seite installiert das MOCCA Zertifikat in ihrem Browser. In jedem weiteren Browser können sie dieses durch Aufruf <a href="https://localhost:3496/index.html">dieser Seite</a> ebenso installieren.</p> + </div> + <div> + <a href="PINManagement?redirect=./index.html">PIN Verwaltung</a> + </div> </body> </html> diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java index 23d832a2..ca40ddc0 100644 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/Launcher.java @@ -1,10 +1,10 @@ package at.gv.egiz.bku.webstart;
+import at.gv.egiz.bku.webstart.gui.AboutDialog;
import at.gv.egiz.bku.webstart.gui.BKUControllerInterface;
-import at.gv.egiz.bku.webstart.gui.TrayMenuListener;
+import at.gv.egiz.bku.webstart.gui.PINManagementInvoker;
import iaik.asn1.CodingException;
import java.io.IOException;
-import java.net.URISyntaxException;
import java.util.Locale;
import java.util.ResourceBundle;
@@ -21,8 +21,12 @@ import java.awt.PopupMenu; import java.awt.SplashScreen;
import java.awt.SystemTray;
import java.awt.TrayIcon;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
import java.net.BindException;
-import java.net.URI;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
import java.net.URL;
import java.security.GeneralSecurityException;
import java.util.jar.Attributes;
@@ -30,9 +34,10 @@ import java.util.jar.Manifest; import javax.imageio.ImageIO;
import javax.jnlp.BasicService;
import javax.jnlp.ServiceManager;
+import javax.swing.JFrame;
import org.mortbay.util.MultiException;
-public class Launcher implements BKUControllerInterface {
+public class Launcher implements BKUControllerInterface, ActionListener {
public static final String WEBAPP_RESOURCE = "BKULocal.war";
public static final String CERTIFICATES_RESOURCE = "BKUCertificates.jar";
@@ -51,23 +56,37 @@ public class Launcher implements BKUControllerInterface { public static final String ERROR_START = "tray.error.start";
public static final String ERROR_CONFIG = "tray.error.config";
public static final String ERROR_BIND = "tray.error.bind";
+ public static final String ERROR_PIN = "tray.error.pin.connect";
public static final String LABEL_SHUTDOWN = "tray.label.shutdown";
public static final String LABEL_PIN = "tray.label.pin";
public static final String LABEL_ABOUT = "tray.label.about";
public static final String TOOLTIP_DEFAULT = "tray.tooltip.default";
-
- /** local bku uri */
- public static final URI HTTPS_SECURITY_LAYER_URI;
+
+ /** action commands for tray menu */
+ public static final String SHUTDOWN_COMMAND = "shutdown";
+ public static final String PIN_COMMAND = "pin";
+ public static final String ABOUT_COMMAND = "about";
+
private static Log log = LogFactory.getLog(Launcher.class);
+ /** local bku uri */
+ public static final URL HTTP_SECURITY_LAYER_URL;
+ public static final URL HTTPS_SECURITY_LAYER_URL;
+ public static final URL PIN_MANAGEMENT_URL;
static {
- URI tmp = null;
+ URL http = null;
+ URL https = null;
+ URL pin = null;
try {
- tmp = new URI("https://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue());
- } catch (URISyntaxException ex) {
+ http = new URL("http://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3495).intValue());
+ https = new URL("https://localhost:" + Integer.getInteger(Container.HTTPS_PORT_PROPERTY, 3496).intValue());
+ pin = new URL(http, "/PINManagement");
+ } catch (MalformedURLException ex) {
log.error(ex);
} finally {
- HTTPS_SECURITY_LAYER_URI = tmp;
+ HTTP_SECURITY_LAYER_URL = http;
+ HTTPS_SECURITY_LAYER_URL = https;
+ PIN_MANAGEMENT_URL = pin;
}
}
public static final String version;
@@ -96,6 +115,8 @@ public class Launcher implements BKUControllerInterface { private BasicService basicService;
private TrayIcon trayIcon;
private ResourceBundle messages;
+ private AboutDialog aboutDialog;
+
public Launcher() {
if (log.isTraceEnabled()) {
@@ -144,7 +165,7 @@ public class Launcher implements BKUControllerInterface { }
}
- private TrayIcon initTrayIcon() { //ResourceBundle messages, BKUControllerInterface bkuHook) {
+ private TrayIcon initTrayIcon() {
if (SystemTray.isSupported()) {
try {
// get the SystemTray instance
@@ -155,21 +176,27 @@ public class Launcher implements BKUControllerInterface { : TRAYICON_RESOURCE + "32.png";
Image image = ImageIO.read(Launcher.class.getClassLoader().getResourceAsStream(iconResource));
- TrayMenuListener listener = new TrayMenuListener(this, messages, version);
PopupMenu popup = new PopupMenu();
+ MenuItem pinItem = new MenuItem(messages.getString(LABEL_PIN));
+ pinItem.addActionListener(this);
+ pinItem.setActionCommand(PIN_COMMAND);
+ popup.add(pinItem);
+
MenuItem shutdownItem = new MenuItem(messages.getString(LABEL_SHUTDOWN));
- shutdownItem.addActionListener(listener);
- shutdownItem.setActionCommand(TrayMenuListener.SHUTDOWN_COMMAND);
+ shutdownItem.addActionListener(this);
+ shutdownItem.setActionCommand(SHUTDOWN_COMMAND);
popup.add(shutdownItem);
+ popup.addSeparator();
+
MenuItem aboutItem = new MenuItem(messages.getString(LABEL_ABOUT));
- aboutItem.setActionCommand(TrayMenuListener.ABOUT_COMMAND);
- aboutItem.addActionListener(listener);
+ aboutItem.setActionCommand(ABOUT_COMMAND);
+ aboutItem.addActionListener(this);
popup.add(aboutItem);
TrayIcon ti = new TrayIcon(image, messages.getString(TOOLTIP_DEFAULT), popup);
- ti.addActionListener(listener);
+ ti.addActionListener(this);
tray.add(ti);
return ti;
} catch (AWTException ex) {
@@ -237,15 +264,15 @@ public class Launcher implements BKUControllerInterface { Desktop desktop = Desktop.getDesktop();
if (desktop.isSupported(Desktop.Action.BROWSE)) {
try {
- desktop.browse(HTTPS_SECURITY_LAYER_URI);
+ desktop.browse(HTTPS_SECURITY_LAYER_URL.toURI());
} catch (Exception ex) {
- log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URI, ex);
+ log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URL, ex);
}
} else {
- log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URI);
+ log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URL);
}
} else {
- log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URI);
+ log.error("failed to open system browser, install TLS certificate manually: " + HTTPS_SECURITY_LAYER_URL);
}
}
log.info("BKU successfully started");
@@ -276,6 +303,39 @@ public class Launcher implements BKUControllerInterface { System.exit(0);
}
+ /**
+ * Listen for TrayMenu actions (display error messages on trayIcon)
+ * @param e
+ */
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ if (SHUTDOWN_COMMAND.equals(e.getActionCommand())) {
+ log.debug("shutdown requested via tray menu");
+ this.shutDown();
+ } else if (ABOUT_COMMAND.equals(e.getActionCommand())) {
+ log.debug("about dialog requested via tray menu");
+ if (aboutDialog == null) {
+ aboutDialog = new AboutDialog(new JFrame(), true, version);
+ aboutDialog.addWindowListener(new WindowAdapter() {
+
+ @Override
+ public void windowClosing(java.awt.event.WindowEvent e) {
+ aboutDialog.setVisible(false);
+ }
+ });
+ }
+ aboutDialog.setLocationByPlatform(true);
+ aboutDialog.setVisible(true);
+ } else if (PIN_COMMAND.equals(e.getActionCommand())) {
+ log.debug("pin management dialog requested via tray menu");
+
+ new Thread(new PINManagementInvoker(trayIcon, messages)).start();
+
+ } else {
+ log.error("unknown tray menu command: " + e.getActionCommand());
+ }
+ }
+
public static void main(String[] args) throws InterruptedException, IOException {
try {
Launcher launcher = new Launcher();
diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/PINManagementInvoker.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/PINManagementInvoker.java new file mode 100644 index 00000000..55e26313 --- /dev/null +++ b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/PINManagementInvoker.java @@ -0,0 +1,71 @@ +/* + * 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.webstart.gui; + +import at.gv.egiz.bku.webstart.Launcher; +import java.awt.TrayIcon; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.util.ResourceBundle; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +/** + * GUI is painted using SwingUtilities.invokeLater, but TrayIcon ActionListener Thread (== webstart thread) joined Jetty Thread + * + * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at> + */ +public class PINManagementInvoker implements Runnable { + + private static final Log log = LogFactory.getLog(PINManagementInvoker.class); + + TrayIcon trayIcon; + ResourceBundle messages; + + public PINManagementInvoker(TrayIcon trayIcon, ResourceBundle messages) { + this.trayIcon = trayIcon; + this.messages = messages; + } + + @Override + public void run() { + HttpURLConnection connection = null; + try { + log.debug("Connecting to: " + Launcher.PIN_MANAGEMENT_URL); + + connection = (HttpURLConnection) Launcher.PIN_MANAGEMENT_URL.openConnection(); + + connection.setRequestMethod("GET"); + connection.setReadTimeout(0); + connection.connect(); + + if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { + log.debug("pin management dialog returned"); + } else { + log.error("unexpected response from pin management: " + connection.getResponseMessage()); + } + } catch (IOException ex) { + log.error("Failed to connect to PIN Management", ex); + trayIcon.displayMessage(messages.getString(Launcher.CAPTION_ERROR), + messages.getString(Launcher.ERROR_PIN), TrayIcon.MessageType.ERROR); + } finally { + if (connection != null) { + connection.disconnect(); + } + } + } +} diff --git a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/TrayMenuListener.java b/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/TrayMenuListener.java deleted file mode 100644 index 1e5efe8e..00000000 --- a/BKUWebStart/src/main/java/at/gv/egiz/bku/webstart/gui/TrayMenuListener.java +++ /dev/null @@ -1,75 +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.webstart.gui; - -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.WindowAdapter; -import java.util.ResourceBundle; -import javax.swing.JFrame; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -/** - * - * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at> - */ -public class TrayMenuListener implements ActionListener { - - /** action commands for tray menu */ - public static final String SHUTDOWN_COMMAND = "shutdown"; - public static final String PIN_COMMAND = "pin"; - public static final String ABOUT_COMMAND = "about"; - - private static final Log log = LogFactory.getLog(TrayMenuListener.class); - - protected BKUControllerInterface bku; - protected ResourceBundle messages; - protected String version; - protected AboutDialog aboutDialog; - - public TrayMenuListener(BKUControllerInterface bkuHook, ResourceBundle messages, String version) { - this.messages = messages; - this.version = version; - this.bku = bkuHook; - } - - @Override - public void actionPerformed(ActionEvent e) { - if (SHUTDOWN_COMMAND.equals(e.getActionCommand())) { - log.debug("shutdown requested via tray menu"); - bku.shutDown(); - } else if (ABOUT_COMMAND.equals(e.getActionCommand())) { - log.debug("about dialog requested via tray menu"); - if (aboutDialog == null) { - aboutDialog = new AboutDialog(new JFrame(), true, version); - aboutDialog.addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(java.awt.event.WindowEvent e) { - aboutDialog.setVisible(false); - } - }); - } - aboutDialog.setLocationByPlatform(true); - aboutDialog.setVisible(true); - } else if (PIN_COMMAND.equals(e.getActionCommand())) { - log.error("not implemented yet."); - } else { - log.error("unknown tray menu command: " + e.getActionCommand()); - } - } -} diff --git a/BKUWebStart/src/main/jnlp/resources/version.xml b/BKUWebStart/src/main/jnlp/resources/version.xml index 013194a4..64a3963e 100644 --- a/BKUWebStart/src/main/jnlp/resources/version.xml +++ b/BKUWebStart/src/main/jnlp/resources/version.xml @@ -2,17 +2,17 @@ <jnlp-versions> <resource> <pattern> - <name>BKUWebStart-1.0.10.jar</name> - <version-id>1.0.10</version-id> + <name>BKUWebStart-1.0.11-SNAPSHOT.jar</name> + <version-id>1.0.11-SNAPSHOT</version-id> </pattern> - <file>BKUWebStart-1.0.10.jar</file> + <file>BKUWebStart-1.0.11-SNAPSHOT.jar</file> </resource> <resource> <pattern> - <name>utils-1.2.1.jar</name> - <version-id>1.2.1</version-id> + <name>utils-1.2.2-SNAPSHOT.jar</name> + <version-id>1.2.2-SNAPSHOT</version-id> </pattern> - <file>utils-1.2.1.jar</file> + <file>utils-1.2.2-SNAPSHOT.jar</file> </resource> <resource> <pattern> diff --git a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages.properties b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages.properties index d965f970..b6d9238e 100644 --- a/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages.properties +++ b/BKUWebStart/src/main/resources/at/gv/egiz/bku/webstart/messages.properties @@ -24,6 +24,7 @@ tray.message.shutdown=B\u00FCrgerkartenumgebung wird beendet tray.error.start=B\u00FCrgerkartenumgebung konnte nicht gestartet werden tray.error.config=Konfiguration konnte nicht initialisiert werden, B\u00FCrberkartenumgebung wird nicht gestartet tray.error.bind=Die f\u00FCr die B\u00FCrgerkartenumgebung reservierte Adresse wird bereits von einem anderen Dienst verwendet +tray.error.pin.connect=Verbindung zur PIN Verwaltung konnte nicht hergestellt werden tray.label.shutdown=Beenden tray.label.pin=PIN Verwaltung tray.label.about=\u00DCber... @@ -25,6 +25,8 @@ <module>BKUWebStart</module> <module>BKUCertificates</module> <module>BKUHelp</module> + <module>BKUGuiExt</module> + <module>smccSTALExt</module> </modules> <developers> <developer> diff --git a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java index 71f35181..d0762da9 100644 --- a/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java +++ b/smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/AbstractSMCCSTAL.java @@ -160,6 +160,11 @@ public abstract class AbstractSMCCSTAL implements STAL { handlerMap.put(id.getSimpleName(), handler); } + public void removeRequestHandler(Class<? extends STALRequest> id) { + log.debug("De-registering STAL request handler: " + id.getSimpleName()); + handlerMap.remove(id.getSimpleName()); + } + public SMCCSTALRequestHandler getRequestHandler( Class<? extends STALRequest> request) { return handlerMap.get(request.getSimpleName()); diff --git a/smccSTALExt/pom.xml b/smccSTALExt/pom.xml new file mode 100644 index 00000000..481993e1 --- /dev/null +++ b/smccSTALExt/pom.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <modelVersion>4.0.0</modelVersion> + <parent> + <artifactId>bku</artifactId> + <groupId>at.gv.egiz</groupId> + <version>1.2.2-SNAPSHOT</version> + </parent> + <groupId>at.gv.egiz</groupId> + <artifactId>smccSTALExt</artifactId> + <version>${project.parent.version}</version> + <name>smcc STAL Extension</name> + <dependencies> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>smccSTAL</artifactId> + <version>${project.parent.version}</version> + </dependency> + <dependency> + <groupId>at.gv.egiz</groupId> + <artifactId>BKUGuiExt</artifactId> + <version>${project.parent.version}</version> + </dependency> + </dependencies> +</project> + diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/CardMgmtRequestHandler.java b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/CardMgmtRequestHandler.java index 769342e7..533206b3 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/CardMgmtRequestHandler.java +++ b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/CardMgmtRequestHandler.java @@ -17,7 +17,7 @@ /** * */ -package at.gv.egiz.bku.smccstal.ext; +package at.gv.egiz.bku.smccstal; import at.gv.egiz.bku.gui.ActivationGUIFacade; import java.util.ArrayList; diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/GetPINStatusException.java b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/GetPINStatusException.java index abbe66a1..66b15887 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/GetPINStatusException.java +++ b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/GetPINStatusException.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package at.gv.egiz.bku.smccstal.ext; +package at.gv.egiz.bku.smccstal; import at.gv.egiz.smcc.SignatureCardException; diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/ManagementPINProviderFactory.java b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/ManagementPINProviderFactory.java index f54f89d4..34bcbf5c 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/ManagementPINProviderFactory.java +++ b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/ManagementPINProviderFactory.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package at.gv.egiz.bku.smccstal.ext; +package at.gv.egiz.bku.smccstal; import at.gv.egiz.bku.gui.BKUGUIFacade; import at.gv.egiz.smcc.ChangePINProvider; diff --git a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/PINManagementRequestHandler.java b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/PINManagementRequestHandler.java index e0b09d63..bfeb90b0 100644 --- a/BKUAppletExt/src/main/java/at/gv/egiz/bku/smccstal/ext/PINManagementRequestHandler.java +++ b/smccSTALExt/src/main/java/at/gv/egiz/bku/smccstal/PINManagementRequestHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package at.gv.egiz.bku.smccstal.ext; +package at.gv.egiz.bku.smccstal; import java.util.HashMap; import java.util.Map; @@ -87,6 +87,7 @@ public class PINManagementRequestHandler extends AbstractRequestHandler { waitForAction(); if ("cancel".equals(actionCommand)) { + log.debug("pin management cancel"); return new PINManagementResponse(); } else { selectedPIN = gui.getSelectedPINSpec(); |