diff options
-rw-r--r-- | BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/AppletHelpListener.java | 46 | ||||
-rw-r--r-- | BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/BKUApplet.java | 4 | ||||
-rw-r--r-- | BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java (renamed from BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java) | 29 | ||||
-rw-r--r-- | BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/BKUGUIFacade.java | 2 | ||||
-rw-r--r-- | BKUCommonGUI/src/main/resources/at/gv/egiz/bku/gui/Messages.properties | 4 | ||||
-rw-r--r-- | BKULocal/pom.xml | 119 | ||||
-rw-r--r-- | BKULocal/src/main/java/at/gv/egiz/bku/local/gui/LocalHelpListener.java | 41 | ||||
-rw-r--r-- | BKULocal/src/main/java/at/gv/egiz/bku/local/stal/SMCCSTALFactory.java | 11 | ||||
-rw-r--r-- | BKUOnline/src/main/webapp/HTTP-ohne.html | 2 | ||||
-rw-r--r-- | smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/InfoBoxReadRequestHandler.java | 7 | ||||
-rw-r--r-- | smccSTAL/src/main/java/at/gv/egiz/bku/smccstal/SignRequestHandler.java | 6 |
11 files changed, 191 insertions, 80 deletions
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/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java index f92a6963..68d61bef 100644 --- a/BKUApplet/src/main/java/at/gv/egiz/bku/online/applet/ExternalHelpListener.java +++ b/BKUCommonGUI/src/main/java/at/gv/egiz/bku/gui/AbstractHelpListener.java @@ -15,9 +15,8 @@ * limitations under the License. */ -package at.gv.egiz.bku.online.applet; +package at.gv.egiz.bku.gui; -import java.applet.AppletContext; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.net.MalformedURLException; @@ -27,24 +26,19 @@ import org.apache.commons.logging.LogFactory; /** * - * @author clemens + * @author Clemens Orthacker <clemens.orthacker@iaik.tugraz.at> */ -public class ExternalHelpListener implements ActionListener { +public abstract class AbstractHelpListener implements ActionListener { - protected final static Log log = LogFactory.getLog(ExternalHelpListener.class); - protected AppletContext ctx; + protected final static Log log = LogFactory.getLog(AbstractHelpListener.class); 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)) { + public AbstractHelpListener(URL baseURL, String locale) { + if (baseURL == null || "".equals(baseURL)) { throw new RuntimeException("no help URL provided"); } - this.ctx = ctx; - this.helpURLBase = helpURL.toString(); + this.helpURLBase = baseURL.toString(); this.locale = locale; } @@ -70,7 +64,11 @@ public class ExternalHelpListener implements ActionListener { return; } } - ctx.showDocument(helpURL, "_blank"); + 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) { @@ -80,4 +78,7 @@ public class ExternalHelpListener implements ActionListener { 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=<html>Das Web-Service ist nicht erreichbar: {0}</html> error.pcsc=<html>Java(TM) scheint keine PC/SC Schnittstelle f\u00FCr den Smartcard-Zugriff zur Verf\u00FCgung zu stellen.</html> error.cardterminal=<html>Es konnte kein Smartcard-Leser gefunden werden.<p>Entweder ist kein Leser angeschlossen oder kein PC/SC Treiber installiert.</p></html> error.unknown=<html>Leider trat ein Fehler auf: {0}</html> -error.test=<html>Fehler1 {0} - Fehler2 {1}</html>
\ No newline at end of file +error.test=<html>Fehler1 {0} - Fehler2 {1}</html> +error.card.locked=<html>B\u00FCrgerkarte ist gesperrt</html> +error.card.notactivated=<html>B\u00FCrgerkartenfunktion ist nicht aktiviert</html>
\ 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 @@ <?xml version="1.0" encoding="UTF-8"?>
-<project
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <parent> - <artifactId>bku</artifactId> - <groupId>at.gv.egiz</groupId> - <version>1.0-SNAPSHOT</version> - </parent> - <modelVersion>4.0.0</modelVersion> - <groupId>at.gv.egiz</groupId> - <artifactId>BKULocal</artifactId> - <packaging>war</packaging> - <name>BKU Local</name> - <version>1.0-SNAPSHOT</version> - <description />
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <artifactId>bku</artifactId>
+ <groupId>at.gv.egiz</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>at.gv.egiz</groupId>
+ <artifactId>BKULocal</artifactId>
+ <packaging>war</packaging>
+ <name>BKU Local</name>
+ <version>1.0-SNAPSHOT</version>
<scm>
<developerConnection>scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal</developerConnection>
<connection>scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal</connection>
<url>scm:svn:svn://svn.egovlabs.gv.at/svnroot/mocca/trunk/BKULocal</url>
- </scm> + </scm>
<build>
<plugins>
<plugin>
@@ -27,15 +24,11 @@ <version>2.0.2</version>
<configuration>
<manifest>
- <addDefaultImplementationEntries>
- true
- </addDefaultImplementationEntries>
+ <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
</manifest>
<archive>
<manifestEntries>
- <Implementation-Build>
- ${project.version}-r${buildNumber}
- </Implementation-Build>
+ <Implementation-Build>${project.version}-r${buildNumber}</Implementation-Build>
</manifestEntries>
</archive>
</configuration>
@@ -59,47 +52,47 @@ </plugin>
</plugins>
</build>
- - <dependencies> - <dependency> - <groupId>at.gv.egiz</groupId> - <artifactId>STAL</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>at.gv.egiz</groupId> - <artifactId>bkucommon</artifactId> - <version>1.0-SNAPSHOT</version> - </dependency> - <dependency> - <groupId>at.gv.egiz</groupId> - <artifactId>smcc</artifactId> - <version>1.0-SNAPSHOT</version> +
+ <dependencies>
+ <dependency>
+ <groupId>at.gv.egiz</groupId>
+ <artifactId>STAL</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>at.gv.egiz</groupId>
+ <artifactId>bkucommon</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>at.gv.egiz</groupId>
+ <artifactId>smcc</artifactId>
+ <version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
<artifactId>smccSTAL</artifactId>
<version>1.0-SNAPSHOT</version>
- </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-core</artifactId> - <version>2.5.5</version> - </dependency> - <dependency> - <groupId>javax.servlet</groupId> - <artifactId>servlet-api</artifactId> - <version>2.5</version> - <scope>provided</scope> - </dependency> - <dependency> - <groupId>org.springframework</groupId> - <artifactId>spring-web</artifactId> - <version>2.5.5</version> - </dependency> - <dependency> - <groupId>commons-logging</groupId> - <artifactId>commons-logging</artifactId> + </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-web</artifactId>
+ <version>2.5.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
</dependency>
<dependency>
<groupId>at.gv.egiz</groupId>
@@ -110,6 +103,10 @@ <groupId>at.gv.egiz</groupId>
<artifactId>BKUViewer</artifactId>
<version>1.0-SNAPSHOT</version>
- </dependency> - </dependencies> -</project>
\ No newline at end of file + </dependency>
+ </dependencies>
+
+ <properties>
+ <netbeans.hint.deploy.server>Tomcat60</netbeans.hint.deploy.server>
+ </properties>
+</project>
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 <clemens.orthacker@iaik.tugraz.at> + */ +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 { <input type="radio" name="appletGuiStyle" value="advanced">advanced </p> <p> - <label for="appletHashDataDisplay">GUI Style</label> + <label for="appletHashDataDisplay">HashData Display</label> <input type="radio" name="appletHashDataDisplay" value="external" checked="checked">external <input type="radio" name="appletHashDataDisplay" value="internal">internal </p> 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"); |